DEADSOFTWARE

game: added console variables for random item respawn
authorTerminalHash <lyashuk.voxx@gmail.com>
Thu, 7 Sep 2023 23:47:40 +0000 (02:47 +0300)
committerTerminalHash <lyashuk.voxx@gmail.com>
Thu, 7 Sep 2023 23:47:40 +0000 (02:47 +0300)
src/game/g_console.pas
src/game/g_game.pas
src/game/g_language.pas

index aece4fe94369c7fea6d9b3446fad4938e81a534d..5315b351b7aa8d4999688a60b5cd9c456d65ee37 100644 (file)
@@ -1118,6 +1118,10 @@ begin
   AddCommand('g_spawn_invul', GameCVars);
   AddCommand('g_item_respawn_time', GameCVars);
   AddCommand('g_item_time_random', GameCVars);
+  AddCommand('g_items_all_respawn_random', GameCVars);
+  AddCommand('g_items_help_respawn_random', GameCVars);
+  AddCommand('g_items_ammo_respawn_random', GameCVars);
+  AddCommand('g_items_weapon_respawn_random', GameCVars);
   AddCommand('g_powerup_randomize_respawn', GameCVars);
   AddCommand('g_powerup_respawn_time', GameCVars);
   AddCommand('g_powerup_time_random', GameCVars);
@@ -1251,6 +1255,10 @@ begin
   WhitelistCommand('g_spawn_invul');
   WhitelistCommand('g_item_respawn_time');
   WhitelistCommand('g_item_time_random');
+  WhitelistCommand('g_items_all_respawn_random');
+  WhitelistCommand('g_items_help_respawn_random');
+  WhitelistCommand('g_items_ammo_respawn_random');
+  WhitelistCommand('g_items_weapon_respawn_random');
   WhitelistCommand('g_powerup_randomize_respawn');
   WhitelistCommand('g_powerup_respawn_time');
   WhitelistCommand('g_powerup_time_random');
@@ -2252,6 +2260,10 @@ begin
   WriteFlag('g_friendly_hit_trace ', GAME_OPTION_TEAMHITTRACE);
   WriteFlag('g_friendly_hit_projectile ', GAME_OPTION_TEAMHITPROJECTILE);
   WriteFlag('g_powerup_randomize_respawn ', GAME_OPTION_RULEZRANDOM);
+  WriteFlag('g_items_all_respawn_random ', GAME_OPTION_ITEMALLRANDOM);
+  WriteFlag('g_items_help_respawn_random ', GAME_OPTION_ITEMHELPRANDOM);
+  WriteFlag('g_items_ammo_respawn_random ', GAME_OPTION_ITEMAMMORANDOM);
+  WriteFlag('g_items_weapon_respawn_random ', GAME_OPTION_ITEMWEAPONRANDOM);
   WriteFlag('g_allow_exit ', GAME_OPTION_ALLOWEXIT);
   WriteFlag('g_allow_monsters ', GAME_OPTION_MONSTERS);
   WriteFlag('g_allow_dropflag ', GAME_OPTION_ALLOWDROPFLAG);
index 2d80b3aaa32ea394316d5b13bae7ca799bcde2f2..a35e2cba976e5c6c121c4d043cad3a8a169ca802 100644 (file)
@@ -5624,6 +5624,22 @@ begin
   begin
     ParseGameFlag(GAME_OPTION_TEAMHITPROJECTILE, I_MSG_FRIENDLY_PROJECT_TRACE_OFF, I_MSG_FRIENDLY_PROJECT_TRACE_ON);
   end
+  else if cmd = 'g_items_all_respawn_random' then
+  begin
+    ParseGameFlag(GAME_OPTION_ITEMALLRANDOM, I_MSG_ITEM_ALL_RANDOM_OFF, I_MSG_ITEM_ALL_RANDOM_ON, False);
+  end
+  else if cmd = 'g_items_help_respawn_random' then
+  begin
+    ParseGameFlag(GAME_OPTION_ITEMHELPRANDOM, I_MSG_ITEM_HELP_RANDOM_OFF, I_MSG_ITEM_HELP_RANDOM_ON, False);
+  end
+  else if cmd = 'g_items_ammo_respawn_random' then
+  begin
+    ParseGameFlag(GAME_OPTION_ITEMAMMORANDOM, I_MSG_ITEM_AMMO_RANDOM_OFF, I_MSG_ITEM_AMMO_RANDOM_ON, False);
+  end
+  else if cmd = 'g_items_weapon_respawn_random' then
+  begin
+    ParseGameFlag(GAME_OPTION_ITEMWEAPONRANDOM, I_MSG_ITEM_WEAPON_RANDOM_OFF, I_MSG_ITEM_WEAPON_RANDOM_ON);
+  end
   else if cmd = 'g_powerup_randomize_respawn' then
   begin
     ParseGameFlag(GAME_OPTION_RULEZRANDOM, I_MSG_RULEZ_RANDOM_OFF, I_MSG_RULEZ_RANDOM_ON, False);
index 778d4369575e5c517c6ca32a55d13aec9568e28d..72098b4c05c9c4d202c6ada81bfdee9a9af7b0b7 100644 (file)
@@ -642,6 +642,14 @@ type
     I_MSG_PING_OFF,
     I_MSG_RULEZ_RANDOM_ON,
     I_MSG_RULEZ_RANDOM_OFF,
+    I_MSG_ITEM_ALL_RANDOM_ON,
+    I_MSG_ITEM_ALL_RANDOM_OFF,
+    I_MSG_ITEM_HELP_RANDOM_ON,
+    I_MSG_ITEM_HELP_RANDOM_OFF,
+    I_MSG_ITEM_AMMO_RANDOM_ON,
+    I_MSG_ITEM_AMMO_RANDOM_OFF,
+    I_MSG_ITEM_WEAPON_RANDOM_ON,
+    I_MSG_ITEM_WEAPON_RANDOM_OFF,
     I_MSG_NO_WAD,
     I_MSG_NO_MAPS,
     I_MSG_NO_MAP,
@@ -1892,6 +1900,22 @@ const
                                        'Ðàíäîìíûé ðåñïàóí äëÿ ïîâåðàïîâ âêëþ÷¸í'),
     ('MSG RULEZ RANDOM OFF',           'Random respawn for powerups off',
                                        'Ðàíäîìíûé ðåñïàóí äëÿ ïîâåðàïîâ âûêëþ÷åí'),
+    ('MSG ITEM ALL RANDOM ON',         'Random respawn for all items on',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ âñåõ ïðåäìåòîâ âêëþ÷¸í'),
+    ('MSG ITEM ALL RANDOM OFF',        'Random respawn for all items off',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ âñåõ ïðåäìåòîâ âûêëþ÷åí'),
+    ('MSG ITEM HELP RANDOM ON',        'Random respawn for help items on',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ âñïîìîãàòåëüíûõ ïðåäìåòîâ âêëþ÷¸í'),
+    ('MSG ITEM HELP RANDOM OFF',       'Random respawn for help items off',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ âñïîìîãàòåëüíûõ ïðåäìåòîâ âûêëþ÷åí'),
+    ('MSG ITEM AMMO RANDOM ON',        'Random respawn for ammo on',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ áîåïðèïàñîâ âêëþ÷¸í'),
+    ('MSG ITEM AMMO RANDOM OFF',       'Random respawn for ammo off',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ áîåïðèïàñîâ âûêëþ÷åí'),
+    ('MSG ITEM WEAPON RANDOM ON',      'Random respawn for weapons on',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ îðóæèÿ âêëþ÷¸í'),
+    ('MSG ITEM WEAPON RANDOM OFF',     'Random respawn for weapons off',
+                                       'Ðàíäîìíûé ðåñïàóí äëÿ îðóæèÿ âûêëþ÷åí'),
     ('MSG NO WAD',                     'WAD "%s" doesn''t exist!',
                                        'WAD ôàéë "%s" íå íàéäåí!'),
     ('MSG NO MAPS',                    'WAD "%s" doesn''t contain any maps!',