From: Mario Date: Thu, 8 Oct 2020 04:03:06 +0000 (+1000) Subject: Fix Arc bolts bouncing more times than they're supposed to, rename the bounce_damage... X-Git-Tag: xonotic-v0.8.5~686^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86ffc5c159e147eed742ec9169c37cbf137df852;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 218a807bb..640ce2720 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 2f68b17cb..1cbfe88e9 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 bb231b685..055afcc2a 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 7f6237e37..a1fea0c38 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 69715d558..647fb2290 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 2f9b84ed5..44fd539be 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 ec15d8db7..6db349889 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 2b6239ae1..e52012ced 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