Add option to enable singleplayer quests in multiplayer

This commit is contained in:
obligaron
2023-02-27 05:00:07 +01:00
committed by Anders Jenbo
parent 4fde59a494
commit adeeae2c52
6 changed files with 9 additions and 2 deletions
+1
View File
@@ -485,6 +485,7 @@ void InitGameInfo()
sgGameInitInfo.bTheoQuest = *sgOptions.Gameplay.theoQuest ? 1 : 0;
sgGameInitInfo.bCowQuest = *sgOptions.Gameplay.cowQuest ? 1 : 0;
sgGameInitInfo.bFriendlyFire = *sgOptions.Gameplay.friendlyFire ? 1 : 0;
sgGameInitInfo.fullQuests = (!gbIsMultiplayer || *sgOptions.Gameplay.multiplayerFullQuests) ? 1 : 0;
}
void NetSendLoPri(int playerId, const byte *data, size_t size)
+2 -1
View File
@@ -31,6 +31,7 @@ struct GameData {
uint8_t bTheoQuest;
uint8_t bCowQuest;
uint8_t bFriendlyFire;
uint8_t fullQuests;
};
/* @brief Contains info of running public game (for game list browsing) */
@@ -44,7 +45,7 @@ extern bool gbSomebodyWonGameKludge;
extern uint16_t sgwPackPlrOffsetTbl[MAX_PLRS];
extern uint8_t gbActivePlayers;
extern bool gbGameDestroyed;
extern GameData sgGameInitInfo;
extern DVL_API_FOR_TEST GameData sgGameInitInfo;
extern bool gbSelectProvider;
extern DVL_API_FOR_TEST bool gbIsMultiplayer;
extern std::string GameName;
+2
View File
@@ -1062,6 +1062,7 @@ GameplayOptions::GameplayOptions()
, theoQuest("Theo Quest", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Theo Quest"), N_("Enable Little Girl quest."), false)
, cowQuest("Cow Quest", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Cow Quest"), N_("Enable Jersey's quest. Lester the farmer is replaced by the Complete Nut."), false)
, friendlyFire("Friendly Fire", OptionEntryFlags::CantChangeInMultiPlayer, N_("Friendly Fire"), N_("Allow arrow/spell damage between players in multiplayer even when the friendly mode is on."), true)
, multiplayerFullQuests("MultiplayerFullQuests", OptionEntryFlags::CantChangeInMultiPlayer, N_("Full quests in Multiplayer"), N_("Enables the full/uncut singleplayer version of quests."), false)
, testBard("Test Bard", OptionEntryFlags::CantChangeInGame, N_("Test Bard"), N_("Force the Bard character type to appear in the hero selection menu."), false)
, testBarbarian("Test Barbarian", OptionEntryFlags::CantChangeInGame, N_("Test Barbarian"), N_("Force the Barbarian character type to appear in the hero selection menu."), false)
, experienceBar("Experience Bar", OptionEntryFlags::None, N_("Experience Bar"), N_("Experience Bar is added to the UI at the bottom of the screen."), false)
@@ -1110,6 +1111,7 @@ std::vector<OptionEntryBase *> GameplayOptions::GetEntries()
&theoQuest,
&cowQuest,
&friendlyFire,
&multiplayerFullQuests,
&testBard,
&testBarbarian,
&experienceBar,
+2
View File
@@ -540,6 +540,8 @@ struct GameplayOptions : OptionCategoryBase {
OptionEntryBoolean cowQuest;
/** @brief Will players still damage other players in non-PvP mode. */
OptionEntryBoolean friendlyFire;
/** @brief Enables the full/uncut singleplayer version of quests. */
OptionEntryBoolean multiplayerFullQuests;
/** @brief Enable the bard hero class. */
OptionEntryBoolean testBard;
/** @brief Enable the babarian hero class. */
+1 -1
View File
@@ -945,7 +945,7 @@ void SetMultiQuest(int q, quest_state s, bool log, int v1, int v2, int16_t qmsg)
bool UseMultiplayerQuests()
{
return gbIsMultiplayer;
return sgGameInitInfo.fullQuests == 0;
}
bool Quest::IsAvailable()
+1
View File
@@ -57,6 +57,7 @@ void TestInitGame(bool fullQuests = true, bool originalCathedral = true)
MyPlayer = &Players[0];
MyPlayer->pOriginalCathedral = originalCathedral;
sgGameInitInfo.fullQuests = fullQuests ? 1 : 0;
gbIsMultiplayer = !fullQuests;
InitQuests();