DEADSOFTWARE

add 'respawn items' flag
[d2df-sdl.git] / src / game / g_options.pas
index d523da8c511b83be4d6d6bc68af001e49598654d..02889313813d3d9cbbba34e7db62f47efa24e6ac 100644 (file)
@@ -60,6 +60,8 @@ var
   gRevertPlayers: Boolean;
   gLanguage: String;
   gAskLanguage: Boolean;
+  gSaveStats: Boolean = False;
+  gScreenshotStats: Boolean = False;
   gcMap: String;
   gcGameMode: String;
   gcTimeLimit: Word;
@@ -71,6 +73,9 @@ var
   gcWeaponStay: Boolean;
   gcMonsters: Boolean;
   gcBotsVS: String;
+  gcDeathmatchKeys: Boolean = True;
+  gcRespawnItems: Boolean = True;
+  gcSpawnInvul: Integer = 0;
   gnMap: String;
   gnGameMode: String;
   gnTimeLimit: Word;
@@ -82,6 +87,9 @@ var
   gnWeaponStay: Boolean;
   gnMonsters: Boolean;
   gnBotsVS: String;
+  gnDeathmatchKeys: Boolean = True;
+  gnRespawnItems: Boolean = True;
+  gnSpawnInvul: Integer = 0;
   gsSDLSampleRate: Integer;
   gsSDLBufferSize: Integer;
   gDefaultMegawadStart: AnsiString;
@@ -264,6 +272,7 @@ begin
   gDefaultMegawadStart := DF_Default_Megawad_Start;
   gBerserkAutoswitch := True;
   g_dbg_scale := 1.0;
+  gSaveStats := False;
 
   gAskLanguage := True;
   gLanguage := LANGUAGE_ENGLISH;
@@ -280,6 +289,9 @@ begin
   gcWeaponStay := False;
   gcMonsters := False;
   gcBotsVS := 'Everybody';
+  gcDeathmatchKeys := True;
+  gcRespawnItems := True;
+  gcSpawnInvul := 0;
 
   (* section GameplayNetwork *)
   gnMap := '';
@@ -293,6 +305,9 @@ begin
   gnWeaponStay := False;
   gnMonsters := False;
   gnBotsVS := 'Everybody';
+  gnDeathmatchKeys := True;
+  gnRespawnItems := True;
+  gnSpawnInvul := 0;
 
   (* section MasterServer *)
   NetSlistIP := 'mpms.doom2d.org';
@@ -407,6 +422,9 @@ begin
   ReadBoolean(gcWeaponStay, 'WeaponStay');
   ReadBoolean(gcMonsters, 'Monsters');
   ReadString(gcBotsVS, 'BotsVS');
+  ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
+  ReadBoolean(gcRespawnItems, 'RespawnItems');
+  ReadInteger(gcSpawnInvul, 'SpawnInvul');
 
   with gGameSettings do
   begin
@@ -434,6 +452,10 @@ begin
       Options := Options or GAME_OPTION_BOTVSPLAYER;
     if gcBotsVS = 'Monsters' then
       Options := Options or GAME_OPTION_BOTVSMONSTER;
+    if gcDeathmatchKeys then
+      Options := Options or GAME_OPTION_DMKEYS;
+    if gcRespawnItems then
+      Options := Options or GAME_OPTION_RESPAWNITEMS;
   end;
 
   section := 'GameplayNetwork';
@@ -448,6 +470,9 @@ begin
   ReadBoolean(gnWeaponStay, 'WeaponStay');
   ReadBoolean(gnMonsters, 'Monsters');
   ReadString(gnBotsVS, 'BotsVS');
+  ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
+  ReadBoolean(gnRespawnItems, 'RespawnItems');
+  ReadInteger(gnSpawnInvul, 'SpawnInvul');
 
   section := 'MasterServer';
   ReadString(NetSlistIP, 'IP');
@@ -518,6 +543,9 @@ begin
   config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
+  config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
+  config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
+  config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.WriteStr ('GameplayNetwork', 'Map', gnMap);
   config.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode);
@@ -530,6 +558,9 @@ begin
   config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
+  config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
+  config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
+  config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.WriteStr('MasterServer', 'IP', NetSlistIP);
   config.WriteInt('MasterServer', 'Port', NetSlistPort);
@@ -576,6 +607,9 @@ begin
   config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
+  config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
+  config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
+  config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.SaveFile(FileName);
   config.Free();
@@ -600,6 +634,9 @@ begin
   config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
+  config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
+  config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
+  config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.SaveFile(FileName);
   config.Free();
@@ -804,5 +841,6 @@ initialization
   conRegVar('sfs_fastmode', @wadoptFast, '', '');
   conRegVar('g_fast_screenshots', @e_FastScreenshots, '', '');
   conRegVar('g_default_megawad', @gDefaultMegawadStart, '', '');
-
+  conRegVar('g_save_stats', @gSaveStats, '', '');
+  conRegVar('g_screenshot_stats', @gScreenshotStats, '', '');
 end.