# 3 Re: newbish question
#using <mscorlib.dll>
#using <System.dll>
#using <System.Data.dll>
using namespace System;
using namespace System::Data;
using namespace System::Data::OleDb;
#include <cstdlib>
#include <ctime>
//function parameters
String *Action(String *, String *__gc[], String *__gc[], String *, OleDbConnection *);
int main()
{
//declare array
String *combatants __gc[] = new String *__gc[20];
String *area __gc[] = new String *__gc[20];
//declare variables
String *battle = " ";
String *cont = " ";
String *play = " ";
int count = 3;
int z = 0;
//create connection object
OleDbConnection *ConnectStats = new OleDbConnection();
ConnectStats->ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Documents and Settings\Owner\My Documents\Souronis GAME\Databases.POPT1.mdb";
Console::WriteLine("You are the prince of Babylon!");
Console::WriteLine("PLEASE MAXIMIZE THE SCREEN!");
Console::WriteLine("Upon defeating the Dahaka, time began to warp");
Console::WriteLine();
Console::WriteLine(",,,,,,,,,, , ,, ,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,,,,,,,,,,,,,,,");
Console::WriteLine(",,,,,,, ,,, , ,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..,,,...");
Console::WriteLine(",,,, , ,,, ,,, ,, .@::.,,,,,,,,,,,,:.::,,,,,,,,.@:#:#@+:::");
Console::WriteLine(":......,,, , ,::##+:.,,,,,,,,,,:+*+*:,...,::::+++#@##:*");
Console::WriteLine("@+*@*#*:..,,,,,,..:##@#:.,,.....:.,,:**###@.::*#@#***#@:+:@");
Console::WriteLine("#**##*@@#:...:.**@@*@@@+:::::::::++:.:*#@@*,+.#:*#..,,:*#@@@");
Console::WriteLine("#**+*#**##@##@@@@#@@@@@@*##*****#**#*##@@:.*##@@@@.,,,,,:#@@");
Console::WriteLine("#:@@@@:***##@#@@:@#*@@@@@@@####@@##@@@@@# *@#@@@@@*,,,,,,.*@");
Console::WriteLine("#@@@@@*:#*#*@**#*@@@@@@@@@@@@@@@@*@@@@@@,@@@@@@@@@@.,,,,,,.#");
Console::WriteLine("@@@@@@##@@*##*:@@*@@@@@@@@@@#@@@+@@@@@# @@#@@@@@#@#+,, ,,,,:");
Console::WriteLine("@@@#@@@@#@**:**+#*#@@@@@@@@@@#@@@@@@@@.#@@@@@@@@@*@+,,,,,,,:");
Console::WriteLine("@@@@@@@#@@***+*+#*###@@@@@#@@#@@@@@@@*#@@#@@@@##@@@+,,,,,,,.");
Console::WriteLine("@@#**##@@@##**:*@*#@@@@@@#@@@#@###@@@@@@@@*@@@@@@@@#:,,, ,,.");
Console::WriteLine("##.,,.+#@@####*:**@@@@@@###*##@@#@@@@@@@@@@@@@@@*@@@+, ,.");
Console::WriteLine("*, ,, ,,**@@##@#@#@@@@@@@##*##@@##@@@@@@@@#@*@@@@@##*, ,,+");
Console::WriteLine(", ,, +#@@@*@###@@@@@@@####@@*@@@@@@@@:*@@@@@#**:, ,# ");
Console::WriteLine(",,,,, , :@*@@@#@@##*#@@@@@@##@#@@@@@::.@@@@@@**:++,,: ,,.@");
Console::WriteLine(",,,, *@@@@**@@@@@@@@@@@@@@@@@@@*#@*@@@@@#::**.,:*+.,*@ ");
Console::WriteLine(", ,,,, .*@@@@@@@@@#*@@@@@@@@@@*+#@#+##@@*::::,.:*@@@@@@");
Console::WriteLine(", ,, ,,.:#@@@#@@@@:@#@@@@@@##*#@#*@@#:::+:..*#@@@@@@@ ");
Console::WriteLine(" ...,..:*##@***+#@@@@@@+#####*:::.::.:+@@@@@@@@@@ ");
Console::WriteLine(",,,...:..:.*....:##**:*@#@@@@@@@##@@..:::::*@@@@@@@@@@@@@ ");
Console::WriteLine(", ...:##*+.,,..::* .::*@@:@@@@@#@@@#.:@@@@#@@@@@@@@@@@@@@@ ");
Console::WriteLine(",:.@.+**@@@@@*#*@@ @:*.:*@@@@@@@####.:,@@@@@@@@@@@@@@@@@@@@ ");
Console::WriteLine("W@.*:**#@@@@@@@@@#::@@*,,#@#:@@@@@@*.,:.@@@@@@@@@@@@@@@@#@@@");
Console::WriteLine("#,##@@#@@@@@@@@@@@*@@@@@, **@@@@@@@,:..@@@@@@@@@@@@@@@@@@@@@");
Console::WriteLine("#*#@@@@@@@@@@@@@*.*@@@@@.:::##@@#@:**:*@@@@@@@@@@@@@@@@##*@@");
Console::WriteLine("*#@@@@@@@@@@@@@@.*@@@@@+@#@@@@@@##@@@@@@@@@@@@@@@@@@@@@@@@@@");
Console::WriteLine("#*@@@@@@@@@@@@*.:#@@@@@@@@@#@@*@@#*@@@@@@@@@@@@@@@@@@@@@@@@@");
Console::WriteLine("***@@@@@@@@@#:..@@@@@@@+@@@@@@*@@@@@@@@@@@@@@@@@@@@@@@@@@@#*");
Console::WriteLine(":+++#@@@@@+...*@@@@@@@@+#:+@#*@#@@@@@@#@@@@@@@@@@@@@@@@@@#*");
Console::WriteLine("*::+::::.....@@@@@@@@@##@@#@##@#@@@@@@@@@@@@@@@@@@@@@@@@##*");
Console::WriteLine(".*::.::+:..::@@@@@@@@@@@#@#*@@#@*@@#@@@@@@@@@@@@@@@@@@@@@#**");
Console::WriteLine("##*....*.:#@@@@@#@@@@@@@@#*@#*@+@@#@@@@@@*@@@#@@@@###@@##**");
Console::WriteLine("##@##*+*:#*@@@@@@@@@@@@##*@@:*W@:@@@@@@@@@@@@@@###########**");
Console::WriteLine("#@@@@@@@@@@@@@@@@@#@@@*@@@@@#@@@,@@@@@@@@@@@@@##*#####******");
Console::WriteLine("@@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@+:@@@@@@@@@@@@###########****");
Console::WriteLine("@@#@@@@@@@@@@#@@#@##@@@#@@@@@#@@.@@@@@@@@@@@#####@@@@#######");
Console::WriteLine("##@##@@@@@@@######@#@@@@@@@@@@@@@@@@@@#@@@@@###############@");
Console::WriteLine("*#################*##@@@@@##@@@@@@@@@#@@@@@###@@###@@@##@@#@");
Console::WriteLine();
Console::WriteLine("Now in order restore order back to time, the Prince must battle his former foes one-by-one until nothing is left to oppose him!!!!");
Console::WriteLine("Welcome to the greatest battle to be held in all of time!!");
Console::WriteLine("Prince of Persia::Tournament");
//assign data to subscripts
combatants[0] = "Trainer";
combatants[1] = "Bat";
combatants[2] = "Crow";
combatants[3] = "Male Sands";
combatants[4] = "Fat Sands";
combatants[5] = "Raider";
combatants[6] = "Female Sands";
combatants[7] = "Bladerunner";
combatants[8] = "Wolf";
combatants[9] = "Executioner";
combatants[10] = "Sillhouete";
combatants[11] = "Brute";
combatants[12] = "Vizier";
combatants[13] = "Crowmaster";
combatants[14] = "Hardened Soldier";
combatants[15] = "Shahdee";
combatants[16] = "Empress";
combatants[17] = "Dahaka";
combatants[18] = "Sandwraith";
combatants[19] = "Void";
//level prompts
area[0] = "level one vs. trainer!!";
area[1] = "level two vs. bat!!";
area[2] = "level three vs. crow!!";
area[3] = "level four vs. male sands zombie!!";
area[4] = "level five vs. fat sands zombie!!";
area[5] = "level six vs. raider!!";
area[6] = "level seven vs. female sands zombie!!";
area[7] = "level eight vs. bladerunner!!";
area[8] = "level nine vs. wolf!!";
area[9] = "level ten vs. executioner!!";
area[10] = "level eleven vs. sillhouete!!";
area[11] = "level twelve vs. brute!!";
area[12] = "level thirteen vs. the Vizier of Babylon!!!";
area[13] = "level fourteen vs. Crowmaster!!!";
area[14] = "level fifteen vs. the hardened soldier!!!";
area[15] = "level sixteen vs. Shahdee!!!";
area[16] = "level seventeen vs. the Empress of Time!!!!";
area[17] = "level eighteen vs. the Gaurdian of the Timeline, THE DAHAKA!!!!!";
area[18] = "the final battle vs. the almighty Sandwraith!!!!!!";
area[19] = "Bonus level vs. Mysterious man named Void...";
try
{
//open connection to database
ConnectStats->Open();
Console::Write("Do you wish to play<yes or no>: ");
play = Convert::ToString(Console::ReadLine()->ToUpper());
} //end try
catch (OleDbException *ex)
{
Console::WriteLine(ex->Message);
} //end catch
//end try/catch block
//gameplay check loop
while (play->CompareTo("YES") == 0)
{
//get location for first fight
if (z == 0)
{
play = "A";
z = z + 1;
} //end if
//get location, which may or may not affect your enemy's stats!
if (play->CompareTo("A") == 0)
{
while (battle->CompareTo("CLOCK TOWER") != 0 && battle->CompareTo("GARDEN TOWER") != 0 && battle->CompareTo("PALACE") != 0 && battle->CompareTo("SACRED CAVES") != 0)
{
Console::Write("Which area would you like to fight your next battle in <Clock Tower, Garden Tower, Palace, or Sacred Caves>: ");
battle = Convert::ToString(Console::ReadLine()->ToUpper());
} //end while
Console::WriteLine();
play = "YES";
} //end if
play = Action(play, combatants, area, battle, ConnectStats);
Console::WriteLine(battle);
} //end while
//game over and/or continue
if (play->CompareTo("NO") == 0)
{
Console::WriteLine("GAME OVER! THANK YOU FOR PLAYING!!");
Console::Write("Would you like to continue?<yes or no>: ");
cont = Convert::ToString(Console::ReadLine()->ToUpper());
if (cont->CompareTo("YES") == 0 && count > 0)
{
play = "YES";
count = count - 1;
Console::WriteLine("You have {0} continues left.", count.ToString("N0"));
} //end if
if (cont->CompareTo("NO") == 0)
{
Console::WriteLine("@@@@@@@@ @@@@@@ @@@@@@@@@@ @@@@@@@@ ");
Console::WriteLine("@@@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @@@@@@@@ ");
Console::WriteLine("!@@ @@! @@@ @@! @@! @@! @@! ");
Console::WriteLine("!@! !@! @!@ !@! !@! !@! !@! ");
Console::WriteLine("!@! @!@!@ @!@!@!@! @!! !!@ @!@ @!!!:! ");
Console::WriteLine("!!! !!@!! !!!@!!!! !@! ! !@! !!!!!: ");
Console::WriteLine(":!! !!: !!: !!! !!: !!: !!: ");
Console::WriteLine(":!: !:: :!: !:! :!: :!: :!: ");
Console::WriteLine("::: :::: :: ::: ::: :: :: :::: ");
Console::WriteLine(":: :: : : : : : : : :: :: ");
Console::WriteLine(" ");
Console::WriteLine(" ");
Console::WriteLine("@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@ ");
Console::WriteLine("@@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ ");
Console::WriteLine("@@! @@@ @@! @@@ @@! @@! @@@ ");
Console::WriteLine("!@! @!@ !@! @!@ !@! !@! @!@ ");
Console::WriteLine("@!@ !@! @!@ !@! @!!!:! @!@!!@! ");
Console::WriteLine("!@! !!! !@! !!! !!!!!: !!@!@! ");
Console::WriteLine("!!: !!! :!: !!: !!: !!: :!! ");
Console::WriteLine(":!: !:! ::!!:! :!: :!: !:! ");
Console::WriteLine("::::: :: :::: :: :::: :: ::: ");
Console::WriteLine(": : : : : :: :: : : : ");
} //end if
} //end if
//win
if (play->CompareTo("NOS") == 0)
Console::WriteLine("GAME OVER: CONGRATULATIONS!! YOU HAVE BEATEN EVERY ENEMY AND HAVE RESTORED ORDER TO THE TIMELINE!!");
//end if
//close connection to database
ConnectStats->Close();
return 0;
} //end of main function