DM: Renaming in MenuMan definition

This commit is contained in:
Strangerke 2016-08-25 21:59:02 +02:00 committed by Bendegúz Nagy
parent 5b05f3cff4
commit d2fbd98f3d
9 changed files with 236 additions and 236 deletions

View File

@ -486,7 +486,7 @@ void ChampionMan::drawChangedObjectIcons() {
if (hasObjectIconInSlotBoxChanged(slotBoxIndex, _champions[champIndex].getSlot((ChampionSlot)getHandSlotIndex(slotBoxIndex)))
&& (getHandSlotIndex(slotBoxIndex) == k1_ChampionSlotActionHand)) {
menuMan.f386_drawActionIcon((ChampionIndex)champIndex);
menuMan.drawActionIcon((ChampionIndex)champIndex);
}
}
@ -499,7 +499,7 @@ void ChampionMan::drawChangedObjectIcons() {
uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
drawViewport |= objIconChanged;
if (objIconChanged && (slotIndex == k1_ChampionSlotActionHand)) {
menuMan.f386_drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
menuMan.drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
@ -548,7 +548,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if (slotIndex == k1_ChampionSlotActionHand) {
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
menuMan.f388_clearActingChampion();
menuMan.clearActingChampion();
if ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)) {
((Scroll *)rawObjPtr)->setClosed(false);
@ -699,7 +699,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if (slotIndex == k1_ChampionSlotActionHand) {
setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
_vm->_menuMan->f388_clearActingChampion();
_vm->_menuMan->clearActingChampion();
if ((curIconIndex >= k30_IconIndiceScrollOpen) && (curIconIndex <= k31_IconIndiceScrollClosed)) {
((Scroll *)curWeapon)->setClosed(true);
@ -907,7 +907,7 @@ void ChampionMan::wakeUp() {
_vm->_eventMan->_primaryKeyboardInput = _vm->_eventMan->_primaryKeyboardInputInterface;
_vm->_eventMan->_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement;
_vm->_eventMan->discardAllInput();
_vm->_menuMan->f457_drawEnabledMenus();
_vm->_menuMan->drawEnabledMenus();
}
int16 ChampionMan::getThrowingStaminaCost(Thing thing) {
@ -1284,7 +1284,7 @@ void ChampionMan::viAltarRebirth(uint16 champIndex) {
uint16 maximumHealth = curChampion->_maxHealth;
curChampion->_maxHealth = MAX(25, maximumHealth - (maximumHealth >> 6) - 1);
curChampion->_currHealth = curChampion->_maxHealth >> 1;
_vm->_menuMan->f393_drawSpellAreaControls(_magicCasterChampionIndex);
_vm->_menuMan->drawSpellAreaControls(_magicCasterChampionIndex);
curChampion->_dir = _vm->_dungeonMan->_partyDir;
setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x1000_ChampionAttributeStatusBox | k0x0400_ChampionAttributeIcon);
drawChampionState((ChampionIndex)champIndex);
@ -1510,9 +1510,9 @@ void ChampionMan::championKill(uint16 champIndex) {
_vm->_eventMan->commandSetLeader((ChampionIndex)aliveChampionIndex);
if (champIndex == _magicCasterChampionIndex)
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(aliveChampionIndex);
_vm->_menuMan->setMagicCasterAndDrawSpellArea(aliveChampionIndex);
else
_vm->_menuMan->f393_drawSpellAreaControls(_magicCasterChampionIndex);
_vm->_menuMan->drawSpellAreaControls(_magicCasterChampionIndex);
}
void ChampionMan::dropAllObjects(uint16 champIndex) {
@ -1850,7 +1850,7 @@ void ChampionMan::resetDataToStartGame() {
}
if ((L0785_i_ChampionIndex = _magicCasterChampionIndex) != kM1_ChampionNone) {
_magicCasterChampionIndex = kM1_ChampionNone;
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(L0785_i_ChampionIndex);
_vm->_menuMan->setMagicCasterAndDrawSpellArea(L0785_i_ChampionIndex);
}
return;
}
@ -1949,10 +1949,10 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
_candidateChampionOrdinal = previousPartyChampionCount + 1;
if (++_partyChampionCount == 1) {
_vm->_eventMan->commandSetLeader(k0_ChampionFirst);
_vm->_menuMan->_g508_refreshActionArea = true;
_vm->_menuMan->_refreshActionArea = true;
} else {
_vm->_menuMan->f388_clearActingChampion();
_vm->_menuMan->f386_drawActionIcon((ChampionIndex)(_partyChampionCount - 1));
_vm->_menuMan->clearActingChampion();
_vm->_menuMan->drawActionIcon((ChampionIndex)(_partyChampionCount - 1));
}
int16 curMapX = _vm->_dungeonMan->_partyMapX;
@ -2028,7 +2028,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
curThing = _vm->_dungeonMan->getNextThing(curThing);
}
_vm->_inventoryMan->toggleInventory((ChampionIndex)previousPartyChampionCount);
_vm->_menuMan->f456_drawDisabledMenu();;
_vm->_menuMan->drawDisabledMenu();;
}
void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
@ -2155,7 +2155,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
} else {
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k8_StatusBoxDeadChampion), &box, k40_byteWidth, kM1_ColorNoTransparency, 29);
_vm->_textMan->f53_printToLogicalScreen(championStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, curChampion->_name);
_vm->_menuMan->f386_drawActionIcon(champIndex);
_vm->_menuMan->drawActionIcon(champIndex);
clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
_vm->_eventMan->hideMouse();
@ -2273,7 +2273,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
if (getFlag(championAttributes, k0x8000_ChampionAttributeActionHand)) {
drawSlot(champIndex, k1_ChampionSlotActionHand);
_vm->_menuMan->f386_drawActionIcon(champIndex);
_vm->_menuMan->drawActionIcon(champIndex);
if (isInventoryChampion)
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
}

View File

@ -299,7 +299,7 @@ void DMEngine::initializeGame() {
}
} while (loadgame(saveSlot) != k1_LoadgameSuccess);
_displayMan->loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_gK73_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap
_displayMan->loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap
// There was some memory wizardy for the Amiga platform, I skipped that part
_displayMan->allocateFlippedWallBitmaps();
@ -334,7 +334,7 @@ void DMEngine::startGame() {
_eventMan->_highlightBoxEnabled = false;
_championMan->_partyIsSleeping = false;
_championMan->_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone);
_menuMan->_g509_actionAreaContainsIcons = true;
_menuMan->_actionAreaContainsIcons = true;
_eventMan->_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone);
_eventMan->_primaryMouseInput = _eventMan->_primaryMouseInputInterface;
@ -359,7 +359,7 @@ void DMEngine::startGame() {
}
_displayMan->buildPaletteChangeCopperList(_displayMan->_palDungeonView[0], _displayMan->_paletteTopAndBottomScreen);
_menuMan->f395_drawMovementArrows();
_menuMan->drawMovementArrows();
_championMan->resetDataToStartGame();
_gameTimeTicking = true;
}
@ -405,7 +405,7 @@ Common::Error DMEngine::run() {
endGame(_championMan->_partyDead);
else {
loadGameState(_loadSaveSlotAtRuntime);
_menuMan->f457_drawEnabledMenus();
_menuMan->drawEnabledMenus();
_displayMan->updateScreen();
_loadSaveSlotAtRuntime = -1;
}
@ -481,7 +481,7 @@ void DMEngine::gameloop() {
if (_championMan->_party._freezeLifeTicks)
_championMan->_party._freezeLifeTicks -= 1;
_menuMan->f390_refreshActionAreaAndSetChampDirMaxDamageReceived();
_menuMan->refreshActionAreaAndSetChampDirMaxDamageReceived();
if (!(_gameTime & (_championMan->_partyIsSleeping ? 15 : 63)))
_championMan->applyTimeEffects();

View File

@ -833,7 +833,7 @@ void EventManager::processCommandQueue() {
if (_vm->_inventoryMan->_inventoryChampionOrdinal)
_vm->_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
_vm->_menuMan->f456_drawDisabledMenu();
_vm->_menuMan->drawDisabledMenu();
_vm->_championMan->_partyIsSleeping = true;
drawSleepScreen();
_vm->_displayMan->drawViewport(k2_viewportAsBeforeSleepOrFreezeGame);
@ -861,7 +861,7 @@ void EventManager::processCommandQueue() {
if (cmdType == k147_CommandFreezeGame) {
_vm->_gameTimeTicking = false;
_vm->_menuMan->f456_drawDisabledMenu();
_vm->_menuMan->drawDisabledMenu();
_vm->_displayMan->fillBitmap(_vm->_displayMan->_bitmapViewport, k0_ColorBlack, 112, 136);
switch (_vm->getGameLanguage()) { // localized
@ -894,7 +894,7 @@ void EventManager::processCommandQueue() {
if (cmdType == k148_CommandUnfreezeGame) {
_vm->_gameTimeTicking = true;
_vm->_menuMan->f457_drawEnabledMenus();
_vm->_menuMan->drawEnabledMenus();
_primaryMouseInput = primaryMouseInputBackup;
_secondaryMouseInput = secondaryMouseInputBackup;
_primaryKeyboardInput = primaryKeyboardInputBackup;
@ -1248,7 +1248,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
dispMan._useByteBoxCoordinates = false;
dispMan.fillScreenBox(box, k0_ColorBlack);
dispMan.fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._partyDir) * 2], k0_ColorBlack);
_vm->_menuMan->f457_drawEnabledMenus();
_vm->_menuMan->drawEnabledMenus();
showMouse();
return;
}
@ -1288,9 +1288,9 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
if (champMan._partyChampionCount == 1) {
_vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime;
commandSetLeader(k0_ChampionFirst);
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
_vm->_menuMan->setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
} else
_vm->_menuMan->f393_drawSpellAreaControls(champMan._magicCasterChampionIndex);
_vm->_menuMan->drawSpellAreaControls(champMan._magicCasterChampionIndex);
_vm->_textMan->f51_messageAreaPrintLineFeed();
Color champColor = _vm->_championMan->_championColor[championIndex];
@ -1310,7 +1310,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
}
invMan.toggleInventory(k4_ChampionCloseInventory);
_vm->_menuMan->f457_drawEnabledMenus();
_vm->_menuMan->drawEnabledMenus();
setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand);
}
@ -1540,7 +1540,7 @@ void EventManager::commandProcessType100_clickInSpellArea(uint16 posX, uint16 po
}
if ((championIndex != kM1_ChampionNone) && (championIndex < _vm->_championMan->_partyChampionCount))
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(championIndex);
_vm->_menuMan->setMagicCasterAndDrawSpellArea(championIndex);
return;
}
@ -1566,7 +1566,7 @@ void EventManager::commandProcessTypes101To108_clickInSpellSymbolsArea(CommandTy
return;
commandHighlightBoxEnable(234, 303, 63, 73);
_vm->_stopWaitingForPlayerInput = _vm->_menuMan->f408_getClickOnSpellCastResult();
_vm->_stopWaitingForPlayerInput = _vm->_menuMan->getClickOnSpellCastResult();
return;
}
@ -1577,9 +1577,9 @@ void EventManager::commandProcessTypes101To108_clickInSpellSymbolsArea(CommandTy
highlightBoxDisable();
if (symbolIndex < 6)
_vm->_menuMan->f399_addChampionSymbol(symbolIndex);
_vm->_menuMan->addChampionSymbol(symbolIndex);
else
_vm->_menuMan->f400_deleteChampionSymbol();
_vm->_menuMan->deleteChampionSymbol();
}
void EventManager::commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY) {
@ -1588,8 +1588,8 @@ void EventManager::commandProcessType111To115_ClickInActionArea(int16 posX, int1
if (mouseCommand != k0_CommandNone) {
if (mouseCommand == k112_CommandClickInActionAreaPass) {
commandHighlightBoxEnable(285, 319, 77, 83);
_vm->_menuMan->f391_didClickTriggerAction(-1);
} else if ((mouseCommand - k112_CommandClickInActionAreaPass) <= _vm->_menuMan->_g507_actionCount) {
_vm->_menuMan->didClickTriggerAction(-1);
} else if ((mouseCommand - k112_CommandClickInActionAreaPass) <= _vm->_menuMan->_actionCount) {
if (mouseCommand == k113_CommandClickInActionAreaAction_0)
commandHighlightBoxEnable(234, 318, 86, 96);
else if (mouseCommand == k114_CommandClickInActionAreaAction_1)
@ -1597,15 +1597,15 @@ void EventManager::commandProcessType111To115_ClickInActionArea(int16 posX, int1
else
commandHighlightBoxEnable(234, 318, 110, 120);
_vm->_stopWaitingForPlayerInput = _vm->_menuMan->f391_didClickTriggerAction(mouseCommand - k113_CommandClickInActionAreaAction_0);
_vm->_stopWaitingForPlayerInput = _vm->_menuMan->didClickTriggerAction(mouseCommand - k113_CommandClickInActionAreaAction_0);
}
}
} else if (_vm->_menuMan->_g509_actionAreaContainsIcons) {
} else if (_vm->_menuMan->_actionAreaContainsIcons) {
uint16 mouseCommand = getCommandTypeFromMouseInput(_mouseInputActionAreaIcons, Common::Point(posX, posY), k1_LeftMouseButton);
if (mouseCommand != k0_CommandNone) {
mouseCommand -= k116_CommandClickInActionAreaChampion_0_Action;
if (mouseCommand < _vm->_championMan->_partyChampionCount)
_vm->_menuMan->f389_processCommands116To119_setActingChampion(mouseCommand);
_vm->_menuMan->processCommands116To119_setActingChampion(mouseCommand);
}
}
}

View File

@ -119,7 +119,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
}
if (championIndex == k4_ChampionCloseInventory) {
_vm->_eventMan->_refreshMousePointerInMainLoop = true;
_vm->_menuMan->f395_drawMovementArrows();
_vm->_menuMan->drawMovementArrows();
_vm->_eventMan->hideMouse();
_vm->_eventMan->_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement;
_vm->_eventMan->_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement;

View File

@ -164,7 +164,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
void DMEngine::saveGame() {
_menuMan->f456_drawDisabledMenu();
_menuMan->drawDisabledMenu();
_eventMan->showMouse();
switch (getGameLanguage()) { // localized
@ -247,7 +247,7 @@ void DMEngine::saveGame() {
}
_restartGameAllowed = true;
_menuMan->f457_drawEnabledMenus();
_menuMan->drawEnabledMenus();
_eventMan->hideMouse();
}

View File

@ -104,7 +104,7 @@ int16 LZWdecompressor::getNextInputCode(Common::MemoryReadStream &inputStream, i
return nextInputCode;
}
void LZWdecompressor::F0496_LZW_OutputCharacter(byte character, byte **out) {
void LZWdecompressor::outputCharacter(byte character, byte **out) {
byte *L1558_pc_Output = *out;
if (false == _repetitionEnabled) {
@ -147,7 +147,7 @@ int32 LZWdecompressor::decompress(Common::MemoryReadStream &inStream, int32 inpu
if (oldCode == -1) {
return -1L;
}
F0496_LZW_OutputCharacter(character, &out);
outputCharacter(character, &out);
int16 code;
while ((code = getNextInputCode(inStream, &inputByteCount)) > -1) {
if (code == 256) { /* This code is used to flush the dictionary */
@ -174,7 +174,7 @@ int32 LZWdecompressor::decompress(Common::MemoryReadStream &inStream, int32 inpu
*reversedDecodedStringEnd++ = (character = _appendCharacter[code]);
/* Output the decoded string in reverse order */
do {
F0496_LZW_OutputCharacter(*(--reversedDecodedStringEnd), &out);
outputCharacter(*(--reversedDecodedStringEnd), &out);
} while (reversedDecodedStringEnd > reversedDecodedStringStart);
/* If possible, add a new code to the string table */
if ((code = _dictNextAvailableCode) < _absoluteMaximumCode) {

View File

@ -53,7 +53,7 @@ class LZWdecompressor {
byte *_appendCharacter;
int16 getNextInputCode(Common::MemoryReadStream &stream, int32 *inputByteCount);
void F0496_LZW_OutputCharacter(byte character, byte **out);
void outputCharacter(byte character, byte **out);
void operator=(const LZWdecompressor&); // deleted
public:
LZWdecompressor();

View File

@ -90,54 +90,54 @@ void MenuMan::initConstants() {
3 /* FUSE */
};
boxActionArea1ActionMenu = Box(224, 319, 77, 97); // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
boxActionArea2ActionMenu = Box(224, 319, 77, 109); // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
boxActionArea3ActionMenu = Box(224, 319, 77, 121); // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
boxActionArea = Box(224, 319, 77, 121); // @ G0001_s_Graphic562_Box_ActionArea
boxSpellArea = Box(224, 319, 42, 74);
_boxActionArea1ActionMenu = Box(224, 319, 77, 97); // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
_boxActionArea2ActionMenu = Box(224, 319, 77, 109); // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
_boxActionArea3ActionMenu = Box(224, 319, 77, 121); // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
_boxActionArea = Box(224, 319, 77, 121); // @ G0001_s_Graphic562_Box_ActionArea
_boxSpellArea = Box(224, 319, 42, 74);
for (int i = 0; i < 40; i++)
g496_ActionSkillIndex[i] = actionSkillIndex[i];
_actionSkillIndex[i] = actionSkillIndex[i];
}
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
_g508_refreshActionArea = false;
_g509_actionAreaContainsIcons = false;
_g513_actionDamage = 0;
_g713_actionList.resetToZero();
_gK72_bitmapSpellAreaLine = new byte[96 * 12];
_gK73_bitmapSpellAreaLines = new byte[3 * 96 * 12];
_g517_actionTargetGroupThing = Thing(0);
_g507_actionCount = 0;
_refreshActionArea = false;
_actionAreaContainsIcons = false;
_actionDamage = 0;
_actionList.resetToZero();
_bitmapSpellAreaLine = new byte[96 * 12];
_bitmapSpellAreaLines = new byte[3 * 96 * 12];
_actionTargetGroupThing = Thing(0);
_actionCount = 0;
initConstants();
}
MenuMan::~MenuMan() {
delete[] _gK72_bitmapSpellAreaLine;
delete[] _bitmapSpellAreaLine;
}
void MenuMan::f395_drawMovementArrows() {
void MenuMan::drawMovementArrows() {
_vm->_eventMan->showMouse();
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k13_MovementArrowsIndice),
&_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kM1_ColorNoTransparency, 45);
_vm->_eventMan->hideMouse();
}
void MenuMan::f388_clearActingChampion() {
void MenuMan::clearActingChampion() {
ChampionMan &cm = *_vm->_championMan;
if (cm._actingChampionOrdinal) {
cm._actingChampionOrdinal--;
cm._champions[cm._actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._actingChampionOrdinal);
cm._actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
_g508_refreshActionArea = true;
_refreshActionArea = true;
}
}
void MenuMan::f386_drawActionIcon(ChampionIndex championIndex) {
void MenuMan::drawActionIcon(ChampionIndex championIndex) {
static byte palChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}; // @ G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon
if (!_g509_actionAreaContainsIcons)
if (!_actionAreaContainsIcons)
return;
DisplayMan &dm = *_vm->_displayMan;
Champion &champion = _vm->_championMan->_champions[championIndex];
@ -178,7 +178,7 @@ T0386006:
}
}
void MenuMan::f456_drawDisabledMenu() {
void MenuMan::drawDisabledMenu() {
if (!_vm->_championMan->_partyIsSleeping) {
_vm->_eventMan->highlightBoxDisable();
_vm->_displayMan->_useByteBoxCoordinates = false;
@ -189,13 +189,13 @@ void MenuMan::f456_drawDisabledMenu() {
} else {
_vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
}
_vm->_displayMan->shadeScreenBox(&boxSpellArea, k0_ColorBlack);
_vm->_displayMan->shadeScreenBox(&boxActionArea, k0_ColorBlack);
_vm->_displayMan->shadeScreenBox(&_boxSpellArea, k0_ColorBlack);
_vm->_displayMan->shadeScreenBox(&_boxActionArea, k0_ColorBlack);
_vm->_eventMan->setMousePointerToNormal(k0_pointerArrow);
}
}
void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
ChampionMan &champMan = *_vm->_championMan;
if (!champMan._partyChampionCount)
@ -204,7 +204,7 @@ void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
Champion *champ = nullptr;
if (champMan._partyIsSleeping || champMan._candidateChampionOrdinal) {
if (champMan._actingChampionOrdinal) {
f388_clearActingChampion();
clearActingChampion();
return;
}
if (!champMan._candidateChampionOrdinal)
@ -229,20 +229,20 @@ void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
} while (champIndex < champMan._partyChampionCount);
}
if (_g508_refreshActionArea) {
if (_refreshActionArea) {
if (!champMan._actingChampionOrdinal) {
if (_g513_actionDamage) {
f385_drawActionDamage(_g513_actionDamage);
_g513_actionDamage = 0;
if (_actionDamage) {
drawActionDamage(_actionDamage);
_actionDamage = 0;
} else {
_g509_actionAreaContainsIcons = true;
f387_drawActionArea();
_actionAreaContainsIcons = true;
drawActionArea();
}
} else {
_g509_actionAreaContainsIcons = false;
_actionAreaContainsIcons = false;
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._actingChampionOrdinal));
f387_drawActionArea();
drawActionArea();
}
}
}
@ -250,23 +250,23 @@ void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
#define k7_ChampionNameMaximumLength 7 // @ C007_CHAMPION_NAME_MAXIMUM_LENGTH
#define k12_ActionNameMaximumLength 12 // @ C012_ACTION_NAME_MAXIMUM_LENGTH
void MenuMan::f387_drawActionArea() {
void MenuMan::drawActionArea() {
DisplayMan &dispMan = *_vm->_displayMan;
ChampionMan &champMan = *_vm->_championMan;
TextMan &textMan = *_vm->_textMan;
_vm->_eventMan->hideMouse();
dispMan._useByteBoxCoordinates = false;
dispMan.fillScreenBox(boxActionArea, k0_ColorBlack);
if (_g509_actionAreaContainsIcons) {
dispMan.fillScreenBox(_boxActionArea, k0_ColorBlack);
if (_actionAreaContainsIcons) {
for (uint16 champIndex = k0_ChampionFirst; champIndex < champMan._partyChampionCount; ++champIndex)
f386_drawActionIcon((ChampionIndex)champIndex);
drawActionIcon((ChampionIndex)champIndex);
} else if (champMan._actingChampionOrdinal) {
Box box = boxActionArea3ActionMenu;
if (_g713_actionList._actionIndices[2] == k255_ChampionActionNone)
box = boxActionArea2ActionMenu;
if (_g713_actionList._actionIndices[1] == k255_ChampionActionNone)
box = boxActionArea1ActionMenu;
Box box = _boxActionArea3ActionMenu;
if (_actionList._actionIndices[2] == k255_ChampionActionNone)
box = _boxActionArea2ActionMenu;
if (_actionList._actionIndices[1] == k255_ChampionActionNone)
box = _boxActionArea1ActionMenu;
dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k10_MenuActionAreaIndice),
&box, k48_byteWidth, kM1_ColorNoTransparency, 45);
textMan.f41_printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen,
@ -274,15 +274,15 @@ void MenuMan::f387_drawActionArea() {
k7_ChampionNameMaximumLength, k200_heightScreen);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
textMan.f41_printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
f384_getActionName(_g713_actionList._actionIndices[actionListIndex]),
getActionName(_actionList._actionIndices[actionListIndex]),
k12_ActionNameMaximumLength, k200_heightScreen);
}
}
_vm->_eventMan->showMouse();
_g508_refreshActionArea = false;
_refreshActionArea = false;
}
const char* MenuMan::f384_getActionName(ChampionAction actionIndex) {
const char* MenuMan::getActionName(ChampionAction actionIndex) {
const char *g490_ChampionActionNames[44] = { // @ G0490_ac_Graphic560_ActionNames
"N", "BLOCK", "CHOP", "X", "BLOW HORN", "FLIP", "PUNCH",
"KICK", "WAR CRY", "STAB", "CLIMB DOWN", "FREEZE LIFE",
@ -297,7 +297,7 @@ const char* MenuMan::f384_getActionName(ChampionAction actionIndex) {
return (actionIndex == k255_ChampionActionNone) ? "" : g490_ChampionActionNames[actionIndex];
}
void MenuMan::f393_drawSpellAreaControls(ChampionIndex champIndex) {
void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
static Box boxSpellAreaControls(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls
Champion *champ = &_vm->_championMan->_champions[champIndex];
@ -369,33 +369,33 @@ T0393003:
#define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
#define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
void MenuMan::f392_buildSpellAreaLine(int16 spellAreaBitmapLine) {
void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
static Box boxSpellAreaLine(0, 95, 0, 11); // @ K0074_s_Box_SpellAreaLine
char L1204_ac_SpellSymbolString[2] = {'\0', '\0'};
Champion *L1203_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];
if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) {
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->blitToBitmap(_gK73_bitmapSpellAreaLines, _gK72_bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
_vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
int16 x = 1;
char character = 96 + (6 * L1203_ps_Champion->_symbolStep);
for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
L1204_ac_SpellSymbolString[0] = character++;
_vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
_vm->_textMan->f40_printTextToBitmap(_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
}
} else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) {
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->blitToBitmap(_gK73_bitmapSpellAreaLines, _gK72_bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
_vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
int16 x = 8;
for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
if ((L1204_ac_SpellSymbolString[0] = L1203_ps_Champion->_symbols[symbolIndex]) == '\0')
break;
_vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
_vm->_textMan->f40_printTextToBitmap(_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
}
}
}
void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) {
void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) {
static Box boxSpellAreaLine2(224, 319, 50, 61); // @ K0075_s_Box_SpellAreaLine2
static Box boxSpellAreaLine3(224, 319, 62, 73); // @ K0076_s_Box_SpellAreaLine3
@ -406,28 +406,28 @@ void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) {
}
if (_vm->_championMan->_magicCasterChampionIndex == kM1_ChampionNone) {
_vm->_eventMan->showMouse();
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33);
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33);
_vm->_eventMan->hideMouse();
}
if (champIndex == kM1_ChampionNone) {
_vm->_championMan->_magicCasterChampionIndex = kM1_ChampionNone;
_vm->_eventMan->showMouse();
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->fillScreenBox(boxSpellArea, k0_ColorBlack);
_vm->_displayMan->fillScreenBox(_boxSpellArea, k0_ColorBlack);
_vm->_eventMan->hideMouse();
return;
}
L1213_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex = (ChampionIndex)champIndex];
f392_buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
_vm->_eventMan->showMouse();
f393_drawSpellAreaControls((ChampionIndex)champIndex);
_vm->_displayMan->blitToScreen(_gK72_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kM1_ColorNoTransparency, 12);
f392_buildSpellAreaLine(k3_SpellAreaChampionSymbols);
_vm->_displayMan->blitToScreen(_gK72_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kM1_ColorNoTransparency, 12);
drawSpellAreaControls((ChampionIndex)champIndex);
_vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kM1_ColorNoTransparency, 12);
buildSpellAreaLine(k3_SpellAreaChampionSymbols);
_vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kM1_ColorNoTransparency, 12);
_vm->_eventMan->hideMouse();
}
void MenuMan::f457_drawEnabledMenus() {
void MenuMan::drawEnabledMenus() {
int16 L1462_i_Multiple;
#define AL1462_i_MagicCasterChampionIndex L1462_i_Multiple
#define AL1462_i_InventoryChampionOrdinal L1462_i_Multiple
@ -439,24 +439,24 @@ void MenuMan::f457_drawEnabledMenus() {
} else {
AL1462_i_MagicCasterChampionIndex = _vm->_championMan->_magicCasterChampionIndex;
_vm->_championMan->_magicCasterChampionIndex = kM1_ChampionNone; /* Force next function to draw the spell area */
f394_setMagicCasterAndDrawSpellArea(AL1462_i_MagicCasterChampionIndex);
setMagicCasterAndDrawSpellArea(AL1462_i_MagicCasterChampionIndex);
if (!_vm->_championMan->_actingChampionOrdinal) {
_g509_actionAreaContainsIcons = true;
_actionAreaContainsIcons = true;
}
f387_drawActionArea();
drawActionArea();
AL1462_i_InventoryChampionOrdinal = _vm->_inventoryMan->_inventoryChampionOrdinal;
if (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();
drawMovementArrows();
}
_vm->_eventMan->setMousePointer();
}
}
int16 MenuMan::f408_getClickOnSpellCastResult() {
int16 MenuMan::getClickOnSpellCastResult() {
int16 L1259_i_SpellCastResult;
Champion* L1260_ps_Champion;
@ -464,10 +464,10 @@ int16 MenuMan::f408_getClickOnSpellCastResult() {
L1260_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];
_vm->_eventMan->showMouse();
_vm->_eventMan->highlightBoxDisable();
if ((L1259_i_SpellCastResult = f412_getChampionSpellCastResult(_vm->_championMan->_magicCasterChampionIndex)) != k3_spellCastFailureNeedsFlask) {
if ((L1259_i_SpellCastResult = getChampionSpellCastResult(_vm->_championMan->_magicCasterChampionIndex)) != k3_spellCastFailureNeedsFlask) {
L1260_ps_Champion->_symbols[0] = '\0';
f397_drawAvailableSymbols(L1260_ps_Champion->_symbolStep = 0);
f398_drawChampionSymbols(L1260_ps_Champion);
drawAvailableSymbols(L1260_ps_Champion->_symbolStep = 0);
drawChampionSymbols(L1260_ps_Champion);
} else {
L1259_i_SpellCastResult = k0_spellCastFailure;
}
@ -475,7 +475,7 @@ int16 MenuMan::f408_getClickOnSpellCastResult() {
return L1259_i_SpellCastResult;
}
int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
uint16 L1267_ui_Multiple;
#define AL1267_ui_SkillLevel L1267_ui_Multiple
#define AL1267_ui_LightPower L1267_ui_Multiple
@ -503,9 +503,9 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
if (!(L1270_ps_Champion->_currHealth)) {
return k0_spellCastFailure;
}
L1271_ps_Spell = f409_getSpellFromSymbols((unsigned char *)L1270_ps_Champion->_symbols);
L1271_ps_Spell = getSpellFromSymbols((unsigned char *)L1270_ps_Champion->_symbols);
if (L1271_ps_Spell == 0) {
f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k1_spellCastSuccess, 0);
menusPrintSpellFailureMessage(L1270_ps_Champion, k1_spellCastSuccess, 0);
return k0_spellCastFailure;
}
L1268_i_PowerSymbolOrdinal = L1270_ps_Champion->_symbols[0] - '_'; /* Values 1 to 6 */
@ -517,15 +517,15 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
while (L1274_i_MissingSkillLevelCount--) {
if (_vm->getRandomNumber(128) > MIN(L1270_ps_Champion->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent] + 15, 115)) {
_vm->_championMan->addSkillExperience(champIndex, L1271_ps_Spell->_skillIndex, L1273_ui_Experience >> (AL1269_ui_RequiredSkillLevel - AL1267_ui_SkillLevel));
f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k0_failureNeedsMorePractice, L1271_ps_Spell->_skillIndex);
menusPrintSpellFailureMessage(L1270_ps_Champion, k0_failureNeedsMorePractice, L1271_ps_Spell->_skillIndex);
return k0_spellCastFailure;
}
}
}
switch (L1271_ps_Spell->getKind()) {
case k1_spellKindPotion:
if ((L1275_ps_Potion = f411_getEmptyFlaskInHand(L1270_ps_Champion, &L1272_T_Object)) == NULL) {
f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k10_failureNeedsFlaskInHand, 0);
if ((L1275_ps_Potion = getEmptyFlaskInHand(L1270_ps_Champion, &L1272_T_Object)) == NULL) {
menusPrintSpellFailureMessage(L1270_ps_Champion, k10_failureNeedsFlaskInHand, 0);
return k3_spellCastFailureNeedsFlask;
}
AL1269_ui_EmptyFlaskWeight = _vm->_dungeonMan->getObjectWeight(L1272_T_Object);
@ -564,12 +564,12 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
AL1267_ui_LightPower++;
T0412019:
_vm->_championMan->_party._magicalLightAmount += _vm->_championMan->_lightPowerToLightAmount[AL1267_ui_LightPower];
f404_createEvent70_light(-AL1267_ui_LightPower, AL1269_ui_Ticks);
createEvent70_light(-AL1267_ui_LightPower, AL1269_ui_Ticks);
break;
case k1_spellType_otherDarkness:
AL1267_ui_LightPower = (AL1267_ui_SpellPower >> 2);
_vm->_championMan->_party._magicalLightAmount -= _vm->_championMan->_lightPowerToLightAmount[AL1267_ui_LightPower];
f404_createEvent70_light(AL1267_ui_LightPower, 98);
createEvent70_light(AL1267_ui_LightPower, 98);
break;
case k2_spellType_otherThievesEye:
L1276_s_Event._type = k73_TMEventTypeThievesEye;
@ -627,7 +627,7 @@ T0412033:
}
break;
case k8_spellType_otherFireshield:
f403_isPartySpellOrFireShieldSuccessful(L1270_ps_Champion, false, (AL1267_ui_SpellPower * AL1267_ui_SpellPower) + 100, false);
isPartySpellOrFireShieldSuccessful(L1270_ps_Champion, false, (AL1267_ui_SpellPower * AL1267_ui_SpellPower) + 100, false);
}
}
_vm->_championMan->addSkillExperience(champIndex, L1271_ps_Spell->_skillIndex, L1273_ui_Experience);
@ -635,7 +635,7 @@ T0412033:
return k1_spellCastSuccess;
}
Spell* MenuMan::f409_getSpellFromSymbols(byte* symbols) {
Spell* MenuMan::getSpellFromSymbols(byte* symbols) {
static Spell G0487_as_Graphic560_Spells[25] = {
/* { Symbols, BaseRequiredSkillLevel, SkillIndex, Attributes } */
Spell(0x00666F00, 2, 15, 0x7843),
@ -689,7 +689,7 @@ Spell* MenuMan::f409_getSpellFromSymbols(byte* symbols) {
return NULL;
}
void MenuMan::f410_menusPrintSpellFailureMessage(Champion* champ, uint16 failureType, uint16 skillIndex) {
void MenuMan::menusPrintSpellFailureMessage(Champion* champ, uint16 failureType, uint16 skillIndex) {
const char *L1264_pc_Message = nullptr;
if (skillIndex > k3_ChampionSkillWizard)
@ -734,7 +734,7 @@ void MenuMan::f410_menusPrintSpellFailureMessage(Champion* champ, uint16 failure
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, L1264_pc_Message);
}
Potion* MenuMan::f411_getEmptyFlaskInHand(Champion* champ, Thing* potionThing) {
Potion* MenuMan::getEmptyFlaskInHand(Champion* champ, Thing* potionThing) {
Thing L1265_T_Thing;
int16 L1266_i_SlotIndex;
@ -747,7 +747,7 @@ Potion* MenuMan::f411_getEmptyFlaskInHand(Champion* champ, Thing* potionThing) {
return nullptr;
}
void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) {
void MenuMan::createEvent70_light(int16 lightPower, int16 ticks) {
TimelineEvent L1241_s_Event;
L1241_s_Event._type = k70_TMEventTypeLight;
@ -758,7 +758,7 @@ void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) {
_vm->_inventoryMan->setDungeonViewPalette();
}
bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spellShield, uint16 ticks, bool useMana) {
bool MenuMan::isPartySpellOrFireShieldSuccessful(Champion* champ, bool spellShield, uint16 ticks, bool useMana) {
bool L1239_B_IsPartySpellOrFireShieldSuccessful;
TimelineEvent L1240_s_Event;
@ -797,7 +797,7 @@ bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spel
return L1239_B_IsPartySpellOrFireShieldSuccessful;
}
void MenuMan::f397_drawAvailableSymbols(uint16 symbolStep) {
void MenuMan::drawAvailableSymbols(uint16 symbolStep) {
uint16 L1214_ui_Counter;
int16 L1215_i_X;
char L1216_c_Character;
@ -812,7 +812,7 @@ void MenuMan::f397_drawAvailableSymbols(uint16 symbolStep) {
}
}
void MenuMan::f398_drawChampionSymbols(Champion* champ) {
void MenuMan::drawChampionSymbols(Champion* champ) {
uint16 L1218_ui_SymbolIndex;
int16 L1219_i_X;
uint16 L1220_ui_SymbolCount;
@ -832,7 +832,7 @@ void MenuMan::f398_drawChampionSymbols(Champion* champ) {
}
}
void MenuMan::f399_addChampionSymbol(int16 symbolIndex) {
void MenuMan::addChampionSymbol(int16 symbolIndex) {
static byte G0485_aauc_Graphic560_SymbolBaseManaCost[4][6] = {
{1, 2, 3, 4, 5, 6}, /* Power 1 */
{2, 3, 4, 5, 6, 7}, /* Power 2 */
@ -858,14 +858,14 @@ void MenuMan::f399_addChampionSymbol(int16 symbolIndex) {
L1225_ps_Champion->_symbols[L1222_ui_SymbolStep + 1] = '\0';
L1225_ps_Champion->_symbolStep = L1222_ui_SymbolStep = returnNextVal(L1222_ui_SymbolStep);
_vm->_eventMan->showMouse();
f397_drawAvailableSymbols(L1222_ui_SymbolStep);
f398_drawChampionSymbols(L1225_ps_Champion);
drawAvailableSymbols(L1222_ui_SymbolStep);
drawChampionSymbols(L1225_ps_Champion);
_vm->_championMan->drawChampionState(_vm->_championMan->_magicCasterChampionIndex);
_vm->_eventMan->hideMouse();
}
}
void MenuMan::f400_deleteChampionSymbol() {
void MenuMan::deleteChampionSymbol() {
int16 L1226_ui_SymbolStep;
Champion* L1228_ps_Champion;
@ -876,19 +876,19 @@ void MenuMan::f400_deleteChampionSymbol() {
L1228_ps_Champion->_symbolStep = L1226_ui_SymbolStep = returnPrevVal(L1228_ps_Champion->_symbolStep);
L1228_ps_Champion->_symbols[L1226_ui_SymbolStep] = '\0';
_vm->_eventMan->showMouse();
f397_drawAvailableSymbols(L1226_ui_SymbolStep);
f398_drawChampionSymbols(L1228_ps_Champion);
drawAvailableSymbols(L1226_ui_SymbolStep);
drawChampionSymbols(L1228_ps_Champion);
_vm->_eventMan->hideMouse();
}
bool MenuMan::f391_didClickTriggerAction(int16 actionListIndex) {
bool MenuMan::didClickTriggerAction(int16 actionListIndex) {
uint16 L1196_ui_ChampionIndex;
uint16 L1197_ui_ActionIndex;
bool L1198_B_ClickTriggeredAction;
Champion* L1199_ps_Champion;
if (!_vm->_championMan->_actingChampionOrdinal || (actionListIndex != -1 && (_g713_actionList._actionIndices[actionListIndex] == k255_ChampionActionNone)))
if (!_vm->_championMan->_actingChampionOrdinal || (actionListIndex != -1 && (_actionList._actionIndices[actionListIndex] == k255_ChampionActionNone)))
return false;
L1199_ps_Champion = &_vm->_championMan->_champions[L1196_ui_ChampionIndex = _vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)];
@ -896,18 +896,18 @@ bool MenuMan::f391_didClickTriggerAction(int16 actionListIndex) {
// L1198_B_ClickTriggeredAction is set to -1 since booleans are stored in int16 in the original
L1198_B_ClickTriggeredAction = true;
} else {
L1197_ui_ActionIndex = _g713_actionList._actionIndices[actionListIndex];
L1197_ui_ActionIndex = _actionList._actionIndices[actionListIndex];
L1199_ps_Champion->_actionDefense += g495_actionDefense[L1197_ui_ActionIndex]; /* BUG0_54 The defense modifier of an action is permanent.
Each action has an associated defense modifier value and a number of ticks while the champion cannot perform another action because the action icon is grayed out. If an action has a non zero defense modifier and a zero value for the number of ticks then the defense modifier is applied but it is never removed. This causes no issue in the original games because there are no actions in this case but it may occur in a version where data is customized. This statement should only be executed if the value for the action in G0491_auc_Graphic560_ActionDisabledTicks is not 0 otherwise the action is not disabled at the end of F0407_MENUS_IsActionPerformed and thus not enabled later in F0253_TIMELINE_ProcessEvent11Part1_EnableChampionAction where the defense modifier is also removed */
setFlag(L1199_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
L1198_B_ClickTriggeredAction = f407_isActionPerformed(L1196_ui_ChampionIndex, L1197_ui_ActionIndex);
L1198_B_ClickTriggeredAction = isActionPerformed(L1196_ui_ChampionIndex, L1197_ui_ActionIndex);
L1199_ps_Champion->_actionIndex = (ChampionAction)L1197_ui_ActionIndex;
}
f388_clearActingChampion();
clearActingChampion();
return L1198_B_ClickTriggeredAction;
}
bool MenuMan::f407_isActionPerformed(uint16 champIndex, int16 actionIndex) {
bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
static unsigned char G0491_auc_Graphic560_ActionDisabledTicks[44] = {
0, /* N */
6, /* BLOCK */
@ -1085,9 +1085,9 @@ bool MenuMan::f407_isActionPerformed(uint16 champIndex, int16 actionIndex) {
L1251_i_MapX = _vm->_dungeonMan->_partyMapX;
L1252_i_MapY = _vm->_dungeonMan->_partyMapY;
L1251_i_MapX += _vm->_dirIntoStepCountEast[L1247_ps_Champion->_dir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[L1247_ps_Champion->_dir];
_g517_actionTargetGroupThing = _vm->_groupMan->groupGetThing(L1251_i_MapX, L1252_i_MapY);
_actionTargetGroupThing = _vm->_groupMan->groupGetThing(L1251_i_MapX, L1252_i_MapY);
L1249_ui_ActionDisabledTicks = G0491_auc_Graphic560_ActionDisabledTicks[actionIndex];
L1254_i_ActionSkillIndex = g496_ActionSkillIndex[actionIndex];
L1254_i_ActionSkillIndex = _actionSkillIndex[actionIndex];
L1253_i_ActionStamina = G0494_auc_Graphic560_ActionStamina[actionIndex] + _vm->getRandomNumber(2);
L1255_i_ActionExperienceGain = G0497_auc_Graphic560_ActionExperienceGain[actionIndex];
AL1244_ui_TargetSquare = _vm->_dungeonMan->getSquare(L1251_i_MapX, L1252_i_MapY).toByte();
@ -1112,7 +1112,7 @@ bool MenuMan::f407_isActionPerformed(uint16 champIndex, int16 actionIndex) {
T0407013:
AL1245_T_ExplosionThing = Thing::_explFireBall.toUint16();
T0407014:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
setChampionDirectionToPartyDirection(L1247_ps_Champion);
if (L1247_ps_Champion->_currMana < AL1246_i_RequiredManaAmount) {
AL1250_i_KineticEnergy = MAX(2, L1247_ps_Champion->_currMana * AL1250_i_KineticEnergy / AL1246_i_RequiredManaAmount);
AL1246_i_RequiredManaAmount = L1247_ps_Champion->_currMana;
@ -1120,7 +1120,7 @@ T0407014:
if (!(AL1245_B_ActionPerformed = _vm->_championMan->isProjectileSpellCast(champIndex, Thing(AL1245_T_ExplosionThing), AL1250_i_KineticEnergy, AL1246_i_RequiredManaAmount))) {
L1255_i_ActionExperienceGain >>= 1;
}
f405_decrementCharges(L1247_ps_Champion);
decrementCharges(L1247_ps_Champion);
break;
case k30_ChampionActionBash:
case k18_ChampionActionHack:
@ -1146,13 +1146,13 @@ T0407014:
case k28_ChampionActionSlash:
case k29_ChampionActionCleave:
case k6_ChampionActionPunch:
if (!(AL1245_B_ActionPerformed = f402_isMeleeActionPerformed(champIndex, L1247_ps_Champion, actionIndex, L1251_i_MapX, L1252_i_MapY, L1254_i_ActionSkillIndex))) {
if (!(AL1245_B_ActionPerformed = isMeleeActionPerformed(champIndex, L1247_ps_Champion, actionIndex, L1251_i_MapX, L1252_i_MapY, L1254_i_ActionSkillIndex))) {
L1255_i_ActionExperienceGain >>= 1;
L1249_ui_ActionDisabledTicks >>= 1;
}
break;
case k22_ChampionActionConfuse:
f405_decrementCharges(L1247_ps_Champion);
decrementCharges(L1247_ps_Champion);
case k8_ChampionActionWarCry:
case k37_ChampionActionCalm:
case k41_ChampionActionBrandish:
@ -1163,7 +1163,7 @@ T0407014:
if (actionIndex == k4_ChampionActionBlowHorn) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k25_soundBLOW_HORN, L1251_i_MapX, L1252_i_MapY, k0_soundModePlayImmediately);
}
AL1245_B_ActionPerformed = f401_isGroupFrightenedByAction(champIndex, actionIndex, L1251_i_MapX, L1252_i_MapY);
AL1245_B_ActionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, L1251_i_MapX, L1252_i_MapY);
break;
case k32_ChampionActionShoot:
if (Thing(L1247_ps_Champion->_slots[k0_ChampionSlotReadyHand]).getType() != k5_WeaponThingType)
@ -1180,7 +1180,7 @@ T0407014:
if ((AL1246_i_ActionHandWeaponClass >= k32_WeaponClassFirstSling) && (AL1246_i_ActionHandWeaponClass <= k47_WeaponClassLastSling)) {
if (AL1250_i_ReadyHandWeaponClass != k11_WeaponClassSlingAmmunition) {
T0407032:
_g513_actionDamage = kM2_damageNoAmmunition;
_actionDamage = kM2_damageNoAmmunition;
L1255_i_ActionExperienceGain = 0;
AL1245_B_ActionPerformed = false;
break;
@ -1188,7 +1188,7 @@ T0407032:
AL1246_i_StepEnergy -= k32_WeaponClassFirstSling;
}
}
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
setChampionDirectionToPartyDirection(L1247_ps_Champion);
{ // so gotos won't skip init
Thing AL1250_T_Object = _vm->_championMan->getObjectRemovedFromSlot(champIndex, k0_ChampionSlotReadyHand);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
@ -1207,19 +1207,19 @@ T0407032:
case Common::FR_FRA: message = messages_FR_FRA; break;
}
if (_vm->getRandomNumber(2)) {
f381_printMessageAfterReplacements(message[0]);
printMessageAfterReplacements(message[0]);
} else {
f381_printMessageAfterReplacements(message[1]);
printMessageAfterReplacements(message[1]);
}
}
break;
case k33_ChampionActionSpellshield:
case k34_ChampionActionFireshield:
if (!f403_isPartySpellOrFireShieldSuccessful(L1247_ps_Champion, actionIndex == k33_ChampionActionSpellshield, 280, true)) {
if (!isPartySpellOrFireShieldSuccessful(L1247_ps_Champion, actionIndex == k33_ChampionActionSpellshield, 280, true)) {
L1255_i_ActionExperienceGain >>= 2;
L1249_ui_ActionDisabledTicks >>= 1;
} else {
f405_decrementCharges(L1247_ps_Champion);
decrementCharges(L1247_ps_Champion);
}
break;
case k27_ChampionActionInvoke:
@ -1238,11 +1238,11 @@ T0407032:
goto T0407013;
}
case k35_ChampionActionFluxcage:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
setChampionDirectionToPartyDirection(L1247_ps_Champion);
_vm->_groupMan->fluxCageAction(L1251_i_MapX, L1252_i_MapY);
break;
case k43_ChampionActionFuse:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
setChampionDirectionToPartyDirection(L1247_ps_Champion);
L1251_i_MapX = _vm->_dungeonMan->_partyMapX;
L1252_i_MapY = _vm->_dungeonMan->_partyMapY;
L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
@ -1304,18 +1304,18 @@ T0407071:
L1248_ps_Weapon->setNextThing(Thing::_none);
} else {
AL1246_i_Ticks = 70;
f405_decrementCharges(L1247_ps_Champion);
decrementCharges(L1247_ps_Champion);
}
_vm->_championMan->_party._freezeLifeTicks = MIN(200, _vm->_championMan->_party._freezeLifeTicks + AL1246_i_Ticks);
break;
case k38_ChampionActionLight:
_vm->_championMan->_party._magicalLightAmount += _vm->_championMan->_lightPowerToLightAmount[2];
f404_createEvent70_light(-2, 2500);
createEvent70_light(-2, 2500);
T0407076:
f405_decrementCharges(L1247_ps_Champion);
decrementCharges(L1247_ps_Champion);
break;
case k42_ChampionActionThrow:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
setChampionDirectionToPartyDirection(L1247_ps_Champion);
AL1245_B_ActionPerformed = _vm->_championMan->isObjectThrown(champIndex, k1_ChampionSlotActionHand, (L1247_ps_Champion->_cell == returnNextVal(_vm->_dungeonMan->_partyDir)) || (L1247_ps_Champion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_partyDir)));
if (AL1245_B_ActionPerformed) {
_vm->_timeline->_g370_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->indexToOrdinal(k1_ChampionSlotActionHand);
@ -1334,14 +1334,14 @@ T0407076:
return AL1245_B_ActionPerformed;
}
void MenuMan::f406_setChampionDirectionToPartyDirection(Champion* champ) {
void MenuMan::setChampionDirectionToPartyDirection(Champion* champ) {
if (champ->_dir != _vm->_dungeonMan->_partyDir) {
champ->_dir = _vm->_dungeonMan->_partyDir;
setFlag(champ->_attributes, k0x0400_ChampionAttributeIcon);
}
}
void MenuMan::f405_decrementCharges(Champion* champ) {
void MenuMan::decrementCharges(Champion* champ) {
Thing L1242_T_Thing;
Junk* L1243_ps_Junk;
@ -1368,7 +1368,7 @@ void MenuMan::f405_decrementCharges(Champion* champ) {
_vm->_championMan->drawChangedObjectIcons();
}
bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int16 actionIndex, int16 targetMapX, int16 targetMapY, int16 skillIndex) {
bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion* champ, int16 actionIndex, int16 targetMapX, int16 targetMapY, int16 skillIndex) {
static unsigned char G0492_auc_Graphic560_ActionDamageFactor[44] = {
0, /* N */
15, /* BLOCK */
@ -1470,7 +1470,7 @@ bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int
int16 L1238_i_CreatureOrdinal;
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
if (_g517_actionTargetGroupThing == Thing::_endOfList)
if (_actionTargetGroupThing == Thing::_endOfList)
goto T0402010;
L1238_i_CreatureOrdinal = _vm->_groupMan->getMeleeTargetCreatureOrdinal(targetMapX, targetMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, AL1236_ui_ChampionCell = champ->_cell);
if (L1238_i_CreatureOrdinal) {
@ -1482,25 +1482,25 @@ bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int
AL1237_ui_CellDelta = 1;
T0402005: /* Check if there is another champion in front */
if (_vm->_championMan->getIndexInCell(normalizeModulo4(AL1236_ui_ChampionCell + AL1237_ui_CellDelta)) != kM1_ChampionNone) {
_g513_actionDamage = kM1_damageCantReach;
_actionDamage = kM1_damageCantReach;
goto T0402010;
}
}
if ((actionIndex == k24_ChampionActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_g517_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
if ((actionIndex == k24_ChampionActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
goto T0402010;
AL1237_ui_ActionHitProbability = G0493_auc_Graphic560_ActionHitProbability[actionIndex];
AL1236_ui_ActionDamageFactor = G0492_auc_Graphic560_ActionDamageFactor[actionIndex];
if ((_vm->_objectMan->f33_getIconIndex(champ->_slots[k1_ChampionSlotActionHand]) == k40_IconIndiceWeaponVorpalBlade) || (actionIndex == k24_ChampionActionDisrupt)) {
setFlag(AL1237_ui_ActionHitProbability, k0x8000_hitNonMaterialCreatures);
}
_g513_actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
_actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->getThingData(_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
return true;
}
T0402010:
return false;
}
bool MenuMan::f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, int16 mapX, int16 mapY) {
bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, int16 mapX, int16 mapY) {
int16 L1229_i_FrightAmount = 0;
uint16 L1230_ui_FearResistance;
uint16 L1231_ui_Experience = 0;
@ -1511,7 +1511,7 @@ bool MenuMan::f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionInde
L1232_B_IsGroupFrightenedByAction = false;
if (_g517_actionTargetGroupThing == Thing::_endOfList)
if (_actionTargetGroupThing == Thing::_endOfList)
goto T0401016;
switch (actionIndex) {
case k8_ChampionActionWarCry:
@ -1535,7 +1535,7 @@ bool MenuMan::f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionInde
L1231_ui_Experience = 45;
}
L1229_i_FrightAmount += _vm->_championMan->getSkillLevel(champIndex, k14_ChampionSkillInfluence);
L1233_ps_Group = (Group*)_vm->_dungeonMan->getThingData(_g517_actionTargetGroupThing);
L1233_ps_Group = (Group*)_vm->_dungeonMan->getThingData(_actionTargetGroupThing);
L1234_ps_CreatureInfo = &g243_CreatureInfo[L1233_ps_Group->_type];
if (((L1230_ui_FearResistance = L1234_ps_CreatureInfo->getFearResistance()) > _vm->getRandomNumber(L1229_i_FrightAmount)) || (L1230_ui_FearResistance == k15_immuneToFear)) {
L1231_ui_Experience >>= 1;
@ -1554,7 +1554,7 @@ T0401016:
return L1232_B_IsGroupFrightenedByAction;
}
void MenuMan::f381_printMessageAfterReplacements(const char* str) {
void MenuMan::printMessageAfterReplacements(const char* str) {
char* L1164_pc_Character;
char* L1165_pc_ReplacementString;
char L1166_ac_OutputString[128];
@ -1586,7 +1586,7 @@ void MenuMan::f381_printMessageAfterReplacements(const char* str) {
}
}
void MenuMan::f389_processCommands116To119_setActingChampion(uint16 champIndex) {
void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) {
static ActionSet G0489_as_Graphic560_ActionSets[44] = {
/* { ActionIndices[0], ActionIndices[1], ActionIndices[2], ActionProperties[0], ActionProperties[1], Useless } */
ActionSet(255, 255, 255, 0x00, 0x00),
@ -1650,15 +1650,15 @@ void MenuMan::f389_processCommands116To119_setActingChampion(uint16 champIndex)
}
L1191_ps_ActionSet = &G0489_as_Graphic560_ActionSets[L1188_ui_ActionSetIndex];
_vm->_championMan->_actingChampionOrdinal = _vm->indexToOrdinal(champIndex);
f383_setActionList(L1191_ps_ActionSet);
_g509_actionAreaContainsIcons = false;
setActionList(L1191_ps_ActionSet);
_actionAreaContainsIcons = false;
setFlag(L1190_ps_Champion->_attributes, k0x8000_ChampionAttributeActionHand);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
f387_drawActionArea();
f387_drawActionArea();
drawActionArea();
drawActionArea();
}
void MenuMan::f383_setActionList(ActionSet* actionSet) {
void MenuMan::setActionList(ActionSet* actionSet) {
#define k0x0080_actionRequiresCharge 0x0080 // @ MASK0x0080_ACTION_REQUIRES_CHARGE
@ -1667,28 +1667,28 @@ void MenuMan::f383_setActionList(ActionSet* actionSet) {
uint16 L1171_ui_ActionIndex;
uint16 L1172_ui_MinimumSkillLevel;
_g713_actionList._actionIndices[0] = (ChampionAction)actionSet->_actionIndices[0];
_g713_actionList._minimumSkillLevel[0] = 1;
_actionList._actionIndices[0] = (ChampionAction)actionSet->_actionIndices[0];
_actionList._minimumSkillLevel[0] = 1;
L1170_ui_NextAvailableActionListIndex = 1;
for (L1169_ui_ActionListIndex = 1; L1169_ui_ActionListIndex < 3; L1169_ui_ActionListIndex++) {
if ((L1171_ui_ActionIndex = actionSet->_actionIndices[L1169_ui_ActionListIndex]) == k255_ChampionActionNone)
continue;
if (getFlag(L1172_ui_MinimumSkillLevel = actionSet->_actionProperties[L1169_ui_ActionListIndex - 1], k0x0080_actionRequiresCharge) && !f382_getActionObjectChargeCount())
if (getFlag(L1172_ui_MinimumSkillLevel = actionSet->_actionProperties[L1169_ui_ActionListIndex - 1], k0x0080_actionRequiresCharge) && !getActionObjectChargeCount())
continue;
clearFlag(L1172_ui_MinimumSkillLevel, k0x0080_actionRequiresCharge);
if (_vm->_championMan->getSkillLevel(_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), g496_ActionSkillIndex[L1171_ui_ActionIndex]) >= L1172_ui_MinimumSkillLevel) {
_g713_actionList._actionIndices[L1170_ui_NextAvailableActionListIndex] = (ChampionAction)L1171_ui_ActionIndex;
_g713_actionList._minimumSkillLevel[L1170_ui_NextAvailableActionListIndex] = L1172_ui_MinimumSkillLevel;
if (_vm->_championMan->getSkillLevel(_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), _actionSkillIndex[L1171_ui_ActionIndex]) >= L1172_ui_MinimumSkillLevel) {
_actionList._actionIndices[L1170_ui_NextAvailableActionListIndex] = (ChampionAction)L1171_ui_ActionIndex;
_actionList._minimumSkillLevel[L1170_ui_NextAvailableActionListIndex] = L1172_ui_MinimumSkillLevel;
L1170_ui_NextAvailableActionListIndex++;
}
}
_g507_actionCount = L1170_ui_NextAvailableActionListIndex;
_actionCount = L1170_ui_NextAvailableActionListIndex;
for (L1169_ui_ActionListIndex = L1170_ui_NextAvailableActionListIndex; L1169_ui_ActionListIndex < 3; L1169_ui_ActionListIndex++) {
_g713_actionList._actionIndices[L1169_ui_ActionListIndex] = k255_ChampionActionNone;
_actionList._actionIndices[L1169_ui_ActionListIndex] = k255_ChampionActionNone;
}
}
int16 MenuMan::f382_getActionObjectChargeCount() {
int16 MenuMan::getActionObjectChargeCount() {
Thing L1167_T_Thing;
Junk* L1168_ps_Junk;
@ -1706,7 +1706,7 @@ int16 MenuMan::f382_getActionObjectChargeCount() {
}
}
void MenuMan::f385_drawActionDamage(int16 damage) {
void MenuMan::drawActionDamage(int16 damage) {
static const Box G0502_s_Graphic560_Box_ActionAreaMediumDamage = Box(242, 305, 81, 117);
static const Box G0503_s_Graphic560_Box_ActionAreaSmallDamage = Box(251, 292, 81, 117);
@ -1727,7 +1727,7 @@ void MenuMan::f385_drawActionDamage(int16 damage) {
_vm->_eventMan->showMouse();
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->fillScreenBox(boxActionArea, k0_ColorBlack);
_vm->_displayMan->fillScreenBox(_boxActionArea, k0_ColorBlack);
if (damage < 0) {
static const char *messages_EN_ANY[2] = {"CAN'T REACH", "NEED AMMO"};
static const char *messages_DE_DEU[2] = {"ZU WEIT WEG", "MEHR MUNITION"};
@ -1754,7 +1754,7 @@ void MenuMan::f385_drawActionDamage(int16 damage) {
_vm->_textMan->f53_printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, (char *)AL1178_puc_String);
} else {
if (damage > 40) {
L1180_ps_Box = &boxActionArea3ActionMenu;
L1180_ps_Box = &_boxActionArea3ActionMenu;
L1177_puc_Bitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k14_damageToCreatureIndice);
L1175_i_ByteWidth = k48_byteWidth;
L1643_i_Width = 45;

View File

@ -22,7 +22,7 @@
/*
* Based on the Reverse Engineering work of Christophe Fontanel,
* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
-* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
*/
#ifndef DM_MENUS_H
@ -71,61 +71,61 @@ public:
explicit MenuMan(DMEngine *vm);
~MenuMan();
bool _g508_refreshActionArea; // @ G0508_B_RefreshActionArea
bool _g509_actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons
int16 _g513_actionDamage; // @ G0513_i_ActionDamage
ActionList _g713_actionList; // @ G0713_s_ActionList
byte *_gK72_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine
byte *_gK73_bitmapSpellAreaLines; // @ K0073_puc_Bitmap_SpellAreaLines
Thing _g517_actionTargetGroupThing; // @ G0517_T_ActionTargetGroupThing
uint16 _g507_actionCount; // @ G0507_ui_ActionCount
bool _refreshActionArea; // @ G0508_B_RefreshActionArea
bool _actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons
int16 _actionDamage; // @ G0513_i_ActionDamage
ActionList _actionList; // @ G0713_s_ActionList
byte *_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine
byte *_bitmapSpellAreaLines; // @ K0073_puc_Bitmap_SpellAreaLines
Thing _actionTargetGroupThing; // @ G0517_T_ActionTargetGroupThing
uint16 _actionCount; // @ G0507_ui_ActionCount
void f388_clearActingChampion(); // @ F0388_MENUS_ClearActingChampion
void f386_drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon
void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion
void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon
void f395_drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows
void f456_drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus
void f390_refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
void f387_drawActionArea(); // @ F0387_MENUS_DrawActionArea
const char* f384_getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName
void f393_drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls
void f392_buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine
void f394_setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea
void f457_drawEnabledMenus(); // @ F0457_START_DrawEnabledMenus_CPSF
int16 f408_getClickOnSpellCastResult(); // @ F0408_MENUS_GetClickOnSpellCastResult
int16 f412_getChampionSpellCastResult(uint16 champIndex); // @ F0412_MENUS_GetChampionSpellCastResult
Spell *f409_getSpellFromSymbols(byte *symbols); // @ F0409_MENUS_GetSpellFromSymbols
void f410_menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, uint16 skillIndex); // @ F0410_MENUS_PrintSpellFailureMessage
Potion *f411_getEmptyFlaskInHand(Champion *champ, Thing *potionThing); // @ F0411_MENUS_GetEmptyFlaskInHand
void f404_createEvent70_light(int16 lightPower, int16 ticks); // @ F0404_MENUS_CreateEvent70_Light
bool f403_isPartySpellOrFireShieldSuccessful(Champion *champ, bool spellShield, uint16 ticks, bool useMana); // @ F0403_MENUS_IsPartySpellOrFireShieldSuccessful
void f397_drawAvailableSymbols(uint16 symbolStep); // @ F0397_MENUS_DrawAvailableSymbols
void f398_drawChampionSymbols(Champion *champ); // @ F0398_MENUS_DrawChampionSymbols
void f399_addChampionSymbol(int16 symbolIndex); // @ F0399_MENUS_AddChampionSymbol
void f400_deleteChampionSymbol(); // @ F0400_MENUS_DeleteChampionSymbol
bool f391_didClickTriggerAction(int16 actionListIndex); // @ F0391_MENUS_DidClickTriggerAction
bool f407_isActionPerformed(uint16 champIndex, int16 actionIndex); // @ F0407_MENUS_IsActionPerformed
void f406_setChampionDirectionToPartyDirection(Champion *champ); // @ F0406_MENUS_SetChampionDirectionToPartyDirection
void f405_decrementCharges(Champion *champ); // @ F0405_MENUS_DecrementCharges
bool f402_isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 actionIndex, int16 targetMapX,
void drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows
void drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus
void refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
void drawActionArea(); // @ F0387_MENUS_DrawActionArea
const char *getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName
void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls
void buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine
void setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea
void drawEnabledMenus(); // @ F0457_START_DrawEnabledMenus_CPSF
int16 getClickOnSpellCastResult(); // @ F0408_MENUS_GetClickOnSpellCastResult
int16 getChampionSpellCastResult(uint16 champIndex); // @ F0412_MENUS_GetChampionSpellCastResult
Spell *getSpellFromSymbols(byte *symbols); // @ F0409_MENUS_GetSpellFromSymbols
void menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, uint16 skillIndex); // @ F0410_MENUS_PrintSpellFailureMessage
Potion *getEmptyFlaskInHand(Champion *champ, Thing *potionThing); // @ F0411_MENUS_GetEmptyFlaskInHand
void createEvent70_light(int16 lightPower, int16 ticks); // @ F0404_MENUS_CreateEvent70_Light
bool isPartySpellOrFireShieldSuccessful(Champion *champ, bool spellShield, uint16 ticks, bool useMana); // @ F0403_MENUS_IsPartySpellOrFireShieldSuccessful
void drawAvailableSymbols(uint16 symbolStep); // @ F0397_MENUS_DrawAvailableSymbols
void drawChampionSymbols(Champion *champ); // @ F0398_MENUS_DrawChampionSymbols
void addChampionSymbol(int16 symbolIndex); // @ F0399_MENUS_AddChampionSymbol
void deleteChampionSymbol(); // @ F0400_MENUS_DeleteChampionSymbol
bool didClickTriggerAction(int16 actionListIndex); // @ F0391_MENUS_DidClickTriggerAction
bool isActionPerformed(uint16 champIndex, int16 actionIndex); // @ F0407_MENUS_IsActionPerformed
void setChampionDirectionToPartyDirection(Champion *champ); // @ F0406_MENUS_SetChampionDirectionToPartyDirection
void decrementCharges(Champion *champ); // @ F0405_MENUS_DecrementCharges
bool isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 actionIndex, int16 targetMapX,
int16 targetMapY, int16 skillIndex); // @ F0402_MENUS_IsMeleeActionPerformed
bool f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, int16 mapX, int16 mapY); // @ F0401_MENUS_IsGroupFrightenedByAction
void f381_printMessageAfterReplacements(const char *str); // @ F0381_MENUS_PrintMessageAfterReplacements
void f389_processCommands116To119_setActingChampion(uint16 champIndex); // @ F0389_MENUS_ProcessCommands116To119_SetActingChampion
void f383_setActionList(ActionSet *actionSet); // @ F0383_MENUS_SetActionList
int16 f382_getActionObjectChargeCount(); // @ F0382_MENUS_GetActionObjectChargeCount
void f385_drawActionDamage(int16 damage); // @ F0385_MENUS_DrawActionDamage
bool isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, int16 mapX, int16 mapY); // @ F0401_MENUS_IsGroupFrightenedByAction
void printMessageAfterReplacements(const char *str); // @ F0381_MENUS_PrintMessageAfterReplacements
void processCommands116To119_setActingChampion(uint16 champIndex); // @ F0389_MENUS_ProcessCommands116To119_SetActingChampion
void setActionList(ActionSet *actionSet); // @ F0383_MENUS_SetActionList
int16 getActionObjectChargeCount(); // @ F0382_MENUS_GetActionObjectChargeCount
void drawActionDamage(int16 damage); // @ F0385_MENUS_DrawActionDamage
Box boxActionArea3ActionMenu; // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
Box boxActionArea2ActionMenu; // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
Box boxActionArea1ActionMenu; // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
Box boxActionArea; // @ G0001_s_Graphic562_Box_ActionArea
Box boxSpellArea;
unsigned char g496_ActionSkillIndex[44]; // @ G0496_auc_Graphic560_ActionSkillIndex
Box _boxActionArea3ActionMenu; // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
Box _boxActionArea2ActionMenu; // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
Box _boxActionArea1ActionMenu; // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
Box _boxActionArea; // @ G0001_s_Graphic562_Box_ActionArea
Box _boxSpellArea;
unsigned char _actionSkillIndex[44]; // @ G0496_auc_Graphic560_ActionSkillIndex
void initConstants();
};
}
#endif // !DM_MENUS_H
#endif // DM_MENUS_H