Subversion Repositories eduke32

Rev

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

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