summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdb4859)
raw | patch | inline | side by side (parent: bdb4859)
author | TerminalHash <lyashuk.voxx@gmail.com> | |
Thu, 7 Sep 2023 22:34:05 +0000 (01:34 +0300) | ||
committer | TerminalHash <lyashuk.voxx@gmail.com> | |
Thu, 7 Sep 2023 22:35:43 +0000 (01:35 +0300) |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 9ea80513eaecd98cbc7e75042fbbe87534f27da1..aece4fe94369c7fea6d9b3446fad4938e81a534d 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('g_warmup_time', GameCVars);
AddCommand('g_spawn_invul', GameCVars);
AddCommand('g_item_respawn_time', GameCVars);
+ AddCommand('g_item_time_random', GameCVars);
AddCommand('g_powerup_randomize_respawn', GameCVars);
AddCommand('g_powerup_respawn_time', GameCVars);
AddCommand('g_powerup_time_random', GameCVars);
WhitelistCommand('g_warmup_time');
WhitelistCommand('g_spawn_invul');
WhitelistCommand('g_item_respawn_time');
+ WhitelistCommand('g_item_time_random');
WhitelistCommand('g_powerup_randomize_respawn');
WhitelistCommand('g_powerup_respawn_time');
WhitelistCommand('g_powerup_time_random');
WriteLn(f, 'g_timelimit ', gsTimeLimit);
WriteLn(f, 'g_maxlives ', gsMaxLives);
WriteLn(f, 'g_item_respawn_time ', gsItemRespawnTime);
+ WriteLn(f, 'g_item_time_random ', gsItemRespawnRandom);
WriteLn(f, 'g_powerup_respawn_time ', gsRulezRespawnTime);
WriteLn(f, 'g_powerup_time_random ', gsRulezRespawnRandom);
WriteLn(f, 'g_spawn_invul ', gsSpawnInvul);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index b675eb4612850e6f90020200656fd819ff4dcc1c..2d80b3aaa32ea394316d5b13bae7ca799bcde2f2 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
WarmupTime: Word;
SpawnInvul: Word;
ItemRespawnTime: Word;
+ ItemRespawnRandom: Word;
RulezRespawnTime: Word;
RulezRespawnRandom: Word;
MaxLives: Byte;
GAME_OPTION_ALLOWDROPFLAG = 2048;
GAME_OPTION_THROWFLAG = 4096;
GAME_OPTION_RULEZRANDOM = 8192;
+ GAME_OPTION_ITEMALLRANDOM = 16384;
+ GAME_OPTION_ITEMHELPRANDOM = 32768;
+ GAME_OPTION_ITEMAMMORANDOM = 65536;
+ GAME_OPTION_ITEMWEAPONRANDOM = 131072;
STATE_NONE = 0;
STATE_MENU = 1;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITPROJECTILE;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITTRACE;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_RULEZRANDOM;
+ gGameSettings.Options := gGameSettings.Options + GAME_OPTION_ITEMALLRANDOM;
+ gGameSettings.Options := gGameSettings.Options + GAME_OPTION_ITEMHELPRANDOM;
+ gGameSettings.Options := gGameSettings.Options + GAME_OPTION_ITEMAMMORANDOM;
+ gGameSettings.Options := gGameSettings.Options + GAME_OPTION_ITEMWEAPONRANDOM;
gSwitchGameMode := GM_SINGLE;
gLMSRespawn := LMS_RESPAWN_NONE;
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_item_time_random' then
+ begin
+ if Length(P) > 1 then
+ begin
+ gsItemRespawnRandom := nclamp(StrToIntDef(P[1], gsItemRespawnRandom), 0, $FFFF);
+ if g_Game_IsServer then
+ begin
+ gGameSettings.ItemRespawnRandom := gsItemRespawnRandom;
+ if g_Game_IsNet then MH_SEND_GameSettings;
+ end;
+ end;
+
+ g_Console_Add(Format('%s %d', [cmd, Integer(gsItemRespawnRandom)]));
+ if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
+ end
else if cmd = 'g_powerup_respawn_time' then
begin
if Length(P) > 1 then
diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index 30e8db912cdf2c89c1099e04c4706de8e1f615b2..92bfca2be5e2816e48cc86fa741da07926917cfc 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
ggItems[ID].RespawnTime := IfThen(gLMSRespawn = LMS_RESPAWN_NONE, gGameSettings.RulezRespawnTime, 15) * 36;
end;
- if LongBool(gGameSettings.Options and GAME_OPTION_RULEZRANDOM) then // Random powerup respawn
+ // #### Random powerup respawn ####
+ if LongBool(gGameSettings.Options and GAME_OPTION_RULEZRANDOM) then
begin
if ggItems[ID].ItemType in [ITEM_SPHERE_BLUE, ITEM_SPHERE_WHITE, ITEM_INVUL,
ITEM_INVIS, ITEM_MEDKIT_BLACK, ITEM_JETPACK, ITEM_SUIT] then
begin
ggItems[ID].RespawnTime := Max(1, (gGameSettings.RulezRespawnTime + RandomRange(-gGameSettings.RulezRespawnRandom, gGameSettings.RulezRespawnRandom + 1)) * 36);
- //e_logwritefln ('Randomized number: %s', [ggItems[ID].RespawnTime]);
+ e_logwritefln ('Randomized rulez time: %s', [ggItems[ID].RespawnTime]);
+ end;
+ end;
+
+ // #### Random item respawn ####
+ // Randomize respawn for all items (excluding rulez)
+ if LongBool(gGameSettings.Options and GAME_OPTION_ITEMALLRANDOM) then
+ begin
+ if ggItems[ID].ItemType in [ITEM_MEDKIT_SMALL, ITEM_MEDKIT_LARGE, ITEM_ARMOR_GREEN,
+ ITEM_ARMOR_BLUE, ITEM_BOTTLE, ITEM_HELMET, ITEM_OXYGEN,
+ ITEM_AMMO_BULLETS, ITEM_AMMO_BULLETS_BOX, ITEM_AMMO_SHELLS,
+ ITEM_AMMO_SHELLS_BOX, ITEM_AMMO_ROCKET, ITEM_AMMO_ROCKET_BOX,
+ ITEM_AMMO_CELL, ITEM_AMMO_CELL_BIG, ITEM_AMMO_FUELCAN,
+ ITEM_AMMO_BACKPACK, ITEM_WEAPON_SAW, ITEM_WEAPON_SHOTGUN1,
+ ITEM_WEAPON_SHOTGUN2, ITEM_WEAPON_CHAINGUN, ITEM_WEAPON_ROCKETLAUNCHER,
+ ITEM_WEAPON_PLASMA, ITEM_WEAPON_BFG, ITEM_WEAPON_SUPERPULEMET,
+ ITEM_WEAPON_FLAMETHROWER] then
+ begin
+ ggItems[ID].RespawnTime := Max(1, (gGameSettings.ItemRespawnTime + RandomRange(-gGameSettings.ItemRespawnRandom, gGameSettings.ItemRespawnRandom + 1)) * 36);
+ e_logwritefln ('Randomized item time: %s', [ggItems[ID].RespawnTime]);
+ end;
+ end;
+
+ // Randomize respawn for heal/armor
+ if LongBool(gGameSettings.Options and GAME_OPTION_ITEMHELPRANDOM) then
+ begin
+ if ggItems[ID].ItemType in [ITEM_MEDKIT_SMALL, ITEM_MEDKIT_LARGE, ITEM_ARMOR_GREEN,
+ ITEM_ARMOR_BLUE, ITEM_BOTTLE, ITEM_HELMET, ITEM_OXYGEN,
+ ITEM_AMMO_BACKPACK] then
+ begin
+ ggItems[ID].RespawnTime := Max(1, (gGameSettings.ItemRespawnTime + RandomRange(-gGameSettings.ItemRespawnRandom, gGameSettings.ItemRespawnRandom + 1)) * 36);
+ e_logwritefln ('Randomized help item time: %s', [ggItems[ID].RespawnTime]);
+ end;
+ end;
+
+ // Randomize respawn for ammo
+ if LongBool(gGameSettings.Options and GAME_OPTION_ITEMAMMORANDOM) then
+ begin
+ if ggItems[ID].ItemType in [ITEM_AMMO_BULLETS, ITEM_AMMO_BULLETS_BOX, ITEM_AMMO_SHELLS,
+ ITEM_AMMO_SHELLS_BOX, ITEM_AMMO_ROCKET, ITEM_AMMO_ROCKET_BOX,
+ ITEM_AMMO_CELL, ITEM_AMMO_CELL_BIG, ITEM_AMMO_FUELCAN] then
+ begin
+ ggItems[ID].RespawnTime := Max(1, (gGameSettings.ItemRespawnTime + RandomRange(-gGameSettings.ItemRespawnRandom, gGameSettings.ItemRespawnRandom + 1)) * 36);
+ e_logwritefln ('Randomized ammo time: %s', [ggItems[ID].RespawnTime]);
+ end;
+ end;
+
+ // Randomize respawn for weapons
+ if LongBool(gGameSettings.Options and GAME_OPTION_ITEMWEAPONRANDOM) then
+ begin
+ if ggItems[ID].ItemType in [ITEM_WEAPON_SAW, ITEM_WEAPON_SHOTGUN1, ITEM_WEAPON_SHOTGUN2,
+ ITEM_WEAPON_CHAINGUN, ITEM_WEAPON_ROCKETLAUNCHER, ITEM_WEAPON_PLASMA,
+ ITEM_WEAPON_BFG, ITEM_WEAPON_SUPERPULEMET, ITEM_WEAPON_FLAMETHROWER] then
+ begin
+ ggItems[ID].RespawnTime := Max(1, (gGameSettings.ItemRespawnTime + RandomRange(-gGameSettings.ItemRespawnRandom, gGameSettings.ItemRespawnRandom + 1)) * 36);
+ e_logwritefln ('Randomized weapons time: %s', [ggItems[ID].RespawnTime]);
end;
end;
end;
index 1d6734776178bdc7935ccb9fd020302815dcc4d9..778d4369575e5c517c6ca32a55d13aec9568e28d 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
I_MENU_START_CLIENT,
I_MENU_CLIENT_CONNECT,
I_MENU_SELECT_MAP,
+ I_MENU_SELECT_ITEM_RESPAWN,
+ I_MENU_ITEM_RESPAWN,
I_MENU_VIDEO_OPTIONS,
I_MENU_SOUND_OPTIONS,
I_MENU_SAVED_OPTIONS,
I_MENU_TEAM_HIT_PROJECTILE,
I_MENU_TEAM_HIT_NOTHING,
I_MENU_ITEM_RESPAWN_TIME,
+ I_MENU_ITEM_RESPAWN_RANDOM,
+ I_MENU_ITEM_RANDOM_ALL,
+ I_MENU_ITEM_RANDOM_HELP_ONLY,
+ I_MENU_ITEM_RANDOM_AMMO_ONLY,
+ I_MENU_ITEM_RANDOM_WEAPON_ONLY,
+ I_MENU_ITEM_RANDOM_NOTHING,
I_MENU_DEATHMATCH_KEYS,
I_MENU_ENABLE_EXITS,
I_MENU_WEAPONS_STAY,
I_MENU_ENABLE_TEAM_DAMAGE_ABSOBR,
I_MENU_ENABLE_MONSTERS,
I_MENU_ENABLE_RULEZ_RANDOM,
+ I_MENU_ENABLE_ITEM_RANDOM,
I_MENU_RULEZ_RESPAWN_TIME,
I_MENU_RULEZ_RESPAWN_RANDOM,
I_MENU_BOTS_VS,
'Ïðèñîåäèíèòüñÿ'),
('MENU SELECT MAP', 'Map',
'ÊÀÐÒÀ'),
+ ('MENU SELECT ITEM RESPAWN', 'Items Respawn Settings',
+ 'Íàñòðîèòü ðåñïàóí ïðåäìåòîâ'),
+ ('MENU ITEM RESPAWN', 'Items Respawn Settings',
+ 'Íàñòðîéêà ðåñïàóíà ïðåäìåòîâ'),
('MENU VIDEO OPTIONS', 'Video',
'ÂÈÄÅÎ'),
('MENU SOUND OPTIONS', 'Sound',
'Íè÷åì'),
('MENU ITEM RESPAWN TIME', 'Item respawn time:',
'Âðåìÿ ðåñïàâíà ïðåäìåòîâ:'),
+ ('MENU ITEM RESPAWN RANDOM', 'Additive time for item timer:',
+ 'Äîïîëíèòåëüíûé ÷èñëî ê òàéìåðó ïðåäìåòîâ:'),
+ ('MENU ITEM RESPAWN ALL', 'For all items',
+ 'Âñå ïðåäìåòû'),
+ ('MENU ITEM RESPAWN HELP ONLY', 'For help items only',
+ 'Òîëüêî âñïîìîãàòåëüíîå'),
+ ('MENU ITEM RESPAWN AMMO ONLY', 'For ammo only',
+ 'Òîëüêî áîåïðèïàñû'),
+ ('MENU ITEM RESPAWN WEAPON ONLY', 'For weapons only',
+ 'Òîëüêî îðóæèå'),
+ ('MENU ITEM RESPAWN NOTHING', 'Nothing',
+ 'Íè÷åãî'),
('MENU DEATHMATCH KEYS', 'Give all keys in DM:',
'Âñå êëþ÷è â DM:'),
('MENU ENABLE EXITS', 'Enable Exit:',
'Ìîíñòðû:'),
('MENU ENABLE RULEZ RANDOM', 'Enable random powerup respawn:',
'Ðàíäîìíûé ðåñïàóí ïîâåðàïîâ:'),
+ ('MENU ENABLE ITEM RANDOM', 'Enable item powerup respawn:',
+ 'Ðàíäîìíûé ðåñïàóí ïðåäìåòîâ:'),
('MENU RULEZ RESPAWN TIME', 'Powerup respawn time:',
'Âðåìÿ ðåñïàóíà ïîâåðàïîâ:'),
('MENU RULEZ RESPAWN RANDOM', 'Additive time for powerup timer:',
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index d9a8c6d7a16d39be58481ba48c93467af4a5d7e9..8cd9363c8da74eb2112b972339e9eab2fa7528a1 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
gsTimeLimit := StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
gsScoreLimit := StrToIntDef(TGUIEdit(GetControl('edScoreLimit')).Text, 0);
gsMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
- gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
- gsRulezRespawnTime := StrToIntDef(TGUIEdit(GetControl('edRulezRespawnTime')).Text, 0);
- gsRulezRespawnRandom := StrToIntDef(TGUIEdit(GetControl('edRulezRespawnRandom')).Text, 0);
gsPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex;
gsMap := Map;
gsGameFlags := gsGameFlags or GAME_OPTION_WEAPONSTAY;
if TGUISwitch(GetControl('swMonsters')).ItemIndex = 0 then
gsGameFlags := gsGameFlags or GAME_OPTION_MONSTERS;
- if TGUISwitch(GetControl('swRulezRandom')).ItemIndex = 0 then
- gsGameFlags := gsGameFlags or GAME_OPTION_RULEZRANDOM;
case TGUISwitch(GetControl('swTeamHit')).ItemIndex of
1: gsGameFlags := gsGameFlags or GAME_OPTION_TEAMHITTRACE;
else gsGameFlags := gsGameFlags and not (GAME_OPTION_ALLOWDROPFLAG or GAME_OPTION_THROWFLAG);
end;
+ // TODO: get this crap out of here
+ gGameSettings.WarmupTime := gsWarmupTime;
+ gGameSettings.SpawnInvul := gsSpawnInvul;
+ end;
+
+ // HACK: We keep the variables for the items in a different menu
+ with TGUIMenu(g_GUI_GetWindow('ItemsRespawnMenu').GetControl('mItemsRespawnMenu')) do
+ begin
+ gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
+ gsItemRespawnRandom := StrToIntDef(TGUIEdit(GetControl('edItemRespawnRandom')).Text, 0);
+ gsRulezRespawnTime := StrToIntDef(TGUIEdit(GetControl('edRulezRespawnTime')).Text, 0);
+ gsRulezRespawnRandom := StrToIntDef(TGUIEdit(GetControl('edRulezRespawnRandom')).Text, 0);
+
+ if TGUISwitch(GetControl('swRulezRandom')).ItemIndex = 0 then
+ gsGameFlags := gsGameFlags or GAME_OPTION_RULEZRANDOM;
+
+ case TGUISwitch(GetControl('swItemsRandom')).ItemIndex of
+ 1: gsGameFlags := gsGameFlags or GAME_OPTION_ITEMHELPRANDOM;
+ 2: gsGameFlags := gsGameFlags or GAME_OPTION_ITEMAMMORANDOM;
+ 3: gsGameFlags := gsGameFlags or GAME_OPTION_ITEMWEAPONRANDOM;
+ 0: gsGameFlags := gsGameFlags or GAME_OPTION_ITEMALLRANDOM;
+ end;
+
// TODO: get this crap out of here
gGameSettings.ItemRespawnTime := gsItemRespawnTime;
+ gGameSettings.ItemRespawnRandom := gsItemRespawnRandom;
gGameSettings.RulezRespawnTime := gsRulezRespawnTime;
gGameSettings.RulezRespawnRandom := gsRulezRespawnRandom;
- gGameSettings.WarmupTime := gsWarmupTime;
- gGameSettings.SpawnInvul := gsSpawnInvul;
end;
end;
end;
end;
+procedure ProcItemsRespawnMenu();
+var
+ menu: TGUIMenu;
+begin
+ menu := TGUIMenu(g_GUI_GetWindow('ItemsRespawnMenu').GetControl('mItemsRespawnMenu'));
+
+ g_GUI_ShowWindow('ItemsRespawnMenu');
+end;
+
procedure ReadGameSettings();
var
menu: TGUIMenu;
if gsMaxLives > 0 then
Text := IntToStr(gsMaxLives);
end;
- with AddEdit(_lc[I_MENU_ITEM_RESPAWN_TIME]) do
- begin
- Name := 'edItemRespawnTime';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsItemRespawnTime > 0 then
- Text := IntToStr(gsItemRespawnTime);
- end;
- AddSpace(); // Rulez Respawn block
- with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_TIME]) do
- begin
- Name := 'edRulezRespawnTime';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsRulezRespawnTime > 0 then
- Text := IntToStr(gsRulezRespawnTime);
- end;
- with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_RANDOM]) do
- begin
- Name := 'edRulezRespawnRandom';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsRulezRespawnRandom > 0 then
- Text := IntToStr(gsRulezRespawnRandom);
- end;
- with AddSwitch(_lc[I_MENU_ENABLE_RULEZ_RANDOM]) do
+ with AddLabel(_lc[I_MENU_SELECT_ITEM_RESPAWN]) do
begin
- Name := 'swRulezRandom';
- AddItem(_lc[I_MENU_YES]);
- AddItem(_lc[I_MENU_NO]);
- if LongBool(gsGameFlags and GAME_OPTION_RULEZRANDOM) then
- ItemIndex := 0
- else
- ItemIndex := 1;
+ Name := 'lbItemsRespawn';
+ FixedLength := 16;
+ OnClick := @ProcItemsRespawnMenu;
end;
AddSpace();
with AddSwitch(_lc[I_MENU_PLAYERS]) do
if gsMaxLives > 0 then
Text := IntToStr(gsMaxLives);
end;
- with AddEdit(_lc[I_MENU_ITEM_RESPAWN_TIME]) do
+ with AddLabel(_lc[I_MENU_SELECT_ITEM_RESPAWN]) do
begin
- Name := 'edItemRespawnTime';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsItemRespawnTime > 0 then
- Text := IntToStr(gsItemRespawnTime);
- end;
- AddSpace(); // Rulez Respawn block
- with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_TIME]) do
- begin
- Name := 'edRulezRespawnTime';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsRulezRespawnTime > 0 then
- Text := IntToStr(gsRulezRespawnTime);
- end;
- with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_RANDOM]) do
- begin
- Name := 'edRulezRespawnRandom';
- OnlyDigits := True;
- Width := 4;
- MaxLength := 5;
- if gsRulezRespawnRandom > 0 then
- Text := IntToStr(gsRulezRespawnRandom);
- end;
- with AddSwitch(_lc[I_MENU_ENABLE_RULEZ_RANDOM]) do
- begin
- Name := 'swRulezRandom';
- AddItem(_lc[I_MENU_YES]);
- AddItem(_lc[I_MENU_NO]);
- if LongBool(gsGameFlags and GAME_OPTION_RULEZRANDOM) then
- ItemIndex := 0
- else
- ItemIndex := 1;
+ Name := 'lbItemsRespawn';
+ FixedLength := 16;
+ OnClick := @ProcItemsRespawnMenu;
end;
AddSpace();
with AddSwitch(_lc[I_MENU_PLAYERS]) do
Menu.DefControl := 'mSelectMapMenu';
g_GUI_AddWindow(Menu);
+ Menu := TGUIWindow.Create('ItemsRespawnMenu');
+ with TGUIMenu(Menu.AddChild(TGUIMenu.Create(gMenuFont, gMenuSmallFont, _lc[I_MENU_ITEM_RESPAWN]))) do
+ begin
+ Name := 'mItemsRespawnMenu';
+
+ // Switches separate from the time entry fields
+ with AddSwitch(_lc[I_MENU_ENABLE_RULEZ_RANDOM]) do
+ begin
+ Name := 'swRulezRandom';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ if LongBool(gsGameFlags and GAME_OPTION_RULEZRANDOM) then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
+ end;
+ with AddSwitch(_lc[I_MENU_ENABLE_ITEM_RANDOM]) do
+ begin
+ Name := 'swItemsRandom';
+ AddItem(_lc[I_MENU_ITEM_RANDOM_ALL]);
+ AddItem(_lc[I_MENU_ITEM_RANDOM_HELP_ONLY]);
+ AddItem(_lc[I_MENU_ITEM_RANDOM_AMMO_ONLY]);
+ AddItem(_lc[I_MENU_ITEM_RANDOM_WEAPON_ONLY]);
+ AddItem(_lc[I_MENU_ITEM_RANDOM_NOTHING]);
+ if LongBool(gsGameFlags and GAME_OPTION_ITEMALLRANDOM) then
+ ItemIndex := 0
+ else if LongBool(gsGameFlags and GAME_OPTION_ITEMHELPRANDOM) then
+ ItemIndex := 1
+ else if LongBool(gsGameFlags and GAME_OPTION_ITEMAMMORANDOM) then
+ ItemIndex := 2
+ else if LongBool(gsGameFlags and GAME_OPTION_ITEMWEAPONRANDOM) then
+ ItemIndex := 3
+ else
+ ItemIndex := 4;
+ end;
+ AddSpace();// Items Respawn block
+ with AddEdit(_lc[I_MENU_ITEM_RESPAWN_TIME]) do
+ begin
+ Name := 'edItemRespawnTime';
+ OnlyDigits := True;
+ Width := 4;
+ MaxLength := 5;
+ if gsItemRespawnTime > 0 then
+ Text := IntToStr(gsItemRespawnTime);
+ end;
+ with AddEdit(_lc[I_MENU_ITEM_RESPAWN_RANDOM]) do
+ begin
+ Name := 'edItemRespawnRandom';
+ OnlyDigits := True;
+ Width := 4;
+ MaxLength := 5;
+ if gsItemRespawnTime > 0 then
+ Text := IntToStr(gsItemRespawnRandom);
+ end;
+ // Rulez Respawn block
+ with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_TIME]) do
+ begin
+ Name := 'edRulezRespawnTime';
+ OnlyDigits := True;
+ Width := 4;
+ MaxLength := 5;
+ if gsRulezRespawnTime > 0 then
+ Text := IntToStr(gsRulezRespawnTime);
+ end;
+ with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_RANDOM]) do
+ begin
+ Name := 'edRulezRespawnRandom';
+ OnlyDigits := True;
+ Width := 4;
+ MaxLength := 5;
+ if gsRulezRespawnRandom > 0 then
+ Text := IntToStr(gsRulezRespawnRandom);
+ end;
+ AddSpace();
+ end;
+ Menu.DefControl := 'mItemsRespawnMenu';
+ g_GUI_AddWindow(Menu);
+
Menu := TGUIWindow.Create('OptionsMenu');
with TGUIMainMenu(Menu.AddChild(TGUIMainMenu.Create(gMenuFont, '', _lc[I_MENU_OPTIONS]))) do
begin
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index b0153192dc5c2c6995922ab13424c190c06f7073..13033d20cc1507bc8fb8acbcea9415f833224961 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
gsGameFlags: LongWord;
gsSpawnInvul: Integer = 0;
gsItemRespawnTime: Word = 60;
+ gsItemRespawnRandom: Word = 0;
gsRulezRespawnTime: Word = 60;
gsRulezRespawnRandom: Word = 0;
gsWarmupTime: Word = 30;
gsPlayers := 1;
gsSpawnInvul := 0;
gsItemRespawnTime := 60;
+ gsItemRespawnRandom := 0;
gsRulezRespawnTime := 60;
gsRulezRespawnRandom := 0;
gsGameFlags := GAME_OPTION_ALLOWEXIT or GAME_OPTION_DMKEYS or
MaxLives := gsMaxLives;
SpawnInvul := gsSpawnInvul;
ItemRespawnTime := gsItemRespawnTime;
+ ItemRespawnRandom := gsItemRespawnRandom;
RulezRespawnTime := gsRulezRespawnTime;
RulezRespawnRandom := gsRulezRespawnRandom;
WarmupTime := gsWarmupTime;