//-------------------------------------------------------------------------------------------------------
/* Name: ICO III alpha 0.3
Copyright: W.O.P LTD All Rights Reserved and Didnet LTD
Author: Tommie Larsson and Andreas Ekström
Date:
Description: Third version of the game ICO III*/
//-------------------------------------------------------------------------------------------------------
#include <string> // Library
#include <windows.h> // Library
#include <iostream> // Library
#include <fstream.h> // Library
#include <conio.h> // Library
#include <stdlib.h>
#include <ctime>
#define UNKNOWN 0xFFFFFFFF // Library
#include "ICO III.h"
//-------------------------------------------------------------------------------------------------------
using namespace std;
//-------------------------------------------------------------------------------------------------------
//Time --------------------------------------------------------------------------------------------------
void gotoxy (int x, int y)
{
COORD coord;
coord.X = x; coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
//Time ---------------------------------------------------------------------------------------------------
short int nInput(0);
string sUsername, sCommand, sPassword;
char CharInput;
//-------------------------------------------------------------------------------------------------------
void setcolor(unsigned int color);
void FullScreen();
//-------------------------------------------------------------------------------------------------------
int main()
{
time_t begin = time( NULL ), end;
//Time 2
time_t now;
while (true)
{
//Time 2
//-------------------------------------------------------------------------------------------------------
setcolor (6);
FullScreen();
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << "Turn on this console by writing On and press enter. ";
cout << endl;
cout << "To shut down write Off and then enter.";
cout << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> sCommand;
//-------------------------------------------------------------------------------------------------------
if (sCommand == "On");
//-------------------------------------------------------------------------------------------------------
else {
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << "Goodbye! ";
Sleep (3000);
return 0;
}
//-------------------------------------------------------------------------------------------------------
gotoxy (0,0);
now = time(0);
cout << "\t The time is now: " << ctime(&now);
}
cin.get ();
cout << endl;
cout << "Note: ";
cout << endl;
cout << "This version of the game ICO III needs windows xp and a ";
cout << endl;
cout << "stationary computer to work propaply. ";
cout << endl;
cout << "If you have a labtop the sound will not work " << endl;
cout << "and if you have windows vista the fullscreen mode will not work. ";
cout << endl;
cout << "But if you have a labtop it will show you how much battery" << endl;
cout << "you have left. ";
cout << "Checking your computer battery! ";
cout << endl;
cout << endl;
cout << "Please wait... ";
//-------------------------------------------------------------------------------------------------------
Sleep (8000);
SYSTEM_POWER_STATUS status;
//-------------------------------------------------------------------------------------------------------
GetSystemPowerStatus( &status );
int life = status.BatteryLifePercent;
int secs = status.BatteryLifeTime;
//-------------------------------------------------------------------------------------------------------
cout << life << "% -> ";
//-------------------------------------------------------------------------------------------------------
switch (status.BatteryFlag)
{
//-------------------------------------------------------------------------------------------------------
case 1: cout << "High";
break;
//-------------------------------------------------------------------------------------------------------
case 2: cout << "Low";
break;
//-------------------------------------------------------------------------------------------------------
case 4: cout << "Critical";
break;
//-------------------------------------------------------------------------------------------------------
case 8: cout << "Charging";
break;
//-------------------------------------------------------------------------------------------------------
case 128: cout << "No system battery";
break;
//-------------------------------------------------------------------------------------------------------
case 256: cout << "Unknown status";
break;
}
//-------------------------------------------------------------------------------------------------------
if (secs = UNKNOWN)
{
//-------------------------------------------------------------------------------------------------------
cout << endl << "Amount of time remaining is unkown";
}
//-------------------------------------------------------------------------------------------------------
else cout << endl << secs << " seconds remaining";
//-------------------------------------------------------------------------------------------------------
Sleep (10000);
system("cls");
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << endl;
cout << endl;
cout << "\t / " << endl;
cout << "\t <<<>>> " << endl;
cout << "\t WOPLTD" << endl;
cout << "\t <<<>>> " << endl;
cout << "\t / ";
//-------------------------------------------------------------------------------------------------------
Sleep (6000);
//-------------------------------------------------------------------------------------------------------
system("cls");
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << endl;
cout << endl;
cout << "\t DDDD DDDDD DDDD DDD D DDDDD DDDDDD" << endl;
cout << "\t D DD D D DD DD D D DD DD" << endl;
cout << "\t ----------------------------------------" << endl;
cout << "\t D DD D D DD DD D D DD DD" << endl;
cout << "\t DDDD DDDDD DDDD DD DD DDDDD DD";
//-------------------------------------------------------------------------------------------------------
Sleep (4000);
//-------------------------------------------------------------------------------------------------------
system("cls");
//-------------------------------------------------------------------------------------------------------
Sleep (300);
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << endl;
cout << endl;
cout << endl;
cout << "\t From the makers of DSGM Maker paint" << endl;
cout << "\t we presents to you...";
//-------------------------------------------------------------------------------------------------------
Sleep (6000);
//-------------------------------------------------------------------------------------------------------
cout << endl
<< endl
<< endl
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< "\t END OF THE WORLD ";
cout << endl;
cout << endl;
//-------------------------------------------------------------------------------------------------------
Sleep (3000);
//-------------------------------------------------------------------------------------------------------
Beep(523,500);
Beep(587,500);
Beep(659,500);
Beep(698,500);
Beep(784,500);
//-------------------------------------------------------------------------------------------------------
cout << endl
<< endl
<< endl
<< " ,.=,,==. ,,_ " << endl
<< " _ ,====, _ |I|`` || `|I `| " << endl
<< " |`I| || `==,|``

`` | " << endl
<< " | `` ^^ ||_,===TT`==,,_ | " << endl
<< " |,==Y``Y==,,__| L=_-`' +J/` " << endl
<< " |=_ ' -=#J/..-|=_- =| " << endl
<< " |=_ -;-='`. .|=_- =|----T--, " << endl
<< " |=/ -|=_-. . |=_-/^ =||-|-|::|____ " << endl
<< " |=|| -|=_-. . |=_-| | =|-|-||::|____| " << endl
<< " |=LJ -|=_-. . |=_-|_| =||-|-|:::::::| " << endl
<< " |=_ -|=_-_. |=_- =|-|-||:::::::| " << endl
<< " |=_ -|=//^ . |=_- =||-|-|:::::::| " << endl
<< " ___|/&_,_-|=|| | |=_- =|-|-||:::::::| " << endl
<< " ,--``8%,/ ',%|| | |=_- =||-|-|%:::::::| " << endl
<< " ,---`_,888` ,.'''''`-.,|,|/!,--,.& |& -,|?:::::::| " << endl
<< " |;:;K`__,...;= _____,=`` %%%& %#,---| " << endl
<< " |;::::::::::::| `'.________+------- ``| " << endl
<< "''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' " << endl;
cout << "Your name is Will.";
cout << endl;
cout << "You traveled through mighty lands with a girl named Tika ";
cout << endl;
cout << "in your arms, bow, sword and your horse Erqo. Severel months";
cout << endl;
cout << "later you reached the Temple and laid Tika on the stone table. ";
cout << endl;
cout << "Suddently you heard a voice that said to gain back Tika´s life ";
cout << endl;
cout << "you must kill 3 mighty matter... ";
cout << endl;
//-------------------------------------------------------------------------------------------------------
Sleep (20000);
//-------------------------------------------------------------------------------------------------------
cout << endl
<< endl
<< endl
<< endl
//-------------------------------------------------------------------------------------------------------
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< endl
<< endl
<< endl;
//-------------------------------------------------------------------------------------------------------
while (true)
{
//-------------------------------------------------------------------------------------------------------
gotoxy (0,0);
now = time(0);
cout << "\t Time: " << ctime(&now);
}
cin.get ();
cout << "1. Login: ";
cout << endl;
cout << "2. Create new account ";
cout << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
while (true)
{
//-------------------------------------------------------------------------------------------------------
cout << "Username: ";
cin >> sUsername;
cout << "Password: ";
cin >> sPassword;
//-------------------------------------------------------------------------------------------------------
if (sUsername == "Blackbird" && sPassword == "Unknown") cout << endl;
else if (sUsername == "Didair" && sPassword == "Didair") cout << endl;
//-------------------------------------------------------------------------------------------------------
else {
cout << endl << "\tYour login failed." << endl // Creates a text
<< "\t Please Try Again" << endl // Creates a text
<< endl;
continue;
}
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << endl;
end = time( NULL );
cout << "Up time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "\t Clock time: " << ctime(&now);
}
cin.get ();
cout << "\t |>---------------------------<|" << endl;
cout << "\t |> Welcome to ICO III <|" << endl;
cout << "\t |> <|" << endl;
cout << "\t |> 1. Start ICO III <|" << endl;
cout << "\t |> 2. Credits <|" << endl;
cout << "\t |> 3. Exit ICO III <|" << endl;
cout << "\t |> <|" << endl;
cout << "\t |_____________________________|" << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
end = time( NULL );
cout << "Up time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "\t Clock time: " << ctime(&now);
}
cin.get ();
cout << "\t HP:" << endl;
cout << "\t [------------]" << endl;
cout << "Your first matter is in the great cave...";
Sleep(3000);
cout << endl;
cout << endl;
cout << "Welcome young hero please choose an action ";
cout << endl;
cout << endl;
Sleep (2000);
cout << "Travel to: " << endl;
cout << endl;
cout << "1. Field " << endl;
cout << "2. Exit " << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
end = time( NULL );
cout << "Up time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "\t Clock time: " << ctime(&now);
}
cin.get ();
cout << "\t HP:" << endl;
cout << "\t [------------]" << endl;
cout << "Ride... ";
cout << endl;
Sleep (4000);
cout << endl;
cout << "Finaly I'm here! ";
cout << "Hm... 2 ways to go which one? ";
cout << endl;
cout << endl;
//-------------------------------------------------------------------------------------------------------
while (true)
{
//-------------------------------------------------------------------------------------------------------
end = time( NULL );
cout << "Up time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "Clock time: " << ctime(&now);
}
cin.get ();
cout << "1. Cave ";
cout << endl;
cout << "2. Mountain ";
cout << endl;
cout << "3. Exit ";
cout << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
end = time( NULL );
cout << "Running time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "Clock time: " << ctime(&now);
}
cin.get ();
cout << "\t HP:" << endl;
cout << "\t [------------]" << endl;
cout << "Ride... ";
cout << endl;
Sleep (4000);
cout << endl;
cout << "Something is in there but it just looks like a big heap of stones. ";
cout << endl;
cout << endl;
cout << "What should I do? ";
//-------------------------------------------------------------------------------------------------------
while (true)
{
//-------------------------------------------------------------------------------------------------------
cout << endl;
cout << endl;
cout << "1. Go and check ";
cout << endl;
cout << "2. Exit ";
cout << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
end = time( NULL );
cout << "Up time: " << end - begin << " seconds" << end;
cin.get();
gotoxy (0,0);
now = time(0);
cout << "Clock time: " << ctime(&now);
}
cin.get ();
cout << "Ohh no!, it's moving run! " << endl;
cout << "Look like it's the first matter that god was talking about!";
cout << endl;
cout << endl;
Beep(523,500);
Beep(587,500);
Beep(659,500);
Beep(698,500);
Beep(784,500);
//-------------------------------------------------------------------------------------------------------
while (true)
{
//-------------------------------------------------------------------------------------------------------
cout << "\t HP:" << endl;
cout << "\t [------------]" << endl;
cout << "1. Attack " << endl;
cout << "2. Defence" << endl;
cout << "3. Run" << endl;
cout << "4. Exit" << endl;
cout << endl;
cout << "Option: ";
//-------------------------------------------------------------------------------------------------------
cin >> nInput;
cout << endl;
//-------------------------------------------------------------------------------------------------------
switch (nInput)
{
//-------------------------------------------------------------------------------------------------------
case 1:
cout << endl;
cout << "This part isn't done yet! ";
cout << endl;
cout << endl;
cout << "Please choose another one: ";
break;
//-------------------------------------------------------------------------------------------------------
case 2:
cout << endl;
cout << "This part isn't done yet! ";
cout << endl;
cout << endl;
cout << "Please choose another one: ";
break;
//-------------------------------------------------------------------------------------------------------
case 3:
cout << endl;
cout << "This part isn't done yet! ";
cout << endl;
cout << endl;
cout << "Please choose another one: ";
break;
//-------------------------------------------------------------------------------------------------------
case 4:
cout << "Goodbye! ";
Sleep (3000);
return 0;
break;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
Sleep (2000);
continue;
return 0;
}
}
break;
//-------------------------------------------------------------------------------------------------------
case 2:
cout << "Goodbye! ";
Sleep (3000);
return 0;
break;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
Sleep (2000);
continue;
//-------------------------------------------------------------------------------------------------------
return 0;
}
}
//-------------------------------------------------------------------------------------------------------
case 2:
cout << "This part isn't done yet! ";
cout << endl;
cout << endl;
cout << "Please choose another one: ";
cout << endl;
cout << endl;
break;
//-------------------------------------------------------------------------------------------------------
case 3:
cout << "Goodbye! ";
Sleep (3000);
return 0;
break;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
Sleep (2000);
break;
//-------------------------------------------------------------------------------------------------------
return 0;
}
//-------------------------------------------------------------------------------------------------------
case 2:
cout << "Goodbye! ";
Sleep (3000);
return 0;
break;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
Sleep (2000);
continue;
//-------------------------------------------------------------------------------------------------------
return 0;
}
//-------------------------------------------------------------------------------------------------------
case 2:
cout << "\t |>--------------------------<|" << endl;
Sleep (1000);
cout << "\t |> Made by: <|" << endl;
Sleep (1000);
cout << "\t |> Andreas Ekstr™m <|" << endl;
Sleep (1000);
cout << "\t |> and <|" << endl;
Sleep (1000);
cout << "\t |> Tommie Larsson. <|" << endl;
Sleep (1000);
cout << "\t |> <|" << endl;
Sleep (1000);
cout << "\t |> Company: <|" << endl;
Sleep (1000);
cout << "\t |> Didnet Game <|" << endl;
Sleep (1000);
cout << "\t |> and <|" << endl;
Sleep (1000);
cout << "\t |> <|" << endl;
cout << "\t |> / <|" << endl;
cout << "\t |> <<<>>> <|" << endl;
cout << "\t |> WOPLTD <|" << endl;
cout << "\t |> <<<>>> <|" << endl;
cout << "\t |> / <|" << endl;
Sleep (1000);
cout << "\t |____________________________|" << endl;
Sleep (2000);
cout << endl;
cout << endl
<< endl
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t II II II II II II II" << endl
<< "\t IIII IIIIIII IIIIII IIII IIII IIII" << endl
<< endl
<< endl
<< endl;
cout << "Please login to your ICO III account: ";
cout << endl;
cout << endl;
continue;
//-------------------------------------------------------------------------------------------------------
case 3:
cout << "Goodbye! ";
Sleep (3000);
return 0;
break;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
continue;
return 0;
}
}
//-------------------------------------------------------------------------------------------------------
case 2:
cout << "This part isn't done yet!" << endl;
cout << endl;
cout << "Please choose another one:" << endl;
cout << endl;
continue;
//-------------------------------------------------------------------------------------------------------
default:
cout << "Invalid choice! " << endl;
cout << endl;
cout << "Please choose another one: " << endl;
cout << endl;
break;
//-------------------------------------------------------------------------------------------------------
return 0;
}
}
}
//-------------------------------------------------------------------------------------------------------
void FullScreen()
{
keybd_event(VK_MENU,
0x38,
0,
0);
keybd_event(VK_RETURN,
0x1c,
0,
0);
keybd_event(VK_RETURN,
0x1c,
KEYEVENTF_KEYUP,
0);
keybd_event(VK_MENU,
0x38,
KEYEVENTF_KEYUP,
0);
}
//-------------------------------------------------------------------------------------------------------
void setcolor(unsigned int color)
{
//-------------------------------------------------------------------------------------------------------
if (color >15 || color <=0)
{
cout <<"Error" <<endl; // Creates a text
}
//-------------------------------------------------------------------------------------------------------
else
{
//-------------------------------------------------------------------------------------------------------
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,color);
}
}
//-------------------------------------------------------------------------------------------------------