wow, i didnt test it like that, you're right.
i had changed it to before
Code:
if(dex && str <= 20)
ok now i changed it to
Code:
if(dex <= 20 && str <= 20 && dex >= 0 && str >= 0)
also, i'm having form problems with my damage numbers.
Code:
float phealth = 100;
int dex, str, PlayerArmor;
float dmg;
float HandtoHand = .5;
int weaponbonus = 5; // weapon bonus, only 5 because its his fists
those are my player variables. playerarmor is randomed, but that doesnt matter here.
Code:
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
else
{
cout << "you did not hit" << endl; //if the players dex was too low
}//closing player hit else
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.