-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathboss.pas
152 lines (123 loc) · 4.17 KB
/
boss.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{ Moria Version 5.0 COPYRIGHT (c) Robert Alan Koeneke
Public Domain
Modified EXTENSIVELY by:
Matthew W. Koch -MWK
with minor help from:
Kendall R. Sears -Opusii
Russell E. Billings -REB
David G. Strubel -DGS
I lovingly dedicate this game to hackers and adventurers
everywhere...
Designer and Programmer : Robert Alan Koeneke
University of Oklahoma
Assitant Programmer : Jimmey Wayne Todd
University of Oklahoma
Moria may be copied and modified freely as long as the above
credits are retained. No one who-so-ever may sell or market
this software in any form without the expressed written consent
of the author Robert Alan Koeneke.
_______________________________________________________________________
BOSS version 2.4 by Robert Gulledge
and Jason Black
BOSS version 2.4b by Michal Bielinski
}
{ [inherit('sys$share:starlet'), environment('BOSS.env')] }
program BOSS;
{$DEFINE SH_DEBUG}
{$INCLUDEPATH inc}
{$I-}
uses crt, dateutils, math, strutils, sysutils;
{ Globals }
{$INCLUDE constants.inc}
{$INCLUDE types.inc}
{$INCLUDE variables.inc}
{ Global Values }
{.$INCLUDE objects.inc}
// included in globals
{ Libraries of routines }
{$INCLUDE io.inc}
{$INCLUDE misc.inc}
{$INCLUDE treasure.inc}
{$INCLUDE help.inc}
{$INCLUDE desc.inc}
{$INCLUDE files.inc}
{$INCLUDE death.inc}
{$INCLUDE store1.inc}
{$INCLUDE datafiles.inc}
{$INCLUDE save.inc}
{$INCLUDE create.inc}
{$INCLUDE generate.inc}
{$INCLUDE main.inc}
{ Initialize, restore, and get the ball rolling. }
BEGIN
{ Get the directory location of the image}
get_paths;
{ Some neccesary initializations }
msg_line := 1;
quart_height := screen_height div 4;
quart_width := screen_width div 4;
dun_level := 0;
turn := 5760; {8:00 a.m.}
wierd_chance := 8640;
{ Grab a random seed from the clock }
//seed := get_seed;
randomize; { this should be enough for now -MB }
{ Read in the monster and object data files. }
read_data;
{ Sort the objects by level }
sort_objects;
{ Init monster and treasure levels for allocate }
init_m_level;
init_t_level;
{ Init the store inventories }
store_init;
{ If you wish call this to change economical game balance.
1.00 is default value and does not need to run price_adjust. -MB}
//price_adjust(1.00);
{ Check or create hours.dat, print message }
if paramcount = 1 then
finam := paramstr(1);
intro('');
{ Generate a character, or retrieve old one... }
if load_game(finam) = true then
BEGIN { Retrieve character }
generate := get_char(finam);
change_name;
magic_init(system.randseed)
END
else
BEGIN { Create character }
create_character;
char_inven_init;
if (py.misc.pskill in [1,2,7]) then
BEGIN
learn_spell(msg_flag);
gain_mana(int_adj)
END;
if (py.misc.pskill in [3,4]) then
BEGIN
learn_prayer;
gain_mana(wis_adj)
END;
if (py.misc.pskill in [5,6]) then
BEGIN
learn_extra(msg_flag);
gain_mana(chr_adj)
END;
py.misc.cmana := py.misc.mana;
magic_init(system.randseed);
generate := true;
END;
{ begin the game }
with py.misc do { This determines the maximum player experience }
player_max_exp := trunc(player_exp[max_player_level-1]*expfact);
clear(1,1);
prt_stat_block;
{ Loop till dead, or exit }
repeat
if (generate) then generate_cave; { New level }
dungeon; { Dungeon logic-located in Main.Inc }
generate := true
until (death);
upon_death { Character gets buried }
END.