jeudi 8 août 2019

I have a question about my battle system hp code

i've been coding a text based RPG pokemon battle and im trying to make a damage count of the wild pokemon. but i'm slightly stuck. i have the link to the running program so you can see what i mean.

https://repl.it/live/Ig6yy9UVHyxScw

ive tried using if the total hp of the wild pokemon is less than 90 but it still shows the first attacks damage. (damage = 20). i have the code i'm stuck on here.

if (pokemonSelect == 1 == move == 1) {//for charmander
    wPhPtotal = wPhP;
    wPhPtotal = wPhP - wPdamage;
}

cout<<"wild pokemon hp lost:" << red<<" "<<wPdamage<<" "<<def<< "hp:"<<green<<wPhPtotal<<endl;

NOTE: only use charmander and ember as i havent programmed the other moves yet.

is there A way to count it all up?

Aucun commentaire:

Enregistrer un commentaire