Replace wall of dup'd code in Gv_AddSystemVars with something more readable.

Specifically, have a weapondata_t type mimicking the aplWeapon* arrays.
Keep a list weapondefaults[] which undergoes some static->dynamic tweaks
and then makes its way to the WEAPONx_XXX per-player gamevars.

git-svn-id: https://svn.eduke32.com/eduke32@3327 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-12-28 17:18:12 +00:00
parent b30d00dd91
commit f1b1ce2cc3
2 changed files with 184 additions and 480 deletions

View file

@ -78,6 +78,30 @@ extern char g_szBuf[1024];
extern intptr_t *g_scriptPtr;
typedef struct
{
// NOTE: the member names must be identical to aplWeapon* suffixes.
int32_t WorksLike; // What the original works like
int32_t Clip; // number of items in magazine
int32_t Reload; // delay to reload (include fire)
int32_t FireDelay; // delay to fire
int32_t TotalTime; // The total time the weapon is cycling before next fire.
int32_t HoldDelay; // delay after release fire button to fire (0 for none)
int32_t Flags; // Flags for weapon
int32_t Shoots; // what the weapon shoots
int32_t SpawnTime; // the frame at which to spawn an item
int32_t Spawn; // the item to spawn
int32_t ShotsPerBurst; // number of shots per 'burst' (one ammo per 'burst')
int32_t InitialSound; // Sound made when weapon starts firing. zero for no sound
int32_t FireSound; // Sound made when firing (each time for automatic)
int32_t Sound2Time; // Alternate sound time
int32_t Sound2Sound; // Alternate sound sound ID
int32_t ReloadSound1; // Sound of magazine being removed
int32_t ReloadSound2; // Sound of magazine being inserted
int32_t SelectSound; // Sound of weapon being selected
int32_t FlashColor; // Muzzle flash color
} weapondata_t;
typedef struct
{
const char *name;

View file

@ -484,8 +484,6 @@ int32_t Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
// found it...
if (aGameVars[i].dwFlags & (GAMEVAR_PTR_MASK))
{
// warning++;
// initprintf("%s:%d: warning: Internal gamevar \"%s\" cannot be redefined.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
C_ReportError(-1);
initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
return 0;
@ -1072,492 +1070,174 @@ void Gv_ResetSystemDefaults(void)
//AddLog("EOF:ResetWeaponDefaults");
}
static weapondata_t weapondefaults[MAX_WEAPONS] = {
/*
WorksLike, Clip, Reload, FireDelay, TotalTime, HoldDelay,
Flags,
Shoots, SpawnTime, Spawn, ShotsPerBurst, InitialSound, FireSound, Sound2Time, Sound2Sound,
ReloadSound1, ReloadSound2, SelectSound, FlashColor
*/
{
KNEE_WEAPON, 0, 0, 7, 14, 0,
WEAPON_NOVISIBLE | WEAPON_RANDOMRESTART | WEAPON_AUTOMATIC,
KNEE__STATIC, 0, 0, 0, 0, 0, 0,
0, EJECT_CLIP, INSERT_CLIP, 0, 0
},
{
PISTOL_WEAPON, /*NAM?20:*/12, /*NAM?50:*/27, 2, 5, 0,
/*NAM?WEAPON_HOLSTER_CLEARS_CLIP:*/0 | WEAPON_RELOAD_TIMING,
SHOTSPARK1__STATIC, 2, SHELL__STATIC, 0, 0, PISTOL_FIRE, 0, 0,
EJECT_CLIP, INSERT_CLIP, INSERT_CLIP, 255+(95<<8)
},
{
SHOTGUN_WEAPON, 0, 13, 4, 30, 0,
WEAPON_CHECKATRELOAD,
SHOTGUN__STATIC, 24, SHOTGUNSHELL__STATIC, 7, 0, SHOTGUN_FIRE, 15, SHOTGUN_COCK,
EJECT_CLIP, INSERT_CLIP, SHOTGUN_COCK, 255+(95<<8)
},
{
CHAINGUN_WEAPON, 0, 0, 3, 12, 3,
WEAPON_AUTOMATIC | WEAPON_FIREEVERYTHIRD | WEAPON_AMMOPERSHOT | WEAPON_SPAWNTYPE3 | WEAPON_RESET,
CHAINGUN__STATIC, 1, SHELL__STATIC, 0, 0, CHAINGUN_FIRE, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 255+(95<<8)
},
{
RPG_WEAPON, 0, 0, 4, 20, 0,
0,
RPG__STATIC, 0, 0, 0, 0, 0, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 255+(95<<8)
},
{
HANDBOMB_WEAPON, 0, 30, 6, 19, 12,
WEAPON_THROWIT,
HEAVYHBOMB__STATIC, 0, 0, 0, 0, 0, 0,
0, EJECT_CLIP, INSERT_CLIP, 0, 0
},
{
SHRINKER_WEAPON, 0, 0, 10, /*NAM?30:*/12, 0,
WEAPON_GLOWS,
SHRINKER__STATIC, 0, 0, 0, SHRINKER_FIRE, 0, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 128+(255<<8)+(128<<16)
},
{
DEVISTATOR_WEAPON, 0, 0, 3, 6, 5,
WEAPON_FIREEVERYOTHER | WEAPON_AMMOPERSHOT,
RPG__STATIC, 0, 0, 2, CAT_FIRE, 0, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 255+(95<<8)
},
{
TRIPBOMB_WEAPON, 0, 16, 3, 16, 7,
WEAPON_NOVISIBLE | WEAPON_STANDSTILL | WEAPON_CHECKATRELOAD,
HANDHOLDINGLASER__STATIC, 0, 0, 0, 0, 0, 0,
0, EJECT_CLIP, INSERT_CLIP, 0, 0
},
{
FREEZE_WEAPON, 0, 0, 3, 5, 0,
WEAPON_RESET,
FREEZEBLAST__STATIC, 0, 0, 0, CAT_FIRE, CAT_FIRE, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 128+(128<<8)+(255<<16)
},
{
HANDREMOTE_WEAPON, 0, 10, 2, 10, 0,
WEAPON_BOMB_TRIGGER | WEAPON_NOVISIBLE,
0, 0, 0, 0, 0, 0, 0,
0, EJECT_CLIP, INSERT_CLIP, 0, 0
},
{
GROW_WEAPON, 0, 0, 3, /*NAM?30:*/5, 0,
WEAPON_GLOWS,
GROWSPARK__STATIC, /*NAM?2:*/0, /*NAM?SHELL:*/0, 0, 0, /*NAM?0:*/EXPANDERSHOOT, 0, 0,
EJECT_CLIP, INSERT_CLIP, SELECT_WEAPON, 255+(95<<8)
},
};
// KEEPINSYNC with what is contained above
// XXX: ugly
static int32_t G_StaticToDynamicTile(int32_t tile)
{
switch (tile)
{
case CHAINGUN__STATIC: return CHAINGUN;
case FREEZEBLAST__STATIC: return FREEZEBLAST;
case GROWSPARK__STATIC: return GROWSPARK;
case HANDHOLDINGLASER__STATIC: return HANDHOLDINGLASER;
case HEAVYHBOMB__STATIC: return HEAVYHBOMB;
case KNEE__STATIC: return KNEE;
case RPG__STATIC: return RPG;
case SHELL__STATIC: return SHELL;
case SHOTGUNSHELL__STATIC: return SHOTGUNSHELL;
case SHOTGUN__STATIC: return SHOTGUN;
case SHOTSPARK1__STATIC: return SHOTSPARK1;
case SHRINKER__STATIC: return SHRINKER;
default: return tile;
}
}
#define ADDWEAPONVAR(Weapidx, Membname) do { \
Bsprintf(aszBuf, "WEAPON%d_" #Membname, Weapidx); \
Bstrupr(aszBuf); \
Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \
} while (0)
static void Gv_AddSystemVars(void)
{
// only call ONCE
char aszBuf[64];
int32_t i;
if (NAM)
{
weapondefaults[PISTOL_WEAPON].Clip = 20;
weapondefaults[PISTOL_WEAPON].Reload = 50;
weapondefaults[PISTOL_WEAPON].Flags = WEAPON_HOLSTER_CLEARS_CLIP;
weapondefaults[SHRINKER_WEAPON].TotalTime = 30;
weapondefaults[GROW_WEAPON].TotalTime = 30;
weapondefaults[GROW_WEAPON].SpawnTime = 2;
weapondefaults[GROW_WEAPON].Spawn = SHELL;
weapondefaults[GROW_WEAPON].FireSound = 0;
}
//AddLog("Gv_AddSystemVars");
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",KNEE_WEAPON);
Gv_NewVar(aszBuf, KNEE_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",KNEE_WEAPON);
Gv_NewVar(aszBuf, 7, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",KNEE_WEAPON);
Gv_NewVar(aszBuf, 14, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",KNEE_WEAPON);
Gv_NewVar(aszBuf, WEAPON_NOVISIBLE | WEAPON_RANDOMRESTART | WEAPON_AUTOMATIC, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",KNEE_WEAPON);
Gv_NewVar(aszBuf, KNEE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",KNEE_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",KNEE_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",KNEE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
for (i=0; i<MAX_WEAPONS; i++)
{
weapondefaults[i].Shoots = G_StaticToDynamicTile(weapondefaults[i].Shoots);
weapondefaults[i].Spawn = G_StaticToDynamicTile(weapondefaults[i].Spawn);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",PISTOL_WEAPON);
Gv_NewVar(aszBuf, PISTOL_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",PISTOL_WEAPON);
Gv_NewVar(aszBuf, NAM?20:12, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",PISTOL_WEAPON);
Gv_NewVar(aszBuf, NAM?50:27, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 2, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 5, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",PISTOL_WEAPON);
Gv_NewVar(aszBuf, NAM?WEAPON_HOLSTER_CLEARS_CLIP:0 | WEAPON_RELOAD_TIMING, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",PISTOL_WEAPON);
Gv_NewVar(aszBuf, SHOTSPARK1, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 2, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",PISTOL_WEAPON);
Gv_NewVar(aszBuf, SHELL, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",PISTOL_WEAPON);
Gv_NewVar(aszBuf, PISTOL_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",PISTOL_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",PISTOL_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",PISTOL_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",PISTOL_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUN_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 13, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 4, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 30, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, WEAPON_CHECKATRELOAD, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUN, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 24, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUNSHELL, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 7, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUN_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 15, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUN_COCK, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, SHOTGUN_COCK, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",SHOTGUN_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, CHAINGUN_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 12, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, WEAPON_AUTOMATIC | WEAPON_FIREEVERYTHIRD | WEAPON_AMMOPERSHOT | WEAPON_SPAWNTYPE3 | WEAPON_RESET, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, CHAINGUN, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 1, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, SHELL, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, CHAINGUN_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",CHAINGUN_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",RPG_WEAPON);
Gv_NewVar(aszBuf, RPG_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",RPG_WEAPON);
Gv_NewVar(aszBuf, 4, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",RPG_WEAPON);
Gv_NewVar(aszBuf, 20, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",RPG_WEAPON);
Gv_NewVar(aszBuf, RPG, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",RPG_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",RPG_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",RPG_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",RPG_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",RPG_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, HANDBOMB_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 30, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 6, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 19, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 12, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, WEAPON_THROWIT, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, HEAVYHBOMB, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",HANDBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, SHRINKER_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 10, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, NAM?30:12, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, WEAPON_GLOWS, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, SHRINKER, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, SHRINKER_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",SHRINKER_WEAPON);
Gv_NewVar(aszBuf, 128+(255<<8)+(128<<16), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, DEVISTATOR_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 6, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 5, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, WEAPON_FIREEVERYOTHER | WEAPON_AMMOPERSHOT, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, RPG, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 2, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, CAT_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",DEVISTATOR_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, TRIPBOMB_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 16, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 16, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 7, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, WEAPON_NOVISIBLE | WEAPON_STANDSTILL | WEAPON_CHECKATRELOAD, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, HANDHOLDINGLASER, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",TRIPBOMB_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",FREEZE_WEAPON);
Gv_NewVar(aszBuf, FREEZE_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 5, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",FREEZE_WEAPON);
Gv_NewVar(aszBuf, WEAPON_RESET, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",FREEZE_WEAPON);
Gv_NewVar(aszBuf, FREEZEBLAST, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",FREEZE_WEAPON);
Gv_NewVar(aszBuf, CAT_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",FREEZE_WEAPON);
Gv_NewVar(aszBuf, CAT_FIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",FREEZE_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",FREEZE_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",FREEZE_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",FREEZE_WEAPON);
Gv_NewVar(aszBuf, 128+(128<<8)+(255<<16), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
/////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, HANDREMOTE_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 10, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 2, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 10, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, WEAPON_BOMB_TRIGGER | WEAPON_NOVISIBLE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",HANDREMOTE_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
///////////////////////////////////////////////////////
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",GROW_WEAPON);
Gv_NewVar(aszBuf, GROW_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_CLIP",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOAD",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIREDELAY",GROW_WEAPON);
Gv_NewVar(aszBuf, 3, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_TOTALTIME",GROW_WEAPON);
Gv_NewVar(aszBuf, NAM?30:5, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_HOLDDELAY",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLAGS",GROW_WEAPON);
Gv_NewVar(aszBuf, WEAPON_GLOWS, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOOTS",GROW_WEAPON);
Gv_NewVar(aszBuf, GROWSPARK, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWNTIME",GROW_WEAPON);
Gv_NewVar(aszBuf, NAM?2:0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SPAWN",GROW_WEAPON);
Gv_NewVar(aszBuf, NAM?SHELL:0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SHOTSPERBURST",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_INITIALSOUND",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FIRESOUND",GROW_WEAPON);
Gv_NewVar(aszBuf, NAM?0:EXPANDERSHOOT, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2TIME",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SOUND2SOUND",GROW_WEAPON);
Gv_NewVar(aszBuf, 0, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND1",GROW_WEAPON);
Gv_NewVar(aszBuf, EJECT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_RELOADSOUND2",GROW_WEAPON);
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",GROW_WEAPON);
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",GROW_WEAPON);
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
ADDWEAPONVAR(i, WorksLike);
ADDWEAPONVAR(i, Clip);
ADDWEAPONVAR(i, Reload);
ADDWEAPONVAR(i, FireDelay);
ADDWEAPONVAR(i, TotalTime);
ADDWEAPONVAR(i, HoldDelay);
ADDWEAPONVAR(i, Flags);
ADDWEAPONVAR(i, Shoots);
ADDWEAPONVAR(i, SpawnTime);
ADDWEAPONVAR(i, Spawn);
ADDWEAPONVAR(i, ShotsPerBurst);
ADDWEAPONVAR(i, InitialSound);
ADDWEAPONVAR(i, FireSound);
ADDWEAPONVAR(i, Sound2Time);
ADDWEAPONVAR(i, Sound2Sound);
ADDWEAPONVAR(i, ReloadSound1);
ADDWEAPONVAR(i, ReloadSound2);
ADDWEAPONVAR(i, SelectSound);
ADDWEAPONVAR(i, FlashColor);
}
Gv_NewVar("GRENADE_LIFETIME", NAM_GRENADE_LIFETIME, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
Gv_NewVar("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);