From: Dr. Jaska Date: Thu, 18 Nov 2021 11:18:47 +0000 (+0000) Subject: New cvar for electro balls to get their lifetime from after sticking X-Git-Tag: xonotic-v0.8.5~290^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=02b4e8be75cc413557c727af3eb2aeb4d23dbc71;p=xonotic%2Fxonotic-data.pk3dir.git New cvar for electro balls to get their lifetime from after sticking --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 3a213f8bb..adb7cc654 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -225,6 +225,7 @@ set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0 set g_balance_electro_secondary_stick 0 +set g_balance_electro_secondary_stick_lifetime -1 set g_balance_electro_secondary_touchexplode 1 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 59f59903f..17f5b31ca 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -225,6 +225,7 @@ set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 set g_balance_electro_secondary_stick 0 +set g_balance_electro_secondary_stick_lifetime -1 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.15 set g_balance_electro_switchdelay_raise 0.15 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index d1c3c175c..2799a2496 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -225,6 +225,7 @@ set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 set g_balance_electro_secondary_stick 0 +set g_balance_electro_secondary_stick_lifetime -1 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index d85c76918..09466acce 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -225,6 +225,7 @@ set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0 set g_balance_electro_secondary_stick 0 +set g_balance_electro_secondary_stick_lifetime -1 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0 set g_balance_electro_switchdelay_raise 0 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index c0b7afc40..566b869f7 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -225,6 +225,7 @@ set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0 set g_balance_electro_secondary_stick 0 +set g_balance_electro_secondary_stick_lifetime -1 set g_balance_electro_secondary_touchexplode 1 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index c2ec43e8c..d80703175 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -312,7 +312,11 @@ void W_Electro_Orb_Stick(entity this, entity to) newproj.weaponentity_fld = this.weaponentity_fld; settouch(newproj, func_null); - newproj.death_time = this.death_time; + if(WEP_CVAR_SEC(electro, stick_lifetime) > 0){ + newproj.death_time = time + WEP_CVAR_SEC(electro, stick_lifetime); + }else{ + newproj.death_time = this.death_time; + } newproj.use = this.use; newproj.flags = this.flags; IL_PUSH(g_projectiles, newproj); @@ -351,8 +355,13 @@ void W_Electro_Orb_Touch(entity this, entity toucher) spamsound(this, CH_SHOTS, SND_ELECTRO_BOUNCE, VOL_BASE, ATTEN_NORM); this.projectiledeathtype |= HITTYPE_BOUNCE; - if(WEP_CVAR_SEC(electro, stick)) - W_Electro_Orb_Stick(this, toucher); + if(WEP_CVAR_SEC(electro, stick)){ + if(WEP_CVAR_SEC(electro, stick_lifetime) == 0){ + W_Electro_Explode(this, toucher); + } else { + W_Electro_Orb_Stick(this, toucher); + } + } } } diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index 9b7c59074..6417243b2 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -60,6 +60,7 @@ CLASS(Electro, Weapon) P(class, prefix, speed_z, float, SEC) \ P(class, prefix, spread, float, BOTH) \ P(class, prefix, stick, float, SEC) \ + P(class, prefix, stick_lifetime, float, SEC) \ P(class, prefix, switchdelay_drop, float, NONE) \ P(class, prefix, switchdelay_raise, float, NONE) \ P(class, prefix, touchexplode, float, SEC) \