From 62363c0849f4bdfd931041764d78b40b2ddfcea3 Mon Sep 17 00:00:00 2001 From: "Dr. Jaska" Date: Thu, 28 Nov 2024 15:15:08 +0000 Subject: [PATCH] q3compat: New Devastator cvar for mimicking q3df rl's horizontal force 1.2x multiplier --- bal-wep-mario.cfg | 1 + bal-wep-nexuiz25.cfg | 1 + bal-wep-samual.cfg | 1 + bal-wep-xdf.cfg | 1 + bal-wep-xonotic.cfg | 1 + qcsrc/common/weapons/weapon/blaster.qc | 5 ++++- qcsrc/common/weapons/weapon/devastator.qc | 10 +++++++++- qcsrc/common/weapons/weapon/devastator.qh | 1 + qcsrc/server/damage.qc | 15 +++++++++------ qcsrc/server/damage.qh | 2 +- 10 files changed, 29 insertions(+), 9 deletions(-) diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 6a2462d33..9352a924d 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1 set g_balance_devastator_detonatedelay 0.02 set g_balance_devastator_edgedamage 40 set g_balance_devastator_force 400 +set g_balance_devastator_force_xyscale 1 set g_balance_devastator_guidedelay 0.2 set g_balance_devastator_guidegoal 512 set g_balance_devastator_guiderate 90 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index bfd58cf17..3d2343254 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 4 set g_balance_devastator_detonatedelay 0.2 set g_balance_devastator_edgedamage 40 set g_balance_devastator_force 600 +set g_balance_devastator_force_xyscale 1 set g_balance_devastator_guidedelay 0.15 set g_balance_devastator_guidegoal 512 set g_balance_devastator_guiderate 90 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index dd555810a..4e1d63cbe 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1 set g_balance_devastator_detonatedelay 0.02 set g_balance_devastator_edgedamage 35 set g_balance_devastator_force 450 +set g_balance_devastator_force_xyscale 1 set g_balance_devastator_guidedelay 0.2 set g_balance_devastator_guidegoal 512 set g_balance_devastator_guiderate 70 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 0782260f4..6f9f7f22e 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 0 set g_balance_devastator_detonatedelay 999 set g_balance_devastator_edgedamage 40 set g_balance_devastator_force 350 +set g_balance_devastator_force_xyscale 1 set g_balance_devastator_guidedelay 0.2 set g_balance_devastator_guidegoal 512 set g_balance_devastator_guiderate 0 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index e049ad22b..76a0a408d 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -394,6 +394,7 @@ set g_balance_devastator_damageforcescale 1 set g_balance_devastator_detonatedelay 0.02 set g_balance_devastator_edgedamage 40 set g_balance_devastator_force 400 +set g_balance_devastator_force_xyscale 1 set g_balance_devastator_guidedelay 0.2 set g_balance_devastator_guidegoal 512 set g_balance_devastator_guiderate 90 diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 3a936a5d8..63e735b3b 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -8,6 +8,9 @@ void W_Blaster_Touch(entity this, entity toucher) this.event_damage = func_null; + vector force_xyzscale = '1 1 1'; + force_xyzscale.z = WEP_CVAR_PRI(WEP_BLASTER, force_zscale); + RadiusDamageForSource( this, (this.origin + (this.mins + this.maxs) * 0.5), @@ -20,7 +23,7 @@ void W_Blaster_Touch(entity this, entity toucher) NULL, false, WEP_CVAR_PRI(WEP_BLASTER, force), - WEP_CVAR_PRI(WEP_BLASTER, force_zscale), + force_xyzscale, this.projectiledeathtype, this.weaponentity_fld, toucher diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 150e1b043..d85cd4634 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -28,15 +28,23 @@ void W_Devastator_Explode(entity this, entity directhitentity) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - RadiusDamage( + vector force_xyzscale = '1 1 1'; + force_xyzscale.x = WEP_CVAR(WEP_DEVASTATOR, force_xyscale); + force_xyzscale.y = WEP_CVAR(WEP_DEVASTATOR, force_xyscale); + + RadiusDamageForSource( this, + this.origin, + this.velocity, this.realowner, WEP_CVAR(WEP_DEVASTATOR, damage), WEP_CVAR(WEP_DEVASTATOR, edgedamage), WEP_CVAR(WEP_DEVASTATOR, radius), NULL, NULL, + false, WEP_CVAR(WEP_DEVASTATOR, force), + force_xyzscale, this.projectiledeathtype, this.weaponentity_fld, directhitentity diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 01f3b59f3..1d3261f42 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -29,6 +29,7 @@ CLASS(Devastator, Weapon) P(class, prefix, detonatedelay, float, NONE) \ P(class, prefix, edgedamage, float, NONE) \ P(class, prefix, force, float, NONE) \ + P(class, prefix, force_xyscale, float, NONE) \ P(class, prefix, guidedelay, float, NONE) \ P(class, prefix, guidegoal, float, NONE) \ P(class, prefix, guideratedelay, float, NONE) \ diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index b681ff54d..8b2af78f2 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -893,7 +893,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de // Returns total damage applies to creatures float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, - float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity) + float inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype, .entity weaponentity, entity directhitentity) { entity targ; vector force; @@ -1024,10 +1024,13 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in force = force * (finaldmg / max(coredamage, edgedamage)) * forceintensity; hitloc = nearest; - // apply special scaling along the z axis if set - // NOTE: 0 value is not allowed for compatibility, in the case of weapon cvars not being set - if(forcezscale) - force.z *= forcezscale; + // apply special force scalings + if(forcexyzscale.x) + force.x *= forcexyzscale.x; + if(forcexyzscale.y) + force.y *= forcexyzscale.y; + if(forcexyzscale.z) + force.z *= forcexyzscale.z; if(targ != directhitentity) { @@ -1132,7 +1135,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity) { return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, - cantbe, mustbe, false, forceintensity, 1, deathtype, weaponentity, directhitentity); + cantbe, mustbe, false, forceintensity, '1 1 1', deathtype, weaponentity, directhitentity); } bool Heal(entity targ, entity inflictor, float amount, float limit) diff --git a/qcsrc/server/damage.qh b/qcsrc/server/damage.qh index 06948528f..bd9e10f97 100644 --- a/qcsrc/server/damage.qh +++ b/qcsrc/server/damage.qh @@ -132,7 +132,7 @@ int autocvar_g_player_damageplayercenter; void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force); float RadiusDamage_running; -float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity); +float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype, .entity weaponentity, entity directhitentity); // Returns total damage applies to creatures float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity); -- 2.39.2