This dumb fighting system. It seems like I'm going in circles. I have the same problem I started with, but now for a different reason. If I come back to fight the man again it says hes already dead. Occasionally his hp will start at something like 35 or some wierd number.
Code:
case 'f':
do{
cout<<"1-man\n";
cout<<"2-goblin\n";
cin>>monster;
if(monster=='1'){
cout<<"You encounter a man";
finalcom=20;
}
}while(monster<1 || monster>4);
while(finalcom>0){ //fight
fight=rand()%5+1;
cout<<"How are you going to combat you opponent?";
cin>>combat;
if(combat=='a'){ //attack
fcom=(((strength*3)+agility)/fight);
finalcom=mhp1-fcom;
mhp1=finalcom;
}
if(finalcom>0){
cout<<"His hp is"<<finalcom<<"\n";
}
}
cout<<"\nHe is dead\n"; //death
How do you edit the variables in a structure? If this is how you do it then why won't it cout?
Code:
bsword brsword;
brsword.bsi=1;
if (brsword.bsi=='1'){
cout<<"Bronze Sword\n";
}
Please help