1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
int main(int argc, char *argv[])
{
/*enemies*/ int enemydmg; int enemymaxhp; int enemycurrenthp;
/* Lock hp = 5, 0 dmg*/;
// Rooms//
int room1done; int room2done; int room3done;
srand((unsigned)time(0));
//BASICS, LEVEL 1 PLAYER //
int maxhp = 100 ; int currenthp = 100; int dmg = (rand() % 3) + 1;; int ap = 0;
//RANDOM STUFF//
string name;
int choice;
// Introduction //
cout << "\t\t--WELCOME TO TEXTVENTURE--\n";
cout << "Hello. What is your name?\n";
cin >> name;
cout << "Your name is now " << name << "\n";
cout << "Hello, and welcome, " << name << ", you are about to enter the world";
cout << " of Textventure.";
cout << "\nYou make selections on what you do by typing any number option given.\n";
cout << "Typing something other than the options given will bring up an error.\n";
cout << "You have health. You may be damaged by monsters, or the result of \n";
cout << "another choice you made. You will encounter monsters and must fight.\n";
cout << "When you fight, or complete other special encounters, you will earn ap,\n";
cout << " aka adventure points, which can make you level up and up your stats.\n";
cout << "There are other ways to raise your stats, anyways, good luck!\n";
cout << "Did you get that? ^^ ";
system("PAUSE");
//Room 1: JAIL CELL//
cout << "\n\nYou awake in a jail cell.\n";
cout << "It's dark and you can only remember your name.\n";
cout << "In this room is only one cell, and a door out. Your cell is locked however.\n";
cout << "What would you like to do?\n";
cout << "1. Try and break the lock with your fists.\n2. Try and squeeze through the bars.\n";
enemycurrenthp = 5;
enemymaxhp = 5;
do {
cin >> choice;
if( choice == 1 ) {
cout << "You hit the lock. You do " << dmg << " damage to the lock.\n";
enemycurrenthp = enemycurrenthp - dmg;
}
else {
cout<<"That wasn't a choice!\n";
}
} while (enemycurrenthp > 0 );
cout << "The lock breaks open.\n";
cout << "What would you like to do?\n";
cout << "1. Continue through the door.\n2.Search the room.\n";
std::cout << "Press ENTER to continue...";
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
return EXIT_SUCCESS;
}
|