]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_new_toys.qc
Merge branch 'master' into terencehill/music_player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_new_toys.qc
index 25c89cee56e2037fdf8d5066a1c2ef3c55e55544..3e41c42fe022215ae6152a92b0eb7a7a0ff48065 100644 (file)
@@ -1,10 +1,10 @@
 /*
 
-CORE    laser   nex     lg      rl      cry     gl      elec    hagar   fireb   hook
-                                                                       minsta  porto
+CORE    laser   vortex     lg      rl      cry     gl      elec    hagar   fireb   hook
+                                                                       vaporizer  porto
                                                                        tuba
 
-NEW             rifle   hlac    minel                           seeker   
+NEW             rifle   hlac    minel                           seeker
 IDEAS                                   OPEN    flak    OPEN            FUN FUN FUN FUN
 
 
@@ -18,28 +18,28 @@ weaponreplace lists.
 Entity:
 
 {
-"classname" "weapon_nex"
+"classname" "weapon_vortex"
 "new_toys" "rifle"
 }
--> This will spawn as Rifle in this mutator ONLY, and as Nex otherwise.
+-> This will spawn as Rifle in this mutator ONLY, and as Vortex otherwise.
 
 {
-"classname" "weapon_nex"
-"new_toys" "nex rifle"
+"classname" "weapon_vortext"
+"new_toys" "vortex rifle"
 }
--> This will spawn as either Nex or Rifle in this mutator ONLY, and as Nex otherwise.
+-> This will spawn as either Vortex or Rifle in this mutator ONLY, and as Vortex otherwise.
 
 {
-"classname" "weapon_nex"
-"new_toys" "nex"
+"classname" "weapon_vortex"
+"new_toys" "vortex"
 }
--> This is always a Nex.
+-> This is always a Vortex.
 
 If the map specifies no "new_toys" argument
 
 There will be two default replacements selectable: "replace all" and "replace random".
-In "replace all" mode, e.g. Nex will have the default replacement "rifle".
-In "replace random" mode, Nex will have the default replacement "nex rifle".
+In "replace all" mode, e.g. Vortex will have the default replacement "rifle".
+In "replace random" mode, Vortex will have the default replacement "vortex rifle".
 
 This mutator's replacements run BEFORE regular weaponreplace!
 
@@ -81,33 +81,17 @@ MUTATOR_HOOKFUNCTION(nt_SetModname)
 
 float nt_IsNewToy(float w)
 {
-       if((get_weaponinfo(w)).weapon)
-       {
-               switch(w)
-               {
-                       case WEP_SEEKER:
-                       case WEP_MINE_LAYER:
-                       case WEP_HLAC:
-                       case WEP_RIFLE:
-                               return TRUE;
-               }
-       }
-       else
+       switch(w)
        {
-               switch(w)
-               {
-                       case MON_ANIMUS:
-                       case MON_BRUISER:
-                       case MON_BRUTE:
-                       case MON_CERBERUS:
-                       case MON_KNIGHT:
-                       case MON_SLIME:
-                       case MON_STINGRAY:
-                               return TRUE;
-               }
+               case WEP_SEEKER:
+               case WEP_MINE_LAYER:
+               case WEP_HLAC:
+               case WEP_RIFLE:
+               case WEP_SHOCKWAVE:
+                       return TRUE;
+               default:
+                       return FALSE;
        }
-       
-       return FALSE;
 }
 
 string nt_GetFullReplacement(string w)
@@ -115,9 +99,10 @@ string nt_GetFullReplacement(string w)
        switch(w)
        {
                case "hagar": return "seeker";
-               case "rocketlauncher": return "minelayer";
-               case "uzi": return "hlac";
-               case "nex": return "rifle";
+               case "devastator": return "minelayer";
+               case "machinegun": return "hlac";
+               case "vortex": return "rifle";
+               case "shotgun": return "shockwave";
                default: return string_null;
        }
 }
@@ -127,7 +112,7 @@ string nt_GetReplacement(string w, float m)
        if(m == NT_AUTOREPLACE_NEVER)
                return w;
        string s = nt_GetFullReplacement(w);
-       if not(s)
+       if (!s)
                return w;
        if(m == NT_AUTOREPLACE_RANDOM)
                s = strcat(w, " ", s);
@@ -144,7 +129,7 @@ MUTATOR_HOOKFUNCTION(nt_SetStartItems)
 
        WepSet newdefault;
        WepSet warmup_newdefault;
-       
+
        newdefault = '0 0 0';
        warmup_newdefault = '0 0 0';
 
@@ -224,10 +209,6 @@ MUTATOR_DEFINITION(mutator_new_toys)
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        if(nt_IsNewToy(i))
                                get_weaponinfo(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-                               
-               for(i = MON_FIRST; i <= MON_LAST; ++i)
-               if(nt_IsNewToy(i))
-                       get_monsterinfo(i).spawnflags &= ~MON_FLAG_MUTATORBLOCKED;
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
@@ -236,10 +217,6 @@ MUTATOR_DEFINITION(mutator_new_toys)
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        if(nt_IsNewToy(i))
                                get_weaponinfo(i).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-                               
-               for(i = MON_FIRST; i <= MON_LAST; ++i)
-               if(nt_IsNewToy(i))
-                       get_monsterinfo(i).spawnflags |= MON_FLAG_MUTATORBLOCKED;
        }
 
        MUTATOR_ONREMOVE