static void et(int s, int, BS &b) { if (b.hasWorkingAbility(s, Ability::MagicGuard)) return; b.sendItemMessage(29,s,0); b.inflictDamage(s, b.poke(s).totalLifePoints()/8,s); }
static void uodr(int s, int t, BS &b) { //Magic Guard if (turn(b,t)["Category"].toInt() != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) { return; } b.eatBerry(s); b.sendBerryMessage(12,s,0,t); b.inflictDamage(t, b.poke(t).lifePoints()/8,s,false); }
static void upa( int s, int t, BS &b) { if (!b.koed(t) && !b.hasWorkingAbility(t, Ability::MagicGuard)) { b.sendItemMessage(34,s,0,t); b.inflictDamage(t,b.poke(t).totalLifePoints()/6,s,false); /* In VGC 2011, the one with the rugged helmet wins */ if (b.koed(t)) { b.selfKoer() = t; } } }
static void uodr(int s, int t, BS &b) { if (!b.attacking()) { return; } //Magic Guard if (tmove(b,t).category != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) { return; } b.eatBerry(s); b.sendBerryMessage(12,s,0,t); b.inflictDamage(t, b.poke(t).totalLife()/8,s,false); }
static void et(int s, int, BS &b) { if(b.koed(s) || b.hasWorkingAbility(s, Ability::MagicGuard)) { return; } if(b.hasType(s, Pokemon::Poison)) { if (!b.poke(s).isFull()) { b.sendItemMessage(16,s,0); b.healLife(s, b.poke(s).totalLifePoints()/16); } } else if (!b.hasType(s, Pokemon::Steel)) { b.sendItemMessage(16,s,1); b.inflictDamage(s, b.poke(s).totalLifePoints()/8,s); } }
static void atl(int s, int, BS &b) { if (turn(b,s).value("ActivateLifeOrb").toBool() && !turn(b,s).value("NoLifeOrbActivation").toBool() && !turn(b,s).value("EncourageBug").toBool() && !b.hasWorkingAbility(s, Ability::MagicGuard)) { if (b.gen() >= 5) b.sendItemMessage(21,s); b.inflictDamage(s,b.poke(s).totalLifePoints()/10,s); turn(b,s)["NoLifeOrbActivation"] = true; /* Self KO Clause */ if (b.koed(s)) { /* In VGC 2011 (gen 5), the user of the Life Orb wins instead of losing with the Self KO Clause */ if (b.gen() <= 4) b.selfKoer() = s; else b.selfKoer() = turn(b,s).value("LOTarget").toInt(); } } }
static void atl(int s, int, BS &b) { if (turn(b,s).value("ActivateLifeOrb").toBool() && !b.hasWorkingAbility(s, Ability::MagicGuard)) { //b.sendItemMessage(21,s); b.inflictDamage(s,b.poke(s).totalLifePoints()/10,s); } }