Esempio n. 1
0
    static void tp(int p, int s, BS &b) {
        if (!b.isOut(s)) {
            return;
        }

        int berry = b.poke(s).item();

        QVector<int> stats;
        for (int i = Attack; i <= Evasion; i++) {
            if (fpoke(b,s).boosts[i] < 6) {
                stats.push_back(i);
            }
        }
        if (stats.empty())
            return;

        if (!testpinch(p, s, b, 4, false))
            return;

        int stat = stats[b.randint(stats.size())];
        if (b.hasWorkingAbility(s, Ability::Contrary)) {
            b.sendBerryMessage(9,s,1,s, berry, stat);
        } else {
            b.sendBerryMessage(9,s,0,s, berry, stat);
        }
        b.inflictStatMod(s, stat, 2, s, false);
    }
Esempio n. 2
0
    static void to (int s, int, BS &b) {
        if (!testpinch(s, s, b,4))
            return;

        b.sendBerryMessage(11,s,0);
        turn(b,s)["TurnOrder"] = 3;
    }
Esempio n. 3
0
    static void btl(int s, int, BS &b) {
        if (!testpinch(s, s, b,4))
            return;

        poke(b,s)["BerryLock"] = true;
        b.sendBerryMessage(10,s,0);
    }
Esempio n. 4
0
    static void tp(int s, int, BS &b) {
        int berry = b.poke(s).item();

        if (!testpinch(s, s, b, 4))
            return;

        int stat = (b.true_rand()%5) +1;
        b.gainStatMod(s, stat, 2,false);
        b.sendBerryMessage(9,s,0,s,berry, stat);
    }
Esempio n. 5
0
    static void to (int p, int s, BS &b) {
        if (!b.isOut(p)) {
            return;
        }
        if (!testpinch(p, s, b, 4, false)) {
            return;
        }

        b.sendBerryMessage(11,s,0);
        turn(b,s)["TurnOrder"] = 3;
    }
Esempio n. 6
0
    static void tp(int s, int, BS &b) {
        if (!testpinch(s, s, b,2))
            return;

        b.sendBerryMessage(3,s,0);
        int arg = poke(b,s)["ItemArg"].toInt();
        if (arg == 10) /* oran berry */
            b.healLife(s, 10);
        else /* Sitrus Berry */
            b.healLife(s, b.poke(s).totalLifePoints()/4);
    }
Esempio n. 7
0
    static void tp(int p, int s, BS &b) {
        if (!b.isOut(s)) {
            return;
        }

        if (!testpinch(p, s, b, 4, false)) {
            return;
        }

        poke(b,s)["BerryLock"] = true;
        b.sendBerryMessage(10,s,0);
    }
Esempio n. 8
0
    static void tp(int s, int, BS &b) {
        /* The berry may change after the call to test pinch (eaten),
           so saved before. */
        int berry = b.poke(s).item();

        if (!testpinch(s, s, b,4))
            return;

        int arg = poke(b,s)["ItemArg"].toInt();
        b.sendBerryMessage(7,s,0,s,berry, arg);
        b.gainStatMod(s, arg, 1,false);
    }
Esempio n. 9
0
 static void to (int p, int s, BS &b) {
     if (!b.isOut(p)) {
         return;
     }
     if (turn(b,p).value("BugBiter").toBool()) {
         b.eatBerry(s);
         return;
     }
     if (!testpinch(p, s, b, 4, false)) {
         return;
     }
     b.sendBerryMessage(11,s,0);
     turn(b,s)["TurnOrder"] = 3;
 }
Esempio n. 10
0
    static void tp(int p, int s, BS &b) {
        if (!b.isOut(s)) {
            return;
        }

        if (!testpinch(p, s, b, 4, false)) {
            return;
        }

        if (b.gen() <= 4) {
            poke(b,s)["BerryLock"] = true;
        } else {
            poke(b,s)["Stat6BerryModifier"] = true;
        }
        b.sendBerryMessage(10,s,0);
    }
Esempio n. 11
0
    static void tp (int p, int s, BS &b) {
        if (b.koed(s))
            return;

        if (!testpinch(p, s, b, 4, true))
            return;

        b.sendBerryMessage(6,s,0);
        b.healLife(s, b.poke(s).totalLifePoints()/8);

        //Berries inflict confusion based on the hindering stat of a non-neutral Nature
        int plus = NatureInfo::StatBoosted(b.poke(s).nature());
        int minus = NatureInfo::StatHindered(b.poke(s).nature());
        if (plus != minus) {
            int arg = poke(b,s)["ItemArg"].toInt();
            if (arg == minus)
                b.inflictConfused(s,s);
        }
    }
Esempio n. 12
0
    static void tp(int p, int s, BS &b) {
        /* The berry may change after the call to test pinch (eaten),
           so saved before. */
        int berry = b.poke(s).item();

        if (!testpinch(p, s, b, 4, false))
            return;

        int arg = poke(b,p)["ItemArg"].toInt();

        if (b.isOut(s)) {
            if (b.hasWorkingAbility(s, Ability::Contrary)) {
                b.sendBerryMessage(7,s,1,s, berry, arg);
            } else {
                b.sendBerryMessage(7,s,0,s, berry, arg);
            }
            b.inflictStatMod(s, arg, 1, s, false);
        }
    }
Esempio n. 13
0
    static void tp(int p, int s, BS &b) {
        if (b.koed(s) || b.poke(s).isFull())
            return;

        if (!testpinch(p, s, b, 2, true))
            return;

        b.sendBerryMessage(3,s,0);
        int arg = poke(b,p)["ItemArg"].toInt();
        if (arg == 10) /* oran berry */
            b.healLife(s, 10);
        else /* Sitrus Berry */
        {
            if (b.gen() >= 4)
                b.healLife(s, b.poke(s).totalLifePoints()/4);
            else
                b.healLife(s, 30);
        }
    }
Esempio n. 14
0
    static void tp(int p, int s, BS &b) {
        if (!testpinch(p, s, b, 4, false))
            return;

        uas(p,s,b);
    }
Esempio n. 15
0
    static void tp(int s, int, BS &b) {
        if (!testpinch(s, s, b,4))
            return;

        uas(s,s,b);
    }