#define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name)
-// WEAPONTODO: remove prop
-#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,mode,name) \
+#define WEP_CONFIG_WRITE_PROPS_string(wepname,name) \
+ { WEP_CONFIG_QUEUE( \
+ sprintf("set g_balance_%s_%s \"%s\"\n", #wepname, #name, \
+ cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
+
+#define WEP_CONFIG_WRITE_PROPS_float(wepname,name) \
{ WEP_CONFIG_QUEUE( \
sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \
cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
+
+#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,type,prop,name) WEP_CONFIG_WRITE_PROPS_##type(wepname,name)
w_cvar(WEP_ARC, arc, MO_PRI, force) \
w_cvar(WEP_ARC, arc, MO_PRI, range) \
w_cvar(WEP_ARC, arc, MO_PRI, refire) \
- w_prop(WEP_ARC, arc, reloading_ammo, reload_ammo) \
- w_prop(WEP_ARC, arc, reloading_time, reload_time) \
- w_prop(WEP_ARC, arc, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_ARC, arc, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_ARC, arc, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_ARC, arc, float, reloading_time, reload_time) \
+ w_prop(WEP_ARC, arc, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_ARC, arc, float, switchdelay_drop, switchdelay_drop)
#ifndef MENUQC
vector arc_shotorigin[4];
w_cvar(WEP_BLASTER, blaster, MO_BOTH, speed) \
w_cvar(WEP_BLASTER, blaster, MO_BOTH, spread) \
w_cvar(WEP_BLASTER, blaster, MO_NONE, secondary) \
- w_prop(WEP_BLASTER, blaster, reloading_ammo, reload_ammo) \
- w_prop(WEP_BLASTER, blaster, reloading_time, reload_time) \
- w_prop(WEP_BLASTER, blaster, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_BLASTER, blaster, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_BLASTER, blaster, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_BLASTER, blaster, float, reloading_time, reload_time) \
+ w_prop(WEP_BLASTER, blaster, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_BLASTER, blaster, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_CRYLINK, crylink, MO_BOTH, joinexplode_radius) \
w_cvar(WEP_CRYLINK, crylink, MO_BOTH, joinexplode_force) \
w_cvar(WEP_CRYLINK, crylink, MO_SEC, spreadtype) \
- w_prop(WEP_CRYLINK, crylink, reloading_ammo, reload_ammo) \
- w_prop(WEP_CRYLINK, crylink, reloading_time, reload_time) \
- w_prop(WEP_CRYLINK, crylink, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_CRYLINK, crylink, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_CRYLINK, crylink, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_CRYLINK, crylink, float, reloading_time, reload_time) \
+ w_prop(WEP_CRYLINK, crylink, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_CRYLINK, crylink, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
CRYLINK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_DEVASTATOR, devastator, MO_NONE, speed) \
w_cvar(WEP_DEVASTATOR, devastator, MO_NONE, speedaccel) \
w_cvar(WEP_DEVASTATOR, devastator, MO_NONE, speedstart) \
- w_prop(WEP_DEVASTATOR, devastator, reloading_ammo, reload_ammo) \
- w_prop(WEP_DEVASTATOR, devastator, reloading_time, reload_time) \
- w_prop(WEP_DEVASTATOR, devastator, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_DEVASTATOR, devastator, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_DEVASTATOR, devastator, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_DEVASTATOR, devastator, float, reloading_time, reload_time) \
+ w_prop(WEP_DEVASTATOR, devastator, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_DEVASTATOR, devastator, float, switchdelay_drop, switchdelay_drop) \
+ w_prop(WEP_DEVASTATOR, devastator, string, weaponreplace, weaponreplace) \
+ w_prop(WEP_DEVASTATOR, devastator, float, weaponstart, weaponstart)
#ifdef SVQC
DEVASTATOR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == self)
{
targ = targetlist;
- while (targ)
+ while(targ)
{
if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
{
WEP_ACTION(self.weapon, WR_RELOAD);
else
{
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
if(self.rl_release || WEP_CVAR(devastator, guidestop))
if(weapon_prepareattack(0, WEP_CVAR(devastator, refire)))
else
self.rl_release = 1;
- if (self.BUTTON_ATCK2)
+ if(self.BUTTON_ATCK2)
{
rockfound = 0;
for(rock = world; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == self)
w_cvar(WEP_ELECTRO, electro, MO_NONE, combo_radius) \
w_cvar(WEP_ELECTRO, electro, MO_NONE, combo_speed) \
w_cvar(WEP_ELECTRO, electro, MO_NONE, combo_safeammocheck) \
- w_prop(WEP_ELECTRO, electro, reloading_ammo, reload_ammo) \
- w_prop(WEP_ELECTRO, electro, reloading_time, reload_time) \
- w_prop(WEP_ELECTRO, electro, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_ELECTRO, electro, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_ELECTRO, electro, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_ELECTRO, electro, float, reloading_time, reload_time) \
+ w_prop(WEP_ELECTRO, electro, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_ELECTRO, electro, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
ELECTRO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_FIREBALL, fireball, MO_SEC, damagetime) \
w_cvar(WEP_FIREBALL, fireball, MO_SEC, speed_up) \
w_cvar(WEP_FIREBALL, fireball, MO_SEC, speed_z) \
- w_prop(WEP_FIREBALL, fireball, reloading_ammo, reload_ammo) \
- w_prop(WEP_FIREBALL, fireball, reloading_time, reload_time) \
- w_prop(WEP_FIREBALL, fireball, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_FIREBALL, fireball, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_FIREBALL, fireball, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_FIREBALL, fireball, float, reloading_time, reload_time) \
+ w_prop(WEP_FIREBALL, fireball, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_FIREBALL, fireball, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
FIREBALL_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_HAGAR, hagar, MO_SEC, lifetime_min) \
w_cvar(WEP_HAGAR, hagar, MO_SEC, lifetime_rand) \
w_cvar(WEP_HAGAR, hagar, MO_NONE, secondary) \
- w_prop(WEP_HAGAR, hagar, reloading_ammo, reload_ammo) \
- w_prop(WEP_HAGAR, hagar, reloading_time, reload_time) \
- w_prop(WEP_HAGAR, hagar, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_HAGAR, hagar, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_HAGAR, hagar, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_HAGAR, hagar, float, reloading_time, reload_time) \
+ w_prop(WEP_HAGAR, hagar, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_HAGAR, hagar, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
HAGAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_HLAC, hlac, MO_NONE, secondary) \
w_cvar(WEP_HLAC, hlac, MO_SEC, shots) \
w_cvar(WEP_HLAC, hlac, MO_SEC, spread) \
- w_prop(WEP_HLAC, hlac, reloading_ammo, reload_ammo) \
- w_prop(WEP_HLAC, hlac, reloading_time, reload_time) \
- w_prop(WEP_HLAC, hlac, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_HLAC, hlac, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_HLAC, hlac, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_HLAC, hlac, float, reloading_time, reload_time) \
+ w_prop(WEP_HLAC, hlac, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_HLAC, hlac, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
HLAC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_HOOK, hook, MO_SEC, speed) \
w_cvar(WEP_HOOK, hook, MO_SEC, health) \
w_cvar(WEP_HOOK, hook, MO_SEC, damageforcescale) \
- w_prop(WEP_HOOK, hook, reloading_ammo, reload_ammo) \
- w_prop(WEP_HOOK, hook, reloading_time, reload_time) \
- w_prop(WEP_HOOK, hook, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_HOOK, hook, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_HOOK, hook, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_HOOK, hook, float, reloading_time, reload_time) \
+ w_prop(WEP_HOOK, hook, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_HOOK, hook, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
HOOK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_UZI, uzi, MO_NONE, burst_animtime) \
w_cvar(WEP_UZI, uzi, MO_NONE, burst_speed) \
w_cvar(WEP_UZI, uzi, MO_NONE, burst_ammo) \
- w_prop(WEP_UZI, uzi, reloading_ammo, reload_ammo) \
- w_prop(WEP_UZI, uzi, reloading_time, reload_time) \
- w_prop(WEP_UZI, uzi, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_UZI, uzi, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_UZI, uzi, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_UZI, uzi, float, reloading_time, reload_time) \
+ w_prop(WEP_UZI, uzi, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_UZI, uzi, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
UZI_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_MINE_LAYER, minelayer, MO_NONE, remote_radius) \
w_cvar(WEP_MINE_LAYER, minelayer, MO_NONE, speed) \
w_cvar(WEP_MINE_LAYER, minelayer, MO_NONE, time) \
- w_prop(WEP_MINE_LAYER, minelayer, reloading_ammo, reload_ammo) \
- w_prop(WEP_MINE_LAYER, minelayer, reloading_time, reload_time) \
- w_prop(WEP_MINE_LAYER, minelayer, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_MINE_LAYER, minelayer, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_MINE_LAYER, minelayer, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_MINE_LAYER, minelayer, float, reloading_time, reload_time) \
+ w_prop(WEP_MINE_LAYER, minelayer, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_MINE_LAYER, minelayer, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
MINELAYER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_MINSTANEX, minstanex, MO_SEC, shotangle) \
w_cvar(WEP_MINSTANEX, minstanex, MO_SEC, speed) \
w_cvar(WEP_MINSTANEX, minstanex, MO_SEC, spread) \
- w_prop(WEP_MINSTANEX, minstanex, reloading_ammo, reload_ammo) \
- w_prop(WEP_MINSTANEX, minstanex, reloading_time, reload_time) \
- w_prop(WEP_MINSTANEX, minstanex, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_MINSTANEX, minstanex, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_MINSTANEX, minstanex, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_MINSTANEX, minstanex, float, reloading_time, reload_time) \
+ w_prop(WEP_MINSTANEX, minstanex, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_MINSTANEX, minstanex, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
MINSTANEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_MORTAR, mortar, MO_BOTH, speed_z) \
w_cvar(WEP_MORTAR, mortar, MO_BOTH, spread) \
w_cvar(WEP_MORTAR, mortar, MO_BOTH, type) \
- w_prop(WEP_MORTAR, mortar, reloading_ammo, reload_ammo) \
- w_prop(WEP_MORTAR, mortar, reloading_time, reload_time) \
- w_prop(WEP_MORTAR, mortar, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_MORTAR, mortar, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_MORTAR, mortar, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_MORTAR, mortar, float, reloading_time, reload_time) \
+ w_prop(WEP_MORTAR, mortar, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_MORTAR, mortar, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
MORTAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_NEX, nex, MO_SEC, chargepool) \
w_cvar(WEP_NEX, nex, MO_SEC, chargepool_regen) \
w_cvar(WEP_NEX, nex, MO_SEC, chargepool_pause_regen) \
- w_prop(WEP_NEX, nex, reloading_ammo, reload_ammo) \
- w_prop(WEP_NEX, nex, reloading_time, reload_time) \
- w_prop(WEP_NEX, nex, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_NEX, nex, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_NEX, nex, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_NEX, nex, float, reloading_time, reload_time) \
+ w_prop(WEP_NEX, nex, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_NEX, nex, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
NEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_PORTO, porto, MO_BOTH, refire) \
w_cvar(WEP_PORTO, porto, MO_BOTH, speed) \
w_cvar(WEP_PORTO, porto, MO_NONE, secondary) \
- w_prop(WEP_PORTO, porto, reloading_ammo, reload_ammo) \
- w_prop(WEP_PORTO, porto, reloading_time, reload_time) \
- w_prop(WEP_PORTO, porto, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_PORTO, porto, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_PORTO, porto, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_PORTO, porto, float, reloading_time, reload_time) \
+ w_prop(WEP_PORTO, porto, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_PORTO, porto, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
PORTO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_RIFLE, rifle, MO_NONE, bursttime) \
w_cvar(WEP_RIFLE, rifle, MO_NONE, secondary) \
w_cvar(WEP_RIFLE, rifle, MO_SEC, reload) \
- w_prop(WEP_RIFLE, rifle, reloading_ammo, reload_ammo) \
- w_prop(WEP_RIFLE, rifle, reloading_time, reload_time) \
- w_prop(WEP_RIFLE, rifle, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_RIFLE, rifle, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_RIFLE, rifle, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_RIFLE, rifle, float, reloading_time, reload_time) \
+ w_prop(WEP_RIFLE, rifle, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_RIFLE, rifle, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
RIFLE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_SEEKER, seeker, MO_NONE, tag_speed) \
w_cvar(WEP_SEEKER, seeker, MO_NONE, tag_spread) \
w_cvar(WEP_SEEKER, seeker, MO_NONE, tag_tracker_lifetime) \
- w_prop(WEP_SEEKER, seeker, reloading_ammo, reload_ammo) \
- w_prop(WEP_SEEKER, seeker, reloading_time, reload_time) \
- w_prop(WEP_SEEKER, seeker, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_SEEKER, seeker, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_SEEKER, seeker, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_SEEKER, seeker, float, reloading_time, reload_time) \
+ w_prop(WEP_SEEKER, seeker, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_SEEKER, seeker, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
SEEKER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_spread) \
w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, primary) \
w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, secondary) \
- w_prop(WEP_SHOCKWAVE, shockwave, reloading_ammo, reload_ammo) \
- w_prop(WEP_SHOCKWAVE, shockwave, reloading_time, reload_time) \
- w_prop(WEP_SHOCKWAVE, shockwave, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_SHOCKWAVE, shockwave, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_SHOCKWAVE, shockwave, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_SHOCKWAVE, shockwave, float, reloading_time, reload_time) \
+ w_prop(WEP_SHOCKWAVE, shockwave, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_SHOCKWAVE, shockwave, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
w_cvar(WEP_TUBA, tuba, MO_NONE, force) \
w_cvar(WEP_TUBA, tuba, MO_NONE, radius) \
w_cvar(WEP_TUBA, tuba, MO_NONE, refire) \
- w_prop(WEP_TUBA, tuba, reloading_ammo, reload_ammo) \
- w_prop(WEP_TUBA, tuba, reloading_time, reload_time) \
- w_prop(WEP_TUBA, tuba, switchdelay_raise, switchdelay_raise) \
- w_prop(WEP_TUBA, tuba, switchdelay_drop, switchdelay_drop)
+ w_prop(WEP_TUBA, tuba, float, reloading_ammo, reload_ammo) \
+ w_prop(WEP_TUBA, tuba, float, reloading_time, reload_time) \
+ w_prop(WEP_TUBA, tuba, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_TUBA, tuba, float, switchdelay_drop, switchdelay_drop)
#ifdef SVQC
TUBA_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
#define WEP_ADD_CVAR(wepid,wepname,mode,name) WEP_ADD_CVAR_##mode(wepname, name)
// create properties for weapon settings
-#define WEP_ADD_PROP(wepid,wepname,prop,name) \
- .float ##prop; \
- final float autocvar_g_balance_##wepname##_##name;
+#define WEP_ADD_PROP(wepid,wepname,type,prop,name) \
+ .type ##prop; \
+ final type autocvar_g_balance_##wepname##_##name;
// read cvars from weapon settings
#define WEP_CVAR(wepname,name) autocvar_g_balance_##wepname##_##name
// set initialization values for weapon settings
#define WEP_SKIPCVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */
-#define WEP_SET_PROP(wepid,wepname,prop,name) get_weaponinfo(##wepid).##prop = autocvar_g_balance_##wepname##_##name;
+#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(##wepid).##prop = autocvar_g_balance_##wepname##_##name;
float w_null(float dummy);
void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);