#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=500;
int healthit;
for(healthit=500 ;healthme>0 && 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.find("weapon") != std::string::npos) {
cout << "What part of the wolf do you want to attack, the body or the head?\n";
string bodypart;
cin >> bodypart;
if(bodypart.find("body") != std::string::npos) {
healthit=healthit-50;
cout << "You hit the wolf!\n";
}
else if(bodypart.find("head") != std::string::npos) {
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.find("magic") != std::string::npos){
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>=0){
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;
}
if you can bother please take the time and tell me what i could make better thank you