本文整理汇总了C++中BS::sendBerryMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::sendBerryMessage方法的具体用法?C++ BS::sendBerryMessage怎么用?C++ BS::sendBerryMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::sendBerryMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tp
static void tp(int p, int s, BS &b) {
if (!b.isOut(s)) {
return;
}
int berry = b.poke(s).item();
QVector<int> stats;
for (int i = Attack; i <= Evasion; i++) {
if (fpoke(b,s).boosts[i] < 6) {
stats.push_back(i);
}
}
if (stats.empty())
return;
if (!testpinch(p, s, b, 4, false))
return;
int stat = stats[b.randint(stats.size())];
if (b.hasWorkingAbility(s, Ability::Contrary)) {
b.sendBerryMessage(9,s,1,s, berry, stat);
} else {
b.sendBerryMessage(9,s,0,s, berry, stat);
}
b.inflictStatMod(s, stat, 2, s, false);
}
示例2: ti
static void ti(int p, int s, BS &b) {
QString sarg = poke(b,p).value("ItemArg").toString();
int arg = sarg.section("_", 0, 0).toInt();
bool permanent = sarg.section("_", 1) == "1";
if (permanent) {
turn(b,p)["PermanentItem"] = true;
}
if (b.koed(s))
return;
int status = b.poke(s).status();
bool conf = b.isConfused(s);
/* Confusion berry */
if (arg == -1) {
if (conf) {
b.healConfused(s);
b.sendBerryMessage(1, s, 0);
}
return;
}
/* Lum berry */
if (conf && arg == 0) {
b.healConfused(s);
goto end;
}
if (status == Pokemon::Fine) {
return;
}
/* LumBerry */
if (arg == 0) {
if (status == Pokemon::Fine)
return;
goto end;
} else { /* Other Status Berry */
if (status == arg) {
goto end;
}
}
return;
end:
b.healStatus(s, status);
b.sendBerryMessage(1, s, arg + 1);
}
示例3: asc
static void asc(int s, int, BS &b) {
if (b.koed(s))
return;
int status = b.poke(s).status();
bool conf = b.isConfused(s);
int arg = poke(b,s)["ItemArg"].toInt();
/* Confusion berry */
if (arg == -1) {
if (conf) {
b.eatBerry(s);
b.healConfused(s);
b.sendBerryMessage(1, s, 0);
}
return;
}
/* Lum berry */
if (conf && arg == 0) {
b.healConfused(s);
goto end;
}
if (status == Pokemon::Fine) {
return;
}
/* LumBerry */
if (arg == 0) {
goto end;
} /* Poison Berry */
else if (arg == Pokemon::Poisoned) {
if (status == Pokemon::Poisoned || status == Pokemon::DeeplyPoisoned) {
goto end;
}
} else { /* Other Status Berry */
if (status == arg) {
goto end;
}
}
return;
end:
b.eatBerry(s);
b.healStatus(s, status);
b.sendBerryMessage(1, s, arg + 1);
}
示例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: appl
static void appl(int s, int, BS &b) {
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.poke(s).move(i).PP() == 0) {
zeroPP = true;
init = true;
minmove = i;
minPP = 0;
break;
}
if (b.poke(s).move(i).PP() < minPP && b.poke(s).move(i).PP() < b.poke(s).move(i).totalPP()) {
minmove = i;
init = true;
minPP = b.poke(s).move(i).PP();
}
}
if (init && (zeroPP || turn(b,s).value("BugBiter").toBool())) {
b.eatBerry(s);
b.sendBerryMessage(2,s,0,0,0,b.move(s,minmove));
b.gainPP(s,minmove,10);
}
}
示例6: to
static void to (int s, int, BS &b) {
if (!testpinch(s, s, b,4))
return;
b.sendBerryMessage(11,s,0);
turn(b,s)["TurnOrder"] = 3;
}
示例7: btl
static void btl(int s, int, BS &b) {
if (!testpinch(s, s, b,4))
return;
poke(b,s)["BerryLock"] = true;
b.sendBerryMessage(10,s,0);
}
示例8: turn
static void m3b(int s, int t, BS &b) {
if (!b.hasSubstitute(s) && turn(b,t)["TypeMod"].toInt() > 4 && turn(b,t)["Type"].toInt() == poke(b,s)["ItemArg"].toInt()) {
b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
b.eatBerry(s,false);
turn(b,t)["Mod3Berry"] = -5;
}
}
示例9: 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);
}
示例10: tp
static void tp(int s, int, BS &b) {
int berry = b.poke(s).item();
if (!testpinch(s, s, b, 4))
return;
int stat = (b.true_rand()%5) +1;
b.gainStatMod(s, stat, 2,false);
b.sendBerryMessage(9,s,0,s,berry, stat);
}
示例11: to
static void to (int p, int s, BS &b) {
if (!b.isOut(p)) {
return;
}
if (!testpinch(p, s, b, 4, false)) {
return;
}
b.sendBerryMessage(11,s,0);
turn(b,s)["TurnOrder"] = 3;
}
示例12: turn
static void m3b(int s, int t, BS &b) {
if (!b.attacking()) {
return;
}
if (!b.hasSubstitute(s) && fturn(b,t).typeMod > 0 && tmove(b,t).type == poke(b,s)["ItemArg"].toInt()) {
b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
b.eatBerry(s,false);
turn(b,t)["Mod3Berry"] = -5;
}
}
示例13: uodr
static void uodr(int s, int t, BS &b) {
if (!b.attacking() || b.koed(s)) {
return;
}
int arg = poke(b,s)["ItemArg"].toInt();
int berry = b.poke(s).item();
if (turn(b,t).value("BugBiter").toBool() || tmove(b,t).category == Move::Special) {
b.eatBerry(s, s==t);
if (b.isOut(s)) {
if (b.hasWorkingAbility(s, Ability::Contrary)) {
b.sendBerryMessage(7,s,1,s, berry, arg);
} else {
b.sendBerryMessage(7,s,0,s, berry, arg);
}
b.inflictStatMod(s,arg,1,s,false);
}
}
}
示例14: tp
static void tp(int p, int s, BS &b) {
if (!b.isOut(s)) {
return;
}
if (!testpinch(p, s, b, 4, false)) {
return;
}
poke(b,s)["BerryLock"] = true;
b.sendBerryMessage(10,s,0);
}
示例15: to
static void to (int p, int s, BS &b) {
if (!b.isOut(p)) {
return;
}
if (turn(b,p).value("BugBiter").toBool()) {
b.eatBerry(s);
return;
}
if (!testpinch(p, s, b, 4, false)) {
return;
}
b.sendBerryMessage(11,s,0);
turn(b,s)["TurnOrder"] = 3;
}