本文整理汇总了C++中BS::gainPP方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::gainPP方法的具体用法?C++ BS::gainPP怎么用?C++ BS::gainPP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BS
的用法示例。
在下文中一共展示了BS::gainPP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: ti
static void ti(int p, int s, BS &b) {
int attack = turn(b,p).value("ItemAttackSlot").toInt();
int pp = poke(b,p).value("ItemArg").toInt();
if (pp == 0) {
pp = 99;
}
b.sendBerryMessage(2,s,0,0,0,b.move(s,attack));
b.gainPP(s, attack, pp);
}