From: Martin Taibr Date: Fri, 10 Jan 2020 22:03:51 +0000 (+0100) Subject: WIP: electro: allow midair combos to only affect enemy orbs X-Git-Tag: xonotic-v0.8.5~1161^2~11^2~5 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=2d954357627e3225a65447deaf8de28dc908dea7 WIP: electro: allow midair combos to only affect enemy orbs --- diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 2ba6b5da18..85f2df77a8 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -152,27 +152,15 @@ void W_Electro_Bolt_Think(entity this) // loop through nearby orbs and trigger them while(e) { - if(e.classname == "electro_orb") + if(e.classname == "electro_orb" && (WEP_CVAR_PRI(electro, midaircombo_own) || DIFF_TEAM(this.owner, e.owner))) { // change owner to whoever caused the combo explosion e.realowner = this.realowner; e.takedamage = DAMAGE_NO; e.classname = "electro_orb_chain"; - // now set the next one to trigger as well - setthink(e, W_Electro_ExplodeCombo); - - // delay combo chains, looks cooler - e.nextthink = - ( - time - + - (WEP_CVAR(electro, combo_speed) ? - (vlen(e.WarpZone_findradius_dist) / WEP_CVAR(electro, combo_speed)) - : - 0 - ) - ); + // explode first orb immediately, other orbs will chain with delay + W_Electro_ExplodeCombo(e); ++found; } diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 7dbed189b0..4603018298 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -42,6 +42,7 @@ CLASS(Electro, Weapon) P(class, prefix, lifetime, float, BOTH) \ P(class, prefix, midaircombo_explode, float, PRI) \ P(class, prefix, midaircombo_interval, float, PRI) \ + P(class, prefix, midaircombo_own, bool, PRI) \ P(class, prefix, midaircombo_radius, float, PRI) \ P(class, prefix, radius, float, BOTH) \ P(class, prefix, refire2, float, SEC) \