#include <iostream>
#include <time.h>
#include "fight.h"
usingnamespace std;
char direction;
int main ()
{
cout << "Welcome to Z.E.T.A";
cout << "“Zombie Elimination Training Academy”";
cout << "You have been selected to attempt to enter this elite group. Your first task is to reach our training facility located at the old airport. ";
cout << "You can take one weapon from those provided in the room. Good luck.";
cout << endl;
cout << "You see set out on a table. There is a shotgun with 12 shells, a 9mm pistol with 30 rounds, a chainsaw, a M16 with 60 rounds and a hatchet. ";
cout << "Choose your weapon. To choose your weapon enter 1 for the Shotgun, 9 for the 9mm, 2 for the chainsaw, 16 for the M16 and 3 for the Hatchet. ";
cout << endl;
cin >> weapon;
switch (weapon)
{
case (1):
prime = 4;
ammo = 12;
second = 1;
hitchance = 0;
break;
case (9):
prime = 1;
ammo = 30;
second = 1;
hitchance = 2;
break;
case (2):
prime = 3;
ammo = 1000;
second = 1;
hitchance = 4;
break;
case (16):
prime = 2;
ammo = 60;
second = 1;
hitchance = 3;
break;
case (3):
prime = 2;
ammo = 1000;
second = 2;
hitchance = 4;
break;
}
cout << "Now that you have chosen your weapon it’s now time to get to the airport. Looking out the window you see a few zombies walking the streets. ";
cout << "This is not going to be as easy as it sounds.";
cout << "You head out down the stairs to get to the facility. As you near the bottom floor you hear a faint shuffling sound.";
cout << " Sounds like it’s time to kill your first zombie.";
cout << endl;
int combat();
if (playerhealth = 0)
cout << "You have died!! Guess you weren’t good enough for Z.E.T.A.";
cout << "Game over";
if (zombiehealth = 0)
cout << "That was close hopefully there won’t be too many of those.";
cout << "After taking out that zombie you take a moment to collect yourself. Walking out the door you see the main road to the airport ";
cout << "and the back streets and alleys. The main road has zombies all over it and who knows what you may find taking the alleys. ";
cout << "Enter 1 to take the road or 2 to go the back way.";
cin >> direction;
if (direction = 1)
cout << "You start making you way down the road listening carefully for signs of zombies. ";
cout << "After passing a few abandoned cars you see a zombie shuffling out from behind a car up ahead.";
int combat();
if (zombiehealth = 0)
cout << "Well hopefully all that noise doesn’t attract too much attention.";
cout <<endl;
cout << "Heading down the road a bit faster now more and more zombies are coming out behind you.";
cout << "As you near the entrance of the airport you see 3 zombies chewing on a corpse in the road. Looks like you have one more big fight ahead of you.";
int combat ();
if (zombiehealth = 0)
int combat();
if (zombiehealth = 0)
int combat();
if (zombiehealth = 0)
cout << "Well you somehow managed to beat those zombies. Dragging yourself through the gate you feel somehow relived.";
cout << endl;
cout << "A man in a military uniform walks up to you. ";
cout << endl;
cout << "Well done looks like you have what it takes to help us rid the world of this zombie menace.";
cout << "Welcome to Z.E.T.A.";
if (direction = 2)
cout << "Twisting through the side streets you can hear the zombies everywhere but so far have yet to see any.";
cout << "Suddenly one stumbles out form a dark corner.";
int combat();
if (zombiehealth = 0)
cout << "Thankfully you know your way around town. ";
cout << endl;
cout << "Taking a few more turns you see a zombie crawling out of a house.";
int combat();
if (zombiehealth = 0)
cout << "Just when you think you might have been better off taking the main road you spot the airport employee parking garage. ";
cout << "Thinking to yourself, wasn’t there a tunnel leading in to the airport in there.";
cout << "Making your way through the garage you manage to find the tunnel with little difficulty. ";
cout << "As you approach the tunnel entrance you see a zombie, who looks like a pilot scratching at the door. ";
int combat();
if (zombiehealth = 0)
cout << "After dispatching the zombie pilot you try to open the door only to find it takes a special key. ";
cout << "Searching around you notice a key card on the pilots belt. Using it to open the door you run through the tunnel to the airport.";
cout << endl;
cout << "When you come out you almost run in to a man in a military uniform. He looks at you and smiles. ";
cout << "Well done you will do well here. We have needed someone like you for some time now. Let’s get you cleaned up and start you training. ";
if (playerhealth = 0 )
cout << "The zombie pulls you to the ground and starts to devour your flesh. Hopefully you will not feel this too long. Game Over.";
return 0;
}
The header file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
usingnamespace std;
int playerhealth;
int zombiehealth;
int weapon;
int prime;
int second;
int ammo;
int hit;
int randhitmod;
int hitmod;
int zombiehitmod;
int zombiechop;
int secammo;
int hitchance;
int zombiehitchance;
char attack;