WIP: electro: allow midair combos to only affect enemy orbs
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 10 Jan 2020 22:03:51 +0000 (23:03 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 10 Jan 2020 22:03:51 +0000 (23:03 +0100)
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh

index 2ba6b5da18628bc669f6de77668c32c23738ea11..85f2df77a8e7cc01e3eeb8f291610240095596bc 100644 (file)
@@ -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;
                        }
index 7dbed189b095e297a6a2805f1df2dda980c36045..460301829892c08ca6fa8a592fbc81d36d4d472d 100644 (file)
@@ -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) \