Subversion Repositories eduke32

Rev

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

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