]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove blaster secondary attack. Share blaster primary settings with all weapons... terencehill/blaster_attack_shared 1282/head
authorterencehill <piuntn@gmail.com>
Sat, 18 May 2024 13:41:55 +0000 (15:41 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 18 May 2024 13:54:47 +0000 (15:54 +0200)
14 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/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 1e2e782ec0b24d48a5100a973a671c0156ff7001..efe16a5ac30530077950eaf2bbd0608f63494df4 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 2272b1f61b7511e011bd8638b912687befc9ae95..ce2b6605869c4029373ff3f6801102fcca675b61 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 c56eaf2d6798bfbada1aba03a12a3584820b719d..b92e1fabb4fa9d9eb2185a84aba2f1e55ef32cf4 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 0795cc7483b3950c3e6dc17f4657fddea3752e9e..d64903b8f887a06ef4490114fd0903ad8c287ce0 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 95205ddae678fda1fae84ae22ec4466e4e30ecff..e8a08ae1089aaf173084d6a920f93e16ddad23b7 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 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 ad192914b20abe7e09e81e915d30c16aedae4df2..7ba63943cbe89e4be7ac00789a48d791b746bf78 100644 (file)
@@ -57,9 +57,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))
                {
@@ -92,13 +92,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 a6db984c276eb57a841cabefffed2ac6d7378e2c..5fd3de129000e8280d40f0b8baa2f368aa8dd251 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))
                {
@@ -60,13 +60,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 13e31cd7d366ba5a8fe6fc881267b085579d7948..ccc20c179f57683feab832bde77a9e402998b78e 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 = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, shotangle);
-       float atk_damage = WEP_CVAR_BOTH(WEP_BLASTER, isprimary, damage);
+       float atk_shotangle = WEP_CVAR_PRI(WEP_BLASTER, shotangle);
+       float atk_damage = WEP_CVAR_PRI(WEP_BLASTER, damage);
        vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD);
+       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 8b634c41d6365a6ce622da44dbb54c08629d0ce6..ec7ccbd43b1f4e92c577c17243ae2b945c7e084c 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;