Bandwidth exceeded on your screenshot (try http://tinypic.com)

The changes sound cool though. I look forward to checking out the latest rev. I'll try not to screw around in the memory and hose it up this time :D


Heh, alright, thanks.

Well I pretty much finished it, please tell me if there are logic errors or ways to improve the current system.

*I plan on adding other monsters to fight as you suggested instead of it being so linear.*

Edited by restrictment: n/a

/*  Game Created by Jacob Caron. Started on 11/2/09  */
//version 2
//header declarations
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <iomanip>
#include <string>
#include <time.h>
#include <fstream>
#include <windows.h>
using namespace std;
//used to maximize screen
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"user32.lib")
//initializing functions
void spell(int & money, int spells[10]);
void look(int material[3], int & money, int & lookaround);
void upgrade(int material[3], int & money, int upgradeitem[2], int weapon, int armor);
void attribute(int stats[4], int & attributes);
void levels(int & level, int & enemy, int & alignment);
void medic(int & money,int potionsize[5]);
void weapons(int & money, int & weapon, int upgradeitem[2]);
void armory(int & money, int & armor, int upgradeitem[2]);
void statistics(int money,int mondef,int potionsize[5],int armor,int weapon,string name,int stats[4], int health, int attributes, int alignment, int deaths, int hp, int tp, int upgradeitem[2], int lookaround, int material[3], int spells[10]);
void heal(int & health, int & hp);
void train(int stats[4], int & tp);
void battlephase(int stats[4], int & enemy, int potionsize[5], string name, int & weapon, int & armor, int & money, int & mondef, int & health, int & level, int & attributes, int & alignment, int & hp, int & tp, int & deaths, int & lookaround, int upgradeitem[2], int spells[10]);
char spellname[10][25] = {"Lower Enemy Health", "Lower Enemy Attack", "Lower Enemy Defence", "Lower Enemy Speed", "Lower Enemy Accuracy", "Raise Health", "Raise Attack", "Raise Defence", "Raise Speed", "Raise Accuracy"};

//main function
int main()
	system("color 0f");
	//tells screen to maximize
	HWND hWnd = GetConsoleWindow();
	/*****array declarations*****/
	int potionsize[5] = {0, 0, 0, 0, 0};
	int armor = 0;
	int weapon = 0;
	//menu array
	char menu[6][50] = {"Go to a Town", "View Stats", "Add Attributes", "Heal", "Train", "Look around the area"};
	char town[5][50] = {"Visit the town medic", "Visit the Weapon Smith", "Go to the Armory", "Upgrade Weapon and Armor", "Go to the spell shop"};
	char monsters[16][25] = {"Wolf", "Bear", "Bandit", "Traveler", "Gargoyle", "Knight", "Warlock", "Mammoth", "Cyclops", "Unicorn", "Dragon", "Your Mother", "Demon", "Jesus", "Satan", "God"};
	char area[7][25] = {"Go to the Trail", "Go to the Mountains", "Go to the Valley", "Go to the Lake", "Go to the Cliff", "Go to the Cave", "Go to the Land of Fire"};
	int level = 0;
	//character Stats
	int stats[4] = {10, 10, 10, 10};
	int count1;
	string name;
	int money = 50;
	//which enemy to fight
	int enemy = 0;
	//monsters defeated
	int mondef = 0;
	//User Health
	int health = 100;
	//amount of attributes
	int attributes = 0;
	int alignment = 0;
	//number of times died
	int deaths = 0;
	//health points
	int hp = 0;
	//training points
	int tp = 0;
	//enter page
	char title;
	//decides whether or not you will move on
	int moveon = 0;
	char menu1;
	//upgraded weapon/armor
	int material[3] = {0,0,0};
	//amount of material
	int upgradeitem[2] = {0,0};
	//looking around the area
	int lookaround = 1;
	int spells[10] = {0,0,0,0,0,0,0,0,0,0};
	//cheat code
	string cheatcode;
		cout << "*************Helsmich*************" << endl
			<< "----------by: Jake Caron----------" << endl << endl << endl;
		cout << "Welcome, what would you like to do?\n\n"
			<< "1. Start a New Game" << endl
			<< "2. Load Saved Game" << endl
			<< "3. Help/Rules" << endl
			<< "4. Enter Cheat Codes" << endl << endl << ">> ";
		cin >> title;
		if(title == 'q')
			return 0;
		case '1':
			cout << "If you have a saved game this will erase it!!\n"
				<< "Are you sure you wish to continue?\n\n"
				<< "1. Yes\n"
				<< "2. No\n\n>> ";
			cin >> count1;
			if(count1 == 1)
				cout << "Please Enter your name (One Word): ";
				cin >> name;
				cout << "Welcome to Grundor, " << name << ", the village where you were born.\n"
					<< "Your mother, Marlene was abducted by the Horrid Dragon, Helsmich, in the land \n"
					<< "of fire. In order for you to save your mother, you must travel along the \n"
					<< "twisted trail into lands that are filled with terror. I bid you the best of \n"
					<< "luck, and here is $50 to spend on supplies. I know it is not much, but I am \n"
					<< "not the wealthiest man alive!\n\n";
				moveon = 1;
		case '3':
			cout << "                       **********Rules**********" << endl << endl
				<< "The Rules of Helsmich are simple. Just enter a number that is available, and\n"
				<< "try to make the CORRECT selection to survive. Every choice or thing that you\n"
				<< "do will impact either your character or the way you play the game. As you make\n"
				<< "choices, your alignment will change. If your alignment is in the negative, you\n"
				<< "will become 'evil'. Thus, the monsters you battle will differ depending on how\n"
				<< "your alignment is. Your score nearly depends on ALL the variables in the game,\n"
				<< "so don't slack on one aspect and think it won't effect you. Your game has an\n"
				<< "auto-save that will save your game each and every time you hit the enter page!\n"
				<< "This was a brief review of the game, so have fun!" << endl << endl;
		case '4':
			cout << "If you have a saved game this will erase it!!\n"
				<< "Are you sure you wish to continue?\n\n"
				<< "1. Yes\n"
				<< "2. No\n\n>> ";
			cin >> count1;
			if(count1 == 1)
					cout << "Please enter your cheat code: \n"
						<< "Type '123' to exit.\n\n>> ";
					cin >> cheatcode;
					if(cheatcode == "GiveMeExcaliberPlease")
						weapon = 9;
					else if(cheatcode == "GiveMeBerzerkerArmorPlease")
						armor = 9;
					else if(cheatcode == "MOOONEY")
						money = 9999999;
					else if(cheatcode == "MusclesRule")
						stats[0] = 999;
					else if(cheatcode == "ArmoredLikeAnAnt")
						stats[1] = 999;
					else if(cheatcode == "RunningShoes")
						stats[2] = 999;
					else if(cheatcode == "EagleEye")
						stats[3] = 999;
					else if(cheatcode == "HealthNut")
						health = 9999;
					else if(cheatcode == "LetMeGuess")
						tp = 999;
					else if(cheatcode == "HealMe")
						hp = 999;
					else if(cheatcode == "ILikeAttributes")
						attributes = 999;
					else if(cheatcode == "MakeMeGoodNow")
						alignment = 6;
					else if(cheatcode == "MakeMeEvilNow")
						alignment = -6;
					else if(cheatcode == "MedicMan")
						for(int x=0;x<5;x++)
					else if(cheatcode == "EvilBoss")
						alignment = 3;
						level = 8;
					else if(cheatcode == "GoodBoss")
						alignment = -3;
						level = 8;
					else if(cheatcode == "IDontFeelLikeActuallyPlaying")
						for(int x=0;x<5;x++)
						attributes = 999;
						tp = 999;
						hp = 999;
						weapon = 9;
						armor = 9;
						for(int x=0;x<4;x++)
						health = 999;
						money = 999;
						mondef = 8;
					else if(cheatcode != "123")
						cout << "Invalid Cheat Code!!!\n\n";
				}while(cheatcode != "123");
				cout << "Please Enter your name (One Word): ";
				cin >> name;
				moveon = 1;
		case '2':
			ifstream infoout("test.txt");
			if (infoout.is_open())
				infoout >> name;
				infoout >> money;
				infoout >> mondef;
				infoout >> potionsize[0];
				infoout >> potionsize[1];
				infoout >> potionsize[2];
				infoout >> potionsize[3];
				infoout >> potionsize[4];
				infoout >> armor;
				infoout >> weapon;
				infoout >> deaths;
				infoout >> hp;
				infoout >> tp;
				infoout >> health;
				infoout >> stats[0];
				infoout >> stats[1];
				infoout >> stats[2];
				infoout >> stats[3];
				infoout >> attributes;
				infoout >> alignment;
				infoout >> level;
				infoout >> material[0];
				infoout >> material[1];
				infoout >> material[2];
				infoout >> upgradeitem[0];
				infoout >> upgradeitem[1];
				infoout >> lookaround;
				infoout >> spells[0];
				infoout >> spells[1];
				infoout >> spells[2];
				infoout >> spells[3];
				infoout >> spells[4];
				infoout >> spells[5];
				infoout >> spells[6];
				infoout >> spells[7];
				infoout >> spells[8];
				infoout >> spells[9];
			moveon = 1;
	}while(moveon == 0);
		ofstream infoin("test.txt");
		infoin << name << endl;
		infoin << money << endl;
		infoin << mondef << endl;
		infoin << potionsize[0] << endl;
		infoin << potionsize[1] << endl;
		infoin << potionsize[2] << endl;
		infoin << potionsize[3] << endl;
		infoin << potionsize[4] << endl;
		infoin << armor << endl;
		infoin << weapon << endl;
		infoin << deaths << endl;
		infoin << hp << endl;
		infoin << tp << endl;
		infoin << health << endl;
		infoin << stats[0] << endl;
		infoin << stats[1] << endl;
		infoin << stats[2] << endl;
		infoin << stats[3] << endl;
		infoin << attributes << endl;
		infoin << alignment << endl;
		infoin << level << endl;
		infoin << material[0] << endl;
		infoin << material[1] << endl;
		infoin << material[2] << endl;
		infoin << upgradeitem[0] << endl;
		infoin << upgradeitem[1] << endl;
		infoin << lookaround << endl;
		infoin << spells[0] << endl;
		infoin << spells[1] << endl;
		infoin << spells[2] << endl;
		infoin << spells[3] << endl;
		infoin << spells[4] << endl;
		infoin << spells[5] << endl;
		infoin << spells[6] << endl;
		infoin << spells[7] << endl;
		infoin << spells[8] << endl;
		infoin << spells[9] <<
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"user32.lib")

You can delete those two lines because including windows.h forces those two libraries.

[edit]Oops! I was fighting the gargoyle and the program sometimes seems to hang as if it is an infinite loop.

Edited by Ancient Dragon: n/a


How odd..the game seems to have random bugs. Like sometimes it will go into an infinite loop for no reason..:( I don't see any logic errors..

Maybe it is too big?

Edited by restrictment: n/a


Oops! I was fighting the gargoyle and the program sometimes seems to hang as if it is an infinite loop.

I haven't had a chance to play it yet. Did you notice what you did right before it hung (enter a choice, after your attack but before monster attack, after monster attack, before your attack, etc. What choice did you make. Etc.)? If you noticed that stuff did you happen to take a peek at the code where that was going on?

I'm going to go get my hair cut and then I'll have a whack at it.


I tried to cast a spell when I didn't have any...I'm not sure if that had anything to do with it, but option 11 to leave wouldn't let me leave. Also, since I couldn't leave with 11, I pressed 0 and it said that I "successfully used the spell !" where there should clearly be a spell name if I chose a spell which I had in inventory, but I chose 0.

ETA: 4. Forfeit doesn't seem to work, at least on the fighting the bandit.

ETA: Using spells, at least the lower enemy health one, doesn't seem to decrement the remaining spell count after use. Also, it asks me to hit enter twice after using it.

ETA: While battling the dragon, my health went down so I drank a Godly potion and two large potions. After exiting the potion screen (presumably, when the dragon attacked), I was presented with the "you lost" screen, despite me having loads of health points left. Are you sure that you're adding the potion health before continuing with the opponent's attack?

ETA: The above seems to happen every time I drink potions while battling the dragon.

Edited by donaldw: n/a

Votes + Comments
Helps a ton with my RPG

Oh, darn..I add new things and get a ton of new errors! >.<

Anyway, the potions thing happens all the time, I am not sure why, but I will have a look into it.

I also forgot to decrease the spell by 1 after each use, and that was just a dumb error on my part.

The forfeit thing doesn't work, because I used to only have '3' options which I changed to '4', and forgot to change the do-while loop to accept the char of '4'.

However, the spells seem to work fine, did you change any coding on them? Besides the fact that it doesn't decrement 1 from the amount, it won't allow you to choose a different spell, and the '11' works. Please try it again and see what happens.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.