Subversion Repositories eduke32

Rev

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

Rev 877 Rev 881
1
//-------------------------------------------------------------------------
1
//-------------------------------------------------------------------------
2
/*
2
/*
3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
4
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
4
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
5
Copyright (C) 2004, 2007 - EDuke32 developers
5
Copyright (C) 2004, 2007 - EDuke32 developers
6

6

7
This file is part of EDuke32
7
This file is part of EDuke32
8

8

9
EDuke32 is free software; you can redistribute it and/or
9
EDuke32 is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License version 2
10
modify it under the terms of the GNU General Public License version 2
11
as published by the Free Software Foundation.
11
as published by the Free Software Foundation.
12

12

13
This program is distributed in the hope that it will be useful,
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16

16

17
See the GNU General Public License for more details.
17
See the GNU General Public License for more details.
18

18

19
You should have received a copy of the GNU General Public License
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
*/
22
*/
23
//-------------------------------------------------------------------------
23
//-------------------------------------------------------------------------
24
24
25
#include "duke3d.h"
25
#include "duke3d.h"
26
#include "gamedef.h"
26
#include "gamedef.h"
27
27
28
#include "osd.h"
28
#include "osd.h"
29
29
30
int g_ScriptVersion = 13; // 13 = 1.3D-style CON files, 14 = 1.4/1.5 style CON files
30
int g_ScriptVersion = 13; // 13 = 1.3D-style CON files, 14 = 1.4/1.5 style CON files
31
31
32
char compilefile[BMAX_PATH] = "(none)";  // file we're currently compiling
32
char compilefile[BMAX_PATH] = "(none)";  // file we're currently compiling
33
static char parsing_item_name[MAXVARLABEL] = "(none)", previous_item_name[MAXVARLABEL] = "NULL";
33
static char parsing_item_name[MAXVARLABEL] = "(none)", previous_item_name[MAXVARLABEL] = "NULL";
34
34
35
int total_lines,line_number;
35
int total_lines,line_number;
36
static int checking_ifelse,parsing_state;
36
static int checking_ifelse,parsing_state;
37
char g_szBuf[1024];
37
char g_szBuf[1024];
38
38
39
intptr_t *casescriptptr=NULL;      // the pointer to the start of the case table in a switch statement
39
intptr_t *casescriptptr=NULL;      // the pointer to the start of the case table in a switch statement
40
// first entry is 'default' code.
40
// first entry is 'default' code.
41
static int casecount = 0;
41
static int casecount = 0;
42
static int checking_switch = 0, current_event = -1;
42
static int checking_switch = 0, current_event = -1;
43
static int labelsonly = 0, nokeywordcheck = 0, dynamicremap = 0;
43
static int labelsonly = 0, nokeywordcheck = 0, dynamicremap = 0;
44
static int num_braces = 0;
44
static int num_braces = 0;
45
45
46
static int increasescriptsize(int size);
46
static int increasescriptsize(int size);
47
47
48
int redefined_quote_count = 0;
48
int redefined_quote_count = 0;
49
49
50
intptr_t *aplWeaponClip[MAX_WEAPONS];       // number of items in magazine
50
intptr_t *aplWeaponClip[MAX_WEAPONS];       // number of items in magazine
51
intptr_t *aplWeaponReload[MAX_WEAPONS];     // delay to reload (include fire)
51
intptr_t *aplWeaponReload[MAX_WEAPONS];     // delay to reload (include fire)
52
intptr_t *aplWeaponFireDelay[MAX_WEAPONS];      // delay to fire
52
intptr_t *aplWeaponFireDelay[MAX_WEAPONS];      // delay to fire
53
intptr_t *aplWeaponHoldDelay[MAX_WEAPONS];      // delay after release fire button to fire (0 for none)
53
intptr_t *aplWeaponHoldDelay[MAX_WEAPONS];      // delay after release fire button to fire (0 for none)
54
intptr_t *aplWeaponTotalTime[MAX_WEAPONS];      // The total time the weapon is cycling before next fire.
54
intptr_t *aplWeaponTotalTime[MAX_WEAPONS];      // The total time the weapon is cycling before next fire.
55
intptr_t *aplWeaponFlags[MAX_WEAPONS];      // Flags for weapon
55
intptr_t *aplWeaponFlags[MAX_WEAPONS];      // Flags for weapon
56
intptr_t *aplWeaponShoots[MAX_WEAPONS];     // what the weapon shoots
56
intptr_t *aplWeaponShoots[MAX_WEAPONS];     // what the weapon shoots
57
intptr_t *aplWeaponSpawnTime[MAX_WEAPONS];      // the frame at which to spawn an item
57
intptr_t *aplWeaponSpawnTime[MAX_WEAPONS];      // the frame at which to spawn an item
58
intptr_t *aplWeaponSpawn[MAX_WEAPONS];      // the item to spawn
58
intptr_t *aplWeaponSpawn[MAX_WEAPONS];      // the item to spawn
59
intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS];  // number of shots per 'burst' (one ammo per 'burst'
59
intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS];  // number of shots per 'burst' (one ammo per 'burst'
60
intptr_t *aplWeaponWorksLike[MAX_WEAPONS];      // What original the weapon works like
60
intptr_t *aplWeaponWorksLike[MAX_WEAPONS];      // What original the weapon works like
61
intptr_t *aplWeaponInitialSound[MAX_WEAPONS];   // Sound made when initialy firing. zero for no sound
61
intptr_t *aplWeaponInitialSound[MAX_WEAPONS];   // Sound made when initialy firing. zero for no sound
62
intptr_t *aplWeaponFireSound[MAX_WEAPONS];      // Sound made when firing (each time for automatic)
62
intptr_t *aplWeaponFireSound[MAX_WEAPONS];      // Sound made when firing (each time for automatic)
63
intptr_t *aplWeaponSound2Time[MAX_WEAPONS];     // Alternate sound time
63
intptr_t *aplWeaponSound2Time[MAX_WEAPONS];     // Alternate sound time
64
intptr_t *aplWeaponSound2Sound[MAX_WEAPONS];    // Alternate sound sound ID
64
intptr_t *aplWeaponSound2Sound[MAX_WEAPONS];    // Alternate sound sound ID
65
intptr_t *aplWeaponReloadSound1[MAX_WEAPONS];    // Sound of magazine being removed
65
intptr_t *aplWeaponReloadSound1[MAX_WEAPONS];    // Sound of magazine being removed
66
intptr_t *aplWeaponReloadSound2[MAX_WEAPONS];    // Sound of magazine being inserted
66
intptr_t *aplWeaponReloadSound2[MAX_WEAPONS];    // Sound of magazine being inserted
67
67
68
int g_iReturnVarID=-1;      // var ID of "RETURN"
68
int g_iReturnVarID=-1;      // var ID of "RETURN"
69
int g_iWeaponVarID=-1;      // var ID of "WEAPON"
69
int g_iWeaponVarID=-1;      // var ID of "WEAPON"
70
int g_iWorksLikeVarID=-1;   // var ID of "WORKSLIKE"
70
int g_iWorksLikeVarID=-1;   // var ID of "WORKSLIKE"
71
int g_iZRangeVarID=-1;      // var ID of "ZRANGE"
71
int g_iZRangeVarID=-1;      // var ID of "ZRANGE"
72
int g_iAngRangeVarID=-1;    // var ID of "ANGRANGE"
72
int g_iAngRangeVarID=-1;    // var ID of "ANGRANGE"
73
int g_iAimAngleVarID=-1;    // var ID of "AUTOAIMANGLE"
73
int g_iAimAngleVarID=-1;    // var ID of "AUTOAIMANGLE"
74
int g_iLoTagID=-1;          // var ID of "LOTAG"
74
int g_iLoTagID=-1;          // var ID of "LOTAG"
75
int g_iHiTagID=-1;          // var ID of "HITAG"
75
int g_iHiTagID=-1;          // var ID of "HITAG"
76
int g_iTextureID=-1;        // var ID of "TEXTURE"
76
int g_iTextureID=-1;        // var ID of "TEXTURE"
77
int g_iThisActorID=-1;      // var ID of "THISACTOR"
77
int g_iThisActorID=-1;      // var ID of "THISACTOR"
78
78
79
intptr_t *actorLoadEventScrptr[MAXTILES];
79
intptr_t *actorLoadEventScrptr[MAXTILES];
80
80
81
intptr_t *apScriptGameEvent[MAXGAMEEVENTS];
81
intptr_t *apScriptGameEvent[MAXGAMEEVENTS];
82
intptr_t *parsing_event=NULL;
82
intptr_t *parsing_event=NULL;
83
83
84
gamevar_t aGameVars[MAXGAMEVARS];
84
gamevar_t aGameVars[MAXGAMEVARS];
85
gamearray_t aGameArrays[MAXGAMEARRAYS];
85
gamearray_t aGameArrays[MAXGAMEARRAYS];
86
int iGameVarCount=0;
86
int iGameVarCount=0;
87
int iGameArrayCount=0;
87
int iGameArrayCount=0;
88
88
89
extern int qsetmode;
89
extern int qsetmode;
90
90
91
char *textptr;
91
char *textptr;
92
int error,warning;
92
int error,warning;
93
93
94
enum labeltypes
94
enum labeltypes
95
{
95
{
96
    LABEL_ANY    = -1,
96
    LABEL_ANY    = -1,
97
    LABEL_DEFINE = 1,
97
    LABEL_DEFINE = 1,
98
    LABEL_STATE  = 2,
98
    LABEL_STATE  = 2,
99
    LABEL_ACTOR  = 4,
99
    LABEL_ACTOR  = 4,
100
    LABEL_ACTION = 8,
100
    LABEL_ACTION = 8,
101
    LABEL_AI     = 16,
101
    LABEL_AI     = 16,
102
    LABEL_MOVE   = 32,
102
    LABEL_MOVE   = 32,
103
};
103
};
104
104
105
static const char *labeltypenames[] =
105
static const char *labeltypenames[] =
106
{
106
{
107
    "define",
107
    "define",
108
    "state",
108
    "state",
109
    "actor",
109
    "actor",
110
    "action",
110
    "action",
111
    "ai",
111
    "ai",
112
    "move"
112
    "move"
113
};
113
};
114
114
115
static const char *translatelabeltype(int type)
115
static const char *translatelabeltype(int type)
116
{
116
{
117
    int i;
117
    int i;
118
    char x[64];
118
    char x[64];
119
119
120
    x[0] = 0;
120
    x[0] = 0;
121
    for (i=0;i<6;i++)
121
    for (i=0;i<6;i++)
122
    {
122
    {
123
        if (!(type & (1<<i))) continue;
123
        if (!(type & (1<<i))) continue;
124
        if (x[0]) Bstrcat(x, " or ");
124
        if (x[0]) Bstrcat(x, " or ");
125
        Bstrcat(x, labeltypenames[i]);
125
        Bstrcat(x, labeltypenames[i]);
126
    }
126
    }
127
    return strdup(x);
127
    return strdup(x);
128
}
128
}
129
129
130
#define NUMKEYWORDS (signed int)(sizeof(keyw)/sizeof(keyw[0]))
130
#define NUMKEYWORDS (signed int)(sizeof(keyw)/sizeof(keyw[0]))
131
131
132
static const char *keyw[] =
132
static const char *keyw[] =
133
{
133
{
134
    "definelevelname",          // 0  defines level name
134
    "definelevelname",          // 0  defines level name
135
    "actor",                    // 1  defines an actor
135
    "actor",                    // 1  defines an actor
136
    "addammo",                  // 2  adds ammo to a weapon
136
    "addammo",                  // 2  adds ammo to a weapon
137
    "ifrnd",                    // 3  checks against a randomizer
137
    "ifrnd",                    // 3  checks against a randomizer
138
    "enda",                     // 4  ends an actor definition
138
    "enda",                     // 4  ends an actor definition
139
    "ifcansee",                 // 5  checks if the player can see an object
139
    "ifcansee",                 // 5  checks if the player can see an object
140
    "ifhitweapon",              // 6  checks if an object was hit by a weapon
140
    "ifhitweapon",              // 6  checks if an object was hit by a weapon
141
    "action",                   // 7  defines an action if used outside a state or actor, otherwise triggers actor to perform action
141
    "action",                   // 7  defines an action if used outside a state or actor, otherwise triggers actor to perform action
142
    "ifpdistl",                 // 8  checks if player distance is less than value
142
    "ifpdistl",                 // 8  checks if player distance is less than value
143
    "ifpdistg",                 // 9  checks if player distance is more than value
143
    "ifpdistg",                 // 9  checks if player distance is more than value
144
    "else",                     // 10 used with if checks
144
    "else",                     // 10 used with if checks
145
    "strength",                 // 11 sets health
145
    "strength",                 // 11 sets health
146
    "break",                    // 12 stops processing
146
    "break",                    // 12 stops processing
147
    "shoot",                    // 13 shoots a projectile
147
    "shoot",                    // 13 shoots a projectile
148
    "palfrom",                  // 14 used for player screen shading effect, sets p->pals_time and p->pals[0-2]
148
    "palfrom",                  // 14 used for player screen shading effect, sets p->pals_time and p->pals[0-2]
149
    "sound",                    // 15 plays a sound that was defined with definesound
149
    "sound",                    // 15 plays a sound that was defined with definesound
150
    "fall",                     // 16 causes actor to fall to sector floor height
150
    "fall",                     // 16 causes actor to fall to sector floor height
151
    "state",                    // 17 begins defining a state if used outside a state or actor, otherwise calls a state
151
    "state",                    // 17 begins defining a state if used outside a state or actor, otherwise calls a state
152
    "ends",                     // 18 ends defining a state
152
    "ends",                     // 18 ends defining a state
153
    "define",                   // 19 defines a value
153
    "define",                   // 19 defines a value
154
    "<null>",                   // 20 was previously used to define a comment
154
    "<null>",                   // 20 was previously used to define a comment
155
    "ifai",                     // 21 checks if actor is currently performing a specific ai function
155
    "ifai",                     // 21 checks if actor is currently performing a specific ai function
156
    "killit",                   // 22 kills an actor
156
    "killit",                   // 22 kills an actor
157
    "addweapon",                // 23 adds a weapon to the closest player
157
    "addweapon",                // 23 adds a weapon to the closest player
158
    "ai",                       // 24 sets an ai function to be used by an actor
158
    "ai",                       // 24 sets an ai function to be used by an actor
159
    "addphealth",               // 25 adds health to the player
159
    "addphealth",               // 25 adds health to the player
160
    "ifdead",                   // 26 checks if actor is dead
160
    "ifdead",                   // 26 checks if actor is dead
161
    "ifsquished",               // 27 checks if actor has been squished
161
    "ifsquished",               // 27 checks if actor has been squished
162
    "sizeto",                   // 28 gradually increases actor size until it matches parameters given
162
    "sizeto",                   // 28 gradually increases actor size until it matches parameters given
163
    "{",                        // 29 used to indicate segments of code
163
    "{",                        // 29 used to indicate segments of code
164
    "}",                        // 30 used to indicate segments of code
164
    "}",                        // 30 used to indicate segments of code
165
    "spawn",                    // 31 spawns an actor
165
    "spawn",                    // 31 spawns an actor
166
    "move",                     // 32
166
    "move",                     // 32
167
    "ifwasweapon",              // 33
167
    "ifwasweapon",              // 33
168
    "ifaction",                 // 34
168
    "ifaction",                 // 34
169
    "ifactioncount",            // 35
169
    "ifactioncount",            // 35
170
    "resetactioncount",         // 36
170
    "resetactioncount",         // 36
171
    "debris",                   // 37
171
    "debris",                   // 37
172
    "pstomp",                   // 38
172
    "pstomp",                   // 38
173
    "<null>",                   // 39 was previously used to define the start of a comment block
173
    "<null>",                   // 39 was previously used to define the start of a comment block
174
    "cstat",                    // 40
174
    "cstat",                    // 40
175
    "ifmove",                   // 41
175
    "ifmove",                   // 41
176
    "resetplayer",              // 42
176
    "resetplayer",              // 42
177
    "ifonwater",                // 43
177
    "ifonwater",                // 43
178
    "ifinwater",                // 44
178
    "ifinwater",                // 44
179
    "ifcanshoottarget",         // 45
179
    "ifcanshoottarget",         // 45
180
    "ifcount",                  // 46
180
    "ifcount",                  // 46
181
    "resetcount",               // 47
181
    "resetcount",               // 47
182
    "addinventory",             // 48
182
    "addinventory",             // 48
183
    "ifactornotstayput",        // 49
183
    "ifactornotstayput",        // 49
184
    "hitradius",                // 50
184
    "hitradius",                // 50
185
    "ifp",                      // 51
185
    "ifp",                      // 51
186
    "count",                    // 52
186
    "count",                    // 52
187
    "ifactor",                  // 53
187
    "ifactor",                  // 53
188
    "music",                    // 54
188
    "music",                    // 54
189
    "include",                  // 55
189
    "include",                  // 55
190
    "ifstrength",               // 56
190
    "ifstrength",               // 56
191
    "definesound",              // 57
191
    "definesound",              // 57
192
    "guts",                     // 58
192
    "guts",                     // 58
193
    "ifspawnedby",              // 59
193
    "ifspawnedby",              // 59
194
    "gamestartup",              // 60
194
    "gamestartup",              // 60
195
    "wackplayer",               // 61
195
    "wackplayer",               // 61
196
    "ifgapzl",                  // 62
196
    "ifgapzl",                  // 62
197
    "ifhitspace",               // 63
197
    "ifhitspace",               // 63
198
    "ifoutside",                // 64
198
    "ifoutside",                // 64
199
    "ifmultiplayer",            // 65
199
    "ifmultiplayer",            // 65
200
    "operate",                  // 66
200
    "operate",                  // 66
201
    "ifinspace",                // 67
201
    "ifinspace",                // 67
202
    "debug",                    // 68
202
    "debug",                    // 68
203
    "endofgame",                // 69
203
    "endofgame",                // 69
204
    "ifbulletnear",             // 70
204
    "ifbulletnear",             // 70
205
    "ifrespawn",                // 71
205
    "ifrespawn",                // 71
206
    "iffloordistl",             // 72
206
    "iffloordistl",             // 72
207
    "ifceilingdistl",           // 73
207
    "ifceilingdistl",           // 73
208
    "spritepal",                // 74
208
    "spritepal",                // 74
209
    "ifpinventory",             // 75
209
    "ifpinventory",             // 75
210
    "betaname",                 // 76
210
    "betaname",                 // 76
211
    "cactor",                   // 77
211
    "cactor",                   // 77
212
    "ifphealthl",               // 78
212
    "ifphealthl",               // 78
213
    "definequote",              // 79
213
    "definequote",              // 79
214
    "quote",                    // 80
214
    "quote",                    // 80
215
    "ifinouterspace",           // 81
215
    "ifinouterspace",           // 81
216
    "ifnotmoving",              // 82
216
    "ifnotmoving",              // 82
217
    "respawnhitag",             // 83
217
    "respawnhitag",             // 83
218
    "tip",                      // 84
218
    "tip",                      // 84
219
    "ifspritepal",              // 85
219
    "ifspritepal",              // 85
220
    "money",                    // 86
220
    "money",                    // 86
221
    "soundonce",                // 87
221
    "soundonce",                // 87
222
    "addkills",                 // 88
222
    "addkills",                 // 88
223
    "stopsound",                // 89
223
    "stopsound",                // 89
224
    "ifawayfromwall",           // 90
224
    "ifawayfromwall",           // 90
225
    "ifcanseetarget",           // 91
225
    "ifcanseetarget",           // 91
226
    "globalsound",              // 92
226
    "globalsound",              // 92
227
    "lotsofglass",              // 93
227
    "lotsofglass",              // 93
228
    "ifgotweaponce",            // 94
228
    "ifgotweaponce",            // 94
229
    "getlastpal",               // 95
229
    "getlastpal",               // 95
230
    "pkick",                    // 96
230
    "pkick",                    // 96
231
    "mikesnd",                  // 97
231
    "mikesnd",                  // 97
232
    "useractor",                // 98
232
    "useractor",                // 98
233
    "sizeat",                   // 99
233
    "sizeat",                   // 99
234
    "addstrength",              // 100  [#]
234
    "addstrength",              // 100  [#]
235
    "cstator",                  // 101
235
    "cstator",                  // 101
236
    "mail",                     // 102
236
    "mail",                     // 102
237
    "paper",                    // 103
237
    "paper",                    // 103
238
    "tossweapon",               // 104
238
    "tossweapon",               // 104
239
    "sleeptime",                // 105
239
    "sleeptime",                // 105
240
    "nullop",                   // 106
240
    "nullop",                   // 106
241
    "definevolumename",         // 107
241
    "definevolumename",         // 107
242
    "defineskillname",          // 108
242
    "defineskillname",          // 108
243
    "ifnosounds",               // 109
243
    "ifnosounds",               // 109
244
    "clipdist",                 // 110
244
    "clipdist",                 // 110
245
    "ifangdiffl",               // 111
245
    "ifangdiffl",               // 111
246
    "gamevar",                  // 112
246
    "gamevar",                  // 112
247
    "ifvarl",                   // 113
247
    "ifvarl",                   // 113
248
    "ifvarg",                   // 114
248
    "ifvarg",                   // 114
249
    "setvarvar",                // 115
249
    "setvarvar",                // 115
250
    "setvar",                   // 116
250
    "setvar",                   // 116
251
    "addvarvar",                // 117
251
    "addvarvar",                // 117
252
    "addvar",                   // 118
252
    "addvar",                   // 118
253
    "ifvarvarl",                // 119
253
    "ifvarvarl",                // 119
254
    "ifvarvarg",                // 120
254
    "ifvarvarg",                // 120
255
    "addlogvar",                // 121
255
    "addlogvar",                // 121
256
    "addlog",                   // 122
256
    "addlog",                   // 122
257
    "onevent",                  // 123
257
    "onevent",                  // 123
258
    "endevent",                 // 124
258
    "endevent",                 // 124
259
    "ifvare",                   // 125
259
    "ifvare",                   // 125
260
    "ifvarvare",                // 126
260
    "ifvarvare",                // 126
261
    "spgetlotag",               // 127
261
    "spgetlotag",               // 127
262
    "spgethitag",               // 128
262
    "spgethitag",               // 128
263
    "sectgetlotag",             // 129
263
    "sectgetlotag",             // 129
264
    "sectgethitag",             // 130
264
    "sectgethitag",             // 130
265
    "ifsound",                  // 131
265
    "ifsound",                  // 131
266
    "gettexturefloor",          // 132
266
    "gettexturefloor",          // 132
267
    "gettextureceiling",        // 133
267
    "gettextureceiling",        // 133
268
    "inittimer",                // 134
268
    "inittimer",                // 134
269
    "starttrack",               // 135
269
    "starttrack",               // 135
270
    "randvar",                  // 136
270
    "randvar",                  // 136
271
    "enhanced",                 // 137
271
    "enhanced",                 // 137
272
    "getangletotarget",         // 138
272
    "getangletotarget",         // 138
273
    "getactorangle",            // 139
273
    "getactorangle",            // 139
274
    "setactorangle",            // 140
274
    "setactorangle",            // 140
275
    "mulvar",                   // 141
275
    "mulvar",                   // 141
276
    "mulvarvar",                // 142
276
    "mulvarvar",                // 142
277
    "divvar",                   // 143
277
    "divvar",                   // 143
278
    "divvarvar",                // 144
278
    "divvarvar",                // 144
279
    "modvar",                   // 145
279
    "modvar",                   // 145
280
    "modvarvar",                // 146
280
    "modvarvar",                // 146
281
    "andvar",                   // 147
281
    "andvar",                   // 147
282
    "andvarvar",                // 148
282
    "andvarvar",                // 148
283
    "orvar",                    // 149
283
    "orvar",                    // 149
284
    "orvarvar",                 // 150
284
    "orvarvar",                 // 150
285
    "getplayerangle",           // 151
285
    "getplayerangle",           // 151
286
    "setplayerangle",           // 152
286
    "setplayerangle",           // 152
287
    "lockplayer",               // 153
287
    "lockplayer",               // 153
288
    "setsector",                // 154
288
    "setsector",                // 154
289
    "getsector",                // 155
289
    "getsector",                // 155
290
    "setactor",                 // 156
290
    "setactor",                 // 156
291
    "getactor",                 // 157
291
    "getactor",                 // 157
292
    "setwall",                  // 158
292
    "setwall",                  // 158
293
    "getwall",                  // 159
293
    "getwall",                  // 159
294
    "findnearactor",            // 160
294
    "findnearactor",            // 160
295
    "findnearactorvar",         // 161
295
    "findnearactorvar",         // 161
296
    "setactorvar",              // 162
296
    "setactorvar",              // 162
297
    "getactorvar",              // 163
297
    "getactorvar",              // 163
298
    "espawn",                   // 164
298
    "espawn",                   // 164
299
    "getplayer",                // 165
299
    "getplayer",                // 165
300
    "setplayer",                // 166
300
    "setplayer",                // 166
301
    "sqrt",                     // 167
301
    "sqrt",                     // 167
302
    "eventloadactor",           // 168
302
    "eventloadactor",           // 168
303
    "espawnvar",                // 169
303
    "espawnvar",                // 169
304
    "getuserdef",               // 170
304
    "getuserdef",               // 170
305
    "setuserdef",               // 171
305
    "setuserdef",               // 171
306
    "subvarvar",                // 172
306
    "subvarvar",                // 172
307
    "subvar",                   // 173
307
    "subvar",                   // 173
308
    "ifvarn",                   // 174
308
    "ifvarn",                   // 174
309
    "ifvarvarn",                // 175
309
    "ifvarvarn",                // 175
310
    "ifvarand",                 // 176
310
    "ifvarand",                 // 176
311
    "ifvarvarand",              // 177
311
    "ifvarvarand",              // 177
312
    "myos",                     // 178
312
    "myos",                     // 178
313
    "myospal",                  // 179
313
    "myospal",                  // 179
314
    "displayrand",              // 180
314
    "displayrand",              // 180
315
    "sin",                      // 181
315
    "sin",                      // 181
316
    "xorvarvar",                // 182
316
    "xorvarvar",                // 182
317
    "xorvar",                   // 183
317
    "xorvar",                   // 183
318
    "randvarvar",               // 184
318
    "randvarvar",               // 184
319
    "myosx",                    // 185
319
    "myosx",                    // 185
320
    "myospalx",                 // 186
320
    "myospalx",                 // 186
321
    "gmaxammo",                 // 187
321
    "gmaxammo",                 // 187
322
    "smaxammo",                 // 188
322
    "smaxammo",                 // 188
323
    "startlevel",               // 189
323
    "startlevel",               // 189
324
    "eshoot",                   // 190
324
    "eshoot",                   // 190
325
    "qspawn",                   // 191
325
    "qspawn",                   // 191
326
    "rotatesprite",             // 192
326
    "rotatesprite",             // 192
327
    "defineprojectile",         // 193
327
    "defineprojectile",         // 193
328
    "spriteshadow",             // 194
328
    "spriteshadow",             // 194
329
    "cos",                      // 195
329
    "cos",                      // 195
330
    "eshootvar",                // 196
330
    "eshootvar",                // 196
331
    "findnearactor3d",          // 197
331
    "findnearactor3d",          // 197
332
    "findnearactor3dvar",       // 198
332
    "findnearactor3dvar",       // 198
333
    "flash",                    // 199
333
    "flash",                    // 199
334
    "qspawnvar",                // 200
334
    "qspawnvar",                // 200
335
    "eqspawn",                  // 201
335
    "eqspawn",                  // 201
336
    "eqspawnvar",               // 202
336
    "eqspawnvar",               // 202
337
    "minitext",                 // 203
337
    "minitext",                 // 203
338
    "gametext",                 // 204
338
    "gametext",                 // 204
339
    "digitalnumber",            // 205
339
    "digitalnumber",            // 205
340
    "addweaponvar",             // 206
340
    "addweaponvar",             // 206
341
    "setprojectile",            // 207
341
    "setprojectile",            // 207
342
    "angoff",                   // 208
342
    "angoff",                   // 208
343
    "updatesector",             // 209
343
    "updatesector",             // 209
344
    "insertspriteq",            // 210
344
    "insertspriteq",            // 210
345
    "angoffvar",                // 211
345
    "angoffvar",                // 211
346
    "whilevarn",                // 212
346
    "whilevarn",                // 212
347
    "switch",                   // 213
347
    "switch",                   // 213
348
    "case",                     // 214
348
    "case",                     // 214
349
    "default",                  // 215
349
    "default",                  // 215
350
    "endswitch",                // 216
350
    "endswitch",                // 216
351
    "shootvar",                 // 217
351
    "shootvar",                 // 217
352
    "soundvar",                 // 218
352
    "soundvar",                 // 218
353
    "findplayer",               // 219
353
    "findplayer",               // 219
354
    "findotherplayer",          // 220
354
    "findotherplayer",          // 220
355
    "activatebysector",         // 221 sectnum, spriteid
355
    "activatebysector",         // 221 sectnum, spriteid
356
    "operatesectors",           // 222 sectnum, spriteid
356
    "operatesectors",           // 222 sectnum, spriteid
357
    "operaterespawns",          // 223 lotag
357
    "operaterespawns",          // 223 lotag
358
    "operateactivators",        // 224 lotag, player index
358
    "operateactivators",        // 224 lotag, player index
359
    "operatemasterswitches",    // 225 lotag
359
    "operatemasterswitches",    // 225 lotag
360
    "checkactivatormotion",     // 226 lotag
360
    "checkactivatormotion",     // 226 lotag
361
    "zshoot",                   // 227 zvar projnum
361
    "zshoot",                   // 227 zvar projnum
362
    "dist",                     // 228 sprite1 sprite2
362
    "dist",                     // 228 sprite1 sprite2
363
    "ldist",                    // 229 sprite1 sprite2
363
    "ldist",                    // 229 sprite1 sprite2
364
    "shiftvarl",                // 230
364
    "shiftvarl",                // 230
365
    "shiftvarr",                // 231
365
    "shiftvarr",                // 231
366
    "spritenvg",                // 232
366
    "spritenvg",                // 232
367
    "getangle",                 // 233
367
    "getangle",                 // 233
368
    "whilevarvarn",             // 234
368
    "whilevarvarn",             // 234
369
    "hitscan",                  // 235
369
    "hitscan",                  // 235
370
    "time",                     // 236
370
    "time",                     // 236
371
    "getplayervar",             // 237
371
    "getplayervar",             // 237
372
    "setplayervar",             // 238
372
    "setplayervar",             // 238
373
    "mulscale",                 // 239
373
    "mulscale",                 // 239
374
    "setaspect",                // 240
374
    "setaspect",                // 240
375
    "ezshoot",                  // 241
375
    "ezshoot",                  // 241
376
    "spritenoshade",            // 242
376
    "spritenoshade",            // 242
377
    "movesprite",               // 243
377
    "movesprite",               // 243
378
    "checkavailweapon",         // 244
378
    "checkavailweapon",         // 244
379
    "soundoncevar",             // 245
379
    "soundoncevar",             // 245
380
    "updatesectorz",            // 246
380
    "updatesectorz",            // 246
381
    "stopallsounds",            // 247
381
    "stopallsounds",            // 247
382
    "ssp",                      // 248
382
    "ssp",                      // 248
383
    "stopsoundvar",             // 249
383
    "stopsoundvar",             // 249
384
    "displayrandvar",           // 250
384
    "displayrandvar",           // 250
385
    "displayrandvarvar",        // 251
385
    "displayrandvarvar",        // 251
386
    "checkavailinven",          // 252
386
    "checkavailinven",          // 252
387
    "globalsoundvar",           // 253
387
    "globalsoundvar",           // 253
388
    "guniqhudid",               // 254
388
    "guniqhudid",               // 254
389
    "getprojectile",            // 255
389
    "getprojectile",            // 255
390
    "getthisprojectile",        // 256
390
    "getthisprojectile",        // 256
391
    "setthisprojectile",        // 257
391
    "setthisprojectile",        // 257
392
    "definecheat",              // 258
392
    "definecheat",              // 258
393
    "cheatkeys",                // 259
393
    "cheatkeys",                // 259
394
    "userquote",                // 260
394
    "userquote",                // 260
395
    "precache",                 // 261
395
    "precache",                 // 261
396
    "definegamefuncname",       // 262
396
    "definegamefuncname",       // 262
397
    "redefinequote",            // 263
397
    "redefinequote",            // 263
398
    "qsprintf",                 // 264
398
    "qsprintf",                 // 264
399
    "getpname",                 // 265
399
    "getpname",                 // 265
400
    "qstrcat",                  // 266
400
    "qstrcat",                  // 266
401
    "qstrcpy",                  // 267
401
    "qstrcpy",                  // 267
402
    "setsprite",                // 268
402
    "setsprite",                // 268
403
    "rotatepoint",              // 269
403
    "rotatepoint",              // 269
404
    "dragpoint",                // 270
404
    "dragpoint",                // 270
405
    "getzrange",                // 271
405
    "getzrange",                // 271
406
    "changespritestat",         // 272
406
    "changespritestat",         // 272
407
    "getceilzofslope",          // 273
407
    "getceilzofslope",          // 273
408
    "getflorzofslope",          // 274
408
    "getflorzofslope",          // 274
409
    "neartag",                  // 275
409
    "neartag",                  // 275
410
    "definegametype",           // 276
410
    "definegametype",           // 276
411
    "changespritesect",         // 277
411
    "changespritesect",         // 277
412
    "spriteflags",              // 278
412
    "spriteflags",              // 278
413
    "savegamevar",              // 279
413
    "savegamevar",              // 279
414
    "readgamevar",              // 280
414
    "readgamevar",              // 280
415
    "findnearsprite",           // 281
415
    "findnearsprite",           // 281
416
    "findnearspritevar",        // 282
416
    "findnearspritevar",        // 282
417
    "findnearsprite3d",         // 283
417
    "findnearsprite3d",         // 283
418
    "findnearsprite3dvar",      // 284
418
    "findnearsprite3dvar",      // 284
419
    "dynamicremap",             // 285
419
    "dynamicremap",             // 285
420
    "setinput",                 // 286
420
    "setinput",                 // 286
421
    "getinput",                 // 287
421
    "getinput",                 // 287
422
    "save",                                         // 288
422
    "save",                                         // 288
423
    "cansee",                   // 289
423
    "cansee",                   // 289
424
    "canseespr",                // 290
424
    "canseespr",                // 290
425
    "findnearactorz",           // 291
425
    "findnearactorz",           // 291
426
    "findnearactorzvar",        // 292
426
    "findnearactorzvar",        // 292
427
    "findnearspritez",          // 293
427
    "findnearspritez",          // 293
428
    "findnearspritezvar",       // 294
428
    "findnearspritezvar",       // 294
429
    "zshootvar",                                // 295
429
    "zshootvar",                                // 295
430
    "ezshootvar",                           // 296
430
    "ezshootvar",                           // 296
431
    "getcurraddress",               // 297
431
    "getcurraddress",               // 297
432
    "jump",                                         // 298
432
    "jump",                                         // 298
433
    "qstrlen",                              // 299
433
    "qstrlen",                              // 299
434
    "getincangle",              // 300
434
    "getincangle",              // 300
435
    "quake",                    // 301
435
    "quake",                    // 301
436
    "showview",                 // 302
436
    "showview",                 // 302
437
    "headspritestat",           // 303
437
    "headspritestat",           // 303
438
    "prevspritestat",           // 304
438
    "prevspritestat",           // 304
439
    "nextspritestat",           // 305
439
    "nextspritestat",           // 305
440
    "headspritesect",           // 306
440
    "headspritesect",           // 306
441
    "prevspritesect",           // 307
441
    "prevspritesect",           // 307
442
    "nextspritesect",           // 308
442
    "nextspritesect",           // 308
443
    "getkeyname",               // 309
443
    "getkeyname",               // 309
444
    "qsubstr",                  // 310
444
    "qsubstr",                  // 310
445
    "gametextz",                // 311
445
    "gametextz",                // 311
446
    "digitalnumberz",           // 312
446
    "digitalnumberz",           // 312
447
    "spritenopal",              // 313
447
    "spritenopal",              // 313
448
    "hitradiusvar",             // 314
448
    "hitradiusvar",             // 314
449
    "rotatesprite16",           // 315
449
    "rotatesprite16",           // 315
450
    "gamearray",                // 316
450
    "gamearray",                // 316
451
    "setarray",                 // 317
451
    "setarray",                 // 317
452
    "resizearray",              // 318
452
    "resizearray",              // 318
453
    "writearraytofile",         // 319
453
    "writearraytofile",         // 319
454
    "readarrayfromfile",        // 320
454
    "readarrayfromfile",        // 320
455
    "starttrackvar",                    // 321
455
    "starttrackvar",                    // 321
456
    "qgetsysstr",                       // 322
456
    "qgetsysstr",                       // 322
457
    "getticks",                                 // 323
457
    "getticks",                                 // 323
458
    "gettspr",                  // 324
458
    "gettspr",                  // 324
459
    "settspr",                  // 325
459
    "settspr",                  // 325
460
    "savemapstate",             // 326
460
    "savemapstate",             // 326
461
    "loadmapstate",             // 327
461
    "loadmapstate",             // 327
462
    "clearmapstate",            // 328
462
    "clearmapstate",            // 328
463
    "scriptsize",               // 329
463
    "scriptsize",               // 329
464
    "<null>"
464
    "<null>"
465
};
465
};
466
466
467
const memberlabel_t sectorlabels[]=
467
const memberlabel_t sectorlabels[]=
468
{
468
{
469
    { "wallptr", SECTOR_WALLPTR, 0, 0 },
469
    { "wallptr", SECTOR_WALLPTR, 0, 0 },
470
    { "wallnum", SECTOR_WALLNUM, 0, 0 },
470
    { "wallnum", SECTOR_WALLNUM, 0, 0 },
471
    { "ceilingz", SECTOR_CEILINGZ, 0, 0 },
471
    { "ceilingz", SECTOR_CEILINGZ, 0, 0 },
472
    { "floorz", SECTOR_FLOORZ, 0, 0 },
472
    { "floorz", SECTOR_FLOORZ, 0, 0 },
473
    { "ceilingstat", SECTOR_CEILINGSTAT, 0, 0 },
473
    { "ceilingstat", SECTOR_CEILINGSTAT, 0, 0 },
474
    { "floorstat", SECTOR_FLOORSTAT, 0, 0 },
474
    { "floorstat", SECTOR_FLOORSTAT, 0, 0 },
475
    { "ceilingpicnum", SECTOR_CEILINGPICNUM, 0, 0 },
475
    { "ceilingpicnum", SECTOR_CEILINGPICNUM, 0, 0 },
476
    { "ceilingslope", SECTOR_CEILINGSLOPE, 0, 0 },
476
    { "ceilingslope", SECTOR_CEILINGSLOPE, 0, 0 },
477
    { "ceilingshade", SECTOR_CEILINGSHADE, 0, 0 },
477
    { "ceilingshade", SECTOR_CEILINGSHADE, 0, 0 },
478
    { "ceilingpal", SECTOR_CEILINGPAL, 0, 0 },
478
    { "ceilingpal", SECTOR_CEILINGPAL, 0, 0 },
479
    { "ceilingxpanning", SECTOR_CEILINGXPANNING, 0, 0 },
479
    { "ceilingxpanning", SECTOR_CEILINGXPANNING, 0, 0 },
480
    { "ceilingypanning", SECTOR_CEILINGYPANNING, 0, 0 },
480
    { "ceilingypanning", SECTOR_CEILINGYPANNING, 0, 0 },
481
    { "floorpicnum", SECTOR_FLOORPICNUM, 0, 0 },
481
    { "floorpicnum", SECTOR_FLOORPICNUM, 0, 0 },
482
    { "floorslope", SECTOR_FLOORSLOPE, 0, 0 },
482
    { "floorslope", SECTOR_FLOORSLOPE, 0, 0 },
483
    { "floorshade", SECTOR_FLOORSHADE, 0, 0 },
483
    { "floorshade", SECTOR_FLOORSHADE, 0, 0 },
484
    { "floorpal", SECTOR_FLOORPAL, 0, 0 },
484
    { "floorpal", SECTOR_FLOORPAL, 0, 0 },
485
    { "floorxpanning", SECTOR_FLOORXPANNING, 0, 0 },
485
    { "floorxpanning", SECTOR_FLOORXPANNING, 0, 0 },
486
    { "floorypanning", SECTOR_FLOORYPANNING, 0, 0 },
486
    { "floorypanning", SECTOR_FLOORYPANNING, 0, 0 },
487
    { "visibility", SECTOR_VISIBILITY, 0, 0 },
487
    { "visibility", SECTOR_VISIBILITY, 0, 0 },
488
    { "alignto", SECTOR_ALIGNTO, 0, 0 },
488
    { "alignto", SECTOR_ALIGNTO, 0, 0 },
489
    { "lotag", SECTOR_LOTAG, 0, 0 },
489
    { "lotag", SECTOR_LOTAG, 0, 0 },
490
    { "hitag", SECTOR_HITAG, 0, 0 },
490
    { "hitag", SECTOR_HITAG, 0, 0 },
491
    { "extra", SECTOR_EXTRA, 0, 0 },
491
    { "extra", SECTOR_EXTRA, 0, 0 },
492
    { "", -1, 0, 0  }     // END OF LIST
492
    { "", -1, 0, 0  }     // END OF LIST
493
};
493
};
494
494
495
const memberlabel_t walllabels[]=
495
const memberlabel_t walllabels[]=
496
{
496
{
497
    { "x", WALL_X, 0, 0 },
497
    { "x", WALL_X, 0, 0 },
498
    { "y", WALL_Y, 0, 0 },
498
    { "y", WALL_Y, 0, 0 },
499
    { "point2", WALL_POINT2, 0, 0 },
499
    { "point2", WALL_POINT2, 0, 0 },
500
    { "nextwall", WALL_NEXTWALL, 0, 0 },
500
    { "nextwall", WALL_NEXTWALL, 0, 0 },
501
    { "nextsector", WALL_NEXTSECTOR, 0, 0 },
501
    { "nextsector", WALL_NEXTSECTOR, 0, 0 },
502
    { "cstat", WALL_CSTAT, 0, 0 },
502
    { "cstat", WALL_CSTAT, 0, 0 },
503
    { "picnum", WALL_PICNUM, 0, 0 },
503
    { "picnum", WALL_PICNUM, 0, 0 },
504
    { "overpicnum", WALL_OVERPICNUM, 0, 0 },
504
    { "overpicnum", WALL_OVERPICNUM, 0, 0 },
505
    { "shade", WALL_SHADE, 0, 0 },
505
    { "shade", WALL_SHADE, 0, 0 },
506
    { "pal", WALL_PAL, 0, 0 },
506
    { "pal", WALL_PAL, 0, 0 },
507
    { "xrepeat", WALL_XREPEAT, 0, 0 },
507
    { "xrepeat", WALL_XREPEAT, 0, 0 },
508
    { "yrepeat", WALL_YREPEAT, 0, 0 },
508
    { "yrepeat", WALL_YREPEAT, 0, 0 },
509
    { "xpanning", WALL_XPANNING, 0, 0 },
509
    { "xpanning", WALL_XPANNING, 0, 0 },
510
    { "ypanning", WALL_YPANNING, 0, 0 },
510
    { "ypanning", WALL_YPANNING, 0, 0 },
511
    { "lotag", WALL_LOTAG, 0, 0 },
511
    { "lotag", WALL_LOTAG, 0, 0 },
512
    { "hitag", WALL_HITAG, 0, 0 },
512
    { "hitag", WALL_HITAG, 0, 0 },
513
    { "extra", WALL_EXTRA, 0, 0 },
513
    { "extra", WALL_EXTRA, 0, 0 },
514
    { "", -1, 0, 0  }     // END OF LIST
514
    { "", -1, 0, 0  }     // END OF LIST
515
};
515
};
516
516
517
const memberlabel_t actorlabels[]=
517
const memberlabel_t actorlabels[]=
518
{
518
{
519
    { "x", ACTOR_X, 0, 0 },
519
    { "x", ACTOR_X, 0, 0 },
520
    { "y", ACTOR_Y, 0, 0 },
520
    { "y", ACTOR_Y, 0, 0 },
521
    { "z", ACTOR_Z, 0, 0 },
521
    { "z", ACTOR_Z, 0, 0 },
522
    { "cstat", ACTOR_CSTAT, 0, 0 },
522
    { "cstat", ACTOR_CSTAT, 0, 0 },
523
    { "picnum", ACTOR_PICNUM, 0, 0 },
523
    { "picnum", ACTOR_PICNUM, 0, 0 },
524
    { "shade", ACTOR_SHADE, 0, 0 },
524
    { "shade", ACTOR_SHADE, 0, 0 },
525
    { "pal", ACTOR_PAL, 0, 0 },
525
    { "pal", ACTOR_PAL, 0, 0 },
526
    { "clipdist", ACTOR_CLIPDIST, 0, 0 },
526
    { "clipdist", ACTOR_CLIPDIST, 0, 0 },
527
    { "detail", ACTOR_DETAIL, 0, 0 },
527
    { "detail", ACTOR_DETAIL, 0, 0 },
528
    { "xrepeat", ACTOR_XREPEAT, 0, 0 },
528
    { "xrepeat", ACTOR_XREPEAT, 0, 0 },
529
    { "yrepeat", ACTOR_YREPEAT, 0, 0 },
529
    { "yrepeat", ACTOR_YREPEAT, 0, 0 },
530
    { "xoffset", ACTOR_XOFFSET, 0, 0 },
530
    { "xoffset", ACTOR_XOFFSET, 0, 0 },
531
    { "yoffset", ACTOR_YOFFSET, 0, 0 },
531
    { "yoffset", ACTOR_YOFFSET, 0, 0 },
532
    { "sectnum", ACTOR_SECTNUM, 0, 0 },
532
    { "sectnum", ACTOR_SECTNUM, 0, 0 },
533
    { "statnum", ACTOR_STATNUM, 0, 0 },
533
    { "statnum", ACTOR_STATNUM, 0, 0 },
534
    { "ang", ACTOR_ANG, 0, 0 },
534
    { "ang", ACTOR_ANG, 0, 0 },
535
    { "owner", ACTOR_OWNER, 0, 0 },
535
    { "owner", ACTOR_OWNER, 0, 0 },
536
    { "xvel", ACTOR_XVEL, 0, 0 },
536
    { "xvel", ACTOR_XVEL, 0, 0 },
537
    { "yvel", ACTOR_YVEL, 0, 0 },
537
    { "yvel", ACTOR_YVEL, 0, 0 },
538
    { "zvel", ACTOR_ZVEL, 0, 0 },
538
    { "zvel", ACTOR_ZVEL, 0, 0 },
539
    { "lotag", ACTOR_LOTAG, 0, 0 },
539
    { "lotag", ACTOR_LOTAG, 0, 0 },
540
    { "hitag", ACTOR_HITAG, 0, 0 },
540
    { "hitag", ACTOR_HITAG, 0, 0 },
541
    { "extra", ACTOR_EXTRA, 0, 0 },
541
    { "extra", ACTOR_EXTRA, 0, 0 },
542
542
543
    // hittype labels...
543
    // hittype labels...
544
    { "htcgg", ACTOR_HTCGG, 0, 0 },
544
    { "htcgg", ACTOR_HTCGG, 0, 0 },
545
    { "htpicnum", ACTOR_HTPICNUM, 0, 0 },
545
    { "htpicnum", ACTOR_HTPICNUM, 0, 0 },
546
    { "htang", ACTOR_HTANG, 0, 0 },
546
    { "htang", ACTOR_HTANG, 0, 0 },
547
    { "htextra", ACTOR_HTEXTRA, 0, 0 },
547
    { "htextra", ACTOR_HTEXTRA, 0, 0 },
548
    { "htowner", ACTOR_HTOWNER, 0, 0 },
548
    { "htowner", ACTOR_HTOWNER, 0, 0 },
549
    { "htmovflag", ACTOR_HTMOVFLAG, 0, 0 },
549
    { "htmovflag", ACTOR_HTMOVFLAG, 0, 0 },
550
    { "httempang", ACTOR_HTTEMPANG, 0, 0 },
550
    { "httempang", ACTOR_HTTEMPANG, 0, 0 },
551
    { "htactorstayput", ACTOR_HTACTORSTAYPUT, 0, 0 },
551
    { "htactorstayput", ACTOR_HTACTORSTAYPUT, 0, 0 },
552
    { "htdispicnum", ACTOR_HTDISPICNUM, 0, 0 },
552
    { "htdispicnum", ACTOR_HTDISPICNUM, 0, 0 },
553
    { "httimetosleep", ACTOR_HTTIMETOSLEEP, 0, 0 },
553
    { "httimetosleep", ACTOR_HTTIMETOSLEEP, 0, 0 },
554
    { "htfloorz", ACTOR_HTFLOORZ, 0, 0 },
554
    { "htfloorz", ACTOR_HTFLOORZ, 0, 0 },
555
    { "htceilingz", ACTOR_HTCEILINGZ, 0, 0 },
555
    { "htceilingz", ACTOR_HTCEILINGZ, 0, 0 },
556
    { "htlastvx", ACTOR_HTLASTVX, 0, 0 },
556
    { "htlastvx", ACTOR_HTLASTVX, 0, 0 },
557
    { "htlastvy", ACTOR_HTLASTVY, 0, 0 },
557
    { "htlastvy", ACTOR_HTLASTVY, 0, 0 },
558
    { "htbposx", ACTOR_HTBPOSX, 0, 0 },
558
    { "htbposx", ACTOR_HTBPOSX, 0, 0 },
559
    { "htbposy", ACTOR_HTBPOSY, 0, 0 },
559
    { "htbposy", ACTOR_HTBPOSY, 0, 0 },
560
    { "htbposz", ACTOR_HTBPOSZ, 0, 0 },
560
    { "htbposz", ACTOR_HTBPOSZ, 0, 0 },
561
    { "htg_t", ACTOR_HTG_T, LABEL_HASPARM2, 10 },
561
    { "htg_t", ACTOR_HTG_T, LABEL_HASPARM2, 10 },
562
562
563
    // model flags
563
    // model flags
564
564
565
    { "angoff", ACTOR_ANGOFF, 0, 0 },
565
    { "angoff", ACTOR_ANGOFF, 0, 0 },
566
    { "pitch", ACTOR_PITCH, 0, 0 },
566
    { "pitch", ACTOR_PITCH, 0, 0 },
567
    { "roll", ACTOR_ROLL, 0, 0 },
567
    { "roll", ACTOR_ROLL, 0, 0 },
568
    { "mdxoff", ACTOR_MDXOFF, 0, 0 },
568
    { "mdxoff", ACTOR_MDXOFF, 0, 0 },
569
    { "mdyoff", ACTOR_MDYOFF, 0, 0 },
569
    { "mdyoff", ACTOR_MDYOFF, 0, 0 },
570
    { "mdzoff", ACTOR_MDZOFF, 0, 0 },
570
    { "mdzoff", ACTOR_MDZOFF, 0, 0 },
571
    { "mdflags", ACTOR_MDFLAGS, 0, 0 },
571
    { "mdflags", ACTOR_MDFLAGS, 0, 0 },
572
    { "xpanning", ACTOR_XPANNING, 0, 0 },
572
    { "xpanning", ACTOR_XPANNING, 0, 0 },
573
    { "ypanning", ACTOR_YPANNING, 0, 0 },
573
    { "ypanning", ACTOR_YPANNING, 0, 0 },
574
574
575
    { "", -1, 0, 0  }     // END OF LIST
575
    { "", -1, 0, 0  }     // END OF LIST
576
};
576
};
577
577
578
const memberlabel_t tsprlabels[]=
578
const memberlabel_t tsprlabels[]=
579
{
579
{
580
    // tsprite access
580
    // tsprite access
581
581
582
    { "tsprx", ACTOR_TSPRX, 0, 0 },
582
    { "tsprx", ACTOR_TSPRX, 0, 0 },
583
    { "tspry", ACTOR_TSPRY, 0, 0 },
583
    { "tspry", ACTOR_TSPRY, 0, 0 },
584
    { "tsprz", ACTOR_TSPRZ, 0, 0 },
584
    { "tsprz", ACTOR_TSPRZ, 0, 0 },
585
    { "tsprcstat", ACTOR_TSPRCSTAT, 0, 0 },
585
    { "tsprcstat", ACTOR_TSPRCSTAT, 0, 0 },
586
    { "tsprpicnum", ACTOR_TSPRPICNUM, 0, 0 },
586
    { "tsprpicnum", ACTOR_TSPRPICNUM, 0, 0 },
587
    { "tsprshade", ACTOR_TSPRSHADE, 0, 0 },
587
    { "tsprshade", ACTOR_TSPRSHADE, 0, 0 },
588
    { "tsprpal", ACTOR_TSPRPAL, 0, 0 },
588
    { "tsprpal", ACTOR_TSPRPAL, 0, 0 },
589
    { "tsprxrepeat", ACTOR_TSPRXREPEAT, 0, 0 },
589
    { "tsprxrepeat", ACTOR_TSPRXREPEAT, 0, 0 },
590
    { "tspryrepeat", ACTOR_TSPRYREPEAT, 0, 0 },
590
    { "tspryrepeat", ACTOR_TSPRYREPEAT, 0, 0 },
591
    { "tsprxoffset", ACTOR_TSPRXOFFSET, 0, 0 },
591
    { "tsprxoffset", ACTOR_TSPRXOFFSET, 0, 0 },
592
    { "tspryoffset", ACTOR_TSPRYOFFSET, 0, 0 },
592
    { "tspryoffset", ACTOR_TSPRYOFFSET, 0, 0 },
593
    { "tsprsectnum", ACTOR_TSPRSECTNUM, 0, 0 },
593
    { "tsprsectnum", ACTOR_TSPRSECTNUM, 0, 0 },
594
    { "tsprang", ACTOR_TSPRANG, 0, 0 },
594
    { "tsprang", ACTOR_TSPRANG, 0, 0 },
595
595
596
    { "", -1, 0, 0  }     // END OF LIST
596
    { "", -1, 0, 0  }     // END OF LIST
597
};
597
};
598
598
599
const memberlabel_t playerlabels[]=
599
const memberlabel_t playerlabels[]=
600
{
600
{
601
    { "zoom", PLAYER_ZOOM, 0, 0 },
601
    { "zoom", PLAYER_ZOOM, 0, 0 },
602
    { "exitx", PLAYER_EXITX, 0, 0 },
602
    { "exitx", PLAYER_EXITX, 0, 0 },
603
    { "exity", PLAYER_EXITY, 0, 0 },
603
    { "exity", PLAYER_EXITY, 0, 0 },
604
    { "loogiex", PLAYER_LOOGIEX, LABEL_HASPARM2, 64 },
604
    { "loogiex", PLAYER_LOOGIEX, LABEL_HASPARM2, 64 },
605
    { "loogiey", PLAYER_LOOGIEY, LABEL_HASPARM2, 64 },
605
    { "loogiey", PLAYER_LOOGIEY, LABEL_HASPARM2, 64 },
606
    { "numloogs", PLAYER_NUMLOOGS, 0, 0 },
606
    { "numloogs", PLAYER_NUMLOOGS, 0, 0 },
607
    { "loogcnt", PLAYER_LOOGCNT, 0, 0 },
607
    { "loogcnt", PLAYER_LOOGCNT, 0, 0 },
608
    { "posx", PLAYER_POSX, 0, 0 },
608
    { "posx", PLAYER_POSX, 0, 0 },
609
    { "posy", PLAYER_POSY, 0, 0 },
609
    { "posy", PLAYER_POSY, 0, 0 },
610
    { "posz", PLAYER_POSZ, 0, 0 },
610
    { "posz", PLAYER_POSZ, 0, 0 },
611
    { "horiz", PLAYER_HORIZ, 0, 0 },
611
    { "horiz", PLAYER_HORIZ, 0, 0 },
612
    { "ohoriz", PLAYER_OHORIZ, 0, 0 },
612
    { "ohoriz", PLAYER_OHORIZ, 0, 0 },
613
    { "ohorizoff", PLAYER_OHORIZOFF, 0, 0 },
613
    { "ohorizoff", PLAYER_OHORIZOFF, 0, 0 },
614
    { "invdisptime", PLAYER_INVDISPTIME, 0, 0 },
614
    { "invdisptime", PLAYER_INVDISPTIME, 0, 0 },
615
    { "bobposx", PLAYER_BOBPOSX, 0, 0 },
615
    { "bobposx", PLAYER_BOBPOSX, 0, 0 },
616
    { "bobposy", PLAYER_BOBPOSY, 0, 0 },
616
    { "bobposy", PLAYER_BOBPOSY, 0, 0 },
617
    { "oposx", PLAYER_OPOSX, 0, 0 },
617
    { "oposx", PLAYER_OPOSX, 0, 0 },
618
    { "oposy", PLAYER_OPOSY, 0, 0 },
618
    { "oposy", PLAYER_OPOSY, 0, 0 },
619
    { "oposz", PLAYER_OPOSZ, 0, 0 },
619
    { "oposz", PLAYER_OPOSZ, 0, 0 },
620
    { "pyoff", PLAYER_PYOFF, 0, 0 },
620
    { "pyoff", PLAYER_PYOFF, 0, 0 },
621
    { "opyoff", PLAYER_OPYOFF, 0, 0 },
621
    { "opyoff", PLAYER_OPYOFF, 0, 0 },
622
    { "posxv", PLAYER_POSXV, 0, 0 },
622
    { "posxv", PLAYER_POSXV, 0, 0 },
623
    { "posyv", PLAYER_POSYV, 0, 0 },
623
    { "posyv", PLAYER_POSYV, 0, 0 },
624
    { "poszv", PLAYER_POSZV, 0, 0 },
624
    { "poszv", PLAYER_POSZV, 0, 0 },
625
    { "last_pissed_time", PLAYER_LAST_PISSED_TIME, 0, 0 },
625
    { "last_pissed_time", PLAYER_LAST_PISSED_TIME, 0, 0 },
626
    { "truefz", PLAYER_TRUEFZ, 0, 0 },
626
    { "truefz", PLAYER_TRUEFZ, 0, 0 },
627
    { "truecz", PLAYER_TRUECZ, 0, 0 },
627
    { "truecz", PLAYER_TRUECZ, 0, 0 },
628
    { "player_par", PLAYER_PLAYER_PAR, 0, 0 },
628
    { "player_par", PLAYER_PLAYER_PAR, 0, 0 },
629
    { "visibility", PLAYER_VISIBILITY, 0, 0 },
629
    { "visibility", PLAYER_VISIBILITY, 0, 0 },
630
    { "bobcounter", PLAYER_BOBCOUNTER, 0, 0 },
630
    { "bobcounter", PLAYER_BOBCOUNTER, 0, 0 },
631
    { "weapon_sway", PLAYER_WEAPON_SWAY, 0, 0 },
631
    { "weapon_sway", PLAYER_WEAPON_SWAY, 0, 0 },
632
    { "pals_time", PLAYER_PALS_TIME, 0, 0 },
632
    { "pals_time", PLAYER_PALS_TIME, 0, 0 },
633
    { "randomflamex", PLAYER_RANDOMFLAMEX, 0, 0 },
633
    { "randomflamex", PLAYER_RANDOMFLAMEX, 0, 0 },
634
    { "crack_time", PLAYER_CRACK_TIME, 0, 0 },
634
    { "crack_time", PLAYER_CRACK_TIME, 0, 0 },
635
    { "aim_mode", PLAYER_AIM_MODE, 0, 0 },
635
    { "aim_mode", PLAYER_AIM_MODE, 0, 0 },
636
    { "ang", PLAYER_ANG, 0, 0 },
636
    { "ang", PLAYER_ANG, 0, 0 },
637
    { "oang", PLAYER_OANG, 0, 0 },
637
    { "oang", PLAYER_OANG, 0, 0 },
638
    { "angvel", PLAYER_ANGVEL, 0, 0 },
638
    { "angvel", PLAYER_ANGVEL, 0, 0 },
639
    { "cursectnum", PLAYER_CURSECTNUM, 0, 0 },
639
    { "cursectnum", PLAYER_CURSECTNUM, 0, 0 },
640
    { "look_ang", PLAYER_LOOK_ANG, 0, 0 },
640
    { "look_ang", PLAYER_LOOK_ANG, 0, 0 },
641
    { "last_extra", PLAYER_LAST_EXTRA, 0, 0 },
641
    { "last_extra", PLAYER_LAST_EXTRA, 0, 0 },
642
    { "subweapon", PLAYER_SUBWEAPON, 0, 0 },
642
    { "subweapon", PLAYER_SUBWEAPON, 0, 0 },
643
    { "ammo_amount", PLAYER_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS },
643
    { "ammo_amount", PLAYER_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS },
644
    { "wackedbyactor", PLAYER_WACKEDBYACTOR, 0, 0 },
644
    { "wackedbyactor", PLAYER_WACKEDBYACTOR, 0, 0 },
645
    { "frag", PLAYER_FRAG, 0, 0 },
645
    { "frag", PLAYER_FRAG, 0, 0 },
646
    { "fraggedself", PLAYER_FRAGGEDSELF, 0, 0 },
646
    { "fraggedself", PLAYER_FRAGGEDSELF, 0, 0 },
647
    { "curr_weapon", PLAYER_CURR_WEAPON, 0, 0 },
647
    { "curr_weapon", PLAYER_CURR_WEAPON, 0, 0 },
648
    { "last_weapon", PLAYER_LAST_WEAPON, 0, 0 },
648
    { "last_weapon", PLAYER_LAST_WEAPON, 0, 0 },
649
    { "tipincs", PLAYER_TIPINCS, 0, 0 },
649
    { "tipincs", PLAYER_TIPINCS, 0, 0 },
650
    { "horizoff", PLAYER_HORIZOFF, 0, 0 },
650
    { "horizoff", PLAYER_HORIZOFF, 0, 0 },
651
    { "wantweaponfire", PLAYER_WANTWEAPONFIRE, 0, 0 },
651
    { "wantweaponfire", PLAYER_WANTWEAPONFIRE, 0, 0 },
652
    { "holoduke_amount", PLAYER_HOLODUKE_AMOUNT, 0, 0 },
652
    { "holoduke_amount", PLAYER_HOLODUKE_AMOUNT, 0, 0 },
653
    { "newowner", PLAYER_NEWOWNER, 0, 0 },
653
    { "newowner", PLAYER_NEWOWNER, 0, 0 },
654
    { "hurt_delay", PLAYER_HURT_DELAY, 0, 0 },
654
    { "hurt_delay", PLAYER_HURT_DELAY, 0, 0 },
655
    { "hbomb_hold_delay", PLAYER_HBOMB_HOLD_DELAY, 0, 0 },
655
    { "hbomb_hold_delay", PLAYER_HBOMB_HOLD_DELAY, 0, 0 },
656
    { "jumping_counter", PLAYER_JUMPING_COUNTER, 0, 0 },
656
    { "jumping_counter", PLAYER_JUMPING_COUNTER, 0, 0 },
657
    { "airleft", PLAYER_AIRLEFT, 0, 0 },
657
    { "airleft", PLAYER_AIRLEFT, 0, 0 },
658
    { "knee_incs", PLAYER_KNEE_INCS, 0, 0 },
658
    { "knee_incs", PLAYER_KNEE_INCS, 0, 0 },
659
    { "access_incs", PLAYER_ACCESS_INCS, 0, 0 },
659
    { "access_incs", PLAYER_ACCESS_INCS, 0, 0 },
660
    { "fta", PLAYER_FTA, 0, 0 },
660
    { "fta", PLAYER_FTA, 0, 0 },
661
    { "ftq", PLAYER_FTQ, 0, 0 },
661
    { "ftq", PLAYER_FTQ, 0, 0 },
662
    { "access_wallnum", PLAYER_ACCESS_WALLNUM, 0, 0 },
662
    { "access_wallnum", PLAYER_ACCESS_WALLNUM, 0, 0 },
663
    { "access_spritenum", PLAYER_ACCESS_SPRITENUM, 0, 0 },
663
    { "access_spritenum", PLAYER_ACCESS_SPRITENUM, 0, 0 },
664
    { "kickback_pic", PLAYER_KICKBACK_PIC, 0, 0 },
664
    { "kickback_pic", PLAYER_KICKBACK_PIC, 0, 0 },
665
    { "got_access", PLAYER_GOT_ACCESS, 0, 0 },
665
    { "got_access", PLAYER_GOT_ACCESS, 0, 0 },
666
    { "weapon_ang", PLAYER_WEAPON_ANG, 0, 0 },
666
    { "weapon_ang", PLAYER_WEAPON_ANG, 0, 0 },
667
    { "firstaid_amount", PLAYER_FIRSTAID_AMOUNT, 0, 0 },
667
    { "firstaid_amount", PLAYER_FIRSTAID_AMOUNT, 0, 0 },
668
    { "somethingonplayer", PLAYER_SOMETHINGONPLAYER, 0, 0 },
668
    { "somethingonplayer", PLAYER_SOMETHINGONPLAYER, 0, 0 },
669
    { "on_crane", PLAYER_ON_CRANE, 0, 0 },
669
    { "on_crane", PLAYER_ON_CRANE, 0, 0 },
670
    { "i", PLAYER_I, 0, 0 },
670
    { "i", PLAYER_I, 0, 0 },
671
    { "one_parallax_sectnum", PLAYER_ONE_PARALLAX_SECTNUM, 0, 0 },
671
    { "one_parallax_sectnum", PLAYER_ONE_PARALLAX_SECTNUM, 0, 0 },
672
    { "over_shoulder_on", PLAYER_OVER_SHOULDER_ON, 0, 0 },
672
    { "over_shoulder_on", PLAYER_OVER_SHOULDER_ON, 0, 0 },
673
    { "random_club_frame", PLAYER_RANDOM_CLUB_FRAME, 0, 0 },
673
    { "random_club_frame", PLAYER_RANDOM_CLUB_FRAME, 0, 0 },
674
    { "fist_incs", PLAYER_FIST_INCS, 0, 0 },
674
    { "fist_incs", PLAYER_FIST_INCS, 0, 0 },
675
    { "one_eighty_count", PLAYER_ONE_EIGHTY_COUNT, 0, 0 },
675
    { "one_eighty_count", PLAYER_ONE_EIGHTY_COUNT, 0, 0 },
676
    { "cheat_phase", PLAYER_CHEAT_PHASE, 0, 0 },
676
    { "cheat_phase", PLAYER_CHEAT_PHASE, 0, 0 },
677
    { "dummyplayersprite", PLAYER_DUMMYPLAYERSPRITE, 0, 0 },
677
    { "dummyplayersprite", PLAYER_DUMMYPLAYERSPRITE, 0, 0 },
678
    { "extra_extra8", PLAYER_EXTRA_EXTRA8, 0, 0 },
678
    { "extra_extra8", PLAYER_EXTRA_EXTRA8, 0, 0 },
679
    { "quick_kick", PLAYER_QUICK_KICK, 0, 0 },
679
    { "quick_kick", PLAYER_QUICK_KICK, 0, 0 },
680
    { "heat_amount", PLAYER_HEAT_AMOUNT, 0, 0 },
680
    { "heat_amount", PLAYER_HEAT_AMOUNT, 0, 0 },
681
    { "actorsqu", PLAYER_ACTORSQU, 0, 0 },
681
    { "actorsqu", PLAYER_ACTORSQU, 0, 0 },
682
    { "timebeforeexit", PLAYER_TIMEBEFOREEXIT, 0, 0 },
682
    { "timebeforeexit", PLAYER_TIMEBEFOREEXIT, 0, 0 },
683
    { "customexitsound", PLAYER_CUSTOMEXITSOUND, 0, 0 },
683
    { "customexitsound", PLAYER_CUSTOMEXITSOUND, 0, 0 },
684
    { "weaprecs[16]", PLAYER_WEAPRECS, 0, 0 },
684
    { "weaprecs[16]", PLAYER_WEAPRECS, 0, 0 },
685
    { "weapreccnt", PLAYER_WEAPRECCNT, 0, 0 },
685
    { "weapreccnt", PLAYER_WEAPRECCNT, 0, 0 },
686
    { "interface_toggle_flag", PLAYER_INTERFACE_TOGGLE_FLAG, 0, 0 },
686
    { "interface_toggle_flag", PLAYER_INTERFACE_TOGGLE_FLAG, 0, 0 },
687
    { "rotscrnang", PLAYER_ROTSCRNANG, 0, 0 },
687
    { "rotscrnang", PLAYER_ROTSCRNANG, 0, 0 },
688
    { "dead_flag", PLAYER_DEAD_FLAG, 0, 0 },
688
    { "dead_flag", PLAYER_DEAD_FLAG, 0, 0 },
689
    { "show_empty_weapon", PLAYER_SHOW_EMPTY_WEAPON, 0, 0 },
689
    { "show_empty_weapon", PLAYER_SHOW_EMPTY_WEAPON, 0, 0 },
690
    { "scuba_amount", PLAYER_SCUBA_AMOUNT, 0, 0 },
690
    { "scuba_amount", PLAYER_SCUBA_AMOUNT, 0, 0 },
691
    { "jetpack_amount", PLAYER_JETPACK_AMOUNT, 0, 0 },
691
    { "jetpack_amount", PLAYER_JETPACK_AMOUNT, 0, 0 },
692
    { "steroids_amount", PLAYER_STEROIDS_AMOUNT, 0, 0 },
692
    { "steroids_amount", PLAYER_STEROIDS_AMOUNT, 0, 0 },
693
    { "shield_amount", PLAYER_SHIELD_AMOUNT, 0, 0 },
693
    { "shield_amount", PLAYER_SHIELD_AMOUNT, 0, 0 },
694
    { "holoduke_on", PLAYER_HOLODUKE_ON, 0, 0 },
694
    { "holoduke_on", PLAYER_HOLODUKE_ON, 0, 0 },
695
    { "pycount", PLAYER_PYCOUNT, 0, 0 },
695
    { "pycount", PLAYER_PYCOUNT, 0, 0 },
696
    { "weapon_pos", PLAYER_WEAPON_POS, 0, 0 },
696
    { "weapon_pos", PLAYER_WEAPON_POS, 0, 0 },
697
    { "frag_ps", PLAYER_FRAG_PS, 0, 0 },
697
    { "frag_ps", PLAYER_FRAG_PS, 0, 0 },
698
    { "transporter_hold", PLAYER_TRANSPORTER_HOLD, 0, 0 },
698
    { "transporter_hold", PLAYER_TRANSPORTER_HOLD, 0, 0 },
699
    { "last_full_weapon", PLAYER_LAST_FULL_WEAPON, 0, 0 },
699
    { "last_full_weapon", PLAYER_LAST_FULL_WEAPON, 0, 0 },
700
    { "footprintshade", PLAYER_FOOTPRINTSHADE, 0, 0 },
700
    { "footprintshade", PLAYER_FOOTPRINTSHADE, 0, 0 },
701
    { "boot_amount", PLAYER_BOOT_AMOUNT, 0, 0 },
701
    { "boot_amount", PLAYER_BOOT_AMOUNT, 0, 0 },
702
    { "scream_voice", PLAYER_SCREAM_VOICE, 0, 0 },
702
    { "scream_voice", PLAYER_SCREAM_VOICE, 0, 0 },
703
    { "gm", PLAYER_GM, 0, 0 },
703
    { "gm", PLAYER_GM, 0, 0 },
704
    { "on_warping_sector", PLAYER_ON_WARPING_SECTOR, 0, 0 },
704
    { "on_warping_sector", PLAYER_ON_WARPING_SECTOR, 0, 0 },
705
    { "footprintcount", PLAYER_FOOTPRINTCOUNT, 0, 0 },
705
    { "footprintcount", PLAYER_FOOTPRINTCOUNT, 0, 0 },
706
    { "hbomb_on", PLAYER_HBOMB_ON, 0, 0 },
706
    { "hbomb_on", PLAYER_HBOMB_ON, 0, 0 },
707
    { "jumping_toggle", PLAYER_JUMPING_TOGGLE, 0, 0 },
707
    { "jumping_toggle", PLAYER_JUMPING_TOGGLE, 0, 0 },
708
    { "rapid_fire_hold", PLAYER_RAPID_FIRE_HOLD, 0, 0 },
708
    { "rapid_fire_hold", PLAYER_RAPID_FIRE_HOLD, 0, 0 },
709
    { "on_ground", PLAYER_ON_GROUND, 0, 0 },
709
    { "on_ground", PLAYER_ON_GROUND, 0, 0 },
710
    { "name", PLAYER_NAME,  LABEL_ISSTRING, 32 },
710
    { "name", PLAYER_NAME,  LABEL_ISSTRING, 32 },
711
    { "inven_icon", PLAYER_INVEN_ICON, 0, 0 },
711
    { "inven_icon", PLAYER_INVEN_ICON, 0, 0 },
712
    { "buttonpalette", PLAYER_BUTTONPALETTE, 0, 0 },
712
    { "buttonpalette", PLAYER_BUTTONPALETTE, 0, 0 },
713
    { "jetpack_on", PLAYER_JETPACK_ON, 0, 0 },
713
    { "jetpack_on", PLAYER_JETPACK_ON, 0, 0 },
714
    { "spritebridge", PLAYER_SPRITEBRIDGE, 0, 0 },
714
    { "spritebridge", PLAYER_SPRITEBRIDGE, 0, 0 },
715
    { "lastrandomspot", PLAYER_LASTRANDOMSPOT, 0, 0 },
715
    { "lastrandomspot", PLAYER_LASTRANDOMSPOT, 0, 0 },
716
    { "scuba_on", PLAYER_SCUBA_ON, 0, 0 },
716
    { "scuba_on", PLAYER_SCUBA_ON, 0, 0 },
717
    { "footprintpal", PLAYER_FOOTPRINTPAL, 0, 0 },
717
    { "footprintpal", PLAYER_FOOTPRINTPAL, 0, 0 },
718
    { "heat_on", PLAYER_HEAT_ON, 0, 0 },
718
    { "heat_on", PLAYER_HEAT_ON, 0, 0 },
719
    { "holster_weapon", PLAYER_HOLSTER_WEAPON, 0, 0 },
719
    { "holster_weapon", PLAYER_HOLSTER_WEAPON, 0, 0 },
720
    { "falling_counter", PLAYER_FALLING_COUNTER, 0, 0 },
720
    { "falling_counter", PLAYER_FALLING_COUNTER, 0, 0 },
721
    { "gotweapon", PLAYER_GOTWEAPON, LABEL_HASPARM2, MAX_WEAPONS },
721
    { "gotweapon", PLAYER_GOTWEAPON, LABEL_HASPARM2, MAX_WEAPONS },
722
    { "refresh_inventory", PLAYER_REFRESH_INVENTORY, 0, 0 },
722
    { "refresh_inventory", PLAYER_REFRESH_INVENTORY, 0, 0 },
723
    { "palette", PLAYER_PALETTE, 0, 0 },
723
    { "palette", PLAYER_PALETTE, 0, 0 },
724
    { "toggle_key_flag", PLAYER_TOGGLE_KEY_FLAG, 0, 0 },
724
    { "toggle_key_flag", PLAYER_TOGGLE_KEY_FLAG, 0, 0 },
725
    { "knuckle_incs", PLAYER_KNUCKLE_INCS, 0, 0 },
725
    { "knuckle_incs", PLAYER_KNUCKLE_INCS, 0, 0 },
726
    { "walking_snd_toggle", PLAYER_WALKING_SND_TOGGLE, 0, 0 },
726
    { "walking_snd_toggle", PLAYER_WALKING_SND_TOGGLE, 0, 0 },
727
    { "palookup", PLAYER_PALOOKUP, 0, 0 },
727
    { "palookup", PLAYER_PALOOKUP, 0, 0 },
728
    { "hard_landing", PLAYER_HARD_LANDING, 0, 0 },
728
    { "hard_landing", PLAYER_HARD_LANDING, 0, 0 },
729
    { "max_secret_rooms", PLAYER_MAX_SECRET_ROOMS, 0, 0 },
729
    { "max_secret_rooms", PLAYER_MAX_SECRET_ROOMS, 0, 0 },
730
    { "secret_rooms", PLAYER_SECRET_ROOMS, 0, 0 },
730
    { "secret_rooms", PLAYER_SECRET_ROOMS, 0, 0 },
731
    { "pals", PLAYER_PALS, LABEL_HASPARM2, 3 },
731
    { "pals", PLAYER_PALS, LABEL_HASPARM2, 3 },
732
    { "max_actors_killed", PLAYER_MAX_ACTORS_KILLED, 0, 0 },
732
    { "max_actors_killed", PLAYER_MAX_ACTORS_KILLED, 0, 0 },
733
    { "actors_killed", PLAYER_ACTORS_KILLED, 0, 0 },
733
    { "actors_killed", PLAYER_ACTORS_KILLED, 0, 0 },
734
    { "return_to_center", PLAYER_RETURN_TO_CENTER, 0, 0 },
734
    { "return_to_center", PLAYER_RETURN_TO_CENTER, 0, 0 },
735
    { "runspeed", PLAYER_RUNSPEED, 0, 0 },
735
    { "runspeed", PLAYER_RUNSPEED, 0, 0 },
736
    { "sbs", PLAYER_SBS, 0, 0 },
736
    { "sbs", PLAYER_SBS, 0, 0 },
737
    { "reloading", PLAYER_RELOADING, 0, 0 },
737
    { "reloading", PLAYER_RELOADING, 0, 0 },
738
    { "auto_aim", PLAYER_AUTO_AIM, 0, 0 },
738
    { "auto_aim", PLAYER_AUTO_AIM, 0, 0 },
739
    { "movement_lock", PLAYER_MOVEMENT_LOCK, 0, 0 },
739
    { "movement_lock", PLAYER_MOVEMENT_LOCK, 0, 0 },
740
    { "sound_pitch", PLAYER_SOUND_PITCH, 0, 0 },
740
    { "sound_pitch", PLAYER_SOUND_PITCH, 0, 0 },
741
    { "weaponswitch", PLAYER_WEAPONSWITCH, 0, 0 },
741
    { "weaponswitch", PLAYER_WEAPONSWITCH, 0, 0 },
742
    { "team", PLAYER_TEAM, 0, 0 },
742
    { "team", PLAYER_TEAM, 0, 0 },
743
    { "max_player_health", PLAYER_MAX_PLAYER_HEALTH, 0, 0 },
743
    { "max_player_health", PLAYER_MAX_PLAYER_HEALTH, 0, 0 },
744
    { "max_shield_amount", PLAYER_MAX_SHIELD_AMOUNT, 0, 0 },
744
    { "max_shield_amount", PLAYER_MAX_SHIELD_AMOUNT, 0, 0 },
745
    { "max_ammo_amount", PLAYER_MAX_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS },
745
    { "max_ammo_amount", PLAYER_MAX_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS },
746
    { "", -1, 0, 0  }     // END OF LIST
746
    { "", -1, 0, 0  }     // END OF LIST
747
};
747
};
748
748
749
const memberlabel_t projectilelabels[]=
749
const memberlabel_t projectilelabels[]=
750
{
750
{
751
    { "workslike", PROJ_WORKSLIKE, 0, 0 },
751
    { "workslike", PROJ_WORKSLIKE, 0, 0 },
752
    { "spawns", PROJ_SPAWNS, 0, 0 },
752
    { "spawns", PROJ_SPAWNS, 0, 0 },
753
    { "sxrepeat", PROJ_SXREPEAT, 0, 0 },
753
    { "sxrepeat", PROJ_SXREPEAT, 0, 0 },
754
    { "syrepeat", PROJ_SYREPEAT, 0, 0 },
754
    { "syrepeat", PROJ_SYREPEAT, 0, 0 },
755
    { "sound", PROJ_SOUND, 0, 0 },
755
    { "sound", PROJ_SOUND, 0, 0 },
756
    { "isound", PROJ_ISOUND, 0, 0 },
756
    { "isound", PROJ_ISOUND, 0, 0 },
757
    { "vel", PROJ_VEL, 0, 0 },
757
    { "vel", PROJ_VEL, 0, 0 },
758
    { "extra", PROJ_EXTRA, 0, 0 },
758
    { "extra", PROJ_EXTRA, 0, 0 },
759
    { "decal", PROJ_DECAL, 0, 0 },
759
    { "decal", PROJ_DECAL, 0, 0 },
760
    { "trail", PROJ_TRAIL, 0, 0 },
760
    { "trail", PROJ_TRAIL, 0, 0 },
761
    { "txrepeat", PROJ_TXREPEAT, 0, 0 },
761
    { "txrepeat", PROJ_TXREPEAT, 0, 0 },
762
    { "tyrepeat", PROJ_TYREPEAT, 0, 0 },
762
    { "tyrepeat", PROJ_TYREPEAT, 0, 0 },
763
    { "toffset", PROJ_TOFFSET, 0, 0 },
763
    { "toffset", PROJ_TOFFSET, 0, 0 },
764
    { "tnum", PROJ_TNUM, 0, 0 },
764
    { "tnum", PROJ_TNUM, 0, 0 },
765
    { "drop", PROJ_DROP, 0, 0 },
765
    { "drop", PROJ_DROP, 0, 0 },
766
    { "cstat", PROJ_CSTAT, 0, 0 },
766
    { "cstat", PROJ_CSTAT, 0, 0 },
767
    { "clipdist", PROJ_CLIPDIST, 0, 0 },
767
    { "clipdist", PROJ_CLIPDIST, 0, 0 },
768
    { "shade", PROJ_SHADE, 0, 0 },
768
    { "shade", PROJ_SHADE, 0, 0 },
769
    { "xrepeat", PROJ_XREPEAT, 0, 0 },
769
    { "xrepeat", PROJ_XREPEAT, 0, 0 },
770
    { "yrepeat", PROJ_YREPEAT, 0, 0 },
770
    { "yrepeat", PROJ_YREPEAT, 0, 0 },
771
    { "pal", PROJ_PAL, 0, 0 },
771
    { "pal", PROJ_PAL, 0, 0 },
772
    { "extra_rand", PROJ_EXTRA_RAND, 0, 0 },
772
    { "extra_rand", PROJ_EXTRA_RAND, 0, 0 },
773
    { "hitradius", PROJ_HITRADIUS, 0, 0 },
773
    { "hitradius", PROJ_HITRADIUS, 0, 0 },
774
    { "velmult", PROJ_VEL_MULT, 0, 0 },
774
    { "velmult", PROJ_VEL_MULT, 0, 0 },
775
    { "offset", PROJ_OFFSET, 0, 0 },
775
    { "offset", PROJ_OFFSET, 0, 0 },
776
    { "bounces", PROJ_BOUNCES, 0, 0 },
776
    { "bounces", PROJ_BOUNCES, 0, 0 },
777
    { "bsound", PROJ_BSOUND, 0, 0 },
777
    { "bsound", PROJ_BSOUND, 0, 0 },
778
    { "range", PROJ_RANGE, 0, 0 },
778
    { "range", PROJ_RANGE, 0, 0 },
779
    { "", -1, 0, 0  }     // END OF LIST
779
    { "", -1, 0, 0  }     // END OF LIST
780
};
780
};
781
781
782
const memberlabel_t userdefslabels[]=
782
const memberlabel_t userdefslabels[]=
783
{
783
{
784
    //        { "<null>", 1, 0, 0 },
784
    //        { "<null>", 1, 0, 0 },
785
    { "god", USERDEFS_GOD, 0, 0 },
785
    { "god", USERDEFS_GOD, 0, 0 },
786
    { "warp_on", USERDEFS_WARP_ON, 0, 0 },
786
    { "warp_on", USERDEFS_WARP_ON, 0, 0 },
787
    { "cashman", USERDEFS_CASHMAN, 0, 0 },
787
    { "cashman", USERDEFS_CASHMAN, 0, 0 },
788
    { "eog", USERDEFS_EOG, 0, 0 },
788
    { "eog", USERDEFS_EOG, 0, 0 },
789
    { "showallmap", USERDEFS_SHOWALLMAP, 0, 0 },
789
    { "showallmap", USERDEFS_SHOWALLMAP, 0, 0 },
790
    { "show_help", USERDEFS_SHOW_HELP, 0, 0 },
790
    { "show_help", USERDEFS_SHOW_HELP, 0, 0 },
791
    { "scrollmode", USERDEFS_SCROLLMODE, 0, 0 },
791
    { "scrollmode", USERDEFS_SCROLLMODE, 0, 0 },
792
    { "clipping", USERDEFS_CLIPPING, 0, 0 },
792
    { "clipping", USERDEFS_CLIPPING, 0, 0 },
793
    { "user_name", USERDEFS_USER_NAME, LABEL_HASPARM2, MAXPLAYERS },
793
    { "user_name", USERDEFS_USER_NAME, LABEL_HASPARM2, MAXPLAYERS },
794
    { "ridecule", USERDEFS_RIDECULE, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
794
    { "ridecule", USERDEFS_RIDECULE, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
795
    { "savegame", USERDEFS_SAVEGAME, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
795
    { "savegame", USERDEFS_SAVEGAME, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
796
    { "pwlockout", USERDEFS_PWLOCKOUT, LABEL_ISSTRING, 128 },
796
    { "pwlockout", USERDEFS_PWLOCKOUT, LABEL_ISSTRING, 128 },
797
    { "rtsname;", USERDEFS_RTSNAME,  LABEL_ISSTRING, 128 },
797
    { "rtsname;", USERDEFS_RTSNAME,  LABEL_ISSTRING, 128 },
798
    { "overhead_on", USERDEFS_OVERHEAD_ON, 0, 0 },
798
    { "overhead_on", USERDEFS_OVERHEAD_ON, 0, 0 },
799
    { "last_overhead", USERDEFS_LAST_OVERHEAD, 0, 0 },
799
    { "last_overhead", USERDEFS_LAST_OVERHEAD, 0, 0 },
800
    { "showweapons", USERDEFS_SHOWWEAPONS, 0, 0 },
800
    { "showweapons", USERDEFS_SHOWWEAPONS, 0, 0 },
801
801
802
    { "pause_on", USERDEFS_PAUSE_ON, 0, 0 },
802
    { "pause_on", USERDEFS_PAUSE_ON, 0, 0 },
803
    { "from_bonus", USERDEFS_FROM_BONUS, 0, 0 },
803
    { "from_bonus", USERDEFS_FROM_BONUS, 0, 0 },
804
    { "camerasprite", USERDEFS_CAMERASPRITE, 0, 0 },
804
    { "camerasprite", USERDEFS_CAMERASPRITE, 0, 0 },
805
    { "last_camsprite", USERDEFS_LAST_CAMSPRITE, 0, 0 },
805
    { "last_camsprite", USERDEFS_LAST_CAMSPRITE, 0, 0 },
806
    { "last_level", USERDEFS_LAST_LEVEL, 0, 0 },
806
    { "last_level", USERDEFS_LAST_LEVEL, 0, 0 },
807
    { "secretlevel", USERDEFS_SECRETLEVEL, 0, 0 },
807
    { "secretlevel", USERDEFS_SECRETLEVEL, 0, 0 },
808
808
809
    { "const_visibility", USERDEFS_CONST_VISIBILITY, 0, 0 },
809
    { "const_visibility", USERDEFS_CONST_VISIBILITY, 0, 0 },
810
    { "uw_framerate", USERDEFS_UW_FRAMERATE, 0, 0 },
810
    { "uw_framerate", USERDEFS_UW_FRAMERATE, 0, 0 },
811
    { "camera_time", USERDEFS_CAMERA_TIME, 0, 0 },
811
    { "camera_time", USERDEFS_CAMERA_TIME, 0, 0 },
812
    { "folfvel", USERDEFS_FOLFVEL, 0, 0 },
812
    { "folfvel", USERDEFS_FOLFVEL, 0, 0 },
813
    { "folavel", USERDEFS_FOLAVEL, 0, 0 },
813
    { "folavel", USERDEFS_FOLAVEL, 0, 0 },
814
    { "folx", USERDEFS_FOLX, 0, 0 },
814
    { "folx", USERDEFS_FOLX, 0, 0 },
815
    { "foly", USERDEFS_FOLY, 0, 0 },
815
    { "foly", USERDEFS_FOLY, 0, 0 },
816
    { "fola", USERDEFS_FOLA, 0, 0 },
816
    { "fola", USERDEFS_FOLA, 0, 0 },
817
    { "reccnt", USERDEFS_RECCNT, 0, 0 },
817
    { "reccnt", USERDEFS_RECCNT, 0, 0 },
818
818
819
    { "entered_name", USERDEFS_ENTERED_NAME, 0, 0 },
819
    { "entered_name", USERDEFS_ENTERED_NAME, 0, 0 },
820
    { "screen_tilting", USERDEFS_SCREEN_TILTING, 0, 0 },
820
    { "screen_tilting", USERDEFS_SCREEN_TILTING, 0, 0 },
821
    { "shadows", USERDEFS_SHADOWS, 0, 0 },
821
    { "shadows", USERDEFS_SHADOWS, 0, 0 },
822
    { "fta_on", USERDEFS_FTA_ON, 0, 0 },
822
    { "fta_on", USERDEFS_FTA_ON, 0, 0 },
823
    { "executions", USERDEFS_EXECUTIONS, 0, 0 },
823
    { "executions", USERDEFS_EXECUTIONS, 0, 0 },
824
    { "auto_run", USERDEFS_AUTO_RUN, 0, 0 },
824
    { "auto_run", USERDEFS_AUTO_RUN, 0, 0 },
825
    { "coords", USERDEFS_COORDS, 0, 0 },
825
    { "coords", USERDEFS_COORDS, 0, 0 },
826
    { "tickrate", USERDEFS_TICKRATE, 0, 0 },
826
    { "tickrate", USERDEFS_TICKRATE, 0, 0 },
827
    { "m_coop", USERDEFS_M_COOP, 0, 0 },
827
    { "m_coop", USERDEFS_M_COOP, 0, 0 },
828
    { "coop", USERDEFS_COOP, 0, 0 },
828
    { "coop", USERDEFS_COOP, 0, 0 },
829
    { "screen_size", USERDEFS_SCREEN_SIZE, 0, 0 },
829
    { "screen_size", USERDEFS_SCREEN_SIZE, 0, 0 },
830
    { "lockout", USERDEFS_LOCKOUT, 0, 0 },
830
    { "lockout", USERDEFS_LOCKOUT, 0, 0 },
831
    { "crosshair", USERDEFS_CROSSHAIR, 0, 0 },
831
    { "crosshair", USERDEFS_CROSSHAIR, 0, 0 },
832
    { "wchoice[MAXPLAYERS][MAX_WEAPONS]", USERDEFS_WCHOICE, 0, 0 },
832
    { "wchoice[MAXPLAYERS][MAX_WEAPONS]", USERDEFS_WCHOICE, 0, 0 },
833
    { "playerai", USERDEFS_PLAYERAI, 0, 0 },
833
    { "playerai", USERDEFS_PLAYERAI, 0, 0 },
834
    { "respawn_monsters", USERDEFS_RESPAWN_MONSTERS, 0, 0 },
834
    { "respawn_monsters", USERDEFS_RESPAWN_MONSTERS, 0, 0 },
835
    { "respawn_items", USERDEFS_RESPAWN_ITEMS, 0, 0 },
835
    { "respawn_items", USERDEFS_RESPAWN_ITEMS, 0, 0 },
836
    { "respawn_inventory", USERDEFS_RESPAWN_INVENTORY, 0, 0 },
836
    { "respawn_inventory", USERDEFS_RESPAWN_INVENTORY, 0, 0 },
837
    { "recstat", USERDEFS_RECSTAT, 0, 0 },
837
    { "recstat", USERDEFS_RECSTAT, 0, 0 },
838
    { "monsters_off", USERDEFS_MONSTERS_OFF, 0, 0 },
838
    { "monsters_off", USERDEFS_MONSTERS_OFF, 0, 0 },
839
    { "brightness", USERDEFS_BRIGHTNESS, 0, 0 },
839
    { "brightness", USERDEFS_BRIGHTNESS, 0, 0 },
840
    { "m_respawn_items", USERDEFS_M_RESPAWN_ITEMS, 0, 0 },
840
    { "m_respawn_items", USERDEFS_M_RESPAWN_ITEMS, 0, 0 },
841
    { "m_respawn_monsters", USERDEFS_M_RESPAWN_MONSTERS, 0, 0 },
841
    { "m_respawn_monsters", USERDEFS_M_RESPAWN_MONSTERS, 0, 0 },
842
    { "m_respawn_inventory", USERDEFS_M_RESPAWN_INVENTORY, 0, 0 },
842
    { "m_respawn_inventory", USERDEFS_M_RESPAWN_INVENTORY, 0, 0 },
843
    { "m_recstat", USERDEFS_M_RECSTAT, 0, 0 },
843
    { "m_recstat", USERDEFS_M_RECSTAT, 0, 0 },
844
    { "m_monsters_off", USERDEFS_M_MONSTERS_OFF, 0, 0 },
844
    { "m_monsters_off", USERDEFS_M_MONSTERS_OFF, 0, 0 },
845
    { "detail", USERDEFS_DETAIL, 0, 0 },
845
    { "detail", USERDEFS_DETAIL, 0, 0 },
846
    { "m_ffire", USERDEFS_M_FFIRE, 0, 0 },
846
    { "m_ffire", USERDEFS_M_FFIRE, 0, 0 },
847
    { "ffire", USERDEFS_FFIRE, 0, 0 },
847
    { "ffire", USERDEFS_FFIRE, 0, 0 },
848
    { "m_player_skill", USERDEFS_M_PLAYER_SKILL, 0, 0 },
848
    { "m_player_skill", USERDEFS_M_PLAYER_SKILL, 0, 0 },
849
    { "m_level_number", USERDEFS_M_LEVEL_NUMBER, 0, 0 },
849
    { "m_level_number", USERDEFS_M_LEVEL_NUMBER, 0, 0 },
850
    { "m_volume_number", USERDEFS_M_VOLUME_NUMBER, 0, 0 },
850
    { "m_volume_number", USERDEFS_M_VOLUME_NUMBER, 0, 0 },
851
    { "multimode", USERDEFS_MULTIMODE, 0, 0 },
851
    { "multimode", USERDEFS_MULTIMODE, 0, 0 },
852
    { "player_skill", USERDEFS_PLAYER_SKILL, 0, 0 },
852
    { "player_skill", USERDEFS_PLAYER_SKILL, 0, 0 },
853
    { "level_number", USERDEFS_LEVEL_NUMBER, 0, 0 },
853
    { "level_number", USERDEFS_LEVEL_NUMBER, 0, 0 },
854
    { "volume_number", USERDEFS_VOLUME_NUMBER, 0, 0 },
854
    { "volume_number", USERDEFS_VOLUME_NUMBER, 0, 0 },
855
    { "m_marker", USERDEFS_M_MARKER, 0, 0 },
855
    { "m_marker", USERDEFS_M_MARKER, 0, 0 },
856
    { "marker", USERDEFS_MARKER, 0, 0 },
856
    { "marker", USERDEFS_MARKER, 0, 0 },
857
    { "mouseflip", USERDEFS_MOUSEFLIP, 0, 0 },
857
    { "mouseflip", USERDEFS_MOUSEFLIP, 0, 0 },
858
    { "statusbarscale", USERDEFS_STATUSBARSCALE, 0, 0 },
858
    { "statusbarscale", USERDEFS_STATUSBARSCALE, 0, 0 },
859
    { "drawweapon", USERDEFS_DRAWWEAPON, 0, 0 },
859
    { "drawweapon", USERDEFS_DRAWWEAPON, 0, 0 },
860
    { "mouseaiming", USERDEFS_MOUSEAIMING, 0, 0 },
860
    { "mouseaiming", USERDEFS_MOUSEAIMING, 0, 0 },
861
    { "weaponswitch", USERDEFS_WEAPONSWITCH, 0, 0 },
861
    { "weaponswitch", USERDEFS_WEAPONSWITCH, 0, 0 },
862
    { "democams", USERDEFS_DEMOCAMS, 0, 0 },
862
    { "democams", USERDEFS_DEMOCAMS, 0, 0 },
863
    { "color", USERDEFS_COLOR, 0, 0 },
863
    { "color", USERDEFS_COLOR, 0, 0 },
864
    { "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 },
864
    { "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 },
865
    { "statusbarmode", USERDEFS_STATUSBARMODE, 0, 0 },
865
    { "statusbarmode", USERDEFS_STATUSBARMODE, 0, 0 },
866
    { "m_noexits", USERDEFS_M_NOEXITS, 0, 0 },
866
    { "m_noexits", USERDEFS_M_NOEXITS, 0, 0 },
867
    { "noexits", USERDEFS_NOEXITS, 0, 0 },
867
    { "noexits", USERDEFS_NOEXITS, 0, 0 },
868
    { "autovote", USERDEFS_AUTOVOTE, 0, 0 },
868
    { "autovote", USERDEFS_AUTOVOTE, 0, 0 },
869
    { "automsg", USERDEFS_AUTOMSG, 0, 0 },
869
    { "automsg", USERDEFS_AUTOMSG, 0, 0 },
870
    { "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
870
    { "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
871
    { "team", USERDEFS_TEAM, 0, 0 },
871
    { "team", USERDEFS_TEAM, 0, 0 },
872
    { "viewbob", USERDEFS_VIEWBOB, 0, 0 },
872
    { "viewbob", USERDEFS_VIEWBOB, 0, 0 },
873
    { "weaponsway", USERDEFS_WEAPONSWAY, 0, 0 },
873
    { "weaponsway", USERDEFS_WEAPONSWAY, 0, 0 },
874
    { "angleinterpolation", USERDEFS_ANGLEINTERPOLATION, 0, 0 },
874
    { "angleinterpolation", USERDEFS_ANGLEINTERPOLATION, 0, 0 },
875
    { "deathmsgs", USERDEFS_DEATHMSGS, 0, 0 },
875
    { "deathmsgs", USERDEFS_DEATHMSGS, 0, 0 },
876
    { "levelstats", USERDEFS_LEVELSTATS, 0, 0 },
876
    { "levelstats", USERDEFS_LEVELSTATS, 0, 0 },
-
 
877
    { "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 },
877
    { "", -1, 0, 0  }     // END OF LIST
878
    { "", -1, 0, 0  }     // END OF LIST
878
};
879
};
879
880
880
const memberlabel_t inputlabels[]=
881
const memberlabel_t inputlabels[]=
881
{
882
{
882
    { "avel", INPUT_AVEL, 0, 0 },
883
    { "avel", INPUT_AVEL, 0, 0 },
883
    { "horz", INPUT_HORZ, 0, 0 },
884
    { "horz", INPUT_HORZ, 0, 0 },
884
    { "fvel", INPUT_FVEL, 0, 0 },
885
    { "fvel", INPUT_FVEL, 0, 0 },
885
    { "svel", INPUT_SVEL, 0, 0 },
886
    { "svel", INPUT_SVEL, 0, 0 },
886
    { "bits", INPUT_BITS, 0, 0 },
887
    { "bits", INPUT_BITS, 0, 0 },
887
    { "extbits", INPUT_EXTBITS, 0, 0 },
888
    { "extbits", INPUT_EXTBITS, 0, 0 },
888
    { "", -1, 0, 0  }     // END OF LIST
889
    { "", -1, 0, 0  }     // END OF LIST
889
};
890
};
890
891
891
static int increasescriptsize(int size)
892
static int increasescriptsize(int size)
892
{
893
{
893
    intptr_t oscriptptr = (unsigned)(scriptptr-script);
894
    intptr_t oscriptptr = (unsigned)(scriptptr-script);
894
    intptr_t ocasescriptptr = (unsigned)(casescriptptr-script);
895
    intptr_t ocasescriptptr = (unsigned)(casescriptptr-script);
895
    intptr_t oparsing_event = (unsigned)(parsing_event-script);
896
    intptr_t oparsing_event = (unsigned)(parsing_event-script);
896
    intptr_t oparsing_actor = (unsigned)(parsing_actor-script);
897
    intptr_t oparsing_actor = (unsigned)(parsing_actor-script);
897
    char *scriptptrs;
898
    char *scriptptrs;
898
    intptr_t *newscript;
899
    intptr_t *newscript;
899
    intptr_t i, j;
900
    intptr_t i, j;
900
    int osize = g_ScriptSize;
901
    int osize = g_ScriptSize;
901
902
902
    for (i=0;i<MAXSECTORS;i++)
903
    for (i=0;i<MAXSECTORS;i++)
903
    {
904
    {
904
        if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
905
        if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
905
        {
906
        {
906
            labelcode[i] -= (intptr_t)&script[0];
907
            labelcode[i] -= (intptr_t)&script[0];
907
        }
908
        }
908
    }
909
    }
909
910
910
    scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(char));
911
    scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(char));
911
    for (i=0;i<g_ScriptSize;i++)
912
    for (i=0;i<g_ScriptSize;i++)
912
    {
913
    {
913
//            initprintf("%d\n",i);
914
//            initprintf("%d\n",i);
914
        if ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize]))
915
        if ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize]))
915
        {
916
        {
916
            scriptptrs[i] = 1;
917
            scriptptrs[i] = 1;
917
            j = (intptr_t)script[i] - (intptr_t)&script[0];
918
            j = (intptr_t)script[i] - (intptr_t)&script[0];
918
            script[i] = j;
919
            script[i] = j;
919
        }
920
        }
920
        else scriptptrs[i] = 0;
921
        else scriptptrs[i] = 0;
921
    }
922
    }
922
923
923
    for (i=0;i<MAXTILES;i++)
924
    for (i=0;i<MAXTILES;i++)
924
        if (actorscrptr[i])
925
        if (actorscrptr[i])
925
        {
926
        {
926
            j = (intptr_t)actorscrptr[i]-(intptr_t)&script[0];
927
            j = (intptr_t)actorscrptr[i]-(intptr_t)&script[0];
927
            actorscrptr[i] = (intptr_t *)j;
928
            actorscrptr[i] = (intptr_t *)j;
928
        }
929
        }
929
930
930
    for (i=0;i<MAXTILES;i++)
931
    for (i=0;i<MAXTILES;i++)
931
        if (actorLoadEventScrptr[i])
932
        if (actorLoadEventScrptr[i])
932
        {
933
        {
933
            j = (intptr_t)actorLoadEventScrptr[i]-(intptr_t)&script[0];
934
            j = (intptr_t)actorLoadEventScrptr[i]-(intptr_t)&script[0];
934
            actorLoadEventScrptr[i] = (intptr_t *)j;
935
            actorLoadEventScrptr[i] = (intptr_t *)j;
935
        }
936
        }
936
937
937
    for (i=0;i<MAXGAMEEVENTS;i++)
938
    for (i=0;i<MAXGAMEEVENTS;i++)
938
        if (apScriptGameEvent[i])
939
        if (apScriptGameEvent[i])
939
        {
940
        {
940
            j = (intptr_t)apScriptGameEvent[i]-(intptr_t)&script[0];
941
            j = (intptr_t)apScriptGameEvent[i]-(intptr_t)&script[0];
941
            apScriptGameEvent[i] = (intptr_t *)j;
942
            apScriptGameEvent[i] = (intptr_t *)j;
942
        }
943
        }
943
944
944
    //initprintf("offset: %d\n",(unsigned)(scriptptr-script));
945
    //initprintf("offset: %d\n",(unsigned)(scriptptr-script));
945
    g_ScriptSize = size;
946
    g_ScriptSize = size;
946
    initprintf("Increasing script buffer size to %d bytes...\n",g_ScriptSize);
947
    initprintf("Increasing script buffer size to %d bytes...\n",g_ScriptSize);
947
    newscript = (intptr_t *)Brealloc(script, g_ScriptSize * sizeof(intptr_t));
948
    newscript = (intptr_t *)Brealloc(script, g_ScriptSize * sizeof(intptr_t));
948
949
949
    if (newscript == NULL)
950
    if (newscript == NULL)
950
    {
951
    {
951
        ReportError(-1);
952
        ReportError(-1);
952
        initprintf("%s:%d: out of memory: Aborted (%ud)\n",compilefile,line_number,(unsigned)(scriptptr-script));
953
        initprintf("%s:%d: out of memory: Aborted (%ud)\n",compilefile,line_number,(unsigned)(scriptptr-script));
953
        initprintf(tempbuf);
954
        initprintf(tempbuf);
954
        error++;
955
        error++;
955
        return 1;
956
        return 1;
956
    }
957
    }
957
    script = newscript;
958
    script = newscript;
958
    scriptptr = (intptr_t *)(script+oscriptptr);
959
    scriptptr = (intptr_t *)(script+oscriptptr);
959
    //initprintf("offset: %d\n",(unsigned)(scriptptr-script));
960
    //initprintf("offset: %d\n",(unsigned)(scriptptr-script));
960
    if (casescriptptr != NULL)
961
    if (casescriptptr != NULL)
961
        casescriptptr = (intptr_t *)(script+ocasescriptptr);
962
        casescriptptr = (intptr_t *)(script+ocasescriptptr);
962
    if (parsing_event != NULL)
963
    if (parsing_event != NULL)
963
        parsing_event = (intptr_t *)(script+oparsing_event);
964
        parsing_event = (intptr_t *)(script+oparsing_event);
964
    if (parsing_actor != NULL)
965
    if (parsing_actor != NULL)
965
        parsing_actor = (intptr_t *)(script+oparsing_actor);
966
        parsing_actor = (intptr_t *)(script+oparsing_actor);
966
967
967
    for (i=0;i<MAXSECTORS;i++)
968
    for (i=0;i<MAXSECTORS;i++)
968
    {
969
    {
969
        if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
970
        if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
970
        {
971
        {
971
            labelcode[i] += (intptr_t)&script[0];
972
            labelcode[i] += (intptr_t)&script[0];
972
        }
973
        }
973
    }
974
    }
974
975
975
    for (i=0;i<g_ScriptSize-(size-osize);i++)
976
    for (i=0;i<g_ScriptSize-(size-osize);i++)
976
        if (scriptptrs[i])
977
        if (scriptptrs[i])
977
        {
978
        {
978
            j = (intptr_t)script[i]+(intptr_t)&script[0];
979
            j = (intptr_t)script[i]+(intptr_t)&script[0];
979
            script[i] = j;
980
            script[i] = j;
980
        }
981
        }
981
982
982
    for (i=0;i<MAXTILES;i++)
983
    for (i=0;i<MAXTILES;i++)
983
        if (actorscrptr[i])
984
        if (actorscrptr[i])
984
        {
985
        {
985
            j = (intptr_t)actorscrptr[i]+(intptr_t)&script[0];
986
            j = (intptr_t)actorscrptr[i]+(intptr_t)&script[0];
986
            actorscrptr[i] = (intptr_t *)j;
987
            actorscrptr[i] = (intptr_t *)j;
987
        }
988
        }
988
989
989
    for (i=0;i<MAXTILES;i++)
990
    for (i=0;i<MAXTILES;i++)
990
        if (actorLoadEventScrptr[i])
991
        if (actorLoadEventScrptr[i])
991
        {
992
        {
992
            j = (intptr_t)actorLoadEventScrptr[i]+(intptr_t)&script[0];
993
            j = (intptr_t)actorLoadEventScrptr[i]+(intptr_t)&script[0];
993
            actorLoadEventScrptr[i] = (intptr_t *)j;
994
            actorLoadEventScrptr[i] = (intptr_t *)j;
994
        }
995
        }
995
996
996
    for (i=0;i<MAXGAMEEVENTS;i++)
997
    for (i=0;i<MAXGAMEEVENTS;i++)
997
        if (apScriptGameEvent[i])
998
        if (apScriptGameEvent[i])
998
        {
999
        {
999
            j = (intptr_t)apScriptGameEvent[i]+(intptr_t)&script[0];
1000
            j = (intptr_t)apScriptGameEvent[i]+(intptr_t)&script[0];
1000
            apScriptGameEvent[i] = (intptr_t *)j;
1001
            apScriptGameEvent[i] = (intptr_t *)j;
1001
        }
1002
        }
1002
    Bfree(scriptptrs);
1003
    Bfree(scriptptrs);
1003
    return 0;
1004
    return 0;
1004
}
1005
}
1005
1006
1006
static int skipcomments(void)
1007
static int skipcomments(void)
1007
{
1008
{
1008
    char c;
1009
    char c;
1009
1010
1010
    while ((c = *textptr))
1011
    while ((c = *textptr))
1011
    {
1012
    {
1012
        if (c == ' ' || c == '\t' || c == '\r')
1013
        if (c == ' ' || c == '\t' || c == '\r')
1013
            textptr++;
1014
            textptr++;
1014
        else if (c == '\n')
1015
        else if (c == '\n')
1015
        {
1016
        {
1016
            line_number++;
1017
            line_number++;
1017
            textptr++;
1018
            textptr++;
1018
        }
1019
        }
1019
        else if (c == '/' && textptr[1] == '/')
1020
        else if (c == '/' && textptr[1] == '/')
1020
        {
1021
        {
1021
            if (!(error || warning) && g_ScriptDebug > 1)
1022
            if (!(error || warning) && g_ScriptDebug > 1)
1022
                initprintf("%s:%d: debug: got comment.\n",compilefile,line_number);
1023
                initprintf("%s:%d: debug: got comment.\n",compilefile,line_number);
1023
            while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
1024
            while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
1024
                textptr++;
1025
                textptr++;
1025
        }
1026
        }
1026
        else if (c == '/' && textptr[1] == '*')
1027
        else if (c == '/' && textptr[1] == '*')
1027
        {
1028
        {
1028
            if (!(error || warning) && g_ScriptDebug > 1)
1029
            if (!(error || warning) && g_ScriptDebug > 1)
1029
                initprintf("%s:%d: debug: got start of comment block.\n",compilefile,line_number);
1030
                initprintf("%s:%d: debug: got start of comment block.\n",compilefile,line_number);
1030
            while (*textptr && !(textptr[0] == '*' && textptr[1] == '/'))
1031
            while (*textptr && !(textptr[0] == '*' && textptr[1] == '/'))
1031
            {
1032
            {
1032
                if (*textptr == '\n')
1033
                if (*textptr == '\n')
1033
                    line_number++;
1034
                    line_number++;
1034
                textptr++;
1035
                textptr++;
1035
            }
1036
            }
1036
            if ((!(error || warning) && g_ScriptDebug > 1) && (textptr[0] == '*' && textptr[1] == '/'))
1037
            if ((!(error || warning) && g_ScriptDebug > 1) && (textptr[0] == '*' && textptr[1] == '/'))
1037
                initprintf("%s:%d: debug: got end of comment block.\n",compilefile,line_number);
1038
                initprintf("%s:%d: debug: got end of comment block.\n",compilefile,line_number);
1038
            if (!*textptr)
1039
            if (!*textptr)
1039
            {
1040
            {
1040
                if (!(error || warning) && g_ScriptDebug)
1041
                if (!(error || warning) && g_ScriptDebug)
1041
                    initprintf("%s:%d: debug: EOF in comment!\n",compilefile,line_number);
1042
                    initprintf("%s:%d: debug: EOF in comment!\n",compilefile,line_number);
1042
                ReportError(-1);
1043
                ReportError(-1);
1043
                initprintf("%s:%d: error: found `/*' with no `*/'.\n",compilefile,line_number);
1044
                initprintf("%s:%d: error: found `/*' with no `*/'.\n",compilefile,line_number);
1044
                parsing_state = num_braces = 0;
1045
                parsing_state = num_braces = 0;
1045
                parsing_actor = 0;
1046
                parsing_actor = 0;
1046
                error++;
1047
                error++;
1047
                break;
1048
                break;
1048
            }
1049
            }
1049
            else textptr+=2;
1050
            else textptr+=2;
1050
        }
1051
        }
1051
        else break;
1052
        else break;
1052
    }
1053
    }
1053
1054
1054
    if ((unsigned)(scriptptr-script) > (unsigned)(g_ScriptSize-32))
1055
    if ((unsigned)(scriptptr-script) > (unsigned)(g_ScriptSize-32))
1055
        return increasescriptsize(g_ScriptSize+16384);
1056
        return increasescriptsize(g_ScriptSize+16384);
1056
1057
1057
    return 0;
1058
    return 0;
1058
}
1059
}
1059
1060
1060
static void DefineProjectile(int lVar1, int lLabelID, int lVar2)
1061
static void DefineProjectile(int lVar1, int lLabelID, int lVar2)
1061
{
1062
{
1062
    switch (lLabelID)
1063
    switch (lLabelID)
1063
    {
1064
    {
1064
    case PROJ_WORKSLIKE:
1065
    case PROJ_WORKSLIKE:
1065
        projectile[lVar1].workslike=lVar2;
1066
        projectile[lVar1].workslike=lVar2;
1066
        break;
1067
        break;
1067
1068
1068
    case PROJ_SPAWNS:
1069
    case PROJ_SPAWNS:
1069
        projectile[lVar1].spawns=lVar2;
1070
        projectile[lVar1].spawns=lVar2;
1070
        break;
1071
        break;
1071
1072
1072
    case PROJ_SXREPEAT:
1073
    case PROJ_SXREPEAT:
1073
        projectile[lVar1].sxrepeat=lVar2;
1074
        projectile[lVar1].sxrepeat=lVar2;
1074
        break;
1075
        break;
1075
1076
1076
    case PROJ_SYREPEAT:
1077
    case PROJ_SYREPEAT:
1077
        projectile[lVar1].syrepeat=lVar2;
1078
        projectile[lVar1].syrepeat=lVar2;
1078
        break;
1079
        break;
1079
1080
1080
    case PROJ_SOUND:
1081
    case PROJ_SOUND:
1081
        projectile[lVar1].sound=lVar2;
1082
        projectile[lVar1].sound=lVar2;
1082
        break;
1083
        break;
1083
1084
1084
    case PROJ_ISOUND:
1085
    case PROJ_ISOUND:
1085
        projectile[lVar1].isound=lVar2;
1086
        projectile[lVar1].isound=lVar2;
1086
        break;
1087
        break;
1087
1088
1088
    case PROJ_VEL:
1089
    case PROJ_VEL:
1089
        projectile[lVar1].vel=lVar2;
1090
        projectile[lVar1].vel=lVar2;
1090
        break;
1091
        break;
1091
1092
1092
    case PROJ_EXTRA:
1093
    case PROJ_EXTRA:
1093
        projectile[lVar1].extra=lVar2;
1094
        projectile[lVar1].extra=lVar2;
1094
        break;
1095
        break;
1095
1096
1096
    case PROJ_DECAL:
1097
    case PROJ_DECAL:
1097
        projectile[lVar1].decal=lVar2;
1098
        projectile[lVar1].decal=lVar2;
1098
        break;
1099
        break;
1099
1100
1100
    case PROJ_TRAIL:
1101
    case PROJ_TRAIL:
1101
        projectile[lVar1].trail=lVar2;
1102
        projectile[lVar1].trail=lVar2;
1102
        break;
1103
        break;
1103
1104
1104
    case PROJ_TXREPEAT:
1105
    case PROJ_TXREPEAT:
1105
        projectile[lVar1].txrepeat=lVar2;
1106
        projectile[lVar1].txrepeat=lVar2;
1106
        break;
1107
        break;
1107
1108
1108
    case PROJ_TYREPEAT:
1109
    case PROJ_TYREPEAT:
1109
        projectile[lVar1].tyrepeat=lVar2;
1110
        projectile[lVar1].tyrepeat=lVar2;
1110
        break;
1111
        break;
1111
1112
1112
    case PROJ_TOFFSET:
1113
    case PROJ_TOFFSET:
1113
        projectile[lVar1].toffset=lVar2;
1114
        projectile[lVar1].toffset=lVar2;
1114
        break;
1115
        break;
1115
1116
1116
    case PROJ_TNUM:
1117
    case PROJ_TNUM:
1117
        projectile[lVar1].tnum=lVar2;
1118
        projectile[lVar1].tnum=lVar2;
1118
        break;
1119
        break;
1119
1120
1120
    case PROJ_DROP:
1121
    case PROJ_DROP:
1121
        projectile[lVar1].drop=lVar2;
1122
        projectile[lVar1].drop=lVar2;
1122
        break;
1123
        break;
1123
1124
1124
    case PROJ_CSTAT:
1125
    case PROJ_CSTAT:
1125
        projectile[lVar1].cstat=lVar2;
1126
        projectile[lVar1].cstat=lVar2;
1126
        break;
1127
        break;
1127
1128
1128
    case PROJ_CLIPDIST:
1129
    case PROJ_CLIPDIST:
1129
        projectile[lVar1].clipdist=lVar2;
1130
        projectile[lVar1].clipdist=lVar2;
1130
        break;
1131
        break;
1131
1132
1132
    case PROJ_SHADE:
1133
    case PROJ_SHADE:
1133
        projectile[lVar1].shade=lVar2;
1134
        projectile[lVar1].shade=lVar2;
1134
        break;
1135
        break;
1135
1136
1136
    case PROJ_XREPEAT:
1137
    case PROJ_XREPEAT:
1137
        projectile[lVar1].xrepeat=lVar2;
1138
        projectile[lVar1].xrepeat=lVar2;
1138
        break;
1139
        break;
1139
1140
1140
    case PROJ_YREPEAT:
1141
    case PROJ_YREPEAT:
1141
        projectile[lVar1].yrepeat=lVar2;
1142
        projectile[lVar1].yrepeat=lVar2;
1142
        break;
1143
        break;
1143
1144
1144
    case PROJ_PAL:
1145
    case PROJ_PAL:
1145
        projectile[lVar1].pal=lVar2;
1146
        projectile[lVar1].pal=lVar2;
1146
        break;
1147
        break;
1147
1148
1148
    case PROJ_EXTRA_RAND:
1149
    case PROJ_EXTRA_RAND:
1149
        projectile[lVar1].extra_rand=lVar2;
1150
        projectile[lVar1].extra_rand=lVar2;
1150
        break;
1151
        break;
1151
1152
1152
    case PROJ_HITRADIUS:
1153
    case PROJ_HITRADIUS:
1153
        projectile[lVar1].hitradius=lVar2;
1154
        projectile[lVar1].hitradius=lVar2;
1154
        break;
1155
        break;
1155
1156
1156
    case PROJ_VEL_MULT:
1157
    case PROJ_VEL_MULT:
1157
        projectile[lVar1].velmult=lVar2;
1158
        projectile[lVar1].velmult=lVar2;
1158
        break;
1159
        break;
1159
1160
1160
    case PROJ_OFFSET:
1161
    case PROJ_OFFSET:
1161
        projectile[lVar1].offset=lVar2;
1162
        projectile[lVar1].offset=lVar2;
1162
        break;
1163
        break;
1163
1164
1164
    case PROJ_BOUNCES:
1165
    case PROJ_BOUNCES:
1165
        projectile[lVar1].bounces=lVar2;
1166
        projectile[lVar1].bounces=lVar2;
1166
        break;
1167
        break;
1167
1168
1168
    case PROJ_BSOUND:
1169
    case PROJ_BSOUND:
1169
        projectile[lVar1].bsound=lVar2;
1170
        projectile[lVar1].bsound=lVar2;
1170
        break;
1171
        break;
1171
1172
1172
    case PROJ_RANGE:
1173
    case PROJ_RANGE:
1173
        projectile[lVar1].range=lVar2;
1174
        projectile[lVar1].range=lVar2;
1174
        break;
1175
        break;
1175
1176
1176
    default:
1177
    default:
1177
        break;
1178
        break;
1178
    }
1179
    }
1179
1180
1180
    //  defaultprojectile[lVar1] = projectile[lVar1];
1181
    //  defaultprojectile[lVar1] = projectile[lVar1];
1181
    Bmemcpy(&defaultprojectile[lVar1], &projectile[lVar1], sizeof(projectile[lVar1]));
1182
    Bmemcpy(&defaultprojectile[lVar1], &projectile[lVar1], sizeof(projectile[lVar1]));
1182
1183
1183
    return;
1184
    return;
1184
}
1185
}
1185
1186
1186
static int CheckEventSync(int iEventID)
1187
static int CheckEventSync(int iEventID)
1187
{
1188
{
1188
    if (parsing_event || parsing_actor)
1189
    if (parsing_event || parsing_actor)
1189
    {
1190
    {
1190
        switch (iEventID)
1191
        switch (iEventID)
1191
        {
1192
        {
1192
        case EVENT_ANIMATESPRITES:
1193
        case EVENT_ANIMATESPRITES:
1193
        case EVENT_CHEATGETSTEROIDS:
1194
        case EVENT_CHEATGETSTEROIDS:
1194
        case EVENT_CHEATGETHEAT:
1195
        case EVENT_CHEATGETHEAT:
1195
        case EVENT_CHEATGETBOOT:
1196
        case EVENT_CHEATGETBOOT:
1196
        case EVENT_CHEATGETSHIELD:
1197
        case EVENT_CHEATGETSHIELD:
1197
        case EVENT_CHEATGETSCUBA:
1198
        case EVENT_CHEATGETSCUBA:
1198
        case EVENT_CHEATGETHOLODUKE:
1199
        case EVENT_CHEATGETHOLODUKE:
1199
        case EVENT_CHEATGETJETPACK:
1200
        case EVENT_CHEATGETJETPACK:
1200
        case EVENT_CHEATGETFIRSTAID:
1201
        case EVENT_CHEATGETFIRSTAID:
1201
        case EVENT_DISPLAYCROSSHAIR:
1202
        case EVENT_DISPLAYCROSSHAIR:
1202
        case EVENT_DISPLAYREST:
1203
        case EVENT_DISPLAYREST:
1203
        case EVENT_DISPLAYBONUSSCREEN:
1204
        case EVENT_DISPLAYBONUSSCREEN:
1204
        case EVENT_DISPLAYMENU:
1205
        case EVENT_DISPLAYMENU:
1205
        case EVENT_DISPLAYMENUREST:
1206
        case EVENT_DISPLAYMENUREST:
1206
        case EVENT_DISPLAYLOADINGSCREEN:
1207
        case EVENT_DISPLAYLOADINGSCREEN:
1207
        case EVENT_DISPLAYROOMS:
1208
        case EVENT_DISPLAYROOMS:
1208
        case EVENT_DISPLAYSBAR:
1209
        case EVENT_DISPLAYSBAR:
1209
        case EVENT_DISPLAYWEAPON:
1210
        case EVENT_DISPLAYWEAPON:
1210
        case EVENT_DRAWWEAPON:
1211
        case EVENT_DRAWWEAPON:
1211
        case EVENT_ENTERLEVEL:
1212
        case EVENT_ENTERLEVEL:
1212
        case EVENT_FAKEDOMOVETHINGS:
1213
        case EVENT_FAKEDOMOVETHINGS:
1213
        case EVENT_GETLOADTILE:
1214
        case EVENT_GETLOADTILE:
1214
        case EVENT_GETMENUTILE:
1215
        case EVENT_GETMENUTILE:
1215
        case EVENT_INIT:
1216
        case EVENT_INIT:
1216
        case EVENT_LOGO:
1217
        case EVENT_LOGO:
1217
            return 0;
1218
            return 0;
1218
        default:
1219
        default:
1219
            return 1;
1220
            return 1;
1220
        }
1221
        }
1221
    }
1222
    }
1222
    return 1;
1223
    return 1;
1223
}
1224
}
1224
1225
1225
#if 0
1226
#if 0
1226
void AddLog(const char *psz, ...)
1227
void AddLog(const char *psz, ...)
1227
{
1228
{
1228
    va_list va;
1229
    va_list va;
1229
1230
1230
    va_start(va, psz);
1231
    va_start(va, psz);
1231
    Bvsnprintf(tempbuf, sizeof(tempbuf), psz, va);
1232
    Bvsnprintf(tempbuf, sizeof(tempbuf), psz, va);
1232
    va_end(va);
1233
    va_end(va);
1233
1234
1234
    if (tempbuf[Bstrlen(tempbuf)] != '\n')
1235
    if (tempbuf[Bstrlen(tempbuf)] != '\n')
1235
        Bstrcat(tempbuf,"\n");
1236
        Bstrcat(tempbuf,"\n");
1236
    if (qsetmode == 200) OSD_Printf(tempbuf);
1237
    if (qsetmode == 200) OSD_Printf(tempbuf);
1237
    else initprintf(tempbuf);
1238
    else initprintf(tempbuf);
1238
}
1239
}
1239
#endif
1240
#endif
1240
1241
1241
static int GetDefID(const char *szGameLabel)
1242
static int GetDefID(const char *szGameLabel)
1242
{
1243
{
1243
    int i;
1244
    int i;
1244
    for (i=0;i<iGameVarCount;i++)
1245
    for (i=0;i<iGameVarCount;i++)
1245
    {
1246
    {
1246
        if (aGameVars[i].szLabel != NULL)
1247
        if (aGameVars[i].szLabel != NULL)
1247
        {
1248
        {
1248
            if (Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0)
1249
            if (Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0)
1249
            {
1250
            {
1250
                return i;
1251
                return i;
1251
            }
1252
            }
1252
        }
1253
        }
1253
    }
1254
    }
1254
    return -1;
1255
    return -1;
1255
}
1256
}
1256
static int GetADefID(const char *szGameLabel)
1257
static int GetADefID(const char *szGameLabel)
1257
{
1258
{
1258
    int i;
1259
    int i;
1259
//    initprintf("iGameArrayCount is %i\n",iGameArrayCount);
1260
//    initprintf("iGameArrayCount is %i\n",iGameArrayCount);
1260
    for (i=0;i<iGameArrayCount;i++)
1261
    for (i=0;i<iGameArrayCount;i++)
1261
    {
1262
    {
1262
        if (aGameArrays[i].szLabel != NULL)
1263
        if (aGameArrays[i].szLabel != NULL)
1263
        {
1264
        {
1264
            if (Bstrcmp(szGameLabel, aGameArrays[i].szLabel) == 0)
1265
            if (Bstrcmp(szGameLabel, aGameArrays[i].szLabel) == 0)
1265
            {
1266
            {
1266
                return i;
1267
                return i;
1267
            }
1268
            }
1268
        }
1269
        }
1269
    }
1270
    }
1270
//    initprintf("game array %s not found\n",szGameLabel);
1271
//    initprintf("game array %s not found\n",szGameLabel);
1271
    return -1;
1272
    return -1;
1272
}
1273
}
1273
static int ispecial(char c)
1274
static int ispecial(char c)
1274
{
1275
{
1275
    if (c == 0x0a)
1276
    if (c == 0x0a)
1276
    {
1277
    {
1277
        line_number++;
1278
        line_number++;
1278
        return 1;
1279
        return 1;
1279
    }
1280
    }
1280
1281
1281
    if (c == ' ' || c == 0x0d)
1282
    if (c == ' ' || c == 0x0d)
1282
        return 1;
1283
        return 1;
1283
1284
1284
    return 0;
1285
    return 0;
1285
}
1286
}
1286
1287
1287
static inline int isaltok(char c)
1288
static inline int isaltok(char c)
1288
{
1289
{
1289
    return (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
1290
    return (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
1290
}
1291
}
1291
1292
1292
static int getlabelid(const memberlabel_t *pLabel, const char *psz)
1293
static int getlabelid(const memberlabel_t *pLabel, const char *psz)
1293
{
1294
{
1294
    // find the label psz in the table pLabel.
1295
    // find the label psz in the table pLabel.
1295
    // returns the ID for the label, or -1
1296
    // returns the ID for the label, or -1
1296
1297
1297
    int l=-1;
1298
    int l=-1;
1298
    int i;
1299
    int i;
1299
1300
1300
    for (i=0;pLabel[i].lId >=0 ; i++)
1301
    for (i=0;pLabel[i].lId >=0 ; i++)
1301
    {
1302
    {
1302
        if (!Bstrcasecmp(pLabel[i].name,psz))
1303
        if (!Bstrcasecmp(pLabel[i].name,psz))
1303
        {
1304
        {
1304
            l= pLabel[i].lId;
1305
            l= pLabel[i].lId;
1305
            break;  // stop for loop
1306
            break;  // stop for loop
1306
        }
1307
        }
1307
    }
1308
    }
1308
    return l;
1309
    return l;
1309
}
1310
}
1310
1311
1311
static int getlabeloffset(const memberlabel_t *pLabel, const char *psz)
1312
static int getlabeloffset(const memberlabel_t *pLabel, const char *psz)
1312
{
1313
{
1313
    // find the label psz in the table pLabel.
1314
    // find the label psz in the table pLabel.
1314
    // returns the offset in the array for the label, or -1
1315
    // returns the offset in the array for the label, or -1
1315
    int i;
1316
    int i;
1316
1317
1317
    for (i=0;pLabel[i].lId >=0 ; i++)
1318
    for (i=0;pLabel[i].lId >=0 ; i++)
1318
    {
1319
    {
1319
        if (!Bstrcasecmp(pLabel[i].name,psz))
1320
        if (!Bstrcasecmp(pLabel[i].name,psz))
1320
        {
1321
        {
1321
            //    printf("Label has flags of %02X\n",pLabel[i].flags);
1322
            //    printf("Label has flags of %02X\n",pLabel[i].flags);
1322
            return i;
1323
            return i;
1323
        }
1324
        }
1324
    }
1325
    }
1325
    return -1;
1326
    return -1;
1326
}
1327
}
1327
1328
1328
static void getlabel(void)
1329
static void getlabel(void)
1329
{
1330
{
1330
    int i;
1331
    int i;
1331
1332
1332
    skipcomments();
1333
    skipcomments();
1333
1334
1334
    while (isalnum(*textptr) == 0)
1335
    while (isalnum(*textptr) == 0)
1335
    {
1336
    {
1336
        if (*textptr == 0x0a) line_number++;
1337
        if (*textptr == 0x0a) line_number++;
1337
        textptr++;
1338
        textptr++;
1338
        if (*textptr == 0)
1339
        if (*textptr == 0)
1339
            return;
1340
            return;
1340
    }
1341
    }
1341
1342
1342
    i = 0;
1343
    i = 0;
1343
    while (ispecial(*textptr) == 0 && *textptr!='['&& *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r')
1344
    while (ispecial(*textptr) == 0 && *textptr!='['&& *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r')
1344
        label[(labelcnt<<6)+i++] = *(textptr++);
1345
        label[(labelcnt<<6)+i++] = *(textptr++);
1345
1346
1346
    label[(labelcnt<<6)+i] = 0;
1347
    label[(labelcnt<<6)+i] = 0;
1347
    if (!(error || warning) && g_ScriptDebug > 1)
1348
    if (!(error || warning) && g_ScriptDebug > 1)
1348
        initprintf("%s:%d: debug: got label `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
1349
        initprintf("%s:%d: debug: got label `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
1349
}
1350
}
1350
1351
1351
static int keyword(void)
1352
static int keyword(void)
1352
{
1353
{
1353
    int i;
1354
    int i;
1354
    char *temptextptr;
1355
    char *temptextptr;
1355
1356
1356
    skipcomments();
1357
    skipcomments();
1357
1358
1358
    temptextptr = textptr;
1359
    temptextptr = textptr;
1359
1360
1360
    while (isaltok(*temptextptr) == 0)
1361
    while (isaltok(*temptextptr) == 0)
1361
    {
1362
    {
1362
        temptextptr++;
1363
        temptextptr++;
1363
        if (*temptextptr == 0)
1364
        if (*temptextptr == 0)
1364
            return 0;
1365
            return 0;
1365
    }
1366
    }
1366
1367
1367
    i = 0;
1368
    i = 0;
1368
    while (isaltok(*temptextptr))
1369
    while (isaltok(*temptextptr))
1369
    {
1370
    {
1370
        tempbuf[i] = *(temptextptr++);
1371
        tempbuf[i] = *(temptextptr++);
1371
        i++;
1372
        i++;
1372
    }
1373
    }
1373
    tempbuf[i] = 0;
1374
    tempbuf[i] = 0;
1374
    for (i=0;i<NUMKEYWORDS;i++)
1375
    for (i=0;i<NUMKEYWORDS;i++)
1375
        if (Bstrcmp(tempbuf,keyw[i]) == 0)
1376
        if (Bstrcmp(tempbuf,keyw[i]) == 0)
1376
            return i;
1377
            return i;
1377
1378
1378
    return -1;
1379
    return -1;
1379
}
1380
}
1380
1381
1381
static int transword(void) //Returns its code #
1382
static int transword(void) //Returns its code #
1382
{
1383
{
1383
    int i, l;
1384
    int i, l;
1384
1385
1385
    skipcomments();
1386
    skipcomments();
1386
1387
1387
    while (isaltok(*textptr) == 0)
1388
    while (isaltok(*textptr) == 0)
1388
    {
1389
    {
1389
        if (*textptr == 0x0a) line_number++;
1390
        if (*textptr == 0x0a) line_number++;
1390
        if (*textptr == 0)
1391
        if (*textptr == 0)
1391
            return -1;
1392
            return -1;
1392
        textptr++;
1393
        textptr++;
1393
    }
1394
    }
1394
1395
1395
    l = 0;
1396
    l = 0;
1396
    while (isaltok(*(textptr+l)) && !(*(textptr + l) == '.'))
1397
    while (isaltok(*(textptr+l)) && !(*(textptr + l) == '.'))
1397
    {
1398
    {
1398
        tempbuf[l] = textptr[l];
1399
        tempbuf[l] = textptr[l];
1399
        l++;
1400
        l++;
1400
    }
1401
    }
1401
    while (isaltok(*(textptr+l)))
1402
    while (isaltok(*(textptr+l)))
1402
    {
1403
    {
1403
        tempbuf[l] = textptr[l];
1404
        tempbuf[l] = textptr[l];
1404
        l++;
1405
        l++;
1405
    }
1406
    }
1406
    tempbuf[l] = 0;
1407
    tempbuf[l] = 0;
1407
1408
1408
    for (i=0;i<NUMKEYWORDS;i++)
1409
    for (i=0;i<NUMKEYWORDS;i++)
1409
    {
1410
    {
1410
        if (Bstrcmp(tempbuf,keyw[i]) == 0)
1411
        if (Bstrcmp(tempbuf,keyw[i]) == 0)
1411
        {
1412
        {
1412
            *scriptptr = i + (line_number<<12);
1413
            *scriptptr = i + (line_number<<12);
1413
            textptr += l;
1414
            textptr += l;
1414
            scriptptr++;
1415
            scriptptr++;
1415
            if (!(error || warning) && g_ScriptDebug)
1416
            if (!(error || warning) && g_ScriptDebug)
1416
                initprintf("%s:%d: debug: translating keyword `%s'.\n",compilefile,line_number,keyw[i]);
1417
                initprintf("%s:%d: debug: translating keyword `%s'.\n",compilefile,line_number,keyw[i]);
1417
            return i;
1418
            return i;
1418
        }
1419
        }
1419
    }
1420
    }
1420
1421
1421
    textptr += l;
1422
    textptr += l;
1422
1423
1423
    if (tempbuf[0] == '{' && tempbuf[1] != 0)
1424
    if (tempbuf[0] == '{' && tempbuf[1] != 0)
1424
    {
1425
    {
1425
        ReportError(-1);
1426
        ReportError(-1);
1426
        initprintf("%s:%d: error: expected a SPACE or CR between `{' and `%s'.\n",compilefile,line_number,tempbuf+1);
1427
        initprintf("%s:%d: error: expected a SPACE or CR between `{' and `%s'.\n",compilefile,line_number,tempbuf+1);
1427
    }
1428
    }
1428
    else if (tempbuf[0] == '}' && tempbuf[1] != 0)
1429
    else if (tempbuf[0] == '}' && tempbuf[1] != 0)
1429
    {
1430
    {
1430
        ReportError(-1);
1431
        ReportError(-1);
1431
        initprintf("%s:%d: error: expected a SPACE or CR between `}' and `%s'.\n",compilefile,line_number,tempbuf+1);
1432
        initprintf("%s:%d: error: expected a SPACE or CR between `}' and `%s'.\n",compilefile,line_number,tempbuf+1);
1432
    }
1433
    }
1433
    else ReportError(ERROR_EXPECTEDKEYWORD);
1434
    else ReportError(ERROR_EXPECTEDKEYWORD);
1434
    error++;
1435
    error++;
1435
    return -1;
1436
    return -1;
1436
}
1437
}
1437
1438
1438
static void transvartype(int type)
1439
static void transvartype(int type)
1439
{
1440
{
1440
    int i=0,f=0;
1441
    int i=0,f=0;
1441
1442
1442
    skipcomments();
1443
    skipcomments();
1443
    if (!type && !labelsonly && (isdigit(*textptr) || ((*textptr == '-') && (isdigit(*(textptr+1))))))
1444
    if (!type && !labelsonly && (isdigit(*textptr) || ((*textptr == '-') && (isdigit(*(textptr+1))))))
1444
    {
1445
    {
1445
        if (!(error || warning) && g_ScriptDebug)
1446
        if (!(error || warning) && g_ScriptDebug)
1446
            initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr));
1447
            initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr));
1447
        *scriptptr++=MAXGAMEVARS;
1448
        *scriptptr++=MAXGAMEVARS;
1448
        if (tolower(textptr[1])=='x')
1449
        if (tolower(textptr[1])=='x')
1449
            sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
1450
            sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
1450
        else
1451
        else
1451
            *scriptptr=atol(textptr);
1452
            *scriptptr=atol(textptr);
1452
        scriptptr++;
1453
        scriptptr++;
1453
        getlabel();
1454
        getlabel();
1454
        return;
1455
        return;
1455
    }
1456
    }
1456
    else if ((*textptr == '-') && !isdigit(*(textptr+1)))
1457
    else if ((*textptr == '-') && !isdigit(*(textptr+1)))
1457
    {
1458
    {
1458
        if (!type)
1459
        if (!type)
1459
        {
1460
        {
1460
            if (!(error || warning) && g_ScriptDebug)
1461
            if (!(error || warning) && g_ScriptDebug)
1461
                initprintf("%s:%d: debug: flagging gamevar as negative.\n",compilefile,line_number,atol(textptr));
1462
                initprintf("%s:%d: debug: flagging gamevar as negative.\n",compilefile,line_number,atol(textptr));
1462
            f = (MAXGAMEVARS<<1);
1463
            f = (MAXGAMEVARS<<1);
1463
        }
1464
        }
1464
        else
1465
        else
1465
        {
1466
        {
1466
            error++;
1467
            error++;
1467
            ReportError(ERROR_SYNTAXERROR);
1468
            ReportError(ERROR_SYNTAXERROR);
1468
            getlabel();
1469
            getlabel();
1469
            return;
1470
            return;
1470
        }
1471
        }
1471
    }
1472
    }
1472
    getlabel();
1473
    getlabel();
1473
1474
1474
    if (!nokeywordcheck)
1475
    if (!nokeywordcheck)
1475
        for (i=0;i<NUMKEYWORDS;i++)
1476
        for (i=0;i<NUMKEYWORDS;i++)
1476
            if (Bstrcmp(label+(labelcnt<<6),keyw[i]) == 0)
1477
            if (Bstrcmp(label+(labelcnt<<6),keyw[i]) == 0)
1477
            {
1478
            {
1478
                error++;
1479
                error++;
1479
                ReportError(ERROR_ISAKEYWORD);
1480
                ReportError(ERROR_ISAKEYWORD);
1480
                return;
1481
                return;
1481
            }
1482
            }
1482
1483
1483
    skipcomments(); //skip comments and whitespace
1484
    skipcomments(); //skip comments and whitespace
1484
    if ((*textptr == '['))     //read of array as a gamevar
1485
    if ((*textptr == '['<