]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove optional blaster secondary attack (copy of primary attack with slightly differ...
authorterencehill <piuntn@gmail.com>
Mon, 12 Aug 2024 23:20:20 +0000 (01:20 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 12 Aug 2024 23:20:20 +0000 (01:20 +0200)
Weapons using blaster as secondary attack now load settings from blaster primary

15 files changed:
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/overkill/okhmg.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/common/mutators/mutator/overkill/oknex.qh
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/blaster.qh
qcsrc/common/weapons/weapon/vaporizer.qc

index ee46e5972968395dd041732b72cffae2448cec34..c6b10f072fbb264daf79dac327f5ec03d0669189 100644 (file)
@@ -11,19 +11,6 @@ set g_balance_blaster_primary_refire 0.7
 set g_balance_blaster_primary_shotangle 0
 set g_balance_blaster_primary_speed 6000
 set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.2
-set g_balance_blaster_secondary_damage 25
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 360
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 5
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 6000
-set g_balance_blaster_secondary_spread 0
 set g_balance_blaster_switchdelay_drop 0.2
 set g_balance_blaster_switchdelay_raise 0.2
 set g_balance_blaster_weaponreplace ""
index a480463cf12147f5b83970cd1119ca8b71391503..ec98688d808934583cdbe5de65cb996ada6ab8e4 100644 (file)
@@ -11,19 +11,6 @@ set g_balance_blaster_primary_refire 0.7
 set g_balance_blaster_primary_shotangle 0
 set g_balance_blaster_primary_speed 9000
 set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.3
-set g_balance_blaster_secondary_damage 35
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 10
-set g_balance_blaster_secondary_force 400
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 30
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 9000
-set g_balance_blaster_secondary_spread 0
 set g_balance_blaster_switchdelay_drop 0.15
 set g_balance_blaster_switchdelay_raise 0.15
 set g_balance_blaster_weaponreplace ""
index 7bbd5709860baac57fee7283d9a95b3144d2d6a3..60020faa8498693d2a2baa43770459120b430f47 100644 (file)
@@ -11,19 +11,6 @@ set g_balance_blaster_primary_refire 0.7
 set g_balance_blaster_primary_shotangle 0
 set g_balance_blaster_primary_speed 6000
 set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.2
-set g_balance_blaster_secondary_damage 25
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 300
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 5
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 6000
-set g_balance_blaster_secondary_spread 0
 set g_balance_blaster_switchdelay_drop 0.15
 set g_balance_blaster_switchdelay_raise 0.15
 set g_balance_blaster_weaponreplace ""
index d25439986aa46202a57ac648d9f921139f9c18a4..268da517be1b45d36ca72342444fc15512d897fb 100644 (file)
@@ -11,19 +11,6 @@ set g_balance_blaster_primary_refire 0.7
 set g_balance_blaster_primary_shotangle 0
 set g_balance_blaster_primary_speed 6000
 set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.2
-set g_balance_blaster_secondary_damage 25
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 360
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 5
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 6000
-set g_balance_blaster_secondary_spread 0
 set g_balance_blaster_switchdelay_drop 0
 set g_balance_blaster_switchdelay_raise 0
 set g_balance_blaster_weaponreplace ""
index ac14eb5ba108c0cb732d676c3db15834369f8da4..888ae196aefddedc21cb0f0e3296d7becdee63cf 100644 (file)
@@ -11,19 +11,6 @@ set g_balance_blaster_primary_refire 0.7
 set g_balance_blaster_primary_shotangle 0
 set g_balance_blaster_primary_speed 6000
 set g_balance_blaster_primary_spread 0
-set g_balance_blaster_secondary 0
-set g_balance_blaster_secondary_animtime 0.2
-set g_balance_blaster_secondary_damage 25
-set g_balance_blaster_secondary_delay 0
-set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 360
-set g_balance_blaster_secondary_force_zscale 1
-set g_balance_blaster_secondary_lifetime 5
-set g_balance_blaster_secondary_radius 70
-set g_balance_blaster_secondary_refire 0.7
-set g_balance_blaster_secondary_shotangle 0
-set g_balance_blaster_secondary_speed 6000
-set g_balance_blaster_secondary_spread 0
 set g_balance_blaster_switchdelay_drop 0.2
 set g_balance_blaster_switchdelay_raise 0.2
 set g_balance_blaster_weaponreplace ""
index 028dc7e32c6980ec761bd76cf51e658f41230c44..e842eb4fe9492ce06e9a9555dbeb97177f1b0f92 100644 (file)
@@ -212,20 +212,17 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
 
                if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
                {
-                       if(frag_deathtype & HITTYPE_SECONDARY)
+                       if(!autocvar_g_instagib_blaster_keepdamage || frag_attacker == frag_target)
                        {
-                               if(!autocvar_g_instagib_blaster_keepdamage || frag_attacker == frag_target)
-                               {
-                                       frag_damage = 0;
-                                       if(!autocvar_g_instagib_mirrordamage)
-                                               frag_mirrordamage = 0; // never do mirror damage on enemies
-                               }
-
-                               if(frag_target != frag_attacker)
-                               {
-                                       if(!autocvar_g_instagib_blaster_keepforce)
-                                               frag_force = '0 0 0';
-                               }
+                               frag_damage = 0;
+                               if(!autocvar_g_instagib_mirrordamage)
+                                       frag_mirrordamage = 0; // never do mirror damage on enemies
+                       }
+
+                       if(frag_target != frag_attacker)
+                       {
+                               if(!autocvar_g_instagib_blaster_keepforce)
+                                       frag_force = '0 0 0';
                        }
                }
        }
index d40495ade72a31587b754511a446b79aa845152c..feb8a02d434c2532b57fff0f430a7ff1fb501989 100644 (file)
@@ -63,9 +63,9 @@ METHOD(OverkillHeavyMachineGun, wr_think, void(entity thiswep, entity actor, .en
        if ((WEP_CVAR_SEC(WEP_OVERKILL_HMG, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
        {
                // Secondary uses it's own refire timer if refire_type is 1.
-               actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+               actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+               W_Blaster_Attack(actor, weaponentity);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -98,13 +98,13 @@ METHOD(OverkillHeavyMachineGun, wr_think, void(entity thiswep, entity actor, .en
        }
        if ((fire & 2) && (WEP_CVAR_SEC(WEP_OVERKILL_HMG, refire_type) == 0)) // Secondary attack
        {
-               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                {
                        return;
                }
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+               W_Blaster_Attack(actor, weaponentity);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
        }
 }
 
@@ -120,10 +120,10 @@ METHOD(OverkillHeavyMachineGun, wr_checkammo1, bool(entity thiswep, entity actor
 
 METHOD(OverkillHeavyMachineGun, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
 {
-       float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
+       float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
        if (autocvar_g_balance_okhmg_reload_ammo)
        {
-               ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_HMG.m_id]) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
+               ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_HMG.m_id]) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
        }
        return ammo_amount;
 }
index 341c4312506a4fb1d40c758fa17373d16e70b6b2..041ea0b5d4385ca6acc1f0155d785aef63be8d37 100644 (file)
@@ -67,9 +67,9 @@ METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity
        if ((WEP_CVAR_SEC(WEP_OVERKILL_MACHINEGUN, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
        {
                // Secondary uses it's own refire timer if refire_type is 1.
-               actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+               actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+               W_Blaster_Attack(actor, weaponentity);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -102,13 +102,13 @@ METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity
        }
        if ((fire & 2) && (WEP_CVAR_SEC(WEP_OVERKILL_MACHINEGUN, refire_type) == 0)) // Secondary attack
        {
-               if (!weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+               if (!weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                {
                        return;
                }
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+               W_Blaster_Attack(actor, weaponentity);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
        }
 }
 
index cd47fee2dc907ce72b1a7c9c081ecbb7f6555ab8..2b205fea9ce966467d6bbc37adebdf5363415ced 100644 (file)
@@ -140,9 +140,9 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
        if ((WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
        {
                // Secondary uses it's own refire timer if refire_type is 1.
-               actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+               actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+               W_Blaster_Attack(actor, weaponentity);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -177,13 +177,13 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
        if ((fire & 2) && (WEP_CVAR(WEP_OVERKILL_NEX, secondary) == 2) && (WEP_CVAR_SEC(WEP_OVERKILL_NEX, refire_type) == 0))
        {
                // Secondary attack
-               if (!weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+               if (!weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                {
                        return;
                }
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+               W_Blaster_Attack(actor, weaponentity);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
                return;
        }
 
@@ -199,10 +199,10 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                        {
                                if(WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool))
                                {
-                                       if(WEP_CVAR_SEC(WEP_BLASTER, ammo))
+                                       if(WEP_CVAR_PRI(WEP_BLASTER, ammo))
                                        {
                                                // always deplete if secondary is held
-                                               actor.(weaponentity).oknex_chargepool_ammo = max(0, actor.(weaponentity).oknex_chargepool_ammo - WEP_CVAR_SEC(WEP_BLASTER, ammo) * dt);
+                                               actor.(weaponentity).oknex_chargepool_ammo = max(0, actor.(weaponentity).oknex_chargepool_ammo - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
 
                                                dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(WEP_OVERKILL_NEX, charge_rate));
                                                actor.oknex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(WEP_OVERKILL_NEX, chargepool_pause_regen);
@@ -213,7 +213,7 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                                        }
                                }
 
-                               else if(WEP_CVAR_SEC(WEP_BLASTER, ammo))
+                               else if(WEP_CVAR_PRI(WEP_BLASTER, ammo))
                                {
                                        if(fire & 2) // only eat ammo when the button is pressed
                                        {
@@ -223,21 +223,21 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                                                        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
                                                        if(autocvar_g_balance_vortex_reload_ammo)
                                                        {
-                                                               dt = min(dt, (actor.(weaponentity).clip_load - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_SEC(WEP_BLASTER, ammo));
+                                                               dt = min(dt, (actor.(weaponentity).clip_load - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_PRI(WEP_BLASTER, ammo));
                                                                dt = max(0, dt);
                                                                if(dt > 0)
                                                                {
-                                                                       actor.(weaponentity).clip_load = max(WEP_CVAR_SEC(WEP_BLASTER, ammo), actor.(weaponentity).clip_load - WEP_CVAR_SEC(WEP_BLASTER, ammo) * dt);
+                                                                       actor.(weaponentity).clip_load = max(WEP_CVAR_PRI(WEP_BLASTER, ammo), actor.(weaponentity).clip_load - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
                                                                }
                                                                actor.(weaponentity).(weapon_load[WEP_OVERKILL_NEX.m_id]) = actor.(weaponentity).clip_load;
                                                        }
                                                        else
                                                        {
-                                                               dt = min(dt, (actor.(thiswep.ammo_field) - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_SEC(WEP_BLASTER, ammo));
+                                                               dt = min(dt, (actor.(thiswep.ammo_field) - WEP_CVAR_PRI(WEP_OVERKILL_NEX, ammo)) / WEP_CVAR_PRI(WEP_BLASTER, ammo));
                                                                dt = max(0, dt);
                                                                if(dt > 0)
                                                                {
-                                                                       actor.(thiswep.ammo_field) = max(WEP_CVAR_SEC(WEP_BLASTER, ammo), actor.(thiswep.ammo_field) - WEP_CVAR_SEC(WEP_BLASTER, ammo) * dt);
+                                                                       actor.(thiswep.ammo_field) = max(WEP_CVAR_PRI(WEP_BLASTER, ammo), actor.(thiswep.ammo_field) - WEP_CVAR_PRI(WEP_BLASTER, ammo) * dt);
                                                                }
                                                        }
                                                }
@@ -254,10 +254,10 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                }
                else if(WEP_CVAR(WEP_OVERKILL_NEX, secondary))
                {
-                       if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+                       if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                        {
                                W_OverkillNex_Attack(thiswep, actor, weaponentity, 1);
-                               weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+                               weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
                        }
                }
        }
@@ -281,8 +281,8 @@ METHOD(OverkillNex, wr_checkammo2, bool(entity thiswep, entity actor, .entity we
        if (WEP_CVAR(WEP_OVERKILL_NEX, secondary))
        {
                // don't allow charging if we don't have enough ammo
-               float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
-               ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
+               float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
+               ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
                return ammo_amount;
        }
        else
index 327be735455214a986d35b17e870bab4b11151b3..120f6d66dae8d7fcdbeeaae364ff0844b7bf9ab5 100644 (file)
@@ -46,16 +46,16 @@ CLASS(OverkillNex, Weapon)
                P(class, prefix, refire, float, PRI) \
                P(class, prefix, secondary, float, NONE) \
                P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
                P(class, prefix, refire_type, float, SEC) \
        END()
-    W_PROPS(X, OverkillNex, oknex)
+       W_PROPS(X, OverkillNex, oknex)
 #undef X
 
 ENDCLASS(OverkillNex)
index a4bbb3b6db526584d4a1770680c6d41d6842905a..1f87c9d28003698ba15bda413bc3841850202ceb 100644 (file)
@@ -138,9 +138,9 @@ METHOD(OverkillRocketPropelledChainsaw, wr_think, void(entity thiswep, entity ac
        if ((WEP_CVAR_SEC(WEP_OVERKILL_RPC, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
        {
                // Secondary uses it's own refire timer if refire_type is 1.
-               actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+               actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+               W_Blaster_Attack(actor, weaponentity);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -173,13 +173,13 @@ METHOD(OverkillRocketPropelledChainsaw, wr_think, void(entity thiswep, entity ac
        }
        if ((fire & 2) && (WEP_CVAR_SEC(WEP_OVERKILL_RPC, refire_type) == 0)) // Secondary attack
        {
-               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                {
                        return;
                }
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+               W_Blaster_Attack(actor, weaponentity);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
        }
 }
 
@@ -192,8 +192,8 @@ METHOD(OverkillRocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep, enti
 
 METHOD(OverkillRocketPropelledChainsaw, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
 {
-       float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
-       ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
+       float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
+       ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
        return ammo_amount;
 }
 
index 5678bf3edb1f29e694ef18216f369f5c869f0a23..886401002e363d79fcb86edf092bf71426f6e1e8 100644 (file)
@@ -18,9 +18,9 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea
        if ((WEP_CVAR_SEC(WEP_OVERKILL_SHOTGUN, refire_type) == 1) && (fire & 2) && (time >= actor.jump_interval))
        {
                // Secondary uses it's own refire timer if refire_type is 1.
-               actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+               actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+               W_Blaster_Attack(actor, weaponentity);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -66,13 +66,13 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea
        }
        if ((fire & 2) && (WEP_CVAR_SEC(WEP_OVERKILL_SHOTGUN, refire_type) == 0)) // Secondary attack
        {
-               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(WEP_BLASTER, refire)))
+               if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
                {
                        return;
                }
                makevectors(actor.v_angle);
-               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+               W_Blaster_Attack(actor, weaponentity);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
        }
 }
 
index 922076f523ed1fc4dd622439ab33b27e4b18ab1a..3a936a5d844c24ca27f212684e92e9b0f0dd8ae1 100644 (file)
@@ -7,21 +7,20 @@ void W_Blaster_Touch(entity this, entity toucher)
        PROJECTILE_TOUCH(this, toucher);
 
        this.event_damage = func_null;
-       bool isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY);
 
        RadiusDamageForSource(
                this,
                (this.origin + (this.mins + this.maxs) * 0.5),
                this.velocity,
                this.realowner,
-               WEP_CVAR_BOTH(WEP_BLASTER, isprimary, damage),
-               WEP_CVAR_BOTH(WEP_BLASTER, isprimary, edgedamage),
-               WEP_CVAR_BOTH(WEP_BLASTER, isprimary, radius),
+               WEP_CVAR_PRI(WEP_BLASTER, damage),
+               WEP_CVAR_PRI(WEP_BLASTER, edgedamage),
+               WEP_CVAR_PRI(WEP_BLASTER, radius),
                NULL,
                NULL,
                false,
-               WEP_CVAR_BOTH(WEP_BLASTER, isprimary, force),
-               WEP_CVAR_BOTH(WEP_BLASTER, isprimary, force_zscale),
+               WEP_CVAR_PRI(WEP_BLASTER, force),
+               WEP_CVAR_PRI(WEP_BLASTER, force_zscale),
                this.projectiledeathtype,
                this.weaponentity_fld,
                toucher
@@ -34,17 +33,16 @@ void W_Blaster_Think(entity this)
 {
        set_movetype(this, MOVETYPE_FLY);
        setthink(this, SUB_Remove);
-       bool isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY);
-       this.nextthink = time + WEP_CVAR_BOTH(WEP_BLASTER, isprimary, lifetime);
+       this.nextthink = time + WEP_CVAR_PRI(WEP_BLASTER, lifetime);
        CSQCProjectile(this, true, PROJECTILE_BLASTER, true);
 }
 
-void W_Blaster_Attack(entity actor, .entity weaponentity, int atk_deathtype)
+void W_Blaster_Attack(entity actor, .entity weaponentity)
 {
-       bool isprimary = !(atk_deathtype & HITTYPE_SECONDARY);
-       float atk_shotangle_rad = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, shotangle) * DEG2RAD;
-       float atk_damage = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, damage);
-       vector s_forward = v_forward * cos(atk_shotangle_rad) + v_up * sin(atk_shotangle_rad);
+       float atk_shotangle = WEP_CVAR_PRI(WEP_BLASTER, shotangle) * DEG2RAD;
+       float atk_damage = WEP_CVAR_PRI(WEP_BLASTER, damage);
+       vector s_forward = v_forward * cos(atk_shotangle) + v_up * sin(atk_shotangle);
+       int atk_deathtype = WEP_BLASTER.m_id;
 
        W_SetupShot_Dir(actor, weaponentity, s_forward, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, atk_damage, atk_deathtype);
        W_MuzzleFlash(WEP_BLASTER, actor, weaponentity, w_shotorg, w_shotdir);
@@ -58,8 +56,8 @@ void W_Blaster_Attack(entity actor, .entity weaponentity, int atk_deathtype)
        setorigin(missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
-       float atk_speed = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, speed);
-       float atk_spread = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, spread);
+       float atk_speed = WEP_CVAR_PRI(WEP_BLASTER, speed);
+       float atk_spread = WEP_CVAR_PRI(WEP_BLASTER, spread);
        W_SetupProjVelocity_Explicit(missile, w_shotdir, v_up, atk_speed, 0, 0, atk_spread, false);
 
        missile.angles = vectoangles(missile.velocity);
@@ -75,7 +73,7 @@ void W_Blaster_Attack(entity actor, .entity weaponentity, int atk_deathtype)
        missile.projectiledeathtype = atk_deathtype;
        missile.weaponentity_fld = weaponentity;
        setthink(missile, W_Blaster_Think);
-       missile.nextthink = time + WEP_CVAR_BOTH(WEP_BLASTER, isprimary, delay);
+       missile.nextthink = time + WEP_CVAR_PRI(WEP_BLASTER, delay);
 
        MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 
@@ -87,70 +85,45 @@ void W_Blaster_Attack(entity actor, .entity weaponentity, int atk_deathtype)
 
 METHOD(Blaster, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    if(WEP_CVAR(WEP_BLASTER, secondary))
-    {
-        if((random() * (WEP_CVAR_PRI(WEP_BLASTER, damage) + WEP_CVAR_SEC(WEP_BLASTER, damage))) > WEP_CVAR_PRI(WEP_BLASTER, damage))
-            { PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(WEP_BLASTER, speed), 0, WEP_CVAR_SEC(WEP_BLASTER, lifetime), false, true); }
-        else
-            { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_BLASTER, speed), 0, WEP_CVAR_PRI(WEP_BLASTER, lifetime), false, true); }
-    }
-    else
-        { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_BLASTER, speed), 0, WEP_CVAR_PRI(WEP_BLASTER, lifetime), false, true); }
+       PHYS_INPUT_BUTTON_ATCK(actor) =
+               bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_BLASTER, speed), 0, WEP_CVAR_PRI(WEP_BLASTER, lifetime), false, true);
 }
 
 METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
 {
-    if(fire & 1)
-    {
-        if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
-        {
-            W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id);
-            weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
-        }
-    }
-    else if(fire & 2)
-    {
-        switch(WEP_CVAR(WEP_BLASTER, secondary))
-        {
-            case 0: // switch to last used weapon
-            {
-                if(actor.(weaponentity).m_switchweapon == WEP_BLASTER) // don't do this if already switching
-                    W_LastWeapon(actor, weaponentity);
-                break;
-            }
-
-            case 1: // normal projectile secondary
-            {
-                if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_BLASTER, refire)))
-                {
-                    W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
-                    weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
-                }
-
-                break;
-            }
-        }
-    }
+       if(fire & 1)
+       {
+               if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_BLASTER, refire)))
+               {
+                       W_Blaster_Attack(actor, weaponentity);
+                       weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
+               }
+       }
+       else if(fire & 2)
+       {
+               if(actor.(weaponentity).m_switchweapon == WEP_BLASTER) // don't do this if already switching
+                       W_LastWeapon(actor, weaponentity);
+       }
 }
 
 METHOD(Blaster, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
 {
-    return true; // infinite ammo
+       return true; // infinite ammo
 }
 
 METHOD(Blaster, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
 {
-    return true; // blaster has infinite ammo
+       return true; // blaster has infinite ammo
 }
 
 METHOD(Blaster, wr_suicidemessage, Notification(entity thiswep))
 {
-    return WEAPON_BLASTER_SUICIDE;
+       return WEAPON_BLASTER_SUICIDE;
 }
 
 METHOD(Blaster, wr_killmessage, Notification(entity thiswep))
 {
-    return WEAPON_BLASTER_MURDER;
+       return WEAPON_BLASTER_MURDER;
 }
 
 METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bool key_pressed))
@@ -159,10 +132,10 @@ METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bo
        {
                return;
        }
-       actor.jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+       actor.jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
        .entity weaponentity = weaponentities[1];
        makevectors(actor.v_angle);
-       W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+       W_Blaster_Attack(actor, weaponentity);
 }
 
 #endif
@@ -170,9 +143,9 @@ METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bo
 
 METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2 = w_org + w_backoff * 2;
-    pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
-    if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
+       vector org2 = w_org + w_backoff * 2;
+       pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
+       if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
 }
 
 #endif
index 23e147478e43abb4e81cf4a3f7b6587123a1373e..27709310ead3b66bad7497a4e5f0f299d9bd3ea6 100644 (file)
@@ -22,25 +22,24 @@ CLASS(Blaster, Weapon)
 
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, delay, float, BOTH) \
-               P(class, prefix, edgedamage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, force_zscale, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, radius, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, shotangle, float, BOTH) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, spread, float, BOTH) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, animtime, float, PRI) \
+               P(class, prefix, damage, float, PRI) \
+               P(class, prefix, delay, float, PRI) \
+               P(class, prefix, edgedamage, float, PRI) \
+               P(class, prefix, force, float, PRI) \
+               P(class, prefix, force_zscale, float, PRI) \
+               P(class, prefix, lifetime, float, PRI) \
+               P(class, prefix, radius, float, PRI) \
+               P(class, prefix, refire, float, PRI) \
+               P(class, prefix, shotangle, float, PRI) \
+               P(class, prefix, speed, float, PRI) \
+               P(class, prefix, spread, float, PRI) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
                P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
        END()
        W_PROPS(X, Blaster, blaster)
 #undef X
index 633ed64e09d772f4eeffa352d8736de7773f8a1e..8a82bba56cb54d11f25d1432ea398591e0900b49 100644 (file)
@@ -249,13 +249,13 @@ METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor, .entity weaponentit
     if((actor.items & IT_UNLIMITED_AMMO) || GetResource(actor, thiswep.ammo_type) > 0)
         PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 1, false, true);
     else
-        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(WEP_BLASTER, speed), 0, WEP_CVAR_SEC(WEP_BLASTER, lifetime), false, true); // WEAPONTODO: replace with proper vaporizer cvars
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_BLASTER, speed), 0, WEP_CVAR_PRI(WEP_BLASTER, lifetime), false, true);
 }
 METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     float vaporizer_ammo = ((autocvar_g_instagib) ? 1 : WEP_CVAR_PRI(WEP_VAPORIZER, ammo));
     // if the laser uses load, we also consider its ammo for reloading
-    if(WEP_CVAR(WEP_VAPORIZER, reload_ammo) && WEP_CVAR_SEC(WEP_BLASTER, ammo) && actor.(weaponentity).clip_load < min(vaporizer_ammo, WEP_CVAR_SEC(WEP_BLASTER, ammo))) { // forced reload
+    if(WEP_CVAR(WEP_VAPORIZER, reload_ammo) && WEP_CVAR_PRI(WEP_BLASTER, ammo) && actor.(weaponentity).clip_load < min(vaporizer_ammo, WEP_CVAR_PRI(WEP_BLASTER, ammo))) { // forced reload
         thiswep.wr_reload(thiswep, actor, weaponentity);
         actor.(weaponentity).hagar_load = false; // rocket minsta exclusive var
         return;
@@ -298,17 +298,17 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent
         else if (actor.(weaponentity).jump_interval <= time)
         {
             // handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib)
-            actor.(weaponentity).jump_interval = time + WEP_CVAR_SEC(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
+            actor.(weaponentity).jump_interval = time + WEP_CVAR_PRI(WEP_BLASTER, refire) * W_WeaponRateFactor(actor);
 
             // decrease ammo for the laser?
-            if(WEP_CVAR_SEC(WEP_BLASTER, ammo))
-                W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(WEP_BLASTER, ammo), weaponentity);
+            if(WEP_CVAR_PRI(WEP_BLASTER, ammo))
+                W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(WEP_BLASTER, ammo), weaponentity);
 
             makevectors(actor.v_angle);
-            W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+            W_Blaster_Attack(actor, weaponentity);
 
             // now do normal refire
-            weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_BLASTER, animtime), w_ready);
+            weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_PRI(WEP_BLASTER, animtime), w_ready);
         }
     }
     else
@@ -327,10 +327,10 @@ METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor, .entity weap
 }
 METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
 {
-    if(!WEP_CVAR_SEC(WEP_BLASTER, ammo))
+    if(!WEP_CVAR_PRI(WEP_BLASTER, ammo))
         return true;
-    float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
-    ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(WEP_BLASTER, ammo);
+    float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
+    ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(WEP_BLASTER, ammo);
     return ammo_amount;
 }
 METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor))
@@ -341,8 +341,8 @@ METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponen
 {
     float vaporizer_ammo = ((autocvar_g_instagib) ? 1 : WEP_CVAR_PRI(WEP_VAPORIZER, ammo));
     float used_ammo;
-    if(WEP_CVAR_SEC(WEP_BLASTER, ammo))
-        used_ammo = min(vaporizer_ammo, WEP_CVAR_SEC(WEP_BLASTER, ammo));
+    if(WEP_CVAR_PRI(WEP_BLASTER, ammo))
+        used_ammo = min(vaporizer_ammo, WEP_CVAR_PRI(WEP_BLASTER, ammo));
     else
         used_ammo = vaporizer_ammo;