-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONQCOM
257 lines (226 loc) · 11.8 KB
/
CONQCOM
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
###############################################################################
#
# C O N Q C O M
#
# Copyright (C)1983-1986 by Jef Poskanzer and Craig Leres
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that this copyright notice appear in all copies and in all
# supporting documentation. Jef Poskanzer and Craig Leres make no
# representations about the suitability of this software for any
# purpose. It is provided "as is" without express or implied warranty.
#
###############################################################################
#
# Detailed revision history lives in "incl/conqdef"
#
###############################################################################
# Special data items - these must be at the very beginning.
integer commonrev # common block rev number
logical closed # the game is closed, everybody out
integer lockword # exclusionary flag
integer lockmesg # exclusive access to the message area
# Start of permanent data.
# Global statistics.
character conqueror(SIZEUSERPNAME) # user who last conquered
character conqteam(MAXTEAMNAME) # team s/he was on
character conqtime(DATESIZE) # time of last conquering
character lastwords(MAXLASTWORDS) # remarks upon conquering
character inittime(DATESIZE) # time the universe was initialized
integer tstats(NUMTEAMS,MAXTSTATS) # random team statistics
logical tcoupinfo(NUMTEAMS) # knows coup time for own team
# Hidden global statistics.
integer ccpuseconds # cpu seconds used by conquest
integer celapsedseconds # elapsed seconds for conquest
integer dcpuseconds # cpu seconds used by conqdriv
integer delapsedseconds # elapsed seconds for conqdriv
integer rcpuseconds # cpu seconds used by robots
integer relapsedseconds # elapsed seconds for robots
integer raccum # accumulated cpu hundredths
character lastupchuck(DATESIZE) # last time the common block was updated
# User statistics.
logical ulive(MAXUSERS) # user exists or not
integer uteam(MAXUSERS) # team s/he is on
integer umultiple(MAXUSERS) # number of ships a multiple can fly
integer ustats(MAXUSERS,MAXUSTATS) # random team statistics
real urating(MAXUSERS) # current rating for each user
logical urobot(MAXUSERS) # says if a user is a robot
logical uwar(MAXUSERS,NUMTEAMS) # teams s/he is at war with
logical uoption(MAXUSERS,MAXOPTIONS) # user options
logical uooption(MAXUSERS,MAXOOPTIONS) # operator options
character uname(SIZEUSERNAME,MAXUSERS) # user's login name
character upname(SIZEUSERPNAME,MAXUSERS) # user's pseudonym
character ulastentry(DATESIZE,MAXUSERS) # time stamp of last entry
# End of permanent data.
# Start of static data.
# Robots.
integer rstrat(REAL_MAX_VAR,10) # robot strategy table
integer rvec(32) # robot rule to action token
# Planets.
integer pprimary(NUMPLANETS) # planet this planet orbits
real porbrad(NUMPLANETS) # radius of the orbit
real porbvel(NUMPLANETS) # velocity of the orbit in deg/min
integer ptype(NUMPLANETS) # type of planet - M, dead, sun
logical preal(NUMPLANETS) # tells if planet can be seen
character pname(MAXPLANETNAME,NUMPLANETS)
character ptname(MAXPTYPENAME,MAXPLANETTYPES)
# Teams.
integer homeplanet(NUMTEAMS) # planet number of the home planet
integer homesun(NUMTEAMS) # sun number of the home system
integer teamplanets(NUMTEAMS,3) # planet numbers of the home system
integer armylim(NUMTEAMS) # maximum armies a team ship can carry
real warplim(NUMTEAMS) # maximum warp based on team
real engfac(NUMTEAMS) # team engine constants
real accelfac(NUMTEAMS) # team acceleration constants
real weafac(NUMTEAMS) # team weapons constants
real torpwarp(NUMTEAMS) # speed of each teams torpedos
character tname(MAXTEAMNAME,NUMALLTEAMS)
# Characters.
character chrplanets(MAXPLANETTYPES)# class M = M, dead = D, sun = S
character chrtorps(NUMTEAMS) # character to display for torps
character chrteams(NUMALLTEAMS) # F = F R = R K = K O = O
# End of static data.
# Start of semi-static data.
# Teams.
integer couptime(NUMTEAMS) # minutes left till coup possible
# Planets.
integer puninhabtime(NUMPLANETS) # minutes left till inhabitable
# Doomsday machine.
integer dstatus # doomsday status; one of the DS_ values
integer dtype # type of doomsday machine
real dx # x and y coordinates of doomsday
real dy
real ddx # x and y increments in mega-meters
real ddy
real dhead # heading
integer dlock # destination: 0, ship #, or -planet #
character dname(SIZEUSERPNAME) # name of doomsday machine
# End of semi-static data.
# Start of semi-volatile data.
# Planets.
real porbang(NUMPLANETS) # current angle of the orbit
real px(NUMPLANETS) # x coordinates of planet
real py(NUMPLANETS) # y coordinates of planet
integer pteam(NUMPLANETS) # which team owns the planet
integer parmies(NUMPLANETS) # how many armies are on the planet
logical pscanned(NUMPLANETS,NUMTEAMS) # which planets have been
# scanned by which teams
# Last usage stuff.
integer histptr # points to most recent usage
integer histunum(MAXHISTLOG) # user number
character histlog(DATESIZE,MAXHISTLOG) # date string of entry
# End of semi-volatile data.
# Start of volatile data.
# Driver.
integer drivstat # driver status; one of the DRS_ values
integer drivpid # pid of the driver process
integer drivcnt # number of driver timeouts (modp1 1000)
integer drivsecs # phase of the universe in seconds
# (modp1 five minutes)
character drivowner(SIZEUSERNAME) # username of the driver's owner
# The following are seconds since midnight.
integer drivtime # last time the driver looped
integer playtime # last time a player looped
# Ships.
integer sstatus(MAXSHIPS) # one of the SS_ values
integer skilledby(MAXSHIPS) # one of the KB_ values, or:
# >0 means ship number
# <0 means -(planet number)
integer suser(MAXSHIPS) # user number of the ship's captain
integer steam(MAXSHIPS) # team of the ship
integer spid(MAXSHIPS) # process id of ships owner process
real sx(MAXSHIPS) # x and y coordinates of ship
real sy(MAXSHIPS)
real sdx(MAXSHIPS) # x and y increments
real sdy(MAXSHIPS) # in mega-meters per iter seconds
real shead(MAXSHIPS) # direction of motion - [0-359.9]
real sdhead(MAXSHIPS) # desired direction of motion
real swarp(MAXSHIPS) # warp factor: [0-variable] or
# <0 for orbiting
real sdwarp(MAXSHIPS) # desired warp factor: [0-variable]
integer slock(MAXSHIPS) # 0 or -planet locked on to;
# if swarp<0, orbiting
logical sshup(MAXSHIPS) # shields up or down
real sshields(MAXSHIPS) # shield percentage - [0-100]
real skills(MAXSHIPS) # kills - [0-inf]
real sdamage(MAXSHIPS) # damage percentage - [0-100]
real sfuel(MAXSHIPS) # fuel - [0-999]
real swtemp(MAXSHIPS) # weapons temperature
real setemp(MAXSHIPS) # engine temperature
integer swfuse(MAXSHIPS) # seconds until weapons work again
integer sefuse(MAXSHIPS) # seconds until engines work again
integer sweapons(MAXSHIPS) # weapons allocation - [40-60]
integer sengines(MAXSHIPS) # engines allocation is 100-sweapons
integer sarmies(MAXSHIPS) # armies being carried
logical srmode(MAXSHIPS) # in repair mode or not
logical scloaked(MAXSHIPS) # cloaking device on or not
logical soption(MAXSHIPS,MAXOPTIONS)# user options - copy of uoption
logical swar(MAXSHIPS,NUMTEAMS) # teams s/he is at war with - copy
# of uwar
logical srwar(MAXSHIPS,NUMTEAMS) # teams s/he is at WAR with
logical ssrpwar(MAXSHIPS,NUMPLANETS)# self-ruled planets s/he is at war
integer ssdfuse(MAXSHIPS) # self-destruct fuse, 0 normally
integer slastmsg(MAXSHIPS) # last message seen
integer salastmsg(MAXSHIPS) # last message allowed to be seen
logical smap(MAXSHIPS) # strategic map or not
integer stowing(MAXSHIPS) # ship we are towing, or 0
integer stowedby(MAXSHIPS) # ship towing us, or 0
real slastblast(MAXSHIPS) # direction of last weapons usage
real slastphase(MAXSHIPS) # phaser direction, needed by display()
integer spfuse(MAXSHIPS) # tenths until can phaser again
integer sscanned(MAXSHIPS,NUMTEAMS) # fuse for which ships have been
# scanned by which teams
logical stalert(MAXSHIPS) # torp alert!
logical srobot(MAXSHIPS) # true if is a robot ship
integer saction(MAXSHIPS) # current action token if a robot
character spname(SIZEUSERPNAME,MAXSHIPS)
# user's pseudonym, copy of upname()
integer sctime(MAXSHIPS) # cpu hundredths at last check
integer setime(MAXSHIPS) # elapsed thousands at last check
integer scacc(MAXSHIPS) # accumulated cpu time
integer seacc(MAXSHIPS) # accumulated elapsed time
# Torpedoes.
integer tstatus(MAXSHIPS,MAXTORPS) # one of the TS_ values
integer tfuse(MAXSHIPS,MAXTORPS) # seconds left
real tx(MAXSHIPS,MAXTORPS) # x and y coordinates of torps
real ty(MAXSHIPS,MAXTORPS)
real tdx(MAXSHIPS,MAXTORPS) # x and y increments
real tdy(MAXSHIPS,MAXTORPS) # in mega-meters per iter seconds
real tmult(MAXSHIPS,MAXTORPS) # multiplier when detonated
logical twar(MAXSHIPS,MAXTORPS,NUMTEAMS) # copy of uwar when fired
# Messages.
character msgbuf(MESSAGE_SIZE,MAXMESSAGES) # the messages
integer msgfrom(MAXMESSAGES) # >0: ship the message is from
# =0: from GOD
# <0: planet with intruder alert
integer msgto(MAXMESSAGES) # >0: ship the message is to
# =0: to nobody
# <0: team the message is to, and
# TEAM_SELFRULED means everyone
integer lastmsg # the last message sent
logical externrobots # used to disable internal robot code
# Note: glastmsg must be the last variable in the common block.
integer glastmsg # the last message read by God
# End of volatile data.
common /conqcom/ commonrev, closed, lockword, lockmesg, conqueror,
conqteam, conqtime, lastwords, inittime, tstats, tcoupinfo,
ccpuseconds, celapsedseconds, dcpuseconds, delapsedseconds,
rcpuseconds, relapsedseconds, raccum, lastupchuck, ulive, uteam,
umultiple, ustats, urating, urobot, uwar, uoption, uooption,
uname, upname, ulastentry, rstrat, rvec, pprimary, porbrad,
porbvel, ptype, preal, pname, ptname, homeplanet, homesun,
teamplanets, armylim, warplim, engfac, accelfac, weafac,
torpwarp, tname, chrplanets, chrtorps, chrteams, couptime,
puninhabtime, dstatus, dtype, dx, dy, ddx, ddy, dhead, dlock,
dname, porbang, px, py, pteam, parmies, pscanned, histptr,
histunum, histlog, drivstat, drivpid, drivcnt, drivsecs,
drivowner, drivtime, playtime, sstatus, skilledby, suser, steam,
spid, sx, sy, sdx, sdy, shead, sdhead, swarp, sdwarp, slock,
sshup, sshields, skills, sdamage, sfuel, swtemp, setemp, swfuse,
sefuse, sweapons, sengines, sarmies, srmode, scloaked, soption,
swar, srwar, ssrpwar, ssdfuse, slastmsg, salastmsg, smap,
stowing, stowedby, slastblast, slastphase, spfuse, sscanned,
stalert, srobot, saction, spname, sctime, setime, scacc, seacc,
tstatus, tfuse, tx, ty, tdx, tdy, tmult, twar, msgbuf, msgfrom,
msgto, lastmsg, externrobots, glastmsg