Add g_balance_devastator_remote_jump as a controller cvar for rocket flying, force...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / rocketflying / sv_rocketflying.qc
1 #include "sv_rocketflying.qh"
2
3 string autocvar_g_rocket_flying;
4 bool autocvar_g_rocket_flying_disabledelays = true;
5 REGISTER_MUTATOR(rocketflying, expr_evaluate(autocvar_g_rocket_flying));
6
7 MUTATOR_HOOKFUNCTION(rocketflying, EditProjectile)
8 {
9         entity proj = M_ARGV(1, entity);
10
11         if(autocvar_g_rocket_flying_disabledelays && (proj.classname == "rocket" || proj.classname == "mine"))
12         {
13                 // kill detonate delay of rockets
14                 proj.spawnshieldtime = time;
15         }
16 }
17
18 MUTATOR_HOOKFUNCTION(rocketflying, AllowRocketJumping)
19 {
20         M_ARGV(0, bool) = true; // force rocket jumping
21 }
22
23 MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsString)
24 {
25         M_ARGV(0, string) = strcat(M_ARGV(0, string), ":RocketFlying");
26 }
27
28 MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsPrettyString)
29 {
30         M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Rocket Flying");
31 }