本文整理汇总了C++中Pokemon::HP方法的典型用法代码示例。如果您正苦于以下问题:C++ Pokemon::HP方法的具体用法?C++ Pokemon::HP怎么用?C++ Pokemon::HP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pokemon
的用法示例。
在下文中一共展示了Pokemon::HP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Play2
void Play2(Pokemon& Tail,Pokemon& Volt, Graphics test1, int posMo2, int& CurrHP1, int& CurrHP2){
int HP1 = Tail.HP(), HP2 = Volt.HP();
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
if (Volt.useMove(posMo2) == 0){
mvprintw(31,61,"Miss Hit");
}else if (Volt.useMove(posMo2) > 0){
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
if (Tail.effectiveness(Volt.ATKDMGT(posMo2)) == 1){
Tail.defend(Volt, posMo2);
CurrHP1 = Tail.GamHP1();
mvprintw(31,61,"Super Effective!");
}else if (Tail.effectiveness(Volt.ATKDMGT(posMo2)) == 2){
Tail.defend(Volt, posMo2);
CurrHP1 = Tail.GamHP1();
mvprintw(31,61,"Not very Effective!");
}else if (Tail.effectiveness(Volt.ATKDMGT(posMo2)) == 3){
Tail.defend(Volt, posMo2);
CurrHP1 = Tail.GamHP1();
mvprintw(31,61,"Doesn't affect opponent");
}else{
mvprintw(31,61,"It Hit!");
Tail.defend(Volt, posMo2);
CurrHP1 = Tail.GamHP1();
}
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
getch();
}else{
Tail.defend(Volt, posMo2);
CurrHP1 = Tail.GamHP1();
Tail.setState(Volt.useMove(posMo2));
mvprintw(31,61,"Status Given");
}
}
示例2: charValMov
char charValMov(Graphics test1,Pokemon& currentPok, int HP2, int& CurrHP2){
char resp;
int posMo;
char posMoch[1];
bool validarEntrada = true;
getch();
int HP1 = currentPok.HP(), otHP2 = HP2;
int CurrHP1 = currentPok.HP(), otCurrHP2 = CurrHP2;
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
while(validarEntrada){
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
mvprintw(29,61,"Move: ");
currentPok.drawMoves();
noecho();
char temp;
temp = getch();
posMoch[0] = temp;
posMo = atoi(posMoch);
if(charPos(temp, posMo, currentPok)){
echo();
resp = temp;
attron(COLOR_PAIR(3));
mvaddch(29,75,resp);
validarEntrada = false;
}else{
setStage(test1, HP1, CurrHP1, HP2, CurrHP2);
currentPok.drawMoves();
validarEntrada == true;
mvprintw(29,61,"Move: ");
mvprintw(31,61,"Invalid Input!!!");
}
getch();
clear();
}
return resp;
}