View Single Post
 
Reply
Posted 2009-03-21, 06:32 PM in reply to JRwakebord's post starting "Cripple fight!"
Damn it, they need to bring back games on the Window console and Gorgoth.

Code:
#include <iostream>
#include <string>
using namespace std;

int doGame();

int main() {
	doGame();
}

int doGame() {
	cout << "Worst Text Adventure Game Ever" << endl;
	cout << "Please select a character class number..." << endl;
	cout << "1)Fighter\n2)Wizard\n3)Cleric\n4)Thief\nEnter a number: ";
	
	int characterNum = 1;
	cin >> characterNum;

	int numHitPoints = 0;
	int numMagPoints = 0;
	string weaponName = "";
	string className = "";
	if (characterNum == 1) { /* Fighter */
		numHitPoints = 10;
		numMagPoints = 4;
		weaponName   = "Sword";
		className    = "Fighter";
	}
	else if (characterNum == 2) { /* Wizard */
		numHitPoints = 4;
		numMagPoints = 10;
		weaponName   = "Magic Staff";
		className    = "Wizard";
	}
	else if (characterNum == 3) { /* Cleric */
		numHitPoints = 7;
		numMagPoints = 7;
		weaponName   = "Magic Staff";
		className    = "Cleric";
	}
	else { /* Thief */
		numHitPoints = 8;
		numMagPoints = 6;
		weaponName   = "Short Sword";
		className    = "Thief";
	}
	cout << endl;
	cout << "Character Properties:\n";
	cout << "Class Name   = " << className << endl;
	cout << "Hit Points   = " << numHitPoints << endl;
	cout << "Magic Points = " << numMagPoints << endl;
	cout << "Weapon Name  = " << weaponName << endl;
	int monHP = 10;
	int monMP = 0;
	string monName = "Gorgoth";
	cout << "\nYou suddenly start a fight with " << monName << endl;
	while (numHitPoints > 0) {
		cout << monName << " takes 2 damage";
		numHitPoints -= 2;
		if (numHitPoints > 0) {
			cout << "\nYou have " << numHitPoints << "HP left";
			cout << "\nWhat do you want to do?\n1)Attack\n2)Magic Attack\n1 or 2? ";
			int yourAttack = 0;
			cin >> yourAttack;
			if (yourAttack == 2) {
				monHP -= 3;
				cout << "You took 3 damage from " << monName << endl;
				if (monHP > 0) {
					cout << monName << " now has " << monHP << "HP left" << endl;
				}
				else {
					cout << "You killed " << monName;
					exit(0);
				}
			}
			else {
				monHP -= 2;
				cout << "You took 3 damage from " << monName << endl;
				if (monHP > 0) {
					cout << monName << " now has " << monHP << "HP left" << endl;
				}
				else {
					cout << "You killed " << monName;
					exit(0);
				}
			}
		}
		else {
			cout << "\nYou have died...:(\n";
			exit(0);
		}
	}
}
 
Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。

I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.

 
Speed Test
 
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl

 
Anime List
Old
Profile PM WWW Search
Goodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to be
 
 
Goodlookinguy