From 86ffc5c159e147eed742ec9169c37cbf137df852 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Oct 2020 14:03:06 +1000 Subject: [PATCH] Fix Arc bolts bouncing more times than they're supposed to, rename the bounce_damage cvar to bounce_explode so as to not confuse it with a damage setting --- bal-wep-mario.cfg | 2 +- bal-wep-nexuiz25.cfg | 2 +- bal-wep-samual.cfg | 2 +- bal-wep-xdf.cfg | 2 +- bal-wep-xonotic.cfg | 2 +- qcsrc/common/weapons/weapon/arc.qc | 11 +++++------ qcsrc/common/weapons/weapon/arc.qh | 2 +- testing.cfg | 4 ++-- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 218a807bb8..640ce27209 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -764,7 +764,7 @@ set g_balance_arc_beam_tightness 0.6 set g_balance_arc_bolt 1 set g_balance_arc_bolt_ammo 1 set g_balance_arc_bolt_bounce_count 0 -set g_balance_arc_bolt_bounce_damage 0 +set g_balance_arc_bolt_bounce_explode 0 set g_balance_arc_bolt_bounce_lifetime 0 set g_balance_arc_bolt_count 1 set g_balance_arc_bolt_damage 25 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 2f68b17cbb..1cbfe88e98 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -764,7 +764,7 @@ set g_balance_arc_beam_tightness 0.5 set g_balance_arc_bolt 0 set g_balance_arc_bolt_ammo 1 set g_balance_arc_bolt_bounce_count 0 -set g_balance_arc_bolt_bounce_damage 0 +set g_balance_arc_bolt_bounce_explode 0 set g_balance_arc_bolt_bounce_lifetime 0 set g_balance_arc_bolt_count 1 set g_balance_arc_bolt_damage 25 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index bb231b6855..055afcc2a3 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -764,7 +764,7 @@ set g_balance_arc_beam_tightness 0.5 set g_balance_arc_bolt 0 set g_balance_arc_bolt_ammo 1 set g_balance_arc_bolt_bounce_count 0 -set g_balance_arc_bolt_bounce_damage 0 +set g_balance_arc_bolt_bounce_explode 0 set g_balance_arc_bolt_bounce_lifetime 0 set g_balance_arc_bolt_count 1 set g_balance_arc_bolt_damage 25 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 7f6237e377..a1fea0c387 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -764,7 +764,7 @@ set g_balance_arc_beam_tightness 0.5 set g_balance_arc_bolt 1 set g_balance_arc_bolt_ammo 1 set g_balance_arc_bolt_bounce_count 0 -set g_balance_arc_bolt_bounce_damage 0 +set g_balance_arc_bolt_bounce_explode 0 set g_balance_arc_bolt_bounce_lifetime 0 set g_balance_arc_bolt_count 1 set g_balance_arc_bolt_damage 25 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 69715d5583..647fb22907 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -764,7 +764,7 @@ set g_balance_arc_beam_tightness 0.6 set g_balance_arc_bolt 1 set g_balance_arc_bolt_ammo 1 set g_balance_arc_bolt_bounce_count 0 -set g_balance_arc_bolt_bounce_damage 0 +set g_balance_arc_bolt_bounce_explode 0 set g_balance_arc_bolt_bounce_lifetime 0 set g_balance_arc_bolt_count 1 set g_balance_arc_bolt_damage 25 diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 2f9b84ed55..44fd539beb 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -118,19 +118,18 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam void W_Arc_Bolt_Touch(entity this, entity toucher) { PROJECTILE_TOUCH(this, toucher); - if(this.cnt > WEP_CVAR(arc, bolt_bounce_count) || !WEP_CVAR(arc, bolt_bounce_count) || toucher.takedamage == DAMAGE_AIM) { + if(this.cnt >= WEP_CVAR(arc, bolt_bounce_count) || !WEP_CVAR(arc, bolt_bounce_count) || toucher.takedamage == DAMAGE_AIM) { this.use(this, NULL, toucher); } else { - if(!this.cnt && WEP_CVAR(arc, bolt_bounce_lifetime)) - this.nextthink = min(this.nextthink, time + WEP_CVAR(arc, bolt_bounce_lifetime)); this.cnt++; Send_Effect(EFFECT_BALL_SPARKS, this.origin, this.velocity, 1); this.angles = vectoangles(this.velocity); this.owner = NULL; - // initial blast doesn't count as bounce damage! - if(WEP_CVAR(arc, bolt_bounce_damage)) - RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, this.weaponentity_fld, toucher); this.projectiledeathtype |= HITTYPE_BOUNCE; + if(WEP_CVAR(arc, bolt_bounce_explode)) + RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, this.weaponentity_fld, toucher); + if(this.cnt == 1 && WEP_CVAR(arc, bolt_bounce_lifetime)) + this.nextthink = time + WEP_CVAR(arc, bolt_bounce_lifetime); } } diff --git a/qcsrc/common/weapons/weapon/arc.qh b/qcsrc/common/weapons/weapon/arc.qh index ec15d8db7e..6db349889b 100644 --- a/qcsrc/common/weapons/weapon/arc.qh +++ b/qcsrc/common/weapons/weapon/arc.qh @@ -24,7 +24,7 @@ CLASS(Arc, Weapon) P(class, prefix, bolt, float, NONE) \ P(class, prefix, bolt_ammo, float, NONE) \ P(class, prefix, bolt_bounce_count, float, NONE) \ - P(class, prefix, bolt_bounce_damage, float, NONE) \ + P(class, prefix, bolt_bounce_explode, float, NONE) \ P(class, prefix, bolt_bounce_lifetime, float, NONE) \ P(class, prefix, bolt_count, float, NONE) \ P(class, prefix, bolt_damageforcescale, float, NONE) \ diff --git a/testing.cfg b/testing.cfg index 2b6239ae1a..e52012cede 100644 --- a/testing.cfg +++ b/testing.cfg @@ -6,8 +6,8 @@ alias test_crylink_sec_horizontal "settemp g_balance_crylink_secondary_linkexplo alias test_rocket_flying "settemp g_balance_devastator_remote_jump 1" -alias test_arc_bounce "settemp g_balance_arc_bolt_bounce_count 1 ; settemp g_balance_arc_bolt_bounce_lifetime 0.5 ; settemp g_balance_arc_bolt_bounce_damage 1 ; settemp g_balance_arc_bolt_ammo 2" -alias test_arc_bounce_burst "settemp g_balance_arc_bolt_bounce_count 1 ; settemp g_balance_arc_bolt_bounce_lifetime 0.5 ; settemp g_balance_arc_bolt_bounce_damage 1 ; settemp g_balance_arc_bolt_ammo 3 ; settemp g_balance_arc_bolt_refire2 0.33333 ; settemp g_balance_arc_bolt_count 3" +alias test_arc_bounce "settemp g_balance_arc_bolt_bounce_count 1 ; settemp g_balance_arc_bolt_bounce_lifetime 0.5 ; settemp g_balance_arc_bolt_bounce_explode 1 ; settemp g_balance_arc_bolt_ammo 2" +alias test_arc_bounce_burst "settemp g_balance_arc_bolt_bounce_count 1 ; settemp g_balance_arc_bolt_bounce_lifetime 0.5 ; settemp g_balance_arc_bolt_bounce_explode 1 ; settemp g_balance_arc_bolt_ammo 3 ; settemp g_balance_arc_bolt_refire2 0.33333 ; settemp g_balance_arc_bolt_count 3" // https://forums.xonotic.org/showthread.php?tid=8192 // https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/736 -- 2.39.2