);
#define ARC_SETTINGS(weapon) \
- WEP_ADD_CVAR(weapon, MO_BOTH, float, ammo) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, animtime) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, damage) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, falloff_halflifedist) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, falloff_maxdist) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, falloff_mindist) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, force) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, range) \
- WEP_ADD_CVAR(weapon, MO_PRI, float, refire)
- //WEP_ADD_PROP(weapon, float, switchdelay_raise, switchdelay_raise) \
- //WEP_ADD_PROP(weapon, float, switchdelay_drop, switchdelay_drop)
+ WEP_ADD_CVAR(weapon, MO_BOTH, ammo) \
+ WEP_ADD_CVAR(weapon, MO_PRI, animtime) \
+ WEP_ADD_CVAR(weapon, MO_PRI, damage) \
+ WEP_ADD_CVAR(weapon, MO_PRI, falloff_halflifedist) \
+ WEP_ADD_CVAR(weapon, MO_PRI, falloff_maxdist) \
+ WEP_ADD_CVAR(weapon, MO_PRI, falloff_mindist) \
+ WEP_ADD_CVAR(weapon, MO_PRI, force) \
+ WEP_ADD_CVAR(weapon, MO_PRI, range) \
+ WEP_ADD_CVAR(weapon, MO_PRI, refire) \
+ WEP_ADD_PROP(weapon, switchdelay_raise, switchdelay_raise) \
+ WEP_ADD_PROP(weapon, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
ARC_SETTINGS(arc)
lightning_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 2);
lightning_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 3);
lightning_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 4);
+
+ #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/
+ #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_LIGHTNING).##prop = autocvar_g_balance_##weapon##_##name;
+ ARC_SETTINGS(arc)
+ #undef WEP_ADD_CVAR
+ #undef WEP_ADD_PROP
}
void spawnfunc_weapon_lightning (void) // should this really be here?
#define MO_SEC 2
#define MO_BOTH 3
-#define WEP_ADD_CVAR(weapon,mode,type,name) \
+#define WEP_ADD_CVAR(weapon,mode,name) \
#if mode == MO_PRI \
- ##type autocvar_g_balance_##weapon##_primary_##name; \
+ float autocvar_g_balance_##weapon##_primary_##name; \
#endif \
#if mode == MO_SEC \
- ##type autocvar_g_balance_##weapon##_secondary_##name; \
+ float autocvar_g_balance_##weapon##_secondary_##name; \
#endif \
#if mode == MO_BOTH \
- ##type autocvar_g_balance_##weapon##_primary_##name; \
- ##type autocvar_g_balance_##weapon##_secondary_##name; \
+ float autocvar_g_balance_##weapon##_primary_##name; \
+ float autocvar_g_balance_##weapon##_secondary_##name; \
#endif \
#if mode == MO_NONE \
- ##type autocvar_g_balance_##weapon##_##name; \
+ float autocvar_g_balance_##weapon##_##name; \
#endif
#define WEP_CVAR(weapon,name) autocvar_g_balance_##weapon##_##name
#define WEP_CVAR_PRI(weapon,name) WEP_CVAR(weapon, primary_##name)
#define WEP_CVAR_SEC(weapon,name) WEP_CVAR(weapon, secondary_##name)
#define WEP_CVAR_BOTH(weapon,mode,name) ((mode == MO_PRI) ? WEP_CVAR_PRI(weapon, name) : WEP_CVAR_SEC(weapon, name))
-
-
-#define WEP_ADD_PROP(weapon,type,prop,name) \
- .##type prop; \
- ##type autocvar_g_balance_##weapon##_##name;
+#define WEP_ADD_PROP(weapon,prop,name) \
+ .float ##prop; \
+ float autocvar_g_balance_##weapon##_##name;
#include "all.qh"
// VorteX: add player model weapon select frame here
// setcustomframe(PlayerWeaponRaise);
- weapon_thinkf(WFRAME_IDLE, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), w_ready);
+ weapon_thinkf(WFRAME_IDLE, newwep.switchdelay_raise, w_ready);
//print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname))));
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
}
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, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear);
+ weapon_thinkf(WFRAME_DONTCHANGE, oldwep.switchdelay_drop, w_clear);
//print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname))));
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
#ifndef INDEPENDENT_ATTACK_FINISHED
if (self.state == WS_RAISE && !intermission_running)
{
entity newwep = get_weaponinfo(self.owner.switchweapon);
- f = f * g_weaponratefactor / max(f, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)));
+ f = f * g_weaponratefactor / max(f, newwep.switchdelay_raise);
//print(sprintf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), (self.owner.weapon_nextthink - time)));
self.angles_x = -90 * f * f;
}
else if (self.state == WS_DROP && !intermission_running)
{
entity oldwep = get_weaponinfo(self.owner.weapon);
- f = 1 - f * g_weaponratefactor / max(f, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)));
+ f = 1 - f * g_weaponratefactor / max(f, oldwep.switchdelay_drop);
//print(sprintf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), (self.owner.weapon_nextthink - time)));
self.angles_x = -90 * f * f;
}