diff options
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/champion.cpp | 56 | ||||
-rw-r--r-- | engines/dm/console.cpp | 12 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 12 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 4 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 10 | ||||
-rw-r--r-- | engines/dm/group.cpp | 42 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 32 | ||||
-rw-r--r-- | engines/dm/loadsave.cpp | 8 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 8 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 38 | ||||
-rw-r--r-- | engines/dm/objectman.cpp | 136 | ||||
-rw-r--r-- | engines/dm/objectman.h | 22 | ||||
-rw-r--r-- | engines/dm/projexpl.cpp | 94 | ||||
-rw-r--r-- | engines/dm/projexpl.h | 34 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 16 |
15 files changed, 263 insertions, 261 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 9e30bdf177..6d9c579698 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -236,7 +236,7 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side) kineticEnergy += _vm->getRandomNumber(16) + (kineticEnergy >> 1) + skillLevel; int16 attack = getBoundedValue((uint16)40, (uint16)((skillLevel << 3) + _vm->getRandomNumber(32)), (uint16)200); int16 stepEnergy = MAX(5, 11 - skillLevel); - _vm->_projexpl->f212_projectileCreate(curThing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, + _vm->_projexpl->createProjectile(curThing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, normalizeModulo4(_vm->_dungeonMan->_partyDir + side), _vm->_dungeonMan->_partyDir, kineticEnergy, attack, stepEnergy); _vm->_projectileDisableMovementTicks = 4; @@ -434,17 +434,17 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) { ObjectMan &objMan = *_vm->_objectMan; - IconIndice currIconIndex = objMan.f39_getIconIndexInSlotBox(slotBoxIndex); + IconIndice currIconIndex = objMan.getIconIndexInSlotBox(slotBoxIndex); if (((currIconIndex < k32_IconIndiceWeaponDagger) && (currIconIndex >= k0_IconIndiceJunkCompassNorth)) || ((currIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (currIconIndex <= k163_IconIndicePotionWaterFlask)) || (currIconIndex == k195_IconIndicePotionEmptyFlask)) { - IconIndice newIconIndex = objMan.f33_getIconIndex(thing); + IconIndice newIconIndex = objMan.getIconIndex(thing); if (newIconIndex != currIconIndex) { if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) { _mousePointerHiddenToDrawChangedObjIconOnScreen = true; _vm->_eventMan->hideMouse(); } - objMan.f38_drawIconInSlotBox(slotBoxIndex, newIconIndex); + objMan.drawIconInSlotBox(slotBoxIndex, newIconIndex); return true; } } @@ -467,14 +467,14 @@ void ChampionMan::drawChangedObjectIcons() { if (((leaderHandObjIconIndex < k32_IconIndiceWeaponDagger) && (leaderHandObjIconIndex >= k0_IconIndiceJunkCompassNorth)) // < instead of <= is correct || ((leaderHandObjIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (leaderHandObjIconIndex <= k163_IconIndicePotionWaterFlask)) || (leaderHandObjIconIndex == k195_IconIndicePotionEmptyFlask)) { - IconIndice iconIndex = objMan.f33_getIconIndex(_leaderHandObject); + IconIndice iconIndex = objMan.getIconIndex(_leaderHandObject); if (iconIndex != leaderHandObjIconIndex) { _mousePointerHiddenToDrawChangedObjIconOnScreen = true; _vm->_eventMan->hideMouse(); - objMan.f36_extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer); - _vm->_eventMan->setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + objMan.extractIconFromBitmap(iconIndex, objMan._objectIconForMousePointer); + _vm->_eventMan->setPointerToObject(_vm->_objectMan->_objectIconForMousePointer); _leaderHandObjectIconIndex = iconIndex; - objMan.f34_drawLeaderObjectName(_leaderHandObject); + objMan.drawLeaderObjectName(_leaderHandObject); } } @@ -539,7 +539,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); + IconIndice iconIndex = objMan.getIconIndex(thing); bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal); applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing); uint16 *rawObjPtr = dunMan.getThingData(thing); @@ -608,7 +608,7 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() { _leaderHandObject = Thing::_none; _leaderHandObjectIconIndex = kM1_IconIndiceNone; _vm->_eventMan->showMouse(); - _vm->_objectMan->f35_clearLeaderObjectName(); + _vm->_objectMan->clearLeaderObjectName(); _vm->_eventMan->setMousePointer(); _vm->_eventMan->hideMouse(); if (_leaderIndex != kM1_ChampionNone) { @@ -676,7 +676,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex) return Thing::_none; bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal); - int16 curIconIndex = _vm->_objectMan->f33_getIconIndex(curThing); + int16 curIconIndex = _vm->_objectMan->getIconIndex(curThing); // Remove object modifiers applyModifiersToStatistics(curChampion, slotIndex, curIconIndex, -1, curThing); @@ -947,7 +947,7 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) { } void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint16 exp) { - if ((skillIndex >= k4_ChampionSkillSwing) && (skillIndex <= k11_ChampionSkillShoot) && (_vm->_projexpl->_g361_lastCreatureAttackTime < _vm->_gameTime - 150)) + if ((skillIndex >= k4_ChampionSkillSwing) && (skillIndex <= k11_ChampionSkillShoot) && (_vm->_projexpl->_lastCreatureAttackTime < _vm->_gameTime - 150)) exp >>= 1; if (exp) { @@ -963,7 +963,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1 uint16 skillLevelBefore = getSkillLevel(champIndex, baseSkillIndex | (k0x4000_IgnoreObjectModifiers | k0x8000_IgnoreTemporaryExperience)); - if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_g361_lastCreatureAttackTime > _vm->_gameTime - 25)) + if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_lastCreatureAttackTime > _vm->_gameTime - 25)) exp <<= 1; Skill *curSkill = &curChampion->_skills[skillIndex]; @@ -1196,14 +1196,14 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) { return; _leaderEmptyHanded = false; - _vm->_objectMan->f36_extractIconFromBitmap(_leaderHandObjectIconIndex = _vm->_objectMan->f33_getIconIndex(_leaderHandObject = thing), _vm->_objectMan->_g412_objectIconForMousePointer); + _vm->_objectMan->extractIconFromBitmap(_leaderHandObjectIconIndex = _vm->_objectMan->getIconIndex(_leaderHandObject = thing), _vm->_objectMan->_objectIconForMousePointer); _vm->_eventMan->showMouse(); - _vm->_objectMan->f34_drawLeaderObjectName(thing); + _vm->_objectMan->drawLeaderObjectName(thing); if (setMousePointer) _vm->_setMousePointerToObjectInMainLoop = true; else - _vm->_eventMan->setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + _vm->_eventMan->setPointerToObject(_vm->_objectMan->_objectIconForMousePointer); _vm->_eventMan->hideMouse(); if (_leaderIndex != kM1_ChampionNone) { @@ -1238,7 +1238,7 @@ int16 ChampionMan::getMovementTicks(Champion *champ) { if (getFlag(champ->_wounds, k0x0020_ChampionWoundFeet)) ticks += woundTicks; - if (_vm->_objectMan->f33_getIconIndex(champ->_slots[k5_ChampionSlotFeet]) == k194_IconIndiceArmourBootOfSpeed) + if (_vm->_objectMan->getIconIndex(champ->_slots[k5_ChampionSlotFeet]) == k194_IconIndiceArmourBootOfSpeed) ticks--; return ticks; @@ -1357,7 +1357,7 @@ bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 ki void ChampionMan::championShootProjectile(Champion* champ, Thing thing, int16 kineticEnergy, int16 attack, int16 stepEnergy) { Direction newDirection = champ->_dir; - _vm->_projexpl->f212_projectileCreate(thing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy); + _vm->_projexpl->createProjectile(thing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy); _vm->_projectileDisableMovementTicks = 4; _vm->_lastProjectileDisabledMovementDirection = newDirection; } @@ -1455,7 +1455,7 @@ void ChampionMan::championKill(uint16 champIndex) { _vm->_pressingEye = false; _vm->_eventMan->_ignoreMouseMovements = false; if (!_leaderEmptyHanded) { - _vm->_objectMan->f34_drawLeaderObjectName(_leaderHandObject); + _vm->_objectMan->drawLeaderObjectName(_leaderHandObject); } _vm->_eventMan->_hideMousePointerRequestCount = 1; _vm->_eventMan->hideMouse(); @@ -1620,7 +1620,7 @@ void ChampionMan::applyTimeEffects() { if (_partyIsSleeping) staminaAmount <<= 1; - int32 compDelay = _vm->_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime; + int32 compDelay = _vm->_gameTime - _vm->_projexpl->_lastPartyMovementTime; if (compDelay > 80) { staminaAmount++; if (compDelay > 250) @@ -1663,7 +1663,7 @@ void ChampionMan::applyTimeEffects() { if (_partyIsSleeping) healthGain <<= 1; - if (_vm->_objectMan->f33_getIconIndex(championPtr->_slots[k10_ChampionSlotNeck]) == k121_IconIndiceJunkEkkhardCross) + if (_vm->_objectMan->getIconIndex(championPtr->_slots[k10_ChampionSlotNeck]) == k121_IconIndiceJunkEkkhardCross) healthGain += (healthGain >> 1) + 1; championPtr->_currHealth += MIN(healthGain, (int16)(championPtr->_maxHealth - championPtr->_currHealth)); @@ -1678,7 +1678,7 @@ void ChampionMan::applyTimeEffects() { curStatistic[k1_ChampionStatCurrent] -= curStatistic[k1_ChampionStatCurrent] / statisticMaximum; } } - if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < _vm->_gameTime)) { + if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_partyDir) && (_vm->_projexpl->_lastCreatureAttackTime + 60 < _vm->_gameTime)) { championPtr->_dir = _vm->_dungeonMan->_partyDir; championPtr->_maximumDamageReceived = 0; setFlag(championPtr->_attributes, k0x0400_ChampionAttributeIcon); @@ -2101,7 +2101,7 @@ uint16 ChampionMan::getMaximumLoad(Champion *champ) { if (wounds) maximumLoad -= maximumLoad >> (champ->getWoundsFlag(k0x0010_ChampionWoundLegs) ? 2 : 3); - if (_vm->_objectMan->f33_getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) + if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) maximumLoad += maximumLoad * 16; maximumLoad += 9; @@ -2314,7 +2314,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) { else thing = champ->getSlot((ChampionSlot)slotIndex); - SlotBox *slotBox = &_vm->_objectMan->_g30_slotBoxes[slotBoxIndex]; + SlotBox *slotBox = &_vm->_objectMan->_slotBoxes[slotBoxIndex]; Box box; box._x1 = slotBox->_x - 1; box._y1 = slotBox->_y - 1; @@ -2340,7 +2340,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) { iconIndex = k204_IconIndiceEmptyBox; } } else { - iconIndex = _vm->_objectMan->f33_getIconIndex(thing); // BUG0_35 + iconIndex = _vm->_objectMan->getIconIndex(thing); // BUG0_35 if (isInventoryChamp && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == k144_IconIndiceContainerChestClosed) || (iconIndex == k30_IconIndiceScrollOpen))) { iconIndex++; } // BUG2_00 @@ -2368,7 +2368,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) { } } - _vm->_objectMan->f38_drawIconInSlotBox(slotBoxIndex, iconIndex); + _vm->_objectMan->drawIconInSlotBox(slotBoxIndex, iconIndex); if (!isInventoryChamp) _vm->_eventMan->showMouse(); @@ -2569,13 +2569,13 @@ uint16 ChampionMan::getSkillLevel(int16 champIndex, uint16 skillIndex) { skillLevel++; } if (!ignoreObjModifiers) { - int16 actionHandIconIndex = _vm->_objectMan->f33_getIconIndex(champ->_slots[k1_ChampionSlotActionHand]); + int16 actionHandIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k1_ChampionSlotActionHand]); if (actionHandIconIndex == k27_IconIndiceWeaponTheFirestaff) skillLevel++; else if (actionHandIconIndex == k28_IconIndiceWeaponTheFirestaffComplete) skillLevel += 2; - int16 neckIconIndex = _vm->_objectMan->f33_getIconIndex(champ->_slots[k10_ChampionSlotNeck]); + int16 neckIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k10_ChampionSlotNeck]); switch (skillIndex) { case k3_ChampionSkillWizard: if (neckIconIndex == k124_IconIndiceJunkPendantFeral) diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp index 77da72a632..c5ebd140af 100644 --- a/engines/dm/console.cpp +++ b/engines/dm/console.cpp @@ -208,12 +208,12 @@ bool Console::Cmd_listItems(int argc, const char** argv) { bool atleastOneFound = false; int16 namesPrintedInLine = 0; - if(strstr(_vm->_objectMan->_g352_objectNames[0], searchedString.c_str()) != nullptr) - debugPrintf("| %s", _vm->_objectMan->_g352_objectNames[0]); + if(strstr(_vm->_objectMan->_objectNames[0], searchedString.c_str()) != nullptr) + debugPrintf("| %s", _vm->_objectMan->_objectNames[0]); for (uint16 i = 1; i < k199_ObjectNameCount; ++i) { - const char *name = _vm->_objectMan->_g352_objectNames[i - 1]; - const char *prevName = _vm->_objectMan->_g352_objectNames[i]; + const char *name = _vm->_objectMan->_objectNames[i - 1]; + const char *prevName = _vm->_objectMan->_objectNames[i]; if (!cstrEquals(name, prevName) && (strstr(name, searchedString.c_str()) != nullptr)) { debugPrintf(" | %s", name); @@ -257,9 +257,9 @@ bool Console::Cmd_gimme(int argc, const char** argv) { dummyThing.setType(thingType); for (int16 thingIndex = 0; thingIndex < thingCount; ++thingIndex) { dummyThing.setIndex(thingIndex); - int16 iconIndex = _vm->_objectMan->f33_getIconIndex(dummyThing); + int16 iconIndex = _vm->_objectMan->getIconIndex(dummyThing); if (iconIndex != -1) { - const char *displayName = _vm->_objectMan->_g352_objectNames[iconIndex]; + const char *displayName = _vm->_objectMan->_objectNames[iconIndex]; if (cstrEquals(displayName, requestedItemName.c_str())) { uint16 *newThingData = new uint16[(thingCount + 1) * thingTypeSize]; memcpy(newThingData, thingDataArray, sizeof(uint16) * thingTypeSize * thingCount); diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index c82246de38..eb592edc97 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -456,7 +456,7 @@ void DMEngine::gameloop() { if (_setMousePointerToObjectInMainLoop) { _setMousePointerToObjectInMainLoop = false; _eventMan->showMouse(); - _eventMan->setPointerToObject(_objectMan->_g412_objectIconForMousePointer); + _eventMan->setPointerToObject(_objectMan->_objectIconForMousePointer); _eventMan->hideMouse(); } @@ -1002,14 +1002,14 @@ T0446002: fuseSequenceUpdate(); for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) { - _projexpl->f213_explosionCreate(Thing::_explFireBall, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); + _projexpl->createExplosion(Thing::_explFireBall, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); fuseSequenceUpdate(); } _sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized); L1428_ps_Group->_type = k25_CreatureTypeLordOrder; fuseSequenceUpdate(); for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) { - _projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); + _projexpl->createExplosion(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); fuseSequenceUpdate(); } for (AL1425_i_CycleCount = 4; --AL1425_i_CycleCount; ) { @@ -1019,8 +1019,8 @@ T0446002: for (AL1426_i_FuseSequenceUpdateCount = AL1425_i_CycleCount; AL1426_i_FuseSequenceUpdateCount--; fuseSequenceUpdate()); } } - _projexpl->f213_explosionCreate(Thing::_explFireBall, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); - _projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); + _projexpl->createExplosion(Thing::_explFireBall, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); + _projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); fuseSequenceUpdate(); L1428_ps_Group->_type = k26_CreatureTypeGreyLord; fuseSequenceUpdate(); @@ -1061,7 +1061,7 @@ T0446002: } for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) { - _projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); + _projexpl->createExplosion(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature); fuseSequenceUpdate(); } diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 82b1e8db5c..dbfbfc3e8b 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -1451,9 +1451,9 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) { _vm->_groupMan->dropGroupPossessions(currMapX, currMapY, squareThing, kM1_soundModeDoNotPlaySound); _vm->_groupMan->groupDelete(currMapX, currMapY); } else { - _vm->_projexpl->f214_projectileDeleteEvent(squareThing); + _vm->_projexpl->projectileDeleteEvent(squareThing); unlinkThingFromList(squareThing, Thing(0), currMapX, currMapY); - _vm->_projexpl->f215_projectileDelete(squareThing, 0, currMapX, currMapY); + _vm->_projexpl->projectileDelete(squareThing, 0, currMapX, currMapY); } break; case k6_ArmourThingType: diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index c84fd010aa..a823486530 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -579,7 +579,7 @@ void EventManager::setMousePointer() { if (_vm->_championMan->_leaderEmptyHanded) setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand); else - setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + setPointerToObject(_vm->_objectMan->_objectIconForMousePointer); } void EventManager::showMouse() { @@ -1195,7 +1195,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY processType80_clickInDungeonViewDropLeaderHandObject(k4_ViewCellAlcove); else { if (_vm->_dungeonMan->_isFacingFountain) { - uint16 iconIdx = _vm->_objectMan->f33_getIconIndex(thingHandObject); + uint16 iconIdx = _vm->_objectMan->getIconIndex(thingHandObject); uint16 weight = _vm->_dungeonMan->getObjectWeight(thingHandObject); if ((iconIdx >= k8_IconIndiceJunkWater) && (iconIdx <= k9_IconIndiceJunkWaterSkin)) junkPtr->setChargeCount(3); /* Full */ @@ -1286,7 +1286,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane } if (champMan._partyChampionCount == 1) { - _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime; + _vm->_projexpl->_lastPartyMovementTime = _vm->_gameTime; commandSetLeader(k0_ChampionFirst); _vm->_menuMan->setMagicCasterAndDrawSpellArea(k0_ChampionFirst); } else @@ -1356,7 +1356,7 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16 } Thing topPileThing = _vm->_dungeonMan->_pileTopObject[viewCell]; - if (_vm->_objectMan->f33_getIconIndex(topPileThing) != kM1_IconIndiceNone) { + if (_vm->_objectMan->getIconIndex(topPileThing) != kM1_IconIndiceNone) { _vm->_moveSens->getMoveResult(topPileThing, mapX, mapY, kM1_MapXNotOnASquare, 0); _vm->_championMan->putObjectInLeaderHand(topPileThing, true); } @@ -1380,7 +1380,7 @@ void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 v uint16 currCell = normalizeModulo4(_vm->_dungeonMan->_partyDir + viewCell); Thing removedThing = _vm->_championMan->getObjectRemovedFromLeaderHand(); _vm->_moveSens->getMoveResult(thingWithNewCell(removedThing, currCell), kM1_MapXNotOnASquare, 0, mapX, mapY); - if (droppingIntoAnAlcove && _vm->_dungeonMan->_isFacingViAltar && (_vm->_objectMan->f33_getIconIndex(removedThing) == k147_IconIndiceJunkChampionBones)) { + if (droppingIntoAnAlcove && _vm->_dungeonMan->_isFacingViAltar && (_vm->_objectMan->getIconIndex(removedThing) == k147_IconIndiceJunkChampionBones)) { Junk *removedJunk = (Junk*)_vm->_dungeonMan->getThingData(removedThing); TimelineEvent newEvent; setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 1); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 91554184bc..ebc946b5dd 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -295,14 +295,14 @@ int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY int16 L0556_i_Direction; if (srcMapX == destMapX) { - _vm->_projexpl->_g363_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 1; /* Resulting direction may be 1 or 3 (East or West) */ + _vm->_projexpl->_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 1; /* Resulting direction may be 1 or 3 (East or West) */ if (srcMapY > destMapY) { return kDirNorth; } return kDirSouth; } if (srcMapY == destMapY) { - _vm->_projexpl->_g363_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 0; /* Resulting direction may be 0 or 2 (North or South) */ + _vm->_projexpl->_secondaryDirToOrFromParty = (_vm->getRandomNumber(65536) & 0x0002) + 0; /* Resulting direction may be 0 or 2 (North or South) */ if (srcMapX > destMapX) { return kDirWest; } @@ -311,15 +311,15 @@ int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY L0556_i_Direction = kDirNorth; for (;;) { if (isDestVisibleFromSource(L0556_i_Direction, srcMapX, srcMapY, destMapX, destMapY)) { - if (!isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { - if ((L0556_i_Direction != kDirNorth) || !isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnPrevVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { - _vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + L0556_i_Direction); + if (!isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { + if ((L0556_i_Direction != kDirNorth) || !isDestVisibleFromSource(_vm->_projexpl->_secondaryDirToOrFromParty = returnPrevVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) { + _vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + L0556_i_Direction); return L0556_i_Direction; } } if (_vm->getRandomNumber(2)) { - AP0483_i_PrimaryDirection = _vm->_projexpl->_g363_secondaryDirToOrFromParty; - _vm->_projexpl->_g363_secondaryDirToOrFromParty = L0556_i_Direction; + AP0483_i_PrimaryDirection = _vm->_projexpl->_secondaryDirToOrFromParty; + _vm->_projexpl->_secondaryDirToOrFromParty = L0556_i_Direction; return AP0483_i_PrimaryDirection; } return L0556_i_Direction; @@ -495,7 +495,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex AL0374_ui_Attack = 255; } } - _vm->_projexpl->f213_explosionCreate(Thing::_explSmoke, AL0374_ui_Attack, mapX, mapY, L0384_ui_Cell); /* BUG0_66 Smoke is placed on the source map instead of the destination map when a creature dies by falling through a pit. The game has a special case to correctly drop the creature possessions on the destination map but there is no such special case for the smoke. Note that the death must be caused by the damage of the fall (there is no smoke if the creature is removed because its type is not allowed on the destination map). However this bug has no visible consequence because of BUG0_26: the smoke explosion falls in the pit right after being placed in the dungeon and before being drawn on screen so it is only visible on the destination square */ + _vm->_projexpl->createExplosion(Thing::_explSmoke, AL0374_ui_Attack, mapX, mapY, L0384_ui_Cell); /* BUG0_66 Smoke is placed on the source map instead of the destination map when a creature dies by falling through a pit. The game has a special case to correctly drop the creature possessions on the destination map but there is no such special case for the smoke. Note that the death must be caused by the damage of the fall (there is no smoke if the creature is removed because its type is not allowed on the destination map). However this bug has no visible consequence because of BUG0_26: the smoke explosion falls in the pit right after being placed in the dungeon and before being drawn on screen so it is only visible on the destination square */ return AL0375_ui_Outcome; } if (damage > 0) { @@ -715,7 +715,7 @@ T0209005_AddEventAndReturn: _groupMovementTestedDirections[0] = 0; _currGroupDistanceToParty = getDistanceBetweenSquares(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); _currGroupPrimaryDirToParty = getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); - _currGroupSecondaryDirToParty = _vm->_projexpl->_g363_secondaryDirToOrFromParty; + _currGroupSecondaryDirToParty = _vm->_projexpl->_secondaryDirToOrFromParty; L0464_l_NextAspectUpdateTime = 0; L0455_B_CurrentEventTypeIsNotUpdateBehavior = true; if (eventType <= k31_TMEventTypeGroupReactionPartyIsAdjecent) { /* Process Reaction events 29 to 31 */ @@ -862,7 +862,7 @@ T0209061_MoveGroup: (L0462_i_TicksSinceLastMove != -1) && L0463_B_Archenemy && ((eventType == kM3_TMEventTypeCreateReactionEvent29DangerOnSquare) || !_vm->getRandomNumber(4))) { /* BUG0_15 The game hangs when you close a door on Lord Chaos. A condition is missing in the code to manage creatures and this may create an infinite loop between two parts in the code */ - _vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal(L0454_i_PrimaryDirectionToOrFromParty = _vm->getRandomNumber(4)); + _vm->_projexpl->_secondaryDirToOrFromParty = returnNextVal(L0454_i_PrimaryDirectionToOrFromParty = _vm->getRandomNumber(4)); goto T0209089_DoubleSquareMove; /* BUG0_69 Memory corruption when you close a door on Lord Chaos. The local variable (L0454_i_PrimaryDirectionToOrFromParty) containing the direction where Lord Chaos tries to move may be used as an array index without being initialized and cause memory corruption */ } if (L0453_B_NewGroupDirectionFound || ((!_vm->getRandomNumber(4) || (L0452_i_DistanceToVisibleParty <= L0448_s_CreatureInfo.getSmellRange())) && (eventType != kM3_TMEventTypeCreateReactionEvent29DangerOnSquare))) { @@ -910,7 +910,7 @@ T0209084_SingleSquareMoveTowardParty: L0454_i_PrimaryDirectionToOrFromParty = getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY); T0209085_SingleSquareMove: if (isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls) || - isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls && _vm->getRandomNumber(2)) || + isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_secondaryDirToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls && _vm->getRandomNumber(2)) || isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction), false) || (!_vm->getRandomNumber(4) && isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty), false))) { AL0450_i_DestinationMapX = eventMapX; @@ -922,7 +922,7 @@ T0209085_SingleSquareMove: T0209089_DoubleSquareMove: getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false); /* BUG0_00 Useless code. Returned value is ignored. When Lord Chaos teleports two squares away the ability to move to the first square is ignored which means Lord Chaos can teleport through walls or any other obstacle */ if (isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty) || - isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty) || + isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_secondaryDirToOrFromParty) || (_fluxCageCount && isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction))) || ((_fluxCageCount >= 2) && isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty)))) { AL0450_i_DestinationMapX = eventMapX; @@ -965,7 +965,7 @@ T0209096_SetBehavior0_Wander: } /* Try and flee from the party (opposite direction) */ L0454_i_PrimaryDirectionToOrFromParty = returnOppositeDir((Direction)getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY)); - _vm->_projexpl->_g363_secondaryDirToOrFromParty = returnOppositeDir((Direction)_vm->_projexpl->_g363_secondaryDirToOrFromParty); + _vm->_projexpl->_secondaryDirToOrFromParty = returnOppositeDir((Direction)_vm->_projexpl->_secondaryDirToOrFromParty); L0461_i_MovementTicks -= (L0461_i_MovementTicks >> 2); goto T0209085_SingleSquareMove; } @@ -1007,7 +1007,7 @@ T0209096_SetBehavior0_Wander: } /* If 1/8 chance and the creature is not adjacent to the party and is a quarter square sized creature then process projectile impacts and update the creature cell if still alive. When the creature is not in front of the party, it has 7/8 chances of dodging a projectile by moving to another cell or staying in the center of the square */ if (!(AL0446_i_GroupCellsCriteria & 0x0038) && (L0452_i_DistanceToVisibleParty != 1) && (L0459_i_CreatureSize == k0_MaskCreatureSizeQuarter)) { - if (_vm->_projexpl->f218_projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* This call to F0218_PROJECTILE_GetImpactCount works fine because there is a single creature in the group so L0445_ps_ActiveGroup->Cells contains only one cell index */ + if (_vm->_projexpl->projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* This call to F0218_PROJECTILE_GetImpactCount works fine because there is a single creature in the group so L0445_ps_ActiveGroup->Cells contains only one cell index */ goto T0209139_Return; L0445_ps_ActiveGroup->_cells = normalizeModulo4(AL0446_i_GroupCellsCriteria); } @@ -1036,9 +1036,9 @@ T0209096_SetBehavior0_Wander: } if (!getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = normalizeModulo4(AL0446_i_Cell)) || (_vm->getRandomNumber(2) && !getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = returnOppositeDir((Direction)AL0446_i_Cell)))) { /* If the selected cell (or the opposite cell) is not already occupied by a creature */ - if (_vm->_projexpl->f218_projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */ + if (_vm->_projexpl->projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */ goto T0209139_Return; - if (_vm->_projexpl->_g364_creatureDamageOutcome != k1_outcomeKilledSomeCreaturesInGroup) { + if (_vm->_projexpl->_creatureDamageOutcome != k1_outcomeKilledSomeCreaturesInGroup) { L0445_ps_ActiveGroup->_cells = getGroupValueUpdatedWithCreatureValue(L0445_ps_ActiveGroup->_cells, AL0447_i_CreatureIndex, AL0446_i_Cell); } } @@ -1399,7 +1399,7 @@ int16 GroupMan::getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int return 0; } if ((((L0426_ui_SmellRange + 1) >> 1) >= _currGroupDistanceToParty) && getDistanceBetweenUnblockedSquares(mapY, mapX, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::isSmellPartyBlocked)) { - _vm->_projexpl->_g363_secondaryDirToOrFromParty = _currGroupSecondaryDirToParty; + _vm->_projexpl->_secondaryDirToOrFromParty = _currGroupSecondaryDirToParty; return _vm->indexToOrdinal(_currGroupPrimaryDirToParty); } if ((L0427_i_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapY, mapX)) && ((_vm->_championMan->_party._scentStrengths[_vm->ordinalToIndex(L0427_i_ScentOrdinal)] + _vm->getRandomNumber(4)) > (30 - (L0426_ui_SmellRange << 1)))) { /* If there is a fresh enough party scent on the group square */ @@ -1471,7 +1471,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 #define AL0440_i_Damage L0440_i_Multiple #define AL0440_i_AttackSoundOrdinal L0440_i_Multiple - _vm->_projexpl->_g361_lastCreatureAttackTime = _vm->_gameTime; + _vm->_projexpl->_lastCreatureAttackTime = _vm->_gameTime; ActiveGroup L0443_s_ActiveGroup = _activeGroups[group->getActiveGroupIndex()]; CreatureInfo *L0441_ps_CreatureInfo = &g243_CreatureInfo[AL0437_ui_CreatureType = group->_type]; uint16 L0438_ui_PrimaryDirectionToParty = _currGroupPrimaryDirToParty; @@ -1527,7 +1527,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy); AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy); _vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately); - _vm->_projexpl->f212_projectileCreate(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8); + _vm->_projexpl->createProjectile(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8); } else { if (getFlag(L0441_ps_CreatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) { AL0439_i_ChampionIndex = _vm->getRandomNumber(4); @@ -1905,7 +1905,7 @@ int16 GroupMan::getMeleeActionDamage(Champion* champ, int16 champIndex, Group* g } L0567_i_DoubledMapDifficulty = _vm->_dungeonMan->_currMap->_difficulty << 1; L0572_ps_CreatureInfo = &g243_CreatureInfo[group->_type]; - L0571_i_ActionHandObjectIconIndex = _vm->_objectMan->f33_getIconIndex(champ->_slots[k1_ChampionSlotActionHand]); + L0571_i_ActionHandObjectIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k1_ChampionSlotActionHand]); L0570_B_ActionHitsNonMaterialCreatures = getFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures); if (L0570_B_ActionHitsNonMaterialCreatures) clearFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures); @@ -2072,7 +2072,7 @@ void GroupMan::fuseAction(uint16 mapX, uint16 mapY) { return; } - _vm->_projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, 255, mapX, mapY, k255_CreatureTypeSingleCenteredCreature); /* BUG0_17 The game crashes after the Fuse action is performed while looking at a wall on a map boundary. An explosion thing is created on the square in front of the party but there is no check to ensure the square coordinates are in the map bounds. This corrupts a memory location and leads to a game crash */ + _vm->_projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, mapX, mapY, k255_CreatureTypeSingleCenteredCreature); /* BUG0_17 The game crashes after the Fuse action is performed while looking at a wall on a map boundary. An explosion thing is created on the square in front of the party but there is no check to ensure the square coordinates are in the map bounds. This corrupts a memory location and leads to a game crash */ L0555_T_LordChaosThing = Thing(isLordChaosOnSquare(mapX, mapY)); if (L0555_T_LordChaosThing.toUint16()) { L0551_ui_FluxcageCount = (L0554_aB_Fluxcages[0] = isFluxcageOnSquare(mapX - 1, mapY)) + diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 0cbc0953e8..c7f95c6f51 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -372,7 +372,7 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is _openChest = thingToOpen; if (!isPressingEye) { - objMan.f38_drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); + objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); } dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k25_PanelOpenChestIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73); @@ -383,12 +383,12 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is if (++thingCount > 8) 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)); + objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing)); _chestSlots[chestSlotIndex++] = thing; thing = _vm->_dungeonMan->getNextThing(thing); } while (chestSlotIndex < 8) { - objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); + objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); _chestSlots[chestSlotIndex++] = Thing::_none; } } @@ -398,7 +398,7 @@ void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yP Box box; box._x2 = (box._x1 = xPos) + 15; box._y2 = (box._y1 = yPos) + 15; - _vm->_objectMan->f36_extractIconFromBitmap(iconIndex, iconBitmap); + _vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap); _vm->_displayMan->blitToViewport(iconBitmap, box, k8_byteWidth, kM1_ColorNoTransparency, 16); } @@ -510,7 +510,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { } else if (thingType == k9_ContainerThingType) { openAndDrawChest(thingToDraw, (Container *)rawThingPtr, pressingEye); } else { - IconIndice iconIndex = objMan.f33_getIconIndex(thingToDraw); + IconIndice iconIndex = objMan.getIconIndex(thingToDraw); dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73); dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k29_ObjectDescCircleIndice), @@ -525,10 +525,10 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { case Common::DE_DEU: // german and english versions are the same strcpy(str, champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name); strcat(str, " "); - strcat(str, objMan._g352_objectNames[iconIndex]); + strcat(str, objMan._objectNames[iconIndex]); break; case Common::FR_FRA: - strcat(str, objMan._g352_objectNames[iconIndex]); + strcat(str, objMan._objectNames[iconIndex]); strcat(str, " "); strcpy(str, champMan._champions[((Junk *)rawThingPtr)->getChargeCount()]._name); break; @@ -541,10 +541,10 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { str[0] = '_' + ((Potion *)rawThingPtr)->getPower() / 40; str[1] = ' '; str[2] = '\0'; - strcat(str, objMan._g352_objectNames[iconIndex]); + strcat(str, objMan._objectNames[iconIndex]); descString = str; } else { - descString = objMan._g352_objectNames[iconIndex]; + descString = objMan._objectNames[iconIndex]; } textMan.f52_printToViewport(134, 68, k13_ColorLightestGray, descString); @@ -711,8 +711,8 @@ void InventoryMan::setDungeonViewPalette() { uint16 AL1039_ui_SlotIndex = k1_ChampionSlotActionHand + 1; while (AL1039_ui_SlotIndex--) { uint16 AL1044_T_Thing = L1043_ps_Champion->_slots[AL1039_ui_SlotIndex].toUint16(); - if ((_vm->_objectMan->f32_getObjectType(Thing(AL1044_T_Thing)) >= k4_IconIndiceWeaponTorchUnlit) && - (_vm->_objectMan->f32_getObjectType(Thing(AL1044_T_Thing)) <= k7_IconIndiceWeaponTorchLit)) { + if ((_vm->_objectMan->getObjectType(Thing(AL1044_T_Thing)) >= k4_IconIndiceWeaponTorchUnlit) && + (_vm->_objectMan->getObjectType(Thing(AL1044_T_Thing)) <= k7_IconIndiceWeaponTorchLit)) { Weapon *L1042_ps_Weapon = (Weapon*)_vm->_dungeonMan->getThingData(Thing(AL1044_T_Thing)); *AL1040_pi_TorchLightPower = L1042_ps_Weapon->getChargeCount(); } else { @@ -779,7 +779,7 @@ void InventoryMan::decreaseTorchesLightPower() { while (L1046_i_ChampionCount--) { int16 L1047_i_SlotIndex = k1_ChampionSlotActionHand + 1; while (L1047_i_SlotIndex--) { - int16 L1049_i_IconIndex = _vm->_objectMan->f33_getIconIndex(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); + int16 L1049_i_IconIndex = _vm->_objectMan->getIconIndex(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); if ((L1049_i_IconIndex >= k4_IconIndiceWeaponTorchUnlit) && (L1049_i_IconIndex <= k7_IconIndiceWeaponTorchLit)) { Weapon *L1051_ps_Weapon = (Weapon *)_vm->_dungeonMan->getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); if (L1051_ps_Weapon->getChargeCount()) { @@ -888,7 +888,7 @@ void InventoryMan::drawStopPressingEye() { drawPanel(); _vm->_displayMan->drawViewport(k0_viewportNotDungeonView); if ((L1100_T_LeaderHandObject = _vm->_championMan->_leaderHandObject) != Thing::_none) { - _vm->_objectMan->f34_drawLeaderObjectName(L1100_T_LeaderHandObject); + _vm->_objectMan->drawLeaderObjectName(L1100_T_LeaderHandObject); } _vm->_eventMan->showMouse(); _vm->_eventMan->showMouse(); @@ -950,7 +950,7 @@ void InventoryMan::clickOnMouth() { if (!getFlag(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(L1078_T_Thing = _vm->_championMan->_leaderHandObject)]._allowedSlots, k0x0001_ObjectAllowedSlotMouth)) { return; } - L1079_ui_IconIndex = _vm->_objectMan->f33_getIconIndex(L1078_T_Thing); + L1079_ui_IconIndex = _vm->_objectMan->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(_inventoryChampionOrdinal)]; @@ -1051,7 +1051,7 @@ void InventoryMan::clickOnMouth() { if (L1081_B_RemoveObjectFromLeaderHand) { for (L1086_ui_Counter = 5; --L1086_ui_Counter; _vm->delay(8)) { /* Animate mouth icon */ - _vm->_objectMan->f37_drawIconToScreen(k205_IconIndiceMouthOpen + !(L1086_ui_Counter & 0x0001), 56, 46); + _vm->_objectMan->drawIconToScreen(k205_IconIndiceMouthOpen + !(L1086_ui_Counter & 0x0001), 56, 46); _vm->_eventMan->discardAllInput(); if (_vm->_engineShouldQuit) return; @@ -1109,7 +1109,7 @@ void InventoryMan::clickOnEye() { if (_vm->_championMan->_leaderEmptyHanded) { drawChampionSkillsAndStatistics(); } else { - _vm->_objectMan->f35_clearLeaderObjectName(); + _vm->_objectMan->clearLeaderObjectName(); drawPanelObject(_vm->_championMan->_leaderHandObject, true); } _vm->_displayMan->drawViewport(k0_viewportNotDungeonView); diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index d30eb624de..1108fd8211 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -103,8 +103,8 @@ LoadgameResponse DMEngine::loadgame(int16 slot) { _timeline->_g373_firstUnusedEventIndex = file->readUint16BE(); _timeline->_g369_eventMaxCount = file->readUint16BE(); _groupMan->_currActiveGroupCount = file->readUint16BE(); - _projexpl->_g361_lastCreatureAttackTime = file->readSint32BE(); - _projexpl->_g362_lastPartyMovementTime = file->readSint32BE(); + _projexpl->_lastCreatureAttackTime = file->readSint32BE(); + _projexpl->_lastPartyMovementTime = file->readSint32BE(); _disabledMovementTicks = file->readSint16BE(); _projectileDisableMovementTicks = file->readSint16BE(); _lastProjectileDisabledMovementDirection = file->readSint16BE(); @@ -319,8 +319,8 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip file->writeUint16BE(_timeline->_g373_firstUnusedEventIndex); file->writeUint16BE(_timeline->_g369_eventMaxCount); file->writeUint16BE(_groupMan->_currActiveGroupCount); - file->writeSint32BE(_projexpl->_g361_lastCreatureAttackTime); - file->writeSint32BE(_projexpl->_g362_lastPartyMovementTime); + file->writeSint32BE(_projexpl->_lastCreatureAttackTime); + file->writeSint32BE(_projexpl->_lastPartyMovementTime); file->writeSint16BE(_disabledMovementTicks); file->writeSint16BE(_projectileDisableMovementTicks); file->writeSint16BE(_lastProjectileDisabledMovementDirection); diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 8750d30024..79955b8f2a 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -158,12 +158,12 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { if (thing == Thing::_none) { iconIndex = k201_IconIndiceActionEmptyHand; } else if (_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) { - iconIndex = _vm->_objectMan->f33_getIconIndex(thing); + iconIndex = _vm->_objectMan->getIconIndex(thing); } else { dm.fillBitmap(bitmapIcon, k4_ColorCyan, 16, 16); goto T0386006; } - _vm->_objectMan->f36_extractIconFromBitmap(iconIndex, bitmapIcon); + _vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon); dm.blitToBitmapShrinkWithPalChange(bitmapIcon, bitmapIcon, 16, 16, 16, 16, palChangesActionAreaObjectIcon); T0386006: dm.fillScreenBox(box, k4_ColorCyan); @@ -739,7 +739,7 @@ Potion* MenuMan::getEmptyFlaskInHand(Champion* champ, Thing* potionThing) { int16 L1266_i_SlotIndex; for (L1266_i_SlotIndex = k2_ChampionSlotHead; --L1266_i_SlotIndex >= k0_ChampionSlotReadyHand; ) { - if (((L1265_T_Thing = champ->_slots[L1266_i_SlotIndex]) != Thing::_none) && (_vm->_objectMan->f33_getIconIndex(L1265_T_Thing) == k195_IconIndicePotionEmptyFlask)) { + if (((L1265_T_Thing = champ->_slots[L1266_i_SlotIndex]) != Thing::_none) && (_vm->_objectMan->getIconIndex(L1265_T_Thing) == k195_IconIndicePotionEmptyFlask)) { *potionThing = L1265_T_Thing; return (Potion*)_vm->_dungeonMan->getThingData(L1265_T_Thing); } @@ -1490,7 +1490,7 @@ T0402005: /* Check if there is another champion in front */ 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)) { + if ((_vm->_objectMan->getIconIndex(champ->_slots[k1_ChampionSlotActionHand]) == k40_IconIndiceWeaponVorpalBlade) || (actionIndex == k24_ChampionActionDisrupt)) { setFlag(AL1237_ui_ActionHitProbability, k0x8000_hitNonMaterialCreatures); } _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); diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index fce6df36cf..694d1350f6 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -116,7 +116,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 goto T0275058_ProceedToNextThing; case k3_SensorWallOrnClickWithSpecObj: case k4_SensorWallOrnClickWithSpecObjRemoved: - L0753_B_DoNotTriggerSensor = ((L0758_i_SensorData == _vm->_objectMan->f32_getObjectType(L0761_T_LeaderHandObject)) == L0755_ps_Sensor->getAttrRevertEffectA()); + L0753_B_DoNotTriggerSensor = ((L0758_i_SensorData == _vm->_objectMan->getObjectType(L0761_T_LeaderHandObject)) == L0755_ps_Sensor->getAttrRevertEffectA()); if (!L0753_B_DoNotTriggerSensor && (L0757_ui_SensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor)) { if (L0763_T_LastProcessedThing == L0750_T_ThingBeingProcessed) /* If the sensor is the only one of its type on the cell */ break; @@ -144,7 +144,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 _vm->_dungeonMan->unlinkThingFromList(L0761_T_LeaderHandObject, Thing(0), mapX, mapY); _vm->_championMan->putObjectInLeaderHand(L0761_T_LeaderHandObject, true); } else { - if ((_vm->_objectMan->f32_getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (getObjectOfTypeInCell(mapX, mapY, L0752_ui_Cell, L0758_i_SensorData) != Thing::_none)) + if ((_vm->_objectMan->getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (getObjectOfTypeInCell(mapX, mapY, L0752_ui_Cell, L0758_i_SensorData) != Thing::_none)) goto T0275058_ProceedToNextThing; _vm->_championMan->getObjectRemovedFromLeaderHand(); _vm->_dungeonMan->linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY); @@ -161,7 +161,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 if (L0760_ai_SensorCountToProcessPerCell[L0752_ui_Cell]) /* If the sensor is not the last one of its type on the cell */ goto T0275058_ProceedToNextThing; L0762_T_ThingOnSquare = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY); - if ((_vm->_objectMan->f32_getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (L0762_T_ThingOnSquare == Thing::_none)) + if ((_vm->_objectMan->getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (L0762_T_ThingOnSquare == Thing::_none)) goto T0275058_ProceedToNextThing; _vm->_dungeonMan->unlinkThingFromList(L0762_T_ThingOnSquare, Thing(0), mapX, mapY); _vm->_championMan->getObjectRemovedFromLeaderHand(); @@ -421,9 +421,9 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM AL0708_i_ScentIndex--; } if (AL0708_i_ScentIndex) { - _vm->_championMan->addScentStrength(mapX, mapY, (int)(_vm->_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime)); + _vm->_championMan->addScentStrength(mapX, mapY, (int)(_vm->_gameTime - _vm->_projexpl->_lastPartyMovementTime)); } - _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime; + _vm->_projexpl->_lastPartyMovementTime = _vm->_gameTime; _vm->_championMan->_party._scentCount++; if (_vm->_championMan->_party._event79Count_Footprints) { _vm->_championMan->_party._lastScentIndex = _vm->_championMan->_party._scentCount; @@ -612,9 +612,9 @@ T0266017_CheckProjectileImpacts: while (L0697_T_Thing != Thing::_endOfList) { if (((L0697_T_Thing).getType() == k14_ProjectileThingType) && (_vm->_timeline->_g370_events[(((Projectile *)_vm->_dungeonMan->_thingData[k14_ProjectileThingType])[(L0697_T_Thing).getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts) && (AL0699_ui_ChampionOrCreatureOrdinal = L0707_auc_ChampionOrCreatureOrdinalInCell[(L0697_T_Thing).getCell()]) && - _vm->_projexpl->f217_projectileHasImpactOccurred(L0702_i_ImpactType, srcMapX, srcMapY, _vm->ordinalToIndex(AL0699_ui_ChampionOrCreatureOrdinal), L0697_T_Thing)) { - _vm->_projexpl->f214_projectileDeleteEvent(L0697_T_Thing); - if (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup) { + _vm->_projexpl->hasProjectileImpactOccurred(L0702_i_ImpactType, srcMapX, srcMapY, _vm->ordinalToIndex(AL0699_ui_ChampionOrCreatureOrdinal), L0697_T_Thing)) { + _vm->_projexpl->projectileDeleteEvent(L0697_T_Thing); + if (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup) { return true; } goto T0266017_CheckProjectileImpacts; @@ -775,7 +775,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing if (thing != Thing::_party) { L0767_i_ThingType = thing.getType(); - L0774_i_ObjectType = _vm->_objectMan->f32_getObjectType(thing); + L0774_i_ObjectType = _vm->_objectMan->getObjectType(thing); } else { L0767_i_ThingType = kM1_PartyThingType; L0774_i_ObjectType = kM1_IconIndiceNone; @@ -803,8 +803,8 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing } else { if ((L0771_ui_ThingType > k4_GroupThingType) && (L0771_ui_ThingType < k14_ProjectileThingType)) { L0772_B_SquareContainsObject = true; - L0775_B_SquareContainsThingOfSameType |= (_vm->_objectMan->f32_getObjectType(L0766_T_Thing) == L0774_i_ObjectType); - L0776_B_SquareContainsThingOfDifferentType |= (_vm->_objectMan->f32_getObjectType(L0766_T_Thing) != L0774_i_ObjectType); + L0775_B_SquareContainsThingOfSameType |= (_vm->_objectMan->getObjectType(L0766_T_Thing) == L0774_i_ObjectType); + L0776_B_SquareContainsThingOfDifferentType |= (_vm->_objectMan->getObjectType(L0766_T_Thing) != L0774_i_ObjectType); } } } @@ -814,8 +814,8 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing while (L0766_T_Thing != Thing::_endOfList) { if ((L0770_ui_SensorTriggeredCell == (L0766_T_Thing).getCell()) && ((L0766_T_Thing).getType() > k4_GroupThingType)) { L0772_B_SquareContainsObject = true; - L0775_B_SquareContainsThingOfSameType |= (_vm->_objectMan->f32_getObjectType(L0766_T_Thing) == L0774_i_ObjectType); - L0776_B_SquareContainsThingOfDifferentType |= (_vm->_objectMan->f32_getObjectType(L0766_T_Thing) != L0774_i_ObjectType); + L0775_B_SquareContainsThingOfSameType |= (_vm->_objectMan->getObjectType(L0766_T_Thing) == L0774_i_ObjectType); + L0776_B_SquareContainsThingOfDifferentType |= (_vm->_objectMan->getObjectType(L0766_T_Thing) != L0774_i_ObjectType); } L0766_T_Thing = _vm->_dungeonMan->getNextThing(L0766_T_Thing); } @@ -857,7 +857,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing } break; case k4_SensorFloorObj: - if ((L0779_i_SensorData != _vm->_objectMan->f32_getObjectType(thing)) || L0775_B_SquareContainsThingOfSameType) + if ((L0779_i_SensorData != _vm->_objectMan->getObjectType(thing)) || L0775_B_SquareContainsThingOfSameType) goto T0276079; break; case k5_SensorFloorPartyOnStairs: @@ -893,11 +893,11 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing goto T0276079; break; case k2_SensorWallOrnClickWithAnyObj: - if (L0775_B_SquareContainsThingOfSameType || (L0769_ps_Sensor->getData() != _vm->_objectMan->f32_getObjectType(thing))) + if (L0775_B_SquareContainsThingOfSameType || (L0769_ps_Sensor->getData() != _vm->_objectMan->getObjectType(thing))) goto T0276079; break; case k3_SensorWallOrnClickWithSpecObj: - if (L0776_B_SquareContainsThingOfDifferentType || (L0769_ps_Sensor->getData() == _vm->_objectMan->f32_getObjectType(thing))) + if (L0776_B_SquareContainsThingOfDifferentType || (L0769_ps_Sensor->getData() == _vm->_objectMan->getObjectType(thing))) goto T0276079; break; default: @@ -943,7 +943,7 @@ bool MovesensMan::isObjcetInPartyPossession(int16 objectType) { for (L0743_ui_SlotIndex = k0_ChampionSlotReadyHand; (L0743_ui_SlotIndex < k30_ChampionSlotChest_1) && !L0748_B_LeaderHandObjectProcessed; L0743_ui_SlotIndex++) { L0744_T_Thing = *L0746_pT_Thing++; T0274003: - L0747_i_ObjectType = _vm->_objectMan->f32_getObjectType(L0744_T_Thing); + L0747_i_ObjectType = _vm->_objectMan->getObjectType(L0744_T_Thing); if (L0747_i_ObjectType == objectType) { return true; } @@ -951,7 +951,7 @@ T0274003: L0749_ps_Container = (Container *)_vm->_dungeonMan->getThingData(L0744_T_Thing); L0744_T_Thing = L0749_ps_Container->getSlot(); while (L0744_T_Thing != Thing::_endOfList) { - if (_vm->_objectMan->f32_getObjectType(L0744_T_Thing) == objectType) { + if (_vm->_objectMan->getObjectType(L0744_T_Thing) == objectType) { return true; } L0744_T_Thing = _vm->_dungeonMan->getNextThing(L0744_T_Thing); @@ -1089,7 +1089,7 @@ Thing MovesensMan::getObjectOfTypeInCell(int16 mapX, int16 mapY, int16 cell, int L0741_T_Thing = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY); while (L0741_T_Thing != Thing::_endOfList) { - if (_vm->_objectMan->f32_getObjectType(L0741_T_Thing) == objectType) { + if (_vm->_objectMan->getObjectType(L0741_T_Thing) == objectType) { if ((cell == kM1_CellAny) || ((L0741_T_Thing.getCell()) == cell)) { return L0741_T_Thing; } diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index 56b99fe15d..8bf12859af 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -44,62 +44,62 @@ int16 g26_IconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIc ObjectMan::ObjectMan(DMEngine *vm) : _vm(vm) { /* 8 for champion hands in status boxes, 30 for champion inventory, 8 for chest */ - _g30_slotBoxes[0] = SlotBox(4, 10, 0); /* Champion Status Box 0 Ready Hand */ - _g30_slotBoxes[1] = SlotBox(24, 10, 0); /* Champion Status Box 0 Action Hand */ - _g30_slotBoxes[2] = SlotBox(73, 10, 0); /* Champion Status Box 1 Ready Hand */ - _g30_slotBoxes[3] = SlotBox(93, 10, 0); /* Champion Status Box 1 Action Hand */ - _g30_slotBoxes[4] = SlotBox(142, 10, 0); /* Champion Status Box 2 Ready Hand */ - _g30_slotBoxes[5] = SlotBox(162, 10, 0); /* Champion Status Box 2 Action Hand */ - _g30_slotBoxes[6] = SlotBox(211, 10, 0); /* Champion Status Box 3 Ready Hand */ - _g30_slotBoxes[7] = SlotBox(231, 10, 0); /* Champion Status Box 3 Action Hand */ - _g30_slotBoxes[8] = SlotBox(6, 53, 0); /* Ready Hand */ - _g30_slotBoxes[9] = SlotBox(62, 53, 0); /* Action Hand */ - _g30_slotBoxes[10] = SlotBox(34, 26, 0); /* Head */ - _g30_slotBoxes[11] = SlotBox(34, 46, 0); /* Torso */ - _g30_slotBoxes[12] = SlotBox(34, 66, 0); /* Legs */ - _g30_slotBoxes[13] = SlotBox(34, 86, 0); /* Feet */ - _g30_slotBoxes[14] = SlotBox(6, 90, 0); /* Pouch 2 */ - _g30_slotBoxes[15] = SlotBox(79, 73, 0); /* Quiver Line2 1 */ - _g30_slotBoxes[16] = SlotBox(62, 90, 0); /* Quiver Line1 2 */ - _g30_slotBoxes[17] = SlotBox(79, 90, 0); /* Quiver Line2 2 */ - _g30_slotBoxes[18] = SlotBox(6, 33, 0); /* Neck */ - _g30_slotBoxes[19] = SlotBox(6, 73, 0); /* Pouch 1 */ - _g30_slotBoxes[20] = SlotBox(62, 73, 0); /* Quiver Line1 1 */ - _g30_slotBoxes[21] = SlotBox(66, 33, 0); /* Backpack Line1 1 */ - _g30_slotBoxes[22] = SlotBox(83, 16, 0); /* Backpack Line2 2 */ - _g30_slotBoxes[23] = SlotBox(100, 16, 0); /* Backpack Line2 3 */ - _g30_slotBoxes[24] = SlotBox(117, 16, 0); /* Backpack Line2 4 */ - _g30_slotBoxes[25] = SlotBox(134, 16, 0); /* Backpack Line2 5 */ - _g30_slotBoxes[26] = SlotBox(151, 16, 0); /* Backpack Line2 6 */ - _g30_slotBoxes[27] = SlotBox(168, 16, 0); /* Backpack Line2 7 */ - _g30_slotBoxes[28] = SlotBox(185, 16, 0); /* Backpack Line2 8 */ - _g30_slotBoxes[29] = SlotBox(202, 16, 0); /* Backpack Line2 9 */ - _g30_slotBoxes[30] = SlotBox(83, 33, 0); /* Backpack Line1 2 */ - _g30_slotBoxes[31] = SlotBox(100, 33, 0); /* Backpack Line1 3 */ - _g30_slotBoxes[32] = SlotBox(117, 33, 0); /* Backpack Line1 4 */ - _g30_slotBoxes[33] = SlotBox(134, 33, 0); /* Backpack Line1 5 */ - _g30_slotBoxes[34] = SlotBox(151, 33, 0); /* Backpack Line1 6 */ - _g30_slotBoxes[35] = SlotBox(168, 33, 0); /* Backpack Line1 7 */ - _g30_slotBoxes[36] = SlotBox(185, 33, 0); /* Backpack Line1 8 */ - _g30_slotBoxes[37] = SlotBox(202, 33, 0); /* Backpack Line1 9 */ - _g30_slotBoxes[38] = SlotBox(117, 59, 0); /* Chest 1 */ - _g30_slotBoxes[39] = SlotBox(106, 76, 0); /* Chest 2 */ - _g30_slotBoxes[40] = SlotBox(111, 93, 0); /* Chest 3 */ - _g30_slotBoxes[41] = SlotBox(128, 98, 0); /* Chest 4 */ - _g30_slotBoxes[42] = SlotBox(145, 101, 0); /* Chest 5 */ - _g30_slotBoxes[43] = SlotBox(162, 103, 0); /* Chest 6 */ - _g30_slotBoxes[44] = SlotBox(179, 104, 0); /* Chest 7 */ - _g30_slotBoxes[45] = SlotBox(196, 105, 0); /* Chest 8 */ + _slotBoxes[0] = SlotBox(4, 10, 0); /* Champion Status Box 0 Ready Hand */ + _slotBoxes[1] = SlotBox(24, 10, 0); /* Champion Status Box 0 Action Hand */ + _slotBoxes[2] = SlotBox(73, 10, 0); /* Champion Status Box 1 Ready Hand */ + _slotBoxes[3] = SlotBox(93, 10, 0); /* Champion Status Box 1 Action Hand */ + _slotBoxes[4] = SlotBox(142, 10, 0); /* Champion Status Box 2 Ready Hand */ + _slotBoxes[5] = SlotBox(162, 10, 0); /* Champion Status Box 2 Action Hand */ + _slotBoxes[6] = SlotBox(211, 10, 0); /* Champion Status Box 3 Ready Hand */ + _slotBoxes[7] = SlotBox(231, 10, 0); /* Champion Status Box 3 Action Hand */ + _slotBoxes[8] = SlotBox(6, 53, 0); /* Ready Hand */ + _slotBoxes[9] = SlotBox(62, 53, 0); /* Action Hand */ + _slotBoxes[10] = SlotBox(34, 26, 0); /* Head */ + _slotBoxes[11] = SlotBox(34, 46, 0); /* Torso */ + _slotBoxes[12] = SlotBox(34, 66, 0); /* Legs */ + _slotBoxes[13] = SlotBox(34, 86, 0); /* Feet */ + _slotBoxes[14] = SlotBox(6, 90, 0); /* Pouch 2 */ + _slotBoxes[15] = SlotBox(79, 73, 0); /* Quiver Line2 1 */ + _slotBoxes[16] = SlotBox(62, 90, 0); /* Quiver Line1 2 */ + _slotBoxes[17] = SlotBox(79, 90, 0); /* Quiver Line2 2 */ + _slotBoxes[18] = SlotBox(6, 33, 0); /* Neck */ + _slotBoxes[19] = SlotBox(6, 73, 0); /* Pouch 1 */ + _slotBoxes[20] = SlotBox(62, 73, 0); /* Quiver Line1 1 */ + _slotBoxes[21] = SlotBox(66, 33, 0); /* Backpack Line1 1 */ + _slotBoxes[22] = SlotBox(83, 16, 0); /* Backpack Line2 2 */ + _slotBoxes[23] = SlotBox(100, 16, 0); /* Backpack Line2 3 */ + _slotBoxes[24] = SlotBox(117, 16, 0); /* Backpack Line2 4 */ + _slotBoxes[25] = SlotBox(134, 16, 0); /* Backpack Line2 5 */ + _slotBoxes[26] = SlotBox(151, 16, 0); /* Backpack Line2 6 */ + _slotBoxes[27] = SlotBox(168, 16, 0); /* Backpack Line2 7 */ + _slotBoxes[28] = SlotBox(185, 16, 0); /* Backpack Line2 8 */ + _slotBoxes[29] = SlotBox(202, 16, 0); /* Backpack Line2 9 */ + _slotBoxes[30] = SlotBox(83, 33, 0); /* Backpack Line1 2 */ + _slotBoxes[31] = SlotBox(100, 33, 0); /* Backpack Line1 3 */ + _slotBoxes[32] = SlotBox(117, 33, 0); /* Backpack Line1 4 */ + _slotBoxes[33] = SlotBox(134, 33, 0); /* Backpack Line1 5 */ + _slotBoxes[34] = SlotBox(151, 33, 0); /* Backpack Line1 6 */ + _slotBoxes[35] = SlotBox(168, 33, 0); /* Backpack Line1 7 */ + _slotBoxes[36] = SlotBox(185, 33, 0); /* Backpack Line1 8 */ + _slotBoxes[37] = SlotBox(202, 33, 0); /* Backpack Line1 9 */ + _slotBoxes[38] = SlotBox(117, 59, 0); /* Chest 1 */ + _slotBoxes[39] = SlotBox(106, 76, 0); /* Chest 2 */ + _slotBoxes[40] = SlotBox(111, 93, 0); /* Chest 3 */ + _slotBoxes[41] = SlotBox(128, 98, 0); /* Chest 4 */ + _slotBoxes[42] = SlotBox(145, 101, 0); /* Chest 5 */ + _slotBoxes[43] = SlotBox(162, 103, 0); /* Chest 6 */ + _slotBoxes[44] = SlotBox(179, 104, 0); /* Chest 7 */ + _slotBoxes[45] = SlotBox(196, 105, 0); /* Chest 8 */ for (uint16 i = 0; i < k199_ObjectNameCount; ++i) - _g352_objectNames[i] = nullptr; + _objectNames[i] = nullptr; - _g412_objectIconForMousePointer = nullptr; + _objectIconForMousePointer = nullptr; } ObjectMan::~ObjectMan() { - delete[] _g412_objectIconForMousePointer; - delete[] _g352_objectNames[0]; + delete[] _objectIconForMousePointer; + delete[] _objectNames[0]; } #define k556_ObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES @@ -107,13 +107,13 @@ ObjectMan::~ObjectMan() { void ObjectMan::loadObjectNames() { DisplayMan &dispMan = *_vm->_displayMan; - _g412_objectIconForMousePointer = new byte[16 * 16]; + _objectIconForMousePointer = new byte[16 * 16]; char *objectNames = new char[dispMan.getCompressedDataSize(k556_ObjectNamesGraphicIndice) + k199_ObjectNameCount]; Common::MemoryReadStream stream = dispMan.getCompressedData(k556_ObjectNamesGraphicIndice); for (uint16 objNameIndex = 0; objNameIndex < k199_ObjectNameCount; ++objNameIndex) { - _g352_objectNames[objNameIndex] = objectNames; + _objectNames[objNameIndex] = objectNames; byte tmpByte; for (tmpByte = stream.readByte(); !(tmpByte & 0x80); tmpByte = stream.readByte()) // last char of object name has 7th bit on @@ -124,7 +124,7 @@ void ObjectMan::loadObjectNames() { } } -IconIndice ObjectMan::f32_getObjectType(Thing thing) { +IconIndice ObjectMan::getObjectType(Thing thing) { if (thing == Thing::_none) return kM1_IconIndiceNone; @@ -137,8 +137,8 @@ IconIndice ObjectMan::f32_getObjectType(Thing thing) { byte g29_ChargeCountToTorchType[16] = {0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3}; // @ G0029_auc_Graphic562_ChargeCountToTorchType -IconIndice ObjectMan::f33_getIconIndex(Thing thing) { - int16 L0005_i_IconIndex = f32_getObjectType(thing); +IconIndice ObjectMan::getIconIndex(Thing thing) { + int16 L0005_i_IconIndex = getObjectType(thing); if (L0005_i_IconIndex != kM1_IconIndiceNone) { if (((L0005_i_IconIndex < k32_IconIndiceWeaponDagger) && (L0005_i_IconIndex >= k0_IconIndiceJunkCompassNorth)) || ((L0005_i_IconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (L0005_i_IconIndex <= k163_IconIndicePotionWaterFlask)) || @@ -180,7 +180,7 @@ IconIndice ObjectMan::f33_getIconIndex(Thing thing) { return (IconIndice)L0005_i_IconIndex; } -void ObjectMan::f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { +void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { uint16 L0011_ui_Counter; byte* L0012_pl_Bitmap_Icon; Box L1568_s_Box; @@ -199,7 +199,7 @@ void ObjectMan::f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { _vm->_displayMan->blitToBitmap(L0012_pl_Bitmap_Icon, destBitmap, L1568_s_Box, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, 128, 8, kM1_ColorNoTransparency, gK77_IconGraphicHeight[L0011_ui_Counter], 16); } -void ObjectMan::f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { +void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { uint16 L0015_ui_IconGraphicIndex; int16 L0016_i_ByteWidth; SlotBox* L0017_ps_SlotBox; @@ -208,7 +208,7 @@ void ObjectMan::f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { byte* L0020_puc_Bitmap_Destination; int16 L1569_i_Width; - L0017_ps_SlotBox = &_g30_slotBoxes[slotBoxIndex]; + L0017_ps_SlotBox = &_slotBoxes[slotBoxIndex]; if ((L0017_ps_SlotBox->_iconIndex = iconIndex) == kM1_IconIndiceNone) { return; } @@ -235,9 +235,9 @@ void ObjectMan::f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { #define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH -void ObjectMan::f34_drawLeaderObjectName(Thing thing) { +void ObjectMan::drawLeaderObjectName(Thing thing) { char* objectName = nullptr; - int16 L0007_i_IconIndex = f33_getIconIndex(thing); + int16 L0007_i_IconIndex = getIconIndex(thing); if (L0007_i_IconIndex == k147_IconIndiceJunkChampionBones) { Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing); char champBonesName[16]; @@ -247,37 +247,37 @@ void ObjectMan::f34_drawLeaderObjectName(Thing thing) { case Common::EN_ANY: case Common::DE_DEU: // english and german version are the same strcpy(champBonesName, _vm->_championMan->_champions[junk->getChargeCount()]._name); - strcat(champBonesName, _g352_objectNames[L0007_i_IconIndex]); + strcat(champBonesName, _objectNames[L0007_i_IconIndex]); break; case Common::FR_FRA: - strcat(champBonesName, _g352_objectNames[L0007_i_IconIndex]); + strcat(champBonesName, _objectNames[L0007_i_IconIndex]); strcpy(champBonesName, _vm->_championMan->_champions[junk->getChargeCount()]._name); break; } objectName = champBonesName; } else { - objectName = _g352_objectNames[L0007_i_IconIndex]; + objectName = _objectNames[L0007_i_IconIndex]; } _vm->_textMan->f41_printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName, k14_ObjectNameMaximumLength, k200_heightScreen); } -IconIndice ObjectMan::f39_getIconIndexInSlotBox(uint16 slotBoxIndex) { - return (IconIndice)_g30_slotBoxes[slotBoxIndex]._iconIndex; +IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) { + return (IconIndice)_slotBoxes[slotBoxIndex]._iconIndex; } -void ObjectMan::f35_clearLeaderObjectName() { +void ObjectMan::clearLeaderObjectName() { static Box g28_BoxLeaderHandObjectName(233, 319, 33, 38); // @ G0028_s_Graphic562_Box_LeaderHandObjectName _vm->_displayMan->fillScreenBox(g28_BoxLeaderHandObjectName, k0_ColorBlack); } -void ObjectMan::f37_drawIconToScreen(int16 iconIndex, int16 posX, int16 posY) { +void ObjectMan::drawIconToScreen(int16 iconIndex, int16 posX, int16 posY) { static byte L0013_puc_Bitmap_Icon[16 * 16]; Box L0014_s_Box; L0014_s_Box._x2 = (L0014_s_Box._x1 = posX) + 15; L0014_s_Box._y2 = (L0014_s_Box._y1 = posY) + 15; - f36_extractIconFromBitmap(iconIndex, L0013_puc_Bitmap_Icon); + extractIconFromBitmap(iconIndex, L0013_puc_Bitmap_Icon); _vm->_displayMan->blitToScreen(L0013_puc_Bitmap_Icon, &L0014_s_Box, k8_byteWidth, kM1_ColorNoTransparency, 16); } } diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h index 1aa4c54637..4478babfa1 100644 --- a/engines/dm/objectman.h +++ b/engines/dm/objectman.h @@ -54,18 +54,18 @@ public: ~ObjectMan(); void loadObjectNames(); // @ F0031_OBJECT_LoadNames - SlotBox _g30_slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes; - char *_g352_objectNames[k199_ObjectNameCount]; // @ G0352_apc_ObjectNames - byte *_g412_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer + SlotBox _slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes; + char *_objectNames[k199_ObjectNameCount]; // @ G0352_apc_ObjectNames + byte *_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer - IconIndice f32_getObjectType(Thing thing); // @ F0032_OBJECT_GetType - IconIndice f33_getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex - void f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap - void f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox - void f34_drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName - IconIndice f39_getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox - void f35_clearLeaderObjectName(); // @ F0035_OBJECT_ClearLeaderHandObjectName - void f37_drawIconToScreen(int16 iconIndex, int16 posX, int16 posY); // @ F0037_OBJECT_DrawIconToScreen + IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType + IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex + void extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap + void drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox + void drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName + IconIndice getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox + void clearLeaderObjectName(); // @ F0035_OBJECT_ClearLeaderHandObjectName + void drawIconToScreen(int16 iconIndex, int16 posX, int16 posY); // @ F0037_OBJECT_DrawIconToScreen }; } diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index 591f17f120..aab6e7ca00 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -37,16 +37,16 @@ namespace DM { ProjExpl::ProjExpl(DMEngine* vm) : _vm(vm) { - _g364_creatureDamageOutcome = 0; - _g363_secondaryDirToOrFromParty = 0; - _g361_lastCreatureAttackTime = -200; - _g365_createLanucherProjectile = false; - _g366_projectilePoisonAttack = 0; - _g367_projectileAttackType = 0; - _g362_lastPartyMovementTime = 0; + _creatureDamageOutcome = 0; + _secondaryDirToOrFromParty = 0; + _lastCreatureAttackTime = -200; + _createLauncherProjectile = false; + _projectilePoisonAttack = 0; + _projectileAttackType = 0; + _lastPartyMovementTime = 0; } -void ProjExpl::f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 cell, Direction dir, byte kineticEnergy, byte attack, byte stepEnergy) { +void ProjExpl::createProjectile(Thing thing, int16 mapX, int16 mapY, uint16 cell, Direction dir, byte kineticEnergy, byte attack, byte stepEnergy) { Thing L0466_T_ProjectileThing; Projectile* L0467_ps_Projectile; TimelineEvent L0468_s_Event; @@ -62,7 +62,7 @@ void ProjExpl::f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 L0467_ps_Projectile->_attack = attack; _vm->_dungeonMan->linkThingToList(L0466_T_ProjectileThing, Thing(0), mapX, mapY); /* Projectiles are added on the square and not 'moved' onto the square. In the case of a projectile launcher sensor, this means that the new projectile traverses the square in front of the launcher without any trouble: there is no impact if it is a wall, the projectile direction is not changed if it is a teleporter. Impacts with creatures and champions are still processed */ setMapAndTime(L0468_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 1); - if (_g365_createLanucherProjectile) { + if (_createLauncherProjectile) { L0468_s_Event._type = k49_TMEventTypeMoveProjectile; /* Launcher projectiles can impact immediately */ } else { L0468_s_Event._type = k48_TMEventTypeMoveProjectileIgnoreImpacts; /* Projectiles created by champions or creatures ignore impacts on their first movement */ @@ -76,7 +76,7 @@ void ProjExpl::f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 L0467_ps_Projectile->_eventIndex = _vm->_timeline->f238_addEventGetEventIndex(&L0468_s_Event); } -bool ProjExpl::f217_projectileHasImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo, int16 cell, Thing projectileThing) { +bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo, int16 cell, Thing projectileThing) { #define AP0454_i_ProjectileTargetMapX mapXCombo #define AP0455_i_ProjectileTargetMapY mapYCombo #define AP0456_i_ChampionIndex cell @@ -116,7 +116,7 @@ bool ProjExpl::f217_projectileHasImpactOccurred(int16 impactType, int16 mapXComb L0501_i_MapXCombo = mapXCombo; L0502_i_MapYCombo = mapYCombo; L0509_B_RemovePotion = false; - _g364_creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; + _creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; if ((L0510_i_ProjectileAssociatedThingType = (L0486_T_ProjectileAssociatedThing = L0490_ps_Projectile->_slot).getType()) == k8_PotionThingType) { L0491_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0486_T_ProjectileAssociatedThing); switch (((Potion *)L0491_ps_Group)->getType()) { @@ -164,19 +164,19 @@ T0217004: ((L0490_ps_Projectile->_attack > _vm->getRandomNumber(128)) && getFlag(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(L0486_T_ProjectileAssociatedThing)].getAllowedSlots(), k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors) && ((L0510_i_ProjectileAssociatedThingType != k10_JunkThingType) || - ((AL0487_i_IconIndex = _vm->_objectMan->f33_getIconIndex(L0486_T_ProjectileAssociatedThing)) < 0) || + ((AL0487_i_IconIndex = _vm->_objectMan->getIconIndex(L0486_T_ProjectileAssociatedThing)) < 0) || (!((AL0487_i_IconIndex >= k176_IconIndiceJunkIronKey) && (AL0487_i_IconIndex <= k191_IconIndiceJunkMasterKey)))) )))) { /* ASSEMBLY_COMPILATION_DIFFERENCE jmp */ return false; } - L0488_i_Attack = f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) + 1; + L0488_i_Attack = getProjectileImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) + 1; _vm->_groupMan->groupIsDoorDestoryedByAttack(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->getRandomNumber(L0488_i_Attack), false, 0); break; case kM2_ChampionElemType: if ((AP0456_i_ChampionIndex = _vm->_championMan->getIndexInCell(cell)) < 0) { return false; } - L0489_i_ChampionAttack = L0488_i_Attack = f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing); + L0489_i_ChampionAttack = L0488_i_Attack = getProjectileImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing); break; case kM1_CreatureElemType: L0491_ps_Group = (Group *)_vm->_dungeonMan->getThingData(_vm->_groupMan->groupGetThing(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY)); @@ -187,18 +187,18 @@ T0217004: L0493_ps_CreatureInfo = &g243_CreatureInfo[L0511_ui_CreatureType = L0491_ps_Group->_type]; if ((L0486_T_ProjectileAssociatedThing == Thing::_explFireBall) && (L0511_ui_CreatureType == k11_CreatureTypeBlackFlame)) { L0496_pui_CreatureHealth = &L0491_ps_Group->_health[L0512_ui_CreatureIndex]; - *L0496_pui_CreatureHealth = MIN(1000, *L0496_pui_CreatureHealth + f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing)); + *L0496_pui_CreatureHealth = MIN(1000, *L0496_pui_CreatureHealth + getProjectileImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing)); goto T0217044; } if (getFlag(L0493_ps_CreatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial) && (L0486_T_ProjectileAssociatedThing != Thing::_explHarmNonMaterial)) { return false; } - L0488_i_Attack = (uint16)((unsigned long)f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) << 6) / L0493_ps_CreatureInfo->_defense; + L0488_i_Attack = (uint16)((unsigned long)getProjectileImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) << 6) / L0493_ps_CreatureInfo->_defense; if (L0488_i_Attack) { - if ((AL0487_i_Outcome = _vm->_groupMan->groupGetDamageCreatureOutcome(L0491_ps_Group, L0512_ui_CreatureIndex, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(L0511_ui_CreatureType, _g366_projectilePoisonAttack), true)) != k0_outcomeKilledNoCreaturesInGroup) { + if ((AL0487_i_Outcome = _vm->_groupMan->groupGetDamageCreatureOutcome(L0491_ps_Group, L0512_ui_CreatureIndex, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(L0511_ui_CreatureType, _projectilePoisonAttack), true)) != k0_outcomeKilledNoCreaturesInGroup) { _vm->_groupMan->processEvents29to41(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, kM2_TMEventTypeCreateReactionEvent30HitByProjectile, 0); } - _g364_creatureDamageOutcome = AL0487_i_Outcome; + _creatureDamageOutcome = AL0487_i_Outcome; if (!L0505_B_CreateExplosionOnImpact && (AL0487_i_Outcome == k0_outcomeKilledNoCreaturesInGroup) && (L0510_i_ProjectileAssociatedThingType == k5_WeaponThingType) && @@ -211,8 +211,8 @@ T0217004: } } } - if (L0489_i_ChampionAttack && _vm->_championMan->addPendingDamageAndWounds_getDamage(AP0456_i_ChampionIndex, L0488_i_Attack, k0x0004_ChampionWoundHead | k0x0008_ChampionWoundTorso, _g367_projectileAttackType) && _g366_projectilePoisonAttack && _vm->getRandomNumber(2)) { - _vm->_championMan->championPoison(AP0456_i_ChampionIndex, _g366_projectilePoisonAttack); + if (L0489_i_ChampionAttack && _vm->_championMan->addPendingDamageAndWounds_getDamage(AP0456_i_ChampionIndex, L0488_i_Attack, k0x0004_ChampionWoundHead | k0x0008_ChampionWoundTorso, _projectileAttackType) && _projectilePoisonAttack && _vm->getRandomNumber(2)) { + _vm->_championMan->championPoison(AP0456_i_ChampionIndex, _projectilePoisonAttack); } if (L0505_B_CreateExplosionOnImpact || L0509_B_RemovePotion ) { @@ -224,7 +224,7 @@ T0217004: } if ((L0486_T_ProjectileAssociatedThing == Thing::_explLightningBolt) && !(AL0507_ui_ExplosionAttack >>= 1)) goto T0217044; - f213_explosionCreate(L0486_T_ProjectileAssociatedThing, AL0507_ui_ExplosionAttack, L0501_i_MapXCombo, L0502_i_MapYCombo, (L0486_T_ProjectileAssociatedThing == Thing::_explPoisonCloud) ? k255_CreatureTypeSingleCenteredCreature : cell); + createExplosion(L0486_T_ProjectileAssociatedThing, AL0507_ui_ExplosionAttack, L0501_i_MapXCombo, L0502_i_MapYCombo, (L0486_T_ProjectileAssociatedThing == Thing::_explPoisonCloud) ? k255_CreatureTypeSingleCenteredCreature : cell); } else { if ((L0486_T_ProjectileAssociatedThing).getType() == k5_WeaponThingType) { AL0507_ui_SoundIndex = k00_soundMETALLIC_THUD; @@ -243,11 +243,11 @@ T0217044: L0490_ps_Projectile->_slot = L0498_T_ExplosionThing; } _vm->_dungeonMan->unlinkThingFromList(projectileThing, Thing(0), L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); - f215_projectileDelete(projectileThing, L0497_pT_GroupSlot, L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); + projectileDelete(projectileThing, L0497_pT_GroupSlot, L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); return true; } -uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing thing) { +uint16 ProjExpl::getProjectileImpactAttack(Projectile* projectile, Thing thing) { WeaponInfo* L0485_ps_WeaponInfo; uint16 L0483_ui_Multiple; #define AL0483_ui_ThingType L0483_ui_Multiple @@ -255,15 +255,15 @@ uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing th uint16 L0484_ui_KineticEnergy; - _g366_projectilePoisonAttack = 0; - _g367_projectileAttackType = k3_attackType_BLUNT; + _projectilePoisonAttack = 0; + _projectileAttackType = k3_attackType_BLUNT; L0484_ui_KineticEnergy = projectile->_kineticEnergy; if ((AL0483_ui_ThingType = thing.getType()) != k15_ExplosionThingType) { if (AL0483_ui_ThingType == k5_WeaponThingType) { L0485_ps_WeaponInfo = _vm->_dungeonMan->getWeaponInfo(thing); AL0483_ui_Attack = L0485_ps_WeaponInfo->_kineticEnergy; - _g367_projectileAttackType = k3_attackType_BLUNT; + _projectileAttackType = k3_attackType_BLUNT; } else { AL0483_ui_Attack = _vm->getRandomNumber(4); } @@ -271,21 +271,21 @@ uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing th } else { if (thing == Thing::_explSlime) { AL0483_ui_Attack = _vm->getRandomNumber(16); - _g366_projectilePoisonAttack = AL0483_ui_Attack + 10; + _projectilePoisonAttack = AL0483_ui_Attack + 10; AL0483_ui_Attack += _vm->getRandomNumber(32); } else { if (thing.toUint16() >= Thing::_explHarmNonMaterial.toUint16()) { - _g367_projectileAttackType = k5_attackType_MAGIC; + _projectileAttackType = k5_attackType_MAGIC; if (thing == Thing::_explPoisonBolt) { - _g366_projectilePoisonAttack = L0484_ui_KineticEnergy; + _projectilePoisonAttack = L0484_ui_KineticEnergy; return 1; } return 0; } - _g367_projectileAttackType = k1_attackType_FIRE; + _projectileAttackType = k1_attackType_FIRE; AL0483_ui_Attack = _vm->getRandomNumber(16) + _vm->getRandomNumber(16) + 10; if (thing == Thing::_explLightningBolt) { - _g367_projectileAttackType = k7_attackType_LIGHTNING; + _projectileAttackType = k7_attackType_LIGHTNING; AL0483_ui_Attack *= 5; } } @@ -296,7 +296,7 @@ uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing th return AL0483_ui_Attack; } -void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXCombo, uint16 mapYCombo, uint16 cell) { +void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo, uint16 mapYCombo, uint16 cell) { #define AP0443_ui_ProjectileMapX mapXCombo #define AP0444_ui_ProjectileMapY mapYCombo Thing L0473_T_Thing = _vm->_dungeonMan->getUnusedThing(k15_ExplosionThingType); @@ -359,7 +359,7 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC attack >>= 2; } if ((attack -= _vm->getRandomNumber((L0469_i_CreatureFireResistance << 1) + 1)) > 0) { - _g364_creatureDamageOutcome = _vm->_groupMan->getDamageAllCreaturesOutcome(L0472_ps_Group, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, attack, true); + _creatureDamageOutcome = _vm->_groupMan->getDamageAllCreaturesOutcome(L0472_ps_Group, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, attack, true); } } } @@ -368,22 +368,22 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC } } -int16 ProjExpl::f218_projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell) { +int16 ProjExpl::projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell) { Thing L0513_T_Thing; int16 L0514_i_ImpactCount; L0514_i_ImpactCount = 0; - _g364_creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; + _creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; T0218001: L0513_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (L0513_T_Thing != Thing::_endOfList) { if (((L0513_T_Thing).getType() == k14_ProjectileThingType) && ((L0513_T_Thing).getCell() == cell) && - f217_projectileHasImpactOccurred(impactType, mapX, mapY, cell, L0513_T_Thing)) { - f214_projectileDeleteEvent(L0513_T_Thing); + hasProjectileImpactOccurred(impactType, mapX, mapY, cell, L0513_T_Thing)) { + projectileDeleteEvent(L0513_T_Thing); L0514_i_ImpactCount++; - if ((impactType == kM1_CreatureElemType) && (_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) + if ((impactType == kM1_CreatureElemType) && (_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) break; goto T0218001; } @@ -392,7 +392,7 @@ T0218001: return L0514_i_ImpactCount; } -void ProjExpl::f214_projectileDeleteEvent(Thing thing) { +void ProjExpl::projectileDeleteEvent(Thing thing) { Projectile* L0477_ps_Projectile; @@ -400,7 +400,7 @@ void ProjExpl::f214_projectileDeleteEvent(Thing thing) { _vm->_timeline->f237_deleteEvent(L0477_ps_Projectile->_eventIndex); } -void ProjExpl::f215_projectileDelete(Thing projectileThing, Thing* groupSlot, int16 mapX, int16 mapY) { +void ProjExpl::projectileDelete(Thing projectileThing, Thing* groupSlot, int16 mapX, int16 mapY) { Projectile *L0480_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(projectileThing); Thing L0479_T_Thing = L0480_ps_Projectile->_slot; if (L0479_T_Thing.getType() != k15_ExplosionThingType) { @@ -420,7 +420,7 @@ void ProjExpl::f215_projectileDelete(Thing projectileThing, Thing* groupSlot, in L0480_ps_Projectile->_nextThing = Thing::_none; } -void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { +void ProjExpl::processEvents48To49(TimelineEvent* event) { TimelineEvent* L0519_ps_Event; Projectile* L0520_ps_Projectile; Thing L0515_T_ProjectileThingNewCell; @@ -447,15 +447,15 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0519_ps_Event->_type = k49_TMEventTypeMoveProjectile; } else { L0518_ui_Cell = (L0515_T_ProjectileThingNewCell).getCell(); - if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0523_i_DestinationMapX == _vm->_dungeonMan->_partyMapX) && (L0524_i_DestinationMapY == _vm->_dungeonMan->_partyMapY) && f217_projectileHasImpactOccurred(kM2_ChampionElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0515_T_ProjectileThingNewCell)) { + if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0523_i_DestinationMapX == _vm->_dungeonMan->_partyMapX) && (L0524_i_DestinationMapY == _vm->_dungeonMan->_partyMapY) && hasProjectileImpactOccurred(kM2_ChampionElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0515_T_ProjectileThingNewCell)) { return; } - if ((_vm->_groupMan->groupGetThing(L0523_i_DestinationMapX, L0524_i_DestinationMapY) != Thing::_endOfList) && f217_projectileHasImpactOccurred(kM1_CreatureElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) { + if ((_vm->_groupMan->groupGetThing(L0523_i_DestinationMapX, L0524_i_DestinationMapY) != Thing::_endOfList) && hasProjectileImpactOccurred(kM1_CreatureElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) { return; } if (L0520_ps_Projectile->_kineticEnergy <= (AL0516_ui_StepEnergy = L0519_ps_Event->_C._projectile.getStepEnergy())) { _vm->_dungeonMan->unlinkThingFromList(L0515_T_ProjectileThingNewCell = L0521_T_ProjectileThing, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); - f215_projectileDelete(L0515_T_ProjectileThingNewCell, NULL, L0523_i_DestinationMapX, L0524_i_DestinationMapY); + projectileDelete(L0515_T_ProjectileThingNewCell, NULL, L0523_i_DestinationMapX, L0524_i_DestinationMapY); return; } L0520_ps_Projectile->_kineticEnergy -= AL0516_ui_StepEnergy; @@ -477,7 +477,7 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { if ((Square(AL0516_ui_Square).getType() == k0_WallElemType) || ((Square(AL0516_ui_Square).getType() == k6_FakeWallElemType) && !getFlag(AL0516_ui_Square, (k0x0001_FakeWallImaginary | k0x0004_FakeWallOpen))) || ((Square(AL0516_ui_Square).getType() == k3_StairsElemType) && (Square(_vm->_dungeonMan->_currMapData[L0525_i_SourceMapX][L0526_i_SourceMapY]).getType() == k3_StairsElemType))) { - if (f217_projectileHasImpactOccurred(Square(AL0516_ui_Square).getType(), L0525_i_SourceMapX, L0526_i_SourceMapY, L0518_ui_Cell, L0515_T_ProjectileThingNewCell)) { + if (hasProjectileImpactOccurred(Square(AL0516_ui_Square).getType(), L0525_i_SourceMapX, L0526_i_SourceMapY, L0518_ui_Cell, L0515_T_ProjectileThingNewCell)) { return; } } @@ -496,7 +496,7 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0515_T_ProjectileThingNewCell = thingWithNewCell(L0515_T_ProjectileThingNewCell, _vm->_moveSens->_moveResultCell); M31_setMap(L0519_ps_Event->_mapTime, _vm->_moveSens->_moveResultMapIndex); } else { - if ((Square(_vm->_dungeonMan->getSquare(L0523_i_DestinationMapX, L0524_i_DestinationMapY)).getType() == k4_DoorElemType) && f217_projectileHasImpactOccurred(k4_DoorElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) { + if ((Square(_vm->_dungeonMan->getSquare(L0523_i_DestinationMapX, L0524_i_DestinationMapY)).getType() == k4_DoorElemType) && hasProjectileImpactOccurred(k4_DoorElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) { return; } _vm->_dungeonMan->unlinkThingFromList(L0515_T_ProjectileThingNewCell, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); @@ -511,7 +511,7 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0520_ps_Projectile->_eventIndex = _vm->_timeline->f238_addEventGetEventIndex(L0519_ps_Event); } -void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) { +void ProjExpl::processEvent25(TimelineEvent* event) { Explosion* L0532_ps_Explosion; Group* L0533_ps_Group = nullptr; CreatureInfo* L0534_ps_CreatureInfo = nullptr; diff --git a/engines/dm/projexpl.h b/engines/dm/projexpl.h index 0d6f3b66c0..1621e3137d 100644 --- a/engines/dm/projexpl.h +++ b/engines/dm/projexpl.h @@ -80,26 +80,28 @@ class Projectile; class ProjExpl { DMEngine *_vm; public: - int16 _g364_creatureDamageOutcome; // @ G0364_i_CreatureDamageOutcome - int16 _g363_secondaryDirToOrFromParty; // @ G0363_i_SecondaryDirectionToOrFromParty - int32 _g361_lastCreatureAttackTime; // @ G0361_l_LastCreatureAttackTime - bool _g365_createLanucherProjectile; // @ G0365_B_CreateLauncherProjectile - int16 _g366_projectilePoisonAttack; // @ G0366_i_ProjectilePoisonAttack - int16 _g367_projectileAttackType; // @ G0367_i_ProjectileAttackType - int32 _g362_lastPartyMovementTime; // @ G0362_l_LastPartyMovementTime + int16 _creatureDamageOutcome; // @ G0364_i_CreatureDamageOutcome + int16 _secondaryDirToOrFromParty; // @ G0363_i_SecondaryDirectionToOrFromParty + int32 _lastCreatureAttackTime; // @ G0361_l_LastCreatureAttackTime + bool _createLauncherProjectile; // @ G0365_B_CreateLauncherProjectile + int16 _projectilePoisonAttack; // @ G0366_i_ProjectilePoisonAttack + int16 _projectileAttackType; // @ G0367_i_ProjectileAttackType + int32 _lastPartyMovementTime; // @ G0362_l_LastPartyMovementTime + explicit ProjExpl(DMEngine *vm); - void f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 cell, Direction dir, + + void createProjectile(Thing thing, int16 mapX, int16 mapY, uint16 cell, Direction dir, byte kineticEnergy, byte attack, byte stepEnergy); // @ F0212_PROJECTILE_Create - bool f217_projectileHasImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo, + bool hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo, int16 cell, Thing projectileThing); // @ F0217_PROJECTILE_HasImpactOccured - uint16 f216_projectileGetImpactAttack(Projectile *projectile, Thing thing); // @ F0216_PROJECTILE_GetImpactAttack - void f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXCombo, + uint16 getProjectileImpactAttack(Projectile *projectile, Thing thing); // @ F0216_PROJECTILE_GetImpactAttack + void createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo, uint16 mapYCombo, uint16 cell); // @ F0213_EXPLOSION_Create - int16 f218_projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell); // @ F0218_PROJECTILE_GetImpactCount - void f214_projectileDeleteEvent(Thing thing); // @ F0214_PROJECTILE_DeleteEvent - void f215_projectileDelete(Thing projectileThing, Thing *groupSlot, int16 mapX, int16 mapY); // @ F0215_PROJECTILE_Delete - void f219_processEvents48To49_projectile(TimelineEvent *event); // @ F0219_PROJECTILE_ProcessEvents48To49_Projectile - void f220_explosionProcessEvent25_explosion(TimelineEvent *event); // @ F0220_EXPLOSION_ProcessEvent25_Explosion + int16 projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell); // @ F0218_PROJECTILE_GetImpactCount + void projectileDeleteEvent(Thing thing); // @ F0214_PROJECTILE_DeleteEvent + void projectileDelete(Thing projectileThing, Thing *groupSlot, int16 mapX, int16 mapY); // @ F0215_PROJECTILE_Delete + void processEvents48To49(TimelineEvent *event); // @ F0219_PROJECTILE_ProcessEvents48To49_Projectile + void processEvent25(TimelineEvent *event); // @ F0220_EXPLOSION_ProcessEvent25_Explosion }; } diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 002b7a6ec9..2fd2eb98ab 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -282,13 +282,13 @@ void Timeline::f261_processTimeline() { switch (AL0680_ui_EventType) { case k48_TMEventTypeMoveProjectileIgnoreImpacts: case k49_TMEventTypeMoveProjectile: - _vm->_projexpl->f219_processEvents48To49_projectile(L0681_ps_Event); + _vm->_projexpl->processEvents48To49(L0681_ps_Event); break; case k1_TMEventTypeDoorAnimation: f241_timelineProcessEvent1_doorAnimation(L0681_ps_Event); break; case k25_TMEventTypeExplosion: - _vm->_projexpl->f220_explosionProcessEvent25_explosion(L0681_ps_Event); + _vm->_projexpl->processEvent25(L0681_ps_Event); break; case k7_TMEventTypeFakeWall: f242_timelineProcessEvent7_squareFakewall(L0681_ps_Event); @@ -784,12 +784,12 @@ void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* eve L0628_ui_ProjectileCell = normalizeModulo4(L0628_ui_ProjectileCell + _vm->getRandomNumber(2)); } L0626_i_MapX += _vm->_dirIntoStepCountEast[L0624_ui_Cell], L0627_i_MapY += _vm->_dirIntoStepCountNorth[L0624_ui_Cell]; /* BUG0_20 The game crashes if the launcher sensor is on a map boundary and shoots in a direction outside the map */ - _vm->_projexpl->_g365_createLanucherProjectile = true; - _vm->_projexpl->f212_projectileCreate(L0622_T_FirstProjectileAssociatedThing, L0626_i_MapX, L0627_i_MapY, L0628_ui_ProjectileCell, (Direction)L0624_ui_Cell, L0630_i_KineticEnergy, 100, L0631_i_StepEnergy); + _vm->_projexpl->_createLauncherProjectile = true; + _vm->_projexpl->createProjectile(L0622_T_FirstProjectileAssociatedThing, L0626_i_MapX, L0627_i_MapY, L0628_ui_ProjectileCell, (Direction)L0624_ui_Cell, L0630_i_KineticEnergy, 100, L0631_i_StepEnergy); if (!L0632_B_LaunchSingleProjectile) { - _vm->_projexpl->f212_projectileCreate(L0623_T_SecondProjectileAssociatedThing, L0626_i_MapX, L0627_i_MapY, returnNextVal(L0628_ui_ProjectileCell), (Direction)L0624_ui_Cell, L0630_i_KineticEnergy, 100, L0631_i_StepEnergy); + _vm->_projexpl->createProjectile(L0623_T_SecondProjectileAssociatedThing, L0626_i_MapX, L0627_i_MapY, returnNextVal(L0628_ui_ProjectileCell), (Direction)L0624_ui_Cell, L0630_i_KineticEnergy, 100, L0631_i_StepEnergy); } - _vm->_projexpl->_g365_createLanucherProjectile = false; + _vm->_projexpl->_createLauncherProjectile = false; } void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) { @@ -1063,7 +1063,7 @@ void Timeline::f255_timelineProcessEvent13_ViAltarRebirth(TimelineEvent* event) L0671_ui_ChampionIndex = event->_priority; switch (L0670_ui_Step = event->_C.A._effect) { /* Rebirth is a 3 steps process (Step 2 -> Step 1 -> Step 0). Step is stored in the Effect value of the event */ case 2: - _vm->_projexpl->f213_explosionCreate(Thing::_explRebirthStep1, 0, L0664_i_MapX, L0665_i_MapY, L0666_ui_Cell); + _vm->_projexpl->createExplosion(Thing::_explRebirthStep1, 0, L0664_i_MapX, L0665_i_MapY, L0666_ui_Cell); event->_mapTime += 5; T0255002: L0670_ui_Step--; @@ -1074,7 +1074,7 @@ T0255002: L0667_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0664_i_MapX, L0665_i_MapY); while (L0667_T_Thing != Thing::_endOfList) { if ((L0667_T_Thing.getCell() == L0666_ui_Cell) && (L0667_T_Thing.getType() == k10_JunkThingType)) { - L0669_i_IconIndex = _vm->_objectMan->f33_getIconIndex(L0667_T_Thing); + L0669_i_IconIndex = _vm->_objectMan->getIconIndex(L0667_T_Thing); if (L0669_i_IconIndex == k147_IconIndiceJunkChampionBones) { L0668_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L0667_T_Thing); if (L0668_ps_Junk->getChargeCount() == L0671_ui_ChampionIndex) { |