]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'drjaska/electrostickylifetime' into 'master'
authorterencehill <piuntn@gmail.com>
Thu, 18 Nov 2021 11:18:47 +0000 (11:18 +0000)
committerterencehill <piuntn@gmail.com>
Thu, 18 Nov 2021 11:18:47 +0000 (11:18 +0000)
New cvar for electro balls to get their lifetime from after sticking

See merge request xonotic/xonotic-data.pk3dir!931

bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh

index 3a213f8bbc2a83881790bbcecb5d263f368f95ba..adb7cc654fa3565e82441a1ca9115936191ebfc1 100644 (file)
@@ -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
index 59f59903fbd10cd48cc320ba93a3d77b20b207c4..17f5b31cab3b29b313e70f27606e6cf42bd7e082 100644 (file)
@@ -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
index d1c3c175c71e9908d4dd27173d15989305a251fd..2799a2496b47fb4debea904aa6b051b95c59a621 100644 (file)
@@ -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
index d85c76918758e1b491ede88612c65b0faa18f6d7..09466acce81bcb3949c256133dce2a9675c89acc 100644 (file)
@@ -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
index c0b7afc40c0852800d269dccbc916f58f4bea9e6..566b869f778bcab92e0a8823f3157714b83e8e65 100644 (file)
@@ -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
index c2ec43e8c374bddbdb917343ce44f98b1a08a42e..d80703175983b87eb0c046ffa68e42276aad0d4e 100644 (file)
@@ -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);
+                       }
+               }
        }
 }
 
index 9b7c59074fe8dc04fa9042b0f4838d062e956479..6417243b2efbbd85c0276cf59a0a0c979c486ed2 100644 (file)
@@ -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) \