DM: Rename members of InventoryMan

This commit is contained in:
Strangerke 2016-08-25 21:25:18 +02:00 committed by Bendegúz Nagy
parent 5c81e4f4fd
commit 5b05f3cff4
8 changed files with 205 additions and 206 deletions

View File

@ -457,7 +457,7 @@ void ChampionMan::drawChangedObjectIcons() {
ObjectMan &objMan = *_vm->_objectMan;
MenuMan &menuMan = *_vm->_menuMan;
uint16 invChampOrdinal = invMan._g432_inventoryChampionOrdinal;
uint16 invChampOrdinal = invMan._inventoryChampionOrdinal;
if (_candidateChampionOrdinal && !invChampOrdinal)
return;
@ -503,8 +503,8 @@ void ChampionMan::drawChangedObjectIcons() {
}
}
if (invMan._g424_panelContent == k4_PanelContentChest) {
thing = invMan._g425_chestSlots;
if (invMan._panelContent == k4_PanelContentChest) {
thing = invMan._chestSlots;
for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) {
drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
}
@ -532,7 +532,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
Champion *champ = &_champions[champIndex];
if (slotIndex >= k30_ChampionSlotChest_1) {
invMan._g425_chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing;
invMan._chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing;
} else {
champ->setSlot(slotIndex, thing);
}
@ -540,7 +540,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
champ->_load += dunMan.getObjectWeight(thing);
champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
IconIndice iconIndex = objMan.f33_getIconIndex(thing);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal);
applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
uint16 *rawObjPtr = dunMan.getThingData(thing);
@ -558,7 +558,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if (iconIndex == k4_IconIndiceWeaponTorchUnlit) {
((Weapon *)rawObjPtr)->setLit(true);
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
drawChangedObjectIcons();
} else if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand) &&
((iconIndex == k144_IconIndiceContainerChestClosed) || ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)))) {
@ -568,7 +568,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if ((iconIndex >= k12_IconIndiceJunkIllumuletUnequipped) && (iconIndex <= k13_IconIndiceJunkIllumuletEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
_party._magicalLightAmount += _lightPowerToLightAmount[2];
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
iconIndex = (IconIndice)(iconIndex + 1);
} else if ((iconIndex >= k10_IconIndiceJunkJewelSymalUnequipped) && (iconIndex <= k11_IconIndiceJunkJewelSymalEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
@ -665,8 +665,8 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
Thing curThing;
if (slotIndex >= k30_ChampionSlotChest_1) {
curThing = _vm->_inventoryMan->_g425_chestSlots[slotIndex - k30_ChampionSlotChest_1];
_vm->_inventoryMan->_g425_chestSlots[slotIndex - k30_ChampionSlotChest_1] = Thing::_none;
curThing = _vm->_inventoryMan->_chestSlots[slotIndex - k30_ChampionSlotChest_1];
_vm->_inventoryMan->_chestSlots[slotIndex - k30_ChampionSlotChest_1] = Thing::_none;
} else {
curThing = curChampion->_slots[slotIndex];
curChampion->_slots[slotIndex] = Thing::_none;
@ -675,7 +675,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if (curThing == Thing::_none)
return Thing::_none;
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal);
int16 curIconIndex = _vm->_objectMan->f33_getIconIndex(curThing);
// Remove object modifiers
applyModifiersToStatistics(curChampion, slotIndex, curIconIndex, -1, curThing);
@ -685,7 +685,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if ((curIconIndex >= k12_IconIndiceJunkIllumuletUnequipped) && (curIconIndex <= k13_IconIndiceJunkIllumuletEquipped)) {
((Junk *)curWeapon)->setChargeCount(0);
_party._magicalLightAmount -= _lightPowerToLightAmount[2];
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
} else if ((curIconIndex >= k10_IconIndiceJunkJewelSymalUnequipped) && (curIconIndex <= k11_IconIndiceJunkJewelSymalEquipped)) {
((Junk *)curWeapon)->setChargeCount(0);
}
@ -709,14 +709,14 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if ((curIconIndex >= k4_IconIndiceWeaponTorchUnlit) && (curIconIndex <= k7_IconIndiceWeaponTorchLit)) {
curWeapon->setLit(false);
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
drawChangedObjectIcons();
}
if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand)) {
switch (curIconIndex) {
case k144_IconIndiceContainerChestClosed:
_vm->_inventoryMan->f334_closeChest();
_vm->_inventoryMan->closeChest();
// No break on purpose
case k30_IconIndiceScrollOpen:
case k31_IconIndiceScrollClosed:
@ -1108,7 +1108,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
Champion *curChampion = &_champions[champIndex];
addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) && (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
setFlag(curChampion->_attributes, k0x0800_ChampionAttributePanel);
}
@ -1299,19 +1299,19 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) {
return;
champIndex = slotBoxIndex >> 1;
if ((champIndex >= _partyChampionCount) || (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) || !_champions[champIndex]._currHealth)
if ((champIndex >= _partyChampionCount) || (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) || !_champions[champIndex]._currHealth)
return;
slotIndex = getHandSlotIndex(slotBoxIndex);
} else {
champIndex = _vm->ordinalToIndex(_vm->_inventoryMan->_g432_inventoryChampionOrdinal);
champIndex = _vm->ordinalToIndex(_vm->_inventoryMan->_inventoryChampionOrdinal);
slotIndex = slotBoxIndex - k8_SlotBoxInventoryFirstSlot;
}
Thing leaderHandObject = _leaderHandObject;
Thing slotThing;
if (slotIndex >= k30_ChampionSlotChest_1) {
slotThing = _vm->_inventoryMan->_g425_chestSlots[slotIndex - k30_ChampionSlotChest_1];
slotThing = _vm->_inventoryMan->_chestSlots[slotIndex - k30_ChampionSlotChest_1];
} else {
slotThing = _champions[champIndex]._slots[slotIndex];
}
@ -1397,7 +1397,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
blitBox._y1 = 0;
_vm->_eventMan->showMouse();
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
blitBox._y2 = 28;
blitBox._x1 = textPosX + 7;
blitBox._x2 = blitBox._x1 + 31; /* Box is over the champion portrait in the status box */
@ -1450,7 +1450,7 @@ void ChampionMan::championKill(uint16 champIndex) {
Champion *curChampion = &_champions[champIndex];
curChampion->_currHealth = 0;
setFlag(curChampion->_attributes, k0x1000_ChampionAttributeStatusBox);
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingEye) {
_vm->_pressingEye = false;
_vm->_eventMan->_ignoreMouseMovements = false;
@ -1465,7 +1465,7 @@ void ChampionMan::championKill(uint16 champIndex) {
_vm->_eventMan->_hideMousePointerRequestCount = 1;
_vm->_eventMan->hideMouse();
}
_vm->_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory);
_vm->_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
}
dropAllObjects(champIndex);
Thing unusedThing = _vm->_dungeonMan->getUnusedThing(k0x8000_championBones | k10_JunkThingType);
@ -1684,8 +1684,8 @@ void ChampionMan::applyTimeEffects() {
setFlag(championPtr->_attributes, k0x0400_ChampionAttributeIcon);
}
setFlag(championPtr->_attributes, k0x0100_ChampionAttributeStatistics);
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
setFlag(championPtr->_attributes, k0x0800_ChampionAttributePanel);
}
}
@ -2027,7 +2027,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
}
curThing = _vm->_dungeonMan->getNextThing(curThing);
}
_vm->_inventoryMan->f355_toggleInventory((ChampionIndex)previousPartyChampionCount);
_vm->_inventoryMan->toggleInventory((ChampionIndex)previousPartyChampionCount);
_vm->_menuMan->f456_drawDisabledMenu();;
}
@ -2119,7 +2119,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
if (!getFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand))
return;
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal);
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_eventMan->showMouse();
if (getFlag(championAttributes, k0x1000_ChampionAttributeStatusBox)) {
@ -2148,7 +2148,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndices[borderCount]), &box, k40_byteWidth, k10_ColorFlesh, 29);
if (isInventoryChampion) {
_vm->_inventoryMan->f354_drawStatusBoxPortrait(champIndex);
_vm->_inventoryMan->drawStatusBoxPortrait(champIndex);
setFlag(championAttributes, k0x0100_ChampionAttributeStatistics);
} else
setFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand);
@ -2262,12 +2262,12 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
if (getFlag(championAttributes, k0x0800_ChampionAttributePanel) && isInventoryChampion) {
if (_vm->_pressingMouth)
_vm->_inventoryMan->f345_drawPanelFoodWaterPoisoned();
_vm->_inventoryMan->drawPanelFoodWaterPoisoned();
else if (_vm->_pressingEye) {
if (_leaderEmptyHanded)
_vm->_inventoryMan->f351_drawChampionSkillsAndStatistics();
_vm->_inventoryMan->drawChampionSkillsAndStatistics();
} else
_vm->_inventoryMan->f347_drawPanel();
_vm->_inventoryMan->drawPanel();
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
}
@ -2297,7 +2297,7 @@ void ChampionMan::drawHealthStaminaManaValues(Champion* champ) {
void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
int16 nativeBitmapIndex = -1;
Champion *champ = &_champions[champIndex];
bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex));
bool isInventoryChamp = (_vm->_inventoryMan->_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex));
uint16 slotBoxIndex;
if (!isInventoryChamp) {
@ -2310,7 +2310,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
Thing thing;
if (slotIndex >= k30_ChampionSlotChest_1)
thing = _vm->_inventoryMan->_g425_chestSlots[slotIndex - k30_ChampionSlotChest_1];
thing = _vm->_inventoryMan->_chestSlots[slotIndex - k30_ChampionSlotChest_1];
else
thing = champ->getSlot((ChampionSlot)slotIndex);
@ -2388,7 +2388,7 @@ void ChampionMan::renameChampion(Champion* champ) {
displayBox._x2 = displayBox._x1 + 167;
_vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, displayBox, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->g32_BoxPanel, k72_byteWidth, k4_ColorCyan, 73);
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->_boxPanel, k72_byteWidth, k4_ColorCyan, 73);
_vm->_textMan->f52_printToViewport(177, 58, k13_ColorLightestGray, "_______");
_vm->_textMan->f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________");
_vm->_eventMan->showMouse();

View File

@ -369,7 +369,7 @@ void DMEngine::processNewPartyMap(uint16 mapIndex) {
_dungeonMan->setCurrentMapAndPartyMap(mapIndex);
_displayMan->loadCurrentMapGraphics();
_groupMan->addAllActiveGroups();
_inventoryMan->f337_setDungeonViewPalette();
_inventoryMan->setDungeonViewPalette();
}
Common::Error DMEngine::run() {
@ -449,7 +449,7 @@ void DMEngine::gameloop() {
break;
}
if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_partyIsSleeping) {
if (!_inventoryMan->_inventoryChampionOrdinal && !_championMan->_partyIsSleeping) {
Box box(0, 223, 0, 135);
_displayMan->fillBoxBitmap(_displayMan->_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code)
_displayMan->drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
@ -476,7 +476,7 @@ void DMEngine::gameloop() {
_gameTime++;
if (!(_gameTime & 511))
_inventoryMan->f338_decreaseTorchesLightPower();
_inventoryMan->decreaseTorchesLightPower();
if (_championMan->_party._freezeLifeTicks)
_championMan->_party._freezeLifeTicks -= 1;
@ -501,11 +501,11 @@ void DMEngine::gameloop() {
if (_stopPressingEye) {
_pressingEye = false;
_stopPressingEye = false;
_inventoryMan->f353_drawStopPressingEye();
_inventoryMan->drawStopPressingEye();
} else if (_stopPressingMouth) {
_pressingMouth = false;
_stopPressingMouth = false;
_inventoryMan->f350_drawStopPressingMouth();
_inventoryMan->drawStopPressingMouth();
}
_eventMan->processCommandQueue();
@ -679,7 +679,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
continue;
char displStr[20];
strcpy(displStr, _inventoryMan->G0428_apc_SkillLevelNames[skillLevel - 2]);
strcpy(displStr, _inventoryMan->_skillLevelNames[skillLevel - 2]);
strcat(displStr, " ");
strcat(displStr, _championMan->_baseSkillName[idx]);
_textMan->f443_endgamePrintString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr);
@ -960,12 +960,12 @@ void DMEngine::fuseSequnce() {
_gameWon = true;
if (_inventoryMan->_g432_inventoryChampionOrdinal) {
_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory);
if (_inventoryMan->_inventoryChampionOrdinal) {
_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
}
_eventMan->highlightBoxDisable();
_championMan->_party._magicalLightAmount = 200;
_inventoryMan->f337_setDungeonViewPalette();
_inventoryMan->setDungeonViewPalette();
_championMan->_party._fireShieldDefense = _championMan->_party._spellShieldDefense = _championMan->_party._shieldDefense = 100;
_timeline->f260_timelineRefreshAllChampionStatusBoxes();
fuseSequenceUpdate();

View File

@ -539,7 +539,7 @@ void EventManager::buildpointerScreenArea(int16 mousePosX, int16 mousePosY) {
_mousePointerType = k4_pointerTypeAutoselect;
else {
championIdx++;
if (championIdx == _vm->_inventoryMan->_g432_inventoryChampionOrdinal)
if (championIdx == _vm->_inventoryMan->_inventoryChampionOrdinal)
_mousePointerType = k0_pointerTypeArrow;
else if (mousePosY <= 6)
_mousePointerType = k0_pointerTypeArrow;
@ -780,14 +780,14 @@ void EventManager::processCommandQueue() {
int16 championIndex = cmdType - k7_CommandToggleInventoryChampion_0;
if (((championIndex == k4_ChampionCloseInventory) || (championIndex < _vm->_championMan->_partyChampionCount)) && !_vm->_championMan->_candidateChampionOrdinal)
_vm->_inventoryMan->f355_toggleInventory((ChampionIndex)championIndex);
_vm->_inventoryMan->toggleInventory((ChampionIndex)championIndex);
return;
}
if (cmdType == k83_CommandToggleInventoryLeader) {
if (_vm->_championMan->_leaderIndex != kM1_ChampionNone)
_vm->_inventoryMan->f355_toggleInventory(_vm->_championMan->_leaderIndex);
_vm->_inventoryMan->toggleInventory(_vm->_championMan->_leaderIndex);
return;
}
@ -807,12 +807,12 @@ void EventManager::processCommandQueue() {
}
if (cmdType == k70_CommandClickOnMouth) {
_vm->_inventoryMan->f349_processCommand70_clickOnMouth();
_vm->_inventoryMan->clickOnMouth();
return;
}
if (cmdType == k71_CommandClickOnEye) {
_vm->_inventoryMan->f352_processCommand71_clickOnEye();
_vm->_inventoryMan->clickOnEye();
return;
}
@ -830,8 +830,8 @@ void EventManager::processCommandQueue() {
if (cmdType == k145_CommandSleep) {
if (!_vm->_championMan->_candidateChampionOrdinal) {
if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal)
_vm->_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory);
if (_vm->_inventoryMan->_inventoryChampionOrdinal)
_vm->_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
_vm->_menuMan->f456_drawDisabledMenu();
_vm->_championMan->_partyIsSleeping = true;
@ -1234,7 +1234,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
uint16 championIndex = champMan._partyChampionCount - 1;
Champion *champ = &champMan._champions[championIndex];
if (commandType == k162_CommandClickInPanelCancel) {
invMan.f355_toggleInventory(k4_ChampionCloseInventory);
invMan.toggleInventory(k4_ChampionCloseInventory);
champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
if (champMan._partyChampionCount == 1) {
commandSetLeader(kM1_ChampionNone);
@ -1309,7 +1309,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
break;
}
invMan.f355_toggleInventory(k4_ChampionCloseInventory);
invMan.toggleInventory(k4_ChampionCloseInventory);
_vm->_menuMan->f457_drawEnabledMenus();
setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand);
}
@ -1319,7 +1319,7 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
InventoryMan &invMan = *_vm->_inventoryMan;
CommandType commandType;
switch (invMan._g424_panelContent) {
switch (invMan._panelContent) {
case k4_PanelContentChest:
if (champMan._leaderIndex == kM1_ChampionNone) // if no leader
return;
@ -1436,7 +1436,7 @@ void EventManager::commandTakeStairs(bool stairsGoDown) {
}
void EventManager::commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY) {
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
commandSetLeader((ChampionIndex)champIndex);
} else {
uint16 commandType = getCommandTypeFromMouseInput(_mouseInputChampionNamesHands, Common::Point(posX, posY), k1_LeftMouseButton);

View File

@ -63,27 +63,27 @@ void InventoryMan::initConstants() {
break;
}
for (int i = 0; i < 15; ++i)
G0428_apc_SkillLevelNames[i] = g428_byLanguage[i];
_skillLevelNames[i] = g428_byLanguage[i];
g32_BoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel
_boxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel
}
InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
_g432_inventoryChampionOrdinal = 0;
_g424_panelContent = k0_PanelContentFoodWaterPoisoned;
_inventoryChampionOrdinal = 0;
_panelContent = k0_PanelContentFoodWaterPoisoned;
for (uint16 i = 0; i < 8; ++i)
_g425_chestSlots[i] = Thing(0);
_g426_openChest = Thing::_none;
_g421_objDescTextXpos = 0;
_g422_objDescTextYpos = 0;
_chestSlots[i] = Thing(0);
_openChest = Thing::_none;
_objDescTextXpos = 0;
_objDescTextYpos = 0;
for (int i = 0; i < 15; i++)
G0428_apc_SkillLevelNames[i] = nullptr;
_skillLevelNames[i] = nullptr;
initConstants();
}
void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
void InventoryMan::toggleInventory(ChampionIndex championIndex) {
static Box g41_BoxFloppyZzzCross(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
@ -100,14 +100,14 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
return;
}
_vm->_stopWaitingForPlayerInput = true;
AL1102_ui_InventoryChampionOrdinal = _g432_inventoryChampionOrdinal;
AL1102_ui_InventoryChampionOrdinal = _inventoryChampionOrdinal;
if (_vm->indexToOrdinal(championIndex) == AL1102_ui_InventoryChampionOrdinal) {
championIndex = k4_ChampionCloseInventory;
}
_vm->_eventMan->showMouse();
if (AL1102_ui_InventoryChampionOrdinal) {
_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
f334_closeChest();
_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
closeChest();
L1103_ps_Champion = &_vm->_championMan->_champions[_vm->ordinalToIndex(AL1102_ui_InventoryChampionOrdinal)];
if (L1103_ps_Champion->_currHealth && !_vm->_championMan->_candidateChampionOrdinal) {
setFlag(L1103_ps_Champion->_attributes, k0x1000_ChampionAttributeStatusBox);
@ -129,7 +129,7 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
}
}
_vm->_displayMan->_useByteBoxCoordinates = false;
_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex);
_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex);
if (!AL1102_ui_InventoryChampionOrdinal) {
_vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
}
@ -168,7 +168,7 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
_vm->_eventMan->discardAllInput();
}
void InventoryMan::f354_drawStatusBoxPortrait(ChampionIndex championIndex) {
void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
DisplayMan &dispMan = *_vm->_displayMan;
dispMan._useByteBoxCoordinates = false;
Box box;
@ -179,7 +179,7 @@ void InventoryMan::f354_drawStatusBoxPortrait(ChampionIndex championIndex) {
dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, &box, k16_byteWidth, kM1_ColorNoTransparency, 29);
}
void InventoryMan::f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
Box box;
box._x1 = x;
box._x2 = box._x1 + pixelWidth;
@ -189,7 +189,7 @@ void InventoryMan::f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidt
_vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, box, color, k112_byteWidthViewport, k136_heightViewport);
}
void InventoryMan::f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
if (amount < -512) {
color = k8_ColorRed;
} else if (amount < 0) {
@ -201,19 +201,19 @@ void InventoryMan::f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color col
pixelWidth = 3071;
}
pixelWidth /= 32;
f343_drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack);
f343_drawPanelHorizontalBar(113, y, pixelWidth, color);
drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack);
drawPanelHorizontalBar(113, y, pixelWidth, color);
}
void InventoryMan::f345_drawPanelFoodWaterPoisoned() {
void InventoryMan::drawPanelFoodWaterPoisoned() {
static Box g35_BoxFood(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food
static Box g36_BoxWater(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water
static Box g37_BoxPoisoned(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned
Champion &champ = _vm->_championMan->_champions[_g432_inventoryChampionOrdinal];
f334_closeChest();
Champion &champ = _vm->_championMan->_champions[_inventoryChampionOrdinal];
closeChest();
DisplayMan &dispMan = *_vm->_displayMan;
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73);
switch (_vm->getGameLanguage()) { // localized
default:
@ -235,60 +235,60 @@ void InventoryMan::f345_drawPanelFoodWaterPoisoned() {
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k32_PoisionedLabelIndice),
g37_BoxPoisoned, k48_byteWidth, k12_ColorDarkestGray, 15);
}
f344_drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
f344_drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
}
void InventoryMan::f346_drawPanelResurrectReincarnate() {
_g424_panelContent = k5_PanelContentResurrectReincarnate;
void InventoryMan::drawPanelResurrectReincarnate() {
_panelContent = k5_PanelContentResurrectReincarnate;
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k40_PanelResurectReincaranteIndice),
g32_BoxPanel, k72_byteWidth, k6_ColorDarkGreen, 73);
_boxPanel, k72_byteWidth, k6_ColorDarkGreen, 73);
}
void InventoryMan::f347_drawPanel() {
f334_closeChest();
void InventoryMan::drawPanel() {
closeChest();
ChampionMan &cm = *_vm->_championMan;
if (cm._candidateChampionOrdinal) {
f346_drawPanelResurrectReincarnate();
drawPanelResurrectReincarnate();
return;
}
Thing thing = cm._champions[_vm->ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
Thing thing = cm._champions[_vm->ordinalToIndex(_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
_g424_panelContent = k0_PanelContentFoodWaterPoisoned;
_panelContent = k0_PanelContentFoodWaterPoisoned;
switch (thing.getType()) {
case k9_ContainerThingType:
_g424_panelContent = k4_PanelContentChest;
_panelContent = k4_PanelContentChest;
break;
case k7_ScrollThingType:
_g424_panelContent = k2_PanelContentScroll;
_panelContent = k2_PanelContentScroll;
break;
default:
thing = Thing::_none;
break;
}
if (thing == Thing::_none) {
f345_drawPanelFoodWaterPoisoned();
drawPanelFoodWaterPoisoned();
} else {
f342_drawPanelObject(thing, false);
drawPanelObject(thing, false);
}
}
void InventoryMan::f334_closeChest() {
void InventoryMan::closeChest() {
DungeonMan &dunMan = *_vm->_dungeonMan;
bool processFirstChestSlot = true;
if (_g426_openChest == Thing::_none)
if (_openChest == Thing::_none)
return;
Container *container = (Container*)dunMan.getThingData(_g426_openChest);
_g426_openChest = Thing::_none;
Container *container = (Container*)dunMan.getThingData(_openChest);
_openChest = Thing::_none;
container->getSlot() = Thing::_endOfList;
Thing prevThing;
for (int16 chestSlotIndex = 0; chestSlotIndex < 8; ++chestSlotIndex) {
Thing thing = _g425_chestSlots[chestSlotIndex];
Thing thing = _chestSlots[chestSlotIndex];
if (thing != Thing::_none) {
_g425_chestSlots[chestSlotIndex] = Thing::_none; // CHANGE8_09_FIX
_chestSlots[chestSlotIndex] = Thing::_none; // CHANGE8_09_FIX
if (processFirstChestSlot) {
processFirstChestSlot = false;
@ -302,7 +302,7 @@ void InventoryMan::f334_closeChest() {
}
}
void InventoryMan::f340_drawPanelScrollTextLine(int16 yPos, char* text) {
void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) {
for (char* iter = text; *iter != '\0'; ++iter) {
if ((*iter >= 'A') && (*iter <= 'Z')) {
*iter -= 64;
@ -313,7 +313,7 @@ void InventoryMan::f340_drawPanelScrollTextLine(int16 yPos, char* text) {
_vm->_textMan->f52_printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
}
void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
void InventoryMan::drawPanelScroll(Scroll* scroll) {
DisplayMan &dispMan = *_vm->_displayMan;
char stringFirstLine[300];
@ -324,7 +324,7 @@ void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
}
*charRed = '\0';
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k23_PanelOpenScrollIndice),
g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
_boxPanel, k72_byteWidth, k8_ColorRed, 73);
int16 lineCount = 1;
charRed++;
char *charGreen = charRed; // first char of the second line
@ -344,7 +344,7 @@ void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
lineCount--;
}
int16 yPos = 92 - (7 * lineCount) / 2; // center the text vertically
f340_drawPanelScrollTextLine(yPos, stringFirstLine);
drawPanelScrollTextLine(yPos, stringFirstLine);
charGreen = charRed;
while (*charGreen) {
yPos += 7;
@ -355,27 +355,27 @@ void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
charRed[1] = '\0';
}
*charRed++ = '\0';
f340_drawPanelScrollTextLine(yPos, charGreen);
drawPanelScrollTextLine(yPos, charGreen);
charGreen = charRed;
}
}
void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) {
void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) {
DisplayMan &dispMan = *_vm->_displayMan;
ObjectMan &objMan = *_vm->_objectMan;
if (_g426_openChest == thingToOpen)
if (_openChest == thingToOpen)
return;
if (_g426_openChest != Thing::_none)
f334_closeChest(); // CHANGE8_09_FIX
if (_openChest != Thing::_none)
closeChest(); // CHANGE8_09_FIX
_g426_openChest = thingToOpen;
_openChest = thingToOpen;
if (!isPressingEye) {
objMan.f38_drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen);
}
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k25_PanelOpenChestIndice),
g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
_boxPanel, k72_byteWidth, k8_ColorRed, 73);
int16 chestSlotIndex = 0;
Thing thing = chest->getSlot();
int16 thingCount = 0;
@ -384,16 +384,16 @@ void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bo
break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn
objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.f33_getIconIndex(thing));
_g425_chestSlots[chestSlotIndex++] = thing;
_chestSlots[chestSlotIndex++] = thing;
thing = _vm->_dungeonMan->getNextThing(thing);
}
while (chestSlotIndex < 8) {
objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone);
_g425_chestSlots[chestSlotIndex++] = Thing::_none;
_chestSlots[chestSlotIndex++] = Thing::_none;
}
}
void InventoryMan::f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) {
void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) {
static byte iconBitmap[16 * 16];
Box box;
box._x2 = (box._x1 = xPos) + 15;
@ -402,7 +402,7 @@ void InventoryMan::f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int
_vm->_displayMan->blitToViewport(iconBitmap, box, k8_byteWidth, kM1_ColorNoTransparency, 16);
}
void InventoryMan::f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char** attribStrings, char* destString, const char* prefixString, const char* suffixString) {
void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char** attribStrings, char* destString, const char* prefixString, const char* suffixString) {
uint16 identicalBitCount = 0;
int16 attribMask = 1;
for (uint16 stringIndex = 0; stringIndex < 16; stringIndex++, attribMask <<= 1) {
@ -440,11 +440,11 @@ void InventoryMan::f336_buildObjectAttributeString(int16 potentialAttribMask, in
strcat(destString, suffixString);
}
void InventoryMan::f335_drawPanelObjectDescriptionString(const char *descString) {
void InventoryMan::drawPanelObjectDescriptionString(const char *descString) {
if (descString[0] == '\f') { // form feed
descString++;
_g421_objDescTextXpos = 108;
_g422_objDescTextYpos = 59;
_objDescTextXpos = 108;
_objDescTextYpos = 59;
}
if (descString[0]) {
@ -464,8 +464,8 @@ void InventoryMan::f335_drawPanelObjectDescriptionString(const char *descString)
severalLines = true;
}
_vm->_textMan->f52_printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine);
_g422_objDescTextYpos += 7;
_vm->_textMan->f52_printToViewport(_objDescTextXpos, _objDescTextYpos, k13_ColorLightestGray, stringLine);
_objDescTextYpos += 7;
if (severalLines) {
severalLines = false;
stringLine = ++string;
@ -476,7 +476,7 @@ void InventoryMan::f335_drawPanelObjectDescriptionString(const char *descString)
}
}
void InventoryMan::f339_drawPanelArrowOrEye(bool pressingEye) {
void InventoryMan::drawPanelArrowOrEye(bool pressingEye) {
static Box boxArrowOrEye(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye
DisplayMan &dispMan = *_vm->_displayMan;
@ -489,7 +489,7 @@ void InventoryMan::f339_drawPanelArrowOrEye(bool pressingEye) {
#define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN
#define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
static Box boxObjectDescCircle(105, 136, 53, 79); // @ G0034_s_Graphic562_Box_ObjectDescriptionCircle
DungeonMan &dunMan = *_vm->_dungeonMan;
@ -499,20 +499,20 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
TextMan &textMan = *_vm->_textMan;
if (_vm->_pressingEye || _vm->_pressingMouth) {
f334_closeChest();
closeChest();
}
uint16 *rawThingPtr = dunMan.getThingData(thingToDraw);
f335_drawPanelObjectDescriptionString("\f"); // form feed
drawPanelObjectDescriptionString("\f"); // form feed
ThingType thingType = thingToDraw.getType();
if (thingType == k7_ScrollThingType) {
f341_drawPanelScroll((Scroll*)rawThingPtr);
drawPanelScroll((Scroll*)rawThingPtr);
} else if (thingType == k9_ContainerThingType) {
f333_openAndDrawChest(thingToDraw, (Container *)rawThingPtr, pressingEye);
openAndDrawChest(thingToDraw, (Container *)rawThingPtr, pressingEye);
} else {
IconIndice iconIndex = objMan.f33_getIconIndex(thingToDraw);
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice),
g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
_boxPanel, k72_byteWidth, k8_ColorRed, 73);
dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k29_ObjectDescCircleIndice),
boxObjectDescCircle, k16_byteWidth, k12_ColorDarkestGray, 27);
@ -537,7 +537,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
descString = str;
} else if ((thingType == k8_PotionThingType)
&& (iconIndex != k163_IconIndicePotionWaterFlask)
&& (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
&& (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
str[0] = '_' + ((Potion *)rawThingPtr)->getPower() / 40;
str[1] = ' ';
str[2] = '\0';
@ -548,10 +548,10 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
}
textMan.f52_printToViewport(134, 68, k13_ColorLightestGray, descString);
f332_drawIconToViewport(iconIndex, 111, 59);
drawIconToViewport(iconIndex, 111, 59);
_g422_objDescTextYpos = 87;
_objDescTextYpos = 87;
uint16 potentialAttribMask = 0;
uint16 actualAttribMask = 0;
@ -566,9 +566,9 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY: f335_drawPanelObjectDescriptionString("(BURNT OUT)"); break;
case Common::DE_DEU: f335_drawPanelObjectDescriptionString("(AUSGEBRANNT)"); break;
case Common::FR_FRA: f335_drawPanelObjectDescriptionString("(CONSUME)"); break;
case Common::EN_ANY: drawPanelObjectDescriptionString("(BURNT OUT)"); break;
case Common::DE_DEU: drawPanelObjectDescriptionString("(AUSGEBRANNT)"); break;
case Common::FR_FRA: drawPanelObjectDescriptionString("(CONSUME)"); break;
}
}
break;
@ -606,7 +606,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
break;
}
f335_drawPanelObjectDescriptionString(descString);
drawPanelObjectDescriptionString(descString);
} else if ((iconIndex >= k0_IconIndiceJunkCompassNorth) && (iconIndex <= k3_IconIndiceJunkCompassWest)) {
potentialAttribMask = 0;
@ -634,7 +634,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
case Common::FR_FRA: strcat(str, directionName_FR_FRA[iconIndex]); break;
}
f335_drawPanelObjectDescriptionString(str);
drawPanelObjectDescriptionString(str);
} else {
Junk *junk = (Junk *)rawThingPtr;
potentialAttribMask = k0x0001_DescriptionMaskConsumable;
@ -659,8 +659,8 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
case Common::FR_FRA: attribString = attribString_FR_FRA; break;
}
f336_buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")");
f335_drawPanelObjectDescriptionString(str);
buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")");
drawPanelObjectDescriptionString(str);
}
switch (_vm->getGameLanguage()) { // localized
@ -691,12 +691,12 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
case Common::FR_FRA: strcat(str, "."); break;
}
f335_drawPanelObjectDescriptionString(str);
drawPanelObjectDescriptionString(str);
}
f339_drawPanelArrowOrEye(pressingEye);
drawPanelArrowOrEye(pressingEye);
}
void InventoryMan::f337_setDungeonViewPalette() {
void InventoryMan::setDungeonViewPalette() {
static const int16 g40_palIndexToLightAmmount[6] = {99, 75, 50, 25, 1, 0}; // @ G0040_ai_Graphic562_PaletteIndexToLightAmount
if (_vm->_dungeonMan->_currMap->_difficulty == 0) {
@ -769,7 +769,7 @@ void InventoryMan::f337_setDungeonViewPalette() {
_vm->_displayMan->_refreshDungeonViewPaleteRequested = true;
}
void InventoryMan::f338_decreaseTorchesLightPower() {
void InventoryMan::decreaseTorchesLightPower() {
bool L1048_B_TorchChargeCountChanged = false;
int16 L1046_i_ChampionCount = _vm->_championMan->_partyChampionCount;
if (_vm->_championMan->_candidateChampionOrdinal) {
@ -793,12 +793,12 @@ void InventoryMan::f338_decreaseTorchesLightPower() {
L1050_ps_Champion++;
}
if (L1048_B_TorchChargeCountChanged) {
f337_setDungeonViewPalette();
setDungeonViewPalette();
_vm->_championMan->drawChangedObjectIcons();
}
}
void InventoryMan::f351_drawChampionSkillsAndStatistics() {
void InventoryMan::drawChampionSkillsAndStatistics() {
uint16 L1090_ui_Multiple;
#define AL1090_ui_SkillIndex L1090_ui_Multiple
@ -824,9 +824,9 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() {
case Common::FR_FRA: G0431_apc_StatisticNames = G0431_apc_StatisticNames_FR_FRA; break;
}
f334_closeChest();
L1094_ps_Champion = &_vm->_championMan->_champions[L1093_ui_ChampionIndex = _vm->ordinalToIndex(_g432_inventoryChampionOrdinal)];
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
closeChest();
L1094_ps_Champion = &_vm->_championMan->_champions[L1093_ui_ChampionIndex = _vm->ordinalToIndex(_inventoryChampionOrdinal)];
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73);
L1091_i_Y = 58;
for (AL1090_ui_SkillIndex = k0_ChampionSkillFighter; AL1090_ui_SkillIndex <= k3_ChampionSkillWizard; AL1090_ui_SkillIndex++) {
AL1092_i_SkillLevel = MIN((uint16)16, _vm->_championMan->getSkillLevel(L1093_ui_ChampionIndex, AL1090_ui_SkillIndex | k0x8000_IgnoreTemporaryExperience));
@ -837,14 +837,14 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() {
default:
case Common::EN_ANY:
case Common::DE_DEU: // english and german versions are the same
strcpy(L1097_ac_String, G0428_apc_SkillLevelNames[AL1092_i_SkillLevel - 2]);
strcpy(L1097_ac_String, _skillLevelNames[AL1092_i_SkillLevel - 2]);
strcat(L1097_ac_String, " ");
strcat(L1097_ac_String, _vm->_championMan->_baseSkillName[AL1090_ui_SkillIndex]);
break;
case Common::FR_FRA:
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]);
strcpy(L1097_ac_String, _skillLevelNames[AL1092_i_SkillLevel - 2]);
break;
}
_vm->_textMan->f52_printToViewport(108, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
@ -872,8 +872,8 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() {
}
}
void InventoryMan::f350_drawStopPressingMouth() {
f347_drawPanel();
void InventoryMan::drawStopPressingMouth() {
drawPanel();
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
_vm->_eventMan->_hideMousePointerRequestCount = 1;
_vm->_eventMan->showMouse();
@ -881,11 +881,11 @@ void InventoryMan::f350_drawStopPressingMouth() {
_vm->_eventMan->showMouse();
}
void InventoryMan::f353_drawStopPressingEye() {
void InventoryMan::drawStopPressingEye() {
Thing L1100_T_LeaderHandObject;
f332_drawIconToViewport(k202_IconIndiceEyeNotLooking, 12, 13);
f347_drawPanel();
drawIconToViewport(k202_IconIndiceEyeNotLooking, 12, 13);
drawPanel();
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
if ((L1100_T_LeaderHandObject = _vm->_championMan->_leaderHandObject) != Thing::_none) {
_vm->_objectMan->f34_drawLeaderObjectName(L1100_T_LeaderHandObject);
@ -895,7 +895,7 @@ void InventoryMan::f353_drawStopPressingEye() {
_vm->_eventMan->showMouse();
}
void InventoryMan::f349_processCommand70_clickOnMouth() {
void InventoryMan::clickOnMouth() {
static int16 G0242_ai_Graphic559_FoodAmounts[8] = {
500, /* Apple */
600, /* Corn */
@ -927,7 +927,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
if (_vm->_championMan->_leaderEmptyHanded) {
if (_g424_panelContent == k0_PanelContentFoodWaterPoisoned) {
if (_panelContent == k0_PanelContentFoodWaterPoisoned) {
return;
}
_vm->_eventMan->_ignoreMouseMovements = true;
@ -939,7 +939,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
} else {
_vm->_eventMan->showMouse();
_vm->_eventMan->_hideMousePointerRequestCount = 1;
f345_drawPanelFoodWaterPoisoned();
drawPanelFoodWaterPoisoned();
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
}
return;
@ -953,7 +953,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
L1079_ui_IconIndex = _vm->_objectMan->f33_getIconIndex(L1078_T_Thing);
AL1088_ui_ThingType = L1078_T_Thing.getType();
L1089_ui_Weight = _vm->_dungeonMan->getObjectWeight(L1078_T_Thing);
L1083_ps_Champion = &_vm->_championMan->_champions[L1080_ui_ChampionIndex = _vm->ordinalToIndex(_g432_inventoryChampionOrdinal)];
L1083_ps_Champion = &_vm->_championMan->_champions[L1080_ui_ChampionIndex = _vm->ordinalToIndex(_inventoryChampionOrdinal)];
L1082_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L1078_T_Thing);
if ((L1079_ui_IconIndex >= k8_IconIndiceJunkWater) && (L1079_ui_IconIndex <= k9_IconIndiceJunkWaterSkin)) {
if (!(L1082_ps_Junk->getChargeCount())) {
@ -980,16 +980,16 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
AL1085_ui_AdjustedPotionPower = (AL1085_ui_PotionPower / 25) + 8; /* Value between 8 and 18 */
switch (((Potion*)L1082_ps_Junk)->getType()) {
case k6_PotionTypeRos:
f348_adjustStatisticCurrentValue(L1083_ps_Champion, k2_ChampionStatDexterity, AL1085_ui_AdjustedPotionPower);
adjustStatisticCurrentValue(L1083_ps_Champion, k2_ChampionStatDexterity, AL1085_ui_AdjustedPotionPower);
break;
case k7_PotionTypeKu:
f348_adjustStatisticCurrentValue(L1083_ps_Champion, k1_ChampionStatStrength, (((Potion*)L1082_ps_Junk)->getPower() / 35) + 5); /* Value between 5 and 12 */
adjustStatisticCurrentValue(L1083_ps_Champion, k1_ChampionStatStrength, (((Potion*)L1082_ps_Junk)->getPower() / 35) + 5); /* Value between 5 and 12 */
break;
case k8_PotionTypeDane:
f348_adjustStatisticCurrentValue(L1083_ps_Champion, k3_ChampionStatWisdom, AL1085_ui_AdjustedPotionPower);
adjustStatisticCurrentValue(L1083_ps_Champion, k3_ChampionStatWisdom, AL1085_ui_AdjustedPotionPower);
break;
case k9_PotionTypeNeta:
f348_adjustStatisticCurrentValue(L1083_ps_Champion, k4_ChampionStatVitality, AL1085_ui_AdjustedPotionPower);
adjustStatisticCurrentValue(L1083_ps_Champion, k4_ChampionStatVitality, AL1085_ui_AdjustedPotionPower);
break;
case k10_PotionTypeAntivenin:
_vm->_championMan->unpoison(L1080_ui_ChampionIndex);
@ -1064,14 +1064,14 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
setFlag(L1083_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
if (_g424_panelContent == k0_PanelContentFoodWaterPoisoned) {
if (_panelContent == k0_PanelContentFoodWaterPoisoned) {
setFlag(L1083_ps_Champion->_attributes, k0x0800_ChampionAttributePanel);
}
_vm->_championMan->drawChampionState((ChampionIndex)L1080_ui_ChampionIndex);
_vm->_eventMan->hideMouse();
}
void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 statIndex, int16 valueDelta) {
void InventoryMan::adjustStatisticCurrentValue(Champion* champ, uint16 statIndex, int16 valueDelta) {
int16 L1077_i_Multiple;
#define AL1077_i_CurrentValue L1077_i_Multiple
#define AL1077_i_Delta L1077_i_Multiple
@ -1091,7 +1091,7 @@ void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 stat
champ->_statistics[statIndex][k1_ChampionStatCurrent] += AL1077_i_Delta;
}
void InventoryMan::f352_processCommand71_clickOnEye() {
void InventoryMan::clickOnEye() {
_vm->_eventMan->_ignoreMouseMovements = true;
_vm->_pressingEye = true;
if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) {
@ -1105,12 +1105,12 @@ void InventoryMan::f352_processCommand71_clickOnEye() {
_vm->_eventMan->hideMouse();
_vm->_eventMan->hideMouse();
_vm->delay(8);
f332_drawIconToViewport(k203_IconIndiceEyeLooking, 12, 13);
drawIconToViewport(k203_IconIndiceEyeLooking, 12, 13);
if (_vm->_championMan->_leaderEmptyHanded) {
f351_drawChampionSkillsAndStatistics();
drawChampionSkillsAndStatistics();
} else {
_vm->_objectMan->f35_clearLeaderObjectName();
f342_drawPanelObject(_vm->_championMan->_leaderHandObject, true);
drawPanelObject(_vm->_championMan->_leaderHandObject, true);
}
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);

View File

@ -52,41 +52,40 @@ class InventoryMan {
public:
explicit InventoryMan(DMEngine *vm);
int16 _g432_inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal
PanelContent _g424_panelContent; // @ G0424_i_PanelContent
Thing _g425_chestSlots[8]; // @ G0425_aT_ChestSlots
Thing _g426_openChest; // @ G0426_T_OpenChest
int16 _g421_objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX
int16 _g422_objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY
Box g32_BoxPanel;
const char* G0428_apc_SkillLevelNames[15];
int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal
PanelContent _panelContent; // @ G0424_i_PanelContent
Thing _chestSlots[8]; // @ G0425_aT_ChestSlots
Thing _openChest; // @ G0426_T_OpenChest
int16 _objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX
int16 _objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY
Box _boxPanel;
const char *_skillLevelNames[15];
void f355_toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
void f354_drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
void f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
void f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
void f345_drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
void f346_drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
void f347_drawPanel(); // @ F0347_INVENTORY_DrawPanel
void f334_closeChest(); // @ F0334_INVENTORY_CloseChest
void f340_drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine
void f341_drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll
void f333_openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest
void f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport
void f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char ** attribStrings,
void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
void drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
void drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
void drawPanel(); // @ F0347_INVENTORY_DrawPanel
void closeChest(); // @ F0334_INVENTORY_CloseChest
void drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine
void drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll
void openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest
void drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport
void buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char ** attribStrings,
char *destString, const char *prefixString, const char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
void f335_drawPanelObjectDescriptionString(const char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString
void f339_drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye
void f342_drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object
void f337_setDungeonViewPalette(); // @ F0337_INVENTORY_SetDungeonViewPalette
void f338_decreaseTorchesLightPower(); // @ F0338_INVENTORY_DecreaseTorchesLightPower_CPSE
void f351_drawChampionSkillsAndStatistics(); // @ F0351_INVENTORY_DrawChampionSkillsAndStatistics
void f350_drawStopPressingMouth(); // @ F0350_INVENTORY_DrawStopPressingMouth
void f353_drawStopPressingEye();// @ F0353_INVENTORY_DrawStopPressingEye
void f349_processCommand70_clickOnMouth(); // @ F0349_INVENTORY_ProcessCommand70_ClickOnMouth
void f348_adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue
void f352_processCommand71_clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye
void drawPanelObjectDescriptionString(const char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString
void drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye
void drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object
void setDungeonViewPalette(); // @ F0337_INVENTORY_SetDungeonViewPalette
void decreaseTorchesLightPower(); // @ F0338_INVENTORY_DecreaseTorchesLightPower_CPSE
void drawChampionSkillsAndStatistics(); // @ F0351_INVENTORY_DrawChampionSkillsAndStatistics
void drawStopPressingMouth(); // @ F0350_INVENTORY_DrawStopPressingMouth
void drawStopPressingEye();// @ F0353_INVENTORY_DrawStopPressingEye
void clickOnMouth(); // @ F0349_INVENTORY_ProcessCommand70_ClickOnMouth
void adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue
void clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye
};
}

View File

@ -182,9 +182,9 @@ void MenuMan::f456_drawDisabledMenu() {
if (!_vm->_championMan->_partyIsSleeping) {
_vm->_eventMan->highlightBoxDisable();
_vm->_displayMan->_useByteBoxCoordinates = false;
if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->_inventoryMan->_g424_panelContent == k4_PanelContentChest) {
_vm->_inventoryMan->f334_closeChest();
if (_vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_inventoryMan->_panelContent == k4_PanelContentChest) {
_vm->_inventoryMan->closeChest();
}
} else {
_vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
@ -444,10 +444,10 @@ void MenuMan::f457_drawEnabledMenus() {
_g509_actionAreaContainsIcons = true;
}
f387_drawActionArea();
AL1462_i_InventoryChampionOrdinal = _vm->_inventoryMan->_g432_inventoryChampionOrdinal;
AL1462_i_InventoryChampionOrdinal = _vm->_inventoryMan->_inventoryChampionOrdinal;
if (AL1462_i_InventoryChampionOrdinal) {
_vm->_inventoryMan->_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
_vm->_inventoryMan->f355_toggleInventory((ChampionIndex)_vm->ordinalToIndex(AL1462_i_InventoryChampionOrdinal));
_vm->_inventoryMan->_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
_vm->_inventoryMan->toggleInventory((ChampionIndex)_vm->ordinalToIndex(AL1462_i_InventoryChampionOrdinal));
} else {
_vm->_displayMan->drawFloorAndCeiling();
f395_drawMovementArrows();
@ -533,7 +533,7 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
L1275_ps_Potion->setPower(_vm->getRandomNumber(16) + (L1268_i_PowerSymbolOrdinal * 40));
L1270_ps_Champion->_load += _vm->_dungeonMan->getObjectWeight(L1272_T_Object) - AL1269_ui_EmptyFlaskWeight;
_vm->_championMan->drawChangedObjectIcons();
if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)) {
if (_vm->_inventoryMan->_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)) {
setFlag(L1270_ps_Champion->_attributes, k0x0200_ChampionAttributeLoad);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
@ -755,7 +755,7 @@ void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) {
setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
L1241_s_Event._priority = 0;
_vm->_timeline->f238_addEventGetEventIndex(&L1241_s_Event);
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
}
bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spellShield, uint16 ticks, bool useMana) {

View File

@ -268,7 +268,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
_vm->_dungeonMan->_partyMapX = destMapX;
_vm->_dungeonMan->_partyMapY = destMapY;
L0718_i_RequiredTeleporterScope = k0x0002_TelepScopeObjOrParty;
L0723_B_DrawDungeonViewWhileFalling = !_vm->_inventoryMan->_g432_inventoryChampionOrdinal && !_vm->_championMan->_partyIsSleeping;
L0723_B_DrawDungeonViewWhileFalling = !_vm->_inventoryMan->_inventoryChampionOrdinal && !_vm->_championMan->_partyIsSleeping;
L0716_ui_Direction = _vm->_dungeonMan->_partyDir;
} else {
if (L0710_i_ThingType == k4_GroupThingType) {

View File

@ -340,7 +340,7 @@ void Timeline::f261_processTimeline() {
case k70_TMEventTypeLight:
_vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex);
f257_timelineProcessEvent70_light(L0681_ps_Event);
_vm->_inventoryMan->f337_setDungeonViewPalette();
_vm->_inventoryMan->setDungeonViewPalette();
break;
case k71_TMEventTypeInvisibility:
_vm->_championMan->_party._event71Count_Invisibility--;
@ -992,9 +992,9 @@ void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex)
if (!L0663_ps_Champion->_currHealth) {
return;
}
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
_vm->_eventMan->showMouse();
_vm->_inventoryMan->f354_drawStatusBoxPortrait((ChampionIndex)champIndex);
_vm->_inventoryMan->drawStatusBoxPortrait((ChampionIndex)champIndex);
_vm->_eventMan->hideMouse();
} else {
setFlag(L0663_ps_Champion->_attributes, k0x0080_ChampionAttributeNameTitle);