wow, i didnt test it like that, you're right.
i had changed it to before
ok now i changed it to
if(dex && str <= 20)
if(dex <= 20 && str <= 20 && dex >= 0 && str >= 0)
also, i'm having form problems with my damage numbers.
those are my player variables. playerarmor is randomed, but that doesnt matter here.
float phealth = 100;
int dex, str, PlayerArmor;
float HandtoHand = .5;
int weaponbonus = 5; // weapon bonus, only 5 because its his fists
thats my code for attack. but when i play it, it deals 5 damage every time, which is the weapon bonus. when i take the add weapon bonus line out, then i do normal damage.
if(dex > GoblinArmor) //checks to see if the player's dex is high enough to hit the goblin
dmg = dex * str;
dmg = dmg * HandtoHand;
dmg = dmg * AttackRandom;
dmg = dmg + weaponbonus;
cout << "you hit the goblin for " << dmg << " damage" << endl; //tells the player how much he hit for
ghealth = ghealth - dmg;
cout << "the goblin has " << ghealth << " Hit points left" << endl;
}//closing player hit if
cout << "you did not hit" << endl; //if the players dex was too low
}//closing player hit else