float autocvar_g_balance_nex_secondary_damagefalloff_mindist;
float autocvar_g_balance_nex_secondary_force;
float autocvar_g_balance_nex_secondary_refire;
+float autocvar_g_balance_nex_switchdelay_drop;
+float autocvar_g_balance_nex_switchdelay_raise;
float autocvar_g_balance_nex_reload_ammo;
float autocvar_g_balance_nex_reload_time;
float autocvar_g_balance_nexball_primary_animtime;
// VorteX: add player model weapon select frame here
// setcustomframe(PlayerWeaponRaise);
- weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_weaponswitchdelay, w_ready);
+ weapon_thinkf(WFRAME_IDLE, ((self.weaponentity.switchdelay_raise < 0) ? autocvar_g_balance_weaponswitchdelay : self.weaponentity.switchdelay_raise), w_ready);
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
}
else if (self.weaponentity.state == WS_DROP)
sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
self.weaponentity.state = WS_DROP;
// set up weapon switch think in the future, and start drop anim
- weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_weaponswitchdelay, w_clear);
+ weapon_thinkf(WFRAME_DONTCHANGE, ((self.weaponentity.switchdelay_drop < 0) ? autocvar_g_balance_weaponswitchdelay : self.weaponentity.switchdelay_drop), w_clear);
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
#ifndef INDEPENDENT_ATTACK_FINISHED
}
float f;
if (self.state == WS_RAISE && !intermission_running)
{
- f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
+ f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / ((self.switchdelay_raise < 0) ? autocvar_g_balance_weaponswitchdelay : self.switchdelay_raise);
self.angles_x = -90 * f * f;
}
else if (self.state == WS_DROP && !intermission_running)
{
- f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
+ f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / ((self.switchdelay_drop < 0) ? autocvar_g_balance_weaponswitchdelay : self.switchdelay_drop);
self.angles_x = -90 * f * f;
}
else if (self.state == WS_CLEAR)
.vector weaponentity_glowmod;
//.float weapon; // current weapon
+.float switchdelay_drop; // amount of time to complete drop frame for weapon
+.float switchdelay_raise; // amount of time to complete raise frame for weapon
.float switchweapon; // weapon requested to switch to
.float switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
.string weaponname; // name of .weapon
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", _("Crylink"));
+REGISTER_WEAPON(
+/* WEP_##id */ CRYLINK,
+/* function */ w_crylink,
+/* ammotype */ IT_CELLS,
+/* impulse */ 6,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "crylink",
+/* shortname */ "crylink",
+/* fullname */ _("Crylink")
+);
#else
#ifdef SVQC
.float gravity;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "electro", "electro", _("Electro"));
+REGISTER_WEAPON(
+/* WEP_##id */ ELECTRO,
+/* function */ w_electro,
+/* ammotype */ IT_CELLS,
+/* impulse */ 5,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "electro",
+/* shortname */ "electro",
+/* fullname */ _("Electro")
+);
#else
#ifdef SVQC
.float electro_count;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(FIREBALL, w_fireball, 0, 9, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
+REGISTER_WEAPON(
+/* WEP_##id */ FIREBALL,
+/* function */ w_fireball,
+/* ammotype */ 0,
+/* impulse */ 9,
+/* flags */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "fireball",
+/* shortname */ "fireball",
+/* fullname */ _("Fireball")
+);
#else
#ifdef SVQC
.float bot_primary_fireballmooth; // whatever a mooth is
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "gl", "grenadelauncher", _("Mortar"))
+REGISTER_WEAPON(
+/* WEP_##id */ GRENADE_LAUNCHER,
+/* function */ w_glauncher,
+/* ammotype */ IT_ROCKETS,
+/* impulse */ 4,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "gl",
+/* shortname */ "grenadelauncher",
+/* fullname */ _("Mortar")
+);
#else
#ifdef SVQC
.float gl_detonate_later;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hagar", "hagar", _("Hagar"))
+REGISTER_WEAPON(
+/* WEP_##id */ HAGAR,
+/* function */ w_hagar,
+/* ammotype */ IT_ROCKETS,
+/* impulse */ 8,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "hagar",
+/* shortname */ "hagar",
+/* fullname */ _("Hagar")
+);
#else
#ifdef SVQC
// NO bounce protection, as bounces are limited!
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", _("Heavy Laser Assault Cannon"))
+REGISTER_WEAPON(
+/* WEP_##id */ HLAC,
+/* function */ w_hlac,
+/* ammotype */ IT_CELLS,
+/* impulse */ 6,
+/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "hlac",
+/* shortname */ "hlac",
+/* fullname */ _("Heavy Laser Assault Cannon")
+);
#else
#ifdef SVQC
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", _("Grappling Hook"))
+REGISTER_WEAPON(
+/* WEP_##id */ HOOK,
+/* function */ w_hook,
+/* ammotype */ IT_CELLS|IT_FUEL,
+/* impulse */ 0,
+/* flags */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ 0,
+/* model */ "hookgun",
+/* shortname */ "hook",
+/* fullname */ _("Grappling Hook")
+);
#else
#ifdef SVQC
.float dmg;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "laser", "laser", _("Laser"))
+REGISTER_WEAPON(
+/* WEP_##id */ LASER,
+/* function */ w_laser,
+/* ammotype */ 0,
+/* impulse */ 1,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ 0,
+/* model */ "laser",
+/* shortname */ "laser",
+/* fullname */ _("Laser")
+);
#else
#ifdef SVQC
void(float imp) W_SwitchWeapon;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", _("Mine Layer"))
+REGISTER_WEAPON(
+/* WEP_##id */ MINE_LAYER,
+/* function */ w_minelayer,
+/* ammotype */ IT_ROCKETS,
+/* impulse */ 4,
+/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_HIGH,
+/* model */ "minelayer",
+/* shortname */ "minelayer",
+/* fullname */ _("Mine Layer")
+);
#else
#ifdef SVQC
void W_Mine_Think (void);
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", _("MinstaNex"))
+REGISTER_WEAPON(
+/* WEP_##id */ MINSTANEX,
+/* function */ w_minstanex,
+/* ammotype */ IT_CELLS,
+/* impulse */ 7,
+/* flags */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_HIGH,
+/* model */ "minstanex",
+/* shortname */ "minstanex",
+/* fullname */ _("MinstaNex")
+);
#else
#ifdef SVQC
.float minstanex_lasthit;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", _("Nex"))
+REGISTER_WEAPON(
+/* WEP_##id */ NEX,
+/* function */ w_nex,
+/* ammotype */ IT_CELLS,
+/* impulse */ 7,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_HIGH,
+/* model */ "nex",
+/* shortname */ "nex",
+/* fullname */ _("Nex")
+);
#else
#ifdef SVQC
{
weapon_setup(WEP_NEX);
self.current_ammo = ammo_cells;
+ self.weaponentity.switchdelay_drop = autocvar_g_balance_nex_switchdelay_drop;
+ self.weaponentity.switchdelay_raise = autocvar_g_balance_nex_switchdelay_raise;
}
else if (req == WR_CHECKAMMO1)
{
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(PORTO, w_porto, 0, 0, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON, 0, "porto" , "porto", _("Port-O-Launch"))
+REGISTER_WEAPON(
+/* WEP_##id */ PORTO,
+/* function */ w_porto,
+/* ammotype */ 0,
+/* impulse */ 0,
+/* flags */ WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON,
+/* rating */ 0,
+/* model */ "porto" ,
+/* shortname */ "porto",
+/* fullname */ _("Port-O-Launch")
+);
#else
#ifdef SVQC
.entity porto_current;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(RIFLE, w_rifle, IT_NAILS, 7, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "rifle", _("Rifle"))
+REGISTER_WEAPON(
+/* WEP_##id */ RIFLE,
+/* function */ w_rifle,
+/* ammotype */ IT_NAILS,
+/* impulse */ 7,
+/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "campingrifle",
+/* shortname */ "rifle",
+/* fullname */ _("Rifle")
+);
#else
#ifdef SVQC
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "rl", "rocketlauncher", _("Rocket Launcher"))
+REGISTER_WEAPON(
+/* WEP_##id */ ROCKET_LAUNCHER,
+/* function */ w_rlauncher,
+/* ammotype */ IT_ROCKETS,
+/* impulse */ 9,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_HIGH,
+/* model */ "rl",
+/* shortname */ "rocketlauncher",
+/* fullname */ _("Rocket Launcher")
+);
#else
#ifdef SVQC
.float rl_release;
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", _("T.A.G. Seeker"))
+REGISTER_WEAPON(
+/* WEP_##id */ SEEKER,
+/* function */ w_seeker,
+/* ammotype */ IT_ROCKETS,
+/* impulse */ 8,
+/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "seeker",
+/* shortname */ "seeker",
+/* fullname */ _("T.A.G. Seeker")
+);
#else
#ifdef SVQC
//.float proxytime; = autoswitch
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_LOW, "shotgun", "shotgun", _("Shotgun"))
+REGISTER_WEAPON(
+/* WEP_##id */ SHOTGUN,
+/* function */ w_shotgun,
+/* ammotype */ IT_SHELLS,
+/* impulse */ 2,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_LOW,
+/* model */ "shotgun",
+/* shortname */ "shotgun",
+/* fullname */ _("Shotgun")
+);
#else
#ifdef SVQC
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(TUBA, w_tuba, 0, 1, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "tuba", "tuba", _("@!#%'n Tuba"))
+REGISTER_WEAPON(
+/* WEP_##id */ TUBA,
+/* function */ w_tuba,
+/* ammotype */ 0,
+/* impulse */ 1,
+/* flags */ WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "tuba",
+/* shortname */ "tuba",
+/* fullname */ _("@!#%'n Tuba")
+);
#else
#ifdef SVQC
//#define TUBA_NOTE(n) strcat("weapons/tuba_note", ftos(n), ".wav")
#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", _("Machine Gun"))
+REGISTER_WEAPON(
+/* WEP_##id */ UZI,
+/* function */ w_uzi,
+/* ammotype */ IT_NAILS,
+/* impulse */ 3,
+/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_MID,
+/* model */ "uzi",
+/* shortname */ "uzi",
+/* fullname */ _("Machine Gun")
+);
#else
#ifdef SVQC