From: Dr. Jaska Date: Tue, 3 Sep 2024 10:56:35 +0000 (+0000) Subject: Opt-in cvar to block shotgun melee directly after a shot X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bf1d2b15aaeceb975e0ff775d69b60e061365178;p=xonotic%2Fxonotic-data.pk3dir.git Opt-in cvar to block shotgun melee directly after a shot --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index c6b10f072..957ee3768 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -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 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index ec98688d8..ac49e4617 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -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 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 60020faa8..53d2c7dbb 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -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 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 268da517b..8e22f7b5b 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -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 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 888ae196a..07a6fc0d0 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -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 diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 8bd7efe31..18259a3a8 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -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 diff --git a/qcsrc/common/weapons/weapon/shotgun.qh b/qcsrc/common/weapons/weapon/shotgun.qh index 13cf944c3..be6121690 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qh +++ b/qcsrc/common/weapons/weapon/shotgun.qh @@ -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) \