From fbed39276714cc1eeeb03c04c834365beb5ada38 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 13 Apr 2018 22:56:37 -0400 Subject: XEEN: Add launcher Engine tab option for more durable armor --- engines/xeen/character.cpp | 2 +- engines/xeen/detection.cpp | 11 +++++++++++ engines/xeen/detection_tables.h | 12 ++++++------ engines/xeen/xeen.cpp | 1 + engines/xeen/xeen.h | 3 ++- 5 files changed, 21 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index 1f53b2bbfe..cbade04248 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -1222,7 +1222,7 @@ void Character::subtractHitPoints(int amount) { // Subtract the given HP amount _currentHp -= amount; - bool breakFlag = _currentHp <= -10; + bool breakFlag = _currentHp <= (g_vm->_extOptions._durableArmor ? -80 : -10); assert(_currentHp < 65000); if (_currentHp < 1) { diff --git a/engines/xeen/detection.cpp b/engines/xeen/detection.cpp index abf82188a9..91eab285b3 100644 --- a/engines/xeen/detection.cpp +++ b/engines/xeen/detection.cpp @@ -73,6 +73,7 @@ static const PlainGameDescriptor XeenGames[] = { }; #define GAMEOPTION_SHOW_ITEM_COSTS GUIO_GAMEOPTIONS1 +#define GAMEOPTION_DURABLE_ARMOR GUIO_GAMEOPTIONS2 #include "xeen/detection_tables.h" @@ -88,6 +89,16 @@ static const ADExtraGuiOptionsMap optionsList[] = { } }, + { + GAMEOPTION_DURABLE_ARMOR, + { + _s("More durable armor"), + _s("Armor won't break until character is at -80HP, rather than merely -10HP"), + "DurableArmor", + false + } + }, + AD_EXTRA_GUI_OPTIONS_TERMINATOR }; diff --git a/engines/xeen/detection_tables.h b/engines/xeen/detection_tables.h index 282fc62cc7..36c116fc2c 100644 --- a/engines/xeen/detection_tables.h +++ b/engines/xeen/detection_tables.h @@ -36,7 +36,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_WorldOfXeen, 0 @@ -55,7 +55,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_WorldOfXeen, 0 @@ -74,7 +74,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_WorldOfXeen, 0 @@ -92,7 +92,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_Clouds, 0 @@ -110,7 +110,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_DarkSide, 0 @@ -128,7 +128,7 @@ static const XeenGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GAMEOPTION_SHOW_ITEM_COSTS) + GUIO2(GAMEOPTION_SHOW_ITEM_COSTS, GAMEOPTION_DURABLE_ARMOR) }, GType_Swords, 0 diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index d5240287ac..1e15ec7792 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -129,6 +129,7 @@ void XeenEngine::loadSettings() { _finalScore = ConfMan.hasKey("final_score") ? ConfMan.getInt("final_score") : 0; _extOptions._showItemCosts = ConfMan.hasKey("ShowItemCosts") && ConfMan.getBool("ShowItemCosts"); + _extOptions._durableArmor = ConfMan.hasKey("DurableArmor") && ConfMan.getBool("DurableArmor"); // If requested, load a savegame instead of showing the intro if (ConfMan.hasKey("save_slot")) { diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h index 93be6d202f..85cc01d7e7 100644 --- a/engines/xeen/xeen.h +++ b/engines/xeen/xeen.h @@ -112,8 +112,9 @@ class XeenEngine : public Engine { */ struct ExtendedOptions { bool _showItemCosts; + bool _durableArmor; - ExtendedOptions() : _showItemCosts(false) {} + ExtendedOptions() : _showItemCosts(false), _durableArmor(false) {} }; private: const XeenGameDescription *_gameDescription; -- cgit v1.2.3