Exemple #1
0
    static void ubh(int s, int t, BS &b) {
        if (b.koed(s) || b.hasSubstitute(s) || turn(b,t).value("EncourageBug").toBool())
            return;
        turn(b,s)["EscapeButtonActivated"] = true;
        turn(b,s)["EscapeButtonCount"] = slot(b,s)["SwitchCount"];

        addFunction(turn(b,t), "AfterAttackFinished", "EscapeButton", &aaf);
    }
Exemple #2
0
    static void ubh(int s, int t, BS &b) {
        if (b.koed(s) || b.hasSubstitute(s) || b.hasWorkingAbility(s, Ability::Encourage))
            return;
        turn(b,s)["EscapeButtonActivated"] = true;
        turn(b,s)["EscapeButtonCount"] = slot(b,s)["SwitchCount"];

        addFunction(turn(b,t), "AfterAttackFinished", "EscapeButton", &aaf);
    }
Exemple #3
0
    static void m3b(int s, int t, BS &b) {
        if (!b.hasSubstitute(s) && turn(b,t)["TypeMod"].toInt() > 4 && turn(b,t)["Type"].toInt() == poke(b,s)["ItemArg"].toInt()) {
            b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
            b.eatBerry(s,false);

            turn(b,t)["Mod3Berry"] = -5;
        }
    }
Exemple #4
0
    static void m3b(int s, int t, BS &b) {
        /* Normal moves */
        if (!b.hasSubstitute(s) && turn(b,t)["Type"].toInt() == 0) {
            b.sendBerryMessage(4,s,0,t,b.poke(s).item(),turn(b,t)["Move"].toInt());
            b.eatBerry(s,false);

            turn(b,t)["Mod3Berry"] = -5;
        }
    }
    static void m3b(int s, int t, BS &b) {
        if (!b.attacking()) {
            return;
        }
        if (!b.hasSubstitute(s) && fturn(b,t).typeMod > 0 && tmove(b,t).type == poke(b,s)["ItemArg"].toInt()) {
            b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
            b.eatBerry(s,false);

            turn(b,t)["Mod3Berry"] = -5;
        }
    }
    static void m3b(int s, int t, BS &b) {
        if (!b.attacking()) {
            return;
        }
        /* We never want to activate this berry if this is consumed by Bug Bite */
        if (b.gen() >= 4 && !turn(b,s).value("BugBiter").toBool()) {
            /* Normal moves */
            if (!b.hasSubstitute(s) && tmove(b,t).type == 0) {
                b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
                b.eatBerry(s,false);

                turn(b,t)["Mod3Berry"] = -5;
            }
        }
    }
Exemple #7
0
    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")) || b.hasSubstitute(s) || tmove(b,t).attack == Move::DragonTail || tmove(b,t).attack == Move::CircleThrow)
            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;
    }
Exemple #8
0
    static void ubh(int s, int t, BS &b) {
        if (b.koed(s) || (b.hasWorkingAbility(t, Ability::Encourage) && turn(b,t).contains("EncourageBug")) || b.hasSubstitute(s))
            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;
    }