Arctic Incident is a simple turn-based idle game that puts you on a remote barren planet called Neverdobien. It is still a work in progress, I plan to add many new features and extras. There will be even a section with something similar in gameplay to interactive fiction games. So far the mechanics are completely not balanced at all. Formulas may and will surely change. Since this is a one-cat project first I am implementing all the major systems in the game then make sure the variables work as intended. Once I have all major systems programmed then I will proceed with balancing the game. So, do not shit on me for a lack of balance.
Program Arctic_Incident;
Uses Crt,Dos;
Procedure cmd_entry; forward;
const
DayStr:array[0..6] of string[3]=('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
MonthStr:array[1..12] of string[3]=('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
var exit_test: Byte;
text: string;
number_antennae: Word;
number_scanners: Word;
number_probes: Word;
asteroids_found: Integer;
asteroids_found_total: Real;
asteroids_with_metal: Integer;
asteroids_with_metal_total: Real;
metal: Real;
energy: Real;
rng_cosmic: Word;
Year,Month,Day,WDay,Hour,Min,Sec,HSec: Word;
Function L0(w:word):string;
var
s:string;
begin
Str(w,s);
if w<10 then
L0:='0'+s
else
L0:=s;
end;
Procedure game_init;
begin
number_antennae:=1;
number_scanners:=1;
number_probes:=1;
asteroids_found:=0;
asteroids_found_total:=0;
asteroids_with_metal:=0;
asteroids_with_metal_total:=0;
metal:=0;
energy:=0;
end;
Procedure info;
begin
GotoXy(2,2);
Delay(150);
Write('You are stranded on an unknown planet due to a critical warp drive malfunction.');
GotoXy(2,3);
Delay(150);
Write('Your mission was to reach Kepler c1337-B system to check if conditions there');
GotoXy(2,4);
Delay(150);
Write('were right for the next humanity`s home. You are quite lucky to have survived');
GotoXy(2,5);
Delay(150);
Write('the crash landing.');
GotoXy(2,6);
Delay(150);
Write('Fortunately, some of your basic equipment have survived your aggressive');
GotoXy(2,7);
Delay(150);
Write('landing procedure. You will have to use them well in order to gather enough');
GotoXy(2,8);
Delay(150);
Write('resources to repair your ship`s warp drive and finish your mission. So far you');
GotoXy(2,9);
Delay(150);
Write('decided to take a courtesy of naming this unknown planet. Neverdobien...');
GotoXy(2,10);
Delay(150);
Write('A quick glimpse over the survival unit`s sensors screen revealed that the');
GotoXy(2,11);
Delay(150);
Write('outside air temperature is below -67C and is barely breatable. The suit is');
GotoXy(2,12);
Delay(150);
Write('strongly advised. External winds blow over 340kph making it almost impossible');
GotoXy(2,13);
Delay(150);
Write('to walk without hooking yourself to the capsule.');
GotoXy(2,14);
Delay(150);
Write('Peering through the unit`s window revealed what seems to be an endless snow');
GotoXy(2,15);
Delay(150);
Write('wastes going in every direction to the barely visible horizon line. Not much');
GotoXy(2,16);
Delay(150);
Write('more features were you able to distinguish between fast moving strands of');
GotoXy(2,17);
Delay(150);
Write('razor sharp ice and snow particles being blown with enourmous speeds. You would');
GotoXy(2,18);
Delay(150);
Write('definitely want to stay inside in such hail.');
GotoXy(2,21);
Delay(150);
Write('Welcome to an Arctic Incident on a planet of Neverdobien.');
GotoXy(2,22);
Delay(150);
Write('A turn-based idle game with an actual ending by Przem');
ReadKey;
end;
Procedure buy_antenna;
var
metal_needed: Real;
energy_needed: Real;
begin
metal_needed:=sqrt(number_antennae)*(number_antennae+1024);
energy_needed:=sqrt(number_antennae*number_antennae*number_antennae)*(number_antennae+2048);
GotoXy(2,2);
Write('Metal needed: ',metal_needed:0:0,' Energy needed: ',energy_needed:0:0);
ReadKey;
if (metal>metal_needed) and (energy>energy_needed) then
begin
GotoXy(2,2);
number_antennae:=number_antennae+1;
metal:=metal-metal_needed;
energy:=energy-energy_needed;
Write('Antenna bought. Used ',metal_needed:0:0,' metal. Metal left: ',metal:0:0);
GotoXy(2,3);
Write('Energy used: ', energy_needed:0:0,' energy left: ',energy:0:0);
ReadKey;
end
else
begin
GotoXy(2,2);
Write('Not enough resources. You need ',abs(metal-metal_needed):0:0,' metal more');
GotoXy(2,3);
Write('and ',abs(energy-energy_needed):0:0,' more Energy');
ReadKey;
end
end;
Procedure buy_probe;
begin
GotoXy(2,2);
number_probes:=number_probes+1;
Write('Probe bought');
ReadKey;
end;
Procedure ass_scan;
var
ix:integer;
iy:integer;
is_ass:integer;
begin
GotoXy(2,2);
Write('Asteroid scanner interface enabled');
asteroids_found:=0;
asteroids_with_metal:=0;
for ix:=3 to 78 do
begin
GotoXy(2,22);
Write('Asteroids found: ',asteroids_found,' asteroids with metal: ',asteroids_with_metal);
GotoXy(2,23);
Write('==== Totals will be available after scan is complete ====');
for iy:=3 to 21 do
begin
GotoXy(ix,iy);
is_ass:=random(32768)+1;
if is_ass>30000 then
begin
Write(chr(254));
metal:=metal+random(255)+1;
asteroids_with_metal:=asteroids_with_metal+1;
asteroids_found:=asteroids_found+1;
GotoXy(2,22);
Write('Asteroids found: ',asteroids_found,' asteroids with metal: ',asteroids_with_metal);
end
else if (is_ass<29999) and (is_ass>25000) then
begin
Write(chr(249));
asteroids_found:=asteroids_found+1;
GotoXy(2,22);
Write('Asteroids found: ',asteroids_found,' asteroids with metal: ',asteroids_with_metal);
end
else
Write(chr(178));
Gotoxy(2,22);
Write('Asteroids found: ',asteroids_found,' asteroids with metal: ',asteroids_with_metal);
end;
end;
asteroids_found_total:=asteroids_found_total+asteroids_found;
asteroids_with_metal_total:=asteroids_with_metal_total+asteroids_with_metal;
GotoXy(2,23);
Write(' ');
GotoXy(2,23);
Write('Total found: ',asteroids_found_total:0:0,' total with metal: ',asteroids_with_metal_total:0:0);
ReadKey;
end;
Procedure get_energy;
var
energy_received:Real;
begin
energy_received:=(random(255)+1)*number_antennae*sqrt(number_probes);
energy:=energy+energy_received;
GotoXy(2,2);
Write('Harvested ',energy_received:0:0,' energy using dark matter antennae');
ReadKey;
end;
Procedure draw_scr;
var i:integer;
begin
for i:=2 to 79 do
begin
GotoXy(i,1);
Write(chr(196));
Delay(25);
GotoXy(i,24);
Write(chr(196));
Delay(25);
end;
for i:=2 to 23 do
begin
GotoXy(1,i);
Write(chr(179));
Delay(25);
GotoXy(80,i);
Write(chr(179));
Delay(25);
end;
Delay(50);
GotoXy(1,1);
Write(chr(218));
Delay(50);
GotoXy(80,1);
Write(chr(191));
Delay(50);
GotoXy(1,24);
Write(chr(192));
Delay(50);
GotoXy(80,24);
Write(chr(217));
end;
Procedure status;
var i:integer;
Begin
ClrScr;
draw_scr;
GotoXy(2,2);
Write('Status screen');
for i:=2 to 79 do
begin
GotoXy(i,3);
Write(chr(196));
Delay(25);
end;
Delay(250);
GotoXy(2,4);
Write('Number of Antennae: ',number_antennae);
Delay(250);
GotoXy(2,5);
Write('Number of Scanners: ',number_scanners);
Delay(250);
GotoXy(2,6);
Write('Number of Probes: ',number_probes);
Delay(250);
GotoXy(2,7);
Write('Metal: ',metal:0:0);
Delay(250);
GotoXy(2,8);
Write('Energy: ',energy:0:0);
Delay(250);
GotoXy(2,9);
Write('Asteroids found: ',asteroids_found_total:0:0);
Delay(250);
GotoXy(2,10);
Write('Asteroids with metal: ',asteroids_with_metal_total:0:0);
Delay(250);
GotoXy(2,11);
Write('Random number: ',rng_cosmic);
GotoXy(23,2);
ReadKey;
cmd_entry;
End;
Procedure cmd_entry;
var command: string;
Begin
ClrScr;
GetTime(Hour,Min,Sec,HSec);
GetDate(Year,Month,Day,WDay);
rng_cosmic:=random(65535)+1;
GotoXy(1,1);
Write('A: ',number_antennae,' S:',number_scanners,' P:',number_probes,' M:',metal:0:0,' E:',energy:0:0,' RNG:',rng_cosmic);
GotoXy(71,24);
Write(chr(219),L0(Hour),':',L0(Min),':',L0(Sec),chr(219));
GotoXy(1,24);
Write(chr(219)+DayStr[WDay]+' ',Day,' '+MonthStr[Month]+' ',Year,chr(219)+' Enter command: ');
readln(command);
if command='status' then
status
else if command='buy_antenna' then
buy_antenna
else if command='get_energy' then
get_energy
else if command='ass_scan' then
ass_scan
else if command='buy_probe' then
buy_probe
else if command='exit' then
exit_test:=1
else if command='info' then
info
else if command='fuck you' then
begin
GotoXy(2,2);
Write('Fuck you too, you motherfucking piece of diarrhoetic spawn of a donkey ass!');
ReadKey;
end
else if command='help' then
begin
GotoXy(2,2);
Write('Available commands: info, status, help, buy_antenna, buy_probe, get_energy, ass_scan, exit');
ReadKey;
end
else
begin
GotoXy(18,24);
Write('Wrong command. Try again.');
ReadKey;
end;
End;
Begin
Randomize;
ClrScr;
game_init;
info;
while exit_test<>1 do
cmd_entry;
End.
Last code update: 19.02.2024
This is it. I usually do not comment my code. I think it is simple enough to be self-explanatory.
So far it has 344 lines of code, newlines inclusive. Feel free to use it as you wish, change, expand or else. Would be nice if you have given me a credit but I am not your mother to tell you what to do.
Here you can download the ARCTIC.PAS sourcecode.