0

Heyy Daniweb,

Got a project I'm trying to compile and I'm getting the following errors:

--------------------Configuration: rpg - Win32 Debug--------------------
Compiling...
rrrrrrrrrrrrrr.cpp
Walking.cpp
H:\final project\rpg\Walking.cpp(551) : warning C4715: 'See' : not all control paths return a value
Linking...
Walking.obj : error LNK2005: _main already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: _clrscr already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: _setfchcol already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: _setchcol already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: _gotoxy already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: _clreol already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "void __cdecl randomize(void)" (?randomize@@YAXXZ) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int __cdecl random(int)" (?random@@YAHH@Z) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::Weapon3x" (?Weapon3x@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::choosecharacter" (?choosecharacter@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::enemy" (?enemy@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::Good" (?Good@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "char const * * var::argv" (?argv@var@@3PAPBDA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::pShields" (?pShields@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "bool var::Sucker" (?Sucker@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::BadName" (?BadName@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::GoodName" (?GoodName@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::argc" (?argc@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::level" (?level@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Name" (?Name@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::enemyHealth" (?enemyHealth@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::Evil" (?Evil@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Weapon" (?Weapon@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::playeraction" (?playeraction@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrr
rrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Weaponx" (?Weaponx@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.ob
j
Walking.obj : error LNK2005: "bool var::SonicDrowns" (?SonicDrowns@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "float var::enemyShields" (?enemyShields@var@@3MA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "bool var::eng" (?eng@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Answer" (?Answer@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Wep" (?Wep@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "float var::totaldamage" (?totaldamage@var@@3MA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "float var::dmg" (?dmg@var@@3MA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::Number" (?Number@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "bool var::GameOver" (?GameOver@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "bool var::KeyPress" (?KeyPress@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::munition" (?munition@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.
obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Weapon2" (?Weapon2@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.ob
j
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Weapon1" (?Weapon1@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.ob
j
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::WeaponHas" (?WeaponHas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrr
r.obj
Walking.obj : error LNK2005: "int var::ochch" (?ochch@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::NumberAnswer3" (?NumberAnswer3@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::NumberAnswer" (?NumberAnswer@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::NumberAnswer2" (?NumberAnswer2@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::enemyhas" (?enemyhas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.
obj
Walking.obj : error LNK2005: "int var::playerHealth" (?playerHealth@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::eShields" (?eShields@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::AWeapon" (?AWeapon@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.ob
j
Walking.obj : error LNK2005: "int var::qqqqq" (?qqqqq@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::object" (?object@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::AHealth" (?AHealth@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "bool var::ByPass" (?ByPass@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::playerHas" (?playerHas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrr
r.obj
Walking.obj : error LNK2005: "int var::numofene" (?numofene@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::AShields" (?AShields@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::name" (?name@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::enemyHas" (?enemyHas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.
obj
Walking.obj : error LNK2005: "int var::playerShields" (?playerShields@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::ahas" (?ahas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::ashields" (?ashields@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::Enemies" (?Enemies@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.ob
j
Walking.obj : error LNK2005: "int var::enemydmg" (?enemydmg@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::playerhas" (?playerhas@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrr
r.obj
Walking.obj : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > var::AWeapon2" (?AWeapon2@var@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in rrrrrrrrrrrrrr.
obj
Walking.obj : error LNK2005: "bool var::NoWeapons" (?NoWeapons@var@@3_NA) already defined in rrrrrrrrrrrrrr.obj
Walking.obj : error LNK2005: "int var::numclips" (?numclips@var@@3HA) already defined in rrrrrrrrrrrrrr.obj
Debug/rpg.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

rpg.exe - 66 error(s), 1 warning(s)

Also, I've attached the two main files of my program.

Here is my custom namespace (Used for my variables)

namespace var
{
	string enemyHas, playerHas, playerhas, enemy, enemyhas, Weapon, Weapon2, object; 
	string munition, playeraction, WeaponHas, name, ahas, AWeapon, AWeapon2, Answer;
	string Weapon1, Weaponx, Enemies, Wep, Name;
	int enemyHealth, eShields, playerShields, playerHealth, BadName, GoodName;
	int pShields, ochch, argc, choosecharacter, level, enemydmg, AHealth;
	int numofene, AShields, ashields, numclips, qqqqq, NumberAnswer, NumberAnswer3, NumberAnswer2;
	int Weapon3x, Number, Evil, Good;
	const char** argv;
	float enemyShields, dmg, totaldamage;
	bool eng, NoWeapons, GameOver, Sucker, ByPass, SonicDrowns, KeyPress;
}

And my header file (used for my #include's)

#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define BROWN 6
#define LIGHTGREY 7
#define DARKGREY 8
#define LIGHTBLUE 9
#define LIGHTGREEN 10
#define LIGHTCYAN 11
#define LIGHTRED 12
#define LIGHTMAGENTA 13
#define YELLOW 14
#define WHITE 15
#define BLINK 128
#include <H:\lvp\irrKlang-1.3.0\inc\irrKlang.h> //for use with VC++ only
#include <windows.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <H:\lvp\conio.h>
#include <H:\lvp\matrix.h>                
#include <H:\lvp\vector.h>
#include <H:\lvp\random.h>
#include <H:\final project\rpg\fff.h>
#pragma comment(lib, "H:\\lvp\\irrKlang-1.3.0\\irrKlang.lib")

using namespace std;
using namespace irrklang;
using namespace var;

It is very important I figure out the problem within a couple hours, I need this for school!

Thanks,
spartan118

Attachments
#include "H:\lvp\headers.h"

void rndmusic ()
{
	ISoundEngine* engine = createIrrKlangDevice();
	if (!engine) {
		cout << "ERROR!!!!! Could not start engine!!" << endl;
		return;
	}
	randomize();
	int ran = random(100) +1;
	if ((ran >= 1)||(ran < 21))  {
		engine->play2D("H:\\My Music\\empeethrees\\run.mp3", false); // play some mp3 file, looped
		engine->drop();
		if(!engine->drop())
			printf ("\nError!!\n");
	}
	else if ((ran >= 21)||(ran < 41))
	{
		engine->play2D("H:\\My Music\\empeethrees\\maybe.mp3", false);
		engine->drop();
		if(!engine->drop())
			printf ("\nError!!\n");
	}
	else if ((ran >= 41)||(ran < 61))
	{
		engine->play2D("H:\\My Music\\empeethrees\\bittersweet.mp3", false);
		engine->drop();
		if(!engine->drop())
			printf ("\nError!!\n");
	}
	else if ((ran >= 61)||(ran < 81))
	{
		engine->play2D("H:\\My Music\\empeethrees\\ordinary.mp3", false);
		engine->drop();
		if(!engine->drop())
			printf ("\nError!!\n");
	}
	else if ((ran >= 81)||(ran <= 100))
	{
		//engine->play2D("H:\\My Music\\empeethrees\\kids.mp3", false);
		engine->play2D("C:\\kids.flac", false);
		engine->drop();
		if(!engine->drop())
			printf ("\nError!!\n");
	}
	else
		printf ("\nError!\n");
}
BOOL NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
	typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
	SCDMProc_t SetConsoleDisplayMode;
	HMODULE hKernel32;
	BOOL bFreeLib = FALSE, ret;
	const char KERNEL32_NAME[] = "kernel32.dll";

	hKernel32 = GetModuleHandleA(KERNEL32_NAME);
	if (hKernel32 == NULL)
	{
		hKernel32 = LoadLibraryA(KERNEL32_NAME);
		if (hKernel32 == NULL)
			return FALSE;

		bFreeLib = true;
	}//if

	SetConsoleDisplayMode =
	(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
	if (SetConsoleDisplayMode == NULL)
	{
		SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
		ret = FALSE;
	}//if
	else
	{
		DWORD dummy;
		ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
	}//else

	if (bFreeLib)
	FreeLibrary(hKernel32);

	return ret;
}//NT_SetConsoleDisplayMode

void fullscreen(void)
{
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
return;
}
void enemyStats()
{
	if (enemy == "Clone Trooper, Regular")
	{
		enemyShields = 25;
		eShields = 25;
		enemyHealth = 50;
		enemyHas = "Shields";
		enemydmg = 15;
	}
	else if (enemy == "Clone Trooper, Elite")
	{
		enemyShields = 40;
		eShields = 40;
		enemyHealth = 75;
		enemyHas = "Shields";
		enemydmg = 20;
	}
	else if (enemy == "Battle Droid")
	{
		enemyShields = 0;
		eShields = 0;
		enemyHealth = 25;
		enemydmg = 15;
	}
	else if (enemy == "Jedi")
	{
		enemyShields = 0;
		eShields = 0;
		enemyHealth = 200;
		enemydmg = 75;
	}
	else if (enemy == "Sith")
	{
		enemyShields = 0;
		eShields = 0;
		enemyHealth = 210;
		enemydmg = 80;
	}
}
void Encounter ()
{
	rndmusic();
	randomize();
	int enemychance = random(100) +1;
	if ((enemychance >= 1)||(enemychance < 26))
		enemy = "Super Battle Droid";
	else if ((enemychance >= 26)||(enemychance < 37))
		enemy = "Destroyer Droid";
	else if ((enemychance >= 37)||(enemychance < 41))
		enemy = "Jedi";
	else if ((enemychance >= 41)||(enemychance < 45))
		enemy = "Sith";
	else if ((enemychance >= 45)||(enemychance < 71))
		enemy = "Clone Trooper, Elite";
	else if ((enemychance >= 72)||(enemychance <= 100))
	{
		randomize();
		int rrk = random(100) +1;
		if((rrk >= 1)||(rrk < 51))
			enemy = "Battle Droid";
		else if((rrk >= 51)||(rrk <= 100))
			enemy = "Clone Trooper, Regular";
	}
}
void combat ()
{
	enemyStats();
	int X, Z, P;
	cout << "Entering Combat!" << endl;
	Sleep(1500);
	if (level != 1)
		Encounter();
	cout << "Options:\n";
	cout << "----------\n";
	Sleep(1500);
	do {
		setfchcol(LIGHTRED);
		cout << "1. ";
		setfchcol(WHITE);
		cout << "Fire once" << endl;
		cout.flush();
		setfchcol(LIGHTRED);
		cout << "2. ";
		setfchcol(WHITE);
		cout << "Scope-In" << endl;
		cout.flush();
		setfchcol(LIGHTRED);
		cout << "3. ";
		setfchcol(WHITE);
		cout << "Fire x number of clips" << endl;
		cout.flush();
		setfchcol(LIGHTRED);
		cout << "4. ";
		setfchcol(WHITE);
		cout << "Switch weapons" << endl;
		cout.flush();
		Sleep(1000);
		cout << ">>";
		cin >> X;
		if (X == 1) {
			setfchcol(WHITE);
			Sleep(1500);
			if (numofene == 1) {
				cout << "You fire once at the " << enemy << " dealing " << dmg << " damage" << endl;
				if (dmg >= enemyHealth)
					cout << "You have killed the enemy" << endl;
				else if (dmg < enemyHealth)
				{
					cout << "The " << enemy << " survived with " << (enemyHealth * numofene - dmg) << " health." << endl;
					Sleep(400);
					cout << enemy << " returns fire, dealing " << enemydmg << " damage to yourself\nand " << endl;
					randomize();
					int d = random(2) +1;
					if (d == 1)
						cout << "no damage to the Arbiter.";
					else if (d == 2)
						cout << "equal damage to the Arbiter.";
					Sleep(300);
					cout << "Status'\n----------------\n";
					cout << name << "'s health: " << (playerHealth - enemydmg * numofene) << endl;
					cout << "The Arbiter's health: " << endl;
					if (d == 2)
						cout << (AHealth - enemydmg * numofene);
					else
						cout << AHealth << endl;
				}
			}
			else if ((X == 2)||(WeaponHas == "2x Scope"))
			{
				cout << "You zoom in through your scope and: " << endl;
				Sleep(500);
				setfchcol(LIGHTRED);
				cout << "1. ";
				setfchcol(WHITE);
				cout << "Fire one shot" << endl;
				cout << ">>";
				cin >> Z;
				if (Z == 1) 
				{
					cout << "You breath out and focus on the armoured figures head";
					Sleep(500);
					cout << ".";
					Sleep(500);
					cout << ".";
					Sleep(500);
					cout << ".";
						randomize();
						int forp = random(100) +1;
						if ((forp >= 1)||(forp < 51)) 
						{
							enemyHealth = 0;
							cout << "HEADSHOT!! " << enemy << " has died from its wounds" << endl;
						}
						else if ((forp >= 51)||(forp <= 100)) 
						{
							cout << "Well, you missed his head but managed to inflict " << dmg << " damage to him" << endl;
						if (dmg >= enemyHealth)
							cout << "You have killed the enemy!" << endl;
						else if (dmg < enemyHealth)
							cout << "The " << enemy << " has " << (dmg - enemyHealth) << " health left";
						Sleep(1500);
						cout << "The Arbiter took no damage" << endl;
						}
				}
			else if (X == 3)
			{
				setfchcol(WHITE);
				cout << "Please enter number of clips you wish to fire\nThis number cannot be greater than the";
				Sleep(800);
				cout << "\nnumber of clips you have";
				Sleep(800);
				cout << "\n>>";
				cin >> P;
				if (P == 1) {
					cout << "You fire one clip at the enemy, and ";
					(numclips - 1);
					randomize();
					int l = random(100) +1;
					if ((l >= 1)||(l < 26))
					{
						totaldamage = (8 * dmg);
						cout << "You fire your entire clip at the " << enemy << "(s) before pausing to reload." << endl;
						Sleep(1500);
						cout << "8 of 32 bullets strike ";
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
						Sleep(1000);
					}
					else if ((l >= 26)||(l < 51))
					{
						totaldamage = (16 * dmg);
						cout << "You fire your entire clip at the " << enemy << "(s) before pausing to reload." << endl;
						Sleep(1500);
						cout << "16 of 32 bullets strike ";
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
					}
					else if ((l >= 51)||(l < 76))
					{
						totaldamage = (24 * dmg);
						cout << "You fire your entire clip at the " << enemy << "(s) before pausing to reload." << endl;
						Sleep(1500);
						cout << "24 of 32 bullets strike ";
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
					}
					else if ((l >= 76)||(l <= 100))
					{
						totaldamage = (0 * dmg);
						cout << "You managed to successfully miss your target(s)";
					}
					else
						cout << "How..." << endl;
				}
				else if (P == 2)
				{
					cout << "You fire two clips at the enemy, and ";
					(numclips - 2);
					randomize();
					int zzz = random(100) +1;
					if ((zzz >= 1)||(zzz < 26))
					{
						totaldamage = (16 * dmg);
						cout << "You fire your first clip at the " << enemy << "(s)\n, reload, then fire the second." << endl;
						Sleep(1500);
						setfchcol(YELLOW);
						cout << "16 of 64 bullets strike ";
						cout.flush();
						setfchcol(WHITE);
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
						Sleep(1000);
					}
					else if ((zzz >= 26)||(zzz < 51))
					{
						totaldamage = (24 * dmg);
						cout << "You fire your first clip at the " << enemy << "(s)\n, reload, then fire the second." << endl;
						Sleep(1500);
						setfchcol(YELLOW);
						cout << "24 of 64 bullets strike ";
						cout.flush();
						setfchcol(WHITE);
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
						Sleep(800);
						cout << "You pause to reload" << endl;
					}
					else if ((zzz >= 51)||(zzz < 76))
					{
						totaldamage = (32 * dmg);
						cout << "You fire your first clip at the " << enemy << "(s)\n, reload, then fire the second." << endl;
						Sleep(1500);
						cout << "32 of 64 bullets strike ";
						cout << "the " << enemy << "(s) dealing a total of " << totaldamage;
						cout << " damage";
					}
					else if ((zzz >= 76)||(zzz <= 100))
					{
						cout << "You fire your first clip at the " << enemy << "(s)\n, reload, then fire the second." << endl;
						Sleep(1500);
						totaldamage = (0 * dmg);
						cout << "Every shot misses and you completely miss your target(s)";
					}
					else
						cout << "How..." << endl;
				}
				else if (P == 3)
				{
					randomize();
					int rrr = random(100) +1;
					if ((rrr >= 1)||(rrr < 26))
					{
						totaldamage = (32 * dmg);
						cout << "You fire clip 1, then reload,  before pausing to reload" << endl
/* This is Amanda F. Penny's Star Wars RPG.  It is not as Star Wars-y as it could be, 
but you'll have to make do.
*/
#include "H:\lvp\headers.h"

void ChangeToGreen()
{
	cout.flush();
	setfchcol(GREEN);
}

void ChangeToRed()
{
	cout.flush();
	setfchcol(RED);
}

void ChangeToWhite()
{
	cout.flush();
	setfchcol(WHITE);
}

void Begin()
{
	bool KeyPress=false;
	
	ISoundEngine* engine = createIrrKlangDevice();  //Create the irrKlang sound engine
	if(!engine)
	{
		cout << "Error!\n";
		return;
	}
	engine->play2D("H:\\My Music\\empeethrees\\SOUND1.WAV", false);//the 2nd parameter is if you want it looped (true) or not looped (false) CONVERT YOUR
	//WAV FILE TO AN FLAC OR MP3!!!
	clrscr();
	engine->drop();
	if(!engine->drop())
	{
		cout << "Error!\n";
		return;
	}
		
	cout << "Press any key to start..." << endl;
	cin.get();  //getch is so old.
}


void SonicDrowning()
{
		
		bool KeyPress=false;
		
		ISoundEngine* engine = createIrrKlangDevice();  //Create the irrKlang sound engine
	
		if(SonicDrowns=true)
		{
		
		system("cls");  //Clear the screen
		engine->play2D("H:\\ComputerInfoScience11\\FinalProject\\Walking\\Sounds\\Drowning.mp3", false);
		}
		engine->drop();
		//Sleeping is not required
		system("pause");
		
}

void YoureASucker()
{
		KeyPress=false;
		
		ISoundEngine* engine = createIrrKlangDevice();  //Create the irrKlang sound engine
	
		if(Sucker=true){
		
		system("cls");  //Clear the screen
		engine->play2D("H:\\My Music\\empeethrees\\thejokermarkhamill.wav", false);
		}
		engine->drop(); // delete engine
		//GAHH HELP ME WITH ALL THEZE ERRORZ
		system("pause");
}

void SoundTastic()
{  //Function to start sounds
	KeyPress=true;  //Initialize press any key to continue
		
	ISoundEngine* engine = createIrrKlangDevice();  //Create the irrKlang sound engine
	if(GameOver=true){
	system("cls");  //Clear the screen
	engine->play2D("H:\\My Music\\empeethrees\\GameOver.mp3", false);//the 2nd parameter is if you want it looped (true) or not looped (false)
	clrscr();
	engine->drop(); // delete engine
	system("pause");
	//Sleeping here is not required.
	}
		
		
	if(GameOver=true)
	{ 
	ChangeToRed();
	clrscr();
	cout << "Game over." << endl;
	ChangeToWhite();
	}

}


void Mission()//The mission function
{  
	Wep="blaster rifles";
	Enemies="Droidekas";
	clrscr();
	if(NoWeapons=true)
		Weaponx="comlink";
	Wep="blaster carbines";

	cout << "They send you topside and point you towards a square building.  They want you to steal a generator" << endl;
	cout << "so that they can power some weird gun they have going on." << endl;
	cout << "They tell you of a specific way to get there." << endl;
	cout << "Do you ";
	ChangeToGreen();  //I think this stuff is self-explanatory...
	cout << "call";
	ChangeToWhite();
	cout << " their bluff or do you ";
	ChangeToGreen();
	cout << "go ";
	ChangeToWhite();
    cout << "their way?" << endl;
	do {  //do this forever if the answer isn't call or go
		cin >> Answer;
	} while((Answer!="call")&&(Answer!="go"));
		
		if(Answer=="call")
		{
			clrscr();
			cout << "You snarl at them and step off of their precious route." << endl;  
			cout << "Instantly a squad of highly skilled " << endl;
			cout << Enemies << " come in and destroys you with their " << Weapon << ".  Nice going." << endl;
			system("pause");
			clrscr();
			GameOver=true;
			clrscr();
			cout << "I shouldn't even have to tell you that you are dead,\n ";
			cout << "but I will just to rub it in your face." << endl;
			system("pause");  //So they have time to read their compliment
			SoundTastic();  //Make them listen to GameOver
		}
		else if(Answer=="go")
		{
			clrscr();
			cout << "You decide to humour them and follow the route they indicate." << endl;  
			cout << "By accident you kick a stone and it goes rolling away. " << endl; 
			cout << " After a couple of inches a fantastic explostion throws" << endl;
			cout << " you to the ground.  What do you want to do now?" << endl;
			cout << "--------------------------------------------------------------------------------" << endl;
			cout << "1. Stay there and hope someone comes to help you." << endl;
			cout << "2. Get up and continue on your mission." << endl;
			cout << "3. Run." << endl;
			cin >> NumberAnswer;
		}
		
		if(NumberAnswer==1)
		{
			cout << "You lie down on the ground, pretending to be dead." << endl;  
			cout <<	"You have underestimated the thoroughness" << endl;
			cout << " of the enemy and your fake-out becomes real as "  << endl;
			cout <<	"they shred you with their " << Weapon << endl;
			system("pause");
			GameOver=true;
			SoundTastic();
		}
		else if(NumberAnswer==2)
		{
			cout << "You get up carefully and continue on your way.  You can't see the mines, " << endl;
			cout << "and you are very scared of stepping on one." << endl;
			cout << "You make it to the building without any trouble." << endl;
			cout << "Do you want to ";
			ChangeToGreen();
			cout << "storm " << endl;
			ChangeToWhite();
			cout << "in or do you want to " << endl;
			ChangeToGreen();
			cout << "sneak " << endl;
			ChangeToWhite();
			cout << "in?" << endl;
			
			do {
				cin >> Answer;
			} while((Answer!="storm")&&(Answer!="sneak"));
			
			if(Answer=="storm")
			{
				cout << "Of course that was the brightest thing to do, " << endl;
				cout << "considering you already know how dangerous it " << endl;
				cout << "it is here.  A giant trap crashes down from the " << endl;
				cout << "ceiling and crushes you, puncturing all of your " << endl;
				cout << "major organs and allowing you to shed blood slowly " << endl;
				cout << "in a long, torturous death." << endl;
				SoundTastic();
			}
			else if(Answer=="sneak")
			{
				cout << "You tiptoe into the building and look around cautiously." << endl;
				cout << "You take out your " << Weaponx << " and creep inside." << endl; 
				cout << "There is no one around, which is pretty suspicious in itself." << endl;
				cout << "Do you want to keep going with this?" << endl;
				do {
					cin >> Answer;
					if(Answer=="yes")
					{
						cout << "You turn to try to leave, but you are so nervous that you drop" << endl;
						cout << " your " << Weaponx << " and it goes crashing to the floor." << endl;
						cout << "to your shock, a dark Jedi descends from the ceiling and " << endl;
						cout << "draws his lightsaber.  What are you going to do?" << endl;
						system("pause");
						clrscr();
						cout << "Unfortunately, Jedi move faster than you can think.  " << endl;
						cout << "While you are figuring out what to do, the dark Jedi " << endl;
						cout << "swoops down and slices you to pieces." << endl;
						system("pause");
						SoundTastic();

					}	
				} while((Answer!="yes")&&(Answer!="no"));
			}
			
			else if(NumberAnswer==3)//Because everybody needs insulted
			{ 
				cout << "Of course, the stupid idiot that you are, you forgot about the mines." << endl;
				cout << "Your new friends watch in horror as you are blown to bits by the mines " << endl;
				cout << "and the rest of your body destroyed by the enemy. " << endl;
				cout << "Not that you can read this, of course.  You don't have eyes to do so with." << endl;
				system("pause");
				GameOver=true;
				SoundTastic();
			} 
		}
		
		

	}
	void KillIt()
	{  //The how evil are you function that doesn't really do anything
		cout << "You take out your " << Weapon1 << " and you attack the thing.  Just for interest, why are you attacking it?";
		cout << "Is it because you ";
		ChangeToGreen();
		cout << "hate";
		ChangeToWhite();
		cout << " it?  or are you just "; 
		ChangeToGreen();
		cout << "sadistic?";
		ChangeToWhite();
		do {
		cin >> Answer;
		} while((Answer!="hate")&&(Answer!="sadistic"));
			if(Answer=="hate")
			{
				Evil++;
				cout << "That's a bit silly...all it did was walk in front of you by mistake." << endl;
			}
			else if(Answer=="sadistic")
			{
				Evil=Evil+2;
				cout << "That's comforting." << endl;
			}
		cout << "Despite your best efforts, you are unable to avoid meeting people along your way." << endl;
		cout << "You come across some people who somehow manage to convince you to do something for " << endl;
		cout << "them." << endl;
		Mission();
		
	}
	
	
	void Ignoramus()
	{
		Good++;  //You are a wimp but you're a good wimp
		cout << "You keep on walking and walking without doing anything.  You'll probably be doing";
		cout << " this for the next twenty minutes.  I wonder if you'll get bored by then...";
		system("pause");
		clrscr();
		cout << endl;
		cout << "You ";
		Sleep(3000);
		for(int i=0; i<100;i++){
			cout << "walk and ";
		}
		system("pause");
		clrscr();
		system("pause");
		clrscr();
		cout << "Are you bored yet?" << endl;
		cout << "Would you like to ";
		ChangeToGreen();
		cout << " do";
		ChangeToWhite();
		cout << " something or";
		ChangeToGreen();
		cout << " keep ";
		ChangeToWhite();
		cout << "on walking?" << endl;
		do{
			cin >> Answer;
		}while((Answer!="do")&&(Answer!="keep"));
		if(Answer=="do"){
			ByPass=true;
		}
		else
			cout << "Oh, did you say you wanted to do something?" << endl;
			getch();
			cout << "All right then, here you go! :) " << endl;
			SonicDrowns=true;
			SonicDrowning();
			cout << "You meet some people that are so mad at you " << endl;
			cout << "for never wanting to do anything that they make " << endl;
			cout << "you do something for them." << endl;
			system("pause");
			Mission();

		}
		
		
	void ItemList() {
			cout << "You have one glowrod, one " << Weapon1 << " , one " << Weaponx << " and a comlink that can receive but not send.";
			
	}
		void WhatNext()
		{  //The function that may destroy you
			
			cout << NumberAnswer3;
			if(NumberAnswer3==2){
				randomize();
				Number=random(10)+1;
				
				if(Number<2)
				{
					clrscr();
					cout << "They beat you badly and take away your weapons.  They throw you in a dingy cell" << endl;
					cout << "somewhere and
2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by VernonDozier
0

Also, I've attached the two main files of my program.

Why do you have two main functions? That's going to screw everything up. Besides that, make sure you have #ifndef guards in your header files. If you try to define something twice, it screws the linkage up, so normally you put something like this at the top of the header file:

#ifndef HEADERS_H
#define HEADERS_H

then this at the bottom:

#endif

Edited by VernonDozier: n/a

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.