From: Mario Date: Sat, 7 Sep 2019 08:55:57 +0000 (+1000) Subject: Add g_balance_devastator_remote_jump as a controller cvar for rocket flying, force... X-Git-Tag: xonotic-v0.8.5~1302 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1219bc076f56dc651a53f5d43acc74b329713f98;p=xonotic%2Fxonotic-data.pk3dir.git Add g_balance_devastator_remote_jump as a controller cvar for rocket flying, force it enabled in the rocket flying mutator --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index d579cb2e8..3b2a3a880 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -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 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index eacfe27c7..16544fa76 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -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 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index 4591267a8..e32b54ff4 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -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 diff --git a/bal-wep-testing.cfg b/bal-wep-testing.cfg index 983ff0604..e3dd68596 100644 --- a/bal-wep-testing.cfg +++ b/bal-wep-testing.cfg @@ -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 diff --git a/bal-wep-testingxpm.cfg b/bal-wep-testingxpm.cfg index d7ffcb5c5..d56926fa5 100644 --- a/bal-wep-testingxpm.cfg +++ b/bal-wep-testingxpm.cfg @@ -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 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 0043c7e4b..a3f36a85f 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -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 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index b7de169b3..dcdd07c4b 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -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 diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg index 5117bc2ac..4a57f2e4c 100644 --- a/bal-wep-xpm.cfg +++ b/bal-wep-xpm.cfg @@ -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 diff --git a/mutators.cfg b/mutators.cfg index f49b8a7c4..b4b6eeb83 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" // ===================== diff --git a/qcsrc/common/mutators/mutator/rocketflying/sv_rocketflying.qc b/qcsrc/common/mutators/mutator/rocketflying/sv_rocketflying.qc index d3c1922b9..58e20568e 100644 --- a/qcsrc/common/mutators/mutator/rocketflying/sv_rocketflying.qc +++ b/qcsrc/common/mutators/mutator/rocketflying/sv_rocketflying.qc @@ -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"); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 5654488dd..a77136b39 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -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, diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 33814a5e1..679f75499 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -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) \ diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 1ca629078..a310c6cca 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -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);