Subversion Repositories eduke32

Rev

Rev 5045 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5045 Rev 5046
1
-- CON language definitions
1
-- CON language definitions
2
2
3
local lpeg = require("lpeg")
3
local lpeg = require("lpeg")
4
4
5
local pairs = pairs
5
local pairs = pairs
6
local print = print
6
local print = print
7
local setmetatable = setmetatable
7
local setmetatable = setmetatable
8
local type = type
8
local type = type
9
9
10
10
11
module(...)
11
module(...)
12
12
13
13
14
MAXVOLUMES = 7
14
MAXVOLUMES = 7
15
MAXLEVELS = 64
15
MAXLEVELS = 64
16
MAXGAMETYPES = 16
16
MAXGAMETYPES = 16
17
17
18
MAXSKILLS = 7
18
MAXSKILLS = 7
19
19
20
MAXSOUNDS = 4096
20
MAXSOUNDS = 4096
21
21
22
MAXSESSIONVARS = 8  -- KEEPINSYNC lunatic_game.c
22
MAXSESSIONVARS = 8  -- KEEPINSYNC lunatic_game.c
23
23
24
-- KEEPINSYNC quotes.h
24
-- KEEPINSYNC quotes.h
25
25
26
-- For Lunatic, MAXQUOTES is OBITQUOTEINDEX because starting from that index
26
-- For Lunatic, MAXQUOTES is OBITQUOTEINDEX because starting from that index
27
-- are obituary and suicide quotes which are passed as *format strings* to
27
-- are obituary and suicide quotes which are passed as *format strings* to
28
-- sprintf() in C.
28
-- sprintf() in C.
29
REALMAXQUOTES = 16384
29
REALMAXQUOTES = 16384
30
MAXQUOTES = REALMAXQUOTES-128
30
MAXQUOTES = REALMAXQUOTES-128
31
MAXQUOTELEN = 128
31
MAXQUOTELEN = 128
32
32
33
local STR = {
33
local STR = {
34
    STR_MAPNAME = 0,
34
    STR_MAPNAME = 0,
35
    STR_MAPFILENAME = 1,
35
    STR_MAPFILENAME = 1,
36
    STR_PLAYERNAME = 2,
36
    STR_PLAYERNAME = 2,
37
    STR_VERSION = 3,
37
    STR_VERSION = 3,
38
    STR_GAMETYPE = 4,
38
    STR_GAMETYPE = 4,
39
    STR_VOLUMENAME = 5,
39
    STR_VOLUMENAME = 5,
40
    STR_YOURTIME = 6,
40
    STR_YOURTIME = 6,
41
    STR_PARTIME = 7,
41
    STR_PARTIME = 7,
42
    STR_DESIGNERTIME = 8,
42
    STR_DESIGNERTIME = 8,
43
    STR_BESTTIME = 9,
43
    STR_BESTTIME = 9,
44
}
44
}
45
45
46
PROJ = {
46
PROJ = {
47
    PROJ_WORKSLIKE = 0,
47
    PROJ_WORKSLIKE = 0,
48
    PROJ_SPAWNS = 1,
48
    PROJ_SPAWNS = 1,
49
    PROJ_SXREPEAT = 2,
49
    PROJ_SXREPEAT = 2,
50
    PROJ_SYREPEAT = 3,
50
    PROJ_SYREPEAT = 3,
51
    PROJ_SOUND = 4,
51
    PROJ_SOUND = 4,
52
    PROJ_ISOUND = 5,
52
    PROJ_ISOUND = 5,
53
    PROJ_VEL = 6,
53
    PROJ_VEL = 6,
54
    PROJ_EXTRA = 7,
54
    PROJ_EXTRA = 7,
55
    PROJ_DECAL = 8,
55
    PROJ_DECAL = 8,
56
    PROJ_TRAIL = 9,
56
    PROJ_TRAIL = 9,
57
    PROJ_TXREPEAT = 10,
57
    PROJ_TXREPEAT = 10,
58
    PROJ_TYREPEAT = 11,
58
    PROJ_TYREPEAT = 11,
59
    PROJ_TOFFSET = 12,
59
    PROJ_TOFFSET = 12,
60
    PROJ_TNUM = 13,
60
    PROJ_TNUM = 13,
61
    PROJ_DROP = 14,
61
    PROJ_DROP = 14,
62
    PROJ_CSTAT = 15,
62
    PROJ_CSTAT = 15,
63
    PROJ_CLIPDIST = 16,
63
    PROJ_CLIPDIST = 16,
64
    PROJ_SHADE = 17,
64
    PROJ_SHADE = 17,
65
    PROJ_XREPEAT = 18,
65
    PROJ_XREPEAT = 18,
66
    PROJ_YREPEAT = 19,
66
    PROJ_YREPEAT = 19,
67
    PROJ_PAL = 20,
67
    PROJ_PAL = 20,
68
    PROJ_EXTRA_RAND = 21,
68
    PROJ_EXTRA_RAND = 21,
69
    PROJ_HITRADIUS = 22,
69
    PROJ_HITRADIUS = 22,
70
    PROJ_VEL_MULT = 23,  -- NAME (PROJ_MOVECNT)
70
    PROJ_VEL_MULT = 23,  -- NAME (PROJ_MOVECNT)
71
    PROJ_OFFSET = 24,
71
    PROJ_OFFSET = 24,
72
    PROJ_BOUNCES = 25,
72
    PROJ_BOUNCES = 25,
73
    PROJ_BSOUND = 26,
73
    PROJ_BSOUND = 26,
74
    PROJ_RANGE = 27,
74
    PROJ_RANGE = 27,
75
    PROJ_FLASH_COLOR = 28,
75
    PROJ_FLASH_COLOR = 28,
76
    PROJ_USERDATA = 29,
76
    PROJ_USERDATA = 29,
77
}
77
}
78
78
79
EVENT = {
79
EVENT = {
80
    EVENT_INIT = 0,
80
    EVENT_INIT = 0,
81
    EVENT_ENTERLEVEL = 1,
81
    EVENT_ENTERLEVEL = 1,
82
    EVENT_RESETWEAPONS = 2,
82
    EVENT_RESETWEAPONS = 2,
83
    EVENT_RESETINVENTORY = 3,
83
    EVENT_RESETINVENTORY = 3,
84
    EVENT_HOLSTER = 4,
84
    EVENT_HOLSTER = 4,
85
    EVENT_LOOKLEFT = 5,
85
    EVENT_LOOKLEFT = 5,
86
    EVENT_LOOKRIGHT = 6,
86
    EVENT_LOOKRIGHT = 6,
87
    EVENT_SOARUP = 7,
87
    EVENT_SOARUP = 7,
88
    EVENT_SOARDOWN = 8,
88
    EVENT_SOARDOWN = 8,
89
    EVENT_CROUCH = 9,
89
    EVENT_CROUCH = 9,
90
    EVENT_JUMP = 10,
90
    EVENT_JUMP = 10,
91
    EVENT_RETURNTOCENTER = 11,
91
    EVENT_RETURNTOCENTER = 11,
92
    EVENT_LOOKUP = 12,
92
    EVENT_LOOKUP = 12,
93
    EVENT_LOOKDOWN = 13,
93
    EVENT_LOOKDOWN = 13,
94
    EVENT_AIMUP = 14,
94
    EVENT_AIMUP = 14,
95
    EVENT_FIRE = 15,
95
    EVENT_FIRE = 15,
96
    EVENT_CHANGEWEAPON = 16,
96
    EVENT_CHANGEWEAPON = 16,
97
    EVENT_GETSHOTRANGE = 17,
97
    EVENT_GETSHOTRANGE = 17,
98
    EVENT_GETAUTOAIMANGLE = 18,
98
    EVENT_GETAUTOAIMANGLE = 18,
99
    EVENT_GETLOADTILE = 19,
99
    EVENT_GETLOADTILE = 19,
100
    EVENT_CHEATGETSTEROIDS = 20,
100
    EVENT_CHEATGETSTEROIDS = 20,
101
    EVENT_CHEATGETHEAT = 21,
101
    EVENT_CHEATGETHEAT = 21,
102
    EVENT_CHEATGETBOOT = 22,
102
    EVENT_CHEATGETBOOT = 22,
103
    EVENT_CHEATGETSHIELD = 23,
103
    EVENT_CHEATGETSHIELD = 23,
104
    EVENT_CHEATGETSCUBA = 24,
104
    EVENT_CHEATGETSCUBA = 24,
105
    EVENT_CHEATGETHOLODUKE = 25,
105
    EVENT_CHEATGETHOLODUKE = 25,
106
    EVENT_CHEATGETJETPACK = 26,
106
    EVENT_CHEATGETJETPACK = 26,
107
    EVENT_CHEATGETFIRSTAID = 27,
107
    EVENT_CHEATGETFIRSTAID = 27,
108
    EVENT_QUICKKICK = 28,
108
    EVENT_QUICKKICK = 28,
109
    EVENT_INVENTORY = 29,
109
    EVENT_INVENTORY = 29,
110
    EVENT_USENIGHTVISION = 30,
110
    EVENT_USENIGHTVISION = 30,
111
    EVENT_USESTEROIDS = 31,
111
    EVENT_USESTEROIDS = 31,
112
    EVENT_INVENTORYLEFT = 32,
112
    EVENT_INVENTORYLEFT = 32,
113
    EVENT_INVENTORYRIGHT = 33,
113
    EVENT_INVENTORYRIGHT = 33,
114
    EVENT_HOLODUKEON = 34,
114
    EVENT_HOLODUKEON = 34,
115
    EVENT_HOLODUKEOFF = 35,
115
    EVENT_HOLODUKEOFF = 35,
116
    EVENT_USEMEDKIT = 36,
116
    EVENT_USEMEDKIT = 36,
117
    EVENT_USEJETPACK = 37,
117
    EVENT_USEJETPACK = 37,
118
    EVENT_TURNAROUND = 38,
118
    EVENT_TURNAROUND = 38,
119
    EVENT_DISPLAYWEAPON = 39,
119
    EVENT_DISPLAYWEAPON = 39,
120
    EVENT_FIREWEAPON = 40,
120
    EVENT_FIREWEAPON = 40,
121
    EVENT_SELECTWEAPON = 41,
121
    EVENT_SELECTWEAPON = 41,
122
    EVENT_MOVEFORWARD = 42,
122
    EVENT_MOVEFORWARD = 42,
123
    EVENT_MOVEBACKWARD = 43,
123
    EVENT_MOVEBACKWARD = 43,
124
    EVENT_TURNLEFT = 44,
124
    EVENT_TURNLEFT = 44,
125
    EVENT_TURNRIGHT = 45,
125
    EVENT_TURNRIGHT = 45,
126
    EVENT_STRAFELEFT = 46,
126
    EVENT_STRAFELEFT = 46,
127
    EVENT_STRAFERIGHT = 47,
127
    EVENT_STRAFERIGHT = 47,
128
    EVENT_WEAPKEY1 = 48,
128
    EVENT_WEAPKEY1 = 48,
129
    EVENT_WEAPKEY2 = 49,
129
    EVENT_WEAPKEY2 = 49,
130
    EVENT_WEAPKEY3 = 50,
130
    EVENT_WEAPKEY3 = 50,
131
    EVENT_WEAPKEY4 = 51,
131
    EVENT_WEAPKEY4 = 51,
132
    EVENT_WEAPKEY5 = 52,
132
    EVENT_WEAPKEY5 = 52,
133
    EVENT_WEAPKEY6 = 53,
133
    EVENT_WEAPKEY6 = 53,
134
    EVENT_WEAPKEY7 = 54,
134
    EVENT_WEAPKEY7 = 54,
135
    EVENT_WEAPKEY8 = 55,
135
    EVENT_WEAPKEY8 = 55,
136
    EVENT_WEAPKEY9 = 56,
136
    EVENT_WEAPKEY9 = 56,
137
    EVENT_WEAPKEY10 = 57,
137
    EVENT_WEAPKEY10 = 57,
138
    EVENT_DRAWWEAPON = 58,
138
    EVENT_DRAWWEAPON = 58,
139
    EVENT_DISPLAYCROSSHAIR = 59,
139
    EVENT_DISPLAYCROSSHAIR = 59,
140
    EVENT_DISPLAYREST = 60,
140
    EVENT_DISPLAYREST = 60,
141
    EVENT_DISPLAYSBAR = 61,
141
    EVENT_DISPLAYSBAR = 61,
142
    EVENT_RESETPLAYER = 62,
142
    EVENT_RESETPLAYER = 62,
143
    EVENT_INCURDAMAGE = 63,
143
    EVENT_INCURDAMAGE = 63,
144
    EVENT_AIMDOWN = 64,
144
    EVENT_AIMDOWN = 64,
145
    EVENT_GAME = 65,
145
    EVENT_GAME = 65,
146
    EVENT_PREVIOUSWEAPON = 66,
146
    EVENT_PREVIOUSWEAPON = 66,
147
    EVENT_NEXTWEAPON = 67,
147
    EVENT_NEXTWEAPON = 67,
148
    EVENT_SWIMUP = 68,
148
    EVENT_SWIMUP = 68,
149
    EVENT_SWIMDOWN = 69,
149
    EVENT_SWIMDOWN = 69,
150
    EVENT_GETMENUTILE = 70,
150
    EVENT_GETMENUTILE = 70,
151
    EVENT_SPAWN = 71,
151
    EVENT_SPAWN = 71,
152
    EVENT_LOGO = 72,
152
    EVENT_LOGO = 72,
153
    EVENT_EGS = 73,
153
    EVENT_EGS = 73,
154
    EVENT_DOFIRE = 74,
154
    EVENT_DOFIRE = 74,
155
    EVENT_PRESSEDFIRE = 75,
155
    EVENT_PRESSEDFIRE = 75,
156
    EVENT_USE = 76,
156
    EVENT_USE = 76,
157
    EVENT_PROCESSINPUT = 77,
157
    EVENT_PROCESSINPUT = 77,
158
    EVENT_FAKEDOMOVETHINGS = 78,
158
    EVENT_FAKEDOMOVETHINGS = 78,
159
    EVENT_DISPLAYROOMS = 79,
159
    EVENT_DISPLAYROOMS = 79,
160
    EVENT_KILLIT = 80,
160
    EVENT_KILLIT = 80,
161
    EVENT_LOADACTOR = 81,
161
    EVENT_LOADACTOR = 81,
162
    EVENT_DISPLAYBONUSSCREEN = 82,
162
    EVENT_DISPLAYBONUSSCREEN = 82,
163
    EVENT_DISPLAYMENU = 83,
163
    EVENT_DISPLAYMENU = 83,
164
    EVENT_DISPLAYMENUREST = 84,
164
    EVENT_DISPLAYMENUREST = 84,
165
    EVENT_DISPLAYLOADINGSCREEN = 85,
165
    EVENT_DISPLAYLOADINGSCREEN = 85,
166
    EVENT_ANIMATESPRITES = 86,
166
    EVENT_ANIMATESPRITES = 86,
167
    EVENT_NEWGAME = 87,
167
    EVENT_NEWGAME = 87,
168
    EVENT_SOUND = 88,
168
    EVENT_SOUND = 88,
169
    EVENT_CHECKTOUCHDAMAGE = 89,
169
    EVENT_CHECKTOUCHDAMAGE = 89,
170
    EVENT_CHECKFLOORDAMAGE = 90,
170
    EVENT_CHECKFLOORDAMAGE = 90,
171
    EVENT_LOADGAME = 91,
171
    EVENT_LOADGAME = 91,
172
    EVENT_SAVEGAME = 92,
172
    EVENT_SAVEGAME = 92,
173
    EVENT_PREGAME = 93,
173
    EVENT_PREGAME = 93,
174
    EVENT_CHANGEMENU = 94,
174
    EVENT_CHANGEMENU = 94,
175
    EVENT_DAMAGEHPLANE = 95,
175
    EVENT_DAMAGEHPLANE = 95,
176
    EVENT_ACTIVATECHEAT = 96,
176
    EVENT_ACTIVATECHEAT = 96,
177
    EVENT_DISPLAYINACTIVEMENU = 97,
177
    EVENT_DISPLAYINACTIVEMENU = 97,
178
    EVENT_DISPLAYINACTIVEMENUREST = 98,
178
    EVENT_DISPLAYINACTIVEMENUREST = 98,
179
    EVENT_CUTSCENE = 99,
179
    EVENT_CUTSCENE = 99,
180
    EVENT_DISPLAYCURSOR = 100,
180
    EVENT_DISPLAYCURSOR = 100,
181
    EVENT_DISPLAYLEVELSTATS = 101,
181
    EVENT_DISPLAYLEVELSTATS = 101,
-
 
182
    EVENT_DISPLAYCAMERAOSD = 102,
182
--    EVENT_ANIMATEALLSPRITES = previous+1,  -- internal
183
--    EVENT_ANIMATEALLSPRITES = previous+1,  -- internal
183
-- KEEPINSYNC with MAXEVENTS below
184
-- KEEPINSYNC with MAXEVENTS below
184
}
185
}
185
186
186
MAXEVENTS = 102  -- KEEPINSYNC with above EVENT_* list
187
MAXEVENTS = 103  -- KEEPINSYNC with above EVENT_* list
187
188
188
-- NOTE: negated values are not exported to the ffi.C namespace or CON.
189
-- NOTE: negated values are not exported to the ffi.C namespace or CON.
189
-- See TWEAK_SFLAG below.
190
-- See TWEAK_SFLAG below.
190
SFLAG = {
191
SFLAG = {
191
    SFLAG_SHADOW           = 0x00000001,
192
    SFLAG_SHADOW           = 0x00000001,
192
    SFLAG_NVG              = 0x00000002,
193
    SFLAG_NVG              = 0x00000002,
193
    SFLAG_NOSHADE          = 0x00000004,
194
    SFLAG_NOSHADE          = 0x00000004,
194
    SFLAG_PROJECTILE       = -0x00000008,
195
    SFLAG_PROJECTILE       = -0x00000008,
195
    SFLAG_DECAL            = -0x00000010,
196
    SFLAG_DECAL            = -0x00000010,
196
    SFLAG_BADGUY           = 0x00000020,
197
    SFLAG_BADGUY           = 0x00000020,
197
    SFLAG_NOPAL            = 0x00000040,
198
    SFLAG_NOPAL            = 0x00000040,
198
    SFLAG_NOEVENTS         = 0x00000080,  -- NAME
199
    SFLAG_NOEVENTS         = 0x00000080,  -- NAME
199
    SFLAG_NOLIGHT          = 0x00000100,
200
    SFLAG_NOLIGHT          = 0x00000100,
200
    SFLAG_USEACTIVATOR     = 0x00000200,
201
    SFLAG_USEACTIVATOR     = 0x00000200,
201
    SFLAG_NULL             = -0x00000400,
202
    SFLAG_NULL             = -0x00000400,
202
    SFLAG_NOCLIP           = 0x00000800,
203
    SFLAG_NOCLIP           = 0x00000800,
203
    SFLAG_NOFLOORSHADOW    = -0x00001000,
204
    SFLAG_NOFLOORSHADOW    = -0x00001000,
204
    SFLAG_SMOOTHMOVE       = 0x00002000,
205
    SFLAG_SMOOTHMOVE       = 0x00002000,
205
    SFLAG_NOTELEPORT       = 0x00004000,
206
    SFLAG_NOTELEPORT       = 0x00004000,
206
    SFLAG_BADGUYSTAYPUT    = -0x00008000,
207
    SFLAG_BADGUYSTAYPUT    = -0x00008000,
207
    SFLAG_CACHE            = -0x00010000,
208
    SFLAG_CACHE            = -0x00010000,
208
    SFLAG_ROTFIXED         = -0x00020000,
209
    SFLAG_ROTFIXED         = -0x00020000,
209
    SFLAG_HARDCODED_BADGUY = -0x00040000,
210
    SFLAG_HARDCODED_BADGUY = -0x00040000,
210
    SFLAG_DIDNOSE7WATER    = -0x00080000,
211
    SFLAG_DIDNOSE7WATER    = -0x00080000,
211
    SFLAG_NODAMAGEPUSH     = 0x00100000,
212
    SFLAG_NODAMAGEPUSH     = 0x00100000,
212
    SFLAG_NOWATERDIP       = 0x00200000,
213
    SFLAG_NOWATERDIP       = 0x00200000,
213
    -- RESERVED for actor.FLAGS.chain_*/replace_*:
214
    -- RESERVED for actor.FLAGS.chain_*/replace_*:
214
    -- 0x08000000, 0x10000000, 0x20000000, 0x40000000
215
    -- 0x08000000, 0x10000000, 0x20000000, 0x40000000
215
}
216
}
216
217
217
STAT = {
218
STAT = {
218
    STAT_DEFAULT = 0,
219
    STAT_DEFAULT = 0,
219
    STAT_ACTOR = 1,
220
    STAT_ACTOR = 1,
220
    STAT_ZOMBIEACTOR = 2,
221
    STAT_ZOMBIEACTOR = 2,
221
    STAT_EFFECTOR = 3,
222
    STAT_EFFECTOR = 3,
222
    STAT_PROJECTILE = 4,
223
    STAT_PROJECTILE = 4,
223
    STAT_MISC = 5,
224
    STAT_MISC = 5,
224
    STAT_STANDABLE = 6,
225
    STAT_STANDABLE = 6,
225
    STAT_LOCATOR = 7,
226
    STAT_LOCATOR = 7,
226
    STAT_ACTIVATOR = 8,
227
    STAT_ACTIVATOR = 8,
227
    STAT_TRANSPORT = 9,
228
    STAT_TRANSPORT = 9,
228
    STAT_PLAYER = 10,
229
    STAT_PLAYER = 10,
229
    STAT_FX = 11,
230
    STAT_FX = 11,
230
    STAT_FALLER = 12,
231
    STAT_FALLER = 12,
231
    STAT_DUMMYPLAYER = 13,
232
    STAT_DUMMYPLAYER = 13,
232
    STAT_LIGHT = 14,
233
    STAT_LIGHT = 14,
233
--    STAT_NETALLOC = 1023,  -- MAXSTATUS-1
234
--    STAT_NETALLOC = 1023,  -- MAXSTATUS-1
234
}
235
}
235
236
236
local GAMEFUNC = {
237
local GAMEFUNC = {
237
    GAMEFUNC_MOVE_FORWARD = 0,
238
    GAMEFUNC_MOVE_FORWARD = 0,
238
    GAMEFUNC_MOVE_BACKWARD = 1,
239
    GAMEFUNC_MOVE_BACKWARD = 1,
239
    GAMEFUNC_TURN_LEFT = 2,
240
    GAMEFUNC_TURN_LEFT = 2,
240
    GAMEFUNC_TURN_RIGHT = 3,
241
    GAMEFUNC_TURN_RIGHT = 3,
241
    GAMEFUNC_STRAFE = 4,
242
    GAMEFUNC_STRAFE = 4,
242
    GAMEFUNC_FIRE = 5,
243
    GAMEFUNC_FIRE = 5,
243
    GAMEFUNC_OPEN = 6,
244
    GAMEFUNC_OPEN = 6,
244
    GAMEFUNC_RUN = 7,
245
    GAMEFUNC_RUN = 7,
245
    GAMEFUNC_AUTORUN = 8,
246
    GAMEFUNC_AUTORUN = 8,
246
    GAMEFUNC_JUMP = 9,
247
    GAMEFUNC_JUMP = 9,
247
    GAMEFUNC_CROUCH = 10,
248
    GAMEFUNC_CROUCH = 10,
248
    GAMEFUNC_LOOK_UP = 11,
249
    GAMEFUNC_LOOK_UP = 11,
249
    GAMEFUNC_LOOK_DOWN = 12,
250
    GAMEFUNC_LOOK_DOWN = 12,
250
    GAMEFUNC_LOOK_LEFT = 13,
251
    GAMEFUNC_LOOK_LEFT = 13,
251
    GAMEFUNC_LOOK_RIGHT = 14,
252
    GAMEFUNC_LOOK_RIGHT = 14,
252
    GAMEFUNC_STRAFE_LEFT = 15,
253
    GAMEFUNC_STRAFE_LEFT = 15,
253
    GAMEFUNC_STRAFE_RIGHT = 16,
254
    GAMEFUNC_STRAFE_RIGHT = 16,
254
    GAMEFUNC_AIM_UP = 17,
255
    GAMEFUNC_AIM_UP = 17,
255
    GAMEFUNC_AIM_DOWN = 18,
256
    GAMEFUNC_AIM_DOWN = 18,
256
    GAMEFUNC_WEAPON_1 = 19,
257
    GAMEFUNC_WEAPON_1 = 19,
257
    GAMEFUNC_WEAPON_2 = 20,
258
    GAMEFUNC_WEAPON_2 = 20,
258
    GAMEFUNC_WEAPON_3 = 21,
259
    GAMEFUNC_WEAPON_3 = 21,
259
    GAMEFUNC_WEAPON_4 = 22,
260
    GAMEFUNC_WEAPON_4 = 22,
260
    GAMEFUNC_WEAPON_5 = 23,
261
    GAMEFUNC_WEAPON_5 = 23,
261
    GAMEFUNC_WEAPON_6 = 24,
262
    GAMEFUNC_WEAPON_6 = 24,
262
    GAMEFUNC_WEAPON_7 = 25,
263
    GAMEFUNC_WEAPON_7 = 25,
263
    GAMEFUNC_WEAPON_8 = 26,
264
    GAMEFUNC_WEAPON_8 = 26,
264
    GAMEFUNC_WEAPON_9 = 27,
265
    GAMEFUNC_WEAPON_9 = 27,
265
    GAMEFUNC_WEAPON_10 = 28,
266
    GAMEFUNC_WEAPON_10 = 28,
266
    GAMEFUNC_INVENTORY = 29,
267
    GAMEFUNC_INVENTORY = 29,
267
    GAMEFUNC_INVENTORY_LEFT = 30,
268
    GAMEFUNC_INVENTORY_LEFT = 30,
268
    GAMEFUNC_INVENTORY_RIGHT = 31,
269
    GAMEFUNC_INVENTORY_RIGHT = 31,
269
    GAMEFUNC_HOLO_DUKE = 32,
270
    GAMEFUNC_HOLO_DUKE = 32,
270
    GAMEFUNC_JETPACK = 33,
271
    GAMEFUNC_JETPACK = 33,
271
    GAMEFUNC_NIGHTVISION = 34,
272
    GAMEFUNC_NIGHTVISION = 34,
272
    GAMEFUNC_MEDKIT = 35,
273
    GAMEFUNC_MEDKIT = 35,
273
    GAMEFUNC_TURNAROUND = 36,
274
    GAMEFUNC_TURNAROUND = 36,
274
    GAMEFUNC_SENDMESSAGE = 37,
275
    GAMEFUNC_SENDMESSAGE = 37,
275
    GAMEFUNC_MAP = 38,
276
    GAMEFUNC_MAP = 38,
276
    GAMEFUNC_SHRINK_SCREEN = 39,
277
    GAMEFUNC_SHRINK_SCREEN = 39,
277
    GAMEFUNC_ENLARGE_SCREEN = 40,
278
    GAMEFUNC_ENLARGE_SCREEN = 40,
278
    GAMEFUNC_CENTER_VIEW = 41,
279
    GAMEFUNC_CENTER_VIEW = 41,
279
    GAMEFUNC_HOLSTER_WEAPON = 42,
280
    GAMEFUNC_HOLSTER_WEAPON = 42,
280
    GAMEFUNC_SHOW_OPPONENTS_WEAPON = 43,
281
    GAMEFUNC_SHOW_OPPONENTS_WEAPON = 43,
281
    GAMEFUNC_MAP_FOLLOW_MODE = 44,
282
    GAMEFUNC_MAP_FOLLOW_MODE = 44,
282
    GAMEFUNC_SEE_COOP_VIEW = 45,
283
    GAMEFUNC_SEE_COOP_VIEW = 45,
283
    GAMEFUNC_MOUSE_AIMING = 46,
284
    GAMEFUNC_MOUSE_AIMING = 46,
284
    GAMEFUNC_TOGGLE_CROSSHAIR = 47,
285
    GAMEFUNC_TOGGLE_CROSSHAIR = 47,
285
    GAMEFUNC_STEROIDS = 48,
286
    GAMEFUNC_STEROIDS = 48,
286
    GAMEFUNC_QUICK_KICK = 49,
287
    GAMEFUNC_QUICK_KICK = 49,
287
    GAMEFUNC_NEXT_WEAPON = 50,
288
    GAMEFUNC_NEXT_WEAPON = 50,
288
    GAMEFUNC_PREVIOUS_WEAPON = 51,
289
    GAMEFUNC_PREVIOUS_WEAPON = 51,
289
--    GAMEFUNC_SHOW_CONSOLE = 52,
290
--    GAMEFUNC_SHOW_CONSOLE = 52,
290
    GAMEFUNC_SHOW_DUKEMATCH_SCORES = 53,
291
    GAMEFUNC_SHOW_DUKEMATCH_SCORES = 53,
291
    GAMEFUNC_DPAD_SELECT = 54,
292
    GAMEFUNC_DPAD_SELECT = 54,
292
    GAMEFUNC_DPAD_AIMING = 55,
293
    GAMEFUNC_DPAD_AIMING = 55,
293
}
294
}
294
295
295
local function shallow_copy(tab)
296
local function shallow_copy(tab)
296
    local t = {}
297
    local t = {}
297
    for k,v in pairs(tab) do
298
    for k,v in pairs(tab) do
298
        t[k] = v
299
        t[k] = v
299
    end
300
    end
300
    return t
301
    return t
301
end
302
end
302
303
303
-- KEEPINSYNC with gamedef.c:C_AddDefaultDefinitions() and the respective
304
-- KEEPINSYNC with gamedef.c:C_AddDefaultDefinitions() and the respective
304
-- defines. These are exported to the ffi.C namespace (except STAT) and as
305
-- defines. These are exported to the ffi.C namespace (except STAT) and as
305
-- literal defines in lunacon.lua.
306
-- literal defines in lunacon.lua.
306
labels =
307
labels =
307
{
308
{
308
    STR,
309
    STR,
309
    PROJ,
310
    PROJ,
310
    EVENT,
311
    EVENT,
311
    shallow_copy(SFLAG),
312
    shallow_copy(SFLAG),
312
    setmetatable(STAT, { __metatable="noffiC" }),
313
    setmetatable(STAT, { __metatable="noffiC" }),
313
    GAMEFUNC,
314
    GAMEFUNC,
314
}
315
}
315
316
316
user_sflags = 0
317
user_sflags = 0
317
-- TWEAK_SFLAG
318
-- TWEAK_SFLAG
318
for name, flag in pairs(SFLAG) do
319
for name, flag in pairs(SFLAG) do
319
    if (flag > 0) then
320
    if (flag > 0) then
320
        user_sflags = user_sflags + flag
321
        user_sflags = user_sflags + flag
321
    else
322
    else
322
        SFLAG[name] = -flag
323
        SFLAG[name] = -flag
323
        labels[4][name] = nil
324
        labels[4][name] = nil
324
    end
325
    end
325
end
326
end
326
327
327
-- KEEPINSYNC player.h
328
-- KEEPINSYNC player.h
328
wdata_members =
329
wdata_members =
329
{
330
{
330
    -- NOTE: they are lowercased for Lunatic
331
    -- NOTE: they are lowercased for Lunatic
331
    -- NOTE: members _*sound*, _spawn and _shoots assume *zero* to mean "none"
332
    -- NOTE: members _*sound*, _spawn and _shoots assume *zero* to mean "none"
332
    --  (-1 would be more logical).
333
    --  (-1 would be more logical).
333
    "const int32_t _workslike",
334
    "const int32_t _workslike",
334
    "int32_t clip",
335
    "int32_t clip",
335
    "int32_t reload",
336
    "int32_t reload",
336
    "int32_t firedelay",
337
    "int32_t firedelay",
337
    "int32_t totaltime",
338
    "int32_t totaltime",
338
    "int32_t holddelay",
339
    "int32_t holddelay",
339
    "int32_t flags",
340
    "int32_t flags",
340
    "const int32_t _shoots",
341
    "const int32_t _shoots",
341
    "int32_t spawntime",
342
    "int32_t spawntime",
342
    "const int32_t _spawn",
343
    "const int32_t _spawn",
343
    "int32_t shotsperburst",
344
    "int32_t shotsperburst",
344
    "const int32_t _initialsound",
345
    "const int32_t _initialsound",
345
    "const int32_t _firesound",
346
    "const int32_t _firesound",
346
    "int32_t sound2time",  -- NOTE: this is a time number, not a sound
347
    "int32_t sound2time",  -- NOTE: this is a time number, not a sound
347
    "const int32_t _sound2sound",
348
    "const int32_t _sound2sound",
348
    "const int32_t _reloadsound1",
349
    "const int32_t _reloadsound1",
349
    "const int32_t _reloadsound2",
350
    "const int32_t _reloadsound2",
350
    "const int32_t _selectsound",
351
    "const int32_t _selectsound",
351
    "int32_t flashcolor",
352
    "int32_t flashcolor",
352
}
353
}
353
354
354
355
355
local SP = function(memb) return "sprite[%s]"..memb end
356
local SP = function(memb) return "sprite[%s]"..memb end
356
local ATSP = function(memb) return "_atsprite[%s]"..memb end
357
local ATSP = function(memb) return "_atsprite[%s]"..memb end
357
local AC = function(memb) return "actor[%s]"..memb end
358
local AC = function(memb) return "actor[%s]"..memb end
358
local SX = function(memb) return "spriteext[%s]"..memb end
359
local SX = function(memb) return "spriteext[%s]"..memb end
359
360
360
-- Generate code to access a signed member as unsigned.
361
-- Generate code to access a signed member as unsigned.
361
local function s2u(label)
362
local function s2u(label)
362
    return "(_band("..label.."+65536,65535))"
363
    return "(_band("..label.."+65536,65535))"
363
end
364
end
364
365
365
local function S2U(label)
366
local function S2U(label)
366
    return { s2u(label), label }
367
    return { s2u(label), label }
367
end
368
end
368
369
369
-- Some literal checker functions (LITERAL_CHECKING).
370
-- Some literal checker functions (LITERAL_CHECKING).
370
-- KEEPINSYNC with the actual setter code.
371
-- KEEPINSYNC with the actual setter code.
371
local function litok_gem1(lit)
372
local function litok_gem1(lit)
372
    return (lit >= -1)
373
    return (lit >= -1)
373
end
374
end
374
375
375
local function litok_ge0(lit)
376
local function litok_ge0(lit)
376
    return (lit >= 0)
377
    return (lit >= 0)
377
end
378
end
378
379
379
local ActorLabels = {
380
local ActorLabels = {
380
    x = SP".x",
381
    x = SP".x",
381
    y = SP".y",
382
    y = SP".y",
382
    z = SP".z",
383
    z = SP".z",
383
    cstat = SP".cstat",
384
    cstat = SP".cstat",
384
    picnum = { SP".picnum", SP":set_picnum(%%s)", litok_ge0 },
385
    picnum = { SP".picnum", SP":set_picnum(%%s)", litok_ge0 },
385
    shade = SP".shade",
386
    shade = SP".shade",
386
    pal = SP".pal",
387
    pal = SP".pal",
387
    clipdist = SP".clipdist",
388
    clipdist = SP".clipdist",
388
--    filler = SP".filler",
389
--    filler = SP".filler",
389
--    detail = SP".filler",  -- NAME
390
--    detail = SP".filler",  -- NAME
390
    blend = SP".blend",
391
    blend = SP".blend",
391
    xrepeat = SP".xrepeat",
392
    xrepeat = SP".xrepeat",
392
    yrepeat = SP".yrepeat",
393
    yrepeat = SP".yrepeat",
393
    xoffset = SP".xoffset",
394
    xoffset = SP".xoffset",
394
    yoffset = SP".yoffset",
395
    yoffset = SP".yoffset",
395
    sectnum = { SP".sectnum", SP":changesect(%%s)", litok_ge0 },  -- set: for tsprite
396
    sectnum = { SP".sectnum", SP":changesect(%%s)", litok_ge0 },  -- set: for tsprite
396
    statnum = { SP".statnum" },
397
    statnum = { SP".statnum" },
397
    ang = SP".ang",
398
    ang = SP".ang",
398
    owner = { SP".owner", SP":_set_owner(%%s)", litok_ge0 },
399
    owner = { SP".owner", SP":_set_owner(%%s)", litok_ge0 },
399
    xvel = SP".xvel",
400
    xvel = SP".xvel",
400
    yvel = { SP".yvel", SP":set_yvel(%%s)" },
401
    yvel = { SP".yvel", SP":set_yvel(%%s)" },
401
    zvel = SP".zvel",
402
    zvel = SP".zvel",
402
    lotag = SP".lotag",
403
    lotag = SP".lotag",
403
    hitag = SP".hitag",
404
    hitag = SP".hitag",
404
    extra = SP".extra",
405
    extra = SP".extra",
405
406
406
    ulotag = S2U(SP".lotag"),
407
    ulotag = S2U(SP".lotag"),
407
    uhitag = S2U(SP".hitag"),
408
    uhitag = S2U(SP".hitag"),
408
409
409
    -- ActorExtra labels...
410
    -- ActorExtra labels...
410
    htcgg = AC".cgg",
411
    htcgg = AC".cgg",
411
    -- XXX: why <0 allowed?
412
    -- XXX: why <0 allowed?
412
    htpicnum = { AC".picnum", AC":set_picnum(%%s)" },
413
    htpicnum = { AC".picnum", AC":set_picnum(%%s)" },
413
    htang = AC".ang",
414
    htang = AC".ang",
414
    htextra = AC".extra",
415
    htextra = AC".extra",
415
    htowner = { AC".owner", AC":set_owner(%%s)", litok_ge0 },
416
    htowner = { AC".owner", AC":set_owner(%%s)", litok_ge0 },
416
    htmovflag = AC"._movflag",
417
    htmovflag = AC"._movflag",
417
    httempang = AC".tempang",
418
    httempang = AC".tempang",
418
    htactorstayput = AC".stayputsect",  -- NAME
419
    htactorstayput = AC".stayputsect",  -- NAME
419
    htdispicnum = { AC".dispicnum" },
420
    htdispicnum = { AC".dispicnum" },
420
    -- NOTE: no access for .shootzvel
421
    -- NOTE: no access for .shootzvel
421
    httimetosleep = AC".timetosleep",
422
    httimetosleep = AC".timetosleep",
422
    htfloorz = AC".floorz",
423
    htfloorz = AC".floorz",
423
    htceilingz = AC".ceilingz",
424
    htceilingz = AC".ceilingz",
424
    htlastvx = AC".lastvx",
425
    htlastvx = AC".lastvx",
425
    htlastvy = AC".lastvy",
426
    htlastvy = AC".lastvy",
426
    htbposx = AC".bpos.x",
427
    htbposx = AC".bpos.x",
427
    htbposy = AC".bpos.y",
428
    htbposy = AC".bpos.y",
428
    htbposz = AC".bpos.z",
429
    htbposz = AC".bpos.z",
429
    -- Read access differs from write ({ get, set }):
430
    -- Read access differs from write ({ get, set }):
430
    htg_t = { AC":_get_t_data(%s)", AC":_set_t_data(%s,%%s)" },
431
    htg_t = { AC":_get_t_data(%s)", AC":_set_t_data(%s,%%s)" },
431
    htflags = AC".flags",
432
    htflags = AC".flags",
432
    movflags = AC".movflags",
433
    movflags = AC".movflags",
433
434
434
    -- (mostly) model-related flags
435
    -- (mostly) model-related flags
435
    angoff = SX".angoff",
436
    angoff = SX".angoff",
436
    pitch = SX".pitch",
437
    pitch = SX".pitch",
437
    roll = SX".roll",
438
    roll = SX".roll",
438
    mdxoff = SX".mdoff.x",  -- NAME
439
    mdxoff = SX".mdoff.x",  -- NAME
439
    mdyoff = SX".mdoff.y",
440
    mdyoff = SX".mdoff.y",
440
    mdzoff = SX".mdoff.z",
441
    mdzoff = SX".mdoff.z",
441
    mdflags = SX".flags",
442
    mdflags = SX".flags",
442
    xpanning = SX".xpanning",
443
    xpanning = SX".xpanning",
443
    ypanning = SX".ypanning",
444
    ypanning = SX".ypanning",
444
445
445
    alpha = { "_math.floor(spriteext[%s].alpha*255)", "spriteext[%s].alpha=(%%s)/255" },
446
    alpha = { "_math.floor(spriteext[%s].alpha*255)", "spriteext[%s].alpha=(%%s)/255" },
446
447
447
    isvalid = { "_con._isvalid(%s)" },
448
    isvalid = { "_con._isvalid(%s)" },
448
}
449
}
449
450
450
local function spr2tspr(code)
451
local function spr2tspr(code)
451
    if (code and code:find(SP"", 1, true)==1) then
452
    if (code and code:find(SP"", 1, true)==1) then
452
        return ATSP(code:sub(#SP"" + 1))
453
        return ATSP(code:sub(#SP"" + 1))
453
    end
454
    end
454
    -- else return nothing
455
    -- else return nothing
455
end
456
end
456
457
457
local TspriteLabels = {}
458
local TspriteLabels = {}
458
459
459
for member, code in pairs(ActorLabels) do
460
for member, code in pairs(ActorLabels) do
460
    if (type(code)=="string") then
461
    if (type(code)=="string") then
461
        TspriteLabels["tspr"..member] = spr2tspr(code)
462
        TspriteLabels["tspr"..member] = spr2tspr(code)
462
    else
463
    else
463
        TspriteLabels["tspr"..member] = { spr2tspr(code[1]), spr2tspr(code[2]) }
464
        TspriteLabels["tspr"..member] = { spr2tspr(code[1]), spr2tspr(code[2]) }
464
    end
465
    end
465
end
466
end
466
467
467
-- Sprites set stat- and sectnum via sprite.change{stat,sect} functions.
468
-- Sprites set stat- and sectnum via sprite.change{stat,sect} functions.
468
ActorLabels.sectnum[2] = "sprite.changesect(%s,%%s,true)"
469
ActorLabels.sectnum[2] = "sprite.changesect(%s,%%s,true)"
469
ActorLabels.statnum[2] = "sprite.changestat(%s,%%s,true)"
470
ActorLabels.statnum[2] = "sprite.changestat(%s,%%s,true)"
470
471
471
local PL = function(memb) return "player[%s]"..memb end
472
local PL = function(memb) return "player[%s]"..memb end
472
-- Access to DukePlayer_t's bool members: they must be read as numbers.
473
-- Access to DukePlayer_t's bool members: they must be read as numbers.
473
local PLBOOL = function(memb) return { "("..PL(memb).." and 1 or 0)", PL(memb) } end
474
local PLBOOL = function(memb) return { "("..PL(memb).." and 1 or 0)", PL(memb) } end
474
475
475
local empty_table = {}
476
local empty_table = {}
476
local DISABLED_PL = function() return empty_table end
477
local DISABLED_PL = function() return empty_table end
477
local DISABLED = DISABLED_PL
478
local DISABLED = DISABLED_PL
478
479
479
local PlayerLabels = {
480
local PlayerLabels = {
480
    posx = PL".pos.x",
481
    posx = PL".pos.x",
481
    posy = PL".pos.y",
482
    posy = PL".pos.y",
482
    posz = PL".pos.z",
483
    posz = PL".pos.z",
483
    oposx = PL".opos.x",
484
    oposx = PL".opos.x",
484
    oposy = PL".opos.y",
485
    oposy = PL".opos.y",
485
    oposz = PL".opos.z",
486
    oposz = PL".opos.z",
486
    posxv = PL".vel.x",  -- NAME
487
    posxv = PL".vel.x",  -- NAME
487
    posyv = PL".vel.y",
488
    posyv = PL".vel.y",
488
    poszv = PL".vel.z",
489
    poszv = PL".vel.z",
489
    -- NOTE: no access for .npos
490
    -- NOTE: no access for .npos
490
    bobposx = DISABLED_PL".bobposx",
491
    bobposx = DISABLED_PL".bobposx",
491
    bobposy = DISABLED_PL".bobposy",
492
    bobposy = DISABLED_PL".bobposy",
492
493
493
    truefz = DISABLED_PL".truefz",
494
    truefz = DISABLED_PL".truefz",
494
    truecz = DISABLED_PL".truecz",
495
    truecz = DISABLED_PL".truecz",
495
    player_par = PL".player_par",
496
    player_par = PL".player_par",
496
497
497
    randomflamex = DISABLED_PL".randomflamex",
498
    randomflamex = DISABLED_PL".randomflamex",
498
    exitx = DISABLED_PL".exitx",
499
    exitx = DISABLED_PL".exitx",
499
    exity = DISABLED_PL".exity",
500
    exity = DISABLED_PL".exity",
500
501
501
    runspeed = PL".runspeed",
502
    runspeed = PL".runspeed",
502
    max_player_health = PL".max_player_health",
503
    max_player_health = PL".max_player_health",
503
    max_shield_amount = PL".max_shield_amount",
504
    max_shield_amount = PL".max_shield_amount",
504
505
505
    autostep = PL".autostep",
506
    autostep = PL".autostep",
506
    autostep_sbw = PL".autostep_sbw",
507
    autostep_sbw = PL".autostep_sbw",
507
508
508
    interface_toggle_flag = DISABLED_PL".interface_toggle_flag",
509
    interface_toggle_flag = DISABLED_PL".interface_toggle_flag",
509
510
510
    -- NOTE: *bombControl etc. are accessed by gamevars in CON
511
    -- NOTE: *bombControl etc. are accessed by gamevars in CON
511
512
512
    max_actors_killed = PL".max_actors_killed",
513
    max_actors_killed = PL".max_actors_killed",
513
    actors_killed = PL".actors_killed",
514
    actors_killed = PL".actors_killed",
514
515
515
    -- NOTE the special case; "%%s" is used to mark settable members
516
    -- NOTE the special case; "%%s" is used to mark settable members
516
    -- with METHOD_MEMBER syntax, it's the value to be set.
517
    -- with METHOD_MEMBER syntax, it's the value to be set.
517
    gotweapon = { "("..PL":has_weapon(%s) and 1 or 0)", PL":_gt_weapon(%s,%%s)" },
518
    gotweapon = { "("..PL":has_weapon(%s) and 1 or 0)", PL":_gt_weapon(%s,%%s)" },
518
    zoom = PL".zoom",
519
    zoom = PL".zoom",
519
520
520
    loogiex = {},
521
    loogiex = {},
521
    loogiey = {},
522
    loogiey = {},
522
523
523
    sbs = PL".sbs",
524
    sbs = PL".sbs",
524
    sound_pitch = PL".sound_pitch",
525
    sound_pitch = PL".sound_pitch",
525
526
526
    ang = PL".ang",
527
    ang = PL".ang",
527
    oang = PL".oang",
528
    oang = PL".oang",
528
    angvel = PL".angvel",
529
    angvel = PL".angvel",
529
530
530
    cursectnum = PL".cursectnum",
531
    cursectnum = PL".cursectnum",
531
532
532
    look_ang = PL".look_ang",
533
    look_ang = PL".look_ang",
533
    last_extra = PL".last_extra",
534
    last_extra = PL".last_extra",
534
    subweapon = PL".subweapon",
535
    subweapon = PL".subweapon",
535
536
536
    max_ammo_amount = PL".max_ammo_amount[%s]",
537
    max_ammo_amount = PL".max_ammo_amount[%s]",
537
    ammo_amount = PL".ammo_amount[%s]",
538
    ammo_amount = PL".ammo_amount[%s]",
538
    -- NOTE: no direct access for .inv_amount (but see end)
539
    -- NOTE: no direct access for .inv_amount (but see end)
539
540
540
    wackedbyactor = PL".wackedbyactor",
541
    wackedbyactor = PL".wackedbyactor",
541
    pyoff = PL".pyoff",
542
    pyoff = PL".pyoff",
542
    opyoff = PL".opyoff",
543
    opyoff = PL".opyoff",
543
544
544
    horiz = PL".horiz",
545
    horiz = PL".horiz",
545
    horizoff = PL".horizoff",
546
    horizoff = PL".horizoff",
546
    ohoriz = PL".ohoriz",
547
    ohoriz = PL".ohoriz",
547
    ohorizoff = PL".ohorizoff",
548
    ohorizoff = PL".ohorizoff",
548
549
549
    newowner = { PL".newowner" },
550
    newowner = { PL".newowner" },
550
551
551
    jumping_counter = PL".jumping_counter",
552
    jumping_counter = PL".jumping_counter",
552
    airleft = PL".airleft",
553
    airleft = PL".airleft",
553
554
554
    fta = PL".fta",
555
    fta = PL".fta",
555
    ftq = PL".ftq",
556
    ftq = PL".ftq",
556
    access_wallnum = { PL".access_wallnum" },
557
    access_wallnum = { PL".access_wallnum" },
557
    access_spritenum = { PL".access_spritenum" },
558
    access_spritenum = { PL".access_spritenum" },
558
559
559
    got_access = PL".got_access",
560
    got_access = PL".got_access",
560
    weapon_ang = PL".weapon_ang",
561
    weapon_ang = PL".weapon_ang",
561
    visibility = PL".visibility",
562
    visibility = PL".visibility",
562
563
563
    somethingonplayer = PL".somethingonplayer",
564
    somethingonplayer = PL".somethingonplayer",
564
    on_crane = PL".on_crane",
565
    on_crane = PL".on_crane",
565
566
566
    i = { PL".i" },
567
    i = { PL".i" },
567
568
568
    one_parallax_sectnum = DISABLED{ PL".one_parallax_sectnum" },
569
    one_parallax_sectnum = DISABLED{ PL".one_parallax_sectnum" },
569
570
570
    random_club_frame = PL".random_club_frame",
571
    random_club_frame = PL".random_club_frame",
571
    one_eighty_count = PL".one_eighty_count",
572
    one_eighty_count = PL".one_eighty_count",
572
573
573
    dummyplayersprite = DISABLED_PL".dummyplayersprite",
574
    dummyplayersprite = DISABLED_PL".dummyplayersprite",
574
    extra_extra8 = PL".extra_extra8",
575
    extra_extra8 = PL".extra_extra8",
575
576
576
    actorsqu = PL".actorsqu",
577
    actorsqu = PL".actorsqu",
577
    timebeforeexit = PL".timebeforeexit",
578
    timebeforeexit = PL".timebeforeexit",
578
    customexitsound = { PL".customexitsound" },
579
    customexitsound = { PL".customexitsound" },
579
580
580
    last_pissed_time = PL".last_pissed_time",
581
    last_pissed_time = PL".last_pissed_time",
581
582
582
    weaprecs = PL".weaprecs[%s]",
583
    weaprecs = PL".weaprecs[%s]",
583
584
584
    weapon_sway = PL".weapon_sway",
585
    weapon_sway = PL".weapon_sway",
585
    crack_time = PL".crack_time",
586
    crack_time = PL".crack_time",
586
    bobcounter = PL".bobcounter",
587
    bobcounter = PL".bobcounter",
587
588
588
    -- NOTE: no access for .orotscrnang
589
    -- NOTE: no access for .orotscrnang
589
    rotscrnang = PL".rotscrnang",
590
    rotscrnang = PL".rotscrnang",
590
    dead_flag = PL".dead_flag",
591
    dead_flag = PL".dead_flag",
591
592
592
    holoduke_on = PL".holoduke_on",
593
    holoduke_on = PL".holoduke_on",
593
    pycount = PL".pycount",
594
    pycount = PL".pycount",
594
    transporter_hold = PL".transporter_hold",
595
    transporter_hold = PL".transporter_hold",
595
596
596
    max_secret_rooms = PL".max_secret_rooms",
597
    max_secret_rooms = PL".max_secret_rooms",
597
    secret_rooms = PL".secret_rooms",
598
    secret_rooms = PL".secret_rooms",
598
599
599
    frag = PL".frag",
600
    frag = PL".frag",
600
    fraggedself = PL".fraggedself",
601
    fraggedself = PL".fraggedself",
601
    quick_kick = PL".quick_kick",
602
    quick_kick = PL".quick_kick",
602
    last_quick_kick = PL".last_quick_kick",
603
    last_quick_kick = PL".last_quick_kick",
603
604
604
    return_to_center = DISABLED_PL".return_to_center",
605
    return_to_center = DISABLED_PL".return_to_center",
605
    reloading = PLBOOL".reloading",
606
    reloading = PLBOOL".reloading",
606
    weapreccnt = { PL".weapreccnt" },
607
    weapreccnt = { PL".weapreccnt" },
607
608
608
    aim_mode = PL".aim_mode",
609
    aim_mode = PL".aim_mode",
609
    auto_aim = PL".auto_aim",
610
    auto_aim = PL".auto_aim",
610
    weaponswitch = PL".weaponswitch",
611
    weaponswitch = PL".weaponswitch",
611
    movement_lock = PL".movement_lock",
612
    movement_lock = PL".movement_lock",
612
    team = PL".team",
613
    team = PL".team",
613
614
614
    tipincs = PL".tipincs",
615
    tipincs = PL".tipincs",
615
    hbomb_hold_delay = PL".hbomb_hold_delay",
616
    hbomb_hold_delay = PL".hbomb_hold_delay",
616
    frag_ps = PL".frag_ps",
617
    frag_ps = PL".frag_ps",
617
    kickback_pic = PL".kickback_pic",
618
    kickback_pic = PL".kickback_pic",
618
619
619
    gm = PL".gm",
620
    gm = PL".gm",
620
    on_warping_sector = PLBOOL".on_warping_sector",
621
    on_warping_sector = PLBOOL".on_warping_sector",
621
    footprintcount = PL".footprintcount",
622
    footprintcount = PL".footprintcount",
622
    hurt_delay = PL".hurt_delay",
623
    hurt_delay = PL".hurt_delay",
623
624
624
    hbomb_on = PLBOOL".hbomb_on",
625
    hbomb_on = PLBOOL".hbomb_on",
625
    jumping_toggle = PLBOOL".jumping_toggle",
626
    jumping_toggle = PLBOOL".jumping_toggle",
626
    rapid_fire_hold = PLBOOL".rapid_fire_hold",
627
    rapid_fire_hold = PLBOOL".rapid_fire_hold",
627
    on_ground = PLBOOL".on_ground",
628
    on_ground = PLBOOL".on_ground",
628
629
629
    inven_icon = PL".inven_icon",
630
    inven_icon = PL".inven_icon",
630
    buttonpalette = PL".buttonpalette",
631
    buttonpalette = PL".buttonpalette",
631
    over_shoulder_on = PLBOOL".over_shoulder_on",
632
    over_shoulder_on = PLBOOL".over_shoulder_on",
632
    show_empty_weapon = PL".show_empty_weapon",
633
    show_empty_weapon = PL".show_empty_weapon",
633
634
634
    jetpack_on = PLBOOL".jetpack_on",
635
    jetpack_on = PLBOOL".jetpack_on",
635
    spritebridge = PLBOOL".spritebridge",
636
    spritebridge = PLBOOL".spritebridge",
636
    lastrandomspot = DISABLED_PL".lastrandomspot",
637
    lastrandomspot = DISABLED_PL".lastrandomspot",
637
638
638
    scuba_on = PLBOOL".scuba_on",
639
    scuba_on = PLBOOL".scuba_on",
639
    footprintpal = PL".footprintpal",
640
    footprintpal = PL".footprintpal",
640
    heat_on = PLBOOL".heat_on",
641
    heat_on = PLBOOL".heat_on",
641
    invdisptime = PL".invdisptime",
642
    invdisptime = PL".invdisptime",
642
    holster_weapon = PLBOOL".holster_weapon",
643
    holster_weapon = PLBOOL".holster_weapon",
643
    falling_counter = PL".falling_counter",
644
    falling_counter = PL".falling_counter",
644
    footprintshade = PL".footprintshade",
645
    footprintshade = PL".footprintshade",
645
646
646
    refresh_inventory = PL".refresh_inventory",
647
    refresh_inventory = PL".refresh_inventory",
647
    last_full_weapon = PL".last_full_weapon",
648
    last_full_weapon = PL".last_full_weapon",
648
649
649
    walking_snd_toggle = PL".walking_snd_toggle",
650
    walking_snd_toggle = PL".walking_snd_toggle",
650
    palookup = PL".palookup",
651
    palookup = PL".palookup",
651
    hard_landing = PL".hard_landing",
652
    hard_landing = PL".hard_landing",
652
    fist_incs = PL".fist_incs",
653
    fist_incs = PL".fist_incs",
653
654
654
    toggle_key_flag = { PL".toggle_key_flag" },
655
    toggle_key_flag = { PL".toggle_key_flag" },
655
    knuckle_incs = PL".knuckle_incs",
656
    knuckle_incs = PL".knuckle_incs",
656
    knee_incs = PL".knee_incs",
657
    knee_incs = PL".knee_incs",
657
    access_incs = PL".access_incs",
658
    access_incs = PL".access_incs",
658
659
659
    numloogs = DISABLED_PL".numloogs",
660
    numloogs = DISABLED_PL".numloogs",
660
    loogcnt = PL".loogcnt",
661
    loogcnt = PL".loogcnt",
661
    scream_voice = { PL".scream_voice" },
662
    scream_voice = { PL".scream_voice" },
662
663
663
    last_weapon = PL".last_weapon",
664
    last_weapon = PL".last_weapon",
664
    cheat_phase = { PL".cheat_phase" },
665
    cheat_phase = { PL".cheat_phase" },
665
    weapon_pos = PL".weapon_pos",
666
    weapon_pos = PL".weapon_pos",
666
    wantweaponfire = PL".wantweaponfire",
667
    wantweaponfire = PL".wantweaponfire",
667
668
668
    curr_weapon = PL".curr_weapon",
669
    curr_weapon = PL".curr_weapon",
669
670
670
    palette = { PL".palette" },
671
    palette = { PL".palette" },
671
672
672
    -- NOTE the special case:
673
    -- NOTE the special case:
673
    pals = PL"._pals[%s]",
674
    pals = PL"._pals[%s]",
674
    pals_time = PL"._pals.f",
675
    pals_time = PL"._pals.f",
675
676
676
    name = {},
677
    name = {},
677
678
678
    -- Access to .inv_amount
679
    -- Access to .inv_amount
679
    steroids_amount = PL".inv_amount[0]",
680
    steroids_amount = PL".inv_amount[0]",
680
    shield_amount = PL".inv_amount[1]",
681
    shield_amount = PL".inv_amount[1]",
681
    scuba_amount = PL".inv_amount[2]",
682
    scuba_amount = PL".inv_amount[2]",
682
    holoduke_amount = PL".inv_amount[3]",
683
    holoduke_amount = PL".inv_amount[3]",
683
    jetpack_amount = PL".inv_amount[4]",
684
    jetpack_amount = PL".inv_amount[4]",
684
    -- 5: dummy
685
    -- 5: dummy
685
    -- 6: no "access_amount"
686
    -- 6: no "access_amount"
686
    heat_amount = PL".inv_amount[7]",
687
    heat_amount = PL".inv_amount[7]",
687
    -- 8: dummy
688
    -- 8: dummy
688
    firstaid_amount = PL".inv_amount[9]",
689
    firstaid_amount = PL".inv_amount[9]",
689
    boot_amount = PL".inv_amount[10]",
690
    boot_amount = PL".inv_amount[10]",
690
}
691
}
691
692
692
local SEC = function(memb) return "sector[%s]"..memb end
693
local SEC = function(memb) return "sector[%s]"..memb end
693
local SECRO = function(memb) return { "sector[%s]"..memb } end
694
local SECRO = function(memb) return { "sector[%s]"..memb } end
694
695
695
local SectorLabels = {
696
local SectorLabels = {
696
    wallptr = SECRO".wallptr",
697
    wallptr = SECRO".wallptr",
697
    wallnum = SECRO".wallnum",
698
    wallnum = SECRO".wallnum",
698
699
699
    ceilingz = SEC".ceilingz",
700
    ceilingz = SEC".ceilingz",
700
    floorz = SEC".floorz",
701
    floorz = SEC".floorz",
701
702
702
    ceilingstat = SEC".ceilingstat",
703
    ceilingstat = SEC".ceilingstat",
703
    floorstat = SEC".floorstat",
704
    floorstat = SEC".floorstat",
704
705
705
    -- CEILING
706
    -- CEILING
706
    ceilingpicnum = { SEC".ceilingpicnum", SEC":set_ceilingpicnum(%%s)", litok_ge0 },
707
    ceilingpicnum = { SEC".ceilingpicnum", SEC":set_ceilingpicnum(%%s)", litok_ge0 },
707
708
708
    ceilingslope = SEC".ceilingheinum",  -- NAME
709
    ceilingslope = SEC".ceilingheinum",  -- NAME
709
    ceilingshade = SEC".ceilingshade",
710
    ceilingshade = SEC".ceilingshade",
710
711
711
    ceilingpal = SEC".ceilingpal",
712
    ceilingpal = SEC".ceilingpal",
712
    ceilingxpanning = SEC".ceilingxpanning",
713
    ceilingxpanning = SEC".ceilingxpanning",
713
    ceilingypanning = SEC".ceilingypanning",
714
    ceilingypanning = SEC".ceilingypanning",
714
715
715
    -- FLOOR
716
    -- FLOOR
716
    floorpicnum = { SEC".floorpicnum", SEC":set_floorpicnum(%%s)", litok_ge0 },
717
    floorpicnum = { SEC".floorpicnum", SEC":set_floorpicnum(%%s)", litok_ge0 },
717
718
718
    floorslope = SEC".floorheinum",  -- NAME
719
    floorslope = SEC".floorheinum",  -- NAME
719
    floorshade = SEC".floorshade",
720
    floorshade = SEC".floorshade",
720
721
721
    floorpal = SEC".floorpal",
722
    floorpal = SEC".floorpal",
722
    floorxpanning = SEC".floorxpanning",
723
    floorxpanning = SEC".floorxpanning",
723
    floorypanning = SEC".floorypanning",
724
    floorypanning = SEC".floorypanning",
724
725
725
    visibility = SEC".visibility",
726
    visibility = SEC".visibility",
726
    fogpal = SEC".fogpal",
727
    fogpal = SEC".fogpal",
727
    alignto = SEC".fogpal",  -- NAME
728
    alignto = SEC".fogpal",  -- NAME
728
729
729
    lotag = SEC".lotag",
730
    lotag = SEC".lotag",
730
    hitag = SEC".hitag",
731
    hitag = SEC".hitag",
731
    extra = SEC".extra",
732
    extra = SEC".extra",
732
733
733
    ceilingbunch = { SEC".ceilingbunch" },
734
    ceilingbunch = { SEC".ceilingbunch" },
734
    floorbunch = { SEC".floorbunch" },
735
    floorbunch = { SEC".floorbunch" },
735
736
736
    ulotag = S2U(SEC".lotag"),
737
    ulotag = S2U(SEC".lotag"),
737
    uhitag = S2U(SEC".hitag"),
738
    uhitag = S2U(SEC".hitag"),
738
}
739
}
739
740
740
local WAL = function(memb) return "wall[%s]"..memb end
741
local WAL = function(memb) return "wall[%s]"..memb end
741
local WALRO = function(memb) return { "wall[%s]"..memb } end
742
local WALRO = function(memb) return { "wall[%s]"..memb } end
742
743
743
local WallLabels = {
744
local WallLabels = {
744
    x = WAL".x",
745
    x = WAL".x",
745
    y = WAL".y",
746
    y = WAL".y",
746
    point2 = WALRO".point2",
747
    point2 = WALRO".point2",
747
    nextwall = { WAL".nextwall", WAL":_set_nextwall(%%s)" },
748
    nextwall = { WAL".nextwall", WAL":_set_nextwall(%%s)" },
748
    nextsector = { WAL".nextsector", WAL":_set_nextsector(%%s)" },
749
    nextsector = { WAL".nextsector", WAL":_set_nextsector(%%s)" },
749
    cstat = WAL".cstat",
750
    cstat = WAL".cstat",
750
    picnum = { WAL".picnum", WAL":set_picnum(%%s)", litok_ge0 },
751
    picnum = { WAL".picnum", WAL":set_picnum(%%s)", litok_ge0 },
751
    overpicnum = { WAL".overpicnum", WAL":set_overpicnum(%%s)", litok_ge0 },
752
    overpicnum = { WAL".overpicnum", WAL":set_overpicnum(%%s)", litok_ge0 },
752
    shade = WAL".shade",
753
    shade = WAL".shade",
753
    pal = WAL".pal",
754
    pal = WAL".pal",
754
    xrepeat = WAL".xrepeat",
755
    xrepeat = WAL".xrepeat",
755
    yrepeat = WAL".yrepeat",
756
    yrepeat = WAL".yrepeat",
756
    xpanning = WAL".xpanning",
757
    xpanning = WAL".xpanning",
757
    ypanning = WAL".ypanning",
758
    ypanning = WAL".ypanning",
758
    lotag = WAL".lotag",
759
    lotag = WAL".lotag",
759
    hitag = WAL".hitag",
760
    hitag = WAL".hitag",
760
    extra = WAL".extra",
761
    extra = WAL".extra",
761
    blend = WAL".blend",
762
    blend = WAL".blend",
762
763
763
    ulotag = S2U(WAL".lotag"),
764
    ulotag = S2U(WAL".lotag"),
764
    uhitag = S2U(WAL".hitag"),
765
    uhitag = S2U(WAL".hitag"),
765
}
766
}
766
767
767
StructAccessCode =
768
StructAccessCode =
768
{
769
{
769
    sector = SectorLabels,
770
    sector = SectorLabels,
770
    wall = WallLabels,
771
    wall = WallLabels,
771
    sprite = ActorLabels,
772
    sprite = ActorLabels,
772
    player = PlayerLabels,
773
    player = PlayerLabels,
773
}
774
}
774
775
775
local function tonegtag(LabelsTab, member, funcname)
776
local function tonegtag(LabelsTab, member, funcname)
776
    local memb = LabelsTab[member]
777
    local memb = LabelsTab[member]
777
    LabelsTab[member] = { memb, memb.."="..funcname.."(%%s)" }
778
    LabelsTab[member] = { memb, memb.."="..funcname.."(%%s)" }
778
end
779
end
779
780
780
function setup_negative_tag_check(funcname)
781
function setup_negative_tag_check(funcname)
781
    tonegtag(TspriteLabels, "tsprlotag", funcname)
782
    tonegtag(TspriteLabels, "tsprlotag", funcname)
782
    tonegtag(TspriteLabels, "tsprhitag", funcname)
783
    tonegtag(TspriteLabels, "tsprhitag", funcname)
783
    tonegtag(ActorLabels, "lotag", funcname)
784
    tonegtag(ActorLabels, "lotag", funcname)
784
    tonegtag(ActorLabels, "hitag", funcname)
785
    tonegtag(ActorLabels, "hitag", funcname)
785
    tonegtag(WallLabels, "lotag", funcname)
786
    tonegtag(WallLabels, "lotag", funcname)
786
    tonegtag(WallLabels, "hitag", funcname)
787
    tonegtag(WallLabels, "hitag", funcname)
787
    tonegtag(SectorLabels, "lotag", funcname)
788
    tonegtag(SectorLabels, "lotag", funcname)
788
    tonegtag(SectorLabels, "hitag", funcname)
789
    tonegtag(SectorLabels, "hitag", funcname)
789
end
790
end
790
791
791
local PROJ = function(memb) return "projectile[%s]"..memb end
792
local PROJ = function(memb) return "projectile[%s]"..memb end
792
local THISPROJ = function(memb) return "actor[%s].proj"..memb end
793
local THISPROJ = function(memb) return "actor[%s].proj"..memb end
793
794
794
local ProjectileLabels = {
795
local ProjectileLabels = {
795
    workslike = PROJ".workslike",
796
    workslike = PROJ".workslike",
796
    cstat = PROJ".cstat",
797
    cstat = PROJ".cstat",
797
    hitradius = PROJ".hitradius",
798
    hitradius = PROJ".hitradius",
798
    range = PROJ".range",
799
    range = PROJ".range",
799
    flashcolor = PROJ".flashcolor",
800
    flashcolor = PROJ".flashcolor",
800
    spawns = { PROJ".spawns", PROJ":set_spawns(%%s)", litok_gem1 },
801
    spawns = { PROJ".spawns", PROJ":set_spawns(%%s)", litok_gem1 },
801
    sound = { PROJ".sound", PROJ":set_sound(%%s)", litok_gem1 },
802
    sound = { PROJ".sound", PROJ":set_sound(%%s)", litok_gem1 },
802
    isound = { PROJ".isound", PROJ":set_isound(%%s)", litok_gem1 },
803
    isound = { PROJ".isound", PROJ":set_isound(%%s)", litok_gem1 },
803
    vel = PROJ".vel",
804
    vel = PROJ".vel",
804
    decal = { PROJ".decal", PROJ":set_decal(%%s)", litok_gem1 },
805
    decal = { PROJ".decal", PROJ":set_decal(%%s)", litok_gem1 },
805
    trail = { PROJ".trail", PROJ":set_trail(%%s)", litok_gem1 },
806
    trail = { PROJ".trail", PROJ":set_trail(%%s)", litok_gem1 },
806
    tnum = PROJ".tnum",
807
    tnum = PROJ".tnum",
807
    drop = PROJ".drop",
808
    drop = PROJ".drop",
808
    offset = PROJ".offset",
809
    offset = PROJ".offset",
809
    bounces = PROJ".bounces",
810
    bounces = PROJ".bounces",
810
    bsound = { PROJ".bsound", PROJ":set_bsound(%%s)", litok_gem1 },
811
    bsound = { PROJ".bsound", PROJ":set_bsound(%%s)", litok_gem1 },
811
    toffset = PROJ".toffset",
812
    toffset = PROJ".toffset",
812
    extra = PROJ".extra",
813
    extra = PROJ".extra",
813
    extra_rand = PROJ".extra_rand",
814
    extra_rand = PROJ".extra_rand",
814
    sxrepeat = PROJ".sxrepeat",
815
    sxrepeat = PROJ".sxrepeat",
815
    syrepeat = PROJ".syrepeat",
816
    syrepeat = PROJ".syrepeat",
816
    txrepeat = PROJ".txrepeat",
817
    txrepeat = PROJ".txrepeat",
817
    tyrepeat = PROJ".tyrepeat",
818
    tyrepeat = PROJ".tyrepeat",
818
    shade = PROJ".shade",
819
    shade = PROJ".shade",
819
    xrepeat = PROJ".xrepeat",
820
    xrepeat = PROJ".xrepeat",
820
    yrepeat = PROJ".yrepeat",
821
    yrepeat = PROJ".yrepeat",
821
    pal = PROJ".pal",
822
    pal = PROJ".pal",
822
    velmult = PROJ".movecnt",  -- NAME
823
    velmult = PROJ".movecnt",  -- NAME
823
    clipdist = PROJ".clipdist",
824
    clipdist = PROJ".clipdist",
824
    userdata = PROJ".userdata",
825
    userdata = PROJ".userdata",
825
}
826
}
826
827
827
-- XXX: kind of CODEDUP form spr2tspr
828
-- XXX: kind of CODEDUP form spr2tspr
828
local function proj2thisproj(code)
829
local function proj2thisproj(code)
829
    if (code and code:find(PROJ"", 1, true)==1) then
830
    if (code and code:find(PROJ"", 1, true)==1) then
830
        return THISPROJ(code:sub(#PROJ"" + 1))
831
        return THISPROJ(code:sub(#PROJ"" + 1))
831
    end
832
    end
832
    -- else return nothing
833
    -- else return nothing
833
end
834
end
834
835
835
local SpriteProjectileLabels = {}
836
local SpriteProjectileLabels = {}
836
837
837
for member, code in pairs(ProjectileLabels) do
838
for member, code in pairs(ProjectileLabels) do
838
    if (type(code)=="string") then
839
    if (type(code)=="string") then
839
        SpriteProjectileLabels[member] = proj2thisproj(code)
840
        SpriteProjectileLabels[member] = proj2thisproj(code)
840
    else
841
    else
841
        SpriteProjectileLabels[member] = { proj2thisproj(code[1]), proj2thisproj(code[2]) }
842
        SpriteProjectileLabels[member] = { proj2thisproj(code[1]), proj2thisproj(code[2]) }
842
    end
843
    end
843
end
844
end
844
845
845
local UD = function(memb) return "_gud(_pli)"..memb end
846
local UD = function(memb) return "_gud(_pli)"..memb end
846
local UDRO = function(memb) return { UD(memb) } end
847
local UDRO = function(memb) return { UD(memb) } end
847
848
848
-- NOTE: Only members that actually encountered in existing mods are added here.
849
-- NOTE: Only members that actually encountered in existing mods are added here.
849
local UserdefLabels = {
850
local UserdefLabels = {
850
    althud = UD".althud",
851
    althud = UD".althud",
851
    auto_run = UD".auto_run",
852
    auto_run = UD".auto_run",
852
    camerasprite = UDRO".camerasprite",
853
    camerasprite = UDRO".camerasprite",
853
    cashman = UDRO".cashman",
854
    cashman = UDRO".cashman",
854
    clipping = UD".noclip",  -- NAME
855
    clipping = UD".noclip",  -- NAME
855
    color = UD".color",
856
    color = UD".color",
856
    const_visibility = UD".const_visibility",
857
    const_visibility = UD".const_visibility",
857
    crosshair = UD".crosshair",
858
    crosshair = UD".crosshair",
858
    crosshairscale = UDRO".crosshairscale",
859
    crosshairscale = UDRO".crosshairscale",
859
    detail = { "1" },
860
    detail = { "1" },
860
    display_bonus_screen = UD".display_bonus_screen",
861
    display_bonus_screen = UD".display_bonus_screen",
861
    drawweapon = UDRO".drawweapon",
862
    drawweapon = UDRO".drawweapon",
862
    eog = UD".eog",
863
    eog = UD".eog",
863
    ffire = UDRO".ffire",
864
    ffire = UDRO".ffire",
864
    fta_on = UD".fta_on",
865
    fta_on = UD".fta_on",
865
    god = UDRO".god",
866
    god = UDRO".god",
866
    idplayers = UDRO".idplayers",
867
    idplayers = UDRO".idplayers",
867
    last_level = UDRO".last_level",
868
    last_level = UDRO".last_level",
868
    level_number = { UD".level_number", UD":set_level_number(%%s)", {0, MAXLEVELS-1} },
869
    level_number = { UD".level_number", UD":set_level_number(%%s)", {0, MAXLEVELS-1} },
869
    levelstats = UD".levelstats",
870
    levelstats = UD".levelstats",
870
    lockout = UDRO".lockout",
871
    lockout = UDRO".lockout",
871
    m_origin_x = UD".m_origin.x",
872
    m_origin_x = UD".m_origin.x",
872
    m_origin_y = UD".m_origin.y",
873
    m_origin_y = UD".m_origin.y",
873
    m_player_skill = UDRO".m_player_skill",
874
    m_player_skill = UDRO".m_player_skill",
874
    m_volume_number = { UD".m_volume_number", UD":set_m_volume_number(%%s)", {0, MAXVOLUMES} },
875
    m_volume_number = { UD".m_volume_number", UD":set_m_volume_number(%%s)", {0, MAXVOLUMES} },
875
    mouseaiming = UD".mouseaiming",
876
    mouseaiming = UD".mouseaiming",
876
    pause_on = UDRO".pause_on",
877
    pause_on = UDRO".pause_on",
877
    player_skill = UD".player_skill",
878
    player_skill = UD".player_skill",
878
    playerbest = UDRO".playerbest",
879
    playerbest = UDRO".playerbest",
879
    mouseflip = UDRO".mouseflip",
880
    mouseflip = UDRO".mouseflip",
880
    multimode = { "1" },
881
    multimode = { "1" },
881
    musictoggle = UDRO".config.MusicToggle",
882
    musictoggle = UDRO".config.MusicToggle",
882
    noexits = UDRO".noexits",
883
    noexits = UDRO".noexits",
883
    overhead_on = UD".overhead_on",
884
    overhead_on = UD".overhead_on",
884
    recstat = UDRO".recstat",
885
    recstat = UDRO".recstat",
885
    runkey_mode = UD".runkey_mode",
886
    runkey_mode = UD".runkey_mode",
886
    show_level_text = UD".show_level_text",
887
    show_level_text = UD".show_level_text",
887
    screen_size = { UD".screen_size", UD":set_screen_size(%%s)" },
888
    screen_size = { UD".screen_size", UD":set_screen_size(%%s)" },
888
    screen_tilting = UD".screen_tilting",
889
    screen_tilting = UD".screen_tilting",
889
    showallmap = UD".showallmap",
890
    showallmap = UD".showallmap",
890
    showweapons = UDRO".showweapons",
891
    showweapons = UDRO".showweapons",
891
    statusbarmode = UDRO".statusbarmode",
892
    statusbarmode = UDRO".statusbarmode",
892
    statusbarscale = UDRO".statusbarscale",
893
    statusbarscale = UDRO".statusbarscale",
893
    volume_number = { UD".volume_number", UD":set_volume_number(%%s)", {0, MAXVOLUMES} },
894
    volume_number = { UD".volume_number", UD":set_volume_number(%%s)", {0, MAXVOLUMES} },
894
    weaponscale = UDRO".weaponscale",
895
    weaponscale = UDRO".weaponscale",
895
    weaponswitch = UD".weaponswitch",
896
    weaponswitch = UD".weaponswitch",
896
}
897
}
897
898
898
local INP = function(memb) return PL"._input"..memb end
899
local INP = function(memb) return PL"._input"..memb end
899
900
900
local InputLabels = {
901
local InputLabels = {
901
    avel = INP".avel",
902
    avel = INP".avel",
902
    horz = INP".horz",
903
    horz = INP".horz",
903
    fvel = INP".fvel",
904
    fvel = INP".fvel",
904
    svel = INP".svel",
905
    svel = INP".svel",
905
    bits = INP".bits",
906
    bits = INP".bits",
906
    extbits = INP".extbits",
907
    extbits = INP".extbits",
907
}
908
}
908
909
909
-- These structs cannot be accessed by inline array exprs in CON:
910
-- These structs cannot be accessed by inline array exprs in CON:
910
StructAccessCode2 =
911
StructAccessCode2 =
911
{
912
{
912
    tspr = TspriteLabels,
913
    tspr = TspriteLabels,
913
    projectile = ProjectileLabels,
914
    projectile = ProjectileLabels,
914
    thisprojectile = SpriteProjectileLabels,
915
    thisprojectile = SpriteProjectileLabels,
915
    userdef = UserdefLabels,
916
    userdef = UserdefLabels,
916
    input = InputLabels,
917
    input = InputLabels,
917
}
918
}
918
919
919
-- NOTE: These MUST be in reverse lexicographical order!
920
-- NOTE: These MUST be in reverse lexicographical order!
920
-- Per CON syntax, valid identifiers names are disjoint from keywords,
921
-- Per CON syntax, valid identifiers names are disjoint from keywords,
921
-- so that a rule like
922
-- so that a rule like
922
--      t_identifier = -con_keyword * (sp1 + "[") * t_identifier_all
923
--      t_identifier = -con_keyword * (sp1 + "[") * t_identifier_all
923
-- (from the final grammar in lunacon.lua) must match the longest
924
-- (from the final grammar in lunacon.lua) must match the longest
924
-- possible keyword name, else the negation might wrongly not fail.
925
-- possible keyword name, else the negation might wrongly not fail.
925
926
926
keyword =
927
keyword =
927
928
928
lpeg.P(false) +
929
lpeg.P(false) +
929
"}" +
930
"}" +
930
"{" +
931
"{" +
931
"zshootvar" +
932
"zshootvar" +
932
"zshoot" +
933
"zshoot" +
933
"xorvarvar" +
934
"xorvarvar" +
934
"xorvar" +
935
"xorvar" +
935
"writearraytofile" +
936
"writearraytofile" +
936
"whilevarvarn" +
937
"whilevarvarn" +
937
"whilevarn" +
938
"whilevarn" +
938
"wackplayer" +
939
"wackplayer" +
939
"userquote" +
940
"userquote" +
940
"useractor" +
941
"useractor" +
941
"updatesectorz" +
942
"updatesectorz" +
942
"updatesector" +
943
"updatesector" +
943
"undefinevolume" +
944
"undefinevolume" +
944
"undefineskill" +
945
"undefineskill" +
945
"undefinelevel" +
946
"undefinelevel" +
946
"tossweapon" +
947
"tossweapon" +
947
"tip" +
948
"tip" +
948
"time" +
949
"time" +
949
"switch" +
950
"switch" +
950
"subvarvar" +
951
"subvarvar" +
951
"subvar" +
952
"subvar" +
952
"strength" +
953
"strength" +
953
"stopsoundvar" +
954
"stopsoundvar" +
954
"stopsound" +
955
"stopsound" +
955
"stopallsounds" +
956
"stopallsounds" +
956
"stopactorsound" +
957
"stopactorsound" +
957
"state" +
958
"state" +
958
"starttrackvar" +
959
"starttrackvar" +
959
"starttrack" +
960
"starttrack" +
960
"startlevel" +
961
"startlevel" +
961
"startcutscene" +
962
"startcutscene" +
962
"ssp" +
963
"ssp" +
963
"sqrt" +
964
"sqrt" +
964
"spriteshadow" +
965
"spriteshadow" +
965
"spritepal" +
966
"spritepal" +
966
"spritenvg" +
967
"spritenvg" +
967
"spritenoshade" +
968
"spritenoshade" +
968
"spritenopal" +
969
"spritenopal" +
969
"spriteflags" +
970
"spriteflags" +
970
"spgetlotag" +
971
"spgetlotag" +
971
"spgethitag" +
972
"spgethitag" +
972
"spawn" +
973
"spawn" +
973
"soundvar" +
974
"soundvar" +
974
"soundoncevar" +
975
"soundoncevar" +
975
"soundonce" +
976
"soundonce" +
976
"sound" +
977
"sound" +
977
"smaxammo" +
978
"smaxammo" +
978
"sleeptime" +
979
"sleeptime" +
979
"sizeto" +
980
"sizeto" +
980
"sizeat" +
981
"sizeat" +
981
"sin" +
982
"sin" +
982
"showviewunbiased" +
983
"showviewunbiased" +
983
"showview" +
984
"showview" +
984
"shootvar" +
985
"shootvar" +
985
"shoot" +
986
"shoot" +
986
"shiftvarr" +
987
"shiftvarr" +
987
"shiftvarl" +
988
"shiftvarl" +
988
"shadeto" +
989
"shadeto" +
989
"setwall" +
990
"setwall" +
990
"setvarvar" +
991
"setvarvar" +
991
"setvar" +
992
"setvar" +
992
"setuserdef" +
993
"setuserdef" +
993
"settspr" +
994
"settspr" +
994
"setthisprojectile" +
995
"setthisprojectile" +
995
"setsprite" +
996
"setsprite" +
996
"setsector" +
997
"setsector" +
997
"setprojectile" +
998
"setprojectile" +
998
"setplayervar" +
999
"setplayervar" +
999
"setplayerangle" +
1000
"setplayerangle" +
1000
"setplayer" +
1001
"setplayer" +
1001
"setmusicposition" +
1002
"setmusicposition" +
1002
"setinput" +
1003
"setinput" +
1003
"setgamepalette" +
1004
"setgamepalette" +
1004
"setgamename" +
1005
"setgamename" +
1005
"setdefname" +
1006
"setdefname" +
1006
"setcfgname" +
1007
"setcfgname" +
1007
"setaspect" +
1008
"setaspect" +
1008
"setarray" +
1009
"setarray" +
1009
"setactorvar" +
1010
"setactorvar" +
1010
"setactorsoundpitch" +
1011
"setactorsoundpitch" +
1011
"setactorangle" +
1012
"setactorangle" +
1012
"setactor" +
1013
"setactor" +
1013
"sectsetinterpolation" +
1014
"sectsetinterpolation" +
1014
"sectorofwall" +
1015
"sectorofwall" +
1015
"sectgetlotag" +
1016
"sectgetlotag" +
1016
"sectgethitag" +
1017
"sectgethitag" +
1017
"sectclearinterpolation" +
1018
"sectclearinterpolation" +
1018
"scriptsize" +
1019
"scriptsize" +
1019
"screentext" +
1020
"screentext" +
1020
"screensound" +
1021
"screensound" +
1021
"savenn" +
1022
"savenn" +
1022
"savemapstate" +
1023
"savemapstate" +
1023
"savegamevar" +
1024
"savegamevar" +
1024
"save" +
1025
"save" +
1025
"rotatespritea" +
1026
"rotatespritea" +
1026
"rotatesprite16" +
1027
"rotatesprite16" +
1027
"rotatesprite" +
1028
"rotatesprite" +
1028
"rotatepoint" +
1029
"rotatepoint" +
1029
"return" +
1030
"return" +
1030
"respawnhitag" +
1031
"respawnhitag" +
1031
"resizearray" +
1032
"resizearray" +
1032
"resetplayerflags" +
1033
"resetplayerflags" +
1033
"resetplayer" +
1034
"resetplayer" +
1034
"resetcount" +
1035
"resetcount" +
1035
"resetactioncount" +
1036
"resetactioncount" +
1036
"redefinequote" +
1037
"redefinequote" +
1037
"readgamevar" +
1038
"readgamevar" +
1038
"readarrayfromfile" +
1039
"readarrayfromfile" +
1039
"rayintersect" +
1040
"rayintersect" +
1040
"randvarvar" +
1041
"randvarvar" +
1041
"randvar" +
1042
"randvar" +
1042
"quote" +
1043
"quote" +
1043
"quake" +
1044
"quake" +
1044
"qsubstr" +
1045
"qsubstr" +
1045
"qstrncat" +
1046
"qstrncat" +
1046
"qstrlen" +
1047
"qstrlen" +
1047
"qstrdim" +
1048
"qstrdim" +
1048
"qstrcpy" +
1049
"qstrcpy" +
1049
"qstrcat" +
1050
"qstrcat" +
1050
"qsprintf" +
1051
"qsprintf" +
1051
"qspawnvar" +
1052
"qspawnvar" +
1052
"qspawn" +
1053
"qspawn" +
1053
"qgetsysstr" +
1054
"qgetsysstr" +
1054
"pstomp" +
1055
"pstomp" +
1055
"prevspritestat" +
1056
"prevspritestat" +
1056
"prevspritesect" +
1057
"prevspritesect" +
1057
"precache" +
1058
"precache" +
1058
"pkick" +
1059
"pkick" +
1059
"paper" +
1060
"paper" +
1060
"palfrom" +
1061
"palfrom" +
1061
"orvarvar" +
1062
"orvarvar" +
1062
"orvar" +
1063
"orvar" +
1063
"operatesectors" +
1064
"operatesectors" +
1064
"operaterespawns" +
1065
"operaterespawns" +
1065
"operatemasterswitches" +
1066
"operatemasterswitches" +
1066
"operateactivators" +
1067
"operateactivators" +
1067
"operate" +
1068
"operate" +
1068
"onevent" +
1069
"onevent" +
1069
"nullop" +
1070
"nullop" +
1070
"nextspritestat" +
1071
"nextspritestat" +
1071
"nextspritesect" +
1072
"nextspritesect" +
1072
"neartag" +
1073
"neartag" +
1073
"myosx" +
1074
"myosx" +
1074
"myospalx" +
1075
"myospalx" +
1075
"myospal" +
1076
"myospal" +
1076
"myos" +
1077
"myos" +
1077
"music" +
1078
"music" +
1078
"mulvarvar" +
1079
"mulvarvar" +
1079
"mulvar" +
1080
"mulvar" +
1080
"mulscale" +
1081
"mulscale" +
1081
"movesprite" +
1082
"movesprite" +
1082
"move" +
1083
"move" +
1083
"money" +
1084
"money" +
1084
"modvarvar" +
1085
"modvarvar" +
1085
"modvar" +
1086
"modvar" +
1086
"minitext" +
1087
"minitext" +
1087
"mikesnd" +
1088
"mikesnd" +
1088
"mail" +
1089
"mail" +
1089
"lotsofglass" +
1090
"lotsofglass" +
1090
"lockplayer" +
1091
"lockplayer" +
1091
"loadmapstate" +
1092
"loadmapstate" +
1092
"lineintersect" +
1093
"lineintersect" +
1093
"ldist" +
1094
"ldist" +
1094
"killit" +
1095
"killit" +
1095
"jump" +
1096
"jump" +
1096
"insertspriteq" +
1097
"insertspriteq" +
1097
"inittimer" +
1098
"inittimer" +
1098
"includedefault" +
1099
"includedefault" +
1099
"include" +
1100
"include" +
1100
"ifwasweapon" +
1101
"ifwasweapon" +
1101
"ifvarxor" +
1102
"ifvarxor" +
1102
"ifvarvarxor" +
1103
"ifvarvarxor" +
1103
"ifvarvaror" +
1104
"ifvarvaror" +
1104
"ifvarvarn" +
1105
"ifvarvarn" +
1105
"ifvarvarl" +
1106
"ifvarvarl" +
1106
"ifvarvarg" +
1107
"ifvarvarg" +
1107
"ifvarvareither" +
1108
"ifvarvareither" +
1108
"ifvarvare" +
1109
"ifvarvare" +
1109
"ifvarvarand" +
1110
"ifvarvarand" +
1110
"ifvaror" +
1111
"ifvaror" +
1111
"ifvarn" +
1112
"ifvarn" +
1112
"ifvarl" +
1113
"ifvarl" +
1113
"ifvarg" +
1114
"ifvarg" +
1114
"ifvareither" +
1115
"ifvareither" +
1115
"ifvare" +
1116
"ifvare" +
1116
"ifvarand" +
1117
"ifvarand" +
1117
"ifstrength" +
1118
"ifstrength" +
1118
"ifsquished" +
1119
"ifsquished" +
1119
"ifspritepal" +
1120
"ifspritepal" +
1120
"ifspawnedby" +
1121
"ifspawnedby" +
1121
"ifsound" +
1122
"ifsound" +
1122
"ifserver" +
1123
"ifserver" +
1123
"ifrnd" +
1124
"ifrnd" +
1124
"ifrespawn" +
1125
"ifrespawn" +
1125
"ifplayersl" +
1126
"ifplayersl" +
1126
"ifpinventory" +
1127
"ifpinventory" +
1127
"ifphealthl" +
1128
"ifphealthl" +
1128
"ifpdistl" +
1129
"ifpdistl" +
1129
"ifpdistg" +
1130
"ifpdistg" +
1130
"ifp" +
1131
"ifp" +
1131
"ifoutside" +
1132
"ifoutside" +
1132
"ifonwater" +
1133
"ifonwater" +
1133
"ifnotmoving" +
1134
"ifnotmoving" +
1134
"ifnosounds" +
1135
"ifnosounds" +
1135
"ifmultiplayer" +
1136
"ifmultiplayer" +
1136
"ifmove" +
1137
"ifmove" +
1137
"ifinwater" +
1138
"ifinwater" +
1138
"ifinspace" +
1139
"ifinspace" +
1139
"ifinouterspace" +
1140
"ifinouterspace" +
1140
"ifhitweapon" +
1141
"ifhitweapon" +
1141
"ifhitspace" +
1142
"ifhitspace" +
1142
"ifgotweaponce" +
1143
"ifgotweaponce" +
1143
"ifgapzl" +
1144
"ifgapzl" +
1144
"iffloordistl" +
1145
"iffloordistl" +
1145
"ifdead" +
1146
"ifdead" +
1146
"ifcutscene" +
1147
"ifcutscene" +
1147
"ifcount" +
1148
"ifcount" +
1148
"ifclient" +
1149
"ifclient" +
1149
"ifceilingdistl" +
1150
"ifceilingdistl" +
1150
"ifcanshoottarget" +
1151
"ifcanshoottarget" +
1151
"ifcanseetarget" +
1152
"ifcanseetarget" +
1152
"ifcansee" +
1153
"ifcansee" +
1153
"ifbulletnear" +
1154
"ifbulletnear" +
1154
"ifawayfromwall" +
1155
"ifawayfromwall" +
1155
"ifangdiffl" +
1156
"ifangdiffl" +
1156
"ifai" +
1157
"ifai" +
1157
"ifactorsound" +
1158
"ifactorsound" +
1158
"ifactornotstayput" +
1159
"ifactornotstayput" +
1159
"ifactor" +
1160
"ifactor" +
1160
"ifactioncount" +
1161
"ifactioncount" +
1161
"ifaction" +
1162
"ifaction" +
1162
"hitscan" +
1163
"hitscan" +
1163
"hitradiusvar" +
1164
"hitradiusvar" +
1164
"hitradius" +
1165
"hitradius" +
1165
"headspritestat" +
1166
"headspritestat" +
1166
"headspritesect" +
1167
"headspritesect" +
1167
"guts" +
1168
"guts" +
1168
"guniqhudid" +
1169
"guniqhudid" +
1169
"gmaxammo" +
1170
"gmaxammo" +
1170
"globalsoundvar" +
1171
"globalsoundvar" +
1171
"globalsound" +
1172
"globalsound" +
1172
"getzrange" +
1173
"getzrange" +
1173
"getwall" +
1174
"getwall" +
1174
"getuserdef" +
1175
"getuserdef" +
1175
"gettspr" +
1176
"gettspr" +
1176
"gettimedate" +
1177
"gettimedate" +
1177
"getticks" +
1178
"getticks" +
1178
"getthisprojectile" +
1179
"getthisprojectile" +
1179
"gettexturefloor" +
1180
"gettexturefloor" +
1180
"gettextureceiling" +
1181
"gettextureceiling" +
1181
"getsector" +
1182
"getsector" +
1182
"getprojectile" +
1183
"getprojectile" +
1183
"getpname" +
1184
"getpname" +
1184
"getplayervar" +
1185
"getplayervar" +
1185
"getplayerangle" +
1186
"getplayerangle" +
1186
"getplayer" +
1187
"getplayer" +
1187
"getmusicposition" +
1188
"getmusicposition" +
1188
"getlastpal" +
1189
"getlastpal" +
1189
"getkeyname" +
1190
"getkeyname" +
1190
"getinput" +
1191
"getinput" +
1191
"getincangle" +
1192
"getincangle" +
1192
"getflorzofslope" +
1193
"getflorzofslope" +
1193
"getcurraddress" +
1194
"getcurraddress" +
1194
"getceilzofslope" +
1195
"getceilzofslope" +
1195
"getarraysize" +
1196
"getarraysize" +
1196
"getangletotarget" +
1197
"getangletotarget" +
1197
"getangle" +
1198
"getangle" +
1198
"getactorvar" +
1199
"getactorvar" +
1199
"getactorangle" +
1200
"getactorangle" +
1200
"getactor" +
1201
"getactor" +
1201
"gamevar" +
1202
"gamevar" +
1202
"gametextz" +
1203
"gametextz" +
1203
"gametext" +
1204
"gametext" +
1204
"gamestartup" +
1205
"gamestartup" +
1205
"gamearray" +
1206
"gamearray" +
1206
"flash" +
1207
"flash" +
1207
"findplayer" +
1208
"findplayer" +
1208
"findotherplayer" +
1209
"findotherplayer" +
1209
"findnearspritezvar" +
1210
"findnearspritezvar" +
1210
"findnearspritez" +
1211
"findnearspritez" +
1211
"findnearspritevar" +
1212
"findnearspritevar" +
1212
"findnearsprite3dvar" +
1213
"findnearsprite3dvar" +
1213
"findnearsprite3d" +
1214
"findnearsprite3d" +
1214
"findnearsprite" +
1215
"findnearsprite" +
1215
"findnearactorzvar" +
1216
"findnearactorzvar" +
1216
"findnearactorz" +
1217
"findnearactorz" +
1217
"findnearactorvar" +
1218
"findnearactorvar" +
1218
"findnearactor3dvar" +
1219
"findnearactor3dvar" +
1219
"findnearactor3d" +
1220
"findnearactor3d" +
1220
"findnearactor" +
1221
"findnearactor" +
1221
"fall" +
1222
"fall" +
1222
"ezshootvar" +
1223
"ezshootvar" +
1223
"ezshoot" +
1224
"ezshoot" +
1224
"eventloadactor" +
1225
"eventloadactor" +
1225
"espawnvar" +
1226
"espawnvar" +
1226
"espawn" +
1227
"espawn" +
1227
"eshootvar" +
1228
"eshootvar" +
1228
"eshoot" +
1229
"eshoot" +
1229
"eqspawnvar" +
1230
"eqspawnvar" +
1230
"eqspawn" +
1231
"eqspawn" +
1231
"enhanced" +
1232
"enhanced" +
1232
"endswitch" +
1233
"endswitch" +
1233
"ends" +
1234
"ends" +
1234
"endoflevel" +
1235
"endoflevel" +
1235
"endofgame" +
1236
"endofgame" +
1236
"endevent" +
1237
"endevent" +
1237
"enda" +
1238
"enda" +
1238
"else" +
1239
"else" +
1239
"echo" +
1240
"echo" +
1240
"dynamicsoundremap" +
1241
"dynamicsoundremap" +
1241
"dynamicremap" +
1242
"dynamicremap" +
1242
"dragpoint" +
1243
"dragpoint" +
1243
"divvarvar" +
1244
"divvarvar" +
1244
"divvar" +
1245
"divvar" +
1245
"dist" +
1246
"dist" +
1246
"displayrandvarvar" +
1247
"displayrandvarvar" +
1247
"displayrandvar" +
1248
"displayrandvar" +
1248
"displayrand" +
1249
"displayrand" +
1249
"digitalnumberz" +
1250
"digitalnumberz" +
1250
"digitalnumber" +
1251
"digitalnumber" +
1251
"definevolumename" +
1252
"definevolumename" +
1252
"definevolumeflags" +
1253
"definevolumeflags" +
1253
"definesound" +
1254
"definesound" +
1254
"defineskillname" +
1255
"defineskillname" +
1255
"definequote" +
1256
"definequote" +
1256
"defineprojectile" +
1257
"defineprojectile" +
1257
"definelevelname" +
1258
"definelevelname" +
1258
"definegametype" +
1259
"definegametype" +
1259
"definegamefuncname" +
1260
"definegamefuncname" +
1260
"definecheat" +
1261
"definecheat" +
1261
"define" +
1262
"define" +
1262
"default" +
1263
"default" +
1263
"debug" +
1264
"debug" +
1264
"debris" +
1265
"debris" +
1265
"cstator" +
1266
"cstator" +
1266
"cstat" +
1267
"cstat" +
1267
"count" +
1268
"count" +
1268
"cos" +
1269
"cos" +
1269
"copy" +
1270
"copy" +
1270
"cmenu" +
1271
"cmenu" +
1271
"clipmovenoslide" +
1272
"clipmovenoslide" +
1272
"clipmove" +
1273
"clipmove" +
1273
"clipdist" +
1274
"clipdist" +
1274
"clearmapstate" +
1275
"clearmapstate" +
1275
"checkavailweapon" +
1276
"checkavailweapon" +
1276
"checkavailinven" +
1277
"checkavailinven" +
1277
"checkactivatormotion" +
1278
"checkactivatormotion" +
1278
"cheatkeys" +
1279
"cheatkeys" +
1279
"changespritestat" +
1280
"changespritestat" +
1280
"changespritesect" +
1281
"changespritesect" +
1281
"case" +
1282
"case" +
1282
"canseespr" +
1283
"canseespr" +
1283
"cansee" +
1284
"cansee" +
1284
"calchypotenuse" +
1285
"calchypotenuse" +
1285
"cactor" +
1286
"cactor" +
1286
"break" +
1287
"break" +
1287
"betaname" +
1288
"betaname" +
1288
"angoffvar" +
1289
"angoffvar" +
1289
"angoff" +
1290
"angoff" +
1290
"andvarvar" +
1291
"andvarvar" +
1291
"andvar" +
1292
"andvar" +
1292
"ai" +
1293
"ai" +
1293
"addweaponvar" +
1294
"addweaponvar" +
1294
"addweapon" +
1295
"addweapon" +
1295
"addvarvar" +
1296
"addvarvar" +
1296
"addvar" +
1297
"addvar" +
1297
"addstrength" +
1298
"addstrength" +
1298
"addphealth" +
1299
"addphealth" +
1299
"addlogvar" +
1300
"addlogvar" +
1300
"addlog" +
1301
"addlog" +
1301
"addkills" +
1302
"addkills" +
1302
"addinventory" +
1303
"addinventory" +
1303
"addammo" +
1304
"addammo" +
1304
"actor" +
1305
"actor" +
1305
"activatecheat" +
1306
"activatecheat" +
1306
"activatebysector" +
1307
"activatebysector" +
1307
"activate" +
1308
"activate" +
1308
"action" +
1309
"action" +
1309
lpeg.P(false)
1310
lpeg.P(false)
1310
 
1311