#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Hello everyone and welcome to this game.\n";
cout << "In this game the aim is to attack the wolf with what you think is the best attack, goodluck!\n";
int healthme;
int healthit;
for(healthme=500;healthme<0; ); (healthit=500; healthit<0; ) {
cout << "Your Health is " << healthme << " and the wolfs health is " << healthit << "\n";
cout << "So, what attack do you want to hit the wolf with a weapon or with magic?";
string attack;
cin >> attack;
if(attack=="a weapon" , "weapon" , "the weapon") {
cout << "What part of the wolf do you want to attack, the body or the head?";
string bodypart;
cin >> bodypart;
if(bodypart == "the body" , "body") {
healthit=healthit-50;
cout << "You hit the wolf!\n";
}
else if(bodypart == "the head" , "head") {
healthit = healthit-100;
healthme=healthme-20;
cout << "It was a good hit, but it bites back!\n";
}
else cout << "you missed! (spelt it wrong) \n";
}
else if(attack =="magic" , "with magic"){
cout << "what element would you like to attack with? fire lightning, ice, water, or earth?\n";
string magic;
cin << magic;
if(magic == "fire"){
healthit=healthit-50;
cout << "It does good damage!\n";
}
else if(magic == "lightning"){
healthit=healthit-100;
cout << "It does amazing damage!\n";
}
else if(magic == "earth"){
healthit= healthit-70;
cout << "It hits hard!\n";
}
else if(magic=="ice") {
healthit = healthit-30;
cout << "It doesn't seem to hurt much!\n";
}
else if(magic=="water") {
healthit = healthit - 10;
cout << "It seems unaffected!\n";
}
else cout << "You missed! (spelt it wrong!)\n";
}
else cout << "you took to long! (spelt wrong!)";
if(healthit<=100){
cout << "He is Angry now and doing more damage!\n";
healthme = healthme-75;
}
else {
cout << "The wolf goes out to attack!\n";
healthme= healthme-50;
}
}
if(healthme<=0) cout << "Your Dead... Game over i guess?";
else cout << "The wolf is dead! You Win!";
return 0;
}
Sorry about the neatness but would be appreciated if someone could tell me what i'm doing wrong, thank you in advance