summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4774edd)
raw | patch | inline | side by side (parent: 4774edd)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 9 Feb 2020 02:17:27 +0000 (05:17 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 9 Feb 2020 02:17:27 +0000 (05:17 +0300) |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index cf87c940dd9abc81ef4e179bcba5259f7a86c42c..0d31e221c6c5c0950e515552fe1b7ed26396620d 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
GAME_OPTION_BOTVSPLAYER = 32;
GAME_OPTION_BOTVSMONSTER = 64;
GAME_OPTION_DMKEYS = 128;
GAME_OPTION_BOTVSPLAYER = 32;
GAME_OPTION_BOTVSMONSTER = 64;
GAME_OPTION_DMKEYS = 128;
+ GAME_OPTION_RESPAWNITEMS = 256;
STATE_NONE = 0;
STATE_MENU = 1;
STATE_NONE = 0;
STATE_MENU = 1;
g_Console_Add(_lc[I_MSG_DMKEYS_ON])
else
g_Console_Add(_lc[I_MSG_DMKEYS_OFF]);
g_Console_Add(_lc[I_MSG_DMKEYS_ON])
else
g_Console_Add(_lc[I_MSG_DMKEYS_OFF]);
- g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
+
+ if g_Game_IsNet then MH_SEND_GameSettings;
+ end;
+ end
+ else if (cmd = 'g_respawn_items') and not g_Game_IsClient then
+ begin
+ with gGameSettings do
+ begin
+ if (Length(P) > 1) and
+ ((P[1] = '1') or (P[1] = '0')) then
+ begin
+ if (P[1][1] = '1') then
+ Options := Options or GAME_OPTION_RESPAWNITEMS
+ else
+ Options := Options and (not GAME_OPTION_RESPAWNITEMS);
+ end;
+
+ if (LongBool(Options and GAME_OPTION_RESPAWNITEMS)) then
+ g_Console_Add(_lc[I_MSG_RESPAWNITEMS_ON])
+ else
+ g_Console_Add(_lc[I_MSG_RESPAWNITEMS_OFF]);
if g_Game_IsNet then MH_SEND_GameSettings;
end;
if g_Game_IsNet then MH_SEND_GameSettings;
end;
diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index 8efa5ca9fb4626cd1907e805d640db44e5153033..07c4df2b1d8e929832c6ac67b97f548de27b3d4d 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
it.slotIsUsed := true;
it.ItemType := ItemType;
it.slotIsUsed := true;
it.ItemType := ItemType;
- it.Respawnable := Respawnable;
- if g_Game_IsServer and (ITEM_RESPAWNTIME = 0) then it.Respawnable := False;
+ if g_Game_IsServer and ((ITEM_RESPAWNTIME = 0) or not LongBool(gGameSettings.Options and GAME_OPTION_RESPAWNITEMS)) then
+ it.Respawnable := False
+ else
+ it.Respawnable := Respawnable;
it.InitX := X;
it.InitY := Y;
it.RespawnTime := 0;
it.InitX := X;
it.InitY := Y;
it.RespawnTime := 0;
index 8ccc8ea8a70e2eb9229530e659de6f7e7cb8af29..1aad7c6823c3cc7fcb061768556076f6b1de918d 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
I_MENU_GOAL_LIMIT,
I_MENU_MAX_LIVES,
I_MENU_TEAM_DAMAGE,
I_MENU_GOAL_LIMIT,
I_MENU_MAX_LIVES,
I_MENU_TEAM_DAMAGE,
+ I_MENU_RESPAWN_ITEMS,
I_MENU_ENABLE_EXITS,
I_MENU_WEAPONS_STAY,
I_MENU_ENABLE_MONSTERS,
I_MENU_ENABLE_EXITS,
I_MENU_WEAPONS_STAY,
I_MENU_ENABLE_MONSTERS,
I_MSG_ALLOWMON_OFF,
I_MSG_DMKEYS_ON,
I_MSG_DMKEYS_OFF,
I_MSG_ALLOWMON_OFF,
I_MSG_DMKEYS_ON,
I_MSG_DMKEYS_OFF,
+ I_MSG_RESPAWNITEMS_ON,
+ I_MSG_RESPAWNITEMS_OFF,
I_MSG_BOTSVSPLAYERS_ON,
I_MSG_BOTSVSPLAYERS_OFF,
I_MSG_BOTSVSMONSTERS_ON,
I_MSG_BOTSVSPLAYERS_ON,
I_MSG_BOTSVSPLAYERS_OFF,
I_MSG_BOTSVSMONSTERS_ON,
'Æèçíè:'),
('MENU TEAM DAMAGE', 'Friendly Fire:',
'Óðîí ñâîèõ:'),
'Æèçíè:'),
('MENU TEAM DAMAGE', 'Friendly Fire:',
'Óðîí ñâîèõ:'),
+ ('MENU RESPAWN ITEMS', 'Respawn Items:',
+ 'Ðåñïàâíèòü ïðåäìåòû:'),
('MENU ENABLE EXITS', 'Enable Exit:',
'Âêëþ÷èòü âûõîä:'),
('MENU WEAPONS STAY', 'Weapons stay:',
('MENU ENABLE EXITS', 'Enable Exit:',
'Âêëþ÷èòü âûõîä:'),
('MENU WEAPONS STAY', 'Weapons stay:',
'Ìîíñòðû â DM âêëþ÷åíû*'),
('MSG ALLOWMON OFF', 'Monsters in DM disabled*',
'Ìîíñòðû â DM âûêëþ÷åíû*'),
'Ìîíñòðû â DM âêëþ÷åíû*'),
('MSG ALLOWMON OFF', 'Monsters in DM disabled*',
'Ìîíñòðû â DM âûêëþ÷åíû*'),
- ('MSG DMKEYS ON', 'Spawning with all keys in DM enabled*',
- 'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âêëþ÷åí*'),
- ('MSG DMKEYS OFF', 'Spawning with all keys in DM disabled*',
- 'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âûêëþ÷åí*'),
+ ('MSG DMKEYS ON', 'Spawning with all keys in DM enabled',
+ 'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âêëþ÷åí'),
+ ('MSG DMKEYS OFF', 'Spawning with all keys in DM disabled',
+ 'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âûêëþ÷åí'),
+ ('MSG RESPAWNITEMS ON', 'Respawning items enabled',
+ 'Ðåñïàâí ïðåäìåòîâ âêëþ÷åí'),
+ ('MSG RESPAWNITEMS OFF', 'Respawning items disabled',
+ 'Ðåñïàâí ïðåäìåòîâ âûêëþ÷åí'),
('MSG BOTSVSPLAYERS ON', 'Bots attack players',
'Áîòû ïðîòèâ èãðîêîâ'),
('MSG BOTSVSPLAYERS OFF', 'Bots ignore players',
('MSG BOTSVSPLAYERS ON', 'Bots attack players',
'Áîòû ïðîòèâ èãðîêîâ'),
('MSG BOTSVSPLAYERS OFF', 'Bots ignore players',
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 3cfec36d6f79ba50f00c1d6c9748991bf9fe71b7..8331660c6107c21c00137101818cc3ce0aa28a37 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
gcMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
gcMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
+ gcRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gcMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := 0;
if gcTeamDamage then
Options := Options or GAME_OPTION_TEAMDAMAGE;
gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gcMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := 0;
if gcTeamDamage then
Options := Options or GAME_OPTION_TEAMDAMAGE;
+ if gcRespawnItems then
+ Options := Options or GAME_OPTION_RESPAWNITEMS;
if gcAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gcWeaponStay then
if gcAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gcWeaponStay then
NetPort := StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
NetPort := StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
+ gnRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gnMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := 0;
if gnTeamDamage then
Options := Options or GAME_OPTION_TEAMDAMAGE;
gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gnMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := 0;
if gnTeamDamage then
Options := Options or GAME_OPTION_TEAMDAMAGE;
+ if gnRespawnItems then
+ Options := Options or GAME_OPTION_RESPAWNITEMS;
if gnAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gnWeaponStay then
if gnAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gnWeaponStay then
else
ItemIndex := 1;
end;
else
ItemIndex := 1;
end;
+ with AddSwitch(_lc[I_MENU_RESPAWN_ITEMS]) do
+ begin
+ Name := 'swRespawnItems';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ if gnRespawnItems then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
+ end;
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
else
ItemIndex := 1;
end;
else
ItemIndex := 1;
end;
+ with AddSwitch(_lc[I_MENU_RESPAWN_ITEMS]) do
+ begin
+ Name := 'swRespawnItems';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ if gcRespawnItems then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
+ end;
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index c923a6771fdb120124f71ef6a778720633af8ffc..02889313813d3d9cbbba34e7db62f47efa24e6ac 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
gcMonsters: Boolean;
gcBotsVS: String;
gcDeathmatchKeys: Boolean = True;
gcMonsters: Boolean;
gcBotsVS: String;
gcDeathmatchKeys: Boolean = True;
+ gcRespawnItems: Boolean = True;
gcSpawnInvul: Integer = 0;
gnMap: String;
gnGameMode: String;
gcSpawnInvul: Integer = 0;
gnMap: String;
gnGameMode: String;
gnMonsters: Boolean;
gnBotsVS: String;
gnDeathmatchKeys: Boolean = True;
gnMonsters: Boolean;
gnBotsVS: String;
gnDeathmatchKeys: Boolean = True;
+ gnRespawnItems: Boolean = True;
gnSpawnInvul: Integer = 0;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
gnSpawnInvul: Integer = 0;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
gcMonsters := False;
gcBotsVS := 'Everybody';
gcDeathmatchKeys := True;
gcMonsters := False;
gcBotsVS := 'Everybody';
gcDeathmatchKeys := True;
+ gcRespawnItems := True;
gcSpawnInvul := 0;
(* section GameplayNetwork *)
gcSpawnInvul := 0;
(* section GameplayNetwork *)
gnMonsters := False;
gnBotsVS := 'Everybody';
gnDeathmatchKeys := True;
gnMonsters := False;
gnBotsVS := 'Everybody';
gnDeathmatchKeys := True;
+ gnRespawnItems := True;
gnSpawnInvul := 0;
(* section MasterServer *)
gnSpawnInvul := 0;
(* section MasterServer *)
ReadBoolean(gcMonsters, 'Monsters');
ReadString(gcBotsVS, 'BotsVS');
ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
ReadBoolean(gcMonsters, 'Monsters');
ReadString(gcBotsVS, 'BotsVS');
ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
+ ReadBoolean(gcRespawnItems, 'RespawnItems');
ReadInteger(gcSpawnInvul, 'SpawnInvul');
with gGameSettings do
ReadInteger(gcSpawnInvul, 'SpawnInvul');
with gGameSettings do
Options := Options or GAME_OPTION_BOTVSMONSTER;
if gcDeathmatchKeys then
Options := Options or GAME_OPTION_DMKEYS;
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';
end;
section := 'GameplayNetwork';
ReadBoolean(gnMonsters, 'Monsters');
ReadString(gnBotsVS, 'BotsVS');
ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
ReadBoolean(gnMonsters, 'Monsters');
ReadString(gnBotsVS, 'BotsVS');
ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
+ ReadBoolean(gnRespawnItems, 'RespawnItems');
ReadInteger(gnSpawnInvul, 'SpawnInvul');
section := 'MasterServer';
ReadInteger(gnSpawnInvul, 'SpawnInvul');
section := 'MasterServer';
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
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.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
config.WriteStr ('GameplayNetwork', 'Map', gnMap);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
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 ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
config.WriteStr('MasterServer', 'IP', NetSlistIP);
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
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.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
config.SaveFile(FileName);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
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.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
config.SaveFile(FileName);