本文整理汇总了C++中BS::gen方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::gen方法的具体用法?C++ BS::gen怎么用?C++ BS::gen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::gen方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: udi
static void udi(int s, int t, BS &b) {
if (s == t)
return; /* life orb doesn't recoil with self damage */
if (b.koed(s))
return;
/* In gen 4, it does not damage the user if the foe has a substitute. In gen 5, it does */
if (b.gen() <= 4 && turn(b,t).contains("DamageTakenBy") && turn(b,t)["DamageTakenBy"].toInt() == s) {
turn(b,s)["ActivateLifeOrb"] = true;
} else if (b.gen() >= 5 && turn(b,s).contains("DamageInflicted")) {
turn(b,s)["ActivateLifeOrb"] = true;
turn(b,s)["LOTarget"] = t;
}
}
示例2: 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;
}
}
}
示例3: mp
static void mp(int s, int, BS &b) {
for (int i = 0; i < 4; i++) {
if (MoveInfo::Power(b.move(s,i), b.gen()) == 0) {
turn(b,s)["Move" + QString::number(i) + "Blocked"] = true;
}
}
}
示例4: 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);
}
}
示例5: bpm
static void bpm(int s, int, BS &b) {
if (tmove(b,s).type == poke(b,s)["ItemArg"]) {
if (b.gen() >= 4)
b.chainBp(s, 4);
else
b.chainBp(s, 2);
}
}
示例6: btd
static void btd(int s, int t, BS &b) {
if(b.poke(s).isFull()) {
if (b.gen() <= 4)
turn(b,s)["CannotBeKoedBy"] = t;
else
turn(b,s)["CannotBeKoedAt"] = b.attackCount();
}
}
示例7: bpm
static void bpm(int s, int, BS &b) {
if (tmove(b,s).type == poke(b,s)["ItemArg"]) {
if (b.gen() >= 4)
turn(b,s)["BasePowerItemModifier"] = 2;
else
turn(b,s)["BasePowerItemModifier"] = 1;
}
}
示例8: atl
static void atl(int s, int, BS &b) {
if (turn(b,s).value("ActivateLifeOrb").toBool() && !turn(b,s).value("NoLifeOrbActivation").toBool() && !turn(b,s).value("EncourageBug").toBool()
&& !b.hasWorkingAbility(s, Ability::MagicGuard)) {
if (b.gen() >= 5)
b.sendItemMessage(21,s);
b.inflictDamage(s,b.poke(s).totalLifePoints()/10,s);
turn(b,s)["NoLifeOrbActivation"] = true;
/* Self KO Clause */
if (b.koed(s)) {
/* In VGC 2011 (gen 5), the user of the Life Orb wins instead of losing with the Self KO Clause */
if (b.gen() <= 4)
b.selfKoer() = s;
else
b.selfKoer() = turn(b,s).value("LOTarget").toInt();
}
}
}
示例9: turn
static void m3b(int s, int t, BS &b) {
if (!b.attacking()) {
return;
}
/* We never want to activate this berry if this is consumed by Bug Bite */
if (b.gen() >= 4 && !turn(b,s).value("BugBiter").toBool()) {
/* Normal moves */
if (!b.hasSubstitute(s) && tmove(b,t).type == 0) {
b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
b.eatBerry(s,false);
turn(b,t)["Mod3Berry"] = -5;
}
}
}
示例10: tp
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);
}
示例11: as
static void as(int s, int, BS &b) {
bool used = false;
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) {
removeFunction(poke(b,s), "DetermineAttackPossible", "Attract");
poke(b,s).remove("AttractedTo");
used = true;
}
}
if (b.gen() >= 5) {
if (poke(b,s).contains("Tormented")) {
removeFunction(poke(b,s), "MovesPossible", "Torment");
poke(b,s).remove("Tormented");
used = true;
}
if (b.counters(s).hasCounter(BC::Taunt)) {
removeFunction(poke(b,s), "MovesPossible", "Taunt");
removeFunction(poke(b,s), "MovePossible", "Taunt");
b.removeEndTurnEffect(BS::PokeEffect, s, "Taunt");
used = true;
}
if (b.counters(s).hasCounter(BC::Encore)) {
removeFunction(poke(b,s), "MovesPossible", "Encore");
b.removeEndTurnEffect(BS::PokeEffect, s, "Encore");
used = true;
}
if (b.counters(s).hasCounter(BC::Disable)) {
removeFunction(poke(b,s), "MovesPossible", "Disable");
removeFunction(poke(b,s), "MovePossible", "Disable");
b.removeEndTurnEffect(BS::PokeEffect, s, "Disable");
used = true;
}
b.counters(s).clear();
}
if (used) {
b.sendItemMessage(7,s);
b.disposeItem(s);
}
}