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 85 86 87 88 89 90 91 92 93 94 95
|
#include <iostream>
#include <string>
using namespace std;
int main ( )
{
string name;
string gender;
string boy;
string girl;
string race;
string Human;
string Orc;
string Elf;
string Direction;
cout << "Hello, welcome to the World.\n\n";
cout << "What's your name?\n\n";
cin >> name;
cout << "\nNice to meet you " << name << endl << endl;
cout << "Are you a boy or girl?\n\n";
cin >> gender;
if ( gender == "boy" )
{
cout << "\nKind of small for a boy, hope you learn fast.\n\n";
}
else
{ cout << "\nA girl? Don't get many girls around these parts.\n\n";
}
cout << "What race are you?\n\nHuman, Orc, or Elf.\n\n";
cout << "Humans get a balanced buff of +1 to all.\n\n";
cout << "Orcs get +2 Attack and HP.\n\n";
cout << "Elves get +2 Magic and HP.\n\n";
cin >> race;
if ( race == "Human" )
{
cout << "\nAh a human, the village through the forest will welcome you openly.\n\n";}
if ( race == "Orc" ) {
cout << "\nThe nearby village fears Orcs, show them kindness to\nbefriend them.\n\n";}
if ( race == "Elf" ) {
cout << "\nAn Elf you say? Mysterious folk you are.\n\n"; }
cout << "Well that's enough about you, down to learning the basics.\n\n";
cout << "General commands will bring your hero where you say\ndepending on the situation.\n\n";
cout << "This game is case-sensative so type commands as you see on\nscreen.\n\n";
cout << "You can attack, magic, or defend in combat.\n\n";
cout << "All heros start with 10 Hit Points (HP), 5 Attack (A),\nand 2 Defense (D).\n\n";
cout << "Now that you have learned some basics, lets jump into this.\n\n\n\n";
cout << "You awaken in a forest circle, you don't know how you got\nhere and you feel like you're being watched.\n\n";
cout << "You can see a path on your left with a bright light shining through, and a dark damp path to the right.\n\n";
cout << "Which do you choose?\n\n";
cout << "Left or Right\n\n";
cin >> Direction;
if ( Direction == "Left" ) {
cout << "\nYou walk through the brightly lit path to an opening, the\nsun is shining so bright through the opening you can barely see. You step off a cliff and fall to your death.\n\n";
cout << "GAME OVER";
return 0; }
else {
cout << "\nYou walk down the dark, dim path. You feel as if whatevers\nwatching you is getting closer. In the distance you hear\nvillage chatter. Suddenly a Giant Rat appears from the\nbushes!\n\n"; }
cout << "Prepare for battle!\n\n";
cout << "Giant Rat 10 HP, 3 Attack, 2 Defense.\n\n";
return 0;
}
|