DEADSOFTWARE

Game: Fix soulsphere and megasphere being mixed up in the 'give' command
[d2df-sdl.git] / src / game / g_game.pas
index 303d036f53c62ee319e56b1d862929065dce0614..b675eb4612850e6f90020200656fd819ff4dcc1c 100644 (file)
@@ -33,7 +33,8 @@ type
     WarmupTime: Word;
     SpawnInvul: Word;
     ItemRespawnTime: Word;
-    RulezTimeMultiplier: Word;
+    RulezRespawnTime: Word;
+    RulezRespawnRandom: Word;
     MaxLives: Byte;
     Options: LongWord;
     WAD: String;
@@ -5614,9 +5615,9 @@ begin
   begin
     ParseGameFlag(GAME_OPTION_TEAMHITPROJECTILE, I_MSG_FRIENDLY_PROJECT_TRACE_OFF, I_MSG_FRIENDLY_PROJECT_TRACE_ON);
   end
-  else if cmd = 'g_rulez_randomize_respawn' then
+  else if cmd = 'g_powerup_randomize_respawn' then
   begin
-    ParseGameFlag(GAME_OPTION_RULEZRANDOM, I_MSG_RULEZ_RANDOM_ON, I_MSG_RULEZ_RANDOM_OFF);
+    ParseGameFlag(GAME_OPTION_RULEZRANDOM, I_MSG_RULEZ_RANDOM_OFF, I_MSG_RULEZ_RANDOM_ON, False);
   end
   else if cmd = 'g_weaponstay' then
   begin
@@ -5714,19 +5715,34 @@ begin
     g_Console_Add(Format('%s %d', [cmd, Integer(gsItemRespawnTime)]));
     if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
   end
-  else if cmd = 'g_rulez_time_multiplier' then
+  else if cmd = 'g_powerup_respawn_time' then
   begin
     if Length(P) > 1 then
     begin
-      gsRulezTimeMultiplier := nclamp(StrToIntDef(P[1], gsRulezTimeMultiplier), 0, $FFFF);
+      gsRulezRespawnTime := nclamp(StrToIntDef(P[1], gsRulezRespawnTime), 0, $FFFF);
       if g_Game_IsServer then
       begin
-        gGameSettings.RulezTimeMultiplier := gsRulezTimeMultiplier;
+        gGameSettings.RulezRespawnTime := gsRulezRespawnTime;
         if g_Game_IsNet then MH_SEND_GameSettings;
       end;
     end;
 
-    g_Console_Add(Format('%s %d', [cmd, Integer(gsRulezTimeMultiplier)]));
+    g_Console_Add(Format('%s %d', [cmd, Integer(gsRulezRespawnTime)]));
+    if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
+  end
+  else if cmd = 'g_powerup_time_random' then
+  begin
+    if Length(P) > 1 then
+    begin
+      gsRulezRespawnRandom := nclamp(StrToIntDef(P[1], gsRulezRespawnRandom), 0, $FFFF);
+      if g_Game_IsServer then
+      begin
+        gGameSettings.RulezRespawnRandom := gsRulezRespawnRandom;
+        if g_Game_IsNet then MH_SEND_GameSettings;
+      end;
+    end;
+
+    g_Console_Add(Format('%s %d', [cmd, Integer(gsRulezRespawnRandom)]));
     if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
   end
   else if cmd = 'sv_intertime' then
@@ -6424,8 +6440,8 @@ begin
       if cmd = 'greenarmor' then begin plr.GiveItem(ITEM_ARMOR_GREEN); g_Console_Add('player got a security armor'); continue; end;
       if cmd = 'bluearmor' then begin plr.GiveItem(ITEM_ARMOR_BLUE); g_Console_Add('player got a combat armor'); continue; end;
 
-      if (cmd = 'megasphere') or (cmd = 'mega') then begin plr.GiveItem(ITEM_SPHERE_BLUE); g_Console_Add('player got a megasphere'); continue; end;
-      if (cmd = 'soulsphere') or (cmd = 'soul')then begin plr.GiveItem(ITEM_SPHERE_WHITE); g_Console_Add('player got a soul sphere'); continue; end;
+      if (cmd = 'soulsphere') or (cmd = 'soul') then begin plr.GiveItem(ITEM_SPHERE_BLUE); g_Console_Add('player got a soul sphere'); continue; end;
+      if (cmd = 'megasphere') or (cmd = 'mega') then begin plr.GiveItem(ITEM_SPHERE_WHITE); g_Console_Add('player got a megasphere'); continue; end;
 
       if (cmd = 'invul') or (cmd = 'invulnerability') then begin plr.GiveItem(ITEM_INVUL); g_Console_Add('player got invulnerability'); continue; end;
       if (cmd = 'invis') or (cmd = 'invisibility') then begin plr.GiveItem(ITEM_INVIS); g_Console_Add('player got invisibility'); continue; end;