Subversion Repositories eduke32

Rev

Rev 5036 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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