本文整理汇总了C++中BS::sendItemMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::sendItemMessage方法的具体用法?C++ BS::sendItemMessage怎么用?C++ BS::sendItemMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::sendItemMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: et
static void et(int s, int, BS &b) {
if (b.poke(s).status() != Pokemon::Fine) {
return;
}
int status = poke(b,s)["ItemArg"].toInt();
if (!b.canGetStatus(s, status))
return;
if (status == Pokemon::Burnt) {
b.sendItemMessage(19,s,0);
} else {
b.sendItemMessage(19,s,1);
}
b.inflictStatus(s, status, s, status == Pokemon::Poisoned ? 15: 0, status == Pokemon::Poisoned ? 15: 0);
}
示例3: uodr
static void uodr(int s, int, BS &b) {
if (b.koed(s))
return;
b.sendItemMessage(4, s);
turn(b,s)["SurviveReason"] = true;
}
示例4: os
static void os(int s, int, BS &b) {
b.sendItemMessage(40, s, 0);
b.sendItemMessage(40, s, 1);
b.inflictStatMod(s, Attack, 2, s, false);
b.inflictConfused(s,s);
b.disposeItem(s);
}
示例5: 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);
}
}
示例6: uodr
static void uodr(int s, int t, BS &b) {
if (b.koed(s))
return;
if (turn(b,s).contains("CannotBeKoedBy") && turn(b,s)["CannotBeKoedBy"].toInt() == t && b.poke(s).lifePoints() == 1) {
b.sendItemMessage(4, s);
}
}
示例7: uss
static void uss(int s, int, BS &b) {
if (b.koed(s))
return;
b.sendItemMessage(5, s);
b.disposeItem(s);
turn(b,s)["SurviveReason"] = true;
}
示例8: 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);
}
示例9: 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);
}
}
示例10: ubh
static void ubh(int s, int t, BS &b) {
int tp = poke(b,s)["ItemArg"].toString().section('_', 0, 0).toInt();
if (!b.koed(s) && type(b,t) == tp) {
int stat = poke(b,s)["ItemArg"].toString().section('_', 1).toInt();
if (b.hasMaximalStatMod(s, stat))
return;
b.sendItemMessage(36, s, 0, t, b.poke(s).item(), stat);
b.disposeItem(s);
b.inflictStatMod(s, stat, 1, s, false);
}
}
示例11: uodr
static void uodr(int s, int t, BS &b) {
if (forbidden_moves.contains(move(b,t)))
return;
if (fturn(b,t).typeMod > 0 && !b.koed(s)) {
b.sendItemMessage(43, s);
b.disposeItem(s);
b.inflictStatMod(s, Attack, 2, s);
b.inflictStatMod(s, SpAttack, 2, s);
}
}
示例12: as
static void as(int s, int, BS &b) {
if (poke(b,s).contains("AttractedTo")) {
int seducer = poke(b,s)["AttractedTo"].toInt();
if (poke(b,seducer).contains("Attracted") && poke(b,seducer)["Attracted"].toInt() == s) {
b.sendItemMessage(7,s);
removeFunction(poke(b,s), "DetermineAttackPossible", "Attract");
poke(b,s).remove("AttractedTo");
b.disposeItem(s);
}
}
}
示例13: upa
static void upa( int s, int t, BS &b) {
if (!b.koed(t) && !b.hasWorkingAbility(t, Ability::MagicGuard)) {
b.sendItemMessage(34,s,0,t);
b.inflictDamage(t,b.poke(t).totalLifePoints()/6,s,false);
/* In VGC 2011, the one with the rugged helmet wins */
if (b.koed(t)) {
b.selfKoer() = t;
}
}
}
示例14: as
static void as(int s, int, BS &b) {
bool act = false;
for (int i = 1; i <= 7; i++) {
if (fpoke(b,s).boosts[i] < 0) {
act = true;
fpoke(b,s).boosts[i] = 0;
}
}
if (act) {
b.sendItemMessage(3,s);
b.disposeItem(s);
}
}
示例15: os
static void os(int s, int, BS &b) {
b.sendItemMessage(40, s, 0);
b.sendItemMessage(40, s, 1);
b.inflictStatMod(s, Attack, 2, s, false);
b.inflictConfused(s,s);
b.disposeItem(s);
/* in GSC cart mechanics, infinite confusion */
if (b.isConfused(s)) {
if (b.gen() == Gen::GoldSilver || b.gen() == Gen::Crystal) {
poke(b,s)["ConfusedCount"] = 255;
}
}
}