From: Mario Date: Tue, 30 Jul 2024 01:38:58 +0000 (+1000) Subject: Rework electro combos over time to always deal consistent damage X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4c188bf2496cfda121f0cdd0e176cf7d7002d25;p=xonotic%2Fxonotic-data.pk3dir.git Rework electro combos over time to always deal consistent damage --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index d3efbd81a..1e33c0332 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -190,11 +190,9 @@ 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_damage_linear 1 set g_balance_electro_combo_duration 1.5 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 0 -set g_balance_electro_combo_power 3 set g_balance_electro_combo_radius 150 set g_balance_electro_combo_safeammocheck 1 set g_balance_electro_combo_speed 2000 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 6610e671a..42c60d205 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -190,11 +190,9 @@ 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_damage_linear 0 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 0 set g_balance_electro_combo_force 200 -set g_balance_electro_combo_power 3 set g_balance_electro_combo_radius 250 set g_balance_electro_combo_safeammocheck 0 set g_balance_electro_combo_speed 2000 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 4a1a2da11..80a90339b 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -190,11 +190,9 @@ 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_damage_linear 0 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 -set g_balance_electro_combo_power 3 set g_balance_electro_combo_radius 150 set g_balance_electro_combo_safeammocheck 1 set g_balance_electro_combo_speed 2000 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 0acce5c89..b0f3c6265 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -190,11 +190,9 @@ 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_damage_linear 0 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 -set g_balance_electro_combo_power 3 set g_balance_electro_combo_radius 175 set g_balance_electro_combo_safeammocheck 1 set g_balance_electro_combo_speed 2000 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 80259bbec..e3e7fbd90 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -190,11 +190,9 @@ 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_damage_linear 0 set g_balance_electro_combo_duration 0 set g_balance_electro_combo_edgedamage 25 set g_balance_electro_combo_force 120 -set g_balance_electro_combo_power 3 set g_balance_electro_combo_radius 150 set g_balance_electro_combo_safeammocheck 1 set g_balance_electro_combo_speed 2000 diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index db375c546..045c5cb9a 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -54,14 +54,8 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own) void W_Electro_ExplodeComboThink(entity this) { float dt = time - this.teleport_time + this.dmg_interval; - float dmg_remaining_next = (bound(0, 1 - dt / this.dmg_duration, 1) ** this.dmg_power); - float f = this.dmg_last - dmg_remaining_next; - this.dmg_last = dmg_remaining_next; - - float dmg_scale = ((this.dmg_linear) ? this.dmg_interval : f); - - RadiusDamage(this, this.realowner, this.dmg * dmg_scale, this.dmg_edge * dmg_scale, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, this.weaponentity_fld, NULL); + RadiusDamage(this, this.realowner, this.dmg, this.dmg_edge, this.dmg_radius, NULL, NULL, this.dmg_force, this.projectiledeathtype, this.weaponentity_fld, NULL); this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect if(dt < this.dmg_duration) @@ -86,14 +80,14 @@ void W_Electro_ExplodeCombo(entity this) setthink(this, W_Electro_ExplodeComboThink); this.nextthink = time; - this.dmg = WEP_CVAR(electro, combo_damage); - this.dmg_edge = WEP_CVAR(electro, combo_edgedamage); + 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_radius = WEP_CVAR(electro, combo_radius); - this.dmg_force = WEP_CVAR(electro, combo_force); - this.dmg_power = WEP_CVAR(electro, combo_power); + this.dmg_force = WEP_CVAR(electro, combo_force) * this.dmg_interval; this.dmg_duration = WEP_CVAR(electro, combo_duration); - this.dmg_interval = WEP_CVAR(electro, combo_damage_interval); - this.dmg_linear = WEP_CVAR(electro, combo_damage_linear); this.teleport_time = time; this.dmg_last = 1; set_movetype(this, MOVETYPE_NONE); diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 721d34889..be3bcfb5e 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -30,12 +30,10 @@ CLASS(Electro, Weapon) 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_damage_linear, float, NONE) \ P(class, prefix, combo_duration, float, NONE) \ P(class, prefix, combo_edgedamage, float, NONE) \ P(class, prefix, combo_force, float, NONE) \ P(class, prefix, combo_radius, float, NONE) \ - P(class, prefix, combo_power, float, NONE) \ P(class, prefix, combo_safeammocheck, float, NONE) \ P(class, prefix, combo_speed, float, NONE) \ P(class, prefix, count, float, SEC) \ @@ -86,11 +84,9 @@ SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO) .float dmg_edge; .float dmg_radius; .float dmg_force; -.float dmg_power; .float dmg_duration; .float dmg_last; .float dmg_interval; -.float dmg_linear; IntrusiveList LimitedElectroBallRubbleList; .float electro_count; diff --git a/testing.cfg b/testing.cfg index bfa0721a9..6c725eab5 100644 --- a/testing.cfg +++ b/testing.cfg @@ -14,7 +14,7 @@ alias test_arc_bounce_burst "settemp g_balance_arc_bolt_bounce_count 1 ; settemp alias test_ctf_stalemate90 "settemp g_ctf_stalemate_time 90" alias test_ctf_stalemate120 "settemp g_ctf_stalemate_time 120" -alias test_electro_combo_over_time "settemp g_balance_electro_combo_damage_interval 0.05 ; settemp g_balance_electro_combo_duration 1.5 ; settemp g_balance_electro_combo_power 3 ; settemp g_balance_electro_combo_damage_linear 1 ; settemp g_balance_electro_combo_force 0" +alias test_electro_combo_over_time "settemp g_balance_electro_combo_damage_interval 0.05 ; settemp g_balance_electro_combo_duration 1.5 ; settemp g_balance_electro_combo_force 0" alias testing_enable "addvote test_blaster_switch ; addvote test_crylink_sec_horizontal ; addvote test_rocket_flying ; addvote test_ctf_stalemate90 ; addvote test_ctf_stalemate120 ; addvote test_arc_bounce ; addvote test_arc_bounce_burst ; addvote test_electro_combo_over_time" alias testing_disable "delvote test_blaster_switch ; delvote test_crylink_sec_horizontal ; delvote test_rocket_flying ; delvote test_ctf_stalemate90 ; delvote test_ctf_stalemate120 ; delvote test_arc_bounce ; delvote test_arc_bounce_burst ; delvote test_electro_combo_over_time"