]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/electro-denoobing' into 'master'
authorMartin Taibr <taibr.martin@gmail.com>
Sat, 18 Jan 2020 14:36:36 +0000 (14:36 +0000)
committerMartin Taibr <taibr.martin@gmail.com>
Sat, 18 Jan 2020 14:36:36 +0000 (14:36 +0000)
Electro: midair combos

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

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

index d3270acc83acd29cf991d547f282a43eaa3c0482..5cfa34882b2710471c8e0a44157dda9feff17eb5 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 40
 set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 5
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 1
 set g_balance_electro_primary_midaircombo_interval 0.1
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 0
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2500
index c9d87fd0578f32daff8750b19727a8e76d2006dc..f9659814b3ea91d425b172095dbc9c264a2e5418 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 65
 set g_balance_electro_primary_edgedamage 0
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 30
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 0
 set g_balance_electro_primary_midaircombo_interval 0
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 0
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 150
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2000
index e32b54ff4b17e3851896ec7a40839484b1be136c..6896f5f5e0be99131c379ea538b28a0ff7e3b252 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 40
 set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 5
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 1
 set g_balance_electro_primary_midaircombo_interval 0.1
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 100
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2500
index 5f62ae83c7d8c69ea1aa3cf39e0e5e131bdb3b78..abee0b6df7bb6c37187b219fea8c626e374c874f 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 40
 set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 5
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 1
 set g_balance_electro_primary_midaircombo_interval 0.1
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 0
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2500
index 1fe4044cab7f25ce1e1a624e1c895680224ed668..ec8029c74bf28647cae83bf57d806178f6120640 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 40
 set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 5
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 1
 set g_balance_electro_primary_midaircombo_interval 0.1
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 100
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2500
index 7e153b3de6b51caa5c2a54698a504ec2c589b764..c38ea832f3e2c53576a9cd2d9c15538d81ca1633 100644 (file)
@@ -191,9 +191,13 @@ set g_balance_electro_primary_damage 40
 set g_balance_electro_primary_edgedamage 20
 set g_balance_electro_primary_force 200
 set g_balance_electro_primary_lifetime 5
+set g_balance_electro_primary_midaircombo_enemy 1
 set g_balance_electro_primary_midaircombo_explode 1
 set g_balance_electro_primary_midaircombo_interval 0.1
+set g_balance_electro_primary_midaircombo_own 1
 set g_balance_electro_primary_midaircombo_radius 0
+set g_balance_electro_primary_midaircombo_speed 2000
+set g_balance_electro_primary_midaircombo_teammate 1
 set g_balance_electro_primary_radius 100
 set g_balance_electro_primary_refire 0.6
 set g_balance_electro_primary_speed 2500
index 2ba6b5da18628bc669f6de77668c32c23738ea11..69ccc4251bff69dbd7dacb70975cdf1966c62434 100644 (file)
@@ -154,27 +154,46 @@ void W_Electro_Bolt_Think(entity this)
                {
                        if(e.classname == "electro_orb")
                        {
-                               // change owner to whoever caused the combo explosion
-                               e.realowner = this.realowner;
-                               e.takedamage = DAMAGE_NO;
-                               e.classname = "electro_orb_chain";
-
-                               // now set the next one to trigger as well
-                               setthink(e, W_Electro_ExplodeCombo);
+                               bool explode;
+                               if (this.owner == e.owner)
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_own);
+                               }
+                               else if (SAME_TEAM(this.owner, e.owner))
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_teammate);
+                               }
+                               else
+                               {
+                                       explode = WEP_CVAR_PRI(electro, midaircombo_enemy);
+                               }
 
-                               // delay combo chains, looks cooler
-                               e.nextthink =
+                               if (explode)
+                               {
+                                       // change owner to whoever caused the combo explosion
+                                       e.realowner = this.realowner;
+                                       e.takedamage = DAMAGE_NO;
+                                       e.classname = "electro_orb_chain";
+
+                                       // Only first orb explosion uses midaircombo_speed, others use the normal combo_speed.
+                                       // This allows to avoid the delay on the first explosion which looks better
+                                       // (the bolt and orb should explode together because they interacted together)
+                                       // while keeping the chaining delay.
+                                       setthink(e, W_Electro_ExplodeCombo);
+                                       e.nextthink =
                                        (
                                                time
                                                +
-                                               (WEP_CVAR(electro, combo_speed) ?
-                                                       (vlen(e.WarpZone_findradius_dist) / WEP_CVAR(electro, combo_speed))
+                                               (WEP_CVAR_PRI(electro, midaircombo_speed) ?
+                                                       (vlen(e.WarpZone_findradius_dist) / WEP_CVAR_PRI(electro, midaircombo_speed))
                                                        :
                                                        0
                                                )
                                        );
 
-                               ++found;
+
+                                       ++found;
+                               }
                        }
                        e = e.chain;
                }
index 7dbed189b095e297a6a2805f1df2dda980c36045..4480812207defe79dfddd925c4589c1a57f09ea7 100644 (file)
@@ -40,9 +40,13 @@ CLASS(Electro, Weapon)
                P(class, prefix, force, float, BOTH) \
                P(class, prefix, health, float, SEC) \
                P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, midaircombo_enemy, bool, PRI) \
                P(class, prefix, midaircombo_explode, float, PRI) \
                P(class, prefix, midaircombo_interval, float, PRI) \
+               P(class, prefix, midaircombo_own, bool, PRI) \
                P(class, prefix, midaircombo_radius, float, PRI) \
+               P(class, prefix, midaircombo_speed, float, PRI) \
+               P(class, prefix, midaircombo_teammate, float, PRI) \
                P(class, prefix, radius, float, BOTH) \
                P(class, prefix, refire2, float, SEC) \
                P(class, prefix, refire, float, BOTH) \