diff options
-rw-r--r-- | engines/dm/champion.cpp | 112 | ||||
-rw-r--r-- | engines/dm/champion.h | 4 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 6 | ||||
-rw-r--r-- | engines/dm/dmglobals.cpp | 3 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 12 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 4 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 12 |
7 files changed, 78 insertions, 75 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 57d7f5e17f..51f89f4d32 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -41,51 +41,6 @@ namespace DM { -uint16 gSlotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks - /* 30 for champion inventory, 8 for chest */ - 0xFFFF, /* Ready Hand Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Action Hand Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0x0002, /* Head Head */ - 0x0008, /* Torso Torso */ - 0x0010, /* Legs Legs */ - 0x0020, /* Feet Feet */ - 0x0100, /* Pouch 2 Pouch */ - 0x0080, /* Quiver Line2 1 Quiver 2 */ - 0x0080, /* Quiver Line1 2 Quiver 2 */ - 0x0080, /* Quiver Line2 2 Quiver 2 */ - 0x0004, /* Neck Neck */ - 0x0100, /* Pouch 1 Pouch */ - 0x0040, /* Quiver Line1 1 Quiver 1 */ - 0xFFFF, /* Backpack Line1 1 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 2 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 3 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 4 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 5 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 6 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 7 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 8 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line2 9 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 2 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 3 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 4 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 5 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 6 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 7 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 8 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0xFFFF, /* Backpack Line1 9 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ - 0x0400, /* Chest 1 Chest */ - 0x0400, /* Chest 2 Chest */ - 0x0400, /* Chest 3 Chest */ - 0x0400, /* Chest 4 Chest */ - 0x0400, /* Chest 5 Chest */ - 0x0400, /* Chest 6 Chest */ - 0x0400, /* Chest 7 Chest */ - 0x0400}; /* Chest 8 Chest */ - -Box gBoxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_ChampionPortrait - -const char *g417_baseSkillName[4]; - void ChampionMan::initConstants() { static const char *g417_baseSkillName_EN_ANY[4] = {"FIGHTER", "NINJA", "PRIEST", "WIZARD"}; static const char *g417_baseSkillName_DE_DEU[4] = {"KAEMPFER", "NINJA", "PRIESTER", "MAGIER"}; @@ -99,6 +54,49 @@ void ChampionMan::initConstants() { static Color championColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14}; int16 lightPowerToLightAmount[16] = {0, 5, 12, 24, 33, 40, 46, 51, 59, 68, 76, 82, 89, 94, 97, 100}; + uint16 slotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks + /* 30 for champion inventory, 8 for chest */ + 0xFFFF, /* Ready Hand Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Action Hand Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0x0002, /* Head Head */ + 0x0008, /* Torso Torso */ + 0x0010, /* Legs Legs */ + 0x0020, /* Feet Feet */ + 0x0100, /* Pouch 2 Pouch */ + 0x0080, /* Quiver Line2 1 Quiver 2 */ + 0x0080, /* Quiver Line1 2 Quiver 2 */ + 0x0080, /* Quiver Line2 2 Quiver 2 */ + 0x0004, /* Neck Neck */ + 0x0100, /* Pouch 1 Pouch */ + 0x0040, /* Quiver Line1 1 Quiver 1 */ + 0xFFFF, /* Backpack Line1 1 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 2 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 3 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 4 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 5 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 6 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 7 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 8 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line2 9 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 2 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 3 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 4 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 5 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 6 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 7 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 8 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0xFFFF, /* Backpack Line1 9 Mouth/Head/Neck/Torso/Legs/Feet/Quiver 1/Quiver 2/Pouch/Hands/Chest */ + 0x0400, /* Chest 1 Chest */ + 0x0400, /* Chest 2 Chest */ + 0x0400, /* Chest 3 Chest */ + 0x0400, /* Chest 4 Chest */ + 0x0400, /* Chest 5 Chest */ + 0x0400, /* Chest 6 Chest */ + 0x0400, /* Chest 7 Chest */ + 0x0400 /* Chest 8 Chest */ + }; + + _boxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_ChampionPortrait const char **g417_byLanguage; switch (_vm->getGameLanguage()) { // localized @@ -116,7 +114,7 @@ void ChampionMan::initConstants() { } for (int i = 0; i < 4; ++i) { - g417_baseSkillName[i] = g417_byLanguage[i]; + _baseSkillName[i] = g417_byLanguage[i]; _championColor[i] = championColor[i]; _boxChampionIcons[i] = boxChampionIcons[i]; } @@ -124,6 +122,8 @@ void ChampionMan::initConstants() { for (int i = 0; i < 16; i++) _lightPowerToLightAmount[i] = lightPowerToLightAmount[i]; + for (int i = 0; i < 38; i++) + _slotMasks[i] = slotMasks[i]; } ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) { @@ -1008,7 +1008,7 @@ void ChampionMan::f304_addSkillExperience(uint16 champIndex, uint16 skillIndex, case Common::FR_FRA: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " VIENT DE DEVENIR "); break; } - _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, g417_baseSkillName[baseSkillIndex]); + _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, _baseSkillName[baseSkillIndex]); switch (_vm->getGameLanguage()) { // localized default: @@ -1285,7 +1285,7 @@ void ChampionMan::f302_processCommands28to65_clickOnSlotBox(uint16 slotBoxIndex) if ((slotThing == Thing::_none) && (leaderHandObject == Thing::_none)) return; - if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(leaderHandObject)]._allowedSlots & gSlotMasks[slotIndex]))) + if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex]))) return; _vm->_eventMan->f78_showMouse(); @@ -1838,7 +1838,7 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) championPtr->resetToZero(); // Strangerke - TODO: Check if the new code is possible to run on the older version (example: the portraits could be missing in the data) _vm->_displayMan->_g578_useByteBoxCoordinates = true; - _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k26_ChampionPortraitsIndice), championPtr->_portrait, gBoxChampionPortrait, M27_getChampionPortraitX(championPortraitIndex), M28_getChampionPortraitY(championPortraitIndex), k128_byteWidth, k16_byteWidth, kM1_ColorNoTransparency, 87, 29); + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k26_ChampionPortraitsIndice), championPtr->_portrait, _boxChampionPortrait, M27_getChampionPortraitX(championPortraitIndex), M28_getChampionPortraitY(championPortraitIndex), k128_byteWidth, k16_byteWidth, kM1_ColorNoTransparency, 87, 29); championPtr->_actionIndex = k255_ChampionActionNone; championPtr->_enableActionEventIndex = -1; championPtr->_hideDamageReceivedIndex = -1; @@ -1931,12 +1931,12 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) ThingType thingType = curThing.getType(); if ((thingType > k3_SensorThingType) && (curThing.getCell() == championObjectsCell)) { int16 objectAllowedSlots = _vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(curThing)]._allowedSlots; - uint16 curSlotIndex; + uint16 curSlotIndex = k0_ChampionSlotReadyHand; switch (thingType) { case k6_ArmourThingType: { bool skipCheck = false; for (curSlotIndex = k2_ChampionSlotHead; curSlotIndex <= k5_ChampionSlotFeet; curSlotIndex++) { - if (objectAllowedSlots & gSlotMasks[curSlotIndex]) { + if (objectAllowedSlots & _slotMasks[curSlotIndex]) { skipCheck = true; break; } @@ -1945,7 +1945,7 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) if (skipCheck) break; - if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) + if ((objectAllowedSlots & _slotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) curSlotIndex = k10_ChampionSlotNeck; else curSlotIndex = slotIdx++; @@ -1955,7 +1955,7 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) case k5_WeaponThingType: if (championPtr->_slots[k1_ChampionSlotActionHand] == Thing::_none) curSlotIndex = k1_ChampionSlotActionHand; - else if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) + else if ((objectAllowedSlots & _slotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) curSlotIndex = k10_ChampionSlotNeck; else curSlotIndex = slotIdx++; @@ -1966,14 +1966,14 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) curSlotIndex = k11_ChampionSlotPouch_1; else if (championPtr->_slots[k6_ChampionSlotPouch_2] == Thing::_none) curSlotIndex = k6_ChampionSlotPouch_2; - else if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) + else if ((objectAllowedSlots & _slotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) curSlotIndex = k10_ChampionSlotNeck; else curSlotIndex = slotIdx++; break; case k9_ContainerThingType: case k10_JunkThingType: - if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) + if ((objectAllowedSlots & _slotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) curSlotIndex = k10_ChampionSlotNeck; else curSlotIndex = slotIdx++; @@ -1984,7 +1984,7 @@ void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) } while (championPtr->_slots[curSlotIndex] != Thing::_none) { - if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) + if ((objectAllowedSlots & _slotMasks[k10_ChampionSlotNeck]) && (championPtr->_slots[k10_ChampionSlotNeck] == Thing::_none)) curSlotIndex = k10_ChampionSlotNeck; else curSlotIndex = slotIdx++; diff --git a/engines/dm/champion.h b/engines/dm/champion.h index af039b754f..f7e9f1f013 100644 --- a/engines/dm/champion.h +++ b/engines/dm/champion.h @@ -448,7 +448,6 @@ public: #define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE #define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES -extern const char *g417_baseSkillName[4]; // @ G0417_apc_BaseSkillNames #define k0_spellCastFailure 0 // @ C0_SPELL_CAST_FAILURE #define k1_spellCastSuccess 1 // @ C1_SPELL_CAST_SUCCESS @@ -590,6 +589,9 @@ public: Box _boxChampionIcons[4]; Color _championColor[4]; int16 _lightPowerToLightAmount[16]; // g039_LightPowerToLightAmount + Box _boxChampionPortrait; + uint16 _slotMasks[38]; + const char *_baseSkillName[4]; }; } diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 9f84269b20..ac85b9d0c4 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -72,13 +72,13 @@ void warning(bool repeat, const char* s, ...) { va_end(va); if (repeat) { - ::warning(output.c_str()); + ::warning("%s", output.c_str()); } else { static Common::Array<Common::String> stringsPrinted; if (Common::find(stringsPrinted.begin(), stringsPrinted.end(), s) == stringsPrinted.end()) { stringsPrinted.push_back(output); - ::warning(output.c_str()); + ::warning("%s", output.c_str()); } } } @@ -683,7 +683,7 @@ void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) { char displStr[20]; strcpy(displStr, G0428_apc_SkillLevelNames[skillLevel - 2]); strcat(displStr, " "); - strcat(displStr, g417_baseSkillName[idx]); + strcat(displStr, _championMan->_baseSkillName[idx]); _textMan->f443_endgamePrintString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr); } championMirrorBox._y1 += 48; diff --git a/engines/dm/dmglobals.cpp b/engines/dm/dmglobals.cpp index 044659aa2e..6457c8510d 100644 --- a/engines/dm/dmglobals.cpp +++ b/engines/dm/dmglobals.cpp @@ -57,8 +57,7 @@ void DMEngine::initArrays() { } void DMEngine::f19_displayErrorAndStop(int16 errorIndex) { - debug("Stuff hit the fun: "); - debug(Common::String::format("%d", errorIndex).c_str()); + debug("Stuff hit the fun: %d", errorIndex); Common::Event event; while (_system->getEventManager()->pollEvent(event) || true) ; diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 8a17ce6fd5..287c454456 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -797,19 +797,19 @@ Square DungeonMan::f151_getSquare(int16 mapX, int16 mapY) { if (isMapYInBounds) { SquareType squareType = Square(_g271_currMapData[0][mapY]).getType(); - if (((mapX == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_ElementTypePit)) + if (((mapX == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0004_WallEastRandOrnAllowed); squareType = Square(_g271_currMapData[_g273_currMapWidth - 1][mapY]).getType(); - if (((mapX == _g273_currMapWidth) && (squareType == k1_CorridorElemType)) || (squareType == k2_ElementTypePit)) + if (((mapX == _g273_currMapWidth) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0001_WallWestRandOrnAllowed); } else if (isMapXInBounds) { SquareType squareType = Square(_g271_currMapData[mapX][0]).getType(); - if (((mapY == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_ElementTypePit)) + if (((mapY == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0002_WallSouthRandOrnAllowed); squareType = Square(_g271_currMapData[mapX][_g274_currMapHeight - 1]).getType(); - if (((mapY == _g274_currMapHeight) && (squareType == k1_CorridorElemType)) || (squareType == k2_ElementTypePit)) + if (((mapY == _g274_currMapHeight) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0008_WallNorthRandOrnAllowed); } return Square(k0_ElementTypeWall, 0); @@ -941,7 +941,7 @@ T0172010_ClosedFakeWall: AL0307_uc_FootprintsAllowed = true; } - while ((curThing != Thing::_endOfList) && ((Direction)curThing.getType() <= k3_SensorThingType)) { + while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) { if (curThing.getType() == k3_SensorThingType) { Sensor *curSensor = (Sensor*)f156_getThingData(curThing); aspectArray[k4_FloorOrnOrdAspect] = curSensor->getOrnOrdinal(); @@ -1271,6 +1271,8 @@ uint16 DungeonMan::f140_getObjectWeight(Thing thing) { case k7_ScrollThingType: weight = 1; break; + default: + break; } return weight; // this is garbage if none of the branches were taken diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index e2cfd96deb..3800b95f7e 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -825,10 +825,10 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() { case Common::DE_DEU: // english and german versions are the same strcpy(L1097_ac_String, G0428_apc_SkillLevelNames[AL1092_i_SkillLevel - 2]); strcat(L1097_ac_String, " "); - strcat(L1097_ac_String, g417_baseSkillName[AL1090_ui_SkillIndex]); + strcat(L1097_ac_String, _vm->_championMan->_baseSkillName[AL1090_ui_SkillIndex]); break; case Common::FR_FRA: - strcat(L1097_ac_String, g417_baseSkillName[AL1090_ui_SkillIndex]); + strcat(L1097_ac_String, _vm->_championMan->_baseSkillName[AL1090_ui_SkillIndex]); strcat(L1097_ac_String, " "); strcpy(L1097_ac_String, G0428_apc_SkillLevelNames[AL1092_i_SkillLevel - 2]); break; diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index abeadd721e..9aaff30f46 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -679,9 +679,9 @@ Spell* MenuMan::f409_getSpellFromSymbols(byte* symbols) { void MenuMan::f410_menusPrintSpellFailureMessage(Champion* champ, uint16 failureType, uint16 skillIndex) { char* L1264_pc_Message = nullptr; - if (skillIndex > k3_ChampionSkillWizard) { + if (skillIndex > k3_ChampionSkillWizard) skillIndex = (skillIndex - 4) / 4; - } + _vm->_textMan->f51_messageAreaPrintLineFeed(); _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, champ->_name); @@ -704,12 +704,12 @@ void MenuMan::f410_menusPrintSpellFailureMessage(Champion* champ, uint16 failure switch (failureType) { case k0_failureNeedsMorePractice: _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, messages[0]); - _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, g417_baseSkillName[skillIndex]); - if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == k3_ChampionSkillWizard) { + _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]); + if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == k3_ChampionSkillWizard) L1264_pc_Message = messages[1]; - } else { + else L1264_pc_Message = messages[4]; - } + break; case k1_failureMeaninglessSpell: L1264_pc_Message = messages[2]; |