- // 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";
+
+ // Only first orb explosion uses midaircombo_speed, others use the normal combo_speed.
+ // This allows to avoid the delay on the first explosion which looks better
+ // (the bolt and orb should explode together because they interacted together)
+ // while keeping the chaining delay.
+ setthink(e, W_Electro_ExplodeCombo);
+ float delay = 0;
+ if (WEP_CVAR_PRI(electro, midaircombo_speed))
+ delay = vlen(e.WarpZone_findradius_dist) / WEP_CVAR_PRI(electro, midaircombo_speed);
+ e.nextthink = time + delay;
+
+ ++found;
+ }