]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
more midair combo options: own/teammate/enemy
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index 2ba6b5da18628bc669f6de77668c32c23738ea11..c1709322e44b14f30b2e84898efdb785ea213d21 100644 (file)
@@ -154,27 +154,33 @@ void W_Electro_Bolt_Think(entity this)
                {
                        if(e.classname == "electro_orb")
                        {
-                               // 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
-                                               )
-                                       );
-
-                               ++found;
+                               bool explode;
+                               if (this.owner == e.owner)
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_own);
+                               }
+                               else if (SAME_TEAM(this.owner, e.owner))
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_teammate);
+                               }
+                               else
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_enemy);
+                               }
+
+                               if (explode)
+                               {
+                                       // change owner to whoever caused the combo explosion
+                                       e.realowner = this.realowner;
+                                       e.takedamage = DAMAGE_NO;
+                                       e.classname = "electro_orb_chain";
+
+                                       // explode first orb immediately, other orbs will chain with delay
+                                       setthink(e, W_Electro_ExplodeCombo);
+                                       e.nextthink = time;
+
+                                       ++found;
+                               }
                        }
                        e = e.chain;
                }