add the "rocket flying" mutator, cvar g_rocket_flying
authorRudolf Polzer <divverent@alientrap.org>
Sat, 23 Oct 2010 07:47:57 +0000 (09:47 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 23 Oct 2010 07:52:12 +0000 (09:52 +0200)
defaultXonotic.cfg
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_dodging.qc
qcsrc/server/mutators/mutator_rocketflying.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/teamplay.qc

index df948aa0036b3f9193fc67fcf3a8d02a3fd1bef5..e9cd073be1b929be1b1a8b8dfaa41d4c79f126d7 100644 (file)
@@ -551,6 +551,7 @@ alias clearmap "disconnect"
 set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
 
 set g_dodging 0 "set to 1 to enable dodging in games"
+set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
 
 seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
 
index 59428f65dbca241c03f7b330440cdd8cf75fce98..113651eebe2d80c69c581f1bcc90b203bc2c984e 100644 (file)
@@ -1172,6 +1172,10 @@ void readlevelcvars(void)
        // first load all the mutators
        if(cvar("g_nix"))
                MUTATOR_ADD(mutator_nix);
+       if(cvar("g_dodging"))
+               MUTATOR_ADD(mutator_dodging);
+       if(cvar("g_rocket_flying"))
+               MUTATOR_ADD(mutator_rocketflying);
 
     g_bugrigs = cvar("g_bugrigs");
     g_bugrigs_planar_movement = cvar("g_bugrigs_planar_movement");
index d3b8e6d64ee04d26d9317f28894579ac6335eedc..894bb3ee54d2212f2f6dcfe056b06f5b4d8cc580 100644 (file)
@@ -266,7 +266,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
        return 0;
 }
 
-MUTATOR_DEFINITION(dodging)
+MUTATOR_DEFINITION(mutator_dodging)
 {
        // we need to be called before GetPressedKey does its thing so we can
        // detect state changes and therefore dodging actions..
diff --git a/qcsrc/server/mutators/mutator_rocketflying.qc b/qcsrc/server/mutators/mutator_rocketflying.qc
new file mode 100644 (file)
index 0000000..53bc829
--- /dev/null
@@ -0,0 +1,31 @@
+MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
+{
+       if(other.classname == "rocket")
+       {
+               // kill detonate delay of rockets
+               other.spawnshieldtime = time;
+       }
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":RocketFlying");
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Rocket Flying");
+       return 0;
+}
+
+MUTATOR_DEFINITION(mutator_rocketflying)
+{
+       entity e;
+
+       MUTATOR_HOOK(EditProjectile, rocketflying_EditProjectile, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, rocketflying_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, rocketflying_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return 0;
+}
index da14483a4d40fa52e10fb198b65af8fe109e10dd..91d2ea5be78c915997474f7fc24c851310bac36c 100644 (file)
@@ -1,5 +1,5 @@
 MUTATOR_DECLARATION(gamemode_keyhunt);
 
 MUTATOR_DECLARATION(mutator_nix);
-
-MUTATOR_DECLARATION(dodging);
+MUTATOR_DECLARATION(mutator_dodging);
+MUTATOR_DECLARATION(mutator_rocketflying);
index adf4b4a1d89545418734228dddc0b16345100f0a..d492a04ed3cb7f81e77a5b5c1ae978bd2c0868bf 100644 (file)
@@ -179,6 +179,7 @@ mutators/base.qc
 mutators/gamemode_keyhunt.qc
 mutators/mutator_nix.qc
 mutators/mutator_dodging.qc
+mutators/mutator_rocketflying.qc
 
 ../warpzonelib/anglestransform.qc
 ../warpzonelib/mathlib.qc
index 912e22c2441e8c9aabea1cef218d45f234b3a2dc..1232e3c8eb9262f180e8bb97279fdaf761f29181 100644 (file)
@@ -210,9 +210,6 @@ void InitGameplayMode()
        fraglimit_override = cvar("fraglimit_override");
        leadlimit_override = cvar("leadlimit_override");
 
-       if(cvar("g_dodging"))
-               MUTATOR_ADD(dodging);
-       
        if(g_dm)
        {
                game = GAME_DEATHMATCH;