From 0922d44199aa492cd57bc3fe1a40e0ff631e98ba Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Apr 2018 23:27:26 -0400 Subject: XEEN: Added differences introduced in Swords of Xeen --- engines/xeen/dialogs/dialogs_quests.cpp | 52 +++++++++++++++++++++------------ engines/xeen/dialogs/dialogs_spells.cpp | 41 +++++++++++++++++--------- 2 files changed, 61 insertions(+), 32 deletions(-) (limited to 'engines/xeen/dialogs') diff --git a/engines/xeen/dialogs/dialogs_quests.cpp b/engines/xeen/dialogs/dialogs_quests.cpp index 239793ee8c..1c91af2eba 100644 --- a/engines/xeen/dialogs/dialogs_quests.cpp +++ b/engines/xeen/dialogs/dialogs_quests.cpp @@ -44,8 +44,9 @@ void Quests::execute() { int count = 0; bool headerShown = false; int topRow = 0; - const char **questItems = (g_vm->getGameID() == GType_Swords) ? Res.QUEST_ITEM_NAMES_SWORDS : Res.QUEST_ITEM_NAMES; + const char **questItemNames = (g_vm->getGameID() == GType_Swords) ? Res.QUEST_ITEM_NAMES_SWORDS : Res.QUEST_ITEM_NAMES; int itemsCount = (g_vm->getGameID() == GType_Swords) ? TOTAL_QUEST_ITEMS_SWORDS : TOTAL_QUEST_ITEMS; + const char *title1 = (g_vm->getGameID() == GType_Swords) ? Res.SWORDS_OF_XEEN_LINE : Res.CLOUDS_OF_XEEN_LINE; addButtons(); loadQuestNotes(); @@ -75,30 +76,43 @@ void Quests::execute() { headerShown = false; for (int idx = 0; idx < itemsCount; ++idx) { if (party._questItems[idx]) { - if (!count && !headerShown && idx < 35) { - lines[count++] = Res.CLOUDS_OF_XEEN_LINE; + if (!count && !headerShown) { + if (_vm->getGameID() == GType_Swords) + lines[count++] = Res.SWORDS_OF_XEEN_LINE; + else if (idx < 35) + lines[count++] = title1; } if (idx >= 35 && !headerShown) { lines[count++] = Res.DARKSIDE_OF_XEEN_LINE; headerShown = true; } - switch (idx) { - case 17: - case 26: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: + bool multiFlag = false; + if (_vm->getGameID() == GType_Swords) { + multiFlag = (idx == 20) || (idx == 27) || (idx == 41); + } else { + switch (idx) { + case 17: + case 26: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + multiFlag = true; + break; + default: + break; + } + } + + if (multiFlag) { lines[count++] = Common::String::format("%d %s%c", - party._questItems[idx], questItems[idx], + party._questItems[idx], questItemNames[idx], party._questItems[idx] == 1 ? ' ' : 's'); - break; - default: - lines[count++] = questItems[idx]; - break; + } else { + lines[count++] = questItemNames[idx]; } } } @@ -125,7 +139,7 @@ void Quests::execute() { for (int idx = 0; idx < TOTAL_QUEST_FLAGS; ++idx) { if (party._questFlags[(idx + 1) / 30][(idx + 1) % 30]) { if (!count && !headerShown && idx < 29) { - lines[count++] = Res.CLOUDS_OF_XEEN_LINE; + lines[count++] = title1; } if (idx > 28 && !headerShown) { lines[count++] = Res.DARKSIDE_OF_XEEN_LINE; @@ -152,7 +166,7 @@ void Quests::execute() { for (int idx = 0; idx < MAX_DIALOG_LINES; ++idx) { if (party._worldFlags[idx]) { if (!count && !headerShown && idx < 72) { - lines[count++] = Res.CLOUDS_OF_XEEN_LINE; + lines[count++] = title1; } if (idx >= 72 && !headerShown) { lines[count++] = Res.DARKSIDE_OF_XEEN_LINE; diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp index 122b22985e..99ef0155c8 100644 --- a/engines/xeen/dialogs/dialogs_spells.cpp +++ b/engines/xeen/dialogs/dialogs_spells.cpp @@ -880,20 +880,35 @@ int TownPortal::execute() { Mode oldMode = _vm->_mode; _vm->_mode = MODE_FF; - // Build up a lsit of the names of the towns on the current side of Xeen - for (int idx = 0; idx < 5; ++idx) { - Common::String txtName = Common::String::format("%s%04d.txt", map._sideTownPortal ? "dark" : "xeen", - Res.TOWN_MAP_NUMBERS[map._sideTownPortal][idx]); - File f(txtName, 1); - townNames[idx] = f.readString(); - f.close(); + w.open(); + + if (_vm->getGameID() == GType_Swords) { + // Build up a lsit of the names of the towns on the current side of Xeen + for (int idx = 0; idx < 3; ++idx) { + Common::String txtName = Common::String::format("%s%04d.txt", "dark", Res.TOWN_MAP_NUMBERS[2][idx]); + File f(txtName, 1); + townNames[idx] = f.readString(); + f.close(); + } + + w.writeString(Common::String::format(Res.TOWN_PORTAL_SWORDS, townNames[0].c_str(), townNames[1].c_str(), + townNames[2].c_str())); + } else { + // Build up a lsit of the names of the towns on the current side of Xeen + for (int idx = 0; idx < 5; ++idx) { + Common::String txtName = Common::String::format("%s%04d.txt", map._sideTownPortal ? "dark" : "xeen", + Res.TOWN_MAP_NUMBERS[map._sideTownPortal][idx]); + File f(txtName, 1); + townNames[idx] = f.readString(); + f.close(); + } + + w.writeString(Common::String::format(Res.TOWN_PORTAL, + townNames[0].c_str(), townNames[1].c_str(), townNames[2].c_str(), + townNames[3].c_str(), townNames[4].c_str() + )); } - w.open(); - w.writeString(Common::String::format(Res.TOWN_PORTAL, - townNames[0].c_str(), townNames[1].c_str(), townNames[2].c_str(), - townNames[3].c_str(), townNames[4].c_str() - )); w.update(); // Get the town number @@ -902,7 +917,7 @@ int TownPortal::execute() { do { int result = Input::show(_vm, &w, num, 1, 160, true); townNumber = !result ? 0 : atoi(num.c_str()); - } while (townNumber > 5); + } while (townNumber > (_vm->getGameID() == GType_Swords ? 3 : 5)); w.close(); _vm->_mode = oldMode; -- cgit v1.2.3