本文整理汇总了C++中BS::koed方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::koed方法的具体用法?C++ BS::koed怎么用?C++ BS::koed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::koed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: upa
static void upa(int s, int t, BS &b) {
if (b.koed(s) && !b.koed(t)) {
if (!b.hasWorkingAbility(t,Ability::Damp)){
b.sendAbMessage(2,0,s,t);
b.inflictPercentDamage(t,25,s,false);
}
else
b.sendAbMessage(2,1,s,t);
}
}
示例2: 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;
}
}
}
示例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: 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);
}
}
示例5: testpinch
static bool testpinch(int p, int s, BS &b, int ratio, bool activate) {
//HP Pinches activate, nothing else does if sending back
if (turn(b,s).value("SendingBack").toBool() && !activate) {
return false;
}
if (turn(b,p).value("BugBiter").toBool()) {
b.eatBerry(s);
return true;
}
//Gluttony
if (b.hasWorkingAbility(s, Ability::Gluttony))
ratio = 2;
if (!b.koed(s)) {
int lp = b.poke(s).lifePoints();
int tp = b.poke(s).totalLifePoints();
if (lp*ratio <= tp) {
//Reusing 'bool activate' in order to only affect HP berries
if (poke(b, s).value("HealBlockCount").toInt() > 0 && activate) {
b.sendMoveMessage(59,BS::HealByItem,s,Type::Psychic,s,b.poke(s).item());
return false;
}
b.eatBerry(s,s==p);
return true;
}
}
return false;
}
示例6: uodr
static void uodr(int s, int, BS &b) {
if (b.koed(s))
return;
b.sendItemMessage(4, s);
turn(b,s)["SurviveReason"] = true;
}
示例7: appl
static void appl(int p, int s, BS &b) {
if (b.koed(s))
return;
int minmove = 0;
int minPP = 100;
bool init = false;
bool zeroPP = false;
for (int i = 0; i < 4; i++) {
if (b.move(s, i) == 0) {
continue;
}
if (b.PP(s, i) == 0) {
zeroPP = true;
init = true;
minmove = i;
minPP = 0;
break;
}
if (b.PP(s, i) < minPP && (fpoke(b, s).moves[i] == b.poke(s).move(i).num() ?
b.PP(s, i) < b.poke(s).move(i).totalPP() : b.PP(s, i) < 5)) {
minmove = i;
init = true;
minPP = b.PP(s, i);
}
}
if (init && (zeroPP || turn(b,p).value("BugBiter").toBool())) {
b.eatBerry(s, s==p);
b.sendBerryMessage(2,s,0,0,0,b.move(s,minmove));
b.gainPP(s,minmove,b.gen() <= 2 ? 5 : 10);
}
}
示例8: ubh
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);
}
示例9: ubh
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);
}
示例10: 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;
}
示例11: 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);
}
示例12: uodr
static void uodr(int s, int t, BS &b) {
//Magic Guard
if (turn(b,t)["Category"].toInt() != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) {
return;
}
b.eatBerry(s);
b.sendBerryMessage(12,s,0,t);
b.inflictDamage(t, b.poke(t).lifePoints()/8,s,false);
}
示例13: 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);
}
}
示例14: ubh
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")) || tmove(b,t).attack == Move::DragonTail || tmove(b,t).attack == Move::CircleThrow || (b.hasSubstitute(s) && !b.canBypassSub(t)))
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;
}
示例15: uodr
static void uodr(int s, int t, BS &b) {
if (!b.attacking()) {
return;
}
//Magic Guard
if (tmove(b,t).category != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) {
return;
}
b.eatBerry(s);
b.sendBerryMessage(12,s,0,t);
b.inflictDamage(t, b.poke(t).totalLife()/8,s,false);
}