diff options
author | Strangerke | 2016-08-24 08:03:55 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 64b1c4fdf11001acc442fea7367b11f45336b25f (patch) | |
tree | 2f76f550236c7064e13417fb4c8077c31fc0c2cd /engines | |
parent | 544ce3578b9c190169d85cfa9ab2c0138684b525 (diff) | |
download | scummvm-rg350-64b1c4fdf11001acc442fea7367b11f45336b25f.tar.gz scummvm-rg350-64b1c4fdf11001acc442fea7367b11f45336b25f.tar.bz2 scummvm-rg350-64b1c4fdf11001acc442fea7367b11f45336b25f.zip |
DM: Rename DungeonMan class members
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/champion.cpp | 132 | ||||
-rw-r--r-- | engines/dm/console.cpp | 36 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 58 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 556 | ||||
-rw-r--r-- | engines/dm/dungeonman.h | 179 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 138 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 152 | ||||
-rw-r--r-- | engines/dm/group.cpp | 200 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 32 | ||||
-rw-r--r-- | engines/dm/loadsave.cpp | 46 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 82 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 230 | ||||
-rw-r--r-- | engines/dm/objectman.cpp | 8 | ||||
-rw-r--r-- | engines/dm/projexpl.cpp | 84 | ||||
-rw-r--r-- | engines/dm/sounds.cpp | 22 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 136 |
16 files changed, 1042 insertions, 1049 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index b6bcdf2593..f9adcc7139 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -217,14 +217,14 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side) return false; } - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); decrementStamina(champIndex, getThrowingStaminaCost(curThing)); disableAction(champIndex, 4); int16 experience = 8; int16 weaponKineticEnergy = 1; if (curThing.getType() == k5_WeaponThingType) { experience += 4; - WeaponInfo *curWeapon = _vm->_dungeonMan->f158_getWeaponInfo(curThing); + WeaponInfo *curWeapon = _vm->_dungeonMan->getWeaponInfo(curThing); if (curWeapon->_class <= k12_WeaponClassPoisinDart) { weaponKineticEnergy = curWeapon->_kineticEnergy; experience += weaponKineticEnergy >> 2; @@ -236,11 +236,11 @@ 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->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, - normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + side), - _vm->_dungeonMan->_g308_partyDir, kineticEnergy, attack, stepEnergy); + _vm->_projexpl->f212_projectileCreate(curThing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, + normalizeModulo4(_vm->_dungeonMan->_partyDir + side), + _vm->_dungeonMan->_partyDir, kineticEnergy, attack, stepEnergy); _vm->_projectileDisableMovementTicks = 4; - _vm->_lastProjectileDisabledMovementDirection = _vm->_dungeonMan->_g308_partyDir; + _vm->_lastProjectileDisabledMovementDirection = _vm->_dungeonMan->_partyDir; drawChampionState((ChampionIndex)champIndex); return true; } @@ -295,11 +295,11 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i if (((thingType == k5_WeaponThingType) || (thingType == k6_ArmourThingType)) && (slotIndex >= k0_ChampionSlotReadyHand) && (slotIndex <= k12_ChampionSlotQuiverLine_1_1)) { if (thingType == k5_WeaponThingType) { - Weapon *weapon = (Weapon *)_vm->_dungeonMan->f156_getThingData(thing); + Weapon *weapon = (Weapon *)_vm->_dungeonMan->getThingData(thing); cursed = weapon->getCursed(); } else { // k6_ArmourThingType - Armour *armour = (Armour *)_vm->_dungeonMan->f156_getThingData(thing); + Armour *armour = (Armour *)_vm->_dungeonMan->getThingData(thing); cursed = armour->getCursed(); } @@ -537,12 +537,12 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio champ->setSlot(slotIndex, thing); } - champ->_load += dunMan.f140_getObjectWeight(thing); + champ->_load += dunMan.getObjectWeight(thing); champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true); IconIndice iconIndex = objMan.f33_getIconIndex(thing); bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal); applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing); - uint16 *rawObjPtr = dunMan.f156_getThingData(thing); + uint16 *rawObjPtr = dunMan.getThingData(thing); if (slotIndex < k2_ChampionSlotHead) { if (slotIndex == k1_ChampionSlotActionHand) { @@ -588,7 +588,7 @@ int16 ChampionMan::getScentOrdinal(int16 mapX, int16 mapY) { Scent searchedScent; searchedScent.setMapX(mapX); searchedScent.setMapY(mapY); - searchedScent.setMapIndex(_vm->_dungeonMan->_g272_currMapIndex); + searchedScent.setMapIndex(_vm->_dungeonMan->_currMapIndex); uint16 searchedScentRedEagle = searchedScent.toUint16(); Scent *scent = &_party._scents[scentIndex--]; do { @@ -612,7 +612,7 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() { _vm->_eventMan->f69_setMousePointer(); _vm->_eventMan->f77_hideMouse(); if (_leaderIndex != kM1_ChampionNone) { - _champions[_leaderIndex]._load -= _vm->_dungeonMan->f140_getObjectWeight(leaderHandObject); + _champions[_leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(leaderHandObject); setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad); drawChampionState(_leaderIndex); } @@ -624,7 +624,7 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) { Champion *curChampion = &_champions[champIndex]; int16 strength = _vm->getRandomNumber(16) + curChampion->_statistics[k1_ChampionStatStrength][k1_ChampionStatCurrent]; Thing curThing = curChampion->_slots[slotIndex]; - uint16 objectWeight = _vm->_dungeonMan->f140_getObjectWeight(curThing); + uint16 objectWeight = _vm->_dungeonMan->getObjectWeight(curThing); uint16 oneSixteenthMaximumLoad = getMaximumLoad(curChampion) >> 4; if (objectWeight <= oneSixteenthMaximumLoad) { @@ -638,7 +638,7 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) { } } if (curThing.getType() == k5_WeaponThingType) { - WeaponInfo *weaponInfo = _vm->_dungeonMan->f158_getWeaponInfo(curThing); + WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing); strength += weaponInfo->_strength; uint16 skillLevel = 0; uint16 weaponClass = weaponInfo->_class; @@ -680,7 +680,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex) // Remove object modifiers applyModifiersToStatistics(curChampion, slotIndex, curIconIndex, -1, curThing); - Weapon *curWeapon = (Weapon *)_vm->_dungeonMan->f156_getThingData(curThing); + Weapon *curWeapon = (Weapon *)_vm->_dungeonMan->getThingData(curThing); if (slotIndex == k10_ChampionSlotNeck) { if ((curIconIndex >= k12_IconIndiceJunkIllumuletUnequipped) && (curIconIndex <= k13_IconIndiceJunkIllumuletEquipped)) { ((Junk *)curWeapon)->setChargeCount(0); @@ -727,7 +727,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex) } } } - curChampion->_load -= _vm->_dungeonMan->f140_getObjectWeight(curThing); + curChampion->_load -= _vm->_dungeonMan->getObjectWeight(curThing); setFlag(curChampion->_attributes, k0x0200_ChampionAttributeLoad); return curThing; } @@ -851,10 +851,10 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) { for (int16 slotIndex = k0_ChampionSlotReadyHand; slotIndex <= k1_ChampionSlotActionHand; slotIndex++) { Thing curThing = curChampion->_slots[slotIndex]; if (curThing.getType() == k6_ArmourThingType) { - ArmourInfo *armorInfo = (ArmourInfo *)_vm->_dungeonMan->f156_getThingData(curThing); + ArmourInfo *armorInfo = (ArmourInfo *)_vm->_dungeonMan->getThingData(curThing); armorInfo = &_vm->_dungeonMan->_armourInfo[((Armour *)armorInfo)->getType()]; if (getFlag(armorInfo->_attributes, k0x0080_ArmourAttributeIsAShield)) - armorShieldDefense += ((getStrength(champIndex, slotIndex) + _vm->_dungeonMan->f143_getArmourDefense(armorInfo, useSharpDefense)) * woundDefenseFactor[woundIndex]) >> ((slotIndex == woundIndex) ? 4 : 5); + armorShieldDefense += ((getStrength(champIndex, slotIndex) + _vm->_dungeonMan->getArmourDefense(armorInfo, useSharpDefense)) * woundDefenseFactor[woundIndex]) >> ((slotIndex == woundIndex) ? 4 : 5); } } @@ -866,8 +866,8 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) { if (woundIndex > k1_ChampionSlotActionHand) { Thing curThing = curChampion->_slots[woundIndex]; if (curThing.getType() == k6_ArmourThingType) { - ArmourInfo *armourInfo = (ArmourInfo *)_vm->_dungeonMan->f156_getThingData(curThing); - woundDefense += _vm->_dungeonMan->f143_getArmourDefense(&_vm->_dungeonMan->_armourInfo[((Armour *)armourInfo)->getType()], useSharpDefense); + ArmourInfo *armourInfo = (ArmourInfo *)_vm->_dungeonMan->getThingData(curThing); + woundDefense += _vm->_dungeonMan->getArmourDefense(&_vm->_dungeonMan->_armourInfo[((Armour *)armourInfo)->getType()], useSharpDefense); } } @@ -911,7 +911,7 @@ void ChampionMan::wakeUp() { } int16 ChampionMan::getThrowingStaminaCost(Thing thing) { - int16 weight = _vm->_dungeonMan->f140_getObjectWeight(thing) >> 1; + int16 weight = _vm->_dungeonMan->getObjectWeight(thing) >> 1; int16 staminaCost = getBoundedValue<int16>(1, weight, 10); while ((weight -= 10) > 0) @@ -942,7 +942,7 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) { setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x0008_ChampionAttributeDisableAction); drawChampionState((ChampionIndex)champIndex); } - setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, updatedEnableActionEventTime); + setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime); curChampion->_enableActionEventIndex = _vm->_timeline->f238_addEventGetEventIndex(&curEvent); } @@ -951,8 +951,8 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1 exp >>= 1; if (exp) { - if (_vm->_dungeonMan->_g269_currMap->_difficulty) - exp *= _vm->_dungeonMan->_g269_currMap->_difficulty; + if (_vm->_dungeonMan->_currMap->_difficulty) + exp *= _vm->_dungeonMan->_currMap->_difficulty; Champion *curChampion = &_champions[champIndex]; uint16 baseSkillIndex; @@ -1070,9 +1070,9 @@ int16 ChampionMan::getDamagedChampionCount(uint16 attack, int16 wounds, int16 at } int16 ChampionMan::getTargetChampionIndex(int16 mapX, int16 mapY, uint16 cell) { - if (_partyChampionCount && (getDistance(mapX, mapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1)) { + if (_partyChampionCount && (getDistance(mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY) <= 1)) { signed char orderedCellsToAttack[4]; - _vm->_groupMan->f229_setOrderedCellsToAttack(orderedCellsToAttack, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, mapX, mapY, cell); + _vm->_groupMan->f229_setOrderedCellsToAttack(orderedCellsToAttack, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, mapX, mapY, cell); for (uint16 i = 0; i < 4; i++) { int16 championIndex = getIndexInCell(orderedCellsToAttack[i]); if (championIndex >= 0) @@ -1117,7 +1117,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) { TimelineEvent newEvent; newEvent._type = k75_TMEventTypePoisonChampion; newEvent._priority = champIndex; - setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 36); + setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 36); newEvent._B._attack = attack; _vm->_timeline->f238_addEventGetEventIndex(&newEvent); } @@ -1126,10 +1126,10 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) { } void ChampionMan::setPartyDirection(int16 dir) { - if (dir == _vm->_dungeonMan->_g308_partyDir) + if (dir == _vm->_dungeonMan->_partyDir) return; - int16 L0834_i_Delta = dir - _vm->_dungeonMan->_g308_partyDir; + int16 L0834_i_Delta = dir - _vm->_dungeonMan->_partyDir; if (L0834_i_Delta < 0) L0834_i_Delta += 4; @@ -1140,7 +1140,7 @@ void ChampionMan::setPartyDirection(int16 dir) { curChampion++; } - _vm->_dungeonMan->_g308_partyDir = (Direction)dir; + _vm->_dungeonMan->_partyDir = (Direction)dir; drawChangedObjectIcons(); } @@ -1171,7 +1171,7 @@ void ChampionMan::addScentStrength(int16 mapX, int16 mapY, int32 cycleCount) { Scent newScent; /* BUG0_00 Useless code */ newScent.setMapX(mapX); /* BUG0_00 Useless code */ newScent.setMapY(mapY); /* BUG0_00 Useless code */ - newScent.setMapIndex(_vm->_dungeonMan->_g272_currMapIndex); /* BUG0_00 Useless code */ + newScent.setMapIndex(_vm->_dungeonMan->_currMapIndex); /* BUG0_00 Useless code */ Scent *curScent = _party._scents; /* BUG0_00 Useless code */ bool cycleCountDefined = false; @@ -1207,7 +1207,7 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) { _vm->_eventMan->f77_hideMouse(); if (_leaderIndex != kM1_ChampionNone) { - _champions[_leaderIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(thing); + _champions[_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thing); setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad); drawChampionState(_leaderIndex); } @@ -1250,7 +1250,7 @@ bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 wea if (curThing.getType() != k5_WeaponThingType) return false; - WeaponInfo *weaponInfo = _vm->_dungeonMan->f158_getWeaponInfo(curThing); + WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing); int16 weaponClass = kM1_WeaponClassNone; if ((weaponInfo->_class >= k16_WeaponClassFirstBow) && (weaponInfo->_class <= k31_WeaponClassLastBow)) @@ -1262,7 +1262,7 @@ bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 wea return false; curThing = curChampion->_slots[ammunitionSlotIndex]; - weaponInfo = _vm->_dungeonMan->f158_getWeaponInfo(curThing); + weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing); return ((curThing.getType() == k5_WeaponThingType) && (weaponInfo->_class == weaponClass)); } @@ -1285,7 +1285,7 @@ void ChampionMan::viAltarRebirth(uint16 champIndex) { curChampion->_maxHealth = MAX(25, maximumHealth - (maximumHealth >> 6) - 1); curChampion->_currHealth = curChampion->_maxHealth >> 1; _vm->_menuMan->f393_drawSpellAreaControls(_magicCasterChampionIndex); - curChampion->_dir = _vm->_dungeonMan->_g308_partyDir; + curChampion->_dir = _vm->_dungeonMan->_partyDir; setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x1000_ChampionAttributeStatusBox | k0x0400_ChampionAttributeIcon); drawChampionState((ChampionIndex)champIndex); } @@ -1319,7 +1319,7 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) { if ((slotThing == Thing::_none) && (leaderHandObject == Thing::_none)) return; - if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex]))) + if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex]))) return; _vm->_eventMan->f78_showMouse(); @@ -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->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy); + _vm->_projexpl->f212_projectileCreate(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; } @@ -1432,12 +1432,12 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() { if (eventIndex == -1) { TimelineEvent newEvent; newEvent._type = k12_TMEventTypeHideDamageReceived; - setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 5); + setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5); newEvent._priority = championIndex; championPtr->_hideDamageReceivedIndex = _vm->_timeline->f238_addEventGetEventIndex(&newEvent); } else { TimelineEvent *curEvent = &_vm->_timeline->_g370_events[eventIndex]; - setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 5); + setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5); _vm->_timeline->f236_fixChronology(_vm->_timeline->f235_getIndex(eventIndex)); } drawChampionState((ChampionIndex)championIndex); @@ -1468,21 +1468,21 @@ void ChampionMan::championKill(uint16 champIndex) { _vm->_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory); } dropAllObjects(champIndex); - Thing unusedThing = _vm->_dungeonMan->f166_getUnusedThing(k0x8000_championBones | k10_JunkThingType); + Thing unusedThing = _vm->_dungeonMan->getUnusedThing(k0x8000_championBones | k10_JunkThingType); uint16 curCell = 0; if (unusedThing != Thing::_none) { - Junk *L0966_ps_Junk = (Junk *)_vm->_dungeonMan->f156_getThingData(unusedThing); + Junk *L0966_ps_Junk = (Junk *)_vm->_dungeonMan->getThingData(unusedThing); L0966_ps_Junk->setType(k5_JunkTypeBones); L0966_ps_Junk->setDoNotDiscard(true); L0966_ps_Junk->setChargeCount(champIndex); curCell = curChampion->_cell; - _vm->_moveSens->f267_getMoveResult(thingWithNewCell(unusedThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + _vm->_moveSens->f267_getMoveResult(thingWithNewCell(unusedThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); } curChampion->_symbolStep = 0; curChampion->_symbols[0] = '\0'; - curChampion->_dir = _vm->_dungeonMan->_g308_partyDir; + curChampion->_dir = _vm->_dungeonMan->_partyDir; curChampion->_maximumDamageReceived = 0; - uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_g308_partyDir); + uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_partyDir); if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap) { _vm->_eventMan->_g598_mousePointerBitmapUpdated = true; _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); @@ -1553,7 +1553,7 @@ void ChampionMan::dropAllObjects(uint16 champIndex) { for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) { Thing curThing = getObjectRemovedFromSlot(champIndex, slotDropOrder[slotIndex]); if (curThing != Thing::_none) - _vm->_moveSens->f267_getMoveResult(thingWithNewCell(curThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + _vm->_moveSens->f267_getMoveResult(thingWithNewCell(curThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); } } @@ -1574,9 +1574,9 @@ void ChampionMan::applyTimeEffects() { return; Scent checkScent; - checkScent.setMapX(_vm->_dungeonMan->_g306_partyMapX); - checkScent.setMapY(_vm->_dungeonMan->_g307_partyMapY); - checkScent.setMapIndex(_vm->_dungeonMan->_g309_partyMapIndex); + checkScent.setMapX(_vm->_dungeonMan->_partyMapX); + checkScent.setMapY(_vm->_dungeonMan->_partyMapY); + checkScent.setMapIndex(_vm->_dungeonMan->_partyMapIndex); for (byte loopScentIndex = 0; loopScentIndex + 1 < _party._scentCount; loopScentIndex++) { if (&_party._scents[loopScentIndex] != &checkScent) { @@ -1678,8 +1678,8 @@ void ChampionMan::applyTimeEffects() { curStatistic[k1_ChampionStatCurrent] -= curStatistic[k1_ChampionStatCurrent] / statisticMaximum; } } - if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_g308_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < _vm->_gameTime)) { - championPtr->_dir = _vm->_dungeonMan->_g308_partyDir; + if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < _vm->_gameTime)) { + championPtr->_dir = _vm->_dungeonMan->_partyDir; championPtr->_maximumDamageReceived = 0; setFlag(championPtr->_attributes, k0x0400_ChampionAttributeIcon); } @@ -1876,26 +1876,26 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { championPtr->_actionIndex = k255_ChampionActionNone; championPtr->_enableActionEventIndex = -1; championPtr->_hideDamageReceivedIndex = -1; - championPtr->_dir = _vm->_dungeonMan->_g308_partyDir; + championPtr->_dir = _vm->_dungeonMan->_partyDir; uint16 viewCell = k0_ViewCellFronLeft; - while (getIndexInCell(normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir)) != kM1_ChampionNone) + while (getIndexInCell(normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir)) != kM1_ChampionNone) viewCell++; - championPtr->_cell = (ViewCell)normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir); + championPtr->_cell = (ViewCell)normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir); championPtr->_attributes = k0x0400_ChampionAttributeIcon; - championPtr->_directionMaximumDamageReceived = _vm->_dungeonMan->_g308_partyDir; + championPtr->_directionMaximumDamageReceived = _vm->_dungeonMan->_partyDir; championPtr->_food = 1500 + _vm->getRandomNumber(256); championPtr->_water = 1500 + _vm->getRandomNumber(256); for (int16 slotIdx = k0_ChampionSlotReadyHand; slotIdx < k30_ChampionSlotChest_1; slotIdx++) championPtr->_slots[slotIdx] = Thing::_none; - Thing curThing = _vm->_dungeonMan->f161_getSquareFirstThing(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + Thing curThing = _vm->_dungeonMan->getSquareFirstThing(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); while (curThing.getType() != k2_TextstringType) - curThing = _vm->_dungeonMan->f159_getNextThing(curThing); + curThing = _vm->_dungeonMan->getNextThing(curThing); char L0807_ac_DecodedChampionText[77]; char *decodedStringPtr = L0807_ac_DecodedChampionText; - _vm->_dungeonMan->f168_decodeText(decodedStringPtr, curThing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + _vm->_dungeonMan->decodeText(decodedStringPtr, curThing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); uint16 charIdx = 0; char tmpChar; @@ -1955,16 +1955,16 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { _vm->_menuMan->f386_drawActionIcon((ChampionIndex)(_partyChampionCount - 1)); } - int16 curMapX = _vm->_dungeonMan->_g306_partyMapX; - int16 curMapY = _vm->_dungeonMan->_g307_partyMapY; - uint16 championObjectsCell = returnOppositeDir(_vm->_dungeonMan->_g308_partyDir); - curMapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir], curMapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; - curThing = _vm->_dungeonMan->f161_getSquareFirstThing(curMapX, curMapY); + int16 curMapX = _vm->_dungeonMan->_partyMapX; + int16 curMapY = _vm->_dungeonMan->_partyMapY; + uint16 championObjectsCell = returnOppositeDir(_vm->_dungeonMan->_partyDir); + curMapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], curMapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; + curThing = _vm->_dungeonMan->getSquareFirstThing(curMapX, curMapY); int16 slotIdx = k13_ChampionSlotBackpackLine_1_1; while (curThing != Thing::_endOfList) { ThingType thingType = curThing.getType(); if ((thingType > k3_SensorThingType) && (curThing.getCell() == championObjectsCell)) { - int16 objectAllowedSlots = _vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(curThing)]._allowedSlots; + int16 objectAllowedSlots = _vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(curThing)]._allowedSlots; uint16 curSlotIndex = k0_ChampionSlotReadyHand; switch (thingType) { case k6_ArmourThingType: { @@ -2025,7 +2025,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { } addObjectInSlot((ChampionIndex)previousPartyChampionCount, curThing, (ChampionSlot)curSlotIndex); } - curThing = _vm->_dungeonMan->f159_getNextThing(curThing); + curThing = _vm->_dungeonMan->getNextThing(curThing); } _vm->_inventoryMan->f355_toggleInventory((ChampionIndex)previousPartyChampionCount); _vm->_menuMan->f456_drawDisabledMenu();; @@ -2255,10 +2255,10 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { _vm->_textMan->f52_printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer); setFlag(championAttributes, k0x4000_ChampionAttributeViewport); } - uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_g308_partyDir); + uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir); if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) { _vm->_displayMan->D24_fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]); - _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen); + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen); } if (getFlag(championAttributes, k0x0800_ChampionAttributePanel) && isInventoryChampion) { if (_vm->_pressingMouth) diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp index 9874708e0e..b931733b54 100644 --- a/engines/dm/console.cpp +++ b/engines/dm/console.cpp @@ -120,8 +120,8 @@ argumentError: bool Console::Cmd_pos(int argc, const char** argv) { DungeonMan &dm = *_vm->_dungeonMan; if (argc == 2 && cstrEquals("get", argv[1])) { - debugPrintf("Position: (%d, %d) Direction: %s\n", dm._g306_partyMapX + dm._g269_currMap->_offsetMapX, - dm._g307_partyMapY + dm._g269_currMap->_offsetMapY, debugGetDirectionName(_vm->_dungeonMan->_g308_partyDir)); + debugPrintf("Position: (%d, %d) Direction: %s\n", dm._partyMapX + dm._currMap->_offsetMapX, + dm._partyMapY + dm._currMap->_offsetMapY, debugGetDirectionName(_vm->_dungeonMan->_partyDir)); } else if (argc == 4 && cstrEquals("set", argv[1])) { int x = atoi(argv[2]); int y = atoi(argv[3]); @@ -130,7 +130,7 @@ bool Console::Cmd_pos(int argc, const char** argv) { return true; } - Map &currMap = *_vm->_dungeonMan->_g269_currMap; + Map &currMap = *_vm->_dungeonMan->_currMap; // not >= because dimensions are inslucsive if (x < currMap._offsetMapX || x > currMap._width + currMap._offsetMapX || y < currMap._offsetMapY || y > currMap._height + currMap._offsetMapY) { @@ -143,7 +143,7 @@ bool Console::Cmd_pos(int argc, const char** argv) { if (haventWarned.check()) debugPrintf("Setting position directly can cause glitches and crashes.\n"); debugPrintf("Position set to (%d, %d)\n", x, y); - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, x - currMap._offsetMapX, y - currMap._offsetMapY); } else goto argumentError; @@ -158,7 +158,7 @@ argumentError: bool Console::Cmd_map(int argc, const char** argv) { if (argc == 2 && cstrEquals("get", argv[1])) { - debugPrintf("Map index: %d\n", _vm->_dungeonMan->_g309_partyMapIndex); + debugPrintf("Map index: %d\n", _vm->_dungeonMan->_partyMapIndex); } else if (argc == 3 && cstrEquals("set", argv[1])) { int index = atoi(argv[2]); if (index == 0 && !cstrEquals("0", argv[2])) { @@ -167,8 +167,8 @@ bool Console::Cmd_map(int argc, const char** argv) { } // not >= because dimensions are inslucsive - if (index < 0 || index >= _vm->_dungeonMan->_g278_dungeonFileHeader._mapCount) { - debugPrintf("Map index %d is out of bounds, possible values [0, %d]\n", index, _vm->_dungeonMan->_g278_dungeonFileHeader._mapCount - 1); + if (index < 0 || index >= _vm->_dungeonMan->_dungeonFileHeader._mapCount) { + debugPrintf("Map index %d is out of bounds, possible values [0, %d]\n", index, _vm->_dungeonMan->_dungeonFileHeader._mapCount - 1); return true; } @@ -177,15 +177,15 @@ bool Console::Cmd_map(int argc, const char** argv) { debugPrintf("Setting map directly can cause glitches and crashes.\n"); debugPrintf("Map set to %d\n", index); - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, kM1_MapXNotOnASquare, 0); - _vm->_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange( - _vm->_dungeonMan->_g309_partyMapIndex, index - _vm->_dungeonMan->_g309_partyMapIndex, - &_vm->_dungeonMan->_g306_partyMapX, &_vm->_dungeonMan->_g307_partyMapY); + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kM1_MapXNotOnASquare, 0); + _vm->_newPartyMapIndex = _vm->_dungeonMan->getLocationAfterLevelChange( + _vm->_dungeonMan->_partyMapIndex, index - _vm->_dungeonMan->_partyMapIndex, + &_vm->_dungeonMan->_partyMapX, &_vm->_dungeonMan->_partyMapY); if (_vm->_newPartyMapIndex == -1) _vm->_newPartyMapIndex = index; - _vm->_dungeonMan->f173_setCurrentMap(_vm->_newPartyMapIndex); - _vm->_championMan->setPartyDirection(_vm->_dungeonMan->f155_getStairsExitDirection(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY)); - _vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex); + _vm->_dungeonMan->setCurrentMap(_vm->_newPartyMapIndex); + _vm->_championMan->setPartyDirection(_vm->_dungeonMan->getStairsExitDirection(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)); + _vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex); } else goto argumentError; @@ -249,9 +249,9 @@ bool Console::Cmd_gimme(int argc, const char** argv) { requestedItemName.deleteLastChar(); for (int16 thingType = 0; thingType < 16; ++thingType) { // 16 number of item types - uint16 *thingDataArray = _vm->_dungeonMan->_g284_thingData[thingType]; + uint16 *thingDataArray = _vm->_dungeonMan->_thingData[thingType]; uint16 thingTypeSize = g235_ThingDataWordCount[thingType]; - uint16 thingCount = _vm->_dungeonMan->_g278_dungeonFileHeader._thingCounts[thingType]; + uint16 thingCount = _vm->_dungeonMan->_dungeonFileHeader._thingCounts[thingType]; Thing dummyThing(0); dummyThing.setType(thingType); @@ -266,8 +266,8 @@ bool Console::Cmd_gimme(int argc, const char** argv) { delete[] thingDataArray; for (uint16 i = 0; i < thingTypeSize; ++i) newThingData[thingCount * thingTypeSize + i] = newThingData[thingIndex * thingTypeSize + i]; - _vm->_dungeonMan->_g278_dungeonFileHeader._thingCounts[thingType]++; - _vm->_dungeonMan->_g284_thingData[thingType] = newThingData; + _vm->_dungeonMan->_dungeonFileHeader._thingCounts[thingType]++; + _vm->_dungeonMan->_thingData[thingType] = newThingData; _vm->_championMan->addObjectInSlot((ChampionIndex)0, dummyThing, (ChampionSlot)29); debugPrintf("Item gimmed to the first champion, last slot\n"); return true; diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 37f03056ea..0c225a7999 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -306,7 +306,7 @@ void DMEngine::initializeGame() { startGame(); if (_newGameFl) - _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); + _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); _eventMan->f78_showMouse(); _eventMan->f357_discardAllInput(); } @@ -342,7 +342,7 @@ void DMEngine::startGame() { _eventMan->_g443_primaryKeyboardInput = _eventMan->_primaryKeyboardInputInterface; _eventMan->_g444_secondaryKeyboardInput = _eventMan->_secondaryKeyboardInputMovement; - processNewPartyMap(_dungeonMan->_g309_partyMapIndex); + processNewPartyMap(_dungeonMan->_partyMapIndex); if (!_newGameFl) { _displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g347_paletteTopAndBottomScreen); @@ -366,7 +366,7 @@ void DMEngine::startGame() { void DMEngine::processNewPartyMap(uint16 mapIndex) { _groupMan->f194_removeAllActiveGroups(); - _dungeonMan->f174_setCurrentMapAndPartyMap(mapIndex); + _dungeonMan->setCurrentMapAndPartyMap(mapIndex); _displayMan->f96_loadCurrentMapGraphics(); _groupMan->f195_addAllActiveGroups(); _inventoryMan->f337_setDungeonViewPalette(); @@ -439,7 +439,7 @@ void DMEngine::gameloop() { if (_newPartyMapIndex != kM1_mapIndexNone) { processNewPartyMap(_newPartyMapIndex); - _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); + _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); _newPartyMapIndex = kM1_mapIndexNone; _eventMan->f357_discardAllInput(); } @@ -452,7 +452,7 @@ void DMEngine::gameloop() { if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_partyIsSleeping) { Box box(0, 223, 0, 135); _displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code) - _displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); + _displayMan->f128_drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); if (_setMousePointerToObjectInMainLoop) { _setMousePointerToObjectInMainLoop = false; _eventMan->f78_showMouse(); @@ -634,7 +634,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) { _eventMan->_g443_primaryKeyboardInput = nullptr; _eventMan->_g444_secondaryKeyboardInput = nullptr; if (doNotDrawCreditsOnly && !_gameWon) { - _sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY, k0_soundModePlayImmediately); + _sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, k0_soundModePlayImmediately); delay(240); } @@ -775,14 +775,14 @@ void DMEngine::drawEntrance() { byte *microDungeonCurrentMapData[32]; - _dungeonMan->_g309_partyMapIndex = k255_mapIndexEntrance; + _dungeonMan->_partyMapIndex = k255_mapIndexEntrance; _displayMan->_g297_drawFloorAndCeilingRequested = true; - _dungeonMan->_g273_currMapWidth = 5; - _dungeonMan->_g274_currMapHeight = 5; - _dungeonMan->_g271_currMapData = microDungeonCurrentMapData; + _dungeonMan->_currMapWidth = 5; + _dungeonMan->_currMapHeight = 5; + _dungeonMan->_currMapData = microDungeonCurrentMapData; Map map; // uninitialized, won't be used - _dungeonMan->_g269_currMap = ↦ + _dungeonMan->_currMap = ↦ Square microDungeonSquares[25]; for (uint16 i = 0; i < 25; ++i) microDungeonSquares[i] = Square(k0_ElementTypeWall, 0); @@ -969,29 +969,29 @@ void DMEngine::fuseSequnce() { _championMan->_party._fireShieldDefense = _championMan->_party._spellShieldDefense = _championMan->_party._shieldDefense = 100; _timeline->f260_timelineRefreshAllChampionStatusBoxes(); fuseSequenceUpdate(); - L1431_i_LordChaosMapX = _dungeonMan->_g306_partyMapX; - L1432_i_LordChaosMapY = _dungeonMan->_g307_partyMapY; - L1431_i_LordChaosMapX += _dirIntoStepCountEast[_dungeonMan->_g308_partyDir], L1432_i_LordChaosMapY += _dirIntoStepCountNorth[_dungeonMan->_g308_partyDir]; - L1428_ps_Group = (Group*)_dungeonMan->f156_getThingData(L1433_T_LordChaosThing = _groupMan->f175_groupGetThing(L1431_i_LordChaosMapX, L1432_i_LordChaosMapY)); + L1431_i_LordChaosMapX = _dungeonMan->_partyMapX; + L1432_i_LordChaosMapY = _dungeonMan->_partyMapY; + L1431_i_LordChaosMapX += _dirIntoStepCountEast[_dungeonMan->_partyDir], L1432_i_LordChaosMapY += _dirIntoStepCountNorth[_dungeonMan->_partyDir]; + L1428_ps_Group = (Group*)_dungeonMan->getThingData(L1433_T_LordChaosThing = _groupMan->f175_groupGetThing(L1431_i_LordChaosMapX, L1432_i_LordChaosMapY)); L1428_ps_Group->_health[0] = 10000; - _dungeonMan->f146_setGroupCells(L1428_ps_Group, k255_CreatureTypeSingleCenteredCreature, _dungeonMan->_g309_partyMapIndex); - _dungeonMan->f148_setGroupDirections(L1428_ps_Group, returnOppositeDir(_dungeonMan->_g308_partyDir), _dungeonMan->_g309_partyMapIndex); + _dungeonMan->setGroupCells(L1428_ps_Group, k255_CreatureTypeSingleCenteredCreature, _dungeonMan->_partyMapIndex); + _dungeonMan->setGroupDirections(L1428_ps_Group, returnOppositeDir(_dungeonMan->_partyDir), _dungeonMan->_partyMapIndex); AL1424_B_RemoveFluxcagesFromLoadChaosSquare = true; - AL1425_i_FluxcageMapX = _dungeonMan->_g306_partyMapX; - AL1426_i_FluxcageMapY = _dungeonMan->_g307_partyMapY; + AL1425_i_FluxcageMapX = _dungeonMan->_partyMapX; + AL1426_i_FluxcageMapY = _dungeonMan->_partyMapY; T0446002: - L1427_T_Thing = _dungeonMan->f162_getSquareFirstObject(AL1425_i_FluxcageMapX, AL1426_i_FluxcageMapY); + L1427_T_Thing = _dungeonMan->getSquareFirstObject(AL1425_i_FluxcageMapX, AL1426_i_FluxcageMapY); while (L1427_T_Thing != Thing::_endOfList) { if (L1427_T_Thing.getType() == k15_ExplosionThingType) { - L1429_ps_Explosion = (Explosion*)_dungeonMan->f156_getThingData(L1427_T_Thing); + L1429_ps_Explosion = (Explosion*)_dungeonMan->getThingData(L1427_T_Thing); if (L1429_ps_Explosion->getType() == k50_ExplosionType_Fluxcage) { - _dungeonMan->f164_unlinkThingFromList(L1427_T_Thing, Thing(0), AL1425_i_FluxcageMapX, AL1426_i_FluxcageMapY); + _dungeonMan->unlinkThingFromList(L1427_T_Thing, Thing(0), AL1425_i_FluxcageMapX, AL1426_i_FluxcageMapY); L1429_ps_Explosion->setNextThing(Thing::_none); goto T0446002; } } - L1427_T_Thing = _dungeonMan->f159_getNextThing(L1427_T_Thing); + L1427_T_Thing = _dungeonMan->getNextThing(L1427_T_Thing); } if (AL1424_B_RemoveFluxcagesFromLoadChaosSquare) { AL1424_B_RemoveFluxcagesFromLoadChaosSquare = false; @@ -1026,8 +1026,8 @@ T0446002: fuseSequenceUpdate(); _displayMan->_g77_doNotDrawFluxcagesDuringEndgame = true; fuseSequenceUpdate(); - for (AL1424_i_MapX = 0; AL1424_i_MapX < _dungeonMan->_g273_currMapWidth; AL1424_i_MapX++) { - for (AL1425_i_MapY = 0; AL1425_i_MapY < _dungeonMan->_g274_currMapHeight; AL1425_i_MapY++) { + for (AL1424_i_MapX = 0; AL1424_i_MapX < _dungeonMan->_currMapWidth; AL1424_i_MapX++) { + for (AL1425_i_MapY = 0; AL1425_i_MapY < _dungeonMan->_currMapHeight; AL1425_i_MapY++) { if (((L1427_T_Thing = _groupMan->f175_groupGetThing(AL1424_i_MapX, AL1425_i_MapY)) != Thing::_endOfList) && ((AL1424_i_MapX != L1431_i_LordChaosMapX) || (AL1425_i_MapY != L1432_i_LordChaosMapY))) { _groupMan->f189_delete(AL1424_i_MapX, AL1425_i_MapY); } @@ -1035,19 +1035,19 @@ T0446002: } fuseSequenceUpdate(); /* Count and get list of text things located at 0, 0 in the current map. Their text is then printed as messages in the order specified by their first letter (which is not printed) */ - L1427_T_Thing = _dungeonMan->f161_getSquareFirstThing(0, 0); + L1427_T_Thing = _dungeonMan->getSquareFirstThing(0, 0); AL1424_i_TextStringThingCount = 0; while (L1427_T_Thing != Thing::_endOfList) { if (L1427_T_Thing.getType() == k2_TextstringType) { L1435_aT_TextStringThings[AL1424_i_TextStringThingCount++] = L1427_T_Thing; } - L1427_T_Thing = _dungeonMan->f159_getNextThing(L1427_T_Thing); + L1427_T_Thing = _dungeonMan->getNextThing(L1427_T_Thing); } L1434_c_TextFirstCharacter = 'A'; AL1426_i_TextStringThingCount = AL1424_i_TextStringThingCount; while (AL1424_i_TextStringThingCount--) { for (AL1425_i_TextStringThingIndex = 0; AL1425_i_TextStringThingIndex < AL1426_i_TextStringThingCount; AL1425_i_TextStringThingIndex++) { - _dungeonMan->f168_decodeText(L1436_ac_String, L1435_aT_TextStringThings[AL1425_i_TextStringThingIndex], (TextType)(k1_TextTypeMessage | k0x8000_DecodeEvenIfInvisible)); + _dungeonMan->decodeText(L1436_ac_String, L1435_aT_TextStringThings[AL1425_i_TextStringThingIndex], (TextType)(k1_TextTypeMessage | k0x8000_DecodeEvenIfInvisible)); if (L1436_ac_String[1] == L1434_c_TextFirstCharacter) { _textMan->f43_messageAreaClearAllRows(); L1436_ac_String[1] = '\n'; /* New line */ @@ -1072,7 +1072,7 @@ T0446002: void DMEngine::fuseSequenceUpdate() { _timeline->f261_processTimeline(); - _displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); + _displayMan->f128_drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); _sound->f65_playPendingSound(); _eventMan->f357_discardAllInput(); _displayMan->updateScreen(); diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index ef4aa6adc5..5e06e57e90 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -70,7 +70,7 @@ CreatureInfo g243_CreatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic5 {25, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5}, {26, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5}}; -void DungeonMan::f150_mapCoordsAfterRelMovement(Direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) { +void DungeonMan::mapCoordsAfterRelMovement(Direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) { posX += _vm->_dirIntoStepCountEast[dir] * stepsForward; posY += _vm->_dirIntoStepCountNorth[dir] * stepsForward; turnDirRight(dir); @@ -388,59 +388,59 @@ void DungeonMan::setupArrays() { DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine) { _rawDunFileDataSize = 0; _rawDunFileData = nullptr; - _g282_dungeonColumCount = 0; - _g281_dungeonMapsFirstColumnIndex = nullptr; + _dungeonColumCount = 0; + _dungeonMapsFirstColumnIndex = nullptr; - _g282_dungeonColumCount = 0; - _g280_dungeonColumnsCumulativeSquareThingCount = nullptr; - _g283_squareFirstThings = nullptr; - _g260_dungeonTextData = nullptr; + _dungeonColumCount = 0; + _dungeonColumnsCumulativeSquareThingCount = nullptr; + _squareFirstThings = nullptr; + _dungeonTextData = nullptr; for (uint16 i = 0; i < 16; ++i) - _g284_thingData[i] = nullptr; - - _g279_dungeonMapData = nullptr; - _g308_partyDir = (Direction)0; - _g306_partyMapX = 0; - _g307_partyMapY = 0; - _g309_partyMapIndex = 0; - _g272_currMapIndex = kM1_mapIndexNone; - _g271_currMapData = nullptr; - _g269_currMap = nullptr; - _g273_currMapWidth = 0; - _g274_currMapHeight = 0; - _g270_currMapColCumulativeSquareFirstThingCount = nullptr; - _g277_dungeonMaps = nullptr; - _g276_dungeonRawMapData = nullptr; - _g265_currMapInscriptionWallOrnIndex = 0; + _thingData[i] = nullptr; + + _dungeonMapData = nullptr; + _partyDir = (Direction)0; + _partyMapX = 0; + _partyMapY = 0; + _partyMapIndex = 0; + _currMapIndex = kM1_mapIndexNone; + _currMapData = nullptr; + _currMap = nullptr; + _currMapWidth = 0; + _currMapHeight = 0; + _currMapColCumulativeSquareFirstThingCount = nullptr; + _dungeonMaps = nullptr; + _dungeonRawMapData = nullptr; + _currMapInscriptionWallOrnIndex = 0; for (uint16 i = 0; i < 6; ++i) - _g291_dungeonViewClickableBoxes[i].setToZero(); - _g286_isFacingAlcove = false; - _g287_isFacingViAltar = false; - _g288_isFacingFountain = false; - _g285_squareAheadElement = (ElementType)0; + _dungeonViewClickableBoxes[i].setToZero(); + _isFacingAlcove = false; + _isFacingViAltar = false; + _isFacingFountain = false; + _squareAheadElement = (ElementType)0; for (uint16 i = 0; i < 5; ++i) - _g292_pileTopObject[i] = Thing(0); + _pileTopObject[i] = Thing(0); for (uint16 i = 0; i < 2; ++i) - _g275_currMapDoorInfo[i].resetToZero(); + _currMapDoorInfo[i].resetToZero(); setupArrays(); } DungeonMan::~DungeonMan() { delete[] _rawDunFileData; - delete[] _g277_dungeonMaps; - delete[] _g281_dungeonMapsFirstColumnIndex; - delete[] _g280_dungeonColumnsCumulativeSquareThingCount; - delete[] _g283_squareFirstThings; - delete[] _g260_dungeonTextData; - delete[] _g279_dungeonMapData; + delete[] _dungeonMaps; + delete[] _dungeonMapsFirstColumnIndex; + delete[] _dungeonColumnsCumulativeSquareThingCount; + delete[] _squareFirstThings; + delete[] _dungeonTextData; + delete[] _dungeonMapData; for (uint16 i = 0; i < 16; ++i) - delete[] _g284_thingData[i]; + delete[] _thingData[i]; - delete[] _g276_dungeonRawMapData; + delete[] _dungeonRawMapData; } -void DungeonMan::f455_decompressDungeonFile() { +void DungeonMan::decompressDungeonFile() { Common::File f; f.open("Dungeon.dat"); if (f.readUint16BE() == 0x8104) { // if dungeon is compressed @@ -537,7 +537,7 @@ const Thing Thing::_explRebirthStep1(0xFFE4); // @ C0xFFE4_THING_EXPLOSION_REBIR const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2 const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY -void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { +void DungeonMan::loadDungeonFile(Common::InSaveFile *file) { static const byte additionalThingCounts[16] = { // @ G0236_auc_Graphic559_AdditionalThingCounts{ 0, /* Door */ 0, /* Teleporter */ @@ -558,7 +558,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { }; if (_vm->_newGameFl) - f455_decompressDungeonFile(); + decompressDungeonFile(); Common::ReadStream *dunDataStream = nullptr; if (file) { @@ -571,114 +571,114 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { } // initialize _g278_dungeonFileHeader - _g278_dungeonFileHeader._ornamentRandomSeed = dunDataStream->readUint16BE(); - _g278_dungeonFileHeader._rawMapDataSize = dunDataStream->readUint16BE(); - _g278_dungeonFileHeader._mapCount = dunDataStream->readByte(); + _dungeonFileHeader._ornamentRandomSeed = dunDataStream->readUint16BE(); + _dungeonFileHeader._rawMapDataSize = dunDataStream->readUint16BE(); + _dungeonFileHeader._mapCount = dunDataStream->readByte(); dunDataStream->readByte(); // discard 1 byte - _g278_dungeonFileHeader._textDataWordCount = dunDataStream->readUint16BE(); - _g278_dungeonFileHeader._partyStartLocation = dunDataStream->readUint16BE(); - _g278_dungeonFileHeader._squareFirstThingCount = dunDataStream->readUint16BE(); + _dungeonFileHeader._textDataWordCount = dunDataStream->readUint16BE(); + _dungeonFileHeader._partyStartLocation = dunDataStream->readUint16BE(); + _dungeonFileHeader._squareFirstThingCount = dunDataStream->readUint16BE(); for (uint16 i = 0; i < k16_ThingTypeTotal; ++i) - _g278_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE(); + _dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE(); // init party position and mapindex if (_vm->_newGameFl) { - uint16 startLoc = _g278_dungeonFileHeader._partyStartLocation; - _g308_partyDir = (Direction)((startLoc >> 10) & 3); - _g306_partyMapX = startLoc & 0x1F; - _g307_partyMapY = (startLoc >> 5) & 0x1F; - _g309_partyMapIndex = 0; + uint16 startLoc = _dungeonFileHeader._partyStartLocation; + _partyDir = (Direction)((startLoc >> 10) & 3); + _partyMapX = startLoc & 0x1F; + _partyMapY = (startLoc >> 5) & 0x1F; + _partyMapIndex = 0; } // load map data if (!_vm->_restartGameRequest) { - delete[] _g277_dungeonMaps; - _g277_dungeonMaps = new Map[_g278_dungeonFileHeader._mapCount]; + delete[] _dungeonMaps; + _dungeonMaps = new Map[_dungeonFileHeader._mapCount]; } - for (uint16 i = 0; i < _g278_dungeonFileHeader._mapCount; ++i) { - _g277_dungeonMaps[i]._rawDunDataOffset = dunDataStream->readUint16BE(); + for (uint16 i = 0; i < _dungeonFileHeader._mapCount; ++i) { + _dungeonMaps[i]._rawDunDataOffset = dunDataStream->readUint16BE(); dunDataStream->readUint32BE(); // discard 4 bytes - _g277_dungeonMaps[i]._offsetMapX = dunDataStream->readByte(); - _g277_dungeonMaps[i]._offsetMapY = dunDataStream->readByte(); + _dungeonMaps[i]._offsetMapX = dunDataStream->readByte(); + _dungeonMaps[i]._offsetMapY = dunDataStream->readByte(); uint16 tmp = dunDataStream->readUint16BE(); - _g277_dungeonMaps[i]._height = tmp >> 11; - _g277_dungeonMaps[i]._width = (tmp >> 6) & 0x1F; - _g277_dungeonMaps[i]._level = tmp & 0x3F; // Only used in DMII + _dungeonMaps[i]._height = tmp >> 11; + _dungeonMaps[i]._width = (tmp >> 6) & 0x1F; + _dungeonMaps[i]._level = tmp & 0x3F; // Only used in DMII tmp = dunDataStream->readUint16BE(); - _g277_dungeonMaps[i]._randFloorOrnCount = tmp >> 12; - _g277_dungeonMaps[i]._floorOrnCount = (tmp >> 8) & 0xF; - _g277_dungeonMaps[i]._randWallOrnCount = (tmp >> 4) & 0xF; - _g277_dungeonMaps[i]._wallOrnCount = tmp & 0xF; + _dungeonMaps[i]._randFloorOrnCount = tmp >> 12; + _dungeonMaps[i]._floorOrnCount = (tmp >> 8) & 0xF; + _dungeonMaps[i]._randWallOrnCount = (tmp >> 4) & 0xF; + _dungeonMaps[i]._wallOrnCount = tmp & 0xF; tmp = dunDataStream->readUint16BE(); - _g277_dungeonMaps[i]._difficulty = tmp >> 12; - _g277_dungeonMaps[i]._creatureTypeCount = (tmp >> 4) & 0xF; - _g277_dungeonMaps[i]._doorOrnCount = tmp & 0xF; + _dungeonMaps[i]._difficulty = tmp >> 12; + _dungeonMaps[i]._creatureTypeCount = (tmp >> 4) & 0xF; + _dungeonMaps[i]._doorOrnCount = tmp & 0xF; tmp = dunDataStream->readUint16BE(); - _g277_dungeonMaps[i]._doorSet1 = (tmp >> 12) & 0xF; - _g277_dungeonMaps[i]._doorSet0 = (tmp >> 8) & 0xF; - _g277_dungeonMaps[i]._wallSet = (WallSet)((tmp >> 4) & 0xF); - _g277_dungeonMaps[i]._floorSet = (FloorSet)(tmp & 0xF); + _dungeonMaps[i]._doorSet1 = (tmp >> 12) & 0xF; + _dungeonMaps[i]._doorSet0 = (tmp >> 8) & 0xF; + _dungeonMaps[i]._wallSet = (WallSet)((tmp >> 4) & 0xF); + _dungeonMaps[i]._floorSet = (FloorSet)(tmp & 0xF); } // load column stuff thingy if (!_vm->_restartGameRequest) { - delete[] _g281_dungeonMapsFirstColumnIndex; - _g281_dungeonMapsFirstColumnIndex = new uint16[_g278_dungeonFileHeader._mapCount]; + delete[] _dungeonMapsFirstColumnIndex; + _dungeonMapsFirstColumnIndex = new uint16[_dungeonFileHeader._mapCount]; } uint16 columCount = 0; - for (uint16 i = 0; i < _g278_dungeonFileHeader._mapCount; ++i) { - _g281_dungeonMapsFirstColumnIndex[i] = columCount; - columCount += _g277_dungeonMaps[i]._width + 1; + for (uint16 i = 0; i < _dungeonFileHeader._mapCount; ++i) { + _dungeonMapsFirstColumnIndex[i] = columCount; + columCount += _dungeonMaps[i]._width + 1; } - _g282_dungeonColumCount = columCount; + _dungeonColumCount = columCount; - uint32 actualSquareFirstThingCount = _g278_dungeonFileHeader._squareFirstThingCount; + uint32 actualSquareFirstThingCount = _dungeonFileHeader._squareFirstThingCount; if (_vm->_newGameFl) - _g278_dungeonFileHeader._squareFirstThingCount += 300; + _dungeonFileHeader._squareFirstThingCount += 300; if (!_vm->_restartGameRequest) { - delete[] _g280_dungeonColumnsCumulativeSquareThingCount; - _g280_dungeonColumnsCumulativeSquareThingCount = new uint16[columCount]; + delete[] _dungeonColumnsCumulativeSquareThingCount; + _dungeonColumnsCumulativeSquareThingCount = new uint16[columCount]; } for (uint16 i = 0; i < columCount; ++i) - _g280_dungeonColumnsCumulativeSquareThingCount[i] = dunDataStream->readUint16BE(); + _dungeonColumnsCumulativeSquareThingCount[i] = dunDataStream->readUint16BE(); // load square first things if (!_vm->_restartGameRequest) { - delete[] _g283_squareFirstThings; - _g283_squareFirstThings = new Thing[_g278_dungeonFileHeader._squareFirstThingCount]; + delete[] _squareFirstThings; + _squareFirstThings = new Thing[_dungeonFileHeader._squareFirstThingCount]; } for (uint16 i = 0; i < actualSquareFirstThingCount; ++i) - _g283_squareFirstThings[i].set(dunDataStream->readUint16BE()); + _squareFirstThings[i].set(dunDataStream->readUint16BE()); if (_vm->_newGameFl) { for (uint16 i = 0; i < 300; ++i) - _g283_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none; + _squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none; } // load text data if (!_vm->_restartGameRequest) { - delete[] _g260_dungeonTextData; - _g260_dungeonTextData = new uint16[_g278_dungeonFileHeader._textDataWordCount]; + delete[] _dungeonTextData; + _dungeonTextData = new uint16[_dungeonFileHeader._textDataWordCount]; } - for (uint16 i = 0; i < _g278_dungeonFileHeader._textDataWordCount; ++i) - _g260_dungeonTextData[i] = dunDataStream->readUint16BE(); + for (uint16 i = 0; i < _dungeonFileHeader._textDataWordCount; ++i) + _dungeonTextData[i] = dunDataStream->readUint16BE(); if (_vm->_newGameFl) _vm->_timeline->_g369_eventMaxCount = 100; // load things for (uint16 thingType = k0_DoorThingType; thingType < k16_ThingTypeTotal; ++thingType) { - uint16 thingCount = _g278_dungeonFileHeader._thingCounts[thingType]; + uint16 thingCount = _dungeonFileHeader._thingCounts[thingType]; if (_vm->_newGameFl) - _g278_dungeonFileHeader._thingCounts[thingType] = MIN((thingType == k15_ExplosionThingType) ? 768 : 1024, thingCount + additionalThingCounts[thingType]); + _dungeonFileHeader._thingCounts[thingType] = MIN((thingType == k15_ExplosionThingType) ? 768 : 1024, thingCount + additionalThingCounts[thingType]); uint16 thingStoreWordCount = g235_ThingDataWordCount[thingType]; @@ -686,13 +686,13 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { continue; if (!_vm->_restartGameRequest) { - delete[] _g284_thingData[thingType]; - _g284_thingData[thingType] = new uint16[_g278_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount]; + delete[] _thingData[thingType]; + _thingData[thingType] = new uint16[_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount]; } if ((thingType == k4_GroupThingType || thingType == k14_ProjectileThingType) && !file) { // !file because save files have diff. structure than dungeon.dat for (uint16 i = 0; i < thingCount; ++i) { - uint16 *nextSlot = _g284_thingData[thingType] + i *thingStoreWordCount; + uint16 *nextSlot = _thingData[thingType] + i *thingStoreWordCount; for (uint16 j = 0; j < thingStoreWordCount; ++j) { if (j == 2 || j == 3) nextSlot[j] = dunDataStream->readByte(); @@ -702,7 +702,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { } } else { for (uint16 i = 0; i < thingCount; ++i) { - uint16 *nextSlot = _g284_thingData[thingType] + i *thingStoreWordCount; + uint16 *nextSlot = _thingData[thingType] + i *thingStoreWordCount; for (uint16 j = 0; j < thingStoreWordCount; ++j) nextSlot[j] = dunDataStream->readUint16BE(); } @@ -710,33 +710,33 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { if (_vm->_newGameFl) { if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType) - _vm->_timeline->_g369_eventMaxCount += _g278_dungeonFileHeader._thingCounts[thingType]; + _vm->_timeline->_g369_eventMaxCount += _dungeonFileHeader._thingCounts[thingType]; for (uint16 i = 0; i < additionalThingCounts[thingType]; ++i) - (_g284_thingData[thingType] + (thingCount + i) * thingStoreWordCount)[0] = Thing::_none.toUint16(); + (_thingData[thingType] + (thingCount + i) * thingStoreWordCount)[0] = Thing::_none.toUint16(); } } // load map data if (!_vm->_restartGameRequest) { - delete[] _g276_dungeonRawMapData; - _g276_dungeonRawMapData = new byte[_g278_dungeonFileHeader._rawMapDataSize]; + delete[] _dungeonRawMapData; + _dungeonRawMapData = new byte[_dungeonFileHeader._rawMapDataSize]; } - for (uint32 i = 0; i < _g278_dungeonFileHeader._rawMapDataSize; ++i) - _g276_dungeonRawMapData[i] = dunDataStream->readByte(); + for (uint32 i = 0; i < _dungeonFileHeader._rawMapDataSize; ++i) + _dungeonRawMapData[i] = dunDataStream->readByte(); if (!_vm->_restartGameRequest) { - uint8 mapCount = _g278_dungeonFileHeader._mapCount; - delete[] _g279_dungeonMapData; - _g279_dungeonMapData = new byte**[_g282_dungeonColumCount + mapCount]; - byte **colFirstSquares = (byte**)_g279_dungeonMapData + mapCount; + uint8 mapCount = _dungeonFileHeader._mapCount; + delete[] _dungeonMapData; + _dungeonMapData = new byte**[_dungeonColumCount + mapCount]; + byte **colFirstSquares = (byte**)_dungeonMapData + mapCount; for (uint8 i = 0; i < mapCount; ++i) { - _g279_dungeonMapData[i] = colFirstSquares; - byte *square = _g276_dungeonRawMapData + _g277_dungeonMaps[i]._rawDunDataOffset; + _dungeonMapData[i] = colFirstSquares; + byte *square = _dungeonRawMapData + _dungeonMaps[i]._rawDunDataOffset; *colFirstSquares++ = square; - for (uint16 w = 1; w <= _g277_dungeonMaps[i]._width; ++w) { - square += _g277_dungeonMaps[i]._height + 1; + for (uint16 w = 1; w <= _dungeonMaps[i]._width; ++w) { + square += _dungeonMaps[i]._height + 1; *colFirstSquares++ = square; } } @@ -747,7 +747,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) { } // the deletion of the function parameter 'file' happens elsewhere } -void DungeonMan::f173_setCurrentMap(uint16 mapIndex) { +void DungeonMan::setCurrentMap(uint16 mapIndex) { static const DoorInfo doorInfo[4] = { // @ G0254_as_Graphic559_DoorInfo /* { Attributes, Defense } */ DoorInfo(3, 110), /* Door type 0 Portcullis */ @@ -757,76 +757,76 @@ void DungeonMan::f173_setCurrentMap(uint16 mapIndex) { }; - _g272_currMapIndex = mapIndex; - _g271_currMapData = _g279_dungeonMapData[mapIndex]; - _g269_currMap = _g277_dungeonMaps + mapIndex; - _g273_currMapWidth = _g277_dungeonMaps[mapIndex]._width + 1; - _g274_currMapHeight = _g277_dungeonMaps[mapIndex]._height + 1; - _g275_currMapDoorInfo[0] = doorInfo[_g269_currMap->_doorSet0]; - _g275_currMapDoorInfo[1] = doorInfo[_g269_currMap->_doorSet1]; - _g270_currMapColCumulativeSquareFirstThingCount = &_g280_dungeonColumnsCumulativeSquareThingCount[_g281_dungeonMapsFirstColumnIndex[mapIndex]]; + _currMapIndex = mapIndex; + _currMapData = _dungeonMapData[mapIndex]; + _currMap = _dungeonMaps + mapIndex; + _currMapWidth = _dungeonMaps[mapIndex]._width + 1; + _currMapHeight = _dungeonMaps[mapIndex]._height + 1; + _currMapDoorInfo[0] = doorInfo[_currMap->_doorSet0]; + _currMapDoorInfo[1] = doorInfo[_currMap->_doorSet1]; + _currMapColCumulativeSquareFirstThingCount = &_dungeonColumnsCumulativeSquareThingCount[_dungeonMapsFirstColumnIndex[mapIndex]]; } -void DungeonMan::f174_setCurrentMapAndPartyMap(uint16 mapIndex) { - f173_setCurrentMap(_g309_partyMapIndex = mapIndex); +void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) { + setCurrentMap(_partyMapIndex = mapIndex); - byte *metaMapData = _g271_currMapData[_g273_currMapWidth - 1] + _g274_currMapHeight; + byte *metaMapData = _currMapData[_currMapWidth - 1] + _currMapHeight; _vm->_displayMan->_g264_currMapAllowedCreatureTypes = metaMapData; - metaMapData += _g269_currMap->_creatureTypeCount; + metaMapData += _currMap->_creatureTypeCount; - memcpy(_vm->_displayMan->_g261_currMapWallOrnIndices, metaMapData, _g269_currMap->_wallOrnCount); - metaMapData += _g269_currMap->_wallOrnCount; + memcpy(_vm->_displayMan->_g261_currMapWallOrnIndices, metaMapData, _currMap->_wallOrnCount); + metaMapData += _currMap->_wallOrnCount; - memcpy(_vm->_displayMan->_g262_currMapFloorOrnIndices, metaMapData, _g269_currMap->_floorOrnCount); - metaMapData += _g269_currMap->_floorOrnCount; + memcpy(_vm->_displayMan->_g262_currMapFloorOrnIndices, metaMapData, _currMap->_floorOrnCount); + metaMapData += _currMap->_floorOrnCount; - memcpy(_vm->_displayMan->_g263_currMapDoorOrnIndices, metaMapData, _g269_currMap->_doorOrnCount); + memcpy(_vm->_displayMan->_g263_currMapDoorOrnIndices, metaMapData, _currMap->_doorOrnCount); - _g265_currMapInscriptionWallOrnIndex = _g269_currMap->_wallOrnCount; - _vm->_displayMan->_g261_currMapWallOrnIndices[_g265_currMapInscriptionWallOrnIndex] = k0_WallOrnInscription; + _currMapInscriptionWallOrnIndex = _currMap->_wallOrnCount; + _vm->_displayMan->_g261_currMapWallOrnIndices[_currMapInscriptionWallOrnIndex] = k0_WallOrnInscription; } -Square DungeonMan::f151_getSquare(int16 mapX, int16 mapY) { - bool isMapYInBounds = (mapY >= 0) && (mapY < _g274_currMapHeight); - bool isMapXInBounds = (mapX >= 0) && (mapX < _g273_currMapWidth); +Square DungeonMan::getSquare(int16 mapX, int16 mapY) { + bool isMapYInBounds = (mapY >= 0) && (mapY < _currMapHeight); + bool isMapXInBounds = (mapX >= 0) && (mapX < _currMapWidth); if (isMapXInBounds && isMapYInBounds) - return Square(_g271_currMapData[mapX][mapY]); + return Square(_currMapData[mapX][mapY]); if (isMapYInBounds) { - SquareType squareType = Square(_g271_currMapData[0][mapY]).getType(); + SquareType squareType = Square(_currMapData[0][mapY]).getType(); if (((mapX == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0004_WallEastRandOrnAllowed); - squareType = Square(_g271_currMapData[_g273_currMapWidth - 1][mapY]).getType(); - if (((mapX == _g273_currMapWidth) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) + squareType = Square(_currMapData[_currMapWidth - 1][mapY]).getType(); + if (((mapX == _currMapWidth) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0001_WallWestRandOrnAllowed); } else if (isMapXInBounds) { - SquareType squareType = Square(_g271_currMapData[mapX][0]).getType(); + SquareType squareType = Square(_currMapData[mapX][0]).getType(); if (((mapY == -1) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0002_WallSouthRandOrnAllowed); - squareType = Square(_g271_currMapData[mapX][_g274_currMapHeight - 1]).getType(); - if (((mapY == _g274_currMapHeight) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) + squareType = Square(_currMapData[mapX][_currMapHeight - 1]).getType(); + if (((mapY == _currMapHeight) && (squareType == k1_CorridorElemType)) || (squareType == k2_PitElemType)) return Square(k0_ElementTypeWall, k0x0008_WallNorthRandOrnAllowed); } return Square(k0_ElementTypeWall, 0); } -Square DungeonMan::f152_getRelSquare(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { - f150_mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY); - return f151_getSquare(posX, posY); +Square DungeonMan::getRelSquare(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { + mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY); + return getSquare(posX, posY); } -int16 DungeonMan::f160_getSquareFirstThingIndex(int16 mapX, int16 mapY) { - unsigned char *curSquare = _g271_currMapData[mapX]; - if ((mapX < 0) || (mapX >= _g273_currMapWidth) || (mapY < 0) || (mapY >= _g274_currMapHeight) || !getFlag(curSquare[mapY], k0x0010_ThingListPresent)) +int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) { + unsigned char *curSquare = _currMapData[mapX]; + if ((mapX < 0) || (mapX >= _currMapWidth) || (mapY < 0) || (mapY >= _currMapHeight) || !getFlag(curSquare[mapY], k0x0010_ThingListPresent)) return -1; int16 curMapY = 0; - uint16 thingIndex = _g270_currMapColCumulativeSquareFirstThingCount[mapX]; + uint16 thingIndex = _currMapColCumulativeSquareFirstThingCount[mapX]; while (curMapY++ != mapY) { if (getFlag(*curSquare++, k0x0010_ThingListPresent)) thingIndex++; @@ -834,14 +834,14 @@ int16 DungeonMan::f160_getSquareFirstThingIndex(int16 mapX, int16 mapY) { return thingIndex; } -Thing DungeonMan::f161_getSquareFirstThing(int16 mapX, int16 mapY) { - int16 index = f160_getSquareFirstThingIndex(mapX, mapY); +Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) { + int16 index = getSquareFirstThingIndex(mapX, mapY); if (index == -1) return Thing::_endOfList; - return _g283_squareFirstThings[index]; + return _squareFirstThings[index]; } -void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY) { +void DungeonMan::setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY) { unsigned char L0307_uc_Multiple; #define AL0307_uc_Square L0307_uc_Multiple #define AL0307_uc_FootprintsAllowed L0307_uc_Multiple @@ -850,8 +850,8 @@ void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16 for (uint16 i = 0; i < 5; ++i) aspectArray[i] = 0; - Thing curThing = f161_getSquareFirstThing(mapX, mapY); - AL0307_uc_Square = f151_getSquare(mapX, mapY).toByte(); + Thing curThing = getSquareFirstThing(mapX, mapY); + AL0307_uc_Square = getSquare(mapX, mapY).toByte(); bool leftRandomWallOrnamentAllowed = false; bool rightRandomWallOrnamentAllowed = false; bool frontRandomWallOrnamentAllowed = false; @@ -887,27 +887,27 @@ void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16 _vm->_displayMan->_g289_championPortraitOrdinal = 0; squareIsFakeWall = false; T0172010_ClosedFakeWall: - f171_setSquareAspectOrnOrdinals(aspectArray, leftRandomWallOrnamentAllowed, frontRandomWallOrnamentAllowed, rightRandomWallOrnamentAllowed, dir, mapX, mapY, squareIsFakeWall); + setSquareAspectOrnOrdinals(aspectArray, leftRandomWallOrnamentAllowed, frontRandomWallOrnamentAllowed, rightRandomWallOrnamentAllowed, dir, mapX, mapY, squareIsFakeWall); while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) { ThingType curThingType = curThing.getType(); int16 AL0310_i_SideIndex = normalizeModulo4(curThing.getCell() - dir); if (AL0310_i_SideIndex) { /* Invisible on the back wall if 0 */ - Sensor *curSensor = (Sensor*)f156_getThingData(curThing); + Sensor *curSensor = (Sensor*)getThingData(curThing); if (curThingType == k2_TextstringType) { if (((TextString*)curSensor)->isVisible()) { - aspectArray[AL0310_i_SideIndex + 1] = _g265_currMapInscriptionWallOrnIndex + 1; + aspectArray[AL0310_i_SideIndex + 1] = _currMapInscriptionWallOrnIndex + 1; _vm->_displayMan->_g290_inscriptionThing = curThing; /* BUG0_76 The same text is drawn on multiple sides of a wall square. The engine stores only a single text to draw on a wall in a global variable. Even if different texts are placed on different sides of the wall, the same text is drawn on each affected side */ } } else { - aspectArray[AL0310_i_SideIndex + 1] = curSensor->getOrnOrdinal(); + aspectArray[AL0310_i_SideIndex + 1] = curSensor->getAttrOrnOrdinal(); if (curSensor->getType() == k127_SensorWallChampionPortrait) { _vm->_displayMan->_g289_championPortraitOrdinal = _vm->indexToOrdinal(curSensor->getData()); } } } - curThing = f159_getNextThing(curThing); + curThing = getNextThing(curThing); } - if (squareIsFakeWall && (_g306_partyMapX != mapX) && (_g307_partyMapY != mapY)) { + if (squareIsFakeWall && (_partyMapX != mapX) && (_partyMapY != mapY)) { aspectArray[k1_FirstGroupOrObjectAspect] = Thing::_endOfList.toUint16(); return; } @@ -926,7 +926,7 @@ T0172010_ClosedFakeWall: case k2_ElementTypePit: case k5_ElementTypeTeleporter: if (aspectArray[k0_ElementAspect] == k1_CorridorElemType) { - aspectArray[k4_FloorOrnOrdAspect] = f170_getRandomOrnOrdinal(getFlag(AL0307_uc_Square, k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30); + aspectArray[k4_FloorOrnOrdAspect] = getRandomOrnOrdinal(getFlag(AL0307_uc_Square, k0x0008_CorridorRandOrnAllowed), _currMap->_randFloorOrnCount, mapX, mapY, 30); AL0307_uc_FootprintsAllowed = true; } else if (aspectArray[k0_ElementAspect] == k2_ElementTypePit) { if (getFlag(AL0307_uc_Square, k0x0008_PitOpen)) { @@ -943,10 +943,10 @@ T0172010_ClosedFakeWall: while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) { if (curThing.getType() == k3_SensorThingType) { - Sensor *curSensor = (Sensor*)f156_getThingData(curThing); - aspectArray[k4_FloorOrnOrdAspect] = curSensor->getOrnOrdinal(); + Sensor *curSensor = (Sensor*)getThingData(curThing); + aspectArray[k4_FloorOrnOrdAspect] = curSensor->getAttrOrnOrdinal(); } - curThing = f159_getNextThing(curThing); + curThing = getNextThing(curThing); } if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) @@ -958,7 +958,7 @@ T0172010_ClosedFakeWall: aspectArray[k2_StairsUpAspect] = getFlag(AL0307_uc_Square, k0x0004_StairsUp); AL0307_uc_FootprintsAllowed = false; while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) - curThing = f159_getNextThing(curThing); + curThing = getNextThing(curThing); break; case k4_DoorElemType: if (bool((getFlag(AL0307_uc_Square, k0x0008_DoorNorthSouthOrient) >> 3)) == isOrientedWestEast(dir)) { @@ -966,12 +966,12 @@ T0172010_ClosedFakeWall: } else { aspectArray[k0_ElementAspect] = k17_DoorFrontElemType; aspectArray[k2_DoorStateAspect] = Square(AL0307_uc_Square).getDoorState(); - aspectArray[k3_DoorThingIndexAspect] = f161_getSquareFirstThing(mapX, mapY).getIndex(); + aspectArray[k3_DoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex(); } AL0307_uc_FootprintsAllowed = true; while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) - curThing = f159_getNextThing(curThing); + curThing = getNextThing(curThing); if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY)) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); @@ -980,23 +980,23 @@ T0172010_ClosedFakeWall: aspectArray[k1_FirstGroupOrObjectAspect] = curThing.toUint16(); } -void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir, +void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir, int16 mapX, int16 mapY, bool isFakeWall) { - int16 randomWallOrnamentCount = _g269_currMap->_randWallOrnCount; - aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (normalizeModulo4(++dir) + 1), 30); - aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (normalizeModulo4(++dir) + 1), 30); - aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (normalizeModulo4(++dir) + 1), 30); - if (isFakeWall || (mapX < 0) || (mapX >= _g273_currMapWidth) || (mapY < 0) || (mapY >= _g274_currMapHeight)) { /* If square is a fake wall or is out of map bounds */ + int16 randomWallOrnamentCount = _currMap->_randWallOrnCount; + aspectArray[k2_RightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (normalizeModulo4(++dir) + 1), 30); + aspectArray[k3_FrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (normalizeModulo4(++dir) + 1), 30); + aspectArray[k4_LeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (normalizeModulo4(++dir) + 1), 30); + if (isFakeWall || (mapX < 0) || (mapX >= _currMapWidth) || (mapY < 0) || (mapY >= _currMapHeight)) { /* If square is a fake wall or is out of map bounds */ for (int16 sideIndex = k2_RightWallOrnOrdAspect; sideIndex <= k4_LeftWallOrnOrdAspect; sideIndex++) { /* Loop to remove any random ornament that is an alcove */ - if (f149_isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[sideIndex]))) + if (isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[sideIndex]))) aspectArray[sideIndex] = 0; } } } -int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) { - int16 randomOrnamentIndex = f169_getRandomOrnamentIndex((int16)2000 + (mapX << 5) + mapY, (int16)3000 + (_g272_currMapIndex << (int16)6) + _g273_currMapWidth + _g274_currMapHeight, modulo); +int16 DungeonMan::getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) { + int16 randomOrnamentIndex = getRandomOrnamentIndex((int16)2000 + (mapX << 5) + mapY, (int16)3000 + (_currMapIndex << (int16)6) + _currMapWidth + _currMapHeight, modulo); if (allowed && (randomOrnamentIndex < count)) return _vm->indexToOrdinal(randomOrnamentIndex); @@ -1005,7 +1005,7 @@ int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX } -bool DungeonMan::f149_isWallOrnAnAlcove(int16 wallOrnIndex) { +bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) { if (wallOrnIndex >= 0) { for (uint16 i = 0; i < k3_AlcoveOrnCount; ++i) { if (_vm->_displayMan->_g267_currMapAlcoveOrnIndices[i] == wallOrnIndex) @@ -1016,19 +1016,19 @@ bool DungeonMan::f149_isWallOrnAnAlcove(int16 wallOrnIndex) { return false; } -uint16 *DungeonMan::f156_getThingData(Thing thing) { - return _g284_thingData[thing.getType()] + thing.getIndex() * g235_ThingDataWordCount[thing.getType()]; +uint16 *DungeonMan::getThingData(Thing thing) { + return _thingData[thing.getType()] + thing.getIndex() * g235_ThingDataWordCount[thing.getType()]; } -uint16* DungeonMan::f157_getSquareFirstThingData(int16 mapX, int16 mapY) { - return f156_getThingData(f161_getSquareFirstThing(mapX, mapY)); +uint16* DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) { + return getThingData(getSquareFirstThing(mapX, mapY)); } -Thing DungeonMan::f159_getNextThing(Thing thing) { - return Thing(f156_getThingData(thing)[0]); +Thing DungeonMan::getNextThing(Thing thing) { + return Thing(getThingData(thing)[0]); } -void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) { +void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { static char messageAndScrollEscReplacementStrings[32][8] = { // @ G0255_aac_Graphic559_MessageAndScrollEscapeReplacementStrings {'x', 0, 0, 0, 0, 0, 0, 0}, /* Atari ST Version 1.0 1987-12-08 1987-12-11 1.1 1.2EN 1.2GE: { '?', 0, 0, 0, 0, 0, 0, 0 }, */ {'y', 0, 0, 0, 0, 0, 0, 0}, /* Atari ST Version 1.0 1987-12-08 1987-12-11 1.1 1.2EN 1.2GE: { '!', 0, 0, 0, 0, 0, 0, 0 }, */ @@ -1110,7 +1110,7 @@ void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) { {0, 0, 0, 0, 0, 0, 0, 0} }; - TextString textString(_g284_thingData[k2_TextstringType] + thing.getIndex() * g235_ThingDataWordCount[k2_TextstringType]); + TextString textString(_thingData[k2_TextstringType] + thing.getIndex() * g235_ThingDataWordCount[k2_TextstringType]); if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) { type = (TextType)(type & ~k0x8000_DecodeEvenIfInvisible); char sepChar; @@ -1124,7 +1124,7 @@ void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) { } uint16 codeCounter = 0; int16 escChar = 0; - uint16 *codeWord = _g260_dungeonTextData + textString.getWordOffset(); + uint16 *codeWord = _dungeonTextData + textString.getWordOffset(); uint16 code = 0, codes = 0; char *escReplString = nullptr; for (;;) { /*infinite loop*/ @@ -1173,8 +1173,8 @@ void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) { *destString = ((type == k0_TextTypeInscription) ? 0x81 : '\0'); } -Thing DungeonMan::f166_getUnusedThing(uint16 thingType) { - int16 thingCount = _g278_dungeonFileHeader._thingCounts[getFlag(thingType, k0x7FFF_thingType)]; +Thing DungeonMan::getUnusedThing(uint16 thingType) { + int16 thingCount = _dungeonFileHeader._thingCounts[getFlag(thingType, k0x7FFF_thingType)]; if (thingType == (k0x8000_championBones | k10_JunkThingType)) { thingType = k10_JunkThingType; } else if (thingType == k10_JunkThingType) @@ -1182,7 +1182,7 @@ Thing DungeonMan::f166_getUnusedThing(uint16 thingType) { int16 thingIdx = thingCount; int16 thingDataByteCount = g235_ThingDataWordCount[thingType] >> 1; - Thing *thingPtr = (Thing *)_g284_thingData[thingType]; + Thing *thingPtr = (Thing *)_thingData[thingType]; Thing curThing; for (;;) { /*_Infinite loop_*/ @@ -1193,11 +1193,11 @@ Thing DungeonMan::f166_getUnusedThing(uint16 thingType) { if (--thingIdx) { /* If there are thing data left to process */ thingPtr += thingDataByteCount; /* Proceed to the next thing data */ } else { - curThing = f165_getDiscardThing(thingType); + curThing = getDiscardThing(thingType); if (curThing == Thing::_none) return Thing::_none; - thingPtr = (Thing *)f156_getThingData(curThing); + thingPtr = (Thing *)getThingData(curThing); break; } } @@ -1207,7 +1207,7 @@ Thing DungeonMan::f166_getUnusedThing(uint16 thingType) { return curThing; } -uint16 DungeonMan::f140_getObjectWeight(Thing thing) { +uint16 DungeonMan::getObjectWeight(Thing thing) { static const uint16 junkInfo[] = { // @ G0241_auc_Graphic559_JunkInfo // COMPASS - WATERSKIN - JEWEL SYMAL - ILLUMULET - ASHES 1, 3, 2, 2, 4, @@ -1239,7 +1239,7 @@ uint16 DungeonMan::f140_getObjectWeight(Thing thing) { // Initialization is not present in original // Set to 0 by default as it's the default value used for Thing::_none uint16 weight = 0; - Junk *junk = (Junk *)f156_getThingData(thing); + Junk *junk = (Junk *)getThingData(thing); switch (thing.getType()) { case k5_WeaponThingType: @@ -1258,8 +1258,8 @@ uint16 DungeonMan::f140_getObjectWeight(Thing thing) { weight = 50; thing = ((Container*)junk)->getSlot(); while (thing != Thing::_endOfList) { - weight += f140_getObjectWeight(thing); - thing = f159_getNextThing(thing); + weight += getObjectWeight(thing); + thing = getNextThing(thing); } break; case k8_PotionThingType: @@ -1278,8 +1278,8 @@ uint16 DungeonMan::f140_getObjectWeight(Thing thing) { return weight; // this is garbage if none of the branches were taken } -int16 DungeonMan::f141_getObjectInfoIndex(Thing thing) { - uint16 *rawType = f156_getThingData(thing); +int16 DungeonMan::getObjectInfoIndex(Thing thing) { + uint16 *rawType = getThingData(thing); switch (thing.getType()) { case k7_ScrollThingType: return k0_ObjectInfoIndexFirstScroll; @@ -1298,54 +1298,54 @@ int16 DungeonMan::f141_getObjectInfoIndex(Thing thing) { } } -void DungeonMan::f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) { +void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) { if (thingToLink == Thing::_endOfList) return; - Thing *thingPtr = (Thing *)f156_getThingData(thingToLink); + Thing *thingPtr = (Thing *)getThingData(thingToLink); *thingPtr = Thing::_endOfList; /* If mapX >= 0 then the thing is linked to the list of things on the specified square else it is linked at the end of the specified thing list */ if (mapX >= 0) { - byte *currSquare = &_g271_currMapData[mapX][mapY]; + byte *currSquare = &_currMapData[mapX][mapY]; if (getFlag(*currSquare, k0x0010_ThingListPresent)) { - thingInList = f161_getSquareFirstThing(mapX, mapY); + thingInList = getSquareFirstThing(mapX, mapY); } else { setFlag(*currSquare, k0x0010_ThingListPresent); - uint16 * tmp = _g270_currMapColCumulativeSquareFirstThingCount + mapX + 1; - uint16 currColumn = _g282_dungeonColumCount - (_g281_dungeonMapsFirstColumnIndex[_g272_currMapIndex] + mapX) - 1; + uint16 * tmp = _currMapColCumulativeSquareFirstThingCount + mapX + 1; + uint16 currColumn = _dungeonColumCount - (_dungeonMapsFirstColumnIndex[_currMapIndex] + mapX) - 1; while (currColumn--) { /* For each column starting from and after the column containing the square where the thing is added */ (*tmp++)++; /* Increment the cumulative first thing count */ } uint16 currMapY = 0; currSquare -= mapY; - uint16 currSquareFirstThingIndex = _g270_currMapColCumulativeSquareFirstThingCount[mapX]; + uint16 currSquareFirstThingIndex = _currMapColCumulativeSquareFirstThingCount[mapX]; while (currMapY++ != mapY) { if (getFlag(*currSquare++, k0x0010_ThingListPresent)) currSquareFirstThingIndex++; } - Thing *currThing = &_g283_squareFirstThings[currSquareFirstThingIndex]; + Thing *currThing = &_squareFirstThings[currSquareFirstThingIndex]; // the second '- 1' is for the loop initialization, > 0 is because we are copying from one behind - for (int16 i = _g278_dungeonFileHeader._squareFirstThingCount - currSquareFirstThingIndex - 1 - 1; i > 0; --i) + for (int16 i = _dungeonFileHeader._squareFirstThingCount - currSquareFirstThingIndex - 1 - 1; i > 0; --i) currThing[i] = currThing[i - 1]; *currThing = thingToLink; return; } } - Thing nextThing = f159_getNextThing(thingInList); + Thing nextThing = getNextThing(thingInList); while (nextThing != Thing::_endOfList) - nextThing = f159_getNextThing(thingInList = nextThing); + nextThing = getNextThing(thingInList = nextThing); - thingPtr = (Thing *)f156_getThingData(thingInList); + thingPtr = (Thing *)getThingData(thingInList); *thingPtr = thingToLink; } -WeaponInfo* DungeonMan::f158_getWeaponInfo(Thing thing) { - Weapon* weapon = (Weapon*)f156_getThingData(thing); +WeaponInfo* DungeonMan::getWeaponInfo(Thing thing) { + Weapon* weapon = (Weapon*)getThingData(thing); return &_weaponInfo[weapon->getType()]; } -int16 DungeonMan::f142_getProjectileAspect(Thing thing) { +int16 DungeonMan::getProjectileAspect(Thing thing) { ThingType thingType = thing.getType(); if (thingType == k15_ExplosionThingType) { if (thing == Thing::_explFireBall) @@ -1359,26 +1359,26 @@ int16 DungeonMan::f142_getProjectileAspect(Thing thing) { return -_vm->indexToOrdinal(k11_ProjectileAspectExplosionDefault); } else if (thingType == k5_WeaponThingType) { - WeaponInfo *weaponInfo = f158_getWeaponInfo(thing); + WeaponInfo *weaponInfo = getWeaponInfo(thing); int16 projAspOrd = weaponInfo->getProjectileAspectOrdinal(); if (projAspOrd) return -projAspOrd; } - return _objectInfo[f141_getObjectInfoIndex(thing)]._objectAspectIndex; + return _objectInfo[getObjectInfoIndex(thing)]._objectAspectIndex; } -int16 DungeonMan::f154_getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16* mapX, int16* mapY) { - if (_g309_partyMapIndex == k255_mapIndexEntrance) +int16 DungeonMan::getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16* mapX, int16* mapY) { + if (_partyMapIndex == k255_mapIndexEntrance) return kM1_mapIndexNone; - Map *map = _g277_dungeonMaps + mapIndex; + Map *map = _dungeonMaps + mapIndex; int16 newMapX = map->_offsetMapX + *mapX; int16 newMapY = map->_offsetMapY + *mapY; int16 newLevel = map->_level + levelDelta; - map = _g277_dungeonMaps; + map = _dungeonMaps; - for (int16 targetMapIndex = 0; targetMapIndex < _g278_dungeonFileHeader._mapCount; targetMapIndex++) { + for (int16 targetMapIndex = 0; targetMapIndex < _dungeonFileHeader._mapCount; targetMapIndex++) { if ((map->_level == newLevel) && (newMapX >= map->_offsetMapX) && (newMapX <= map->_offsetMapX + map->_width) && (newMapY >= map->_offsetMapY) && (newMapY <= map->_offsetMapY + map->_height)) { @@ -1391,15 +1391,15 @@ int16 DungeonMan::f154_getLocationAfterLevelChange(int16 mapIndex, int16 levelDe return kM1_mapIndexNone; } -Thing DungeonMan::f162_getSquareFirstObject(int16 mapX, int16 mapY) { - Thing thing = f161_getSquareFirstThing(mapX, mapY); +Thing DungeonMan::getSquareFirstObject(int16 mapX, int16 mapY) { + Thing thing = getSquareFirstThing(mapX, mapY); while ((thing != Thing::_endOfList) && (thing.getType() < k4_GroupThingType)) - thing = f159_getNextThing(thing); + thing = getNextThing(thing); return thing; } -uint16 DungeonMan::f143_getArmourDefense(ArmourInfo* armourInfo, bool useSharpDefense) { +uint16 DungeonMan::getArmourDefense(ArmourInfo* armourInfo, bool useSharpDefense) { uint16 defense = armourInfo->_defense; if (useSharpDefense) defense = _vm->getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, k0x0007_ArmourAttributeSharpDefense) + 4); @@ -1407,52 +1407,52 @@ uint16 DungeonMan::f143_getArmourDefense(ArmourInfo* armourInfo, bool useSharpDe return defense; } -Thing DungeonMan::f165_getDiscardThing(uint16 thingType) { +Thing DungeonMan::getDiscardThing(uint16 thingType) { // CHECKME: Shouldn't it be saved in the savegames? static unsigned char lastDiscardedThingMapIndex[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (thingType == k15_ExplosionThingType) return Thing::_none; - int16 currentMapIdx = _g272_currMapIndex; + int16 currentMapIdx = _currMapIndex; uint16 mapIndex = lastDiscardedThingMapIndex[thingType]; - if ((mapIndex == _g309_partyMapIndex) && (++mapIndex >= _g278_dungeonFileHeader._mapCount)) + if ((mapIndex == _partyMapIndex) && (++mapIndex >= _dungeonFileHeader._mapCount)) mapIndex = 0; uint16 discardThingMapIndex = mapIndex; for (;;) { /*_Infinite loop_*/ - uint16 mapWidth = _g277_dungeonMaps[mapIndex]._width; - uint16 mapHeight = _g277_dungeonMaps[mapIndex]._height; - byte *currSquare = _g279_dungeonMapData[mapIndex][0]; - Thing *squareFirstThing = &_g283_squareFirstThings[_g280_dungeonColumnsCumulativeSquareThingCount[_g281_dungeonMapsFirstColumnIndex[mapIndex]]]; + uint16 mapWidth = _dungeonMaps[mapIndex]._width; + uint16 mapHeight = _dungeonMaps[mapIndex]._height; + byte *currSquare = _dungeonMapData[mapIndex][0]; + Thing *squareFirstThing = &_squareFirstThings[_dungeonColumnsCumulativeSquareThingCount[_dungeonMapsFirstColumnIndex[mapIndex]]]; for (int16 currMapX = 0; currMapX <= mapWidth; currMapX++) { for (int16 currMapY = 0; currMapY <= mapHeight; currMapY++) { if (getFlag(*currSquare++, k0x0010_ThingListPresent)) { Thing squareThing = *squareFirstThing++; - if ((mapIndex == _g309_partyMapIndex) && ((currMapX - _g306_partyMapX + 5) <= 10) && ((currMapY - _g307_partyMapY + 5) <= 10)) /* If square is too close to the party */ + if ((mapIndex == _partyMapIndex) && ((currMapX - _partyMapX + 5) <= 10) && ((currMapY - _partyMapY + 5) <= 10)) /* If square is too close to the party */ continue; do { ThingType squareThingType = squareThing.getType(); if (squareThingType == k3_SensorThingType) { - Thing *squareThingData = (Thing*)f156_getThingData(squareThing); + Thing *squareThingData = (Thing*)getThingData(squareThing); if (((Sensor*)squareThingData)->getType()) /* If sensor is not disabled */ break; } else if (squareThingType == thingType) { - Thing *squareThingData = (Thing*)f156_getThingData(squareThing); + Thing *squareThingData = (Thing*)getThingData(squareThing); switch (thingType) { case k4_GroupThingType: if (((Group*)squareThingData)->getDoNotDiscard()) continue; case k14_ProjectileThingType: - f173_setCurrentMap(mapIndex); + setCurrentMap(mapIndex); if (thingType == k4_GroupThingType) { _vm->_groupMan->f188_dropGroupPossessions(currMapX, currMapY, squareThing, kM1_soundModeDoNotPlaySound); _vm->_groupMan->f189_delete(currMapX, currMapY); } else { _vm->_projexpl->f214_projectileDeleteEvent(squareThing); - f164_unlinkThingFromList(squareThing, Thing(0), currMapX, currMapY); + unlinkThingFromList(squareThing, Thing(0), currMapX, currMapY); _vm->_projexpl->f215_projectileDelete(squareThing, 0, currMapX, currMapY); } break; @@ -1460,77 +1460,77 @@ Thing DungeonMan::f165_getDiscardThing(uint16 thingType) { if (((Armour*)squareThingData)->getDoNotDiscard()) continue; - f173_setCurrentMap(mapIndex); + setCurrentMap(mapIndex); _vm->_moveSens->f267_getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0); break; case k5_WeaponThingType: if (((Weapon*)squareThingData)->getDoNotDiscard()) continue; - f173_setCurrentMap(mapIndex); + setCurrentMap(mapIndex); _vm->_moveSens->f267_getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0); break; case k10_JunkThingType: if (((Junk*)squareThingData)->getDoNotDiscard()) continue; - f173_setCurrentMap(mapIndex); + setCurrentMap(mapIndex); _vm->_moveSens->f267_getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0); break; case k8_PotionThingType: if (((Potion*)squareThingData)->getDoNotDiscard()) continue; - f173_setCurrentMap(mapIndex); + setCurrentMap(mapIndex); _vm->_moveSens->f267_getMoveResult(squareThing, currMapX, currMapY, kM1_MapXNotOnASquare, 0); break; } - f173_setCurrentMap(currentMapIdx); + setCurrentMap(currentMapIdx); lastDiscardedThingMapIndex[thingType] = mapIndex; return Thing(squareThing.getTypeAndIndex()); } - } while ((squareThing = f159_getNextThing(squareThing)) != Thing::_endOfList); + } while ((squareThing = getNextThing(squareThing)) != Thing::_endOfList); } } } - if ((mapIndex == _g309_partyMapIndex) || (_g278_dungeonFileHeader._mapCount <= 1)) { + if ((mapIndex == _partyMapIndex) || (_dungeonFileHeader._mapCount <= 1)) { lastDiscardedThingMapIndex[thingType] = mapIndex; return Thing::_none; } do { - if (++mapIndex >= _g278_dungeonFileHeader._mapCount) + if (++mapIndex >= _dungeonFileHeader._mapCount) mapIndex = 0; - } while (mapIndex == _g309_partyMapIndex); + } while (mapIndex == _partyMapIndex); if (mapIndex == discardThingMapIndex) - mapIndex = _g309_partyMapIndex; + mapIndex = _partyMapIndex; } } -uint16 DungeonMan::f144_getCreatureAttributes(Thing thing) { - Group *currGroup = (Group *)f156_getThingData(thing); +uint16 DungeonMan::getCreatureAttributes(Thing thing) { + Group *currGroup = (Group *)getThingData(thing); return g243_CreatureInfo[currGroup->_type]._attributes; } -void DungeonMan::f146_setGroupCells(Group* group, uint16 cells, uint16 mapIndex) { - if (mapIndex == _g309_partyMapIndex) +void DungeonMan::setGroupCells(Group* group, uint16 cells, uint16 mapIndex) { + if (mapIndex == _partyMapIndex) _vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]._cells = cells; else group->_cells = cells; } -void DungeonMan::f148_setGroupDirections(Group* group, int16 dir, uint16 mapIndex) { - if (mapIndex == _g309_partyMapIndex) +void DungeonMan::setGroupDirections(Group* group, int16 dir, uint16 mapIndex) { + if (mapIndex == _partyMapIndex) _vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]._directions = (Direction)dir; else group->setDir(normalizeModulo4(dir)); } -bool DungeonMan::f139_isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) { - int16 creatureType = ((Group*)f156_getThingData(thing))->_type; - Map *map = &_g277_dungeonMaps[mapIndex]; - byte *allowedCreatureType = _g279_dungeonMapData[mapIndex][map->_width] + map->_height + 1; +bool DungeonMan::isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) { + int16 creatureType = ((Group*)getThingData(thing))->_type; + Map *map = &_dungeonMaps[mapIndex]; + byte *allowedCreatureType = _dungeonMapData[mapIndex][map->_width] + map->_height + 1; for (int16 L0234_i_Counter = map->_creatureTypeCount; L0234_i_Counter > 0; L0234_i_Counter--) { if (*allowedCreatureType++ == creatureType) return true; @@ -1538,7 +1538,7 @@ bool DungeonMan::f139_isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) { return false; } -void DungeonMan::f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int16 mapX, int16 mapY) { +void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int16 mapX, int16 mapY) { if (thingToUnlink == Thing::_endOfList) return; @@ -1548,18 +1548,18 @@ void DungeonMan::f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList Thing *thingPtr = nullptr; if (mapX >= 0) { - thingPtr = (Thing*)f156_getThingData(thingToUnlink); - uint16 firstThingIndex = f160_getSquareFirstThingIndex(mapX, mapY); - Thing *currThing = &_g283_squareFirstThings[firstThingIndex]; /* BUG0_01 Coding error without consequence. The engine does not check that there are things at the specified square coordinates. f160_getSquareFirstThingIndex would return -1 for an empty square. No consequence as the function is never called with the coordinates of an empty square (except in the case of BUG0_59) */ + thingPtr = (Thing*)getThingData(thingToUnlink); + uint16 firstThingIndex = getSquareFirstThingIndex(mapX, mapY); + Thing *currThing = &_squareFirstThings[firstThingIndex]; /* BUG0_01 Coding error without consequence. The engine does not check that there are things at the specified square coordinates. f160_getSquareFirstThingIndex would return -1 for an empty square. No consequence as the function is never called with the coordinates of an empty square (except in the case of BUG0_59) */ if ((*thingPtr == Thing::_endOfList) && (((Thing*)currThing)->getTypeAndIndex() == thingToUnlink.toUint16())) { /* If the thing to unlink is the last thing on the square */ - clearFlag(_g271_currMapData[mapX][mapY], k0x0010_ThingListPresent); - uint16 squareFirstThingIdx = _g278_dungeonFileHeader._squareFirstThingCount - 1; + clearFlag(_currMapData[mapX][mapY], k0x0010_ThingListPresent); + uint16 squareFirstThingIdx = _dungeonFileHeader._squareFirstThingCount - 1; for (uint16 i = 0; i < squareFirstThingIdx - firstThingIndex; ++i) currThing[i] = currThing[i + 1]; - _g283_squareFirstThings[squareFirstThingIdx] = Thing::_none; - uint16 *cumulativeFirstThingCount = _g270_currMapColCumulativeSquareFirstThingCount + mapX + 1; - uint16 currColumn = _g282_dungeonColumCount - (_g281_dungeonMapsFirstColumnIndex[_g272_currMapIndex] + mapX) - 1; + _squareFirstThings[squareFirstThingIdx] = Thing::_none; + uint16 *cumulativeFirstThingCount = _currMapColCumulativeSquareFirstThingCount + mapX + 1; + uint16 currColumn = _dungeonColumCount - (_dungeonMapsFirstColumnIndex[_currMapIndex] + mapX) - 1; while (currColumn--) { /* For each column starting from and after the column containing the square where the thing is unlinked */ (*cumulativeFirstThingCount++)--; /* Decrement the cumulative first thing count */ } @@ -1574,22 +1574,22 @@ void DungeonMan::f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList thingInList = *currThing; } - Thing currThing = f159_getNextThing(thingInList); + Thing currThing = getNextThing(thingInList); while (currThing.getTypeAndIndex() != thingToUnlink.toUint16()) { if ((currThing == Thing::_endOfList) || (currThing == Thing::_none)) { *thingPtr = Thing::_endOfList; return; } - currThing = f159_getNextThing(thingInList = currThing); + currThing = getNextThing(thingInList = currThing); } - thingPtr = (Thing*)f156_getThingData(thingInList); - *thingPtr = f159_getNextThing(currThing); - thingPtr = (Thing*)f156_getThingData(thingToUnlink); + thingPtr = (Thing*)getThingData(thingInList); + *thingPtr = getNextThing(currThing); + thingPtr = (Thing*)getThingData(thingToUnlink); *thingPtr = Thing::_endOfList; } -int16 DungeonMan::f155_getStairsExitDirection(int16 mapX, int16 mapY) { - bool northSouthOrientedStairs = !getFlag(f151_getSquare(mapX, mapY).toByte(), k0x0008_StairsNorthSouthOrient); +int16 DungeonMan::getStairsExitDirection(int16 mapX, int16 mapY) { + bool northSouthOrientedStairs = !getFlag(getSquare(mapX, mapY).toByte(), k0x0008_StairsNorthSouthOrient); if (northSouthOrientedStairs) { mapX = mapX + _vm->_dirIntoStepCountEast[kDirEast]; @@ -1598,7 +1598,7 @@ int16 DungeonMan::f155_getStairsExitDirection(int16 mapX, int16 mapY) { mapX = mapX + _vm->_dirIntoStepCountEast[kDirNorth]; mapY = mapY + _vm->_dirIntoStepCountNorth[kDirNorth]; } - int16 squareType = Square(f151_getSquare(mapX, mapY)).getType(); + int16 squareType = Square(getSquare(mapX, mapY)).getType(); int16 retval = ((squareType == k0_ElementTypeWall) || (squareType == k3_ElementTypeStairs)) ? 1 : 0; retval <<= 1; @@ -1607,7 +1607,7 @@ int16 DungeonMan::f155_getStairsExitDirection(int16 mapX, int16 mapY) { return retval; } -Thing DungeonMan::f167_getObjForProjectileLaucherOrObjGen(uint16 iconIndex) { +Thing DungeonMan::getObjForProjectileLaucherOrObjGen(uint16 iconIndex) { int16 thingType = k5_WeaponThingType; if ((iconIndex >= k4_IconIndiceWeaponTorchUnlit) && (iconIndex <= k7_IconIndiceWeaponTorchLit)) iconIndex = k4_IconIndiceWeaponTorchUnlit; @@ -1644,11 +1644,11 @@ Thing DungeonMan::f167_getObjForProjectileLaucherOrObjGen(uint16 iconIndex) { return Thing::_none; } - Thing unusedThing = f166_getUnusedThing(thingType); + Thing unusedThing = getUnusedThing(thingType); if (unusedThing == Thing::_none) return Thing::_none; - Junk *junkPtr = (Junk*)f156_getThingData(unusedThing); + Junk *junkPtr = (Junk*)getThingData(unusedThing); junkPtr->setType(junkType); /* Also works for WEAPON in cases other than Boulder */ if ((iconIndex == k4_IconIndiceWeaponTorchUnlit) && ((Weapon*)junkPtr)->isLit()) /* BUG0_65 Torches created by object generator or projectile launcher sensors have no charges. Charges are only defined if the Torch is lit which is not possible at the time it is created */ ((Weapon*)junkPtr)->setChargeCount(15); @@ -1656,10 +1656,10 @@ Thing DungeonMan::f167_getObjForProjectileLaucherOrObjGen(uint16 iconIndex) { return unusedThing; } -int16 DungeonMan::f169_getRandomOrnamentIndex(uint16 val1, uint16 val2, int16 modulo) { +int16 DungeonMan::getRandomOrnamentIndex(uint16 val1, uint16 val2, int16 modulo) { // TODO: Use ScummVM random number generator return ((((((val1 * 31417) & 0xFFFF) >> 1) + ((val2 * 11) & 0xFFFF) - + _g278_dungeonFileHeader._ornamentRandomSeed) & 0xFFFF) >> 2) % modulo; /* Pseudorandom number generator */ + + _dungeonFileHeader._ornamentRandomSeed) & 0xFFFF) >> 2) % modulo; /* Pseudorandom number generator */ } } diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index ce90dc1a44..1f52614b21 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -315,22 +315,22 @@ public: void setData(uint16 dat) { _datAndType = dat; } // @ M41_SET_DATA void setTypeDisabled() { _datAndType &= 0xFF80; } // @ M44_SET_TYPE_DISABLED - bool getOnlyOnce() { return (_attributes >> 2) & 1; } - uint16 getEffectA() { return (_attributes >> 3) & 0x3; } - bool getRevertEffectA() { return (_attributes >> 5) & 0x1; } - bool getAudibleA() { return (_attributes >> 6) & 0x1; } - uint16 getValue() { return (_attributes >> 7) & 0xF; } - bool getLocalEffect() { return (_attributes >> 11) & 1; } - uint16 getOrnOrdinal() { return _attributes >> 12; } - - uint16 getTargetMapY() { return (_action >> 11); } - uint16 getTargetMapX() { return (_action >> 6) & 0x1F; } - Direction getTargetCell() { return (Direction)((_action >> 4) & 3); } - uint16 getHealthMultiplier() { return ((_action >> 4) & 0xF); } // @ M45_HEALTH_MULTIPLIER - uint16 M46_ticks() { return ((_action >> 4) >> 4) & 0xFFF; } // @ M46_TICKS - uint16 M47_kineticEnergy() { return ((_action >> 4) & 0xFF); }// @ M47_KINETIC_ENERGY - uint16 M48_stepEnergy() { return ((_action >> 4) >> 8) & 0xFF; }// @ M48_STEP_ENERGY - uint16 M49_localEffect() { return (_action >> 4); } // @ M49_LOCAL_EFFECT + bool getAttrOnlyOnce() { return (_attributes >> 2) & 1; } + uint16 getAttrEffectA() { return (_attributes >> 3) & 0x3; } + bool getAttrRevertEffectA() { return (_attributes >> 5) & 0x1; } + bool getAttrAudibleA() { return (_attributes >> 6) & 0x1; } + uint16 getAttrValue() { return (_attributes >> 7) & 0xF; } + bool getAttrLocalEffect() { return (_attributes >> 11) & 1; } + uint16 getAttrOrnOrdinal() { return _attributes >> 12; } + + uint16 getActionTargetMapY() { return (_action >> 11); } + uint16 getActionTargetMapX() { return (_action >> 6) & 0x1F; } + Direction getActionTargetCell() { return (Direction)((_action >> 4) & 3); } + uint16 getActionHealthMultiplier() { return ((_action >> 4) & 0xF); } // @ M45_HEALTH_MULTIPLIER + uint16 getActionTicks() { return ((_action >> 4) >> 4) & 0xFFF; } // @ M46_TICKS + uint16 getActionKineticEnergy() { return ((_action >> 4) & 0xFF); }// @ M47_KINETIC_ENERGY + uint16 getActionStepEnergy() { return ((_action >> 4) >> 8) & 0xFF; }// @ M48_STEP_ENERGY + uint16 getActionLocalEffect() { return (_action >> 4); } // @ M49_LOCAL_EFFECT void setDatAndTypeWithOr(uint16 val) { _datAndType |= val; } @@ -339,7 +339,6 @@ public: #define k0x8000_randomDrop 0x8000 // @ MASK0x8000_RANDOM_DROP - enum WeaponType { k2_WeaponTypeTorch = 2, // @ C02_WEAPON_TORCH k8_WeaponTypeDagger = 8, // @ C08_WEAPON_DAGGER @@ -646,98 +645,92 @@ class DungeonMan { DungeonMan(const DungeonMan &other); // no implementation on purpose void operator=(const DungeonMan &rhs); // no implementation on purpose - Square f152_getRelSquare(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare + Square getRelSquare(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare - void f455_decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon + void decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon - int16 f160_getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex + int16 getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex - int16 f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal - void f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir, + int16 getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal + void setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir, int16 mapX, int16 mapY, bool isFakeWall); // @ F0171_DUNGEON_SetSquareAspectRandomWallOrnamentOrdinals - public: explicit DungeonMan(DMEngine *dmEngine); ~DungeonMan(); - Square f151_getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare - void f173_setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap - Thing f161_getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing - Thing f159_getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing) - uint16 *f156_getThingData(Thing thing); // @ F0156_DUNGEON_GetThingData - uint16 *f157_getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData + Square getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare + void setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap + Thing getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing + Thing getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing) + uint16 *getThingData(Thing thing); // @ F0156_DUNGEON_GetThingData + uint16 *getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData // TODO: this does stuff other than load the file! - void f434_loadDungeonFile(Common::InSaveFile *file); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC - void f174_setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap + void loadDungeonFile(Common::InSaveFile *file); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC + void setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap - bool f149_isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove - void f150_mapCoordsAfterRelMovement(Direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement - SquareType f153_getRelSquareType(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { - return Square(f152_getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType(); + bool isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove + void mapCoordsAfterRelMovement(Direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement + SquareType getRelSquareType(Direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { + return Square(getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType(); } // @ F0153_DUNGEON_GetRelativeSquareType - void f172_setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect - void f168_decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText - Thing f166_getUnusedThing(uint16 thingType); // @ F0166_DUNGEON_GetUnusedThing - - - uint16 f140_getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight - int16 f141_getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex - void f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList - WeaponInfo *f158_getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo - int16 f142_getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect - int16 f154_getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16 *mapX, int16 *mapY); // @ F0154_DUNGEON_GetLocationAfterLevelChange - Thing f162_getSquareFirstObject(int16 mapX, int16 mapY); // @ F0162_DUNGEON_GetSquareFirstObject - uint16 f143_getArmourDefense(ArmourInfo *armourInfo, bool useSharpDefense); // @ F0143_DUNGEON_GetArmourDefense - Thing f165_getDiscardThing(uint16 thingType); // @ F0165_DUNGEON_GetDiscardedThing - uint16 f144_getCreatureAttributes(Thing thing); // @ F0144_DUNGEON_GetCreatureAttributes - void f146_setGroupCells(Group *group, uint16 cells, uint16 mapIndex); // @ F0146_DUNGEON_SetGroupCells - void f148_setGroupDirections(Group *group, int16 dir, uint16 mapIndex); // @ F0148_DUNGEON_SetGroupDirections - bool f139_isCreatureAllowedOnMap(Thing thing, uint16 mapIndex); // @ F0139_DUNGEON_IsCreatureAllowedOnMap - void f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int16 mapX, int16 mapY); // @ F0164_DUNGEON_UnlinkThingFromList - int16 f155_getStairsExitDirection(int16 mapX, int16 mapY); // @ F0155_DUNGEON_GetStairsExitDirection - Thing f167_getObjForProjectileLaucherOrObjGen(uint16 iconIndex); // @ F0167_DUNGEON_GetObjectForProjectileLauncherOrObjectGenerator - int16 f169_getRandomOrnamentIndex(uint16 val1, uint16 val2, int16 modulo); // @ F0169_DUNGEON_GetRandomOrnamentIndex - + void setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect + void decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText + Thing getUnusedThing(uint16 thingType); // @ F0166_DUNGEON_GetUnusedThing + + uint16 getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight + int16 getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex + void linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList + WeaponInfo *getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo + int16 getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect + int16 getLocationAfterLevelChange(int16 mapIndex, int16 levelDelta, int16 *mapX, int16 *mapY); // @ F0154_DUNGEON_GetLocationAfterLevelChange + Thing getSquareFirstObject(int16 mapX, int16 mapY); // @ F0162_DUNGEON_GetSquareFirstObject + uint16 getArmourDefense(ArmourInfo *armourInfo, bool useSharpDefense); // @ F0143_DUNGEON_GetArmourDefense + Thing getDiscardThing(uint16 thingType); // @ F0165_DUNGEON_GetDiscardedThing + uint16 getCreatureAttributes(Thing thing); // @ F0144_DUNGEON_GetCreatureAttributes + void setGroupCells(Group *group, uint16 cells, uint16 mapIndex); // @ F0146_DUNGEON_SetGroupCells + void setGroupDirections(Group *group, int16 dir, uint16 mapIndex); // @ F0148_DUNGEON_SetGroupDirections + bool isCreatureAllowedOnMap(Thing thing, uint16 mapIndex); // @ F0139_DUNGEON_IsCreatureAllowedOnMap + void unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int16 mapX, int16 mapY); // @ F0164_DUNGEON_UnlinkThingFromList + int16 getStairsExitDirection(int16 mapX, int16 mapY); // @ F0155_DUNGEON_GetStairsExitDirection + Thing getObjForProjectileLaucherOrObjGen(uint16 iconIndex); // @ F0167_DUNGEON_GetObjectForProjectileLauncherOrObjectGenerator + int16 getRandomOrnamentIndex(uint16 val1, uint16 val2, int16 modulo); // @ F0169_DUNGEON_GetRandomOrnamentIndex uint32 _rawDunFileDataSize; // @ probably NONE byte *_rawDunFileData; // @ ??? - DungeonFileHeader _g278_dungeonFileHeader; // @ G0278_ps_DungeonHeader - - - uint16 *_g281_dungeonMapsFirstColumnIndex; // @ G0281_pui_DungeonMapsFirstColumnIndex - uint16 _g282_dungeonColumCount; // @ G0282_ui_DungeonColumnCount - uint16 *_g280_dungeonColumnsCumulativeSquareThingCount; // @ G0280_pui_DungeonColumnsCumulativeSquareThingCount - Thing *_g283_squareFirstThings; // @ G0283_pT_SquareFirstThings - uint16 *_g260_dungeonTextData; // @ G0260_pui_DungeonTextData - uint16 *_g284_thingData[16]; // @ G0284_apuc_ThingData - byte ***_g279_dungeonMapData; // @ G0279_pppuc_DungeonMapData - - - Direction _g308_partyDir; // @ G0308_i_PartyDirection - int16 _g306_partyMapX; // @ G0306_i_PartyMapX - int16 _g307_partyMapY; // @ G0307_i_PartyMapY - uint8 _g309_partyMapIndex; // @ G0309_i_PartyMapIndex - int16 _g272_currMapIndex; // @ G0272_i_CurrentMapIndex - byte **_g271_currMapData; // @ G0271_ppuc_CurrentMapData - Map *_g269_currMap; // @ G0269_ps_CurrentMap - uint16 _g273_currMapWidth; // @ G0273_i_CurrentMapWidth - uint16 _g274_currMapHeight; // @ G0274_i_CurrentMapHeight - uint16 *_g270_currMapColCumulativeSquareFirstThingCount; // @G0270_pui_CurrentMapColumnsCumulativeSquareFirstThingCount - - - Map *_g277_dungeonMaps; // @ G0277_ps_DungeonMaps - byte *_g276_dungeonRawMapData; // @ G0276_puc_DungeonRawMapData - - int16 _g265_currMapInscriptionWallOrnIndex; // @ G0265_i_CurrentMapInscriptionWallOrnamentIndex - Box _g291_dungeonViewClickableBoxes[6]; // G0291_aauc_DungeonViewClickableBoxes - bool _g286_isFacingAlcove; // @ G0286_B_FacingAlcove - bool _g287_isFacingViAltar; // @ G0287_B_FacingViAltar - bool _g288_isFacingFountain; // @ G0288_B_FacingFountain - ElementType _g285_squareAheadElement; // @ G0285_i_SquareAheadElement - Thing _g292_pileTopObject[5]; // @ G0292_aT_PileTopObject - DoorInfo _g275_currMapDoorInfo[2]; // @ G0275_as_CurrentMapDoorInfo + DungeonFileHeader _dungeonFileHeader; // @ G0278_ps_DungeonHeader + + uint16 *_dungeonMapsFirstColumnIndex; // @ G0281_pui_DungeonMapsFirstColumnIndex + uint16 _dungeonColumCount; // @ G0282_ui_DungeonColumnCount + uint16 *_dungeonColumnsCumulativeSquareThingCount; // @ G0280_pui_DungeonColumnsCumulativeSquareThingCount + Thing *_squareFirstThings; // @ G0283_pT_SquareFirstThings + uint16 *_dungeonTextData; // @ G0260_pui_DungeonTextData + uint16 *_thingData[16]; // @ G0284_apuc_ThingData + byte ***_dungeonMapData; // @ G0279_pppuc_DungeonMapData + + Direction _partyDir; // @ G0308_i_PartyDirection + int16 _partyMapX; // @ G0306_i_PartyMapX + int16 _partyMapY; // @ G0307_i_PartyMapY + uint8 _partyMapIndex; // @ G0309_i_PartyMapIndex + int16 _currMapIndex; // @ G0272_i_CurrentMapIndex + byte **_currMapData; // @ G0271_ppuc_CurrentMapData + Map *_currMap; // @ G0269_ps_CurrentMap + uint16 _currMapWidth; // @ G0273_i_CurrentMapWidth + uint16 _currMapHeight; // @ G0274_i_CurrentMapHeight + uint16 *_currMapColCumulativeSquareFirstThingCount; // @G0270_pui_CurrentMapColumnsCumulativeSquareFirstThingCount + + Map *_dungeonMaps; // @ G0277_ps_DungeonMaps + byte *_dungeonRawMapData; // @ G0276_puc_DungeonRawMapData + + int16 _currMapInscriptionWallOrnIndex; // @ G0265_i_CurrentMapInscriptionWallOrnamentIndex + Box _dungeonViewClickableBoxes[6]; // G0291_aauc_DungeonViewClickableBoxes + bool _isFacingAlcove; // @ G0286_B_FacingAlcove + bool _isFacingViAltar; // @ G0287_B_FacingViAltar + bool _isFacingFountain; // @ G0288_B_FacingFountain + ElementType _squareAheadElement; // @ G0285_i_SquareAheadElement + Thing _pileTopObject[5]; // @ G0292_aT_PileTopObject + DoorInfo _currMapDoorInfo[2]; // @ G0275_as_CurrentMapDoorInfo ObjectInfo _objectInfo[180]; // @ G0237_as_Graphic559_ObjectInfo ArmourInfo _armourInfo[58]; // @ G0239_as_Graphic559_ArmourInfo diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index dbf8c1b298..b5dfcccf58 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -728,7 +728,7 @@ void EventManager::f380_processCommandQueue() { Command cmd = _commandQueue.pop(); CommandType cmdType = cmd._type; - if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft) && (_vm->_disabledMovementTicks || (_vm->_projectileDisableMovementTicks && (_vm->_lastProjectileDisabledMovementDirection == (normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + cmdType - k3_CommandMoveForward)))))) { /* If movement is disabled */ + if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft) && (_vm->_disabledMovementTicks || (_vm->_projectileDisableMovementTicks && (_vm->_lastProjectileDisabledMovementDirection == (normalizeModulo4(_vm->_dungeonMan->_partyDir + cmdType - k3_CommandMoveForward)))))) { /* If movement is disabled */ _g435_isCommandQueueLocked = false; f360_processPendingClick(); return; @@ -934,15 +934,15 @@ void EventManager::f365_commandTurnParty(CommandType cmdType) { else f362_commandHighlightBoxEnable(291, 318, 125, 145); - uint16 partySquare = _vm->_dungeonMan->f151_getSquare(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY).toByte(); + uint16 partySquare = _vm->_dungeonMan->getSquare(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY).toByte(); if (Square(partySquare).getType() == k3_StairsElemType) { f364_commandTakeStairs(getFlag(partySquare, k0x0004_StairsUp)); return; } - _vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, false); - _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + ((cmdType == k2_CommandTurnRight) ? 1 : 3))); - _vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, true); + _vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, Thing::_party, true, false); + _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_partyDir + ((cmdType == k2_CommandTurnRight) ? 1 : 3))); + _vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, Thing::_party, true, true); } void EventManager::f366_commandMoveParty(CommandType cmdType) { @@ -977,20 +977,20 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { uint16 movementArrowIdx = cmdType - k3_CommandMoveForward; Box *highlightBox = &boxMovementArrows[movementArrowIdx]; f362_commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2); - int16 partyMapX = _vm->_dungeonMan->_g306_partyMapX; - int16 partyMapY = _vm->_dungeonMan->_g307_partyMapY; - uint16 AL1115_ui_Square = _vm->_dungeonMan->f151_getSquare(partyMapX, partyMapY).toByte(); + int16 partyMapX = _vm->_dungeonMan->_partyMapX; + int16 partyMapY = _vm->_dungeonMan->_partyMapY; + uint16 AL1115_ui_Square = _vm->_dungeonMan->getSquare(partyMapX, partyMapY).toByte(); bool isStairsSquare = (Square(AL1115_ui_Square).getType() == k3_StairsElemType); if (isStairsSquare && (movementArrowIdx == 2)) { /* If moving backward while in stairs */ f364_commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); return; } - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(_vm->_dungeonMan->_g308_partyDir, movementArrowToStepForwardCount[movementArrowIdx], movementArrowToSepRightCount[movementArrowIdx], partyMapX, partyMapY); - int16 partySquareType = Square(AL1115_ui_Square = _vm->_dungeonMan->f151_getSquare(partyMapX, partyMapY).toByte()).getType(); + _vm->_dungeonMan->mapCoordsAfterRelMovement(_vm->_dungeonMan->_partyDir, movementArrowToStepForwardCount[movementArrowIdx], movementArrowToSepRightCount[movementArrowIdx], partyMapX, partyMapY); + int16 partySquareType = Square(AL1115_ui_Square = _vm->_dungeonMan->getSquare(partyMapX, partyMapY).toByte()).getType(); if (partySquareType == k3_ElementTypeStairs) { - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, kM1_MapXNotOnASquare, 0); - _vm->_dungeonMan->_g306_partyMapX = partyMapX; - _vm->_dungeonMan->_g307_partyMapY = partyMapY; + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kM1_MapXNotOnASquare, 0); + _vm->_dungeonMan->_partyMapX = partyMapX; + _vm->_dungeonMan->_partyMapY = partyMapY; f364_commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); return; } @@ -1006,7 +1006,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { if (_vm->_championMan->_partyChampionCount) { if (isMovementBlocked) { - movementArrowIdx += (_vm->_dungeonMan->_g308_partyDir + 2); + movementArrowIdx += (_vm->_dungeonMan->_partyDir + 2); int16 L1124_i_FirstDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, normalizeModulo4(movementArrowIdx)); int16 L1125_i_SecondDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, returnNextVal(movementArrowIdx)); int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs, k2_attackType_SELF); @@ -1032,7 +1032,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { if (isStairsSquare) _vm->_moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, partyMapX, partyMapY); else - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, partyMapX, partyMapY); + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, partyMapX, partyMapY); uint16 disabledMovtTicks = 1; championsPtr = _vm->_championMan->_champions; @@ -1055,7 +1055,7 @@ bool EventManager::f375_processType80_clickDungeonView_isLeaderHandObjThrown(int bool objectThrownFl; if (posX <= 111) { - if (_vm->_dungeonMan->_g285_squareAheadElement == k17_ElementTypeDoorFront) { + if (_vm->_dungeonMan->_squareAheadElement == k17_ElementTypeDoorFront) { if (posX < 64) return false; } else if (posX < 32) @@ -1064,7 +1064,7 @@ bool EventManager::f375_processType80_clickDungeonView_isLeaderHandObjThrown(int // Strangerke: Only present in CSB2.1... But it fixes a bug so we keep it objectThrownFl = _vm->_championMan->isLeaderHandObjectThrown(k0_sideLeft); } else { - if (_vm->_dungeonMan->_g285_squareAheadElement == k17_ElementTypeDoorFront) { + if (_vm->_dungeonMan->_squareAheadElement == k17_ElementTypeDoorFront) { if (posX > 163) return false; } else if (posX > 191) @@ -1112,7 +1112,7 @@ void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { leaderIndex = cm._leaderIndex; cm._champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true); cm._champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); - cm._champions[leaderIndex]._load -= _vm->_dungeonMan->f140_getObjectWeight(cm._leaderHandObject); + cm._champions[leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(cm._leaderHandObject); cm._leaderIndex = kM1_ChampionNone; cm.drawChampionState(leaderIndex); } @@ -1122,8 +1122,8 @@ void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { } cm._leaderIndex = champIndex; Champion *champion = &cm._champions[cm._leaderIndex]; - champion->_dir = _vm->_dungeonMan->_g308_partyDir; - cm._champions[champIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(cm._leaderHandObject); + champion->_dir = _vm->_dungeonMan->_partyDir; + cm._champions[champIndex]._load += _vm->_dungeonMan->getObjectWeight(cm._leaderHandObject); if (_vm->indexToOrdinal(champIndex) != cm._candidateChampionOrdinal) { champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true); champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); @@ -1132,12 +1132,12 @@ void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { } void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() { - uint16 mapX = _vm->_dungeonMan->_g306_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir]; - uint16 mapY = _vm->_dungeonMan->_g307_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + uint16 mapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + uint16 mapY = _vm->_dungeonMan->_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; - if ((mapX >= 0) && (mapX < _vm->_dungeonMan->_g273_currMapWidth) - && (mapY >= 0) && (mapY < _vm->_dungeonMan->_g274_currMapHeight)) - _vm->_stopWaitingForPlayerInput = _vm->_moveSens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(_vm->_dungeonMan->_g308_partyDir)); + if ((mapX >= 0) && (mapX < _vm->_dungeonMan->_currMapWidth) + && (mapY >= 0) && (mapY < _vm->_dungeonMan->_currMapHeight)) + _vm->_stopWaitingForPlayerInput = _vm->_moveSens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(_vm->_dungeonMan->_partyDir)); } void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { @@ -1149,18 +1149,18 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 Box(40, 111, 122, 147) /* Back left */ }; - if (_vm->_dungeonMan->_g285_squareAheadElement == k17_ElementTypeDoorFront) { + if (_vm->_dungeonMan->_squareAheadElement == k17_ElementTypeDoorFront) { if (_vm->_championMan->_leaderIndex == kM1_ChampionNone) return; - int16 L1155_i_MapX = _vm->_dungeonMan->_g306_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir]; - int16 L1156_i_MapY = _vm->_dungeonMan->_g307_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + int16 L1155_i_MapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + int16 L1156_i_MapY = _vm->_dungeonMan->_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; if (_vm->_championMan->_leaderEmptyHanded) { - Junk *junkPtr = (Junk*)_vm->_dungeonMan->f157_getSquareFirstThingData(L1155_i_MapX, L1156_i_MapY); - if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { + Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(L1155_i_MapX, L1156_i_MapY); + if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { _vm->_stopWaitingForPlayerInput = true; - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1); return; } @@ -1170,9 +1170,9 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 if (_vm->_championMan->_leaderEmptyHanded) { for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k5_ViewCellDoorButtonOrWallOrn + 1; currViewCell++) { - if (_vm->_dungeonMan->_g291_dungeonViewClickableBoxes[currViewCell].isPointInside(posX, posY - 33)) { + if (_vm->_dungeonMan->_dungeonViewClickableBoxes[currViewCell].isPointInside(posX, posY - 33)) { if (currViewCell == k5_ViewCellDoorButtonOrWallOrn) { - if (!_vm->_dungeonMan->_g286_isFacingAlcove) + if (!_vm->_dungeonMan->_isFacingAlcove) f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); } else f373_processType80_clickInDungeonView_grabLeaderHandObject(currViewCell); @@ -1182,21 +1182,21 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 } } else { Thing thingHandObject = _vm->_championMan->_leaderHandObject; - Junk *junkPtr = (Junk*)_vm->_dungeonMan->f156_getThingData(thingHandObject); - if (_vm->_dungeonMan->_g285_squareAheadElement == k0_ElementTypeWall) { + Junk *junkPtr = (Junk*)_vm->_dungeonMan->getThingData(thingHandObject); + if (_vm->_dungeonMan->_squareAheadElement == k0_ElementTypeWall) { for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k1_ViewCellFrontRight + 1; currViewCell++) { if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) { f374_processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); return; } } - if (_vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { - if (_vm->_dungeonMan->_g286_isFacingAlcove) + if (_vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { + if (_vm->_dungeonMan->_isFacingAlcove) f374_processType80_clickInDungeonViewDropLeaderHandObject(k4_ViewCellAlcove); else { - if (_vm->_dungeonMan->_g288_isFacingFountain) { + if (_vm->_dungeonMan->_isFacingFountain) { uint16 iconIdx = _vm->_objectMan->f33_getIconIndex(thingHandObject); - uint16 weight = _vm->_dungeonMan->f140_getObjectWeight(thingHandObject); + uint16 weight = _vm->_dungeonMan->getObjectWeight(thingHandObject); if ((iconIdx >= k8_IconIndiceJunkWater) && (iconIdx <= k9_IconIndiceJunkWaterSkin)) junkPtr->setChargeCount(3); /* Full */ else if (iconIdx == k195_IconIndicePotionEmptyFlask) @@ -1206,7 +1206,7 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 return; } _vm->_championMan->drawChangedObjectIcons(); - _vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(thingHandObject) - weight; + _vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thingHandObject) - weight; } f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); } @@ -1247,29 +1247,29 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat box._x2 = box._x1 + 66; dispMan._g578_useByteBoxCoordinates = false; dispMan.D24_fillScreenBox(box, k0_ColorBlack); - dispMan.D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._g308_partyDir) * 2], k0_ColorBlack); + dispMan.D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._partyDir) * 2], k0_ColorBlack); _vm->_menuMan->f457_drawEnabledMenus(); f78_showMouse(); return; } champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); - int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir]; - int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir]; + int16 mapX = dunMan._partyMapX + _vm->_dirIntoStepCountEast[dunMan._partyDir]; + int16 mapY = dunMan._partyMapY + _vm->_dirIntoStepCountNorth[dunMan._partyDir]; for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) { Thing thing = champ->getSlot((ChampionSlot)slotIndex); if (thing != Thing::_none) { - _vm->_dungeonMan->f164_unlinkThingFromList(thing, Thing(0), mapX, mapY); + _vm->_dungeonMan->unlinkThingFromList(thing, Thing(0), mapX, mapY); } } - Thing thing = dunMan.f161_getSquareFirstThing(mapX, mapY); + Thing thing = dunMan.getSquareFirstThing(mapX, mapY); for (;;) { // infinite if (thing.getType() == k3_SensorThingType) { - ((Sensor*)dunMan.f156_getThingData(thing))->setTypeDisabled(); + ((Sensor*)dunMan.getThingData(thing))->setTypeDisabled(); break; } - thing = dunMan.f159_getNextThing(thing); + thing = dunMan.getNextThing(thing); } if (commandType == k161_CommandClickInPanelReincarnate) { @@ -1343,19 +1343,19 @@ void EventManager::f373_processType80_clickInDungeonView_grabLeaderHandObject(ui if (_vm->_championMan->_leaderIndex == kM1_ChampionNone) return; - int16 mapX = _vm->_dungeonMan->_g306_partyMapX; - int16 mapY = _vm->_dungeonMan->_g307_partyMapY; + int16 mapX = _vm->_dungeonMan->_partyMapX; + int16 mapY = _vm->_dungeonMan->_partyMapY; if (viewCell >= k2_ViewCellBackRight) { - mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; Thing groupThing = _vm->_groupMan->f175_groupGetThing(mapX, mapY); if ((groupThing != Thing::_endOfList) && !_vm->_moveSens->f264_isLevitating(groupThing) && - _vm->_groupMan->f176_getCreatureOrdinalInCell((Group*)_vm->_dungeonMan->f156_getThingData(groupThing), normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir))) { + _vm->_groupMan->f176_getCreatureOrdinalInCell((Group*)_vm->_dungeonMan->getThingData(groupThing), normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir))) { return; /* It is not possible to grab an object on floor if there is a non levitating creature on its cell */ } } - Thing topPileThing = _vm->_dungeonMan->_g292_pileTopObject[viewCell]; + Thing topPileThing = _vm->_dungeonMan->_pileTopObject[viewCell]; if (_vm->_objectMan->f33_getIconIndex(topPileThing) != kM1_IconIndiceNone) { _vm->_moveSens->f267_getMoveResult(topPileThing, mapX, mapY, kM1_MapXNotOnASquare, 0); _vm->_championMan->putObjectInLeaderHand(topPileThing, true); @@ -1368,22 +1368,22 @@ void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uin if (_vm->_championMan->_leaderIndex == kM1_ChampionNone) return; - int16 mapX = _vm->_dungeonMan->_g306_partyMapX; - int16 mapY = _vm->_dungeonMan->_g307_partyMapY; + int16 mapX = _vm->_dungeonMan->_partyMapX; + int16 mapY = _vm->_dungeonMan->_partyMapY; bool droppingIntoAnAlcove = (viewCell == k4_ViewCellAlcove); if (droppingIntoAnAlcove) viewCell = k2_ViewCellBackRight; if (viewCell > k1_ViewCellFrontRight) - mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; - uint16 currCell = normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + viewCell); + uint16 currCell = normalizeModulo4(_vm->_dungeonMan->_partyDir + viewCell); Thing removedThing = _vm->_championMan->getObjectRemovedFromLeaderHand(); _vm->_moveSens->f267_getMoveResult(thingWithNewCell(removedThing, currCell), kM1_MapXNotOnASquare, 0, mapX, mapY); - if (droppingIntoAnAlcove && _vm->_dungeonMan->_g287_isFacingViAltar && (_vm->_objectMan->f33_getIconIndex(removedThing) == k147_IconIndiceJunkChampionBones)) { - Junk *removedJunk = (Junk*)_vm->_dungeonMan->f156_getThingData(removedThing); + if (droppingIntoAnAlcove && _vm->_dungeonMan->_isFacingViAltar && (_vm->_objectMan->f33_getIconIndex(removedThing) == k147_IconIndiceJunkChampionBones)) { + Junk *removedJunk = (Junk*)_vm->_dungeonMan->getThingData(removedThing); TimelineEvent newEvent; - setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 1); + setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 1); newEvent._type = k13_TMEventTypeViAltarRebirth; newEvent._priority = removedJunk->getChargeCount(); newEvent._B._location._mapX = mapX; @@ -1428,11 +1428,11 @@ void EventManager::f357_discardAllInput() { } void EventManager::f364_commandTakeStairs(bool stairsGoDown) { - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, kM1_MapXNotOnASquare, 0); - _vm->_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(_vm->_dungeonMan->_g309_partyMapIndex, stairsGoDown ? -1 : 1, &_vm->_dungeonMan->_g306_partyMapX, &_vm->_dungeonMan->_g307_partyMapY); - _vm->_dungeonMan->f173_setCurrentMap(_vm->_newPartyMapIndex); - _vm->_championMan->setPartyDirection(_vm->_dungeonMan->f155_getStairsExitDirection(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY)); - _vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex); + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kM1_MapXNotOnASquare, 0); + _vm->_newPartyMapIndex = _vm->_dungeonMan->getLocationAfterLevelChange(_vm->_dungeonMan->_partyMapIndex, stairsGoDown ? -1 : 1, &_vm->_dungeonMan->_partyMapX, &_vm->_dungeonMan->_partyMapY); + _vm->_dungeonMan->setCurrentMap(_vm->_newPartyMapIndex); + _vm->_championMan->setPartyDirection(_vm->_dungeonMan->getStairsExitDirection(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)); + _vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex); } void EventManager::f367_commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY) { @@ -1454,7 +1454,7 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c _gK100_preventBuildPointerScreenArea = true; if (!_g599_useChampionIconOrdinalAsMousePointerBitmap) { - if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir)) == kM1_ChampionNone) { + if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir)) == kM1_ChampionNone) { _gK100_preventBuildPointerScreenArea = false; return; } @@ -1474,20 +1474,20 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c _g598_mousePointerBitmapUpdated = true; uint16 championIconIndex = _vm->ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap); _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); - int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir)); + int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir)); if (championIconIndex == champIconIndex) { setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon); _vm->_championMan->drawChampionState((ChampionIndex)championCellIndex); } else { - int16 championIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir)); + int16 championIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir)); if (championIndex >= 0) { - _vm->_championMan->_champions[championIndex]._cell = (ViewCell)normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir); + _vm->_championMan->_champions[championIndex]._cell = (ViewCell)normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir); setFlag(_vm->_championMan->_champions[championIndex]._attributes, k0x0400_ChampionAttributeIcon); _vm->_championMan->drawChampionState((ChampionIndex)championIndex); } else _vm->_displayMan->D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], k0_ColorBlack); - _vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir); + _vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir); setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon); _vm->_championMan->drawChampionState((ChampionIndex)championCellIndex); } diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index f56d78d17f..30f5a0cac0 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -744,10 +744,10 @@ void DisplayMan::f110_drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButt if (viewDoorButtonIndex == k3_viewDoorButton_D1C) { bitmap = f489_getNativeBitmapOrGraphic(nativeBitmapIndex); - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x1 = coordSetRedEagle[0]; - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x2 = coordSetRedEagle[1]; - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordSetRedEagle[2]; - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordSetRedEagle[3]; + _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x1 = coordSetRedEagle[0]; + _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x2 = coordSetRedEagle[1]; + _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordSetRedEagle[2]; + _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordSetRedEagle[3]; } else { if (!f491_isDerivedBitmapInCache(doorButtonOrdinal = k102_DerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((!viewDoorButtonIndex) ? 0 : viewDoorButtonIndex - 1))) { uint16 *coordSetBlueGoat = doorButtonCoordSets[coordSet][k3_viewDoorButton_D1C]; @@ -1056,11 +1056,11 @@ void DisplayMan::f111_drawDoor(uint16 doorThingIndex, uint16 doorState, int16* d return; DoorFrames *doorFramesTemp = doorFrames; - Door *door = (Door *)(_vm->_dungeonMan->_g284_thingData[k0_DoorThingType]) + doorThingIndex; + Door *door = (Door *)(_vm->_dungeonMan->_thingData[k0_DoorThingType]) + doorThingIndex; uint16 doorType = door->getType(); memmove(_g74_tmpBitmap, f489_getNativeBitmapOrGraphic(doorNativeBitmapIndices[doorType]), byteCount * 2); f109_drawDoorOrnament(door->getOrnOrdinal(), viewDoorOrnIndex); - if (getFlag(_vm->_dungeonMan->_g275_currMapDoorInfo[doorType]._attributes, k0x0004_MaskDoorInfo_Animated)) { + if (getFlag(_vm->_dungeonMan->_currMapDoorInfo[doorType]._attributes, k0x0004_MaskDoorInfo_Animated)) { if (_vm->getRandomNumber(2)) f130_flipBitmapHorizontal(_g74_tmpBitmap, doorFramesTemp->_closedOrDestroyed._srcByteWidth, doorFramesTemp->_closedOrDestroyed._srcHeight); @@ -1153,12 +1153,12 @@ void DisplayMan::f109_drawDoorOrnament(int16 doorOrnOrdinal, int16 viewDoorOrnIn } void DisplayMan::f112_drawCeilingPit(int16 nativeBitmapIndex, Frame *frame, int16 mapX, int16 mapY, bool flipHorizontal) { - int16 mapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(_vm->_dungeonMan->_g272_currMapIndex, -1, &mapX, &mapY); + int16 mapIndex = _vm->_dungeonMan->getLocationAfterLevelChange(_vm->_dungeonMan->_currMapIndex, -1, &mapX, &mapY); if (mapIndex < 0) return; - int16 mapSquare = _vm->_dungeonMan->_g279_dungeonMapData[mapIndex][mapX][mapY]; + int16 mapSquare = _vm->_dungeonMan->_dungeonMapData[mapIndex][mapX][mapY]; if ((Square(mapSquare).getType() == k2_PitElemType) && getFlag(mapSquare, k0x0008_PitOpen)) { if (flipHorizontal) f105_drawFloorPitOrStairsBitmapFlippedHorizontally(nativeBitmapIndex, *frame); @@ -1223,7 +1223,7 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; int16 order; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) @@ -1301,7 +1301,7 @@ void DisplayMan::f117_drawSquareD3R(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1332,7 +1332,7 @@ void DisplayMan::f117_drawSquareD3R(Direction dir, int16 posX, int16 posY) { f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); memmove(_g74_tmpBitmap, _g705_bitmapWallSet_DoorFrameLeft_D3L, 32 * 44); f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD3R); - if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k0_viewDoorButton_D3R); f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], @@ -1385,7 +1385,7 @@ void DisplayMan::f118_drawSquareD3C(Direction dir, int16 posX, int16 posY) { int16 order; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1410,7 +1410,7 @@ void DisplayMan::f118_drawSquareD3C(Direction dir, int16 posX, int16 posY) { f100_drawWallSetBitmap(_g706_bitmapWallSet_DoorFrameLeft_D3C, doorFrameLeftD3C); memmove(_g74_tmpBitmap, _g706_bitmapWallSet_DoorFrameLeft_D3C, 32 * 44); f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD3C); - if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k1_ViewDoorOrnament_D2LCR); f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], @@ -1463,7 +1463,7 @@ void DisplayMan::f119_drawSquareD2L(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1546,7 +1546,7 @@ void DisplayMan::f120_drawSquareD2R(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1633,7 +1633,7 @@ void DisplayMan::f121_drawSquareD2C(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1660,7 +1660,7 @@ void DisplayMan::f121_drawSquareD2C(Direction dir, int16 posX, int16 posY) { f100_drawWallSetBitmap(_g707_bitmapWallSet_DoorFrameLeft_D2C, doorFrameLeftD2C); memcpy(_g74_tmpBitmap, _g707_bitmapWallSet_DoorFrameLeft_D2C, 48 * 65); f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD2C); - if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k2_viewDoorButton_D2C); f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], @@ -1715,7 +1715,7 @@ void DisplayMan::f122_drawSquareD1L(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1800,7 +1800,7 @@ void DisplayMan::f123_drawSquareD1R(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) @@ -1870,8 +1870,8 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; bool skip = false; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); - switch (_vm->_dungeonMan->_g285_squareAheadElement = (ElementType)squareAspect[k0_ElementAspect]) { + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + switch (_vm->_dungeonMan->_squareAheadElement = (ElementType)squareAspect[k0_ElementAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) f104_drawFloorPitOrStairsBitmap(_g680_stairsNativeBitmapIndex_Up_Front_D1C, frameStairsUpFrontD1C); @@ -1884,9 +1884,9 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) { f112_drawCeilingPit(k66_ceilingPitD1C_GraphicIndice, &frameCeilingPitD1C, posX, posY, false); break; case k0_ElementTypeWall: - _vm->_dungeonMan->_g286_isFacingAlcove = false; - _vm->_dungeonMan->_g287_isFacingViAltar = false; - _vm->_dungeonMan->_g288_isFacingFountain = false; + _vm->_dungeonMan->_isFacingAlcove = false; + _vm->_dungeonMan->_isFacingViAltar = false; + _vm->_dungeonMan->_isFacingFountain = false; if (_vm->_championMan->_party._event73Count_ThievesEye) { f491_isDerivedBitmapInCache(k1_DerivedBitmapThievesEyeVisibleArea); f132_blitToBitmap(_g296_bitmapViewport, f492_getDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea), @@ -1914,7 +1914,7 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) { f100_drawWallSetBitmap(_g704_bitmapWallSet_DoorFrameTop_D1LCR, doorFrameTopD1C); f100_drawWallSetBitmap(_g708_bitmapWallSet_DoorFrameLeft_D1C, _doorFrameLeftD1C); f100_drawWallSetBitmap(_g710_bitmapWallSet_DoorFrameRight_D1C, _doorFrameRightD1C); - if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k3_viewDoorButton_D1C); f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], @@ -1949,7 +1949,7 @@ void DisplayMan::f125_drawSquareD0L(Direction dir, int16 posX, int16 posY) { static Frame frameCeilingPitD0L = Frame(0, 15, 0, 3, 8, 4, 0, 0); // @ G0158_s_Graphic558_Frame_CeilingPit_D0L uint16 squareAspect[5]; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k0_WallElemType: f100_drawWallSetBitmap(_g701_bitmapWallSet_Wall_D0L, _frameWalls163[k10_ViewSquare_D0L]); @@ -1981,7 +1981,7 @@ void DisplayMan::f126_drawSquareD0R(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k18_ElementTypeStairsSide: f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g692_stairsNativeBitmapIndex_Side_D0L, frameStairsSideD0R); @@ -2015,7 +2015,7 @@ void DisplayMan::f127_drawSquareD0C(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElementAspect]) { case k16_DoorSideElemType: if (_vm->_championMan->_party._event73Count_ThievesEye) { @@ -2056,10 +2056,10 @@ void DisplayMan::f128_drawDungeon(Direction dir, int16 posX, int16 posY) { _g578_useByteBoxCoordinates = true; for (int16 i = 0; i < 6; ++i) - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[i].setToZero(); + _vm->_dungeonMan->_dungeonViewClickableBoxes[i].setToZero(); for (uint16 i = 0; i < 6; ++i) - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[i]._x1 = 255; + _vm->_dungeonMan->_dungeonViewClickableBoxes[i]._x1 = 255; _g76_useFlippedWallAndFootprintsBitmap = (posX + posY + dir) & 1; if (_g76_useFlippedWallAndFootprintsBitmap) { @@ -2078,67 +2078,67 @@ void DisplayMan::f128_drawDungeon(Direction dir, int16 posX, int16 posY) { f100_drawWallSetBitmap(_g84_bitmapFloor, floorFrame); } - if (_vm->_dungeonMan->f153_getRelSquareType(dir, 3, -2, posX, posY) == k0_WallElemType) + if (_vm->_dungeonMan->getRelSquareType(dir, 3, -2, posX, posY) == k0_WallElemType) f100_drawWallSetBitmap(_g697_bitmapWallSet_Wall_D3L2, frameWallD3L2); - if (_vm->_dungeonMan->f153_getRelSquareType(dir, 3, 2, posX, posY) == k0_WallElemType) + if (_vm->_dungeonMan->getRelSquareType(dir, 3, 2, posX, posY) == k0_WallElemType) f100_drawWallSetBitmap(_g696_bitmapWallSet_Wall_D3R2, _frameWallD3R2); int16 tmpPosX = posX; int16 tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 4, -1, tmpPosX, tmpPosY); - f115_cthulhu(_vm->_dungeonMan->f162_getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM2_ViewSquare_D4L, k0x0001_CellOrder_BackLeft); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, -1, tmpPosX, tmpPosY); + f115_cthulhu(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM2_ViewSquare_D4L, k0x0001_CellOrder_BackLeft); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 4, 1, tmpPosX, tmpPosY); - f115_cthulhu(_vm->_dungeonMan->f162_getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM1_ViewSquare_D4R, k0x0001_CellOrder_BackLeft); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, 1, tmpPosX, tmpPosY); + f115_cthulhu(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM1_ViewSquare_D4R, k0x0001_CellOrder_BackLeft); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 4, 0, tmpPosX, tmpPosY); - f115_cthulhu(_vm->_dungeonMan->f162_getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM3_ViewSquare_D4C, k0x0001_CellOrder_BackLeft); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, 0, tmpPosX, tmpPosY); + f115_cthulhu(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM3_ViewSquare_D4C, k0x0001_CellOrder_BackLeft); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, -1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, -1, tmpPosX, tmpPosY); f116_drawSquareD3L(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, 1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, 1, tmpPosX, tmpPosY); f117_drawSquareD3R(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, 0, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, 0, tmpPosX, tmpPosY); f118_drawSquareD3C(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, -1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, -1, tmpPosX, tmpPosY); f119_drawSquareD2L(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, 1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, 1, tmpPosX, tmpPosY); f120_drawSquareD2R(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, 0, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, 0, tmpPosX, tmpPosY); f121_drawSquareD2C(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, -1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, -1, tmpPosX, tmpPosY); f122_drawSquareD1L(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, 1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, 1, tmpPosX, tmpPosY); f123_drawSquareD1R(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, 0, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, 0, tmpPosX, tmpPosY); f124_drawSquareD1C(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 0, -1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 0, -1, tmpPosX, tmpPosY); f125_drawSquareD0L(dir, tmpPosX, tmpPosY); tmpPosX = posX; tmpPosY = posY; - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 0, 1, tmpPosX, tmpPosY); + _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 0, 1, tmpPosX, tmpPosY); f126_drawSquareD0R(dir, tmpPosX, tmpPosY); f127_drawSquareD0C(dir, posX, posY); @@ -2150,8 +2150,8 @@ void DisplayMan::f128_drawDungeon(Direction dir, int16 posX, int16 posY) { _g702_bitmapWallSet_Wall_D0R = _g99_bitmapWall_D0R_Native; } - f97_drawViewport((_vm->_dungeonMan->_g309_partyMapIndex != k255_mapIndexEntrance) ? 1 : 0); - if (_vm->_dungeonMan->_g309_partyMapIndex != k255_mapIndexEntrance) + f97_drawViewport((_vm->_dungeonMan->_partyMapIndex != k255_mapIndexEntrance) ? 1 : 0); + if (_vm->_dungeonMan->_partyMapIndex != k255_mapIndexEntrance) f98_drawFloorAndCeiling(); } @@ -2303,8 +2303,8 @@ void DisplayMan::f96_loadCurrentMapGraphics() { 3}; /* Arched Alcove */ static int16 g193_FountainOrnIndices[k1_FountainOrnCount] = {35}; // @ G0193_ai_Graphic558_FountainOrnamentIndices - f94_loadFloorSet(_vm->_dungeonMan->_g269_currMap->_floorSet); - f95_loadWallSet(_vm->_dungeonMan->_g269_currMap->_wallSet); + f94_loadFloorSet(_vm->_dungeonMan->_currMap->_floorSet); + f95_loadWallSet(_vm->_dungeonMan->_currMap->_wallSet); _g578_useByteBoxCoordinates = true; @@ -2325,7 +2325,7 @@ void DisplayMan::f96_loadCurrentMapGraphics() { f99_copyBitmapAndFlipHorizontal(_g99_bitmapWall_D0R_Native = _g702_bitmapWallSet_Wall_D0R, _g93_bitmapWall_D0L_Flipped, _frameWalls163[k10_ViewSquare_D0L]._srcByteWidth, _frameWalls163[k10_ViewSquare_D0L]._srcHeight); - int16 val = _vm->_dungeonMan->_g269_currMap->_wallSet * k18_StairsGraphicCount + k90_FirstStairs; + int16 val = _vm->_dungeonMan->_currMap->_wallSet * k18_StairsGraphicCount + k90_FirstStairs; _g675_stairsNativeBitmapIndex_Up_Front_D3L = val++; _g676_stairsNativeBitmapIndex_Up_Front_D3C = val++; _g677_stairsNativeBitmapIndex_Up_Front_D2L = val++; @@ -2352,8 +2352,8 @@ void DisplayMan::f96_loadCurrentMapGraphics() { _g268_currMapFountainOrnIndices[i] = -1; uint16 doorSets[2]; - doorSets[0] = _vm->_dungeonMan->_g269_currMap->_doorSet0; - doorSets[1] = _vm->_dungeonMan->_g269_currMap->_doorSet1; + doorSets[0] = _vm->_dungeonMan->_currMap->_doorSet0; + doorSets[1] = _vm->_dungeonMan->_currMap->_doorSet1; for (uint16 doorSet = 0; doorSet <= 1; doorSet++) { int16 counter = k108_FirstDoorSet + (doorSets[doorSet] * k3_DoorSetGraphicsCount); _g693_doorNativeBitmapIndex_Front_D3LCR[doorSet] = counter++; @@ -2363,7 +2363,7 @@ void DisplayMan::f96_loadCurrentMapGraphics() { uint16 alcoveCount = 0; uint16 fountainCount = 0; - Map &currMap = *_vm->_dungeonMan->_g269_currMap; + Map &currMap = *_vm->_dungeonMan->_currMap; _g266_currMapViAltarIndex = -1; @@ -2623,11 +2623,11 @@ bool DisplayMan::f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWall int16 ornNativeBitmapIndex = _g101_currMapWallOrnInfo[wallOrnamentIndex][k0_NativeBitmapIndex]; int16 wallOrnamentCoordinateSetIndex = _g101_currMapWallOrnInfo[wallOrnamentIndex][k1_CoordinateSet]; byte *ornCoordSet = g205_WallOrnCoordSets[wallOrnamentCoordinateSetIndex][viewWallIndex]; - bool isAlcove = _vm->_dungeonMan->f149_isWallOrnAnAlcove(wallOrnamentIndex); + bool isAlcove = _vm->_dungeonMan->isWallOrnAnAlcove(wallOrnamentIndex); unsigned char inscriptionString[70]; - bool isInscription = (wallOrnamentIndex == _vm->_dungeonMan->_g265_currMapInscriptionWallOrnIndex); + bool isInscription = (wallOrnamentIndex == _vm->_dungeonMan->_currMapInscriptionWallOrnIndex); if (isInscription) - _vm->_dungeonMan->f168_decodeText((char*)inscriptionString, _g290_inscriptionThing, k0_TextTypeInscription); + _vm->_dungeonMan->decodeText((char*)inscriptionString, _g290_inscriptionThing, k0_TextTypeInscription); int16 blitPosX; byte *ornBlitBitmap; @@ -2659,15 +2659,15 @@ bool DisplayMan::f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWall ornNativeBitmapIndex++; { Box tmpBox(ornCoordSet); - _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn] = tmpBox; + _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn] = tmpBox; } - _vm->_dungeonMan->_g286_isFacingAlcove = isAlcove; - _vm->_dungeonMan->_g287_isFacingViAltar = + _vm->_dungeonMan->_isFacingAlcove = isAlcove; + _vm->_dungeonMan->_isFacingViAltar = (wallOrnamentIndex == _g266_currMapViAltarIndex); - _vm->_dungeonMan->_g288_isFacingFountain = false; + _vm->_dungeonMan->_isFacingFountain = false; for (int16 idx = 0; idx < k1_FountainOrnCount; idx++) { if (_g268_currMapFountainOrnIndices[idx] == wallOrnamentIndex) { - _vm->_dungeonMan->_g288_isFacingFountain = true; + _vm->_dungeonMan->_isFacingFountain = true; break; } } @@ -3110,7 +3110,7 @@ void DisplayMan::f115_cthulhu(Thing thingParam, Direction directionParam, int16 } if ((viewSquareIndex >= k0_ViewSquare_D3C) && (viewSquareIndex <= k9_ViewSquare_D0C) && (thingParam.getCell() == cellYellowBear)) { /* Square where objects are visible and object is located on cell being processed */ - objectAspect = &(_objectAspects209[_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(thingParam)]._objectAspectIndex]); + objectAspect = &(_objectAspects209[_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(thingParam)]._objectAspectIndex]); AL_4_nativeBitmapIndex = k360_FirstObjectGraphicIndice + objectAspect->_firstNativeBitmapRelativeIndex; useAlcoveObjectImage = (L0135_B_DrawAlcoveObjects && getFlag(objectAspect->_graphicInfo, k0x0010_ObjectAlcoveMask) && !viewLane); if (useAlcoveObjectImage) @@ -3198,7 +3198,7 @@ T0115015_DrawProjectileAsObject: if (drawingGrabbableObject) { bitmapGreenAnt = bitmapRedBanana; - Box *AL_6_box = &_vm->_dungeonMan->_g291_dungeonViewClickableBoxes[AL_2_viewCell]; + Box *AL_6_box = &_vm->_dungeonMan->_dungeonViewClickableBoxes[AL_2_viewCell]; if (AL_6_box->_x1 == 255) { /* If the grabbable object is the first */ *AL_6_box = boxByteGreen; @@ -3215,13 +3215,13 @@ T0115015_DrawProjectileAsObject: AL_6_box->_y2 = MAX(AL_6_box->_y2, boxByteGreen._y2); } bitmapRedBanana = bitmapGreenAnt; - _vm->_dungeonMan->_g292_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */ + _vm->_dungeonMan->_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */ } f132_blitToBitmap(bitmapRedBanana, _g296_bitmapViewport, boxByteGreen, AL_4_xPos, 0, M77_getNormalizedByteWidth(byteWidth), k112_byteWidthViewport, k10_ColorFlesh, heightRedEagle, k136_heightViewport); if (drawProjectileAsObject) goto T0115171_BackFromT0115015_DrawProjectileAsObject; } - } while ((thingParam = _vm->_dungeonMan->f159_getNextThing(thingParam)) != Thing::_endOfList); + } while ((thingParam = _vm->_dungeonMan->getNextThing(thingParam)) != Thing::_endOfList); if (AL_2_viewCell == k4_ViewCellAlcove) break; /* End of processing when drawing objects in an alcove */ if (viewSquareIndex < k0_ViewSquare_D3C) @@ -3233,7 +3233,7 @@ T0115015_DrawProjectileAsObject: ActiveGroup *activeGroup; if (group == nullptr) { /* If all creature data and info has not already been gathered */ - group = (Group*)_vm->_dungeonMan->f156_getThingData(groupThing); + group = (Group*)_vm->_dungeonMan->getThingData(groupThing); activeGroup = &_vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]; CreatureInfo *creatureInfo = &g243_CreatureInfo[group->_type]; creatureAspectStruct = &_creatureAspects219[creatureInfo->_creatureAspectIndex]; @@ -3483,8 +3483,8 @@ T0115129_DrawProjectiles: thingParam = firstThingToDraw; /* Restart processing list of objects from the beginning. The next loop draws only projectile objects among the list */ do { if ((thingParam.getType() == k14_ProjectileThingType) && (thingParam.getCell() == cellYellowBear)) { - Projectile *projectile = (Projectile*)_vm->_dungeonMan->f156_getThingData(thingParam); - if ((AL_4_projectileAspect = _vm->_dungeonMan->f142_getProjectileAspect(projectile->_slot)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */ + Projectile *projectile = (Projectile*)_vm->_dungeonMan->getThingData(thingParam); + if ((AL_4_projectileAspect = _vm->_dungeonMan->getProjectileAspect(projectile->_slot)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */ objectAspect = (ObjectAspect*)&_projectileAspect[_vm->ordinalToIndex(-AL_4_projectileAspect)]; AL_4_nativeBitmapIndex = ((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + k316_FirstProjectileGraphicIndice; projectileAspectType = getFlag(((ProjectileAspect*)objectAspect)->_graphicInfo, k0x0003_ProjectileAspectTypeMask); @@ -3596,7 +3596,7 @@ T0115129_DrawProjectiles: } } T0115171_BackFromT0115015_DrawProjectileAsObject:; - } while ((thingParam = _vm->_dungeonMan->f159_getNextThing(thingParam)) != Thing::_endOfList); + } while ((thingParam = _vm->_dungeonMan->getNextThing(thingParam)) != Thing::_endOfList); } while (remainingViewCellOrdinalsToProcess); /* Draw explosions */ @@ -3612,7 +3612,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; do { if (thingParam.getType() == k15_ExplosionThingType) { AL_2_cellPurpleMan = thingParam.getCell(); - Explosion *explosion = (Explosion*)_vm->_dungeonMan->f156_getThingData(thingParam); + Explosion *explosion = (Explosion*)_vm->_dungeonMan->getThingData(thingParam); bool rebirthExplosion = ((uint16)(AL_4_explosionType = explosion->getType()) >= k100_ExplosionType_RebirthStep1); if (rebirthExplosion && ((AL_1_viewSquareExplosionIndex < k3_ViewSquare_D3C_Explosion) || (AL_1_viewSquareExplosionIndex > k9_ViewSquare_D1C_Explosion) || (AL_2_cellPurpleMan != cellYellowBear))) /* If explosion is rebirth and is not visible */ continue; @@ -3628,7 +3628,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke; } else { if (AL_4_explosionType == k100_ExplosionType_RebirthStep1) { - objectAspect = (ObjectAspect*)&_projectileAspect[_vm->ordinalToIndex(-_vm->_dungeonMan->f142_getProjectileAspect(Thing::_explLightningBolt))]; + objectAspect = (ObjectAspect*)&_projectileAspect[_vm->ordinalToIndex(-_vm->_dungeonMan->getProjectileAspect(Thing::_explLightningBolt))]; bitmapRedBanana = f489_getNativeBitmapOrGraphic(((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1)); explosionCoordinates = rebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3]; byteWidth = M78_getScaledDimension((((ProjectileAspect*)objectAspect)->_byteWidth), explosionCoordinates[2]); @@ -3734,7 +3734,7 @@ T0115200_DrawExplosion: f132_blitToBitmap(bitmapRedBanana, _g296_bitmapViewport, boxByteGreen, AL_4_xPos, 0, byteWidth, k112_byteWidthViewport, k10_ColorFlesh, heightRedEagle, k136_heightViewport); } } - thingParam = _vm->_dungeonMan->f159_getNextThing(thingParam); + thingParam = _vm->_dungeonMan->getNextThing(thingParam); } while (thingParam != Thing::_endOfList); if ((fluxcageExplosion != 0) && (doorFrontViewDrawingPass != 1) && !_g77_doNotDrawFluxcagesDuringEndgame) { /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */ diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 18af098b25..5c60ff4c4f 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -84,7 +84,7 @@ void GroupMan::f196_initActiveGroups() { uint16 GroupMan::f145_getGroupCells(Group *group, int16 mapIndex) { byte cells = group->_cells; - if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex) + if (mapIndex == _vm->_dungeonMan->_partyMapIndex) cells = _g375_activeGroups[cells]._cells; return cells; } @@ -92,14 +92,14 @@ uint16 GroupMan::f145_getGroupCells(Group *group, int16 mapIndex) { uint16 GroupMan::f147_getGroupDirections(Group *group, int16 mapIndex) { static byte groupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections - if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex) + if (mapIndex == _vm->_dungeonMan->_partyMapIndex) return _g375_activeGroups[group->getActiveGroupIndex()]._directions; return groupDirections[group->getDir()]; } int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) { - uint16 currMapIndex = _vm->_dungeonMan->_g272_currMapIndex; + uint16 currMapIndex = _vm->_dungeonMan->_currMapIndex; byte groupCells = f145_getGroupCells(group, currMapIndex); if (groupCells == k255_CreatureTypeSingleCenteredCreature) return _vm->indexToOrdinal(0); @@ -134,11 +134,11 @@ uint16 GroupMan::M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex) { } void GroupMan::f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode) { - Group *group = (Group *)_vm->_dungeonMan->f156_getThingData(groupThing); + Group *group = (Group *)_vm->_dungeonMan->getThingData(groupThing); uint16 creatureType = group->_type; if ((mode >= k0_soundModePlayImmediately) && getFlag(g243_CreatureInfo[creatureType]._attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) { int16 creatureIndex = group->getCount(); - uint16 groupCells = f145_getGroupCells(group, _vm->_dungeonMan->_g272_currMapIndex); + uint16 groupCells = f145_getGroupCells(group, _vm->_dungeonMan->_currMapIndex); do { f186_dropCreatureFixedPossessions(creatureType, mapX, mapY, (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : M50_getCreatureValue(groupCells, creatureIndex), mode); @@ -150,7 +150,7 @@ void GroupMan::f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThin bool L0371_B_WeaponDropped = false; Thing nextThing; do { - nextThing = _vm->_dungeonMan->f159_getNextThing(currentThing); + nextThing = _vm->_dungeonMan->getNextThing(currentThing); currentThing = thingWithNewCell(currentThing, _vm->getRandomNumber(4)); if ((currentThing).getType() == k5_WeaponThingType) { L0371_B_WeaponDropped = true; @@ -275,11 +275,11 @@ void GroupMan::f186_dropCreatureFixedPossessions(uint16 creatureType, int16 mapX currFixedPossession -= k23_ObjectInfoIndexFirstWeapon; } - Thing nextUnusedThing = _vm->_dungeonMan->f166_getUnusedThing(currThingType); + Thing nextUnusedThing = _vm->_dungeonMan->getUnusedThing(currThingType); if ((nextUnusedThing) == Thing::_none) continue; - Weapon *currWeapon = (Weapon *)_vm->_dungeonMan->f156_getThingData(nextUnusedThing); + Weapon *currWeapon = (Weapon *)_vm->_dungeonMan->getThingData(nextUnusedThing); /* The same pointer type is used no matter the actual type k5_WeaponThingType, k6_ArmourThingType or k10_JunkThingType */ currWeapon->setType(currFixedPossession); currWeapon->setCursed(cursedPossessions); @@ -360,16 +360,16 @@ bool GroupMan::f227_isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 src } bool GroupMan::f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack, bool magicAttack, int16 ticks) { - Door *L0573_ps_Door = (Door *)_vm->_dungeonMan->f157_getSquareFirstThingData(mapX, mapY); + Door *L0573_ps_Door = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); if ((magicAttack && !L0573_ps_Door->isMagicDestructible()) || (!magicAttack && !L0573_ps_Door->isMeleeDestructible())) { return false; } - if (attack >= _vm->_dungeonMan->_g275_currMapDoorInfo[L0573_ps_Door->getType()]._defense) { - byte *L0574_puc_Square = &_vm->_dungeonMan->_g271_currMapData[mapX][mapY]; + if (attack >= _vm->_dungeonMan->_currMapDoorInfo[L0573_ps_Door->getType()]._defense) { + byte *L0574_puc_Square = &_vm->_dungeonMan->_currMapData[mapX][mapY]; if (Square(*L0574_puc_Square).getDoorState() == k4_doorState_CLOSED) { if (ticks) { TimelineEvent L0575_s_Event; - setMapAndTime(L0575_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + ticks); + setMapAndTime(L0575_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ticks); L0575_s_Event._type = k2_TMEventTypeDoorDestruction; L0575_s_Event._priority = 0; L0575_s_Event._B._location._mapX = mapX; @@ -387,9 +387,9 @@ bool GroupMan::f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 Thing GroupMan::f175_groupGetThing(int16 mapX, int16 mapY) { Thing L0317_T_Thing; - L0317_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + L0317_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while ((L0317_T_Thing != Thing::_endOfList) && ((L0317_T_Thing).getType() != k4_GroupThingType)) { - L0317_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0317_T_Thing); + L0317_T_Thing = _vm->_dungeonMan->getNextThing(L0317_T_Thing); } return L0317_T_Thing; } @@ -421,7 +421,7 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature if (getFlag(L0376_ps_CreatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) /* Lord Chaos cannot be damaged */ goto T0190024; if (group->_health[creatureIndex] <= damage) { - L0381_ui_GroupCells = f145_getGroupCells(group, _vm->_dungeonMan->_g272_currMapIndex); + L0381_ui_GroupCells = f145_getGroupCells(group, _vm->_dungeonMan->_currMapIndex); L0384_ui_Cell = (L0381_ui_GroupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : M50_getCreatureValue(L0381_ui_GroupCells, creatureIndex); if (!(L0379_ui_CreatureCount = group->getCount())) { /* If there is a single creature in the group */ if (notMoving) { @@ -430,7 +430,7 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature } AL0375_ui_Outcome = k2_outcomeKilledAllCreaturesInGroup; } else { /* If there are several creatures in the group */ - L0382_ui_GroupDirections = f147_getGroupDirections(group, _vm->_dungeonMan->_g272_currMapIndex); + L0382_ui_GroupDirections = f147_getGroupDirections(group, _vm->_dungeonMan->_currMapIndex); if (getFlag(L0376_ps_CreatureInfo->_attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) { if (notMoving) { f186_dropCreatureFixedPossessions(AL0380_ui_CreatureType, mapX, mapY, L0384_ui_Cell, k2_soundModePlayOneTickLater); @@ -438,14 +438,14 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature _g392_dropMovingCreatureFixedPossessionsCell[_g391_dropMovingCreatureFixedPossCellCount++] = L0384_ui_Cell; } } - L0383_B_CurrentMapIsPartyMap = (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex); + L0383_B_CurrentMapIsPartyMap = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex); if (L0383_B_CurrentMapIsPartyMap) L0378_ps_ActiveGroup = &_g375_activeGroups[group->getActiveGroupIndex()]; if (group->getBehaviour() == k6_behavior_ATTACK) { L0377_ps_Event = _vm->_timeline->_g370_events; for (AL0374_ui_EventIndex = 0; AL0374_ui_EventIndex < _vm->_timeline->_g369_eventMaxCount; AL0374_ui_EventIndex++) { - if ((getMap(L0377_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) && + if ((getMap(L0377_ps_Event->_mapTime) == _vm->_dungeonMan->_currMapIndex) && (L0377_ps_Event->_B._location._mapX == mapX) && (L0377_ps_Event->_B._location._mapY == mapY) && ((AL0375_ui_EventType = L0377_ps_Event->_type) > k32_TMEventTypeUpdateAspectGroup) && @@ -481,8 +481,8 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature } } L0381_ui_GroupCells &= 0x003F; - _vm->_dungeonMan->f146_setGroupCells(group, L0381_ui_GroupCells, _vm->_dungeonMan->_g272_currMapIndex); - _vm->_dungeonMan->f148_setGroupDirections(group, L0382_ui_GroupDirections, _vm->_dungeonMan->_g272_currMapIndex); + _vm->_dungeonMan->setGroupCells(group, L0381_ui_GroupCells, _vm->_dungeonMan->_currMapIndex); + _vm->_dungeonMan->setGroupDirections(group, L0382_ui_GroupDirections, _vm->_dungeonMan->_currMapIndex); group->setCount(group->getCount() - 1); AL0375_ui_Outcome = k1_outcomeKilledSomeCreaturesInGroup; } @@ -513,12 +513,12 @@ void GroupMan::f189_delete(int16 mapX, int16 mapY) { if ((L0372_T_GroupThing = f175_groupGetThing(mapX, mapY)) == Thing::_endOfList) { return; } - L0373_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(L0372_T_GroupThing); + L0373_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0372_T_GroupThing); for (uint16 i = 0; i < 4; ++i) L0373_ps_Group->_health[i] = 0; _vm->_moveSens->f267_getMoveResult(L0372_T_GroupThing, mapX, mapY, kM1_MapXNotOnASquare, 0); L0373_ps_Group->_nextThing = Thing::_none; - if (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) { + if (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) { _g375_activeGroups[L0373_ps_Group->getActiveGroupIndex()]._groupThingIndex = -1; _g377_currActiveGroupCount--; } @@ -533,7 +533,7 @@ void GroupMan::f181_groupDeleteEvents(int16 mapX, int16 mapY) { L0336_ps_Event = _vm->_timeline->_g370_events; for (L0334_i_EventIndex = 0; L0334_i_EventIndex < _vm->_timeline->_g369_eventMaxCount; L0334_i_EventIndex++) { - if ((getMap(L0336_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) && + if ((getMap(L0336_ps_Event->_mapTime) == _vm->_dungeonMan->_currMapIndex) && ((L0335_ui_EventType = L0336_ps_Event->_type) > k29_TMEventTypeGroupReactionDangerOnSquare - 1) && (L0335_ui_EventType < k41_TMEventTypeUpdateBehaviour_3 + 1) && (L0336_ps_Event->_B._location._mapX == mapX) && (L0336_ps_Event->_B._location._mapY == mapY)) { _vm->_timeline->f237_deleteEvent(L0334_i_EventIndex); @@ -635,21 +635,21 @@ void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16 /* If the party is not on the map specified in the event and the event type is not one of 32, 33, 37, 38 then the event is ignored */ - if ((_vm->_dungeonMan->_g272_currMapIndex != _vm->_dungeonMan->_g309_partyMapIndex) && ((AL0446_i_EventType = eventType) != k37_TMEventTypeUpdateBehaviourGroup) && (AL0446_i_EventType != k32_TMEventTypeUpdateAspectGroup) && (AL0446_i_EventType != k38_TMEventTypeUpdateBehaviour_0) && (AL0446_i_EventType != k33_TMEventTypeUpdateAspectCreature_0)) + if ((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) && ((AL0446_i_EventType = eventType) != k37_TMEventTypeUpdateBehaviourGroup) && (AL0446_i_EventType != k32_TMEventTypeUpdateAspectGroup) && (AL0446_i_EventType != k38_TMEventTypeUpdateBehaviour_0) && (AL0446_i_EventType != k33_TMEventTypeUpdateAspectCreature_0)) goto T0209139_Return; /* If there is no creature at the location specified in the event then the event is ignored */ if ((L0449_T_GroupThing = f175_groupGetThing(eventMapX, eventMapY)) == Thing::_endOfList) { goto T0209139_Return; } - L0444_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(L0449_T_GroupThing); + L0444_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0449_T_GroupThing); L0448_s_CreatureInfo = g243_CreatureInfo[L0444_ps_Group->_type]; /* Update the event */ - setMapAndTime(L0465_s_NextEvent._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime); + setMapAndTime(L0465_s_NextEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime); L0465_s_NextEvent._priority = 255 - L0448_s_CreatureInfo._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */ L0465_s_NextEvent._B._location._mapX = eventMapX; L0465_s_NextEvent._B._location._mapY = eventMapY; /* If the creature is not on the party map then try and move the creature in a random direction and place a new event 37 in the timeline for the next creature movement */ - if (_vm->_dungeonMan->_g272_currMapIndex != _vm->_dungeonMan->_g309_partyMapIndex) { + if (_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) { if (f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->getRandomNumber(4), false)) { /* BUG0_67 A group that is not on the party map may wrongly move or not move into a teleporter. Normally, a creature type with Wariness >= 10 (Vexirk, Materializer / Zytaz, Demon, Lord Chaos, Red Dragon / Dragon) would only move into a teleporter if the creature type is allowed on the destination map. However, the variable G0380_T_CurrentGroupThing identifying the group is not set before being used by F0139_DUNGEON_IsCreatureAllowedOnMap called by f202_isMovementPossible so the check to see if the creature type is allowed may operate on another creature type and thus return an incorrect result, causing the creature to teleport while it should not, or not to teleport while it should */ AL0450_i_DestinationMapX = eventMapX; AL0451_i_DestinationMapY = eventMapY; @@ -660,7 +660,7 @@ void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16 L0465_s_NextEvent._B._location._mapY = _vm->_moveSens->_g398_moveResultMapY; } L0465_s_NextEvent._type = k37_TMEventTypeUpdateBehaviourGroup; - AL0446_i_Ticks = MAX(ABS(_vm->_dungeonMan->_g272_currMapIndex - _vm->_dungeonMan->_g309_partyMapIndex) << 4, L0448_s_CreatureInfo._movementTicks << 1); + AL0446_i_Ticks = MAX(ABS(_vm->_dungeonMan->_currMapIndex - _vm->_dungeonMan->_partyMapIndex) << 4, L0448_s_CreatureInfo._movementTicks << 1); /* BUG0_68 A group moves or acts with a wrong timing. Event is added below but L0465_s_NextEvent.C.Ticks has not been initialized. No consequence while the group is not on the party map. When the party enters the group map the first group event may have a wrong timing */ T0209005_AddEventAndReturn: L0465_s_NextEvent._mapTime += AL0446_i_Ticks; @@ -707,14 +707,14 @@ T0209005_AddEventAndReturn: AL0447_i_Behavior = L0444_ps_Group->getBehaviour(); L0460_ui_CreatureCount = L0444_ps_Group->getCount(); L0459_i_CreatureSize = getFlag(L0448_s_CreatureInfo._attributes, k0x0003_MaskCreatureInfo_size); - AL0450_i_DistanceXToParty = ((AL0446_i_Distance = eventMapX - _vm->_dungeonMan->_g306_partyMapX) < 0) ? -AL0446_i_Distance : AL0446_i_Distance; - AL0451_i_DistanceYToParty = ((AL0446_i_Distance = eventMapY - _vm->_dungeonMan->_g307_partyMapY) < 0) ? -AL0446_i_Distance : AL0446_i_Distance; + AL0450_i_DistanceXToParty = ((AL0446_i_Distance = eventMapX - _vm->_dungeonMan->_partyMapX) < 0) ? -AL0446_i_Distance : AL0446_i_Distance; + AL0451_i_DistanceYToParty = ((AL0446_i_Distance = eventMapY - _vm->_dungeonMan->_partyMapY) < 0) ? -AL0446_i_Distance : AL0446_i_Distance; _g378_currentGroupMapX = eventMapX; _g379_currentGroupMapY = eventMapY; _g380_currGroupThing = L0449_T_GroupThing; _g384_groupMovementTestedDirections[0] = 0; - _g381_currGroupDistanceToParty = f226_getDistanceBetweenSquares(eventMapX, eventMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); - _g382_currGroupPrimaryDirToParty = f228_getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + _g381_currGroupDistanceToParty = f226_getDistanceBetweenSquares(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); + _g382_currGroupPrimaryDirToParty = f228_getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); _g383_currGroupSecondaryDirToParty = _vm->_projexpl->_g363_secondaryDirToOrFromParty; L0464_l_NextAspectUpdateTime = 0; L0455_B_CurrentEventTypeIsNotUpdateBehavior = true; @@ -725,8 +725,8 @@ T0209005_AddEventAndReturn: f181_groupDeleteEvents(eventMapX, eventMapY); goto T0209044_SetBehavior6_Attack; } - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; goto T0209139_Return; case kM2_TMEventTypeCreateReactionEvent30HitByProjectile: /* This event is used for the reaction of a group after a projectile impacted with one creature in the group (some creatures may have been killed) */ if ((AL0447_i_Behavior == k6_behavior_ATTACK) || (AL0447_i_Behavior == k5_behavior_FLEE)) /* If the creature is attacking the party or fleeing from the target then there is no reaction */ @@ -749,13 +749,13 @@ T0209005_AddEventAndReturn: L0465_s_NextEvent._type = eventType + 5; if (f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) { if ((AL0447_i_Behavior != k6_behavior_ATTACK) && (AL0447_i_Behavior != k5_behavior_FLEE)) { - if (getDistance(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, eventMapX, eventMapY) <= 1) + if (getDistance(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, eventMapX, eventMapY) <= 1) goto T0209044_SetBehavior6_Attack; if (((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k3_behavior_USELESS)) && (AL0447_i_Behavior != k7_behavior_APPROACH)) /* BUG0_00 Useless code. Behavior cannot be 3 because this value is never used. Moreover, the second condition in the && is redundant (if the value is 0 or 3, it cannot be 7). The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */ goto T0209054_SetBehavior7_Approach; } - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; } if (AL0447_i_Behavior == k6_behavior_ATTACK) { AL0446_i_CreatureAspectIndex = eventType - k33_TMEventTypeUpdateAspectCreature_0; /* Value -1 for event 32, meaning aspect will be updated for all creatures in the group */ @@ -780,8 +780,8 @@ T0209044_SetBehavior6_Attack: if (eventType == kM2_TMEventTypeCreateReactionEvent30HitByProjectile) { f181_groupDeleteEvents(eventMapX, eventMapY); } - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; L0444_ps_Group->setBehaviour(k6_behavior_ATTACK); AL0446_i_Direction = _g382_currGroupPrimaryDirToParty; for (AL0447_i_CreatureIndex = L0460_ui_CreatureCount; AL0447_i_CreatureIndex >= 0; AL0447_i_CreatureIndex--) { @@ -803,8 +803,8 @@ T0209044_SetBehavior6_Attack: if (AL0447_i_Behavior != k2_behavior_USELESS) { /* BUG0_00 Useless code. Behavior cannot be 2 because this value is never used */ T0209054_SetBehavior7_Approach: L0444_ps_Group->setBehaviour(k7_behavior_APPROACH); - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; L0465_s_NextEvent._mapTime += 1; goto T0209134_SetEvent37; } @@ -853,8 +853,8 @@ T0209061_MoveGroup: !f203_getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false) || _vm->getRandomNumber(2))) goto T0209044_SetBehavior6_Attack; - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; } } while ((AL0446_i_Direction = returnNextVal(AL0446_i_Direction)) != AL0447_i_ReferenceDirection); } @@ -892,8 +892,8 @@ T0209073_SetDirectionGroup: T0209081_RunTowardParty: L0461_i_MovementTicks++; L0461_i_MovementTicks = L0461_i_MovementTicks >> 1; /* Running speed is half the movement ticks */ - AL0450_i_TargetMapX = (L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX); - AL0451_i_TargetMapY = (L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY); + AL0450_i_TargetMapX = (L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX); + AL0451_i_TargetMapY = (L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY); } else { T0209082_WalkTowardTarget: AL0450_i_TargetMapX = L0445_ps_ActiveGroup->_targetMapX; @@ -940,8 +940,8 @@ T0209094_FleeFromTarget: /* If the creature can see the party then update target coordinates */ L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY); if (L0452_i_DistanceToVisibleParty) { - AL0450_i_TargetMapX = (L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX); - AL0451_i_TargetMapY = (L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY); + AL0450_i_TargetMapX = (L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX); + AL0451_i_TargetMapY = (L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY); } else { if (!(--(L0445_ps_ActiveGroup->_delayFleeingFromTarget))) { /* If the creature is not afraid anymore then stop fleeing from target */ T0209096_SetBehavior0_Wander: @@ -952,7 +952,7 @@ T0209096_SetBehavior0_Wander: if (_vm->getRandomNumber(2)) { /* If the creature cannot move and the party is adjacent then stop fleeing */ if (!f203_getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false)) { - if (getDistance(eventMapX, eventMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1) + if (getDistance(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY) <= 1) goto T0209096_SetBehavior0_Wander; } /* Set creature target to the home square where the creature was located when the party entered the map */ @@ -992,8 +992,8 @@ T0209096_SetBehavior0_Wander: L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, AL0447_i_CreatureIndex, eventMapX, eventMapY); /* If the party is visible, update the target coordinates */ if (L0452_i_DistanceToVisibleParty) { - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; } /* If there is a single creature in the group that is not full square sized and 1/4 chance */ if (!L0460_ui_CreatureCount && (L0459_i_CreatureSize != k2_MaskCreatureSizeFull) && !((AL0446_i_GroupCellsCriteria = _vm->getRandomNumber(65536)) & 0x00C0)) { @@ -1059,8 +1059,8 @@ T0209096_SetBehavior0_Wander: } else { /* If the party is visible, update target coordinates */ if (f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) { - L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_g306_partyMapX; - L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY; + L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX; + L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY; f205_setDirection(L0445_ps_ActiveGroup, L0454_i_PrimaryDirectionToOrFromParty, AL0447_i_CreatureIndex, L0460_ui_CreatureCount && (L0459_i_CreatureSize == k1_MaskCreatureSizeHalf)); L0465_s_NextEvent._mapTime += 2; L0464_l_NextAspectUpdateTime = filterTime(L0465_s_NextEvent._mapTime); @@ -1110,14 +1110,14 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i if (creatureInfo->_movementTicks == k255_immobile) { return false; } - _vm->_dungeonMan->f150_mapCoordsAfterRelMovement((Direction)dir, 1, 0, mapX, mapY); + _vm->_dungeonMan->mapCoordsAfterRelMovement((Direction)dir, 1, 0, mapX, mapY); L0428_i_MapX = mapX; L0429_i_MapY = mapY; - L0430_ui_Square = _vm->_dungeonMan->_g271_currMapData[L0428_i_MapX][L0429_i_MapY]; + L0430_ui_Square = _vm->_dungeonMan->_currMapData[L0428_i_MapX][L0429_i_MapY]; L0431_i_SquareType = Square(L0430_ui_Square).getType(); _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = - !(((L0428_i_MapX >= 0) && (L0428_i_MapX < _vm->_dungeonMan->_g273_currMapWidth)) && - ((L0429_i_MapY >= 0) && (L0429_i_MapY < _vm->_dungeonMan->_g274_currMapHeight)) && + !(((L0428_i_MapX >= 0) && (L0428_i_MapX < _vm->_dungeonMan->_currMapWidth)) && + ((L0429_i_MapY >= 0) && (L0429_i_MapY < _vm->_dungeonMan->_currMapHeight)) && (L0431_i_SquareType != k0_ElementTypeWall) && (L0431_i_SquareType != k3_ElementTypeStairs) && ((L0431_i_SquareType != k2_ElementTypePit) || (getFlag(L0430_ui_Square, k0x0001_PitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(L0430_ui_Square, k0x0008_PitOpen) || getFlag(creatureInfo->_attributes, k0x0020_MaskCreatureInfo_levitation)) && @@ -1127,10 +1127,10 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i return false; if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) { - L0433_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(L0428_i_MapX, L0429_i_MapY); + L0433_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0428_i_MapX, L0429_i_MapY); while (L0433_T_Thing != Thing::_endOfList) { if ((L0433_T_Thing).getType() == k15_ExplosionThingType) { - L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f156_getThingData(L0433_T_Thing); + L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getThingData(L0433_T_Thing); if (((Explosion *)L0432_ps_Teleporter)->setType(k50_ExplosionType_Fluxcage)) { _g385_fluxCages[dir] = true; _g386_fluxCageCount++; @@ -1138,23 +1138,23 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i return false; } } - L0433_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0433_T_Thing); + L0433_T_Thing = _vm->_dungeonMan->getNextThing(L0433_T_Thing); } } if ((L0431_i_SquareType == k5_ElementTypeTeleporter) && getFlag(L0430_ui_Square, k0x0008_TeleporterOpen) && (creatureInfo->getWariness() >= 10)) { - L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f157_getSquareFirstThingData(L0428_i_MapX, L0429_i_MapY); - if (getFlag(L0432_ps_Teleporter->getScope(), k0x0001_TelepScopeCreatures) && !_vm->_dungeonMan->f139_isCreatureAllowedOnMap(_g380_currGroupThing, L0432_ps_Teleporter->getTargetMapIndex())) { + L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getSquareFirstThingData(L0428_i_MapX, L0429_i_MapY); + if (getFlag(L0432_ps_Teleporter->getScope(), k0x0001_TelepScopeCreatures) && !_vm->_dungeonMan->isCreatureAllowedOnMap(_g380_currGroupThing, L0432_ps_Teleporter->getTargetMapIndex())) { _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = true; return false; } } - _g390_groupMovementBlockedByParty = (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0428_i_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0429_i_MapY == _vm->_dungeonMan->_g307_partyMapY); + _g390_groupMovementBlockedByParty = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0428_i_MapX == _vm->_dungeonMan->_partyMapX) && (L0429_i_MapY == _vm->_dungeonMan->_partyMapY); if (_g390_groupMovementBlockedByParty) return false; if (L0431_i_SquareType == k4_DoorElemType) { - L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f157_getSquareFirstThingData(L0428_i_MapX, L0429_i_MapY); + L0432_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getSquareFirstThingData(L0428_i_MapX, L0429_i_MapY); if (((Square(L0430_ui_Square).getDoorState()) > (((Door *)L0432_ps_Teleporter)->opensVertically() ? CreatureInfo::getHeight(creatureInfo->_attributes) : 1)) && ((Square(L0430_ui_Square).getDoorState()) != k5_doorState_DESTROYED) && !getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) { _g389_groupMovementBlockedByDoor = true; return false; @@ -1204,7 +1204,7 @@ T0200006: L0421_i_CreatureViewDirectionCount = 1; } while (L0421_i_CreatureViewDirectionCount--) { - if (f227_isDestVisibleFromSource(L0425_ai_CreatureViewDirections[L0421_i_CreatureViewDirectionCount], mapX, mapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY)) { + if (f227_isDestVisibleFromSource(L0425_ai_CreatureViewDirections[L0421_i_CreatureViewDirectionCount], mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) { T0200011: AL0422_i_SightRange = L0424_ps_CreatureInfo->getSightRange(); if (!getFlag(L0424_ps_CreatureInfo->_attributes, k0x1000_MaskCreatureInfo_nightVision)) { @@ -1213,7 +1213,7 @@ T0200011: if (_g381_currGroupDistanceToParty > MAX((int16)1, AL0422_i_SightRange)) { return 0; } - return f199_getDistanceBetweenUnblockedSquares(mapX, mapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, &GroupMan::f197_isViewPartyBlocked); + return f199_getDistanceBetweenUnblockedSquares(mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::f197_isViewPartyBlocked); } } return 0; @@ -1267,12 +1267,12 @@ int16 GroupMan::f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 src } bool GroupMan::f197_isViewPartyBlocked(uint16 mapX, uint16 mapY) { - uint16 L0404_ui_Square = _vm->_dungeonMan->_g271_currMapData[mapX][mapY]; + uint16 L0404_ui_Square = _vm->_dungeonMan->_currMapData[mapX][mapY]; int16 L0405_i_SquareType = Square(L0404_ui_Square).getType(); if (L0405_i_SquareType == k4_DoorElemType) { - Door *L0407_ps_Door = (Door *)_vm->_dungeonMan->f157_getSquareFirstThingData(mapX, mapY); + Door *L0407_ps_Door = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY); int16 L0406_i_DoorState = Square(L0404_ui_Square).getDoorState(); - return ((L0406_i_DoorState == k3_doorState_FOURTH) || (L0406_i_DoorState == k4_doorState_CLOSED)) && !getFlag(_vm->_dungeonMan->_g275_currMapDoorInfo[L0407_ps_Door->getType()]._attributes, k0x0001_MaskDoorInfo_CraturesCanSeeThrough); + return ((L0406_i_DoorState == k3_doorState_FOURTH) || (L0406_i_DoorState == k4_doorState_CLOSED)) && !getFlag(_vm->_dungeonMan->_currMapDoorInfo[L0407_ps_Door->getType()]._attributes, k0x0001_MaskDoorInfo_CraturesCanSeeThrough); } return (L0405_i_SquareType == k0_ElementTypeWall) || ((L0405_i_SquareType == k6_ElementTypeFakeWall) && !getFlag(L0404_ui_Square, k0x0004_FakeWallOpen)); } @@ -1288,7 +1288,7 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 uint16 L0331_ui_CreatureType; uint16 L1635_ui_SoundIndex; - L0329_ps_Group = &(((Group *)_vm->_dungeonMan->_g284_thingData[k4_GroupThingType])[activeGroup->_groupThingIndex]); + L0329_ps_Group = &(((Group *)_vm->_dungeonMan->_thingData[k4_GroupThingType])[activeGroup->_groupThingIndex]); L0327_ui_CreatureGraphicInfo = g243_CreatureInfo[L0331_ui_CreatureType = L0329_ps_Group->_type]._graphicInfo; L0330_B_ProcessGroup = (creatureIndex < 0); if (L0330_B_ProcessGroup) /* If the creature index is negative then all creatures in the group are processed */ @@ -1398,7 +1398,7 @@ int16 GroupMan::f201_getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo if (!(L0426_ui_SmellRange = creatureInfo->getSmellRange())) { return 0; } - if ((((L0426_ui_SmellRange + 1) >> 1) >= _g381_currGroupDistanceToParty) && f199_getDistanceBetweenUnblockedSquares(mapY, mapX, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, &GroupMan::f198_isSmellPartyBlocked)) { + if ((((L0426_ui_SmellRange + 1) >> 1) >= _g381_currGroupDistanceToParty) && f199_getDistanceBetweenUnblockedSquares(mapY, mapX, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::f198_isSmellPartyBlocked)) { _vm->_projexpl->_g363_secondaryDirToOrFromParty = _g383_currGroupSecondaryDirToParty; return _vm->indexToOrdinal(_g382_currGroupPrimaryDirToParty); } @@ -1412,7 +1412,7 @@ bool GroupMan::f198_isSmellPartyBlocked(uint16 mapX, uint16 mapY) { uint16 L0408_ui_Square; int16 L0409_i_SquareType; - return ((L0409_i_SquareType = Square(L0408_ui_Square = _vm->_dungeonMan->_g271_currMapData[mapX][mapY]).getType()) == k0_ElementTypeWall) || ((L0409_i_SquareType == k6_ElementTypeFakeWall) && !getFlag(L0408_ui_Square, k0x0004_FakeWallOpen)); + return ((L0409_i_SquareType = Square(L0408_ui_Square = _vm->_dungeonMan->_currMapData[mapX][mapY]).getType()) == k0_ElementTypeWall) || ((L0409_i_SquareType == k6_ElementTypeFakeWall) && !getFlag(L0408_ui_Square, k0x0004_FakeWallOpen)); } int16 GroupMan::f203_getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 mapX, int16 mapY, bool allowMovementOverImaginaryPitsAndFakeWalls) { @@ -1606,7 +1606,7 @@ void GroupMan::f193_stealFromChampion(Group *group, uint16 championIndex) { The following statement is missing: L0394_T_Thing->Next = Thing::_endOfList; This creates cloned things if L0394_T_Thing->Next is not Thing::_endOfList which is the case when the object comes from a chest in which it was not the last object */ } else { - _vm->_dungeonMan->f163_linkThingToList(L0394_T_Thing, group->_slot, kM1_MapXNotOnASquare, 0); + _vm->_dungeonMan->linkThingToList(L0394_T_Thing, group->_slot, kM1_MapXNotOnASquare, 0); } _vm->_championMan->drawChampionState((ChampionIndex)championIndex); } @@ -1649,7 +1649,7 @@ int16 GroupMan::f230_getChampionDamage(Group *group, uint16 champIndex) { if (_vm->_championMan->_partyIsSleeping) { _vm->_championMan->wakeUp(); } - L0563_i_DoubledMapDifficulty = _vm->_dungeonMan->_g269_currMap->_difficulty << 1; + L0563_i_DoubledMapDifficulty = _vm->_dungeonMan->_currMap->_difficulty << 1; L0564_s_CreatureInfo = g243_CreatureInfo[group->_type]; _vm->_championMan->addSkillExperience(champIndex, k7_ChampionSkillParry, L0564_s_CreatureInfo.getExperience()); if (_vm->_championMan->_partyIsSleeping || (((_vm->_championMan->getDexterity(L0562_ps_Champion) < (_vm->getRandomNumber(32) + L0564_s_CreatureInfo._dexterity + L0563_i_DoubledMapDifficulty - 16)) || !_vm->getRandomNumber(4)) && !_vm->_championMan->isLucky(L0562_ps_Champion, 60))) { @@ -1679,7 +1679,7 @@ int16 GroupMan::f230_getChampionDamage(Group *group, uint16 champIndex) { AL0558_i_Damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(champIndex, AL0558_i_Attack, AL0561_ui_AllowedWound, L0564_s_CreatureInfo._attackType); if (AL0558_i_Damage) { - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k2_soundModePlayOneTickLater); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater); AL0559_ui_PoisonAttack = L0564_s_CreatureInfo._poisonAttack; if (AL0559_ui_PoisonAttack && _vm->getRandomNumber(2)) { @@ -1700,7 +1700,7 @@ void GroupMan::f187_dropMovingCreatureFixedPossession(Thing thing, int16 mapX, i if (_g391_dropMovingCreatureFixedPossCellCount) { - L0363_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(thing); + L0363_ps_Group = (Group *)_vm->_dungeonMan->getThingData(thing); L0364_i_CreatureType = L0363_ps_Group->_type; while (_g391_dropMovingCreatureFixedPossCellCount) { f186_dropCreatureFixedPossessions(L0364_i_CreatureType, mapX, mapY, _g392_dropMovingCreatureFixedPossessionsCell[--_g391_dropMovingCreatureFixedPossCellCount], k2_soundModePlayOneTickLater); @@ -1713,11 +1713,11 @@ void GroupMan::f180_startWanedring(int16 mapX, int16 mapY) { TimelineEvent L0333_s_Event; - L0332_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(f175_groupGetThing(mapX, mapY)); + L0332_ps_Group = (Group *)_vm->_dungeonMan->getThingData(f175_groupGetThing(mapX, mapY)); if (L0332_ps_Group->getBehaviour() >= k4_behavior_USELESS) { L0332_ps_Group->setBehaviour(k0_behavior_WANDER); } - setMapAndTime(L0333_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, (_vm->_gameTime + 1)); + setMapAndTime(L0333_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, (_vm->_gameTime + 1)); L0333_s_Event._type = k37_TMEventTypeUpdateBehaviourGroup; L0333_s_Event._priority = 255 - g243_CreatureInfo[L0332_ps_Group->_type]._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */ L0333_s_Event._C._ticks = 0; @@ -1743,7 +1743,7 @@ void GroupMan::f183_addActiveGroup(Thing thing, int16 mapX, int16 mapY) { } _g377_currActiveGroupCount++; - L0340_ps_Group = (Group *)(_vm->_dungeonMan->_g284_thingData[k4_GroupThingType] + + L0340_ps_Group = (Group *)(_vm->_dungeonMan->_thingData[k4_GroupThingType] + g235_ThingDataWordCount[k4_GroupThingType] * (L0341_ps_ActiveGroup->_groupThingIndex = (thing).getIndex())); L0341_ps_ActiveGroup->_cells = L0340_ps_Group->_cells; @@ -1768,7 +1768,7 @@ void GroupMan::f184_removeActiveGroup(uint16 activeGroupIndex) { return; } L0347_ps_ActiveGroup = &_g375_activeGroups[activeGroupIndex]; - L0348_ps_Group = &((Group *)_vm->_dungeonMan->_g284_thingData[k4_GroupThingType])[L0347_ps_ActiveGroup->_groupThingIndex]; + L0348_ps_Group = &((Group *)_vm->_dungeonMan->_thingData[k4_GroupThingType])[L0347_ps_ActiveGroup->_groupThingIndex]; _g377_currActiveGroupCount--; L0348_ps_Group->_cells = L0347_ps_ActiveGroup->_cells; L0348_ps_Group->setDir(normalizeModulo4(L0347_ps_ActiveGroup->_directions)); @@ -1794,10 +1794,10 @@ void GroupMan::f195_addAllActiveGroups() { Thing *L0402_pT_SquareFirstThing; - L0401_puc_Square = _vm->_dungeonMan->_g271_currMapData[0]; - L0402_pT_SquareFirstThing = &_vm->_dungeonMan->_g283_squareFirstThings[_vm->_dungeonMan->_g270_currMapColCumulativeSquareFirstThingCount[0]]; - for (L0398_ui_MapX = 0; L0398_ui_MapX < _vm->_dungeonMan->_g273_currMapWidth; L0398_ui_MapX++) { - for (L0399_ui_MapY = 0; L0399_ui_MapY < _vm->_dungeonMan->_g274_currMapHeight; L0399_ui_MapY++) { + L0401_puc_Square = _vm->_dungeonMan->_currMapData[0]; + L0402_pT_SquareFirstThing = &_vm->_dungeonMan->_squareFirstThings[_vm->_dungeonMan->_currMapColCumulativeSquareFirstThingCount[0]]; + for (L0398_ui_MapX = 0; L0398_ui_MapX < _vm->_dungeonMan->_currMapWidth; L0398_ui_MapX++) { + for (L0399_ui_MapY = 0; L0399_ui_MapY < _vm->_dungeonMan->_currMapHeight; L0399_ui_MapY++) { if (getFlag(*L0401_puc_Square++, k0x0010_ThingListPresent)) { L0400_T_Thing = *L0402_pT_SquareFirstThing++; do { @@ -1807,7 +1807,7 @@ void GroupMan::f195_addAllActiveGroups() { f180_startWanedring(L0398_ui_MapX, L0399_ui_MapY); break; } - } while ((L0400_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0400_T_Thing)) != Thing::_endOfList); + } while ((L0400_T_Thing = _vm->_dungeonMan->getNextThing(L0400_T_Thing)) != Thing::_endOfList); } } } @@ -1823,10 +1823,10 @@ Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplie bool L0355_B_SeveralCreaturesInGroup; - if (((_g377_currActiveGroupCount >= (_g376_maxActiveGroupCount - 5)) && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex)) || ((L0349_T_GroupThing = _vm->_dungeonMan->f166_getUnusedThing(k4_GroupThingType)) == Thing::_none)) { + if (((_g377_currActiveGroupCount >= (_g376_maxActiveGroupCount - 5)) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) || ((L0349_T_GroupThing = _vm->_dungeonMan->getUnusedThing(k4_GroupThingType)) == Thing::_none)) { return Thing::_none; } - L0353_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(L0349_T_GroupThing); + L0353_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0349_T_GroupThing); L0353_ps_Group->_slot = Thing::_endOfList; L0353_ps_Group->setDoNotDiscard(false); L0353_ps_Group->setDir(dir); @@ -1860,7 +1860,7 @@ Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplie bool GroupMan::f223_isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY) { int16 L0544_i_SquareType; - return (((L0544_i_SquareType = Square(_vm->_dungeonMan->f151_getSquare(mapX, mapY)).getType()) == k1_CorridorElemType) + return (((L0544_i_SquareType = Square(_vm->_dungeonMan->getSquare(mapX, mapY)).getType()) == k1_CorridorElemType) || (L0544_i_SquareType == k5_ElementTypeTeleporter) || (L0544_i_SquareType == k2_ElementTypePit) || (L0544_i_SquareType == k4_DoorElemType)); } @@ -1875,7 +1875,7 @@ int16 GroupMan::f177_getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, i if (L0323_T_GroupThing == Thing::_endOfList) return 0; - L0324_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(L0323_T_GroupThing); + L0324_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0323_T_GroupThing); f229_setOrderedCellsToAttack(L0325_auc_OrderedCellsToAttack, groupX, groupY, partyX, partyY, champCell); L0321_ui_Counter = 0; for (;;) { /*_Infinite loop_*/ @@ -1903,7 +1903,7 @@ int16 GroupMan::f231_getMeleeActionDamage(Champion* champ, int16 champIndex, Gro if (!champ->_currHealth) { return 0; } - L0567_i_DoubledMapDifficulty = _vm->_dungeonMan->_g269_currMap->_difficulty << 1; + 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]); L0570_B_ActionHitsNonMaterialCreatures = getFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures); @@ -1978,17 +1978,17 @@ void GroupMan::f224_fluxCageAction(int16 mapX, int16 mapY) { TimelineEvent L0547_s_Event; - AL0546_i_SquareType = _vm->_dungeonMan->f151_getSquare(mapX, mapY).getType(); + AL0546_i_SquareType = _vm->_dungeonMan->getSquare(mapX, mapY).getType(); if ((AL0546_i_SquareType == k0_ElementTypeWall) || (AL0546_i_SquareType == k3_ElementTypeStairs)) return; - L0545_T_Thing = _vm->_dungeonMan->f166_getUnusedThing(k15_ExplosionThingType); + L0545_T_Thing = _vm->_dungeonMan->getUnusedThing(k15_ExplosionThingType); if (L0545_T_Thing == Thing::_none) return; - _vm->_dungeonMan->f163_linkThingToList(L0545_T_Thing, Thing(0), mapX, mapY); - (((Explosion*)_vm->_dungeonMan->_g284_thingData[k15_ExplosionThingType])[L0545_T_Thing.getIndex()]).setType(k50_ExplosionType_Fluxcage); - setMapAndTime(L0547_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + 100); + _vm->_dungeonMan->linkThingToList(L0545_T_Thing, Thing(0), mapX, mapY); + (((Explosion*)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[L0545_T_Thing.getIndex()]).setType(k50_ExplosionType_Fluxcage); + setMapAndTime(L0547_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 100); L0547_s_Event._type = k24_TMEventTypeRemoveFluxcage; L0547_s_Event._priority = 0; L0547_s_Event._C._slot = L0545_T_Thing.toUint16(); @@ -2034,7 +2034,7 @@ uint16 GroupMan::f222_isLordChaosOnSquare(int16 mapX, int16 mapY) { if (L0542_T_Thing == Thing::_endOfList) return 0; - L0543_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(L0542_T_Thing); + L0543_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0542_T_Thing); if (L0543_ps_Group->_type == k23_CreatureTypeLordChaos) return L0542_T_Thing.toUint16(); @@ -2045,16 +2045,16 @@ bool GroupMan::f221_isFluxcageOnSquare(int16 mapX, int16 mapY) { Thing L0540_T_Thing; int16 L0541_i_SquareType; - L0541_i_SquareType = _vm->_dungeonMan->f151_getSquare(mapX, mapY).getType(); + L0541_i_SquareType = _vm->_dungeonMan->getSquare(mapX, mapY).getType(); if ((L0541_i_SquareType == k0_ElementTypeWall) || (L0541_i_SquareType == k3_ElementTypeStairs)) return false; - L0540_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + L0540_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (L0540_T_Thing != Thing::_endOfList) { - if ((L0540_T_Thing.getType() == k15_ExplosionThingType) && (((Explosion*)_vm->_dungeonMan->_g284_thingData[k15_ExplosionThingType])[L0540_T_Thing.getIndex()].getType() == k50_ExplosionType_Fluxcage)) { + if ((L0540_T_Thing.getType() == k15_ExplosionThingType) && (((Explosion*)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[L0540_T_Thing.getIndex()].getType() == k50_ExplosionType_Fluxcage)) { return true; } - L0540_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0540_T_Thing); + L0540_T_Thing = _vm->_dungeonMan->getNextThing(L0540_T_Thing); } return false; } @@ -2068,7 +2068,7 @@ void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) { bool L0554_aB_Fluxcages[4]; Thing L0555_T_LordChaosThing; - if ((mapX < 0) || (mapX >= _vm->_dungeonMan->_g273_currMapWidth) || (mapY < 0) || (mapY >= _vm->_dungeonMan->_g274_currMapHeight)) { + if ((mapX < 0) || (mapX >= _vm->_dungeonMan->_currMapWidth) || (mapY < 0) || (mapY >= _vm->_dungeonMan->_currMapHeight)) { return; } diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 222be9227c..fd132d7fac 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -281,7 +281,7 @@ void InventoryMan::f334_closeChest() { bool processFirstChestSlot = true; if (_g426_openChest == Thing::_none) return; - Container *container = (Container*)dunMan.f156_getThingData(_g426_openChest); + Container *container = (Container*)dunMan.getThingData(_g426_openChest); _g426_openChest = Thing::_none; container->getSlot() = Thing::_endOfList; Thing prevThing; @@ -292,10 +292,10 @@ void InventoryMan::f334_closeChest() { if (processFirstChestSlot) { processFirstChestSlot = false; - *dunMan.f156_getThingData(thing) = Thing::_endOfList.toUint16(); + *dunMan.getThingData(thing) = Thing::_endOfList.toUint16(); container->getSlot() = prevThing = thing; } else { - dunMan.f163_linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0); + dunMan.linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0); prevThing = thing; } } @@ -317,7 +317,7 @@ void InventoryMan::f341_drawPanelScroll(Scroll* scroll) { DisplayMan &dispMan = *_vm->_displayMan; char stringFirstLine[300]; - _vm->_dungeonMan->f168_decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); char *charRed = stringFirstLine; while (*charRed && (*charRed != '\n')) { charRed++; @@ -385,7 +385,7 @@ void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bo objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.f33_getIconIndex(thing)); _g425_chestSlots[chestSlotIndex++] = thing; - thing = _vm->_dungeonMan->f159_getNextThing(thing); + thing = _vm->_dungeonMan->getNextThing(thing); } while (chestSlotIndex < 8) { objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); @@ -502,7 +502,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) { f334_closeChest(); } - uint16 *rawThingPtr = dunMan.f156_getThingData(thingToDraw); + uint16 *rawThingPtr = dunMan.getThingData(thingToDraw); f335_drawPanelObjectDescriptionString("\f"); // form feed ThingType thingType = thingToDraw.getType(); if (thingType == k7_ScrollThingType) { @@ -671,7 +671,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) { } - uint16 weight = dunMan.f140_getObjectWeight(thingToDraw); + uint16 weight = dunMan.getObjectWeight(thingToDraw); strcat(str, champMan.getStringFromInteger(weight / 10, false, 3).c_str()); switch (_vm->getGameLanguage()) { // localized @@ -699,7 +699,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) { void InventoryMan::f337_setDungeonViewPalette() { static const int16 g40_palIndexToLightAmmount[6] = {99, 75, 50, 25, 1, 0}; // @ G0040_ai_Graphic562_PaletteIndexToLightAmount - if (_vm->_dungeonMan->_g269_currMap->_difficulty == 0) { + if (_vm->_dungeonMan->_currMap->_difficulty == 0) { _vm->_displayMan->_g304_dungeonViewPaletteIndex = 0; /* Brightest color palette index */ } else { /* Get torch light power from both hands of each champion in the party */ @@ -713,7 +713,7 @@ void InventoryMan::f337_setDungeonViewPalette() { 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)) { - Weapon *L1042_ps_Weapon = (Weapon*)_vm->_dungeonMan->f156_getThingData(Thing(AL1044_T_Thing)); + Weapon *L1042_ps_Weapon = (Weapon*)_vm->_dungeonMan->getThingData(Thing(AL1044_T_Thing)); *AL1040_pi_TorchLightPower = L1042_ps_Weapon->getChargeCount(); } else { *AL1040_pi_TorchLightPower = 0; @@ -781,7 +781,7 @@ void InventoryMan::f338_decreaseTorchesLightPower() { while (L1047_i_SlotIndex--) { int16 L1049_i_IconIndex = _vm->_objectMan->f33_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->f156_getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); + Weapon *L1051_ps_Weapon = (Weapon *)_vm->_dungeonMan->getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); if (L1051_ps_Weapon->getChargeCount()) { if (L1051_ps_Weapon->setChargeCount(L1051_ps_Weapon->getChargeCount() - 1) == 0) { L1051_ps_Weapon->setDoNotDiscard(false); @@ -947,14 +947,14 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { if (_vm->_championMan->_candidateChampionOrdinal) { return; } - if (!getFlag(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(L1078_T_Thing = _vm->_championMan->_leaderHandObject)]._allowedSlots, k0x0001_ObjectAllowedSlotMouth)) { + 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); AL1088_ui_ThingType = L1078_T_Thing.getType(); - L1089_ui_Weight = _vm->_dungeonMan->f140_getObjectWeight(L1078_T_Thing); + L1089_ui_Weight = _vm->_dungeonMan->getObjectWeight(L1078_T_Thing); L1083_ps_Champion = &_vm->_championMan->_champions[L1080_ui_ChampionIndex = _vm->ordinalToIndex(_g432_inventoryChampionOrdinal)]; - L1082_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1078_T_Thing); + L1082_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L1078_T_Thing); if ((L1079_ui_IconIndex >= k8_IconIndiceJunkWater) && (L1079_ui_IconIndex <= k9_IconIndiceJunkWaterSkin)) { if (!(L1082_ps_Junk->getChargeCount())) { return; @@ -1004,7 +1004,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { } L1083_ps_Champion->_shieldDefense += AL1085_ui_AdjustedPotionPower; L1084_s_Event._type = k72_TMEventTypeChampionShield; - setMapAndTime(L1084_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + (AL1085_ui_AdjustedPotionPower * AL1085_ui_AdjustedPotionPower)); + setMapAndTime(L1084_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + (AL1085_ui_AdjustedPotionPower * AL1085_ui_AdjustedPotionPower)); L1084_s_Event._priority = L1080_ui_ChampionIndex; L1084_s_Event._B._defense = AL1085_ui_AdjustedPotionPower; _vm->_timeline->f238_addEventGetEventIndex(&L1084_s_Event); @@ -1059,10 +1059,10 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { } } else { _vm->_championMan->drawChangedObjectIcons(); - _vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(L1078_T_Thing) - L1089_ui_Weight; + _vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(L1078_T_Thing) - L1089_ui_Weight; setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad); } - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k08_soundSWALLOW, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k0_soundModePlayImmediately); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately); setFlag(L1083_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics); if (_g424_panelContent == k0_PanelContentFoodWaterPoisoned) { setFlag(L1083_ps_Champion->_attributes, k0x0800_ChampionAttributePanel); diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index ceaf79e68b..a6efc10876 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -93,10 +93,10 @@ LoadgameResponse DMEngine::loadgame(int16 slot) { _gameTime = file->readSint32BE(); // G0349_ul_LastRandomNumber = L1371_s_GlobalData.LastRandomNumber; _championMan->_partyChampionCount = file->readUint16BE(); - _dungeonMan->_g306_partyMapX = file->readSint16BE(); - _dungeonMan->_g307_partyMapY = file->readSint16BE(); - _dungeonMan->_g308_partyDir = (Direction)file->readUint16BE(); - _dungeonMan->_g309_partyMapIndex = file->readByte(); + _dungeonMan->_partyMapX = file->readSint16BE(); + _dungeonMan->_partyMapY = file->readSint16BE(); + _dungeonMan->_partyDir = (Direction)file->readUint16BE(); + _dungeonMan->_partyMapIndex = file->readByte(); _championMan->_leaderIndex = (ChampionIndex)file->readSint16BE(); _championMan->_magicCasterChampionIndex = (ChampionIndex)file->readSint16BE(); _timeline->_g372_eventCount = file->readUint16BE(); @@ -125,7 +125,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) { assert(sentinel == 0x6f85e3d3); } - _dungeonMan->f434_loadDungeonFile(file); + _dungeonMan->loadDungeonFile(file); delete file; if (_newGameFl) { @@ -224,7 +224,7 @@ void DMEngine::saveGame() { uint16 champHandObjWeight = 0; if (!_championMan->_leaderEmptyHanded) { - champHandObjWeight = _dungeonMan->f140_getObjectWeight(_championMan->_leaderHandObject); + champHandObjWeight = _dungeonMan->getObjectWeight(_championMan->_leaderHandObject); _championMan->_champions[_championMan->_leaderIndex]._load -= champHandObjWeight; } @@ -309,10 +309,10 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip file->writeSint32BE(_gameTime); //L1348_s_GlobalData.LastRandomNumber = G0349_ul_LastRandomNumber; file->writeUint16BE(_championMan->_partyChampionCount); - file->writeSint16BE(_dungeonMan->_g306_partyMapX); - file->writeSint16BE(_dungeonMan->_g307_partyMapY); - file->writeUint16BE(_dungeonMan->_g308_partyDir); - file->writeByte(_dungeonMan->_g309_partyMapIndex); + file->writeSint16BE(_dungeonMan->_partyMapX); + file->writeSint16BE(_dungeonMan->_partyMapY); + file->writeUint16BE(_dungeonMan->_partyDir); + file->writeByte(_dungeonMan->_partyMapIndex); file->writeSint16BE(_championMan->_leaderIndex); file->writeSint16BE(_championMan->_magicCasterChampionIndex); file->writeUint16BE(_timeline->_g372_eventCount); @@ -341,7 +341,7 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip // save _g278_dungeonFileHeader { - DungeonFileHeader &header = _dungeonMan->_g278_dungeonFileHeader; + DungeonFileHeader &header = _dungeonMan->_dungeonFileHeader; file->writeUint16BE(header._ornamentRandomSeed); file->writeUint16BE(header._rawMapDataSize); file->writeByte(header._mapCount); @@ -354,8 +354,8 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip } // save _g277_dungeonMaps - for (uint16 i = 0; i < _dungeonMan->_g278_dungeonFileHeader._mapCount; ++i) { - Map &map = _dungeonMan->_g277_dungeonMaps[i]; + for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._mapCount; ++i) { + Map &map = _dungeonMan->_dungeonMaps[i]; uint16 tmp; file->writeUint16BE(map._rawDunDataOffset); @@ -379,25 +379,25 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip } // save _g280_dungeonColumnsCumulativeSquareThingCount - for (uint16 i = 0; i < _dungeonMan->_g282_dungeonColumCount; ++i) - file->writeUint16BE(_dungeonMan->_g280_dungeonColumnsCumulativeSquareThingCount[i]); + for (uint16 i = 0; i < _dungeonMan->_dungeonColumCount; ++i) + file->writeUint16BE(_dungeonMan->_dungeonColumnsCumulativeSquareThingCount[i]); // save _g283_squareFirstThings - for (uint16 i = 0; i < _dungeonMan->_g278_dungeonFileHeader._squareFirstThingCount; ++i) - file->writeUint16BE(_dungeonMan->_g283_squareFirstThings[i].toUint16()); + for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._squareFirstThingCount; ++i) + file->writeUint16BE(_dungeonMan->_squareFirstThings[i].toUint16()); // save _g260_dungeonTextData - for (uint16 i = 0; i < _dungeonMan->_g278_dungeonFileHeader._textDataWordCount; ++i) - file->writeUint16BE(_dungeonMan->_g260_dungeonTextData[i]); + for (uint16 i = 0; i < _dungeonMan->_dungeonFileHeader._textDataWordCount; ++i) + file->writeUint16BE(_dungeonMan->_dungeonTextData[i]); // save _g284_thingData for (uint16 thingIndex = 0; thingIndex < 16; ++thingIndex) - for (uint16 i = 0; i < g235_ThingDataWordCount[thingIndex] * _dungeonMan->_g278_dungeonFileHeader._thingCounts[thingIndex]; ++i) - file->writeUint16BE(_dungeonMan->_g284_thingData[thingIndex][i]); + for (uint16 i = 0; i < g235_ThingDataWordCount[thingIndex] * _dungeonMan->_dungeonFileHeader._thingCounts[thingIndex]; ++i) + file->writeUint16BE(_dungeonMan->_thingData[thingIndex][i]); // save _g276_dungeonRawMapData - for (uint32 i = 0; i < _dungeonMan->_g278_dungeonFileHeader._rawMapDataSize; ++i) - file->writeByte(_dungeonMan->_g276_dungeonRawMapData[i]); + for (uint32 i = 0; i < _dungeonMan->_dungeonFileHeader._rawMapDataSize; ++i) + file->writeByte(_dungeonMan->_dungeonRawMapData[i]); file->flush(); file->finalize(); diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index d2cddf63a0..cf32fd778b 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -157,7 +157,7 @@ void MenuMan::f386_drawActionIcon(ChampionIndex championIndex) { IconIndice iconIndex; if (thing == Thing::_none) { iconIndex = k201_IconIndiceActionEmptyHand; - } else if (_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(thing)]._actionSetIndex) { + } else if (_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) { iconIndex = _vm->_objectMan->f33_getIconIndex(thing); } else { dm.f134_fillBitmap(bitmapIcon, k4_ColorCyan, 16, 16); @@ -528,10 +528,10 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) { f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k10_failureNeedsFlaskInHand, 0); return k3_spellCastFailureNeedsFlask; } - AL1269_ui_EmptyFlaskWeight = _vm->_dungeonMan->f140_getObjectWeight(L1272_T_Object); + AL1269_ui_EmptyFlaskWeight = _vm->_dungeonMan->getObjectWeight(L1272_T_Object); L1275_ps_Potion->setType((PotionType)L1271_ps_Spell->getType()); L1275_ps_Potion->setPower(_vm->getRandomNumber(16) + (L1268_i_PowerSymbolOrdinal * 40)); - L1270_ps_Champion->_load += _vm->_dungeonMan->f140_getObjectWeight(L1272_T_Object) - AL1269_ui_EmptyFlaskWeight; + L1270_ps_Champion->_load += _vm->_dungeonMan->getObjectWeight(L1272_T_Object) - AL1269_ui_EmptyFlaskWeight; _vm->_championMan->drawChangedObjectIcons(); if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)) { setFlag(L1270_ps_Champion->_attributes, k0x0200_ChampionAttributeLoad); @@ -539,8 +539,8 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) { } break; case k2_spellKindProjectile: - if (L1270_ps_Champion->_dir != _vm->_dungeonMan->_g308_partyDir) { - L1270_ps_Champion->_dir = _vm->_dungeonMan->_g308_partyDir; + if (L1270_ps_Champion->_dir != _vm->_dungeonMan->_partyDir) { + L1270_ps_Champion->_dir = _vm->_dungeonMan->_partyDir; setFlag(L1270_ps_Champion->_attributes, k0x0400_ChampionAttributeIcon); _vm->_championMan->drawChampionState((ChampionIndex)champIndex); } @@ -601,13 +601,13 @@ T0412019: T0412032: AL1267_ui_Ticks = AL1267_ui_SpellPower * AL1267_ui_SpellPower; T0412033: - setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + AL1267_ui_Ticks); + setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + AL1267_ui_Ticks); _vm->_timeline->f238_addEventGetEventIndex(&L1276_s_Event); break; case k7_spellType_otherZokathra: - if ((L1272_T_Object = _vm->_dungeonMan->f166_getUnusedThing(k10_JunkThingType)) == Thing::_none) + if ((L1272_T_Object = _vm->_dungeonMan->getUnusedThing(k10_JunkThingType)) == Thing::_none) break; - L1277_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1272_T_Object); + L1277_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L1272_T_Object); L1277_ps_Junk->setType(k51_JunkTypeZokathra); ChampionSlot AL1267_ui_SlotIndex; if (L1270_ps_Champion->_slots[k0_ChampionSlotReadyHand] == Thing::_none) { @@ -623,7 +623,7 @@ T0412033: _vm->_championMan->addObjectInSlot((ChampionIndex)champIndex, L1272_T_Object, AL1267_ui_SlotIndex); _vm->_championMan->drawChampionState((ChampionIndex)champIndex); } else { - _vm->_moveSens->f267_getMoveResult(L1272_T_Object, kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + _vm->_moveSens->f267_getMoveResult(L1272_T_Object, kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); } break; case k8_spellType_otherFireshield: @@ -741,7 +741,7 @@ Potion* MenuMan::f411_getEmptyFlaskInHand(Champion* champ, Thing* potionThing) { 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)) { *potionThing = L1265_T_Thing; - return (Potion*)_vm->_dungeonMan->f156_getThingData(L1265_T_Thing); + return (Potion*)_vm->_dungeonMan->getThingData(L1265_T_Thing); } } return nullptr; @@ -752,7 +752,7 @@ void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) { L1241_s_Event._type = k70_TMEventTypeLight; L1241_s_Event._B._lightPower = lightPower; - setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + ticks); + setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); L1241_s_Event._priority = 0; _vm->_timeline->f238_addEventGetEventIndex(&L1241_s_Event); _vm->_inventoryMan->f337_setDungeonViewPalette(); @@ -791,7 +791,7 @@ bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spel _vm->_championMan->_party._fireShieldDefense += L1240_s_Event._B._defense; } L1240_s_Event._priority = 0; - setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + ticks); + setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); _vm->_timeline->f238_addEventGetEventIndex(&L1240_s_Event); _vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes(); return L1239_B_IsPartySpellOrFireShieldSuccessful; @@ -1078,19 +1078,19 @@ bool MenuMan::f407_isActionPerformed(uint16 champIndex, int16 actionIndex) { return false; } L1247_ps_Champion = &_vm->_championMan->_champions[champIndex]; - L1248_ps_Weapon = (Weapon*)_vm->_dungeonMan->f156_getThingData(L1247_ps_Champion->_slots[k1_ChampionSlotActionHand]); + L1248_ps_Weapon = (Weapon*)_vm->_dungeonMan->getThingData(L1247_ps_Champion->_slots[k1_ChampionSlotActionHand]); if (!L1247_ps_Champion->_currHealth) { return false; } - L1251_i_MapX = _vm->_dungeonMan->_g306_partyMapX; - L1252_i_MapY = _vm->_dungeonMan->_g307_partyMapY; + L1251_i_MapX = _vm->_dungeonMan->_partyMapX; + L1252_i_MapY = _vm->_dungeonMan->_partyMapY; L1251_i_MapX += _vm->_dirIntoStepCountEast[L1247_ps_Champion->_dir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[L1247_ps_Champion->_dir]; _g517_actionTargetGroupThing = _vm->_groupMan->f175_groupGetThing(L1251_i_MapX, L1252_i_MapY); L1249_ui_ActionDisabledTicks = G0491_auc_Graphic560_ActionDisabledTicks[actionIndex]; L1254_i_ActionSkillIndex = g496_ActionSkillIndex[actionIndex]; L1253_i_ActionStamina = G0494_auc_Graphic560_ActionStamina[actionIndex] + _vm->getRandomNumber(2); L1255_i_ActionExperienceGain = G0497_auc_Graphic560_ActionExperienceGain[actionIndex]; - AL1244_ui_TargetSquare = _vm->_dungeonMan->f151_getSquare(L1251_i_MapX, L1252_i_MapY).toByte(); + AL1244_ui_TargetSquare = _vm->_dungeonMan->getSquare(L1251_i_MapX, L1252_i_MapY).toByte(); AL1245_B_ActionPerformed = true; if (((L1254_i_ActionSkillIndex >= k16_ChampionSkillFire) && (L1254_i_ActionSkillIndex <= k19_ChampionSkillWater)) || (L1254_i_ActionSkillIndex == k3_ChampionSkillWizard)) { AL1246_i_RequiredManaAmount = 7 - MIN((uint16)6, _vm->_championMan->getSkillLevel(champIndex, L1254_i_ActionSkillIndex)); @@ -1129,10 +1129,10 @@ T0407014: case k13_ChampionActionSwing: case k2_ChampionActionChop: if ((Square(AL1244_ui_TargetSquare).getType() == k4_DoorElemType) && (Square(AL1244_ui_TargetSquare).getDoorState() == k4_doorState_CLOSED)) { - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); L1249_ui_ActionDisabledTicks = 6; _vm->_groupMan->f232_groupIsDoorDestoryedByAttack(L1251_i_MapX, L1252_i_MapY, _vm->_championMan->getStrength(champIndex, k1_ChampionSlotActionHand), false, 2); - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k2_soundModePlayOneTickLater); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater); break; } case k24_ChampionActionDisrupt: @@ -1169,7 +1169,7 @@ T0407014: if (Thing(L1247_ps_Champion->_slots[k0_ChampionSlotReadyHand]).getType() != k5_WeaponThingType) goto T0407032; L1256_ps_WeaponInfoActionHand = &_vm->_dungeonMan->_weaponInfo[L1248_ps_Weapon->getType()]; - L1257_ps_WeaponInfoReadyHand = _vm->_dungeonMan->f158_getWeaponInfo(L1247_ps_Champion->_slots[k0_ChampionSlotReadyHand]); + L1257_ps_WeaponInfoReadyHand = _vm->_dungeonMan->getWeaponInfo(L1247_ps_Champion->_slots[k0_ChampionSlotReadyHand]); AL1246_i_ActionHandWeaponClass = L1256_ps_WeaponInfoActionHand->_class; AL1250_i_ReadyHandWeaponClass = L1257_ps_WeaponInfoReadyHand->_class; if ((AL1246_i_ActionHandWeaponClass >= k16_WeaponClassFirstBow) && (AL1246_i_ActionHandWeaponClass <= k31_WeaponClassLastBow)) { @@ -1191,7 +1191,7 @@ T0407032: f406_setChampionDirectionToPartyDirection(L1247_ps_Champion); { // so gotos won't skip init Thing AL1250_T_Object = _vm->_championMan->getObjectRemovedFromSlot(champIndex, k0_ChampionSlotReadyHand); - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); _vm->_championMan->championShootProjectile(L1247_ps_Champion, AL1250_T_Object, L1256_ps_WeaponInfoActionHand->_kineticEnergy + L1257_ps_WeaponInfoReadyHand->_kineticEnergy, (L1256_ps_WeaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, k11_ChampionSkillShoot)) << 1, AL1246_i_StepEnergy); } break; @@ -1243,9 +1243,9 @@ T0407032: break; case k43_ChampionActionFuse: f406_setChampionDirectionToPartyDirection(L1247_ps_Champion); - L1251_i_MapX = _vm->_dungeonMan->_g306_partyMapX; - L1252_i_MapY = _vm->_dungeonMan->_g307_partyMapY; - L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + L1251_i_MapX = _vm->_dungeonMan->_partyMapX; + L1252_i_MapY = _vm->_dungeonMan->_partyMapY; + L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; _vm->_groupMan->f225_fuseAction(L1251_i_MapX, L1252_i_MapY); break; case k36_ChampionActionHeal: @@ -1273,20 +1273,20 @@ T0407032: AL1246_i_Ticks = _vm->getRandomNumber(_vm->_championMan->getSkillLevel(champIndex, L1254_i_ActionSkillIndex) + 8) + 5; L1258_s_Event._priority = 0; L1258_s_Event._type = k73_TMEventTypeThievesEye; - setMapAndTime(L1258_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + AL1246_i_Ticks); + setMapAndTime(L1258_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + AL1246_i_Ticks); _vm->_timeline->f238_addEventGetEventIndex(&L1258_s_Event); _vm->_championMan->_party._event73Count_ThievesEye++; goto T0407076; case k10_ChampionActionClimbDown: - L1251_i_MapX = _vm->_dungeonMan->_g306_partyMapX; - L1252_i_MapY = _vm->_dungeonMan->_g307_partyMapY; - L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir]; - L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir]; + L1251_i_MapX = _vm->_dungeonMan->_partyMapX; + L1252_i_MapY = _vm->_dungeonMan->_partyMapY; + L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; /* CHANGE6_00_FIX The presence of a group over the pit is checked so that you cannot climb down a pit with the rope if there is a group levitating over it */ - if ((_vm->_dungeonMan->f151_getSquare(L1251_i_MapX, L1252_i_MapY).getType() == k2_PitElemType) && (_vm->_groupMan->f175_groupGetThing(L1251_i_MapX, L1252_i_MapY) == Thing::_endOfList)) { + if ((_vm->_dungeonMan->getSquare(L1251_i_MapX, L1252_i_MapY).getType() == k2_PitElemType) && (_vm->_groupMan->f175_groupGetThing(L1251_i_MapX, L1252_i_MapY) == Thing::_endOfList)) { /* BUG0_77 The party moves forward when using the rope in front of a closed pit. The engine does not check whether the pit is open before moving the party over the pit. This is not consistent with the behavior when using the rope in front of a corridor where nothing happens */ _vm->_moveSens->_g402_useRopeToClimbDownPit = true; - _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, L1251_i_MapX, L1252_i_MapY); + _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, L1251_i_MapX, L1252_i_MapY); _vm->_moveSens->_g402_useRopeToClimbDownPit = false; } else { L1249_ui_ActionDisabledTicks = 0; @@ -1316,7 +1316,7 @@ T0407076: break; case k42_ChampionActionThrow: f406_setChampionDirectionToPartyDirection(L1247_ps_Champion); - AL1245_B_ActionPerformed = _vm->_championMan->isObjectThrown(champIndex, k1_ChampionSlotActionHand, (L1247_ps_Champion->_cell == returnNextVal(_vm->_dungeonMan->_g308_partyDir)) || (L1247_ps_Champion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_g308_partyDir))); + AL1245_B_ActionPerformed = _vm->_championMan->isObjectThrown(champIndex, k1_ChampionSlotActionHand, (L1247_ps_Champion->_cell == returnNextVal(_vm->_dungeonMan->_partyDir)) || (L1247_ps_Champion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_partyDir))); if (AL1245_B_ActionPerformed) { _vm->_timeline->_g370_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->indexToOrdinal(k1_ChampionSlotActionHand); } @@ -1335,8 +1335,8 @@ T0407076: } void MenuMan::f406_setChampionDirectionToPartyDirection(Champion* champ) { - if (champ->_dir != _vm->_dungeonMan->_g308_partyDir) { - champ->_dir = _vm->_dungeonMan->_g308_partyDir; + if (champ->_dir != _vm->_dungeonMan->_partyDir) { + champ->_dir = _vm->_dungeonMan->_partyDir; setFlag(champ->_attributes, k0x0400_ChampionAttributeIcon); } } @@ -1345,7 +1345,7 @@ void MenuMan::f405_decrementCharges(Champion* champ) { Thing L1242_T_Thing; Junk* L1243_ps_Junk; - L1243_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1242_T_Thing = champ->_slots[k1_ChampionSlotActionHand]); + L1243_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L1242_T_Thing = champ->_slots[k1_ChampionSlotActionHand]); switch (L1242_T_Thing.getType()) { case k5_WeaponThingType: if (((Weapon*)L1243_ps_Junk)->getChargeCount()) { @@ -1469,10 +1469,10 @@ bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int #define AL1237_ui_ActionHitProbability L1237_ui_Multiple int16 L1238_i_CreatureOrdinal; - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); if (_g517_actionTargetGroupThing == Thing::_endOfList) goto T0402010; - L1238_i_CreatureOrdinal = _vm->_groupMan->f177_getMeleeTargetCreatureOrdinal(targetMapX, targetMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, AL1236_ui_ChampionCell = champ->_cell); + L1238_i_CreatureOrdinal = _vm->_groupMan->f177_getMeleeTargetCreatureOrdinal(targetMapX, targetMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, AL1236_ui_ChampionCell = champ->_cell); if (L1238_i_CreatureOrdinal) { switch (normalizeModulo4(AL1236_ui_ChampionCell + 4 - champ->_dir)) { case k2_ViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */ @@ -1486,14 +1486,14 @@ T0402005: /* Check if there is another champion in front */ goto T0402010; } } - if ((actionIndex == k24_ChampionActionDisrupt) && !getFlag(_vm->_dungeonMan->f144_getCreatureAttributes(_g517_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) + if ((actionIndex == k24_ChampionActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_g517_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) goto T0402010; AL1237_ui_ActionHitProbability = G0493_auc_Graphic560_ActionHitProbability[actionIndex]; AL1236_ui_ActionDamageFactor = G0492_auc_Graphic560_ActionDamageFactor[actionIndex]; if ((_vm->_objectMan->f33_getIconIndex(champ->_slots[k1_ChampionSlotActionHand]) == k40_IconIndiceWeaponVorpalBlade) || (actionIndex == k24_ChampionActionDisrupt)) { setFlag(AL1237_ui_ActionHitProbability, k0x8000_hitNonMaterialCreatures); } - _g513_actionDamage = _vm->_groupMan->f231_getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->f156_getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex); + _g513_actionDamage = _vm->_groupMan->f231_getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex); return true; } T0402010: @@ -1535,7 +1535,7 @@ bool MenuMan::f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionInde L1231_ui_Experience = 45; } L1229_i_FrightAmount += _vm->_championMan->getSkillLevel(champIndex, k14_ChampionSkillInfluence); - L1233_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(_g517_actionTargetGroupThing); + L1233_ps_Group = (Group*)_vm->_dungeonMan->getThingData(_g517_actionTargetGroupThing); L1234_ps_CreatureInfo = &g243_CreatureInfo[L1233_ps_Group->_type]; if (((L1230_ui_FearResistance = L1234_ps_CreatureInfo->getFearResistance()) > _vm->getRandomNumber(L1229_i_FrightAmount)) || (L1230_ui_FearResistance == k15_immuneToFear)) { L1231_ui_Experience >>= 1; @@ -1645,7 +1645,7 @@ void MenuMan::f389_processCommands116To119_setActingChampion(uint16 champIndex) } if ((L1189_T_Thing = L1190_ps_Champion->_slots[k1_ChampionSlotActionHand]) == Thing::_none) { L1188_ui_ActionSetIndex = 2; /* Actions Punch, Kick and War Cry */ - } else if ((L1188_ui_ActionSetIndex = _vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(L1189_T_Thing)]._actionSetIndex) == 0) { + } else if ((L1188_ui_ActionSetIndex = _vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(L1189_T_Thing)]._actionSetIndex) == 0) { return; } L1191_ps_ActionSet = &G0489_as_Graphic560_ActionSets[L1188_ui_ActionSetIndex]; @@ -1693,7 +1693,7 @@ int16 MenuMan::f382_getActionObjectChargeCount() { Junk* L1168_ps_Junk; - L1168_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1167_T_Thing = _vm->_championMan->_champions[_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._slots[k1_ChampionSlotActionHand]); + L1168_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L1167_T_Thing = _vm->_championMan->_champions[_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._slots[k1_ChampionSlotActionHand]); switch (L1167_T_Thing.getType()) { case k5_WeaponThingType: return ((Weapon*)L1168_ps_Junk)->getChargeCount(); diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index b24a997549..ac66f231f6 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -77,7 +77,7 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui for (L0752_ui_Cell = k0_CellNorthWest; L0752_ui_Cell < k3_CellSouthWest + 1; L0752_ui_Cell++) { L0760_ai_SensorCountToProcessPerCell[L0752_ui_Cell] = 0; } - L0764_T_SquareFirstThing = L0750_T_ThingBeingProcessed = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + L0764_T_SquareFirstThing = L0750_T_ThingBeingProcessed = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (L0750_T_ThingBeingProcessed != Thing::_endOfList) { if ((L0751_ui_ThingType = (L0750_T_ThingBeingProcessed).getType()) == k3_SensorThingType) { L0760_ai_SensorCountToProcessPerCell[(L0750_T_ThingBeingProcessed).getCell()]++; @@ -85,13 +85,13 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui if (L0751_ui_ThingType >= k4_GroupThingType) break; } - L0750_T_ThingBeingProcessed = _vm->_dungeonMan->f159_getNextThing(L0750_T_ThingBeingProcessed); + L0750_T_ThingBeingProcessed = _vm->_dungeonMan->getNextThing(L0750_T_ThingBeingProcessed); } L0763_T_LastProcessedThing = L0750_T_ThingBeingProcessed = L0764_T_SquareFirstThing; while (L0750_T_ThingBeingProcessed != Thing::_endOfList) { if ((L0751_ui_ThingType = (L0750_T_ThingBeingProcessed).getType()) == k3_SensorThingType) { L0760_ai_SensorCountToProcessPerCell[L0752_ui_Cell = (L0750_T_ThingBeingProcessed).getCell()]--; - L0755_ps_Sensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0750_T_ThingBeingProcessed); + L0755_ps_Sensor = (Sensor *)_vm->_dungeonMan->getThingData(L0750_T_ThingBeingProcessed); if ((L0757_ui_SensorType = (L0755_ps_Sensor)->getType()) == k0_SensorDisabled) goto T0275058_ProceedToNextThing; if ((_vm->_championMan->_leaderIndex == kM1_ChampionNone) && (L0757_ui_SensorType != k127_SensorWallChampionPortrait)) @@ -99,16 +99,16 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui if (L0752_ui_Cell != cellParam) goto T0275058_ProceedToNextThing; L0758_i_SensorData = L0755_ps_Sensor->getData(); - L0756_i_SensorEffect = L0755_ps_Sensor->getEffectA(); + L0756_i_SensorEffect = L0755_ps_Sensor->getAttrEffectA(); switch (L0757_ui_SensorType) { case k1_SensorWallOrnClick: L0753_B_DoNotTriggerSensor = false; - if (L0755_ps_Sensor->getEffectA() == k3_SensorEffHold) { + if (L0755_ps_Sensor->getAttrEffectA() == k3_SensorEffHold) { goto T0275058_ProceedToNextThing; } break; case k2_SensorWallOrnClickWithAnyObj: - L0753_B_DoNotTriggerSensor = (_vm->_championMan->_leaderEmptyHanded != L0755_ps_Sensor->getRevertEffectA()); + L0753_B_DoNotTriggerSensor = (_vm->_championMan->_leaderEmptyHanded != L0755_ps_Sensor->getAttrRevertEffectA()); break; case k17_SensorWallOrnClickWithSpecObjRemovedSensor: case k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors: @@ -116,11 +116,11 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui 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->getRevertEffectA()); + L0753_B_DoNotTriggerSensor = ((L0758_i_SensorData == _vm->_objectMan->f32_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; - L0765_ps_Sensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0763_T_LastProcessedThing); + L0765_ps_Sensor = (Sensor *)_vm->_dungeonMan->getThingData(L0763_T_LastProcessedThing); L0765_ps_Sensor->setNextThing(L0755_ps_Sensor->getNextThing()); L0755_ps_Sensor->setNextThing(Thing::_none); L0750_T_ThingBeingProcessed = L0763_T_LastProcessedThing; @@ -141,13 +141,13 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui if (_vm->_championMan->_leaderEmptyHanded) { if ((L0761_T_LeaderHandObject = f273_sensorGetObjectOfTypeInCell(mapX, mapY, L0752_ui_Cell, L0758_i_SensorData)) == Thing::_none) goto T0275058_ProceedToNextThing; - _vm->_dungeonMan->f164_unlinkThingFromList(L0761_T_LeaderHandObject, Thing(0), mapX, mapY); + _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) || (f273_sensorGetObjectOfTypeInCell(mapX, mapY, L0752_ui_Cell, L0758_i_SensorData) != Thing::_none)) goto T0275058_ProceedToNextThing; _vm->_championMan->getObjectRemovedFromLeaderHand(); - _vm->_dungeonMan->f163_linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY); + _vm->_dungeonMan->linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY); L0761_T_LeaderHandObject = Thing::_none; } f270_sensorTriggetLocalEffect(k2_SensorEffToggle, mapX, mapY, L0752_ui_Cell); /* This will cause a rotation of the sensors at the specified cell on the specified square after all sensors have been processed */ @@ -160,12 +160,12 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui case k16_SensorWallObjExchanger: 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->f162_getSquareFirstObject(mapX, mapY); + L0762_T_ThingOnSquare = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY); if ((_vm->_objectMan->f32_getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (L0762_T_ThingOnSquare == Thing::_none)) goto T0275058_ProceedToNextThing; - _vm->_dungeonMan->f164_unlinkThingFromList(L0762_T_ThingOnSquare, Thing(0), mapX, mapY); + _vm->_dungeonMan->unlinkThingFromList(L0762_T_ThingOnSquare, Thing(0), mapX, mapY); _vm->_championMan->getObjectRemovedFromLeaderHand(); - _vm->_dungeonMan->f163_linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY); + _vm->_dungeonMan->linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY); _vm->_championMan->putObjectInLeaderHand(L0762_T_ThingOnSquare, true); L0753_B_DoNotTriggerSensor = false; break; @@ -181,18 +181,18 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui } if (!L0753_B_DoNotTriggerSensor) { L0759_B_AtLeastOneSensorWasTriggered = true; - if (L0755_ps_Sensor->getAudibleA()) { - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized); + if (L0755_ps_Sensor->getAttrAudibleA()) { + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized); } if (!_vm->_championMan->_leaderEmptyHanded && ((L0757_ui_SensorType == k4_SensorWallOrnClickWithSpecObjRemoved) || (L0757_ui_SensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors) || (L0757_ui_SensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor))) { - L0754_ps_Generic = (Thing *)_vm->_dungeonMan->f156_getThingData(L0761_T_LeaderHandObject); + L0754_ps_Generic = (Thing *)_vm->_dungeonMan->getThingData(L0761_T_LeaderHandObject); *L0754_ps_Generic = Thing::_none; _vm->_championMan->getObjectRemovedFromLeaderHand(); L0761_T_LeaderHandObject = Thing::_none; } else { if (_vm->_championMan->_leaderEmptyHanded && (L0757_ui_SensorType == k12_SensorWallObjGeneratorRotateSensors) && - ((L0761_T_LeaderHandObject = _vm->_dungeonMan->f167_getObjForProjectileLaucherOrObjGen(L0758_i_SensorData)) != Thing::_none)) { + ((L0761_T_LeaderHandObject = _vm->_dungeonMan->getObjForProjectileLaucherOrObjGen(L0758_i_SensorData)) != Thing::_none)) { _vm->_championMan->putObjectInLeaderHand(L0761_T_LeaderHandObject, true); } } @@ -204,7 +204,7 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui break; T0275058_ProceedToNextThing: L0763_T_LastProcessedThing = L0750_T_ThingBeingProcessed; - L0750_T_ThingBeingProcessed = _vm->_dungeonMan->f159_getNextThing(L0750_T_ThingBeingProcessed); + L0750_T_ThingBeingProcessed = _vm->_dungeonMan->getNextThing(L0750_T_ThingBeingProcessed); } f271_processRotationEffect(); return L0759_B_AtLeastOneSensorWasTriggered; @@ -245,7 +245,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 L0713_B_ThingLevitates = f264_isLevitating(thing); } /* If moving the party or a creature on the party map from a dungeon square then check for a projectile impact */ - if ((mapX >= 0) && ((thing == Thing::_party) || ((L0710_i_ThingType == k4_GroupThingType) && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex)))) { + if ((mapX >= 0) && ((thing == Thing::_party) || ((L0710_i_ThingType == k4_GroupThingType) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)))) { if (f266_moveIsKilledByProjectileImpact(mapX, mapY, destMapX, destMapY, thing)) { return true; /* The specified group thing cannot be moved because it was killed by a projectile impact */ } @@ -258,18 +258,18 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 bool L0726_B_Audible = false; if (destMapX >= 0) { - L0714_ui_MapIndexSource = L0715_ui_MapIndexDestination = _vm->_dungeonMan->_g272_currMapIndex; - L0721_B_GroupOnPartyMap = (L0714_ui_MapIndexSource == _vm->_dungeonMan->_g309_partyMapIndex) && (mapX >= 0); + L0714_ui_MapIndexSource = L0715_ui_MapIndexDestination = _vm->_dungeonMan->_currMapIndex; + L0721_B_GroupOnPartyMap = (L0714_ui_MapIndexSource == _vm->_dungeonMan->_partyMapIndex) && (mapX >= 0); uint16 L0716_ui_Direction = 0; bool L0722_B_FallKilledGroup = false; bool L0723_B_DrawDungeonViewWhileFalling = false; bool L0724_B_DestinationIsTeleporterTarget = false; if (thing == Thing::_party) { - _vm->_dungeonMan->_g306_partyMapX = destMapX; - _vm->_dungeonMan->_g307_partyMapY = destMapY; + _vm->_dungeonMan->_partyMapX = destMapX; + _vm->_dungeonMan->_partyMapY = destMapY; L0718_i_RequiredTeleporterScope = k0x0002_TelepScopeObjOrParty; L0723_B_DrawDungeonViewWhileFalling = !_vm->_inventoryMan->_g432_inventoryChampionOrdinal && !_vm->_championMan->_partyIsSleeping; - L0716_ui_Direction = _vm->_dungeonMan->_g308_partyDir; + L0716_ui_Direction = _vm->_dungeonMan->_partyDir; } else { if (L0710_i_ThingType == k4_GroupThingType) { L0718_i_RequiredTeleporterScope = k0x0001_TelepScopeCreatures; @@ -278,15 +278,15 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 } } if (L0710_i_ThingType == k14_ProjectileThingType) { - L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f156_getThingData(thing); + L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getThingData(thing); _g400_moveResultDir = (_vm->_timeline->_g370_events[((Projectile *)L0712_ps_Teleporter)->_eventIndex])._C._projectile.getDir(); } for (L0728_i_ChainedMoveCount = 1000; --L0728_i_ChainedMoveCount; ) { /* No more than 1000 chained moves at once (in a chain of teleporters and pits for example) */ - AL0708_i_DestinationSquare = _vm->_dungeonMan->_g271_currMapData[destMapX][destMapY]; + AL0708_i_DestinationSquare = _vm->_dungeonMan->_currMapData[destMapX][destMapY]; if ((AL0709_i_DestinationSquareType = Square(AL0708_i_DestinationSquare).getType()) == k5_ElementTypeTeleporter) { if (!getFlag(AL0708_i_DestinationSquare, k0x0008_TeleporterOpen)) break; - L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f157_getSquareFirstThingData(destMapX, destMapY); + L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getSquareFirstThingData(destMapX, destMapY); if ((L0712_ps_Teleporter->getScope() == k0x0001_TelepScopeCreatures) && (L0710_i_ThingType != k4_GroupThingType)) break; if ((L0718_i_RequiredTeleporterScope != (k0x0001_TelepScopeCreatures | k0x0002_TelepScopeObjOrParty)) && !getFlag(L0712_ps_Teleporter->getScope(), L0718_i_RequiredTeleporterScope)) @@ -295,18 +295,18 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destMapX = L0712_ps_Teleporter->getTargetMapX(); destMapY = L0712_ps_Teleporter->getTargetMapY(); L0726_B_Audible = L0712_ps_Teleporter->isAudible(); - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination = L0712_ps_Teleporter->getTargetMapIndex()); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination = L0712_ps_Teleporter->getTargetMapIndex()); if (thing == Thing::_party) { - _vm->_dungeonMan->_g306_partyMapX = destMapX; - _vm->_dungeonMan->_g307_partyMapY = destMapY; + _vm->_dungeonMan->_partyMapX = destMapX; + _vm->_dungeonMan->_partyMapY = destMapY; if (L0712_ps_Teleporter->isAudible()) { - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k0_soundModePlayImmediately); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately); } L0723_B_DrawDungeonViewWhileFalling = true; if (L0712_ps_Teleporter->getAbsoluteRotation()) { _vm->_championMan->setPartyDirection(L0712_ps_Teleporter->getRotation()); } else { - _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + L0712_ps_Teleporter->getRotation())); + _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_partyDir + L0712_ps_Teleporter->getRotation())); } } else { if (L0710_i_ThingType == k4_GroupThingType) { @@ -331,19 +331,19 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 if (L0723_B_DrawDungeonViewWhileFalling && !_g402_useRopeToClimbDownPit) { L0723_B_DrawDungeonViewWhileFalling = true; if (L0719_i_TraversedPitCount) { - _vm->_dungeonMan->f174_setCurrentMapAndPartyMap(L0715_ui_MapIndexDestination); + _vm->_dungeonMan->setCurrentMapAndPartyMap(L0715_ui_MapIndexDestination); _vm->_displayMan->f96_loadCurrentMapGraphics(); } L0719_i_TraversedPitCount++; - _vm->_displayMan->f128_drawDungeon(_vm->_dungeonMan->_g308_partyDir, destMapX, destMapY); /* BUG0_28 When falling through multiple pits the dungeon view is updated to show each traversed map but the graphics used for creatures, wall and floor ornaments may not be correct. The dungeon view is drawn for each map by using the graphics loaded for the source map. Therefore the graphics for creatures, wall and floor ornaments may not look like what they should */ + _vm->_displayMan->f128_drawDungeon(_vm->_dungeonMan->_partyDir, destMapX, destMapY); /* BUG0_28 When falling through multiple pits the dungeon view is updated to show each traversed map but the graphics used for creatures, wall and floor ornaments may not be correct. The dungeon view is drawn for each map by using the graphics loaded for the source map. Therefore the graphics for creatures, wall and floor ornaments may not look like what they should */ /* BUG0_71 Some timings are too short on fast computers. When the party falls in a series of pits, the dungeon view is refreshed too quickly because the execution speed is not limited */ /* BUG0_01 While drawing creatures the engine will read invalid ACTIVE_GROUP data in _vm->_groupMan->_g375_activeGroups because the data is for the creatures on the source map and not the map being drawn. The only consequence is that creatures may be drawn with incorrect bitmaps and/or directions */ } - L0715_ui_MapIndexDestination = _vm->_dungeonMan->f154_getLocationAfterLevelChange(L0715_ui_MapIndexDestination, 1, &destMapX, &destMapY); - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); + L0715_ui_MapIndexDestination = _vm->_dungeonMan->getLocationAfterLevelChange(L0715_ui_MapIndexDestination, 1, &destMapX, &destMapY); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); if (thing == Thing::_party) { - _vm->_dungeonMan->_g306_partyMapX = destMapX; - _vm->_dungeonMan->_g307_partyMapY = destMapY; + _vm->_dungeonMan->_partyMapX = destMapX; + _vm->_dungeonMan->_partyMapY = destMapY; if (_vm->_championMan->_partyChampionCount > 0) { if (_g402_useRopeToClimbDownPit) { for (AL0709_i_ChampionIndex = k0_ChampionFirst, L0711_ps_Champion = _vm->_championMan->_champions; AL0709_i_ChampionIndex < _vm->_championMan->_partyChampionCount; AL0709_i_ChampionIndex++, L0711_ps_Champion++) { @@ -353,16 +353,16 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 } } else { if (_vm->_championMan->getDamagedChampionCount(20, k0x0010_ChampionWoundLegs | k0x0020_ChampionWoundFeet, k2_attackType_SELF)) { - _vm->_sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k0_soundModePlayImmediately); + _vm->_sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately); } } } _g402_useRopeToClimbDownPit = false; } else { if (L0710_i_ThingType == k4_GroupThingType) { - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); - AL0727_ui_Outcome = _vm->_groupMan->f191_getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->f156_getThingData(thing), mapX, mapY, 20, false); - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); + AL0727_ui_Outcome = _vm->_groupMan->f191_getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(thing), mapX, mapY, 20, false); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); L0722_B_FallKilledGroup = (AL0727_ui_Outcome == k2_outcomeKilledAllCreaturesInGroup); if (L0722_B_FallKilledGroup) break; @@ -374,10 +374,10 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 } else { if ((AL0709_i_DestinationSquareType == k3_ElementTypeStairs) && (thing != Thing::_party) && (L0710_i_ThingType != k14_ProjectileThingType)) { if (!getFlag(AL0708_i_DestinationSquare, k0x0004_StairsUp)) { - L0715_ui_MapIndexDestination = _vm->_dungeonMan->f154_getLocationAfterLevelChange(L0715_ui_MapIndexDestination, 1, &destMapX, &destMapY); - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); + L0715_ui_MapIndexDestination = _vm->_dungeonMan->getLocationAfterLevelChange(L0715_ui_MapIndexDestination, 1, &destMapX, &destMapY); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); } - L0716_ui_Direction = _vm->_dungeonMan->f155_getStairsExitDirection(destMapX, destMapY); + L0716_ui_Direction = _vm->_dungeonMan->getStairsExitDirection(destMapX, destMapY); destMapX += _vm->_dirIntoStepCountEast[L0716_ui_Direction], destMapY += _vm->_dirIntoStepCountNorth[L0716_ui_Direction]; L0716_ui_Direction = returnOppositeDir((Direction)L0716_ui_Direction); AL0727_ui_ThingCell = thing.getCell(); @@ -388,10 +388,10 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 } } } - if ((L0710_i_ThingType == k4_GroupThingType) && (L0722_B_FallKilledGroup || !_vm->_dungeonMan->f139_isCreatureAllowedOnMap(thing, L0715_ui_MapIndexDestination))) { + if ((L0710_i_ThingType == k4_GroupThingType) && (L0722_B_FallKilledGroup || !_vm->_dungeonMan->isCreatureAllowedOnMap(thing, L0715_ui_MapIndexDestination))) { _vm->_groupMan->f187_dropMovingCreatureFixedPossession(thing, destMapX, destMapY); _vm->_groupMan->f188_dropGroupPossessions(destMapX, destMapY, thing, k2_soundModePlayOneTickLater); - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); if (mapX >= 0) { _vm->_groupMan->f189_delete(mapX, mapY); } @@ -404,7 +404,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 L0725_B_PartySquare = (L0715_ui_MapIndexDestination == L0714_ui_MapIndexSource) && (destMapX == mapX) && (destMapY == mapY); if (L0725_B_PartySquare) { if (thing == Thing::_party) { - if (_vm->_dungeonMan->_g308_partyDir == L0716_ui_Direction) { + if (_vm->_dungeonMan->_partyDir == L0716_ui_Direction) { return false; } } else { @@ -436,7 +436,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 AL0708_i_DestinationSquare = AL0727_ui_Backup; } if (L0715_ui_MapIndexDestination != L0714_ui_MapIndexSource) { - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); } } } @@ -445,32 +445,32 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 f276_sensorProcessThingAdditionOrRemoval(mapX, mapY, Thing::_party, L0725_B_PartySquare, false); } else { if (L0713_B_ThingLevitates) { - _vm->_dungeonMan->f164_unlinkThingFromList(thing, Thing(0), mapX, mapY); + _vm->_dungeonMan->unlinkThingFromList(thing, Thing(0), mapX, mapY); } else { - f276_sensorProcessThingAdditionOrRemoval(mapX, mapY, thing, (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (mapX == _vm->_dungeonMan->_g306_partyMapX) && (mapY == _vm->_dungeonMan->_g307_partyMapY), false); + f276_sensorProcessThingAdditionOrRemoval(mapX, mapY, thing, (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY), false); } } } if (destMapX >= 0) { if (thing == Thing::_party) { - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); - if ((thing = _vm->_groupMan->f175_groupGetThing(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY)) != Thing::_endOfList) { /* Delete group if party moves onto its square */ - _vm->_groupMan->f188_dropGroupPossessions(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, thing, k1_soundModePlayIfPrioritized); - _vm->_groupMan->f189_delete(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); + if ((thing = _vm->_groupMan->f175_groupGetThing(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) != Thing::_endOfList) { /* Delete group if party moves onto its square */ + _vm->_groupMan->f188_dropGroupPossessions(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, thing, k1_soundModePlayIfPrioritized); + _vm->_groupMan->f189_delete(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY); } if (L0715_ui_MapIndexDestination == L0714_ui_MapIndexSource) { - f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, L0725_B_PartySquare, true); + f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, Thing::_party, L0725_B_PartySquare, true); } else { - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); _vm->_newPartyMapIndex = L0715_ui_MapIndexDestination; } } else { if (L0710_i_ThingType == k4_GroupThingType) { - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); - L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->f156_getThingData(thing); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); + L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getThingData(thing); AL0708_i_ActiveGroupIndex = ((Group *)L0712_ps_Teleporter)->getActiveGroupIndex(); - if (((L0715_ui_MapIndexDestination == _vm->_dungeonMan->_g309_partyMapIndex) && (destMapX == _vm->_dungeonMan->_g306_partyMapX) && (destMapY == _vm->_dungeonMan->_g307_partyMapY)) || (_vm->_groupMan->f175_groupGetThing(destMapX, destMapY) != Thing::_endOfList)) { /* If a group tries to move to the party square or over another group then create an event to move the group later */ - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + if (((L0715_ui_MapIndexDestination == _vm->_dungeonMan->_partyMapIndex) && (destMapX == _vm->_dungeonMan->_partyMapX) && (destMapY == _vm->_dungeonMan->_partyMapY)) || (_vm->_groupMan->f175_groupGetThing(destMapX, destMapY) != Thing::_endOfList)) { /* If a group tries to move to the party square or over another group then create an event to move the group later */ + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); if (mapX >= 0) { _vm->_groupMan->f181_groupDeleteEvents(mapX, mapY); } @@ -480,28 +480,28 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 f265_createEvent60to61_moveGroup(thing, destMapX, destMapY, L0715_ui_MapIndexDestination, L0726_B_Audible); return true; /* The specified group thing cannot be moved because the party or another group is on the destination square */ } - L1638_ui_MovementSoundIndex = f514_getSound(((Group *)_vm->_dungeonMan->_g284_thingData[k4_GroupThingType])[thing.getIndex()]._type); + L1638_ui_MovementSoundIndex = f514_getSound(((Group *)_vm->_dungeonMan->_thingData[k4_GroupThingType])[thing.getIndex()]._type); if (L1638_ui_MovementSoundIndex < k34_D13_soundCount) { _vm->_sound->f064_SOUND_RequestPlay_CPSD(L1638_ui_MovementSoundIndex, destMapX, destMapY, k1_soundModePlayIfPrioritized); } - if (L0721_B_GroupOnPartyMap && (L0715_ui_MapIndexDestination != _vm->_dungeonMan->_g309_partyMapIndex)) { /* If the group leaves the party map */ + if (L0721_B_GroupOnPartyMap && (L0715_ui_MapIndexDestination != _vm->_dungeonMan->_partyMapIndex)) { /* If the group leaves the party map */ _vm->_groupMan->f184_removeActiveGroup(AL0708_i_ActiveGroupIndex); L0720_ui_MoveGroupResult = true; } else { - if ((L0715_ui_MapIndexDestination == _vm->_dungeonMan->_g309_partyMapIndex) && (!L0721_B_GroupOnPartyMap)) { /* If the group arrives on the party map */ + if ((L0715_ui_MapIndexDestination == _vm->_dungeonMan->_partyMapIndex) && (!L0721_B_GroupOnPartyMap)) { /* If the group arrives on the party map */ _vm->_groupMan->f183_addActiveGroup(thing, destMapX, destMapY); L0720_ui_MoveGroupResult = true; } } if (L0713_B_ThingLevitates) { - _vm->_dungeonMan->f163_linkThingToList(thing, Thing(0), destMapX, destMapY); + _vm->_dungeonMan->linkThingToList(thing, Thing(0), destMapX, destMapY); } else { f276_sensorProcessThingAdditionOrRemoval(destMapX, destMapY, thing, false, true); } if (L0720_ui_MoveGroupResult || (mapX < 0)) { /* If group moved from one map to another or if it was just placed on a square */ _vm->_groupMan->f180_startWanedring(destMapX, destMapY); } - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); if (mapX >= 0) { if (L0720_ui_MoveGroupResult > 1) { /* If the group behavior was C6_BEHAVIOR_ATTACK before being teleported from and to the party map */ _vm->_groupMan->f182_stopAttacking(&_vm->_groupMan->_g375_activeGroups[L0720_ui_MoveGroupResult - 2], mapX, mapY); @@ -513,13 +513,13 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 } return L0720_ui_MoveGroupResult; } - _vm->_dungeonMan->f173_setCurrentMap(L0715_ui_MapIndexDestination); + _vm->_dungeonMan->setCurrentMap(L0715_ui_MapIndexDestination); if (L0710_i_ThingType == k14_ProjectileThingType) { /* BUG0_29 An explosion can trigger a floor sensor. Explosions do not trigger floor sensors on the square where they are created. However, if an explosion is moved by a teleporter (or by falling into a pit, see BUG0_26) after it was created, it can trigger floor sensors on the destination square. This is because explosions are not considered as levitating in the code, while projectiles are. The condition here should be (L0713_B_ThingLevitates) so that explosions would not start sensor processing on their destination square as they should be Levitating. This would work if F0264_MOVE_IsLevitating returned true for explosions (see BUG0_26) */ - _vm->_dungeonMan->f163_linkThingToList(thing, Thing(0), destMapX, destMapY); + _vm->_dungeonMan->linkThingToList(thing, Thing(0), destMapX, destMapY); } else { - f276_sensorProcessThingAdditionOrRemoval(destMapX, destMapY, thing, (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (destMapX == _vm->_dungeonMan->_g306_partyMapX) && (destMapY == _vm->_dungeonMan->_g307_partyMapY), true); + f276_sensorProcessThingAdditionOrRemoval(destMapX, destMapY, thing, (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (destMapX == _vm->_dungeonMan->_partyMapX) && (destMapY == _vm->_dungeonMan->_partyMapY), true); } - _vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource); + _vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource); } } return false; @@ -530,7 +530,7 @@ bool MovesensMan::f264_isLevitating(Thing thing) { if ((L0695_i_ThingType = thing.getType()) == k4_GroupThingType) { - return getFlag(_vm->_dungeonMan->f144_getCreatureAttributes(thing), k0x0020_MaskCreatureInfo_levitation); + return getFlag(_vm->_dungeonMan->getCreatureAttributes(thing), k0x0020_MaskCreatureInfo_levitation); } if (L0695_i_ThingType == k14_ProjectileThingType) { /* BUG0_26 An explosion may fall in a pit. If a pit is opened while there is an explosion above then the explosion falls into the pit in F0267_MOVE_GetMoveResult_CPSCE. Explosions are not considered as levitating so they are moved when the pit is opened. This function should return true for explosions */ return true; @@ -572,7 +572,7 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa } } else { L0702_i_ImpactType = kM1_CreatureElemType; - L0701_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(thing); + L0701_ps_Group = (Group *)_vm->_dungeonMan->getThingData(thing); for (AL0699_ui_Cell = k0_CellNorthWest, AL0700_B_CreatureAlive = false; AL0699_ui_Cell < k3_CellSouthWest + 1; AL0699_ui_Cell++) { AL0700_B_CreatureAlive |= L0701_ps_Group->_health[AL0699_ui_Cell]; if (_vm->_groupMan->f176_getCreatureOrdinalInCell(L0701_ps_Group, AL0699_ui_Cell)) { @@ -608,10 +608,10 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa L0704_ui_ProjectileMapX = srcMapX; /* Check impacts with projectiles on the source square */ L0705_ui_ProjectileMapY = srcMapY; T0266017_CheckProjectileImpacts: - L0697_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(L0704_ui_ProjectileMapX, L0705_ui_ProjectileMapY); + L0697_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0704_ui_ProjectileMapX, L0705_ui_ProjectileMapY); while (L0697_T_Thing != Thing::_endOfList) { if (((L0697_T_Thing).getType() == k14_ProjectileThingType) && - (_vm->_timeline->_g370_events[(((Projectile *)_vm->_dungeonMan->_g284_thingData[k14_ProjectileThingType])[(L0697_T_Thing).getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts) && (AL0699_ui_ChampionOrCreatureOrdinal = L0707_auc_ChampionOrCreatureOrdinalInCell[(L0697_T_Thing).getCell()]) && + (_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) { @@ -619,7 +619,7 @@ T0266017_CheckProjectileImpacts: } goto T0266017_CheckProjectileImpacts; } - L0697_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0697_T_Thing); + L0697_T_Thing = _vm->_dungeonMan->getNextThing(L0697_T_Thing); } if (L0703_B_CheckDestinationSquareProjectileImpacts) { srcMapX |= ((L0704_ui_ProjectileMapX = destMapX) + 1) << 8; /* Check impacts with projectiles on the destination square */ @@ -635,7 +635,7 @@ T0266017_CheckProjectileImpacts: void MovesensMan::f268_addEvent(byte type, byte mapX, byte mapY, byte cell, byte effect, int32 time) { TimelineEvent L0729_s_Event; - setMapAndTime(L0729_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, time); + setMapAndTime(L0729_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, time); L0729_s_Event._type = type; L0729_s_Event._priority = 0; L0729_s_Event._B._location._mapX = mapX; @@ -702,7 +702,7 @@ int16 MovesensMan::f262_getTeleporterRotatedGroupResult(Teleporter* teleporter, int16 L0691_i_CreatureSize; int16 L0692_i_RelativeRotation; - L0686_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(thing); + L0686_ps_Group = (Group *)_vm->_dungeonMan->getThingData(thing); L0683_i_Rotation = teleporter->getRotation(); L0684_ui_GroupDirections = _vm->_groupMan->f147_getGroupDirections(L0686_ps_Group, mapIndex); @@ -732,9 +732,9 @@ int16 MovesensMan::f262_getTeleporterRotatedGroupResult(Teleporter* teleporter, L0690_ui_GroupCells >>= 2; } } - _vm->_dungeonMan->f148_setGroupDirections(L0686_ps_Group, L0685_ui_UpdatedGroupDirections, mapIndex); - _vm->_dungeonMan->f146_setGroupCells(L0686_ps_Group, L0687_ui_UpdatedGroupCells, mapIndex); - if ((mapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0686_ps_Group->setBehaviour(k6_behavior_ATTACK))) { + _vm->_dungeonMan->setGroupDirections(L0686_ps_Group, L0685_ui_UpdatedGroupDirections, mapIndex); + _vm->_dungeonMan->setGroupCells(L0686_ps_Group, L0687_ui_UpdatedGroupCells, mapIndex); + if ((mapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0686_ps_Group->setBehaviour(k6_behavior_ATTACK))) { return L0686_ps_Group->getActiveGroupIndex() + 2; } return 1; @@ -781,24 +781,24 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m L0774_i_ObjectType = kM1_IconIndiceNone; } if ((!addThing) && (L0767_i_ThingType != kM1_PartyThingType)) { - _vm->_dungeonMan->f164_unlinkThingFromList(thing, Thing(0), mapX, mapY); + _vm->_dungeonMan->unlinkThingFromList(thing, Thing(0), mapX, mapY); } - L0777_ui_Square = _vm->_dungeonMan->_g271_currMapData[mapX][mapY]; + L0777_ui_Square = _vm->_dungeonMan->_currMapData[mapX][mapY]; if (Square(L0777_ui_Square).getType() == k0_WallElemType) { L0770_ui_SensorTriggeredCell = thing.getCell(); } else { L0770_ui_SensorTriggeredCell = kM1_CellAny; // this will wrap around } L0772_B_SquareContainsObject = L0773_B_SquareContainsGroup = L0775_B_SquareContainsThingOfSameType = L0776_B_SquareContainsThingOfDifferentType = false; - L0766_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + L0766_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); if (L0770_ui_SensorTriggeredCell == kM1_CellAny) { while (L0766_T_Thing != Thing::_endOfList) { if ((L0771_ui_ThingType = (L0766_T_Thing).getType()) == k4_GroupThingType) { L0773_B_SquareContainsGroup = true; } else { if ((L0771_ui_ThingType == k2_TextstringType) && (L0767_i_ThingType == kM1_PartyThingType) && addThing && !partySquare) { - _vm->_dungeonMan->f168_decodeText(_vm->_stringBuildBuffer, L0766_T_Thing, k1_TextTypeMessage); + _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, L0766_T_Thing, k1_TextTypeMessage); _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer); } else { if ((L0771_ui_ThingType > k4_GroupThingType) && (L0771_ui_ThingType < k14_ProjectileThingType)) { @@ -808,7 +808,7 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m } } } - L0766_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0766_T_Thing); + L0766_T_Thing = _vm->_dungeonMan->getNextThing(L0766_T_Thing); } } else { while (L0766_T_Thing != Thing::_endOfList) { @@ -817,17 +817,17 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m 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); } - L0766_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0766_T_Thing); + L0766_T_Thing = _vm->_dungeonMan->getNextThing(L0766_T_Thing); } } if (addThing && (L0767_i_ThingType != kM1_PartyThingType)) { - _vm->_dungeonMan->f163_linkThingToList(thing, Thing(0), mapX, mapY); + _vm->_dungeonMan->linkThingToList(thing, Thing(0), mapX, mapY); } - L0766_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + L0766_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (L0766_T_Thing != Thing::_endOfList) { L0771_ui_ThingType = (L0766_T_Thing).getType(); if (L0771_ui_ThingType == k3_SensorThingType) { - L0769_ps_Sensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0766_T_Thing); + L0769_ps_Sensor = (Sensor *)_vm->_dungeonMan->getThingData(L0766_T_Thing); if ((L0769_ps_Sensor)->getType() == k0_SensorDisabled) goto T0276079; L0779_i_SensorData = L0769_ps_Sensor->getData(); @@ -852,7 +852,7 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m if (!addThing) { L0768_B_TriggerSensor = false; } else { - L0768_B_TriggerSensor = (L0779_i_SensorData == _vm->indexToOrdinal(_vm->_dungeonMan->_g308_partyDir)); + L0768_B_TriggerSensor = (L0779_i_SensorData == _vm->indexToOrdinal(_vm->_dungeonMan->_partyDir)); } } break; @@ -904,14 +904,14 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m goto T0276079; } } - L0768_B_TriggerSensor ^= L0769_ps_Sensor->getRevertEffectA(); - L0778_i_Effect = L0769_ps_Sensor->getEffectA(); + L0768_B_TriggerSensor ^= L0769_ps_Sensor->getAttrRevertEffectA(); + L0778_i_Effect = L0769_ps_Sensor->getAttrEffectA(); if (L0778_i_Effect == k3_SensorEffHold) { L0778_i_Effect = L0768_B_TriggerSensor ? k0_SensorEffSet : k1_SensorEffClear; } else if (!L0768_B_TriggerSensor) goto T0276079; - if (L0769_ps_Sensor->getAudibleA()) + if (L0769_ps_Sensor->getAttrAudibleA()) _vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, mapX, mapY, k1_soundModePlayIfPrioritized); f272_sensorTriggerEffect(L0769_ps_Sensor, L0778_i_Effect, mapX, mapY, (uint16)kM1_CellAny); // this will wrap around @@ -920,7 +920,7 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m if (L0771_ui_ThingType >= k4_GroupThingType) break; T0276079: - L0766_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0766_T_Thing); + L0766_T_Thing = _vm->_dungeonMan->getNextThing(L0766_T_Thing); } f271_processRotationEffect(); } @@ -948,13 +948,13 @@ T0274003: return true; } if (L0747_i_ObjectType == k144_IconIndiceContainerChestClosed) { - L0749_ps_Container = (Container *)_vm->_dungeonMan->f156_getThingData(L0744_T_Thing); + 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) { return true; } - L0744_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0744_T_Thing); + L0744_T_Thing = _vm->_dungeonMan->getNextThing(L0744_T_Thing); } } } @@ -985,18 +985,18 @@ void MovesensMan::f272_sensorTriggerEffect(Sensor* sensor, int16 effect, int16 m uint16 L0740_ui_TargetCell; - if (sensor->getOnlyOnce()) { + if (sensor->getAttrOnlyOnce()) { sensor->setTypeDisabled(); } - L0738_l_Time = _vm->_gameTime + sensor->getValue(); - if (sensor->getLocalEffect()) { - f270_sensorTriggetLocalEffect(sensor->M49_localEffect(), mapX, mapY, cell); + L0738_l_Time = _vm->_gameTime + sensor->getAttrValue(); + if (sensor->getAttrLocalEffect()) { + f270_sensorTriggetLocalEffect(sensor->getActionLocalEffect(), mapX, mapY, cell); } else { - L0736_i_TargetMapX = sensor->getTargetMapX(); - L0737_i_TargetMapY = sensor->getTargetMapY(); - L0739_ui_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[L0736_i_TargetMapX][L0737_i_TargetMapY]).getType(); + L0736_i_TargetMapX = sensor->getActionTargetMapX(); + L0737_i_TargetMapY = sensor->getActionTargetMapY(); + L0739_ui_SquareType = Square(_vm->_dungeonMan->_currMapData[L0736_i_TargetMapX][L0737_i_TargetMapY]).getType(); if (L0739_ui_SquareType == k0_ElementTypeWall) { - L0740_ui_TargetCell = sensor->getTargetCell(); + L0740_ui_TargetCell = sensor->getActionTargetCell(); } else { L0740_ui_TargetCell = k0_CellNorthWest; } @@ -1045,25 +1045,25 @@ void MovesensMan::f271_processRotationEffect() { switch (_g403_sensorRotationEffect) { case k1_SensorEffClear: case k2_SensorEffToggle: - L0732_T_FirstSensorThing = _vm->_dungeonMan->f161_getSquareFirstThing(_g404_sensorRotationEffMapX, _g405_sensorRotationEffMapY); + L0732_T_FirstSensorThing = _vm->_dungeonMan->getSquareFirstThing(_g404_sensorRotationEffMapX, _g405_sensorRotationEffMapY); while (((L0732_T_FirstSensorThing).getType() != k3_SensorThingType) || ((_g406_sensorRotationEffCell != kM1_CellAny) && ((L0732_T_FirstSensorThing).getCell() != _g406_sensorRotationEffCell))) { - L0732_T_FirstSensorThing = _vm->_dungeonMan->f159_getNextThing(L0732_T_FirstSensorThing); + L0732_T_FirstSensorThing = _vm->_dungeonMan->getNextThing(L0732_T_FirstSensorThing); } - L0734_ps_FirstSensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0732_T_FirstSensorThing); + L0734_ps_FirstSensor = (Sensor *)_vm->_dungeonMan->getThingData(L0732_T_FirstSensorThing); L0733_T_LastSensorThing = L0734_ps_FirstSensor->getNextThing(); while ((L0733_T_LastSensorThing != Thing::_endOfList) && (((L0733_T_LastSensorThing).getType() != k3_SensorThingType) || ((_g406_sensorRotationEffCell != kM1_CellAny) && ((L0733_T_LastSensorThing).getCell() != _g406_sensorRotationEffCell)))) { - L0733_T_LastSensorThing = _vm->_dungeonMan->f159_getNextThing(L0733_T_LastSensorThing); + L0733_T_LastSensorThing = _vm->_dungeonMan->getNextThing(L0733_T_LastSensorThing); } if (L0733_T_LastSensorThing == Thing::_endOfList) break; - _vm->_dungeonMan->f164_unlinkThingFromList(L0732_T_FirstSensorThing, Thing(0), _g404_sensorRotationEffMapX, _g405_sensorRotationEffMapY); - L0735_ps_LastSensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0733_T_LastSensorThing); - L0733_T_LastSensorThing = _vm->_dungeonMan->f159_getNextThing(L0733_T_LastSensorThing); + _vm->_dungeonMan->unlinkThingFromList(L0732_T_FirstSensorThing, Thing(0), _g404_sensorRotationEffMapX, _g405_sensorRotationEffMapY); + L0735_ps_LastSensor = (Sensor *)_vm->_dungeonMan->getThingData(L0733_T_LastSensorThing); + L0733_T_LastSensorThing = _vm->_dungeonMan->getNextThing(L0733_T_LastSensorThing); while (((L0733_T_LastSensorThing != Thing::_endOfList) && ((L0733_T_LastSensorThing).getType() == k3_SensorThingType))) { if ((_g406_sensorRotationEffCell == kM1_CellAny) || ((L0733_T_LastSensorThing).getCell() == _g406_sensorRotationEffCell)) { - L0735_ps_LastSensor = (Sensor *)_vm->_dungeonMan->f156_getThingData(L0733_T_LastSensorThing); + L0735_ps_LastSensor = (Sensor *)_vm->_dungeonMan->getThingData(L0733_T_LastSensorThing); } - L0733_T_LastSensorThing = _vm->_dungeonMan->f159_getNextThing(L0733_T_LastSensorThing); + L0733_T_LastSensorThing = _vm->_dungeonMan->getNextThing(L0733_T_LastSensorThing); } L0734_ps_FirstSensor->setNextThing(L0735_ps_LastSensor->getNextThing()); L0735_ps_LastSensor->setNextThing(L0732_T_FirstSensorThing); @@ -1087,14 +1087,14 @@ Thing MovesensMan::f273_sensorGetObjectOfTypeInCell(int16 mapX, int16 mapY, int1 Thing L0741_T_Thing; - L0741_T_Thing = _vm->_dungeonMan->f162_getSquareFirstObject(mapX, mapY); + L0741_T_Thing = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY); while (L0741_T_Thing != Thing::_endOfList) { if (_vm->_objectMan->f32_getObjectType(L0741_T_Thing) == objectType) { if ((cell == kM1_CellAny) || ((L0741_T_Thing.getCell()) == cell)) { return L0741_T_Thing; } } - L0741_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0741_T_Thing); + L0741_T_Thing = _vm->_dungeonMan->getNextThing(L0741_T_Thing); } return Thing::_none; } diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index fe5737d9d6..00023c3aea 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -128,7 +128,7 @@ IconIndice ObjectMan::f32_getObjectType(Thing thing) { if (thing == Thing::_none) return kM1_IconIndiceNone; - int16 objectInfoIndex = _vm->_dungeonMan->f141_getObjectInfoIndex(thing); + int16 objectInfoIndex = _vm->_dungeonMan->getObjectInfoIndex(thing); if (objectInfoIndex != -1) { objectInfoIndex = _vm->_dungeonMan->_objectInfo[objectInfoIndex]._type; } @@ -143,10 +143,10 @@ IconIndice ObjectMan::f33_getIconIndex(Thing thing) { if (((L0005_i_IconIndex < k32_IconIndiceWeaponDagger) && (L0005_i_IconIndex >= k0_IconIndiceJunkCompassNorth)) || ((L0005_i_IconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (L0005_i_IconIndex <= k163_IconIndicePotionWaterFlask)) || (L0005_i_IconIndex == k195_IconIndicePotionEmptyFlask)) { - Junk *L0006_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(thing); + Junk *L0006_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(thing); switch (L0005_i_IconIndex) { case k0_IconIndiceJunkCompassNorth: - L0005_i_IconIndex += _vm->_dungeonMan->_g308_partyDir; + L0005_i_IconIndex += _vm->_dungeonMan->_partyDir; break; case k4_IconIndiceWeaponTorchUnlit: if (((Weapon*)L0006_ps_Junk)->isLit()) { @@ -239,7 +239,7 @@ void ObjectMan::f34_drawLeaderObjectName(Thing thing) { char* objectName = nullptr; int16 L0007_i_IconIndex = f33_getIconIndex(thing); if (L0007_i_IconIndex == k147_IconIndiceJunkChampionBones) { - Junk *junk = (Junk*)_vm->_dungeonMan->f156_getThingData(thing); + Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing); char champBonesName[16]; switch (_vm->getGameLanguage()) { // localized diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index bc0c1a97e8..4fdda2ede0 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -52,16 +52,16 @@ void ProjExpl::f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16 TimelineEvent L0468_s_Event; - if ((L0466_T_ProjectileThing = _vm->_dungeonMan->f166_getUnusedThing(k14_ProjectileThingType)) == Thing::_none) { /* BUG0_16 If the game cannot create a projectile thing because it has run out of such things (60 maximum) then the object being thrown/shot/launched is orphaned. If the game has run out of projectile things it will try to remove a projectile from elsewhere in the dungeon, except in an area of 11x11 squares centered around the party (to make sure the player cannot actually see the thing disappear on screen) */ + if ((L0466_T_ProjectileThing = _vm->_dungeonMan->getUnusedThing(k14_ProjectileThingType)) == Thing::_none) { /* BUG0_16 If the game cannot create a projectile thing because it has run out of such things (60 maximum) then the object being thrown/shot/launched is orphaned. If the game has run out of projectile things it will try to remove a projectile from elsewhere in the dungeon, except in an area of 11x11 squares centered around the party (to make sure the player cannot actually see the thing disappear on screen) */ return; } L0466_T_ProjectileThing = thingWithNewCell(L0466_T_ProjectileThing, cell); - L0467_ps_Projectile = (Projectile *)_vm->_dungeonMan->f156_getThingData(L0466_T_ProjectileThing); + L0467_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(L0466_T_ProjectileThing); L0467_ps_Projectile->_slot = thing; L0467_ps_Projectile->_kineticEnergy = MIN((int16)kineticEnergy, (int16)255); L0467_ps_Projectile->_attack = attack; - _vm->_dungeonMan->f163_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->_g272_currMapIndex, _vm->_gameTime + 1); + _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) { L0468_s_Event._type = k49_TMEventTypeMoveProjectile; /* Launcher projectiles can impact immediately */ } else { @@ -112,13 +112,13 @@ bool ProjExpl::f217_projectileHasImpactOccurred(int16 impactType, int16 mapXComb uint16 L0511_ui_CreatureType; uint16 L0512_ui_CreatureIndex; - L0490_ps_Projectile = (Projectile *)_vm->_dungeonMan->f156_getThingData(Thing(projectileThing)); + L0490_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(Thing(projectileThing)); L0501_i_MapXCombo = mapXCombo; L0502_i_MapYCombo = mapYCombo; L0509_B_RemovePotion = false; _g364_creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; if ((L0510_i_ProjectileAssociatedThingType = (L0486_T_ProjectileAssociatedThing = L0490_ps_Projectile->_slot).getType()) == k8_PotionThingType) { - L0491_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(L0486_T_ProjectileAssociatedThing); + L0491_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0486_T_ProjectileAssociatedThing); switch (((Potion *)L0491_ps_Group)->getType()) { case k3_PotionTypeVen: L0498_T_ExplosionThing = Thing::_explPoisonCloud; @@ -148,8 +148,8 @@ T0217004: } switch (impactType) { case k4_DoorElemType: - AL0487_i_DoorState = Square(L0503_uc_Square = _vm->_dungeonMan->_g271_currMapData[AP0454_i_ProjectileTargetMapX][AP0455_i_ProjectileTargetMapY]).getDoorState(); - L0494_ps_Door = (Door *)_vm->_dungeonMan->f157_getSquareFirstThingData(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY); + AL0487_i_DoorState = Square(L0503_uc_Square = _vm->_dungeonMan->_currMapData[AP0454_i_ProjectileTargetMapX][AP0455_i_ProjectileTargetMapY]).getDoorState(); + L0494_ps_Door = (Door *)_vm->_dungeonMan->getSquareFirstThingData(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY); if ((AL0487_i_DoorState != k5_doorState_DESTROYED) && (L0486_T_ProjectileAssociatedThing == Thing::_explOpenDoor)) { if (L0494_ps_Door->hasButton()) { _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1); @@ -158,11 +158,11 @@ T0217004: } if ((AL0487_i_DoorState == k5_doorState_DESTROYED) || (AL0487_i_DoorState <= k1_doorState_FOURTH) || - (getFlag(_vm->_dungeonMan->_g275_currMapDoorInfo[L0494_ps_Door->getType()]._attributes, k0x0002_MaskDoorInfo_ProjectilesCanPassThrough) && + (getFlag(_vm->_dungeonMan->_currMapDoorInfo[L0494_ps_Door->getType()]._attributes, k0x0002_MaskDoorInfo_ProjectilesCanPassThrough) && ((L0510_i_ProjectileAssociatedThingType == k15_ExplosionThingType) ? (L0486_T_ProjectileAssociatedThing.toUint16() >= Thing::_explHarmNonMaterial.toUint16()) : ((L0490_ps_Projectile->_attack > _vm->getRandomNumber(128)) && - getFlag(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(L0486_T_ProjectileAssociatedThing)].getAllowedSlots(), k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors) + 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 >= k176_IconIndiceJunkIronKey) && (AL0487_i_IconIndex <= k191_IconIndiceJunkMasterKey)))) @@ -179,7 +179,7 @@ T0217004: L0489_i_ChampionAttack = L0488_i_Attack = f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing); break; case kM1_CreatureElemType: - L0491_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(_vm->_groupMan->f175_groupGetThing(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY)); + L0491_ps_Group = (Group *)_vm->_dungeonMan->getThingData(_vm->_groupMan->f175_groupGetThing(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY)); if (!(L0512_ui_CreatureIndex = _vm->_groupMan->f176_getCreatureOrdinalInCell(L0491_ps_Group, cell))) { return false; } @@ -203,7 +203,7 @@ T0217004: (AL0487_i_Outcome == k0_outcomeKilledNoCreaturesInGroup) && (L0510_i_ProjectileAssociatedThingType == k5_WeaponThingType) && getFlag(L0493_ps_CreatureInfo->_attributes, k0x0400_MaskCreatureInfo_keepThrownSharpWeapon)) { - L0495_ps_Weapon = (Weapon *)_vm->_dungeonMan->f156_getThingData(L0486_T_ProjectileAssociatedThing); + L0495_ps_Weapon = (Weapon *)_vm->_dungeonMan->getThingData(L0486_T_ProjectileAssociatedThing); AL0487_i_WeaponType = L0495_ps_Weapon->getType(); if ((AL0487_i_WeaponType == k8_WeaponTypeDagger) || (AL0487_i_WeaponType == k27_WeaponTypeArrow) || (AL0487_i_WeaponType == k28_WeaponTypeSlayer) || (AL0487_i_WeaponType == k31_WeaponTypePoisonDart) || (AL0487_i_WeaponType == k32_WeaponTypeThrowingStar)) { L0497_pT_GroupSlot = &L0491_ps_Group->_slot; @@ -242,7 +242,7 @@ T0217044: L0492_ps_Potion->_nextThing = Thing::_none; L0490_ps_Projectile->_slot = L0498_T_ExplosionThing; } - _vm->_dungeonMan->f164_unlinkThingFromList(projectileThing, Thing(0), L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); + _vm->_dungeonMan->unlinkThingFromList(projectileThing, Thing(0), L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); f215_projectileDelete(projectileThing, L0497_pT_GroupSlot, L0499_i_ProjectileMapX, L0500_i_ProjectileMapY); return true; } @@ -261,13 +261,13 @@ uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing th L0484_ui_KineticEnergy = projectile->_kineticEnergy; if ((AL0483_ui_ThingType = thing.getType()) != k15_ExplosionThingType) { if (AL0483_ui_ThingType == k5_WeaponThingType) { - L0485_ps_WeaponInfo = _vm->_dungeonMan->f158_getWeaponInfo(thing); + L0485_ps_WeaponInfo = _vm->_dungeonMan->getWeaponInfo(thing); AL0483_ui_Attack = L0485_ps_WeaponInfo->_kineticEnergy; _g367_projectileAttackType = k3_attackType_BLUNT; } else { AL0483_ui_Attack = _vm->getRandomNumber(4); } - AL0483_ui_Attack += _vm->_dungeonMan->f140_getObjectWeight(thing) >> 1; + AL0483_ui_Attack += _vm->_dungeonMan->getObjectWeight(thing) >> 1; } else { if (thing == Thing::_explSlime) { AL0483_ui_Attack = _vm->getRandomNumber(16); @@ -299,12 +299,12 @@ uint16 ProjExpl::f216_projectileGetImpactAttack(Projectile* projectile, Thing th void ProjExpl::f213_explosionCreate(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->f166_getUnusedThing(k15_ExplosionThingType); + Thing L0473_T_Thing = _vm->_dungeonMan->getUnusedThing(k15_ExplosionThingType); if (L0473_T_Thing == Thing::_none) { return; } - Explosion *L0470_ps_Explosion = &((Explosion *)_vm->_dungeonMan->_g284_thingData[k15_ExplosionThingType])[(L0473_T_Thing).getIndex()]; + Explosion *L0470_ps_Explosion = &((Explosion *)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[(L0473_T_Thing).getIndex()]; int16 L0474_i_ProjectileTargetMapX; int16 L0475_i_ProjectileTargetMapY; if (mapXCombo <= 255) { @@ -332,9 +332,9 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC _vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, k1_soundModePlayIfPrioritized); } } - _vm->_dungeonMan->f163_linkThingToList(L0473_T_Thing, Thing(0), AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY); + _vm->_dungeonMan->linkThingToList(L0473_T_Thing, Thing(0), AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY); TimelineEvent L0476_s_Event; - setMapAndTime(L0476_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1)); + setMapAndTime(L0476_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1)); L0476_s_Event._type = k25_TMEventTypeExplosion; L0476_s_Event._priority = 0; L0476_s_Event._C._slot = L0473_T_Thing.toUint16(); @@ -347,11 +347,11 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC attack = (attack >> 1) + 1; attack += _vm->getRandomNumber(attack) + 1; if ((explThing == Thing::_explFireBall) || (attack >>= 1)) { - if ((_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (AP0443_ui_ProjectileMapX == _vm->_dungeonMan->_g306_partyMapX) && (AP0444_ui_ProjectileMapY == _vm->_dungeonMan->_g307_partyMapY)) { + if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (AP0443_ui_ProjectileMapX == _vm->_dungeonMan->_partyMapX) && (AP0444_ui_ProjectileMapY == _vm->_dungeonMan->_partyMapY)) { _vm->_championMan->getDamagedChampionCount(attack, k0x0001_ChampionWoundReadHand | k0x0002_ChampionWoundActionHand | k0x0004_ChampionWoundHead | k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs | k0x0020_ChampionWoundFeet, k1_attackType_FIRE); } else { if ((L0473_T_Thing = _vm->_groupMan->f175_groupGetThing(AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY)) != Thing::_endOfList) { /* ASSEMBLY_COMPILATION_DIFFERENCE jmp */ - Group *L0472_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(L0473_T_Thing); + Group *L0472_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0473_T_Thing); CreatureInfo *L0471_ps_CreatureInfo = &g243_CreatureInfo[L0472_ps_Group->_type]; int16 L0469_i_CreatureFireResistance = L0471_ps_CreatureInfo->getFireResistance(); if (L0469_i_CreatureFireResistance != k15_immuneToFire) { @@ -376,7 +376,7 @@ int16 ProjExpl::f218_projectileGetImpactCount(int16 impactType, int16 mapX, int1 L0514_i_ImpactCount = 0; _g364_creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup; T0218001: - L0513_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(mapX, mapY); + 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) && @@ -387,7 +387,7 @@ T0218001: break; goto T0218001; } - L0513_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0513_T_Thing); + L0513_T_Thing = _vm->_dungeonMan->getNextThing(L0513_T_Thing); } return L0514_i_ImpactCount; } @@ -396,22 +396,22 @@ void ProjExpl::f214_projectileDeleteEvent(Thing thing) { Projectile* L0477_ps_Projectile; - L0477_ps_Projectile = (Projectile *)_vm->_dungeonMan->f156_getThingData(thing); + L0477_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(thing); _vm->_timeline->f237_deleteEvent(L0477_ps_Projectile->_eventIndex); } void ProjExpl::f215_projectileDelete(Thing projectileThing, Thing* groupSlot, int16 mapX, int16 mapY) { - Projectile *L0480_ps_Projectile = (Projectile *)_vm->_dungeonMan->f156_getThingData(projectileThing); + Projectile *L0480_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(projectileThing); Thing L0479_T_Thing = L0480_ps_Projectile->_slot; if (L0479_T_Thing.getType() != k15_ExplosionThingType) { if (groupSlot != NULL) { Thing L0478_T_PreviousThing = *groupSlot; if (L0478_T_PreviousThing == Thing::_endOfList) { - Thing *L0481_ps_Generic = (Thing *)_vm->_dungeonMan->f156_getThingData(L0479_T_Thing); + Thing *L0481_ps_Generic = (Thing *)_vm->_dungeonMan->getThingData(L0479_T_Thing); *L0481_ps_Generic = Thing::_endOfList; *groupSlot = L0479_T_Thing; } else { - _vm->_dungeonMan->f163_linkThingToList(L0479_T_Thing, L0478_T_PreviousThing, kM1_MapXNotOnASquare, 0); + _vm->_dungeonMan->linkThingToList(L0479_T_Thing, L0478_T_PreviousThing, kM1_MapXNotOnASquare, 0); } } else { _vm->_moveSens->f267_getMoveResult(Thing((L0479_T_Thing).getTypeAndIndex() | getFlag(projectileThing.toUint16(), 0xC)), -2, 0, mapX, mapY); @@ -440,21 +440,21 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0527_s_Event = *event; L0519_ps_Event = &L0527_s_Event; - L0520_ps_Projectile = (Projectile*)_vm->_dungeonMan->f156_getThingData(L0521_T_ProjectileThing = L0515_T_ProjectileThingNewCell = Thing(L0519_ps_Event->_B._slot)); + L0520_ps_Projectile = (Projectile*)_vm->_dungeonMan->getThingData(L0521_T_ProjectileThing = L0515_T_ProjectileThingNewCell = Thing(L0519_ps_Event->_B._slot)); L0523_i_DestinationMapX = L0519_ps_Event->_C._projectile.getMapX(); L0524_i_DestinationMapY = L0519_ps_Event->_C._projectile.getMapY(); if (L0519_ps_Event->_type == k48_TMEventTypeMoveProjectileIgnoreImpacts) { L0519_ps_Event->_type = k49_TMEventTypeMoveProjectile; } else { L0518_ui_Cell = (L0515_T_ProjectileThingNewCell).getCell(); - if ((_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0523_i_DestinationMapX == _vm->_dungeonMan->_g306_partyMapX) && (L0524_i_DestinationMapY == _vm->_dungeonMan->_g307_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) && f217_projectileHasImpactOccurred(kM2_ChampionElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0515_T_ProjectileThingNewCell)) { return; } if ((_vm->_groupMan->f175_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)) { return; } if (L0520_ps_Projectile->_kineticEnergy <= (AL0516_ui_StepEnergy = L0519_ps_Event->_C._projectile.getStepEnergy())) { - _vm->_dungeonMan->f164_unlinkThingFromList(L0515_T_ProjectileThingNewCell = L0521_T_ProjectileThing, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); + _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); return; } @@ -473,10 +473,10 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0525_i_SourceMapX = L0523_i_DestinationMapX; L0526_i_SourceMapY = L0524_i_DestinationMapY; L0523_i_DestinationMapX += _vm->_dirIntoStepCountEast[L0517_ui_ProjectileDirection], L0524_i_DestinationMapY += _vm->_dirIntoStepCountNorth[L0517_ui_ProjectileDirection]; - AL0516_ui_Square = _vm->_dungeonMan->f151_getSquare(L0523_i_DestinationMapX, L0524_i_DestinationMapY).toByte(); + AL0516_ui_Square = _vm->_dungeonMan->getSquare(L0523_i_DestinationMapX, L0524_i_DestinationMapY).toByte(); 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->_g271_currMapData[L0525_i_SourceMapX][L0526_i_SourceMapY]).getType() == k3_StairsElemType))) { + ((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)) { return; } @@ -496,13 +496,13 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) { L0515_T_ProjectileThingNewCell = thingWithNewCell(L0515_T_ProjectileThingNewCell, _vm->_moveSens->_g401_moveResultCell); M31_setMap(L0519_ps_Event->_mapTime, _vm->_moveSens->_g399_moveResultMapIndex); } else { - if ((Square(_vm->_dungeonMan->f151_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) && f217_projectileHasImpactOccurred(k4_DoorElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) { return; } - _vm->_dungeonMan->f164_unlinkThingFromList(L0515_T_ProjectileThingNewCell, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); - _vm->_dungeonMan->f163_linkThingToList(L0515_T_ProjectileThingNewCell, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); + _vm->_dungeonMan->unlinkThingFromList(L0515_T_ProjectileThingNewCell, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); + _vm->_dungeonMan->linkThingToList(L0515_T_ProjectileThingNewCell, Thing(0), L0523_i_DestinationMapX, L0524_i_DestinationMapY); } - L0519_ps_Event->_mapTime += (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) ? 1 : 3; + L0519_ps_Event->_mapTime += (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) ? 1 : 3; //Strangerke: CHECKME: Maybe we should keep that piece of code too as it sounds like it's fixing a weird behavior of projectiles on different maps #ifdef COMPILE42_CSB20EN_CSB21EN /* CHANGE7_20_IMPROVEMENT Projectiles now move at the same speed on all maps instead of moving slower on maps other than the party map */ L0519_ps_Event->Map_Time++; @@ -531,11 +531,11 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) { L0528_ui_MapX = event->_B._location._mapX; L0529_ui_MapY = event->_B._location._mapY; - L0532_ps_Explosion = &((Explosion*)_vm->_dungeonMan->_g284_thingData[k15_ExplosionThingType])[Thing((event->_C._slot)).getIndex()]; - AL0531_i_SquareType = Square(_vm->_dungeonMan->_g271_currMapData[L0528_ui_MapX][L0529_ui_MapY]).getType(); - L0538_B_ExplosionOnPartySquare = (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0528_ui_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0529_ui_MapY == _vm->_dungeonMan->_g307_partyMapY); + L0532_ps_Explosion = &((Explosion*)_vm->_dungeonMan->_thingData[k15_ExplosionThingType])[Thing((event->_C._slot)).getIndex()]; + AL0531_i_SquareType = Square(_vm->_dungeonMan->_currMapData[L0528_ui_MapX][L0529_ui_MapY]).getType(); + L0538_B_ExplosionOnPartySquare = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0528_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0529_ui_MapY == _vm->_dungeonMan->_partyMapY); if ((L0535_T_GroupThing = _vm->_groupMan->f175_groupGetThing(L0528_ui_MapX, L0529_ui_MapY)) != Thing::_endOfList) { - L0533_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(L0535_T_GroupThing); + L0533_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0535_T_GroupThing); L0534_ps_CreatureInfo = &g243_CreatureInfo[AL0537_ui_CreatureType = L0533_ps_Group->_type]; } if ((L0536_T_ExplosionThing = Thing(Thing::_firstExplosion.toUint16() + L0532_ps_Explosion->getType())) == Thing::_explPoisonCloud) { @@ -557,7 +557,7 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) { break; case 0xFF83: if ((L0535_T_GroupThing != Thing::_endOfList) && getFlag(L0534_ps_CreatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) { - if ((AL0537_ui_CreatureType == k19_CreatureTypeMaterializerZytaz) && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex)) { /* ASSEMBLY_COMPILATION_DIFFERENCE jmp */ + if ((AL0537_ui_CreatureType == k19_CreatureTypeMaterializerZytaz) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) { /* ASSEMBLY_COMPILATION_DIFFERENCE jmp */ L0530_i_Attack -= (AL0537_ui_NonMaterialAdditionalAttack = L0530_i_Attack >> 3); AL0537_ui_NonMaterialAdditionalAttack <<= 1; AL0537_ui_NonMaterialAdditionalAttack++; @@ -599,7 +599,7 @@ T0220026: return; } } - _vm->_dungeonMan->f164_unlinkThingFromList(Thing(event->_C._slot), Thing(0), L0528_ui_MapX, L0529_ui_MapY); + _vm->_dungeonMan->unlinkThingFromList(Thing(event->_C._slot), Thing(0), L0528_ui_MapX, L0529_ui_MapY); L0532_ps_Explosion->setNextThing(Thing::_none); } } diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp index e0bef370fe..bb1bd1ffb0 100644 --- a/engines/dm/sounds.cpp +++ b/engines/dm/sounds.cpp @@ -161,22 +161,22 @@ bool SoundMan::f505_soundGetVolume(int16 mapX, int16 mapY, uint8* leftVolume, ui int16 L1680_i_LeftVolumeColumnIndex = 0; - switch (_vm->_dungeonMan->_g308_partyDir) { + switch (_vm->_dungeonMan->_partyDir) { case kDirNorth: - L1678_i_RightVolumeColumnIndex = mapX - _vm->_dungeonMan->_g306_partyMapX; - L1679_i_LineIndex = mapY - _vm->_dungeonMan->_g307_partyMapY; + L1678_i_RightVolumeColumnIndex = mapX - _vm->_dungeonMan->_partyMapX; + L1679_i_LineIndex = mapY - _vm->_dungeonMan->_partyMapY; break; case kDirEast: - L1678_i_RightVolumeColumnIndex = mapY - _vm->_dungeonMan->_g307_partyMapY; - L1679_i_LineIndex = -(mapX - _vm->_dungeonMan->_g306_partyMapX); + L1678_i_RightVolumeColumnIndex = mapY - _vm->_dungeonMan->_partyMapY; + L1679_i_LineIndex = -(mapX - _vm->_dungeonMan->_partyMapX); break; case kDirSouth: - L1678_i_RightVolumeColumnIndex = -(mapX - _vm->_dungeonMan->_g306_partyMapX); - L1679_i_LineIndex = -(mapY - _vm->_dungeonMan->_g307_partyMapY); + L1678_i_RightVolumeColumnIndex = -(mapX - _vm->_dungeonMan->_partyMapX); + L1679_i_LineIndex = -(mapY - _vm->_dungeonMan->_partyMapY); break; case kDirWest: - L1678_i_RightVolumeColumnIndex = -(mapY - _vm->_dungeonMan->_g307_partyMapY); - L1679_i_LineIndex = mapX - _vm->_dungeonMan->_g306_partyMapX; + L1678_i_RightVolumeColumnIndex = -(mapY - _vm->_dungeonMan->_partyMapY); + L1679_i_LineIndex = mapX - _vm->_dungeonMan->_partyMapX; break; } if ((L1678_i_RightVolumeColumnIndex < -12) || (L1678_i_RightVolumeColumnIndex > 12)) { /* Sound is not audible if source is more than 12 squares away from the party */ @@ -197,13 +197,13 @@ void SoundMan::f064_SOUND_RequestPlay_CPSD(uint16 soundIndex, int16 mapX, int16 Sound* sound; uint8 leftVolume, rightVolume; - if (mode && (_vm->_dungeonMan->_g272_currMapIndex != _vm->_dungeonMan->_g309_partyMapIndex)) + if (mode && (_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex)) return; sound = &g60_sounds[soundIndex]; if (mode > k1_soundModePlayIfPrioritized) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */ TimelineEvent event; - setMapAndTime(event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + mode - 1); + setMapAndTime(event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + mode - 1); event._type = k20_TMEventTypePlaySound; event._priority = sound->_priority; event._C._soundIndex = soundIndex; diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 45ca77108d..3f414c87c9 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -274,7 +274,7 @@ void Timeline::f261_processTimeline() { while (f240_isFirstEventExpiered()) { L0681_ps_Event = &L0682_s_Event; f239_timelineExtractFirstEvent(L0681_ps_Event); - _vm->_dungeonMan->f173_setCurrentMap(getMap(L0682_s_Event._mapTime)); + _vm->_dungeonMan->setCurrentMap(getMap(L0682_s_Event._mapTime)); AL0680_ui_EventType = L0682_s_Event._type; if ((AL0680_ui_EventType > (k29_TMEventTypeGroupReactionDangerOnSquare - 1)) && (AL0680_ui_EventType < (k41_TMEventTypeUpdateBehaviour_3 + 1))) { _vm->_groupMan->f209_processEvents29to41(L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, AL0680_ui_EventType, L0682_s_Event._C._ticks); @@ -323,8 +323,8 @@ void Timeline::f261_processTimeline() { break; case k24_TMEventTypeRemoveFluxcage: if (!_vm->_gameWon) { - _vm->_dungeonMan->f164_unlinkThingFromList(Thing(L0682_s_Event._C._slot), Thing(0), L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY); - L0681_ps_Event = (TimelineEvent*)_vm->_dungeonMan->f156_getThingData(Thing(L0682_s_Event._C._slot)); + _vm->_dungeonMan->unlinkThingFromList(Thing(L0682_s_Event._C._slot), Thing(0), L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY); + L0681_ps_Event = (TimelineEvent*)_vm->_dungeonMan->getThingData(Thing(L0682_s_Event._C._slot)); ((Explosion*)L0681_ps_Event)->setNextThing(Thing::_none); } break; @@ -338,7 +338,7 @@ void Timeline::f261_processTimeline() { f254_timelineProcessEvent12_hideDamageReceived(L0682_s_Event._priority); break; case k70_TMEventTypeLight: - _vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex); + _vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex); f257_timelineProcessEvent70_light(L0681_ps_Event); _vm->_inventoryMan->f337_setDungeonViewPalette(); break; @@ -376,7 +376,7 @@ T0261053: _vm->_championMan->_party._event79Count_Footprints--; } } - _vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex); + _vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex); } } @@ -404,16 +404,16 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) { #define AL0602_ui_VerticalDoor L0602_ui_Multiple #define AL0602_ui_Height L0602_ui_Multiple - L0597_puc_Square = (Square*)&_vm->_dungeonMan->_g271_currMapData[L0593_ui_MapX = event->_B._location._mapX][L0594_ui_MapY = event->_B._location._mapY]; + L0597_puc_Square = (Square*)&_vm->_dungeonMan->_currMapData[L0593_ui_MapX = event->_B._location._mapX][L0594_ui_MapY = event->_B._location._mapY]; if ((L0596_i_DoorState = Square(*L0597_puc_Square).getDoorState()) == k5_doorState_DESTROYED) { return; } event->_mapTime++; L0595_i_Effect = event->_C.A._effect; if (L0595_i_Effect == k1_SensorEffClear) { - L0598_ps_Door = (Door*)_vm->_dungeonMan->f157_getSquareFirstThingData(L0593_ui_MapX, L0594_ui_MapY); + L0598_ps_Door = (Door*)_vm->_dungeonMan->getSquareFirstThingData(L0593_ui_MapX, L0594_ui_MapY); AL0602_ui_VerticalDoor = L0598_ps_Door->opensVertically(); - if ((_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0593_ui_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0594_ui_MapY == _vm->_dungeonMan->_g307_partyMapY) && (L0596_i_DoorState != k0_doorState_OPEN)) { + if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0593_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0594_ui_MapY == _vm->_dungeonMan->_partyMapY) && (L0596_i_DoorState != k0_doorState_OPEN)) { if (_vm->_championMan->_partyChampionCount > 0) { L0597_puc_Square->setDoorState(k0_doorState_OPEN); @@ -428,9 +428,9 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) { f238_addEventGetEventIndex(event); return; } - if (((L0599_T_GroupThing = _vm->_groupMan->f175_groupGetThing(L0593_ui_MapX, L0594_ui_MapY)) != Thing::_endOfList) && !getFlag(L0600_ui_CreatureAttributes = _vm->_dungeonMan->f144_getCreatureAttributes(L0599_T_GroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) { + if (((L0599_T_GroupThing = _vm->_groupMan->f175_groupGetThing(L0593_ui_MapX, L0594_ui_MapY)) != Thing::_endOfList) && !getFlag(L0600_ui_CreatureAttributes = _vm->_dungeonMan->getCreatureAttributes(L0599_T_GroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) { if (L0596_i_DoorState >= (AL0602_ui_Height ? CreatureInfo::getHeight(L0600_ui_CreatureAttributes) : 1)) { /* Creature height or 1 */ - if (_vm->_groupMan->f191_getDamageAllCreaturesOutcome((Group*)_vm->_dungeonMan->f156_getThingData(L0599_T_GroupThing), L0593_ui_MapX, L0594_ui_MapY, 5, true) != k2_outcomeKilledAllCreaturesInGroup) { + if (_vm->_groupMan->f191_getDamageAllCreaturesOutcome((Group*)_vm->_dungeonMan->getThingData(L0599_T_GroupThing), L0593_ui_MapX, L0594_ui_MapY, 5, true) != k2_outcomeKilledAllCreaturesInGroup) { _vm->_groupMan->f209_processEvents29to41(L0593_ui_MapX, L0594_ui_MapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0); } L0596_i_DoorState = (L0596_i_DoorState == k0_doorState_OPEN) ? k0_doorState_OPEN : (L0596_i_DoorState - 1); @@ -471,17 +471,17 @@ void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) { byte* L0607_puc_Square; - L0607_puc_Square = &_vm->_dungeonMan->_g271_currMapData[L0603_ui_MapX = event->_B._location._mapX][L0604_ui_MapY = event->_B._location._mapY]; + L0607_puc_Square = &_vm->_dungeonMan->_currMapData[L0603_ui_MapX = event->_B._location._mapX][L0604_ui_MapY = event->_B._location._mapY]; L0605_i_Effect = event->_C.A._effect; if (L0605_i_Effect == k2_SensorEffToggle) { L0605_i_Effect = getFlag(*L0607_puc_Square, k0x0004_FakeWallOpen) ? k1_SensorEffClear : k0_SensorEffSet; } if (L0605_i_Effect == k1_SensorEffClear) { - if ((_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0603_ui_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0604_ui_MapY == _vm->_dungeonMan->_g307_partyMapY)) { + if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0603_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0604_ui_MapY == _vm->_dungeonMan->_partyMapY)) { event->_mapTime++; f238_addEventGetEventIndex(event); } else { - if (((L0606_T_Thing = _vm->_groupMan->f175_groupGetThing(L0603_ui_MapX, L0604_ui_MapY)) != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->f144_getCreatureAttributes(L0606_T_Thing), k0x0040_MaskCreatureInfo_nonMaterial)) { + if (((L0606_T_Thing = _vm->_groupMan->f175_groupGetThing(L0603_ui_MapX, L0604_ui_MapY)) != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(L0606_T_Thing), k0x0040_MaskCreatureInfo_nonMaterial)) { event->_mapTime++; f238_addEventGetEventIndex(event); } else { @@ -496,7 +496,7 @@ void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) { void Timeline::f243_timelineProcessEvent2_doorDestruction(TimelineEvent* event) { Square* L0608_puc_Square; - L0608_puc_Square = (Square*)&_vm->_dungeonMan->_g271_currMapData[event->_B._location._mapX][event->_B._location._mapY]; + L0608_puc_Square = (Square*)&_vm->_dungeonMan->_currMapData[event->_B._location._mapX][event->_B._location._mapY]; L0608_puc_Square->setDoorState(k5_doorState_DESTROYED); } @@ -504,7 +504,7 @@ void Timeline::f244_timelineProcessEvent10_squareDoor(TimelineEvent* event) { int16 L0609_i_DoorState; - if ((L0609_i_DoorState = Square(_vm->_dungeonMan->_g271_currMapData[event->_B._location._mapX][event->_B._location._mapY]).getDoorState()) == k5_doorState_DESTROYED) { + if ((L0609_i_DoorState = Square(_vm->_dungeonMan->_currMapData[event->_B._location._mapX][event->_B._location._mapY]).getDoorState()) == k5_doorState_DESTROYED) { return; } if (event->_C.A._effect == k2_SensorEffToggle) { @@ -530,7 +530,7 @@ void Timeline::f251_timelineProcessEvent9_squarePit(TimelineEvent* event) { byte* L0655_puc_Square; - L0655_puc_Square = &_vm->_dungeonMan->_g271_currMapData[L0653_ui_MapX = event->_B._location._mapX][L0654_ui_MapY = event->_B._location._mapY]; + L0655_puc_Square = &_vm->_dungeonMan->_currMapData[L0653_ui_MapX = event->_B._location._mapX][L0654_ui_MapY = event->_B._location._mapY]; if (event->_C.A._effect == k2_SensorEffToggle) { event->_C.A._effect = getFlag(*L0655_puc_Square, k0x0008_PitOpen) ? k1_SensorEffClear : k0_SensorEffSet; } @@ -553,32 +553,32 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) { int16 L0649_i_ThingsToMoveCount; - if ((_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (mapX == _vm->_dungeonMan->_g306_partyMapX) && (mapY == _vm->_dungeonMan->_g307_partyMapY)) { + if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY)) { _vm->_moveSens->f267_getMoveResult(Thing::_party, mapX, mapY, mapX, mapY); _vm->_championMan->drawChangedObjectIcons(); } if ((L0645_T_Thing = _vm->_groupMan->f175_groupGetThing(mapX, mapY)) != Thing::_endOfList) { _vm->_moveSens->f267_getMoveResult(L0645_T_Thing, mapX, mapY, mapX, mapY); } - L0645_T_Thing = _vm->_dungeonMan->f162_getSquareFirstObject(mapX, mapY); + L0645_T_Thing = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY); L0648_T_NextThing = L0645_T_Thing; L0649_i_ThingsToMoveCount = 0; while (L0645_T_Thing != Thing::_endOfList) { if (L0645_T_Thing.getType() > k4_GroupThingType) { L0649_i_ThingsToMoveCount++; } - L0645_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0645_T_Thing); + L0645_T_Thing = _vm->_dungeonMan->getNextThing(L0645_T_Thing); } L0645_T_Thing = L0648_T_NextThing; while ((L0645_T_Thing != Thing::_endOfList) && L0649_i_ThingsToMoveCount) { L0649_i_ThingsToMoveCount--; - L0648_T_NextThing = _vm->_dungeonMan->f159_getNextThing(L0645_T_Thing); + L0648_T_NextThing = _vm->_dungeonMan->getNextThing(L0645_T_Thing); AL0644_ui_ThingType = L0645_T_Thing.getType(); if (AL0644_ui_ThingType > k4_GroupThingType) { _vm->_moveSens->f267_getMoveResult(L0645_T_Thing, mapX, mapY, mapX, mapY); } if (AL0644_ui_ThingType == k14_ProjectileThingType) { - L0646_ps_Projectile = (Projectile*)_vm->_dungeonMan->f156_getThingData(L0645_T_Thing); + L0646_ps_Projectile = (Projectile*)_vm->_dungeonMan->getThingData(L0645_T_Thing); L0647_ps_Event = &_g370_events[L0646_ps_Projectile->_eventIndex]; L0647_ps_Event->_C._projectile.setMapX(_vm->_moveSens->_g397_moveResultMapX); L0647_ps_Event->_C._projectile.setMapY(_vm->_moveSens->_g398_moveResultMapY); @@ -607,7 +607,7 @@ void Timeline::f250_timelineProcessEvent8_squareTeleporter(TimelineEvent* event) byte* L0652_puc_Square; - L0652_puc_Square = &_vm->_dungeonMan->_g271_currMapData[L0650_ui_MapX = event->_B._location._mapX][L0651_ui_MapY = event->_B._location._mapY]; + L0652_puc_Square = &_vm->_dungeonMan->_currMapData[L0650_ui_MapX = event->_B._location._mapX][L0651_ui_MapY = event->_B._location._mapY]; if (event->_C.A._effect == k2_SensorEffToggle) { event->_C.A._effect = getFlag(*L0652_puc_Square, k0x0008_TeleporterOpen) ? k1_SensorEffClear : k0_SensorEffSet; } @@ -634,11 +634,11 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) { uint16 L0643_ui_Cell; - L0634_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(L0641_i_MapX = event->_B._location._mapX, L0642_i_MapY = event->_B._location._mapY); + L0634_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0641_i_MapX = event->_B._location._mapX, L0642_i_MapY = event->_B._location._mapY); L0643_ui_Cell = event->_C.A._cell; while (L0634_T_Thing != Thing::_endOfList) { if (((L0635_i_ThingType = L0634_T_Thing.getType()) == k2_TextstringType) && (L0634_T_Thing.getCell() == event->_C.A._cell)) { - L0639_ps_TextString = (TextString*)_vm->_dungeonMan->f156_getThingData(L0634_T_Thing); + L0639_ps_TextString = (TextString*)_vm->_dungeonMan->getThingData(L0634_T_Thing); if (event->_C.A._effect == k2_SensorEffToggle) { L0639_ps_TextString->setVisible(!L0639_ps_TextString->isVisible()); } else { @@ -646,7 +646,7 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) { } } else { if (L0635_i_ThingType == k3_SensorThingType) { - L0638_ps_Sensor = (Sensor*)_vm->_dungeonMan->f156_getThingData(L0634_T_Thing); + L0638_ps_Sensor = (Sensor*)_vm->_dungeonMan->getThingData(L0634_T_Thing); L0640_ui_SensorType = L0638_ps_Sensor->getType(); L0637_ui_SensorData = L0638_ps_Sensor->getData(); if (L0640_ui_SensorType == k6_SensorWallCountdown) { @@ -659,12 +659,12 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) { L0637_ui_SensorData--; } L0638_ps_Sensor->setData(L0637_ui_SensorData); - if (L0638_ps_Sensor->getEffectA() == k3_SensorEffHold) { - AL0636_B_TriggerSetEffect = ((L0637_ui_SensorData == 0) != L0638_ps_Sensor->getRevertEffectA()); + if (L0638_ps_Sensor->getAttrEffectA() == k3_SensorEffHold) { + AL0636_B_TriggerSetEffect = ((L0637_ui_SensorData == 0) != L0638_ps_Sensor->getAttrRevertEffectA()); _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, AL0636_B_TriggerSetEffect ? k0_SensorEffSet : k1_SensorEffClear, L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); } else { if (L0637_ui_SensorData == 0) { - _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, L0638_ps_Sensor->getEffectA(), L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); + _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, L0638_ps_Sensor->getAttrEffectA(), L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); } } } @@ -685,23 +685,23 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) { } } L0638_ps_Sensor->setData(L0637_ui_SensorData); - AL0636_B_TriggerSetEffect = (Sensor::getDataMask1(L0637_ui_SensorData) == Sensor::getDataMask2(L0637_ui_SensorData)) != L0638_ps_Sensor->getRevertEffectA(); - if (L0638_ps_Sensor->getEffectA() == k3_SensorEffHold) { + AL0636_B_TriggerSetEffect = (Sensor::getDataMask1(L0637_ui_SensorData) == Sensor::getDataMask2(L0637_ui_SensorData)) != L0638_ps_Sensor->getAttrRevertEffectA(); + if (L0638_ps_Sensor->getAttrEffectA() == k3_SensorEffHold) { _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, AL0636_B_TriggerSetEffect ? k0_SensorEffSet : k1_SensorEffClear, L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); } else { if (AL0636_B_TriggerSetEffect) { - _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, L0638_ps_Sensor->getEffectA(), L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); + _vm->_moveSens->f272_sensorTriggerEffect(L0638_ps_Sensor, L0638_ps_Sensor->getAttrEffectA(), L0641_i_MapX, L0642_i_MapY, L0643_ui_Cell); } } } else { if ((((L0640_ui_SensorType >= k7_SensorWallSingleProjLauncherNewObj) && (L0640_ui_SensorType <= k10_SensorWallDoubleProjLauncherExplosion)) || (L0640_ui_SensorType == k14_SensorWallSingleProjLauncherSquareObj) || (L0640_ui_SensorType == k15_SensorWallDoubleProjLauncherSquareObj)) && (L0634_T_Thing.getCell() == event->_C.A._cell)) { f247_triggerProjectileLauncher(L0638_ps_Sensor, event); - if (L0638_ps_Sensor->getOnlyOnce()) { + if (L0638_ps_Sensor->getAttrOnlyOnce()) { L0638_ps_Sensor->setTypeDisabled(); } } else { if (L0640_ui_SensorType == k18_SensorWallEndGame) { - _vm->delay(60 * L0638_ps_Sensor->getValue()); + _vm->delay(60 * L0638_ps_Sensor->getAttrValue()); _vm->_restartGameAllowed = false; _vm->_gameWon = true; _vm->endGame(true); @@ -711,7 +711,7 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) { } } } - L0634_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0634_T_Thing); + L0634_T_Thing = _vm->_dungeonMan->getNextThing(L0634_T_Thing); } _vm->_moveSens->f271_processRotationEffect(); } @@ -737,8 +737,8 @@ void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* eve L0628_ui_ProjectileCell = returnOppositeDir((Direction)L0624_ui_Cell); L0625_i_SensorType = sensor->getType(); L0629_i_SensorData = sensor->getData(); - L0630_i_KineticEnergy = sensor->M47_kineticEnergy(); - L0631_i_StepEnergy = sensor->M48_stepEnergy(); + L0630_i_KineticEnergy = sensor->getActionKineticEnergy(); + L0631_i_StepEnergy = sensor->getActionStepEnergy(); L0632_B_LaunchSingleProjectile = (L0625_i_SensorType == k7_SensorWallSingleProjLauncherNewObj) || (L0625_i_SensorType == k8_SensorWallSingleProjLauncherExplosion) || (L0625_i_SensorType == k14_SensorWallSingleProjLauncherSquareObj); @@ -746,36 +746,36 @@ void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* eve L0622_T_FirstProjectileAssociatedThing = L0623_T_SecondProjectileAssociatedThing = Thing(L0629_i_SensorData + Thing::_firstExplosion.toUint16()); } else { if ((L0625_i_SensorType == k14_SensorWallSingleProjLauncherSquareObj) || (L0625_i_SensorType == k15_SensorWallDoubleProjLauncherSquareObj)) { - L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->f161_getSquareFirstThing(L0626_i_MapX, L0627_i_MapY); + L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->getSquareFirstThing(L0626_i_MapX, L0627_i_MapY); while (L0622_T_FirstProjectileAssociatedThing != Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList. If there are no more objects on the square then this loop may return an undefined value, this can crash the game. In the original DM and CSB dungeons, the number of times that these sensors are triggered is always controlled to be equal to the number of available objects (with a countdown sensor or a number of once only sensors) */ L0633_ui_ThingCell = L0622_T_FirstProjectileAssociatedThing.getCell(); if ((L0622_T_FirstProjectileAssociatedThing.getType() > k3_SensorThingType) && ((L0633_ui_ThingCell == L0624_ui_Cell) || (L0633_ui_ThingCell == returnNextVal(L0624_ui_Cell)))) break; - L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->f159_getNextThing(L0622_T_FirstProjectileAssociatedThing); + L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->getNextThing(L0622_T_FirstProjectileAssociatedThing); } if (L0622_T_FirstProjectileAssociatedThing == Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList */ return; } - _vm->_dungeonMan->f164_unlinkThingFromList(L0622_T_FirstProjectileAssociatedThing, Thing(0), L0626_i_MapX, L0627_i_MapY); /* The object is removed without triggering any sensor effects */ + _vm->_dungeonMan->unlinkThingFromList(L0622_T_FirstProjectileAssociatedThing, Thing(0), L0626_i_MapX, L0627_i_MapY); /* The object is removed without triggering any sensor effects */ if (!L0632_B_LaunchSingleProjectile) { - L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->f161_getSquareFirstThing(L0626_i_MapX, L0627_i_MapY); + L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->getSquareFirstThing(L0626_i_MapX, L0627_i_MapY); while (L0623_T_SecondProjectileAssociatedThing != Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList. If there are no more objects on the square then this loop may return an undefined value, this can crash the game */ L0633_ui_ThingCell = L0623_T_SecondProjectileAssociatedThing.getCell(); if ((L0623_T_SecondProjectileAssociatedThing.getType() > k3_SensorThingType) && ((L0633_ui_ThingCell == L0624_ui_Cell) || (L0633_ui_ThingCell == returnNextVal(L0624_ui_Cell)))) break; - L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->f159_getNextThing(L0623_T_SecondProjectileAssociatedThing); + L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->getNextThing(L0623_T_SecondProjectileAssociatedThing); } if (L0623_T_SecondProjectileAssociatedThing == Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList */ L0632_B_LaunchSingleProjectile = true; } else { - _vm->_dungeonMan->f164_unlinkThingFromList(L0623_T_SecondProjectileAssociatedThing, Thing(0), L0626_i_MapX, L0627_i_MapY); /* The object is removed without triggering any sensor effects */ + _vm->_dungeonMan->unlinkThingFromList(L0623_T_SecondProjectileAssociatedThing, Thing(0), L0626_i_MapX, L0627_i_MapY); /* The object is removed without triggering any sensor effects */ } } } else { - if ((L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->f167_getObjForProjectileLaucherOrObjGen(L0629_i_SensorData)) == Thing::_none) { + if ((L0622_T_FirstProjectileAssociatedThing = _vm->_dungeonMan->getObjForProjectileLaucherOrObjGen(L0629_i_SensorData)) == Thing::_none) { return; } - if (!L0632_B_LaunchSingleProjectile && ((L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->f167_getObjForProjectileLaucherOrObjGen(L0629_i_SensorData)) == Thing::_none)) { + if (!L0632_B_LaunchSingleProjectile && ((L0623_T_SecondProjectileAssociatedThing = _vm->_dungeonMan->getObjForProjectileLaucherOrObjGen(L0629_i_SensorData)) == Thing::_none)) { L0632_B_LaunchSingleProjectile = true; } } @@ -810,49 +810,49 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) { TimelineEvent L0619_s_Event; - L0613_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(L0616_ui_MapX = event->_B._location._mapX, L0617_ui_MapY = event->_B._location._mapY); + L0613_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0616_ui_MapX = event->_B._location._mapX, L0617_ui_MapY = event->_B._location._mapY); while (L0613_T_Thing != Thing::_endOfList) { if ((L0610_i_ThingType = L0613_T_Thing.getType()) == k2_TextstringType) { - L0615_ps_TextString = (TextString*)_vm->_dungeonMan->f156_getThingData(L0613_T_Thing); + L0615_ps_TextString = (TextString*)_vm->_dungeonMan->getThingData(L0613_T_Thing); L0611_B_TextCurrentlyVisible = L0615_ps_TextString->isVisible(); if (event->_C.A._effect == k2_SensorEffToggle) { L0615_ps_TextString->setVisible(!L0611_B_TextCurrentlyVisible); } else { L0615_ps_TextString->setVisible((event->_C.A._effect == k0_SensorEffSet)); } - if (!L0611_B_TextCurrentlyVisible && L0615_ps_TextString->isVisible() && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0616_ui_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0617_ui_MapY == _vm->_dungeonMan->_g307_partyMapY)) { - _vm->_dungeonMan->f168_decodeText(_vm->_stringBuildBuffer, L0613_T_Thing, k1_TextTypeMessage); + if (!L0611_B_TextCurrentlyVisible && L0615_ps_TextString->isVisible() && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0616_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0617_ui_MapY == _vm->_dungeonMan->_partyMapY)) { + _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, L0613_T_Thing, k1_TextTypeMessage); _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer); } } else { if (L0610_i_ThingType == k3_SensorThingType) { - L0614_ps_Sensor = (Sensor*)_vm->_dungeonMan->f156_getThingData(L0613_T_Thing); + L0614_ps_Sensor = (Sensor*)_vm->_dungeonMan->getThingData(L0613_T_Thing); if (L0614_ps_Sensor->getType() == k6_SensorFloorGroupGenerator) { - L0612_i_CreatureCount = L0614_ps_Sensor->getValue(); + L0612_i_CreatureCount = L0614_ps_Sensor->getAttrValue(); if (getFlag(L0612_i_CreatureCount, k0x0008_randomizeGeneratedCreatureCount)) { L0612_i_CreatureCount = _vm->getRandomNumber(getFlag(L0612_i_CreatureCount, k0x0007_generatedCreatureCount)); } else { L0612_i_CreatureCount--; } - AL0618_ui_HealthMultiplier = L0614_ps_Sensor->getHealthMultiplier(); + AL0618_ui_HealthMultiplier = L0614_ps_Sensor->getActionHealthMultiplier(); if (AL0618_ui_HealthMultiplier == 0) { - AL0618_ui_HealthMultiplier = _vm->_dungeonMan->_g269_currMap->_difficulty; + AL0618_ui_HealthMultiplier = _vm->_dungeonMan->_currMap->_difficulty; } _vm->_groupMan->f185_groupGetGenerated(L0614_ps_Sensor->getData(), AL0618_ui_HealthMultiplier, L0612_i_CreatureCount, (Direction)_vm->getRandomNumber(4), L0616_ui_MapX, L0617_ui_MapY); - if (L0614_ps_Sensor->getAudibleA()) { + if (L0614_ps_Sensor->getAttrAudibleA()) { _vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L0616_ui_MapX, L0617_ui_MapY, k1_soundModePlayIfPrioritized); } - if (L0614_ps_Sensor->getOnlyOnce()) { + if (L0614_ps_Sensor->getAttrOnlyOnce()) { L0614_ps_Sensor->setTypeDisabled(); } else { - AL0618_ui_Ticks = L0614_ps_Sensor->M46_ticks(); + AL0618_ui_Ticks = L0614_ps_Sensor->getActionTicks(); if (AL0618_ui_Ticks != 0) { L0614_ps_Sensor->setTypeDisabled(); if (AL0618_ui_Ticks > 127) { AL0618_ui_Ticks = (AL0618_ui_Ticks - 126) << 6; } L0619_s_Event._type = k65_TMEventTypeEnableGroupGenerator; - setMapAndTime(L0619_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + AL0618_ui_Ticks); + setMapAndTime(L0619_s_Event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + AL0618_ui_Ticks); L0619_s_Event._priority = 0; L0619_s_Event._B._location._mapX = L0616_ui_MapX; L0619_s_Event._B._location._mapY = L0617_ui_MapY; @@ -863,7 +863,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) { } } } - L0613_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0613_T_Thing); + L0613_T_Thing = _vm->_dungeonMan->getNextThing(L0613_T_Thing); } } @@ -878,7 +878,7 @@ void Timeline::f252_timelineProcessEvents60to61_moveGroup(TimelineEvent* event) L0657_ui_MapY = event->_B._location._mapY; L0657_ui_MapY = event->_B._location._mapY; T0252001: - if (((_vm->_dungeonMan->_g272_currMapIndex != _vm->_dungeonMan->_g309_partyMapIndex) || (L0656_ui_MapX != _vm->_dungeonMan->_g306_partyMapX) || (L0657_ui_MapY != _vm->_dungeonMan->_g307_partyMapY)) && (_vm->_groupMan->f175_groupGetThing(L0656_ui_MapX, L0657_ui_MapY) == Thing::_endOfList)) { /* BUG0_24 Lord Chaos may teleport into one of the Black Flames and become invisible until the Black Flame is killed. In this case, _vm->_groupMan->f175_groupGetThing returns the Black Flame thing and the Lord Chaos thing is not moved into the dungeon until the Black Flame is killed */ + if (((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) || (L0656_ui_MapX != _vm->_dungeonMan->_partyMapX) || (L0657_ui_MapY != _vm->_dungeonMan->_partyMapY)) && (_vm->_groupMan->f175_groupGetThing(L0656_ui_MapX, L0657_ui_MapY) == Thing::_endOfList)) { /* BUG0_24 Lord Chaos may teleport into one of the Black Flames and become invisible until the Black Flame is killed. In this case, _vm->_groupMan->f175_groupGetThing returns the Black Flame thing and the Lord Chaos thing is not moved into the dungeon until the Black Flame is killed */ if (event->_type == k61_TMEventTypeMoveGroupAudible) { _vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L0656_ui_MapX, L0657_ui_MapY, k1_soundModePlayIfPrioritized); } @@ -886,7 +886,7 @@ T0252001: } else { if (!L0659_B_RandomDirectionMoveRetried) { L0659_B_RandomDirectionMoveRetried = true; - L0658_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(Thing(event->_C._slot)); + L0658_ps_Group = (Group*)_vm->_dungeonMan->getThingData(Thing(event->_C._slot)); if ((L0658_ps_Group->_type == k23_CreatureTypeLordChaos) && !_vm->getRandomNumber(4)) { switch (_vm->getRandomNumber(4)) { case 0: @@ -914,17 +914,17 @@ void Timeline::f246_timelineProcesEvent65_enableGroupGenerator(TimelineEvent* ev Thing L0620_T_Thing; Sensor* L0621_ps_Sensor; - L0620_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(event->_B._location._mapX, event->_B._location._mapY); - L0620_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(event->_B._location._mapX, event->_B._location._mapY); + L0620_T_Thing = _vm->_dungeonMan->getSquareFirstThing(event->_B._location._mapX, event->_B._location._mapY); + L0620_T_Thing = _vm->_dungeonMan->getSquareFirstThing(event->_B._location._mapX, event->_B._location._mapY); while (L0620_T_Thing != Thing::_none) { if ((L0620_T_Thing.getType()) == k3_SensorThingType) { - L0621_ps_Sensor = (Sensor*)_vm->_dungeonMan->f156_getThingData(L0620_T_Thing); + L0621_ps_Sensor = (Sensor*)_vm->_dungeonMan->getThingData(L0620_T_Thing); if (L0621_ps_Sensor->getType() == k0_SensorDisabled) { L0621_ps_Sensor->setDatAndTypeWithOr(k6_SensorFloorGroupGenerator); return; } } - L0620_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0620_T_Thing); + L0620_T_Thing = _vm->_dungeonMan->getNextThing(L0620_T_Thing); } } @@ -1030,7 +1030,7 @@ void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) { if (L0673_i_WeakerLightPower) { L0676_s_Event._type = k70_TMEventTypeLight; L0676_s_Event._B._lightPower = L0673_i_WeakerLightPower; - setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 4); + setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 4); L0676_s_Event._priority = 0; f238_addEventGetEventIndex(&L0676_s_Event); } @@ -1071,21 +1071,21 @@ T0255002: f238_addEventGetEventIndex(event); break; case 1: - L0667_T_Thing = _vm->_dungeonMan->f161_getSquareFirstThing(L0664_i_MapX, L0665_i_MapY); + 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); if (L0669_i_IconIndex == k147_IconIndiceJunkChampionBones) { - L0668_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L0667_T_Thing); + L0668_ps_Junk = (Junk*)_vm->_dungeonMan->getThingData(L0667_T_Thing); if (L0668_ps_Junk->getChargeCount() == L0671_ui_ChampionIndex) { - _vm->_dungeonMan->f164_unlinkThingFromList(L0667_T_Thing, Thing(0), L0664_i_MapX, L0665_i_MapY); /* BUG0_25 When a champion dies, no bones object is created so it is not possible to bring the champion back to life at an altar of Vi. Each time a champion is brought back to life, the bones object is removed from the dungeon but it is not marked as unused and thus becomes an orphan. After a large number of champion deaths, all JUNK things are exhausted and the game cannot create any more. This also affects the creation of JUNK things dropped by some creatures when they die (Screamer, Rockpile, Magenta Worm, Pain Rat, Red Dragon) */ + _vm->_dungeonMan->unlinkThingFromList(L0667_T_Thing, Thing(0), L0664_i_MapX, L0665_i_MapY); /* BUG0_25 When a champion dies, no bones object is created so it is not possible to bring the champion back to life at an altar of Vi. Each time a champion is brought back to life, the bones object is removed from the dungeon but it is not marked as unused and thus becomes an orphan. After a large number of champion deaths, all JUNK things are exhausted and the game cannot create any more. This also affects the creation of JUNK things dropped by some creatures when they die (Screamer, Rockpile, Magenta Worm, Pain Rat, Red Dragon) */ L0668_ps_Junk->setNextThing(Thing::_none); event->_mapTime += 1; goto T0255002; } } } - L0667_T_Thing = _vm->_dungeonMan->f159_getNextThing(L0667_T_Thing); + L0667_T_Thing = _vm->_dungeonMan->getNextThing(L0667_T_Thing); } break; case 0: |