static void ubh(int s, int t, BS &b) { if (b.koed(s) || turn(b,t).value("EncourageBug").toBool() || (b.hasSubstitute(s) && !b.canBypassSub(t))) return; turn(b,s)["EscapeButtonActivated"] = true; turn(b,s)["EscapeButtonCount"] = slot(b,s)["SwitchCount"]; addFunction(turn(b,t), "AfterAttackFinished", "EscapeButton", &aaf); }
static void ubh(int s, int t, BS &b) { //Red Card does not trigger if the Pokemon is phazed with Dragon Tail/Circle Throw if (b.koed(s) || (b.hasWorkingAbility(t, Ability::SheerForce) && turn(b,t).contains("EncourageBug")) || tmove(b,t).attack == Move::DragonTail || tmove(b,t).attack == Move::CircleThrow || (b.hasSubstitute(s) && !b.canBypassSub(t))) return; addFunction(turn(b,t), "AfterAttackFinished", "RedCard", &aaf); turn(b,t)["RedCardUser"] = s; turn(b,t)["RedCardCount"] = slot(b,t)["SwitchCount"]; turn(b,t)["RedCardGiverCount"] = slot(b,s)["SwitchCount"]; return; }