From: Mario Date: Tue, 14 Jan 2020 14:12:55 +0000 (+1000) Subject: Add an option to configure the rate at which the Electro combo damages players X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7b4ca01fbee97a8a5fc6cd49f5f68ef13c01d92b;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to configure the rate at which the Electro combo damages players --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 234c26644..1ee9dbee8 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -179,6 +179,7 @@ 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_damagerate 0.05 set g_balance_electro_combo_duration 1.5 set g_balance_electro_combo_edgedamage 45 set g_balance_electro_combo_force -100 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 4f9aa7926..c3580487d 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -179,6 +179,7 @@ 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_damagerate 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 c3007e015..413e1a75f 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -179,6 +179,7 @@ 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_damagerate 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-testing.cfg b/bal-wep-testing.cfg index 4da4ab66d..22f8a7b9c 100644 --- a/bal-wep-testing.cfg +++ b/bal-wep-testing.cfg @@ -179,6 +179,7 @@ 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_damagerate 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 7280c5bdb..13e2683d5 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -179,6 +179,7 @@ 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_damagerate 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 5f9f754c2..c8948f20c 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -179,6 +179,7 @@ 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_damagerate 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 f1cc5ba15..dfba8f62b 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -51,7 +51,7 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own) void W_Electro_ExplodeComboThink(entity this) { - float dt = time - this.teleport_time; + float dt = time - this.teleport_time + this.dmg_rate; float dmg_remaining_next = (bound(0, 1 - dt / this.dmg_duration, 1) ** this.dmg_power); float f = this.dmg_last - dmg_remaining_next; @@ -61,7 +61,7 @@ void W_Electro_ExplodeComboThink(entity this) this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect if(dt < this.dmg_duration) - this.nextthink = time + 0.05; // soon + this.nextthink = time + this.dmg_rate; // soon else delete(this); } @@ -87,6 +87,7 @@ void W_Electro_ExplodeCombo(entity this) this.dmg_force = WEP_CVAR(electro, combo_force); this.dmg_power = WEP_CVAR(electro, combo_power); this.dmg_duration = WEP_CVAR(electro, combo_duration); + this.dmg_rate = WEP_CVAR(electro, combo_damagerate); 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 d081f15bf..febb6e322 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -27,6 +27,7 @@ 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_damagerate, float, NONE) \ P(class, prefix, combo_duration, float, NONE) \ P(class, prefix, combo_edgedamage, float, NONE) \ P(class, prefix, combo_force, float, NONE) \ @@ -79,6 +80,7 @@ SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO) .float dmg_power; .float dmg_duration; .float dmg_last; +.float dmg_rate; .float electro_count; .float electro_secondarytime;