From: terencehill Date: Tue, 8 Oct 2024 21:58:44 +0000 (+0200) Subject: Electro combo over time: repeat explosion effect every x seconds (0.75s for g_balance... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bcbbeb9473f31eb9778ea1a48d55842d301aefdd;p=xonotic%2Fxonotic-data.pk3dir.git Electro combo over time: repeat explosion effect every x seconds (0.75s for g_balance_electro_combo_duration 1.5) --- diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 594c39289..66ea172dc 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -51,6 +51,8 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own) } } +float ExplodeOverTime_eff_interval; +.float ltime2; void W_Electro_ExplodeComboThink(entity this) { if(time >= this.ltime) @@ -64,6 +66,17 @@ void W_Electro_ExplodeComboThink(entity this) float damage = WEP_CVAR(WEP_ELECTRO, combo_damage) * PHYS_INPUT_TIMELENGTH; float edgedamage = WEP_CVAR(WEP_ELECTRO, combo_edgedamage) * PHYS_INPUT_TIMELENGTH; + if (time > this.ltime2) // show explosion effect every ExplodeOverTime_eff_interval seconds + { + this.projectiledeathtype &= ~HITTYPE_SPAM; + if (!this.ltime2) + { + ExplodeOverTime_eff_interval = (this.ltime - time) / ceil(((this.ltime - time) + 0.01) / 0.9); + this.ltime2 = time + ExplodeOverTime_eff_interval; + } + else + this.ltime2 += ExplodeOverTime_eff_interval; + } RadiusDamage(this, this.realowner, damage, edgedamage, WEP_CVAR(WEP_ELECTRO, combo_radius), NULL, NULL, 0, this.projectiledeathtype, this.weaponentity_fld, NULL); this.projectiledeathtype |= HITTYPE_SPAM; // ensure it doesn't spam its effect }