Add g_balance_devastator_remote_jump as a controller cvar for rocket flying, force...
authorMario <mario@smbclan.net>
Sat, 7 Sep 2019 08:55:57 +0000 (18:55 +1000)
committerMario <mario@smbclan.net>
Sat, 7 Sep 2019 08:55:57 +0000 (18:55 +1000)
13 files changed:
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-testing.cfg
bal-wep-testingxpm.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
mutators.cfg
qcsrc/common/mutators/mutator/rocketflying/sv_rocketflying.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/server/mutators/events.qh

index d579cb2..3b2a3a8 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 300
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 100
index eacfe27..16544fa 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 105
 set g_balance_devastator_remote_edgedamage 40
 set g_balance_devastator_remote_force 600
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 0
 set g_balance_devastator_remote_jump_radius 0
index 4591267..e32b54f 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 400
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 40
 set g_balance_devastator_remote_jump_force 0
 set g_balance_devastator_remote_jump_radius 200
index 983ff06..e3dd685 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 300
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 100
index d7ffcb5..d56926f 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 300
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 100
index 0043c7e..a3f36a8 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 350
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 0
index b7de169..dcdd07c 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 300
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 0
index 5117bc2..4a57f2e 100644 (file)
@@ -401,6 +401,7 @@ set g_balance_devastator_reload_time 2
 set g_balance_devastator_remote_damage 70
 set g_balance_devastator_remote_edgedamage 35
 set g_balance_devastator_remote_force 300
+set g_balance_devastator_remote_jump 0
 set g_balance_devastator_remote_jump_damage 70
 set g_balance_devastator_remote_jump_force 450
 set g_balance_devastator_remote_jump_radius 0
index f49b8a7..b4b6eeb 100644 (file)
@@ -111,6 +111,7 @@ set g_invincible_projectiles 0 "set to 1 to disable any damage to projectiles in
 //  rocket flying
 // ===============
 set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
+set g_rocket_flying_disabledelays 1 "disable detonation delays on rockets and mines"
 
 
 // =====================
index d3c1922..58e2056 100644 (file)
@@ -1,19 +1,25 @@
 #include "sv_rocketflying.qh"
 
 string autocvar_g_rocket_flying;
+bool autocvar_g_rocket_flying_disabledelays = true;
 REGISTER_MUTATOR(rocketflying, expr_evaluate(autocvar_g_rocket_flying));
 
 MUTATOR_HOOKFUNCTION(rocketflying, EditProjectile)
 {
        entity proj = M_ARGV(1, entity);
 
-       if(proj.classname == "rocket" || proj.classname == "mine")
+       if(autocvar_g_rocket_flying_disabledelays && (proj.classname == "rocket" || proj.classname == "mine"))
        {
                // kill detonate delay of rockets
                proj.spawnshieldtime = time;
        }
 }
 
+MUTATOR_HOOKFUNCTION(rocketflying, AllowRocketJumping)
+{
+       M_ARGV(0, bool) = true; // force rocket jumping
+}
+
 MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsString)
 {
        M_ARGV(0, string) = strcat(M_ARGV(0, string), ":RocketFlying");
index 5654488..a77136b 100644 (file)
@@ -71,8 +71,11 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
 
        bool handled_as_rocketjump = false;
        entity head = NULL;
+       bool allow_rocketjump = WEP_CVAR(devastator, remote_jump);
+       MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump);
+       allow_rocketjump = M_ARGV(0, bool);
 
-       if(WEP_CVAR(devastator, remote_jump_radius))
+       if(allow_rocketjump && WEP_CVAR(devastator, remote_jump_radius))
        {
                head = WarpZone_FindRadius(
                        this.origin,
index 33814a5..679f754 100644 (file)
@@ -40,6 +40,7 @@ CLASS(Devastator, Weapon)
         P(class, prefix, remote_damage, float, NONE) \
         P(class, prefix, remote_edgedamage, float, NONE) \
         P(class, prefix, remote_force, float, NONE) \
+        P(class, prefix, remote_jump, float, NONE) \
         P(class, prefix, remote_jump_damage, float, NONE) \
         P(class, prefix, remote_jump_force, float, NONE) \
         P(class, prefix, remote_jump_radius, float, NONE) \
index 1ca6290..a310c6c 100644 (file)
@@ -1231,3 +1231,10 @@ MUTATOR_HOOKABLE(GetPlayerLimit, EV_GetPlayerLimit);
     /**/                  o(string, MUTATOR_ARGV_1_string) \
     /**/
 MUTATOR_HOOKABLE(LogDeath_AppendItemCodes, EV_LogDeath_AppendItemCodes);
+
+/** Allows disabling or enabling rocket jumping independently of balance, use the parameter to force a preferred setting */
+#define EV_AllowRocketJumping(i, o) \
+    /** allow_rocketjump */         i(bool, MUTATOR_ARGV_0_bool) \
+    /**/                            o(bool, MUTATOR_ARGV_0_bool) \
+    /**/
+MUTATOR_HOOKABLE(AllowRocketJumping, EV_AllowRocketJumping);