#include <iostream>
#include <string>
using namespace std;
int main()
{
int strength, spellPower, health, playerLevel, playerName, 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;
}
{
}
{
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;
}
|