]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Opt-in cvar to block shotgun melee directly after a shot
authorDr. Jaska <drjaska83@gmail.com>
Tue, 3 Sep 2024 10:56:35 +0000 (10:56 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Tue, 3 Sep 2024 10:56:35 +0000 (10:56 +0000)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh

index c6b10f072fbb264daf79dac327f5ec03d0669189..957ee37689c7c0358f2aa02df80a93eedab37bb7 100644 (file)
@@ -41,6 +41,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
+set g_balance_shotgun_secondary_melee_blockedbyfiring 0
 set g_balance_shotgun_secondary_melee_delay 0.25
 set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
index ec98688d808934583cdbe5de65cb996ada6ab8e4..ac49e46179a18335f7fac70d58a2bd4ed20f4215 100644 (file)
@@ -41,6 +41,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 80
 set g_balance_shotgun_secondary_force 200
+set g_balance_shotgun_secondary_melee_blockedbyfiring 0
 set g_balance_shotgun_secondary_melee_delay 0.25
 set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
index 60020faa8498693d2a2baa43770459120b430f47..53d2c7dbb5efbdc071a105bf7ff1694e6bb5ef6d 100644 (file)
@@ -41,6 +41,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 80
 set g_balance_shotgun_secondary_force 200
+set g_balance_shotgun_secondary_melee_blockedbyfiring 0
 set g_balance_shotgun_secondary_melee_delay 0.25
 set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
index 268da517be1b45d36ca72342444fc15512d897fb..8e22f7b5b073d7acb36b4d92f96ed217693e47ad 100644 (file)
@@ -41,6 +41,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
+set g_balance_shotgun_secondary_melee_blockedbyfiring 0
 set g_balance_shotgun_secondary_melee_delay 0.25
 set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
index 888ae196aefddedc21cb0f0e3296d7becdee63cf..07a6fc0d0337d3c5234226472b7c3bb9366fdb36 100644 (file)
@@ -41,6 +41,7 @@ set g_balance_shotgun_secondary_alt_refire 1.2
 set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
+set g_balance_shotgun_secondary_melee_blockedbyfiring 0
 set g_balance_shotgun_secondary_melee_delay 0.25
 set g_balance_shotgun_secondary_melee_multihit 1
 set g_balance_shotgun_secondary_melee_no_doubleslap 1
index 8bd7efe317c5a7d32e1894b00330dfffbeb244a9..18259a3a8269cdb327e732dbbce170af0d298029 100644 (file)
@@ -319,6 +319,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
     if(actor.(weaponentity).clip_load >= 0) // we are not currently reloading
     if(WEP_CVAR(WEP_SHOTGUN, secondary) == 1)
     if(((fire & 1) && !IS_BOT_CLIENT(actor) && GetResource(actor, thiswep.ammo_type) <= 0 && actor.(weaponentity).clip_load == 0 && !(actor.items & IT_UNLIMITED_AMMO)) || (fire & 2))
+    if(!WEP_CVAR_SEC(WEP_SHOTGUN, melee_blockedbyfiring) || time >= actor.(weaponentity).shotgun_primarytime)
     if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_SHOTGUN, refire)))
     {
         // melee attack
index 13cf944c3ba9daccd1eb66960f4b3436609ee7bd..be6121690df3860d2f8638d9f030ed80501ba95e 100644 (file)
@@ -32,6 +32,7 @@ CLASS(Shotgun, Weapon)
                P(class, prefix, damagefalloff_maxdist, float, PRI) \
                P(class, prefix, damagefalloff_mindist, float, PRI) \
                P(class, prefix, force, float, BOTH) \
+               P(class, prefix, melee_blockedbyfiring, bool, SEC) \
                P(class, prefix, melee_delay, float, SEC) \
                P(class, prefix, melee_multihit, float, SEC) \
                P(class, prefix, melee_nonplayerdamage, float, SEC) \