From: Mario Date: Thu, 1 Aug 2024 04:38:14 +0000 (+1000) Subject: Refactor combos over time to apply every frame instead of by a set interval X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d171d3b901ea70628189b179ed7a6395a09581a;p=xonotic%2Fxonotic-data.pk3dir.git Refactor combos over time to apply every frame instead of by a set interval --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 1e33c0332..2858bde44 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -189,7 +189,6 @@ set g_balance_minelayer_weaponthrowable 1 set g_balance_electro_combo_comboradius 300 set g_balance_electro_combo_comboradius_thruwall 200 set g_balance_electro_combo_damage 50 -set g_balance_electro_combo_damage_interval 0.05 set g_balance_electro_combo_duration 1.5 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 0 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 42c60d205..ebc38b58c 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -189,7 +189,6 @@ set g_balance_minelayer_weaponthrowable 1 set g_balance_electro_combo_comboradius 0 set g_balance_electro_combo_comboradius_thruwall 0 set g_balance_electro_combo_damage 80 -set g_balance_electro_combo_damage_interval 0.05 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 0 set g_balance_electro_combo_force 200 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 80a90339b..f6168e334 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -189,7 +189,6 @@ set g_balance_minelayer_weaponthrowable 1 set g_balance_electro_combo_comboradius 300 set g_balance_electro_combo_comboradius_thruwall 200 set g_balance_electro_combo_damage 50 -set g_balance_electro_combo_damage_interval 0.05 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index b0f3c6265..8d79b1898 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -189,7 +189,6 @@ set g_balance_minelayer_weaponthrowable 1 set g_balance_electro_combo_comboradius 275 set g_balance_electro_combo_comboradius_thruwall 200 set g_balance_electro_combo_damage 50 -set g_balance_electro_combo_damage_interval 0.05 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index e3e7fbd90..0f0948420 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -189,7 +189,6 @@ set g_balance_minelayer_weaponthrowable 1 set g_balance_electro_combo_comboradius 300 set g_balance_electro_combo_comboradius_thruwall 200 set g_balance_electro_combo_damage 50 -set g_balance_electro_combo_damage_interval 0.05 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index cb8ea617b..207149148 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -59,9 +59,12 @@ void W_Electro_ExplodeComboThink(entity this) return; } - this.nextthink = time + this.dmg_interval; + this.nextthink = time; + + float damage = this.dmg * PHYS_INPUT_TIMELENGTH; + float edgedamage = this.dmg_edge * PHYS_INPUT_TIMELENGTH; - RadiusDamage(this, this.realowner, this.dmg, this.dmg_edge, this.dmg_radius, NULL, NULL, 0, this.projectiledeathtype, this.weaponentity_fld, NULL); + RadiusDamage(this, this.realowner, damage, edgedamage, this.dmg_radius, NULL, NULL, 0, this.projectiledeathtype, this.weaponentity_fld, NULL); this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect } @@ -81,11 +84,8 @@ void W_Electro_ExplodeCombo(entity this) setthink(this, W_Electro_ExplodeComboThink); this.nextthink = time; - this.dmg_interval = WEP_CVAR(electro, combo_damage_interval); - if(!this.dmg_interval) - this.dmg_interval = PHYS_INPUT_TIMELENGTH; - this.dmg = WEP_CVAR(electro, combo_damage) * this.dmg_interval; - this.dmg_edge = WEP_CVAR(electro, combo_edgedamage) * this.dmg_interval; + this.dmg = WEP_CVAR(electro, combo_damage); + this.dmg_edge = WEP_CVAR(electro, combo_edgedamage); this.dmg_radius = WEP_CVAR(electro, combo_radius); this.dmg_duration = WEP_CVAR(electro, combo_duration); this.teleport_time = time; diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index f8e53ee75..cdb2f10e0 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -29,7 +29,6 @@ CLASS(Electro, Weapon) P(class, prefix, combo_comboradius, float, NONE) \ P(class, prefix, combo_comboradius_thruwall, float, NONE) \ P(class, prefix, combo_damage, float, NONE) \ - P(class, prefix, combo_damage_interval, float, NONE) \ P(class, prefix, combo_duration, float, NONE) \ P(class, prefix, combo_edgedamage, float, NONE) \ P(class, prefix, combo_force, float, NONE) \ @@ -85,7 +84,6 @@ SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO) .float dmg_radius; .float dmg_duration; .float dmg_last; -.float dmg_interval; IntrusiveList LimitedElectroBallRubbleList; .float electro_count;