Exemple #1
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);
    }
Exemple #2
0
    static void et(int s, int, BS &b) {
        if (!b.canHeal(s))
            return;

        b.sendItemMessage(12,s);
        b.healLife(s, b.poke(s).totalLifePoints()/16);
    }
Exemple #3
0
 static void ahpc(int s, int, BS &b) {
     if (!b.koed(s) && b.poke(s).lifePercent() <= 50) {
         b.disposeItem(s);
         b.sendItemMessage(18,s,0);
         b.healLife(s, 20);
     }
 }
Exemple #4
0
    static void udi(int s, int t, BS &b) {
	if (s==t)
	    return;
	if (b.koed(s))
	    return;

	b.sendItemMessage(24, s);
	b.healLife(s, turn(b,s)["DamageInflicted"].toInt()/8);
    }
Exemple #5
0
    static void ahpc(int s, int, BS &b) {
        if (!b.canHeal(s))
            return;

        if (b.poke(s).lifePercent() <= 50) {
            b.disposeItem(s);
            b.sendItemMessage(18,s,0);
            b.healLife(s, 20);
        }
    }
    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);
        }
    }
Exemple #7
0
 static void uodr(int s, int t, BS &b) {
     if (b.koed(s))
         return;
     if (turn(b,t)["TypeMod"].toInt() <= 4)
         return;
     if (b.poke(s).isFull())
         return;
     b.eatBerry(s);
     b.sendBerryMessage(6,s,0);
     b.healLife(s, b.poke(s).totalLifePoints()/5);
 }
Exemple #8
0
    static void ti(int p, int s, BS &b) {
        if (b.poke(s).isFull()) {
            return;
        }
        b.sendBerryMessage(3,s,0);
        int arg = poke(b,p).value("ItemArg").toInt();

        if (arg == 0) {
            arg = b.poke(s).totalLifePoints();
        }

        b.healLife(s, arg);
    }
Exemple #9
0
    static void udi(int s, int t, BS &b) {
        if (s==t)
            return;

        if (!b.canHeal(s) || turn(b,s).value("EncourageBug").toBool())
            return;

        int damage = turn(b,s)["DamageInflicted"].toInt();

        if (damage > 0) {
            b.sendItemMessage(24, s);
            b.healLife(s, damage/8);
        }
    }
Exemple #10
0
 static void uodr(int s, int, BS &b) {
     if (!b.attacking()) {
         return;
     }
     if (b.attacker() == s)
         return;
     if (fturn(b,b.attacker()).typeMod <= 0)
         return;
     if (b.canHeal(s,BS::HealByItem,b.poke(s).item())) {
         b.eatBerry(s);
         b.sendBerryMessage(6,s,0);
         b.healLife(s, b.poke(s).totalLifePoints()/5);
     }
 }
Exemple #11
0
    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);
	}
    }
Exemple #12
0
    static void udi(int s, int t, BS &b) {
        if (s==t)
            return;
        if (b.koed(s) || b.hasWorkingAbility(s, Ability::Encourage))
            return;

        if (b.poke(s).lifePoints() == b.poke(s).totalLifePoints()) {
            // Don't heal if at full health already
            return;
        }

        int damage = turn(b,s)["DamageInflicted"].toInt();

        if (damage > 0) {
            b.sendItemMessage(24, s);
            b.healLife(s, damage/8);
        }
    }
Exemple #13
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);
        }
    }
Exemple #14
0
 static void et(int s, int, BS &b) {
     if (!b.poke(s).isFull()) {
         b.sendItemMessage(12,s);
         b.healLife(s, b.poke(s).totalLifePoints()/16);
     }
 }