]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
make powerups rules game mode dependent
authorRudolf Polzer <divverent@alientrap.org>
Thu, 15 Dec 2011 14:43:08 +0000 (15:43 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 15 Dec 2011 14:44:15 +0000 (15:44 +0100)
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/server/g_world.qc
qcsrc/server/t_items.qc
qcsrc/server/teamplay.qc

index af797c1e943502e7fbc9ba30c4f7db98da6e9dc8..7f0844af8dac15ad1b3685f8520437dfdf776e48 100644 (file)
@@ -500,7 +500,7 @@ set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved t
 set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
 set g_weapon_stay 0 "if set to 1 or 2, weapons stay after they were picked up (1: weapons you don't have yet give you ammo of their type and they can not be dropped, 2: weapons don't give ammo, but instead players start with one pickup-load of ammo by default, 3: weapons give ammo, weapons only stay as ammo-less ghosts)"
 set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
-set g_powerups 1 "if set to 0 the strength and shield (invincibility) will not spawn on the map"
+set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
 set g_pickup_items 1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map"
 set g_minstagib 0      "enable minstagib"
@@ -835,7 +835,6 @@ set g_arena 0 "Arena: many one-on-one rounds are played to find the winner"
 set g_arena_maxspawned 2       "maximum number of players to spawn at once (the rest is spectating, waiting for their turn)"
 set g_arena_roundbased 1       "if disabled, the next player will spawn as soon as someone dies"
 set g_arena_warmup 5   "time, newly spawned players have to prepare themselves in round based matches"
-set g_arena_powerups 0 "enables powerups (superhealth, strength and shield), which are removed by default"
 
 // ca
 set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round."
index 7cdbdb8d02d8438c22232de5d3ad68db122bbd80..7133eb67f1ec601a80c555ab2f75d48c5d7ca6d5 100644 (file)
@@ -96,8 +96,10 @@ string XonoticMutatorsDialog_toString(entity me)
                s = strcat(s, ", ", _("Blood loss"));
        if(cvar("g_jetpack"))
                s = strcat(s, ", ", _("Jet pack"));
-       if(!cvar("g_powerups"))
+       if(cvar("g_powerups") == 0)
                s = strcat(s, ", ", _("No powerups"));
+       if(cvar("g_powerups") > 0)
+               s = strcat(s, ", ", _("Powerups"));
        if(s == "")
                return ZCTX(_("MUT^None"));
        else
index dc8ab56c93aab25ec7639df389fbe43c5ca7b9a2..3b6ada7024239dc99689c18704b1d81a2dd8333e 100644 (file)
@@ -767,8 +767,10 @@ void spawnfunc_worldspawn (void)
                        s = strcat(s, ":minstagib");
 
                // TODO to mutator system
-               if(!autocvar_g_powerups)
+               if(autocvar_g_powerups == 0)
                        s = strcat(s, ":no_powerups");
+               if(autocvar_g_powerups > 0)
+                       s = strcat(s, ":powerups");
 
                GameLogEcho(s);
                GameLogEcho(":gameinfo:end");
index eb6331a88923985a3be535af256dfb8939fb7eb9..6cf81edca81e47f034dbc9bec4ea49a89d208fc2 100644 (file)
@@ -744,21 +744,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                }
                */
 
-               if(autocvar_spawn_debug >= 2)
-               {
-                       entity otheritem;
-                       for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
-                       {
-                               if(otheritem.is_item)
-                               {
-                                       dprint("XXX Found duplicated item: ", itemname, vtos(self.origin));
-                                       dprint(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
-                                       error("Mapper sucks.");
-                               }
-                       }
-                       self.is_item = TRUE;
-               }
-
                if(g_lms || g_ca)
                {
                        startitem_failed = TRUE;
@@ -781,13 +766,28 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                                return;
                        }
                }
-               else if (!autocvar_g_pickup_items && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
+               else if (!autocvar_g_pickup_items && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE)
                {
                        startitem_failed = TRUE;
                        remove (self);
                        return;
                }
 
+               if(autocvar_spawn_debug >= 2)
+               {
+                       entity otheritem;
+                       for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
+                       {
+                               if(otheritem.is_item)
+                               {
+                                       dprint("XXX Found duplicated item: ", itemname, vtos(self.origin));
+                                       dprint(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
+                                       error("Mapper sucks.");
+                               }
+                       }
+                       self.is_item = TRUE;
+               }
+
                weaponsInMap |= weaponid;
 
                precache_model (itemmodel);
@@ -1240,11 +1240,20 @@ void spawnfunc_item_health1() { spawnfunc_item_health_small(); }
 void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
 void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
-void spawnfunc_item_strength (void) {
-       if(!autocvar_g_powerups)
-               return;
+float have_powerups(void)
+{
+       if(autocvar_g_powerups > 0)
+               return TRUE;
+       else if(autocvar_g_powerups == 0)
+               return FALSE;
+       else if(g_arena)
+               return FALSE;
+       else
+               return TRUE;
+}
 
-       if((g_arena || g_ca) && !autocvar_g_arena_powerups)
+void spawnfunc_item_strength (void) {
+       if(!have_powerups())
                return;
 
        if(g_minstagib) {
@@ -1257,10 +1266,7 @@ void spawnfunc_item_strength (void) {
 }
 
 void spawnfunc_item_invincible (void) {
-       if(!autocvar_g_powerups)
-               return;
-
-       if((g_arena || g_ca) && !autocvar_g_arena_powerups)
+       if(!have_powerups())
                return;
 
        if(g_minstagib) {
index 5df5025251db77da36b8d4ad4590e1c84f81ef6b..66e909eec3ce9e5d26ee161a7729a9dd70462768 100644 (file)
@@ -478,8 +478,10 @@ string getwelcomemessage(void)
                modifications = strcat(modifications, ", Blood loss");
        if(g_jetpack)
                modifications = strcat(modifications, ", Jet pack");
-       if(!autocvar_g_powerups)
+       if(autocvar_g_powerups == 0)
                modifications = strcat(modifications, ", No powerups");
+       if(autocvar_g_powerups > 0)
+               modifications = strcat(modifications, ", Powerups");
        modifications = substring(modifications, 2, strlen(modifications) - 2);
 
        string versionmessage;