本文整理汇总了C++中BS::healLife方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::healLife方法的具体用法?C++ BS::healLife怎么用?C++ BS::healLife使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::healLife方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tp
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);
}
示例2: et
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);
}
示例3: ahpc
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);
}
}
示例4: udi
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);
}
示例5: ahpc
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);
}
}
示例6: tp
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);
}
}
示例7: uodr
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);
}
示例8: ti
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);
}
示例9: udi
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);
}
}
示例10: uodr
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);
}
}
示例11: et
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);
}
}
示例12: udi
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);
}
}
示例13: et
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);
}
}