-
Notifications
You must be signed in to change notification settings - Fork 10
/
underworld.pas
65 lines (52 loc) · 1.2 KB
/
underworld.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
program Underworld;
{$IFDEF WINDOWS}
{$R underworld-rc.rc}
{$ENDIF}
uses
effects,
echo,
engine,
initializing,
finalizing,
outputcolor,
screens,
{$IFDEF UNIX}
setlocale,
ncrt,
{$ENDIF}
types,
endprogram;
procedure Initialize(var locations: TLocations; var status: TStatus);
begin
//ColorWrite('[+] Initizlization', ColorDebug, 1);
status.isCredits := false;
InitEncoding();
InitSettings();
ShowMenu();
InitCanvas();
InitLocations(locations, status.currentPosition);
InitHeroes(status.hero, status.antiHero);
PrintLocation(status.currentPosition.location.name);
PrintCurrentStatsHero(status.hero);
PrintEvent(status.currentPosition.event, 0, false);
PrintCommands(status.currentPosition.event.commands);
end;
procedure Finalize(var locations: TLocations; var status: TStatus);
begin
if status.isCredits then
ShowCredits();
DisposeAll(locations, status);
end;
var
isPlaying: Boolean;
status: TStatus;
locations: TLocations;
begin
repeat
isPlaying := false;
Initialize(locations, status);
isPlaying := Play(locations, status);
Finalize(locations, status);
until not isPlaying;
ExitProgram(0);
end.