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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
int strength, spellPower, health, playerLevel, choose, playerXp, arrowPower, gold;
int evilStrength, evilSpellPower, evilHealth, evilLevel;
playerLevel = 1;
playerXp = 0;
cout << "Welcome to Crypt!" << endl;
cout << "A console RPG game where you choose your playstyle and fight in an arena." << endl;
cout << "Choose a class." << endl;
cout << "1. Knight" << endl;
cout << "2. Archer" << endl;
cout << "3. Spellbreaker" << endl;
cout << "4. Healer" << endl;
cout << "5. Zombie" << endl;
int playerClass;
cin >> playerClass;
if (playerClass == 1)
{
cout << " ===|====>" << endl;
strength = 10;
spellPower = 0;
health = 100;
cout << "you choose The Knight! here is your attributes:" << endl;
cout << "Strength = " << strength << endl << "Health = " << health << endl;
}
else if (playerClass == 2)
{
cout << " |)" << endl;
strength = 8;
arrowPower = 25;
health = 90;
cout << "you choose the Archer! here is your attributes:" << endl;
cout << "Strength = " << strength << endl << "Bow and Arrow = " << arrowPower << endl << "Health = " << health << endl;
}
else if (playerClass == 3)
{
cout << " ----(o" << endl;
strength = 7;
spellPower = 20;
health = 95;
cout << "you choose the Spellbreaker! here is your attributes:" << endl;
cout << "Strenght = " << strength << endl << "Spell Power = " << spellPower << endl << "Health = " << health << endl;
}
else if (playerClass == 4)
{
cout << " <3" << endl;
strength = 5;
spellPower = 18;
health = 150;
cout << "you choose the Healer! here is your attributes:" << endl;
cout << "Strength = " << strength << endl << "Spell Power = " << spellPower << endl << "Heatlh = " << health << endl;
}
else if (playerClass == 5)
{
cout << " brrraiiinssss...." << endl;
strength = 9;
spellPower = 0;
health = 90;
cout << "you choose the Zombie! here is your attributes:" << endl;
cout << "Strength = " << strength << endl << "Spell Power = " << spellPower << endl << "Heatlh = " << health << endl;
}
{
gold = 0;
}
bool gameOver = false;
while (!gameOver)
if (playerLevel < 5)
if (health == 0)
gameOver = true;
{
cout << "|_|_|_|_|__|__|__|_|_|_|_|" << endl;
cout << "|_______|________|_______|" << endl;
cout << "| ___ | | ___ |" << endl;
cout << "| [ ] | | [ ] |" << endl;
cout << "| [___] | ____ | [___] |" << endl;
cout << "| | | | | |" << endl;
cout << "| | | | | |" << endl;
cout << "--------------------------" << endl;
cout << "Welcome to the Crypt Arena!" << endl;
cout << "You are level " << playerLevel <<endl;
cout << "You have " << gold << " Gold" << endl;
cout << "---------------------------" << endl;
cout << "What do you want to fight?" << endl << "\n 1. Bandit" << endl << "\n 2. Troll" << endl;
cin >> choose;
}
if (choose == 1)
{
{
cout << string( 100, '\n' );
cout << "fighting level 1 Bandit!! Prepare for combat!" << endl;
evilHealth = 40;
evilStrength = 4;
evilSpellPower = 0;
while (health > 0)
{
if (evilHealth < 0)
{
playerXp += 10;
gold += 5;
cout << "You killed the Bandit! You are awarded 10 experience points! you now have " << playerXp << " experience points!" << endl;
cout << "You are awarded 5 Gold! You now have " << gold << " Gold!" << endl;
cout << "Type any number to continue." << endl;
cin >> choose;
cout << string( 100, '\n' );
break;
}
health -= evilStrength * 2;
cout << "the Bandit strikes and deals " << evilStrength * 2 << " damage to you!" << "\nYou have " << health << " health left!" << endl;
cout << "Choose an action!" << "\n 1. Attack" << "\ 2. Cast fireball" << endl;
cin >> choose;
if (choose == 1)
{
evilHealth -= strength * 2;
cout << "you swing your weapon and deal " << strength * 2 << " damage to the Bandit!" << endl;
cout << "the Bandit has " << evilHealth << " health left!" << endl;
}
if (choose == 2)
{
evilHealth -= strength * 2;
cout << "You cast a fireball and deal " << strength * 2 << " damage to the Bandit!" << endl;
cout << "the Bandit has " << evilHealth << " health left!" << endl;
}
}
}
}
if (choose == 2)
{
{
cout << string( 100, '\n' );
cout << "fighting level 1 Troll!! Prepare for combat!" << endl;
evilLevel = 2;
evilHealth = 40;
evilStrength = 4;
evilSpellPower = 0;
while (health > 0)
{
if (evilHealth < 0)
{
playerXp += 10;
cout << "You killed the Troll! You are awarded 10 experience points! you now have " << playerXp << " experience points!" << endl;
cout << "Type any number to continue." << endl;
cin >> choose;
cout << string( 100, '\n' );
break;
}
health -= evilStrength * 2;
cout << "the Troll strikes and deals " << evilStrength * 2 << " damage to you!" << "\nYou have " << health << " health left!" << endl;
cout << "Choose an action!" << "\n 1. Attack" << "\ 2. Cast fireball" << endl;
cin >> choose;
if (choose == 1)
{
evilHealth -= strength * 2;
cout << "you swing your weapon and deal " << strength * 2 << " damage to the Troll!" << endl;
cout << "the Troll has " << evilHealth << " health left!" << endl;
}
}
}
}
return 0;
}
|