At first everything was just plain cout and I had using namespace std;, but then when I added more code in, it all said cout is ambiguous so I took off using namespace std and just put std:: behind them all. it fixed them except for all the ones inside the body of else if (quest1 == 2). Theres also a few other errors, some saying expected a declaration, including on return 0;.
Can anybody tell me whats going on?
#include <iostream>
#include <string>
using std::string;
string name;
string womanname;
int quest1;
int health = 100;
int damage = 10
void fight(int enhealth, int endamage)
{
do
{
if (health != 0)
{
system("PAUSE");
std::cout << "\n\nAttacking...\n\n";
enhealth= enhealth-damage;
std::cout << "did " << damage;
std::cout << "\n\n Enemy now has " << enhealth;
}
if (enhealth != 0)
{
std::cout << "\n\n";
system("PAUSE");
std::cout << "\nEnemy attacks\n";
health= health-endamage;
std::cout << "\n\nEnemy does " << endamage;
std::cout << "\nYour health is at " << health;
std::cout << "\n\n";
}
}
while (enhealth != 0);
}
int main()
{
std::cout << "Vitalsma: Adventure - Presented by Bradley R/ZAAL\n\n";
std::cout << "What is your name, young Warrior?\n";
std::cin >>name;
std::cout << "Well, ";
std::cout << name;
std::cout << ",\nYou are chosen by us spirits to rid the monsters, restore peace and avenge us.\n\n";
std::cout << "Take my Broadsword that I used until I perished.\n\n";
std::cout << "You are walking and the road splits into 3 paths\n";
std::cout << "Which path will you choose? (type 1, 2 or 3)\n";
std::cin >> quest1;
if (quest1 == 1)
{
std::cout << "As you enter the first path, you start to have unfamiliar\n";
std::cout << "thoughts of a Woman whom you know nothing of\n";
std::cout << "What do you think her name could be?\n";
std::cin >> womanname;
}
else if (quest1 == 2)
{
std::cout << "As you walk the second path, you find a farm.\n";//here
std::cout << "There appears to be a a Thief robbing the farm while the farmer is\ntied up to the roof\n";
std::cout << "The Thief disturbingly has Red Eyes\n";
std::cout << "Red Eyed Thief:";
std::cout << name;
std::cout << ", the Dragon is waiting for you, he knows that were summoned to put an end to our plan to rule the world.\n";
std::cout << "Red Eyed Thief: Foolish your summoner was, thinking that a puny human such as yourself could stop this\n";
std::cout << "Red Eyed Thief: I'm stealing for the Dragon, but at this time, I'm sure he'll just want me to end your life now...\n";//to here
}
else if (quest1 == 3)
{
std::cout << "As you walk the third path, you smell fire...\n";
std::cout << "You see an Old Man running to you.\n";
std::cout <<"Old Man: You must help! Our town is on Fire!\nThe Dragon came and attacked us with it's minions!";
}
system("PAUSE");
return 0;//
}