Exemple #1
0
 static void ubh(int s, int t, BS &b) {
     if (!b.koed(s) && type(b,t) == poke(b,s)["ItemArg"].toInt()) {
         int stat;
         if (b.poke(s).item() == Item::RechargeableBattery) {
             if (b.hasMaximalStatMod(s, Attack))
                 return;
             stat = Attack;
         } else {
             if (b.hasMaximalStatMod(s, SpAttack))
                 return;
             stat = SpAttack;
         }
         b.sendItemMessage(36, s, 0, t, b.poke(s).item(), stat);
         b.disposeItem(s);
         b.inflictStatMod(s, stat, 1, s, false);
     }
 }
Exemple #2
0
 static void ubh(int s, int t, BS &b) {
     int tp = poke(b,s)["ItemArg"].toString().section('_', 0, 0).toInt();
     if (!b.koed(s) && type(b,t) == tp) {
         int stat = poke(b,s)["ItemArg"].toString().section('_', 1).toInt();
         if (b.hasMaximalStatMod(s, stat))
             return;
         b.sendItemMessage(36, s, 0, t, b.poke(s).item(), stat);
         b.disposeItem(s);
         b.inflictStatMod(s, stat, 1, s, false);
     }
 }