aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-08-25 21:17:48 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit5c81e4f4fd2ea79255e9bc635eb8ef2a93aef60c (patch)
treeffcd683b492648b41d76923b6146d39e51007bc2 /engines
parent6a02a571cd5e8df4f70f64eace4fbce03f70faf8 (diff)
downloadscummvm-rg350-5c81e4f4fd2ea79255e9bc635eb8ef2a93aef60c.tar.gz
scummvm-rg350-5c81e4f4fd2ea79255e9bc635eb8ef2a93aef60c.tar.bz2
scummvm-rg350-5c81e4f4fd2ea79255e9bc635eb8ef2a93aef60c.zip
DM: Rename functions and class members of GroupMan
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/champion.cpp2
-rw-r--r--engines/dm/dm.cpp10
-rw-r--r--engines/dm/dungeonman.cpp8
-rw-r--r--engines/dm/eventman.cpp8
-rw-r--r--engines/dm/gfx.cpp8
-rw-r--r--engines/dm/group.cpp520
-rw-r--r--engines/dm/group.h147
-rw-r--r--engines/dm/loadsave.cpp16
-rw-r--r--engines/dm/menus.cpp20
-rw-r--r--engines/dm/movesens.cpp44
-rw-r--r--engines/dm/projexpl.cpp30
-rw-r--r--engines/dm/timeline.cpp18
12 files changed, 414 insertions, 417 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 91a1f99ded..f21d4c5124 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -1072,7 +1072,7 @@ 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->_partyMapX, _vm->_dungeonMan->_partyMapY) <= 1)) {
signed char orderedCellsToAttack[4];
- _vm->_groupMan->f229_setOrderedCellsToAttack(orderedCellsToAttack, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, mapX, mapY, cell);
+ _vm->_groupMan->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)
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 9eefbff309..7f439a20b9 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -365,10 +365,10 @@ void DMEngine::startGame() {
}
void DMEngine::processNewPartyMap(uint16 mapIndex) {
- _groupMan->f194_removeAllActiveGroups();
+ _groupMan->removeAllActiveGroups();
_dungeonMan->setCurrentMapAndPartyMap(mapIndex);
_displayMan->loadCurrentMapGraphics();
- _groupMan->f195_addAllActiveGroups();
+ _groupMan->addAllActiveGroups();
_inventoryMan->f337_setDungeonViewPalette();
}
@@ -972,7 +972,7 @@ void DMEngine::fuseSequnce() {
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 = (Group*)_dungeonMan->getThingData(L1433_T_LordChaosThing = _groupMan->groupGetThing(L1431_i_LordChaosMapX, L1432_i_LordChaosMapY));
L1428_ps_Group->_health[0] = 10000;
_dungeonMan->setGroupCells(L1428_ps_Group, k255_CreatureTypeSingleCenteredCreature, _dungeonMan->_partyMapIndex);
_dungeonMan->setGroupDirections(L1428_ps_Group, returnOppositeDir(_dungeonMan->_partyDir), _dungeonMan->_partyMapIndex);
@@ -1028,8 +1028,8 @@ T0446002:
fuseSequenceUpdate();
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);
+ if (((L1427_T_Thing = _groupMan->groupGetThing(AL1424_i_MapX, AL1425_i_MapY)) != Thing::_endOfList) && ((AL1424_i_MapX != L1431_i_LordChaosMapX) || (AL1425_i_MapY != L1432_i_LordChaosMapY))) {
+ _groupMan->groupDelete(AL1424_i_MapX, AL1425_i_MapY);
}
}
}
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 00e66fee6f..5f356b9a09 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1448,8 +1448,8 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
case k14_ProjectileThingType:
setCurrentMap(mapIndex);
if (thingType == k4_GroupThingType) {
- _vm->_groupMan->f188_dropGroupPossessions(currMapX, currMapY, squareThing, kM1_soundModeDoNotPlaySound);
- _vm->_groupMan->f189_delete(currMapX, currMapY);
+ _vm->_groupMan->dropGroupPossessions(currMapX, currMapY, squareThing, kM1_soundModeDoNotPlaySound);
+ _vm->_groupMan->groupDelete(currMapX, currMapY);
} else {
_vm->_projexpl->f214_projectileDeleteEvent(squareThing);
unlinkThingFromList(squareThing, Thing(0), currMapX, currMapY);
@@ -1515,14 +1515,14 @@ uint16 DungeonMan::getCreatureAttributes(Thing thing) {
void DungeonMan::setGroupCells(Group* group, uint16 cells, uint16 mapIndex) {
if (mapIndex == _partyMapIndex)
- _vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]._cells = cells;
+ _vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._cells = cells;
else
group->_cells = cells;
}
void DungeonMan::setGroupDirections(Group* group, int16 dir, uint16 mapIndex) {
if (mapIndex == _partyMapIndex)
- _vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]._directions = (Direction)dir;
+ _vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._directions = (Direction)dir;
else
group->setDir(normalizeModulo4(dir));
}
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index d5d1e310a3..b627549379 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -1016,9 +1016,9 @@ void EventManager::commandMoveParty(CommandType cmdType) {
if (damage)
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
} else {
- isMovementBlocked = (_vm->_groupMan->f175_groupGetThing(partyMapX, partyMapY) != Thing::_endOfList);
+ isMovementBlocked = (_vm->_groupMan->groupGetThing(partyMapX, partyMapY) != Thing::_endOfList);
if (isMovementBlocked)
- _vm->_groupMan->f209_processEvents29to41(partyMapX, partyMapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
+ _vm->_groupMan->processEvents29to41(partyMapX, partyMapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
}
}
@@ -1347,10 +1347,10 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16
int16 mapY = _vm->_dungeonMan->_partyMapY;
if (viewCell >= k2_ViewCellBackRight) {
mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
- Thing groupThing = _vm->_groupMan->f175_groupGetThing(mapX, mapY);
+ Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
if ((groupThing != Thing::_endOfList) &&
!_vm->_moveSens->f264_isLevitating(groupThing) &&
- _vm->_groupMan->f176_getCreatureOrdinalInCell((Group*)_vm->_dungeonMan->getThingData(groupThing), normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir))) {
+ _vm->_groupMan->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 */
}
}
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 89cba9d2ee..7947ea957e 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3234,14 +3234,14 @@ T0115015_DrawProjectileAsObject:
ActiveGroup *activeGroup;
if (group == nullptr) { /* If all creature data and info has not already been gathered */
group = (Group*)_vm->_dungeonMan->getThingData(groupThing);
- activeGroup = &_vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()];
+ activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()];
CreatureInfo *creatureInfo = &g243_CreatureInfo[group->_type];
creatureAspectStruct = &_creatureAspects219[creatureInfo->_creatureAspectIndex];
creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size);
creatureGraphicInfoGreen = creatureInfo->_graphicInfo;
}
objectAspect = (ObjectAspect*)creatureAspectStruct;
- AL_0_creatureIndexRed = _vm->_groupMan->f176_getCreatureOrdinalInCell(group, cellYellowBear);
+ AL_0_creatureIndexRed = _vm->_groupMan->getCreatureOrdinalInCell(group, cellYellowBear);
if (AL_0_creatureIndexRed) { /* If there is a creature on the cell being processed */
AL_0_creatureIndexRed--; /* Convert ordinal to index */
@@ -3252,7 +3252,7 @@ T0115015_DrawProjectileAsObject:
} else
goto T0115129_DrawProjectiles; /* No creature to draw at cell, skip to projectiles */
- creatureDirectionDelta = normalizeModulo4(directionParam - _vm->_groupMan->M50_getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed));
+ creatureDirectionDelta = normalizeModulo4(directionParam - _vm->_groupMan->getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed));
twoHalfSquareCreaturesFrontView = false;
if ((AL_4_groupCells = activeGroup->_cells) == k255_CreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */
if (remainingViewCellOrdinalsToProcess || (doorFrontViewDrawingPass == 1))
@@ -3281,7 +3281,7 @@ T0115015_DrawProjectileAsObject:
creatureIndexGreen = 0;
twoHalfSquareCreaturesFrontView = group->getCount();
- if (((AL_4_groupCells = _vm->_groupMan->M50_getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed)) == directionParam) || (AL_4_groupCells == returnPrevVal(directionParam)))
+ if (((AL_4_groupCells = _vm->_groupMan->getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed)) == directionParam) || (AL_4_groupCells == returnPrevVal(directionParam)))
AL_2_viewCell = k0_HalfSizedViewCell_LeftColumn;
else
AL_2_viewCell = k1_HalfSizedViewCell_RightColumn;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 2b2675c7ff..99ce13381a 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -43,75 +43,75 @@ int32 M32_setTime(int32 &map_time, int32 time) {
GroupMan::GroupMan(DMEngine *vm) : _vm(vm) {
for (uint16 i = 0; i < 4; ++i)
- _g392_dropMovingCreatureFixedPossessionsCell[i] = 0;
- _g391_dropMovingCreatureFixedPossCellCount = 0;
- _g386_fluxCageCount = 0;
+ _dropMovingCreatureFixedPossessionsCell[i] = 0;
+ _dropMovingCreatureFixedPossCellCount = 0;
+ _fluxCageCount = 0;
for (uint16 i = 0; i < 4; ++i)
- _g385_fluxCages[i] = 0;
- _g378_currentGroupMapX = 0;
- _g379_currentGroupMapY = 0;
- _g380_currGroupThing = Thing(0);
+ _fluxCages[i] = 0;
+ _currentGroupMapX = 0;
+ _currentGroupMapY = 0;
+ _currGroupThing = Thing(0);
for (uint16 i = 0; i < 4; ++i)
- _g384_groupMovementTestedDirections[i] = 0;
- _g381_currGroupDistanceToParty = 0;
- _g382_currGroupPrimaryDirToParty = 0;
- _g383_currGroupSecondaryDirToParty = 0;
- _g388_groupMovementBlockedByGroupThing = Thing(0);
- _g389_groupMovementBlockedByDoor = false;
- _g390_groupMovementBlockedByParty = false;
- _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = false;
- _g376_maxActiveGroupCount = 60;
- _g375_activeGroups = nullptr;
- _g377_currActiveGroupCount = 0;
- _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = 0;
+ _groupMovementTestedDirections[i] = 0;
+ _currGroupDistanceToParty = 0;
+ _currGroupPrimaryDirToParty = 0;
+ _currGroupSecondaryDirToParty = 0;
+ _groupMovementBlockedByGroupThing = Thing(0);
+ _groupMovementBlockedByDoor = false;
+ _groupMovementBlockedByParty = false;
+ _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = false;
+ _maxActiveGroupCount = 60;
+ _activeGroups = nullptr;
+ _currActiveGroupCount = 0;
+ twoHalfSquareSizedCreaturesGroupLastDirectionSetTime = 0;
}
GroupMan::~GroupMan() {
- delete[] _g375_activeGroups;
+ delete[] _activeGroups;
}
-void GroupMan::f196_initActiveGroups() {
+void GroupMan::initActiveGroups() {
if (_vm->_newGameFl)
- _g376_maxActiveGroupCount = 60;
+ _maxActiveGroupCount = 60;
- if (_g375_activeGroups)
- delete[] _g375_activeGroups;
+ if (_activeGroups)
+ delete[] _activeGroups;
- _g375_activeGroups = new ActiveGroup[_g376_maxActiveGroupCount];
- for (uint16 i = 0; i < _g376_maxActiveGroupCount; ++i)
- _g375_activeGroups[i]._groupThingIndex = -1;
+ _activeGroups = new ActiveGroup[_maxActiveGroupCount];
+ for (uint16 i = 0; i < _maxActiveGroupCount; ++i)
+ _activeGroups[i]._groupThingIndex = -1;
}
-uint16 GroupMan::f145_getGroupCells(Group *group, int16 mapIndex) {
+uint16 GroupMan::getGroupCells(Group *group, int16 mapIndex) {
byte cells = group->_cells;
if (mapIndex == _vm->_dungeonMan->_partyMapIndex)
- cells = _g375_activeGroups[cells]._cells;
+ cells = _activeGroups[cells]._cells;
return cells;
}
-uint16 GroupMan::f147_getGroupDirections(Group *group, int16 mapIndex) {
+uint16 GroupMan::getGroupDirections(Group *group, int16 mapIndex) {
static byte groupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections
if (mapIndex == _vm->_dungeonMan->_partyMapIndex)
- return _g375_activeGroups[group->getActiveGroupIndex()]._directions;
+ return _activeGroups[group->getActiveGroupIndex()]._directions;
return groupDirections[group->getDir()];
}
-int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) {
+int16 GroupMan::getCreatureOrdinalInCell(Group *group, uint16 cell) {
uint16 currMapIndex = _vm->_dungeonMan->_currMapIndex;
- byte groupCells = f145_getGroupCells(group, currMapIndex);
+ byte groupCells = getGroupCells(group, currMapIndex);
if (groupCells == k255_CreatureTypeSingleCenteredCreature)
return _vm->indexToOrdinal(0);
int retval = 0;
byte creatureIndex = group->getCount();
if (getFlag(g243_CreatureInfo[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
- if ((f147_getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
+ if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
cell = returnPrevVal(cell);
do {
- byte creatureCell = M50_getCreatureValue(groupCells, creatureIndex);
+ byte creatureCell = getCreatureValue(groupCells, creatureIndex);
if (creatureCell == cell || creatureCell == returnNextVal(cell)) {
retval = _vm->indexToOrdinal(creatureIndex);
break;
@@ -119,7 +119,7 @@ int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) {
} while (creatureIndex--);
} else {
do {
- if (M50_getCreatureValue(groupCells, creatureIndex) == cell) {
+ if (getCreatureValue(groupCells, creatureIndex) == cell) {
retval = _vm->indexToOrdinal(creatureIndex);
break;
}
@@ -129,19 +129,19 @@ int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) {
return retval;
}
-uint16 GroupMan::M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
+uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
return (groupVal >> (creatureIndex << 1)) & 0x3;
}
-void GroupMan::f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode) {
+void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode) {
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->_currMapIndex);
+ uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
do {
- f186_dropCreatureFixedPossessions(creatureType, mapX, mapY,
- (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : M50_getCreatureValue(groupCells, creatureIndex), mode);
+ dropCreatureFixedPossessions(creatureType, mapX, mapY,
+ (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex), mode);
} while (creatureIndex--);
}
@@ -163,7 +163,7 @@ void GroupMan::f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThin
}
}
-void GroupMan::f186_dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell, int16 mode) {
+void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell, int16 mode) {
static uint16 fixedPossessionCreature12Skeleton[3] = { // @ G0245_aui_Graphic559_FixedPossessionsCreature12Skeleton
k23_ObjectInfoIndexFirstWeapon + k9_WeaponTypeFalchion,
k69_ObjectInfoIndexFirstArmour + k30_ArmourTypeWoodenShield,
@@ -290,7 +290,7 @@ void GroupMan::f186_dropCreatureFixedPossessions(uint16 creatureType, int16 mapX
_vm->_sound->f064_SOUND_RequestPlay_CPSD(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
}
-int16 GroupMan::f228_getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
+int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
#define AP0483_i_PrimaryDirection srcMapX
int16 L0556_i_Direction;
@@ -310,9 +310,9 @@ int16 GroupMan::f228_getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 sr
}
L0556_i_Direction = kDirNorth;
for (;;) {
- if (f227_isDestVisibleFromSource(L0556_i_Direction, srcMapX, srcMapY, destMapX, destMapY)) {
- if (!f227_isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) {
- if ((L0556_i_Direction != kDirNorth) || !f227_isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnPrevVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) {
+ if (isDestVisibleFromSource(L0556_i_Direction, srcMapX, srcMapY, destMapX, destMapY)) {
+ if (!isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) {
+ if ((L0556_i_Direction != kDirNorth) || !isDestVisibleFromSource(_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnPrevVal(L0556_i_Direction), srcMapX, srcMapY, destMapX, destMapY)) {
_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + L0556_i_Direction);
return L0556_i_Direction;
}
@@ -328,7 +328,7 @@ int16 GroupMan::f228_getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 sr
}
}
-bool GroupMan::f227_isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
+bool GroupMan::isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
int L1637_i_Temp;
switch (dir) { /* If direction is not 'West' then swap variables so that the same test as for west can be applied */
@@ -359,7 +359,7 @@ bool GroupMan::f227_isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 src
return ((srcMapX -= (destMapX - 1)) > 0) && ((((srcMapY -= destMapY) < 0) ? -srcMapY : srcMapY) <= srcMapX);
}
-bool GroupMan::f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack, bool magicAttack, int16 ticks) {
+bool GroupMan::groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack, bool magicAttack, int16 ticks) {
Door *L0573_ps_Door = (Door *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY);
if ((magicAttack && !L0573_ps_Door->isMagicDestructible()) || (!magicAttack && !L0573_ps_Door->isMeleeDestructible())) {
return false;
@@ -384,7 +384,7 @@ bool GroupMan::f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16
return false;
}
-Thing GroupMan::f175_groupGetThing(int16 mapX, int16 mapY) {
+Thing GroupMan::groupGetThing(int16 mapX, int16 mapY) {
Thing L0317_T_Thing;
L0317_T_Thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
@@ -394,7 +394,7 @@ Thing GroupMan::f175_groupGetThing(int16 mapX, int16 mapY) {
return L0317_T_Thing;
}
-int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex, int16 mapX, int16 mapY, int16 damage, bool notMoving) {
+int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex, int16 mapX, int16 mapY, int16 damage, bool notMoving) {
uint16 L0374_ui_Multiple;
#define AL0374_ui_EventIndex L0374_ui_Multiple
#define AL0374_ui_CreatureIndex L0374_ui_Multiple
@@ -421,26 +421,26 @@ 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->_currMapIndex);
- L0384_ui_Cell = (L0381_ui_GroupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : M50_getCreatureValue(L0381_ui_GroupCells, creatureIndex);
+ L0381_ui_GroupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
+ L0384_ui_Cell = (L0381_ui_GroupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(L0381_ui_GroupCells, creatureIndex);
if (!(L0379_ui_CreatureCount = group->getCount())) { /* If there is a single creature in the group */
if (notMoving) {
- f188_dropGroupPossessions(mapX, mapY, f175_groupGetThing(mapX, mapY), k2_soundModePlayOneTickLater);
- f189_delete(mapX, mapY);
+ dropGroupPossessions(mapX, mapY, groupGetThing(mapX, mapY), k2_soundModePlayOneTickLater);
+ groupDelete(mapX, mapY);
}
AL0375_ui_Outcome = k2_outcomeKilledAllCreaturesInGroup;
} else { /* If there are several creatures in the group */
- L0382_ui_GroupDirections = f147_getGroupDirections(group, _vm->_dungeonMan->_currMapIndex);
+ L0382_ui_GroupDirections = 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);
+ dropCreatureFixedPossessions(AL0380_ui_CreatureType, mapX, mapY, L0384_ui_Cell, k2_soundModePlayOneTickLater);
} else {
- _g392_dropMovingCreatureFixedPossessionsCell[_g391_dropMovingCreatureFixedPossCellCount++] = L0384_ui_Cell;
+ _dropMovingCreatureFixedPossessionsCell[_dropMovingCreatureFixedPossCellCount++] = L0384_ui_Cell;
}
}
L0383_B_CurrentMapIsPartyMap = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex);
if (L0383_B_CurrentMapIsPartyMap)
- L0378_ps_ActiveGroup = &_g375_activeGroups[group->getActiveGroupIndex()];
+ L0378_ps_ActiveGroup = &_activeGroups[group->getActiveGroupIndex()];
if (group->getBehaviour() == k6_behavior_ATTACK) {
L0377_ps_Event = _vm->_timeline->_g370_events;
@@ -474,8 +474,8 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature
for (AL0375_ui_NextCreatureIndex = AL0374_ui_CreatureIndex = creatureIndex; AL0374_ui_CreatureIndex < L0379_ui_CreatureCount; AL0374_ui_CreatureIndex++) {
AL0375_ui_NextCreatureIndex++;
group->_health[AL0374_ui_CreatureIndex] = group->_health[AL0375_ui_NextCreatureIndex];
- L0382_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0382_ui_GroupDirections, AL0374_ui_CreatureIndex, M50_getCreatureValue(L0382_ui_GroupDirections, AL0375_ui_NextCreatureIndex));
- L0381_ui_GroupCells = f178_getGroupValueUpdatedWithCreatureValue(L0381_ui_GroupCells, AL0374_ui_CreatureIndex, M50_getCreatureValue(L0381_ui_GroupCells, AL0375_ui_NextCreatureIndex));
+ L0382_ui_GroupDirections = getGroupValueUpdatedWithCreatureValue(L0382_ui_GroupDirections, AL0374_ui_CreatureIndex, getCreatureValue(L0382_ui_GroupDirections, AL0375_ui_NextCreatureIndex));
+ L0381_ui_GroupCells = getGroupValueUpdatedWithCreatureValue(L0381_ui_GroupCells, AL0374_ui_CreatureIndex, getCreatureValue(L0381_ui_GroupCells, AL0375_ui_NextCreatureIndex));
if (L0383_B_CurrentMapIsPartyMap) {
L0378_ps_ActiveGroup->_aspect[AL0374_ui_CreatureIndex] = L0378_ps_ActiveGroup->_aspect[AL0375_ui_NextCreatureIndex];
}
@@ -505,12 +505,12 @@ T0190024:
return k0_outcomeKilledNoCreaturesInGroup;
}
-void GroupMan::f189_delete(int16 mapX, int16 mapY) {
+void GroupMan::groupDelete(int16 mapX, int16 mapY) {
Thing L0372_T_GroupThing;
Group *L0373_ps_Group;
- if ((L0372_T_GroupThing = f175_groupGetThing(mapX, mapY)) == Thing::_endOfList) {
+ if ((L0372_T_GroupThing = groupGetThing(mapX, mapY)) == Thing::_endOfList) {
return;
}
L0373_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0372_T_GroupThing);
@@ -519,13 +519,13 @@ void GroupMan::f189_delete(int16 mapX, int16 mapY) {
_vm->_moveSens->f267_getMoveResult(L0372_T_GroupThing, mapX, mapY, kM1_MapXNotOnASquare, 0);
L0373_ps_Group->_nextThing = Thing::_none;
if (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) {
- _g375_activeGroups[L0373_ps_Group->getActiveGroupIndex()]._groupThingIndex = -1;
- _g377_currActiveGroupCount--;
+ _activeGroups[L0373_ps_Group->getActiveGroupIndex()]._groupThingIndex = -1;
+ _currActiveGroupCount--;
}
- f181_groupDeleteEvents(mapX, mapY);
+ groupDeleteEvents(mapX, mapY);
}
-void GroupMan::f181_groupDeleteEvents(int16 mapX, int16 mapY) {
+void GroupMan::groupDeleteEvents(int16 mapX, int16 mapY) {
int16 L0334_i_EventIndex;
uint16 L0335_ui_EventType;
TimelineEvent *L0336_ps_Event;
@@ -542,13 +542,13 @@ void GroupMan::f181_groupDeleteEvents(int16 mapX, int16 mapY) {
}
}
-uint16 GroupMan::f178_getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 creatureIndex, uint16 creatreVal) {
+uint16 GroupMan::getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 creatureIndex, uint16 creatreVal) {
creatreVal &= 0x0003;
creatreVal <<= (creatureIndex <<= 1);
return creatreVal | (groupVal & ~(3 << creatreVal));
}
-int16 GroupMan::f191_getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving) {
+int16 GroupMan::getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving) {
uint16 L0385_ui_RandomAttack;
int16 L0386_i_CreatureIndex;
int16 L0387_i_Outcome;
@@ -558,13 +558,13 @@ int16 GroupMan::f191_getDamageAllCreaturesOutcome(Group *group, int16 mapX, int1
L0388_B_KilledSomeCreatures = false;
L0389_B_KilledAllCreatures = true;
- _g391_dropMovingCreatureFixedPossCellCount = 0;
+ _dropMovingCreatureFixedPossCellCount = 0;
if (attack > 0) {
L0386_i_CreatureIndex = group->getCount();
attack -= (L0385_ui_RandomAttack = (attack >> 3) + 1);
L0385_ui_RandomAttack <<= 1;
do {
- L0389_B_KilledAllCreatures = (L0387_i_Outcome = f190_groupGetDamageCreatureOutcome(group, L0386_i_CreatureIndex, mapX, mapY, attack + _vm->getRandomNumber(L0385_ui_RandomAttack), notMoving)) && L0389_B_KilledAllCreatures;
+ L0389_B_KilledAllCreatures = (L0387_i_Outcome = groupGetDamageCreatureOutcome(group, L0386_i_CreatureIndex, mapX, mapY, attack + _vm->getRandomNumber(L0385_ui_RandomAttack), notMoving)) && L0389_B_KilledAllCreatures;
L0388_B_KilledSomeCreatures = L0388_B_KilledSomeCreatures || L0387_i_Outcome;
} while (L0386_i_CreatureIndex--);
if (L0389_B_KilledAllCreatures) {
@@ -579,7 +579,7 @@ int16 GroupMan::f191_getDamageAllCreaturesOutcome(Group *group, int16 mapX, int1
}
}
-int16 GroupMan::f192_groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack) {
+int16 GroupMan::groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack) {
int16 L0390_i_PoisonResistance;
@@ -589,7 +589,7 @@ int16 GroupMan::f192_groupGetResistanceAdjustedPoisonAttack(uint16 creatreType,
return ((poisonAttack + _vm->getRandomNumber(4)) << 3) / ++L0390_i_PoisonResistance;
}
-void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks) {
+void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks) {
Group *L0444_ps_Group;
ActiveGroup *L0445_ps_ActiveGroup;
int16 L0446_i_Multiple;
@@ -638,7 +638,7 @@ void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16
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) {
+ if ((L0449_T_GroupThing = groupGetThing(eventMapX, eventMapY)) == Thing::_endOfList) {
goto T0209139_Return;
}
L0444_ps_Group = (Group *)_vm->_dungeonMan->getThingData(L0449_T_GroupThing);
@@ -650,7 +650,7 @@ void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16
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->_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 */
+ if (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;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction], AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction];
@@ -673,10 +673,10 @@ T0209005_AddEventAndReturn:
if (_vm->_gameWon) {
goto T0209139_Return;
}
- _g386_fluxCageCount = 0;
- _g385_fluxCages[0] = 0;
+ _fluxCageCount = 0;
+ _fluxCages[0] = 0;
}
- L0445_ps_ActiveGroup = &_g375_activeGroups[L0444_ps_Group->getActiveGroupIndex()];
+ L0445_ps_ActiveGroup = &_activeGroups[L0444_ps_Group->getActiveGroupIndex()];
L0462_i_TicksSinceLastMove = (unsigned char)_vm->_gameTime - L0445_ps_ActiveGroup->_lastMoveTime;
if (L0462_i_TicksSinceLastMove < 0)
@@ -709,20 +709,20 @@ T0209005_AddEventAndReturn:
L0459_i_CreatureSize = getFlag(L0448_s_CreatureInfo._attributes, k0x0003_MaskCreatureInfo_size);
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->_partyMapX, _vm->_dungeonMan->_partyMapY);
- _g382_currGroupPrimaryDirToParty = f228_getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
- _g383_currGroupSecondaryDirToParty = _vm->_projexpl->_g363_secondaryDirToOrFromParty;
+ _currentGroupMapX = eventMapX;
+ _currentGroupMapY = eventMapY;
+ _currGroupThing = L0449_T_GroupThing;
+ _groupMovementTestedDirections[0] = 0;
+ _currGroupDistanceToParty = getDistanceBetweenSquares(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
+ _currGroupPrimaryDirToParty = getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
+ _currGroupSecondaryDirToParty = _vm->_projexpl->_g363_secondaryDirToOrFromParty;
L0464_l_NextAspectUpdateTime = 0;
L0455_B_CurrentEventTypeIsNotUpdateBehavior = true;
if (eventType <= k31_TMEventTypeGroupReactionPartyIsAdjecent) { /* Process Reaction events 29 to 31 */
switch (eventType = eventType - k32_TMEventTypeUpdateAspectGroup) {
case kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent: /* This event is used when the party bumps into a group or attacks a group physically (not with a spell). It causes the creature behavior to change to attack if it is not already attacking the party or fleeing from target */
if ((AL0447_i_Behavior != k6_behavior_ATTACK) && (AL0447_i_Behavior != k5_behavior_FLEE)) {
- f181_groupDeleteEvents(eventMapX, eventMapY);
+ groupDeleteEvents(eventMapX, eventMapY);
goto T0209044_SetBehavior6_Attack;
}
L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
@@ -732,7 +732,7 @@ T0209005_AddEventAndReturn:
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 */
goto T0209139_Return;
if ((AL0446_i_Behavior2Or3 = ((AL0447_i_Behavior == k3_behavior_USELESS) || (AL0447_i_Behavior == k2_behavior_USELESS))) || (_vm->getRandomNumber(4))) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is thus: if 3/4 chances */
- if (!f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) { /* If the group cannot see the party then look in a random direction to try and search for the party */
+ if (!groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) { /* If the group cannot see the party then look in a random direction to try and search for the party */
L0458_B_SetBehavior7_ApproachAfterReaction = L0453_B_NewGroupDirectionFound = false;
goto T0209073_SetDirectionGroup;
}
@@ -747,7 +747,7 @@ T0209005_AddEventAndReturn:
}
if (eventType < k37_TMEventTypeUpdateBehaviourGroup) { /* Process Update Aspect events 32 to 36 */
L0465_s_NextEvent._type = eventType + 5;
- if (f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
+ if (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->_partyMapX, _vm->_dungeonMan->_partyMapY, eventMapX, eventMapY) <= 1)
goto T0209044_SetBehavior6_Attack;
@@ -759,7 +759,7 @@ T0209005_AddEventAndReturn:
}
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 */
- L0464_l_NextAspectUpdateTime = f179_getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0446_i_CreatureAspectIndex, getFlag(L0445_ps_ActiveGroup->_aspect[AL0446_i_CreatureAspectIndex], k0x0080_MaskActiveGroupIsAttacking));
+ L0464_l_NextAspectUpdateTime = getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0446_i_CreatureAspectIndex, getFlag(L0445_ps_ActiveGroup->_aspect[AL0446_i_CreatureAspectIndex], k0x0080_MaskActiveGroupIsAttacking));
goto T0209136;
}
if ((AL0450_i_DistanceXToParty > 3) || (AL0451_i_DistanceYToParty > 3)) {
@@ -773,21 +773,21 @@ T0209005_AddEventAndReturn:
if (eventType == k37_TMEventTypeUpdateBehaviourGroup) { /* Process event 37, Update Group Behavior */
if ((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k2_behavior_USELESS) || (AL0447_i_Behavior == k3_behavior_USELESS)) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
- L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ L0452_i_DistanceToVisibleParty = groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
if (L0452_i_DistanceToVisibleParty) {
if ((L0452_i_DistanceToVisibleParty <= (L0448_s_CreatureInfo.getAttackRange())) && ((!AL0450_i_DistanceXToParty) || (!AL0451_i_DistanceYToParty))) { /* If the creature is in range for attack and on the same row or column as the party on the map */
T0209044_SetBehavior6_Attack:
if (eventType == kM2_TMEventTypeCreateReactionEvent30HitByProjectile) {
- f181_groupDeleteEvents(eventMapX, eventMapY);
+ groupDeleteEvents(eventMapX, eventMapY);
}
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;
+ AL0446_i_Direction = _currGroupPrimaryDirToParty;
for (AL0447_i_CreatureIndex = L0460_ui_CreatureCount; AL0447_i_CreatureIndex >= 0; AL0447_i_CreatureIndex--) {
- if ((M50_getCreatureValue(L0445_ps_ActiveGroup->_directions, AL0447_i_CreatureIndex) != AL0446_i_Direction) &&
+ if ((getCreatureValue(L0445_ps_ActiveGroup->_directions, AL0447_i_CreatureIndex) != AL0446_i_Direction) &&
((!AL0447_i_CreatureIndex) || (!_vm->getRandomNumber(2)))) {
- f205_setDirection(L0445_ps_ActiveGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, L0460_ui_CreatureCount && (L0459_i_CreatureSize == k1_MaskCreatureSizeHalf));
+ setGroupDirection(L0445_ps_ActiveGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, L0460_ui_CreatureCount && (L0459_i_CreatureSize == k1_MaskCreatureSizeHalf));
M32_setTime(L0465_s_NextEvent._mapTime, _vm->_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
} else {
M32_setTime(L0465_s_NextEvent._mapTime, _vm->_gameTime + 1);
@@ -796,7 +796,7 @@ T0209044_SetBehavior6_Attack:
L0465_s_NextEvent._mapTime += MIN((uint16)((L0448_s_CreatureInfo._attackTicks >> 1) + _vm->getRandomNumber(4)), ticks);
}
L0465_s_NextEvent._type = k38_TMEventTypeUpdateBehaviour_0 + AL0447_i_CreatureIndex;
- f208_groupAddEvent(&L0465_s_NextEvent, f179_getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, false));
+ addGroupEvent(&L0465_s_NextEvent, getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, false));
}
goto T0209139_Return;
}
@@ -810,7 +810,7 @@ T0209054_SetBehavior7_Approach:
}
} else {
if (AL0447_i_Behavior == k0_behavior_WANDER) {
- L0454_i_PrimaryDirectionToOrFromParty = f201_getSmelledPartyPrimaryDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY);
+ L0454_i_PrimaryDirectionToOrFromParty = getSmelledPartyPrimaryDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY);
if (L0454_i_PrimaryDirectionToOrFromParty) {
L0454_i_PrimaryDirectionToOrFromParty--;
L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls = false;
@@ -829,7 +829,7 @@ T0209058_MoveInRandomDirection:
if (((L0445_ps_ActiveGroup->_priorMapX != AL0450_i_DestinationMapX) ||
(L0445_ps_ActiveGroup->_priorMapY != AL0451_i_DestinationMapY) ||
(L0457_B_MoveToPriorLocation = !_vm->getRandomNumber(4))) /* 1/4 chance of moving back to the square that the creature comes from */
- && f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction, false)) {
+ && isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction, false)) {
T0209061_MoveGroup:
AL0447_i_Ticks = (L0461_i_MovementTicks >> 1) - L0462_i_TicksSinceLastMove;
L0453_B_NewGroupDirectionFound = (AL0447_i_Ticks <= 0);
@@ -847,10 +847,10 @@ T0209061_MoveGroup:
}
break;
}
- if (_g390_groupMovementBlockedByParty) {
+ if (_groupMovementBlockedByParty) {
if ((eventType != kM3_TMEventTypeCreateReactionEvent29DangerOnSquare) &&
((L0444_ps_Group->getBehaviour() != k5_behavior_FLEE) ||
- !f203_getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false) ||
+ !getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false) ||
_vm->getRandomNumber(2)))
goto T0209044_SetBehavior6_Attack;
L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
@@ -870,7 +870,7 @@ T0209073_SetDirectionGroup:
if (!L0453_B_NewGroupDirectionFound && (L0462_i_TicksSinceLastMove >= 0)) { /* If direction is not found yet then look around in a random direction */
AL0446_i_Direction = _vm->getRandomNumber(4);
}
- f206_groupSetDirGroup(L0445_ps_ActiveGroup, AL0446_i_Direction, L0460_ui_CreatureCount, L0459_i_CreatureSize);
+ setDirGroup(L0445_ps_ActiveGroup, AL0446_i_Direction, L0460_ui_CreatureCount, L0459_i_CreatureSize);
}
/* If event is kM3_TMEventTypeCreateReactionEvent29DangerOnSquare or kM2_TMEventTypeCreateReactionEvent30HitByProjectile */
if (eventType < kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent) {
@@ -879,13 +879,13 @@ T0209073_SetDirectionGroup:
if (L0458_B_SetBehavior7_ApproachAfterReaction)
L0444_ps_Group->setBehaviour(k7_behavior_APPROACH);
- f182_stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
+ stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
}
}
}
} else {
if (AL0447_i_Behavior == k7_behavior_APPROACH) {
- L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ L0452_i_DistanceToVisibleParty = groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
if (L0452_i_DistanceToVisibleParty) {
if ((L0452_i_DistanceToVisibleParty <= L0448_s_CreatureInfo.getAttackRange()) && ((!AL0450_i_DistanceXToParty) || (!AL0451_i_DistanceYToParty))) /* If the creature is in range for attack and on the same row or column as the party on the map */
goto T0209044_SetBehavior6_Attack;
@@ -907,12 +907,12 @@ T0209082_WalkTowardTarget:
}
L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls = true;
T0209084_SingleSquareMoveTowardParty:
- L0454_i_PrimaryDirectionToOrFromParty = f228_getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY);
+ L0454_i_PrimaryDirectionToOrFromParty = getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY);
T0209085_SingleSquareMove:
- if (f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls) ||
- f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls && _vm->getRandomNumber(2)) ||
- f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction), false) ||
- (!_vm->getRandomNumber(4) && f202_isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty), false))) {
+ if (isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls) ||
+ isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty, L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls && _vm->getRandomNumber(2)) ||
+ isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction), false) ||
+ (!_vm->getRandomNumber(4) && isMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty), false))) {
AL0450_i_DestinationMapX = eventMapX;
AL0451_i_DestinationMapY = eventMapY;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction], AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction];
@@ -920,11 +920,11 @@ T0209085_SingleSquareMove:
}
if (L0463_B_Archenemy) {
T0209089_DoubleSquareMove:
- f203_getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false); /* BUG0_00 Useless code. Returned value is ignored. When Lord Chaos teleports two squares away the ability to move to the first square is ignored which means Lord Chaos can teleport through walls or any other obstacle */
- if (f204_isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty) ||
- f204_isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty) ||
- (_g386_fluxCageCount && f204_isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction))) ||
- ((_g386_fluxCageCount >= 2) && f204_isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty)))) {
+ getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false); /* BUG0_00 Useless code. Returned value is ignored. When Lord Chaos teleports two squares away the ability to move to the first square is ignored which means Lord Chaos can teleport through walls or any other obstacle */
+ if (isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = L0454_i_PrimaryDirectionToOrFromParty) ||
+ isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->_projexpl->_g363_secondaryDirToOrFromParty) ||
+ (_fluxCageCount && isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)AL0446_i_Direction))) ||
+ ((_fluxCageCount >= 2) && isArchenemyDoubleMovementPossible(&L0448_s_CreatureInfo, eventMapX, eventMapY, AL0446_i_Direction = returnOppositeDir((Direction)L0454_i_PrimaryDirectionToOrFromParty)))) {
AL0450_i_DestinationMapX = eventMapX;
AL0451_i_DestinationMapY = eventMapY;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2, AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2;
@@ -932,13 +932,13 @@ T0209089_DoubleSquareMove:
goto T0209061_MoveGroup;
}
}
- f206_groupSetDirGroup(L0445_ps_ActiveGroup, L0454_i_PrimaryDirectionToOrFromParty, L0460_ui_CreatureCount, L0459_i_CreatureSize);
+ setDirGroup(L0445_ps_ActiveGroup, L0454_i_PrimaryDirectionToOrFromParty, L0460_ui_CreatureCount, L0459_i_CreatureSize);
} else {
if (AL0447_i_Behavior == k5_behavior_FLEE) {
T0209094_FleeFromTarget:
L0456_B_AllowMovementOverImaginaryPitsAndFakeWalls = true;
/* If the creature can see the party then update target coordinates */
- L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ L0452_i_DistanceToVisibleParty = groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY);
if (L0452_i_DistanceToVisibleParty) {
AL0450_i_TargetMapX = (L0445_ps_ActiveGroup->_targetMapX = _vm->_dungeonMan->_partyMapX);
AL0451_i_TargetMapY = (L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_partyMapY);
@@ -951,7 +951,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 (!getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false)) {
if (getDistance(eventMapX, eventMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY) <= 1)
goto T0209096_SetBehavior0_Wander;
}
@@ -964,7 +964,7 @@ T0209096_SetBehavior0_Wander:
AL0451_i_TargetMapY = L0445_ps_ActiveGroup->_targetMapY;
}
/* Try and flee from the party (opposite direction) */
- L0454_i_PrimaryDirectionToOrFromParty = returnOppositeDir((Direction)f228_getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY));
+ L0454_i_PrimaryDirectionToOrFromParty = returnOppositeDir((Direction)getDirsWhereDestIsVisibleFromSource(eventMapX, eventMapY, AL0450_i_TargetMapX, AL0451_i_TargetMapY));
_vm->_projexpl->_g363_secondaryDirToOrFromParty = returnOppositeDir((Direction)_vm->_projexpl->_g363_secondaryDirToOrFromParty);
L0461_i_MovementTicks -= (L0461_i_MovementTicks >> 2);
goto T0209085_SingleSquareMove;
@@ -974,13 +974,13 @@ T0209096_SetBehavior0_Wander:
} else { /* Process events 38 to 41, Update Creature Behavior */
if (AL0447_i_Behavior == k5_behavior_FLEE) {
if (L0460_ui_CreatureCount) {
- f182_stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
+ stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
}
goto T0209094_FleeFromTarget;
}
/* If the creature is attacking, then compute the next aspect update time and the next attack time */
if (getFlag(L0445_ps_ActiveGroup->_aspect[AL0447_i_CreatureIndex = eventType - k38_TMEventTypeUpdateBehaviour_0], k0x0080_MaskActiveGroupIsAttacking)) {
- L0464_l_NextAspectUpdateTime = f179_getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, false);
+ L0464_l_NextAspectUpdateTime = getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, false);
L0465_s_NextEvent._mapTime += ((AL0447_i_Ticks = L0448_s_CreatureInfo._attackTicks) + _vm->getRandomNumber(4) - 1);
if (AL0447_i_Ticks > 15)
L0465_s_NextEvent._mapTime += _vm->getRandomNumber(8) - 2;
@@ -988,8 +988,8 @@ T0209096_SetBehavior0_Wander:
if (AL0447_i_CreatureIndex > L0460_ui_CreatureCount) /* Ignore event if it is for a creature that is not in the group */
goto T0209139_Return;
- L0454_i_PrimaryDirectionToOrFromParty = _g382_currGroupPrimaryDirToParty;
- L0452_i_DistanceToVisibleParty = f200_groupGetDistanceToVisibleParty(L0444_ps_Group, AL0447_i_CreatureIndex, eventMapX, eventMapY);
+ L0454_i_PrimaryDirectionToOrFromParty = _currGroupPrimaryDirToParty;
+ L0452_i_DistanceToVisibleParty = 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->_partyMapX;
@@ -1015,7 +1015,7 @@ T0209096_SetBehavior0_Wander:
/* If the creature can see the party and is looking in the party direction or can attack in all direction */
if (L0452_i_DistanceToVisibleParty &&
(getFlag(L0448_s_CreatureInfo._attributes, k0x0004_MaskCreatureInfo_sideAttack) ||
- M50_getCreatureValue(L0445_ps_ActiveGroup->_directions, AL0447_i_CreatureIndex) == L0454_i_PrimaryDirectionToOrFromParty)) {
+ getCreatureValue(L0445_ps_ActiveGroup->_directions, AL0447_i_CreatureIndex) == L0454_i_PrimaryDirectionToOrFromParty)) {
/* If the creature is in range to attack the party and random test succeeds */
if ((L0452_i_DistanceToVisibleParty <= (AL0446_i_Range = L0448_s_CreatureInfo.getAttackRange())) &&
(!AL0450_i_DistanceXToParty || !AL0451_i_DistanceYToParty) &&
@@ -1024,7 +1024,7 @@ T0209096_SetBehavior0_Wander:
(!getFlag(AL0446_i_CreatureAttributes = L0448_s_CreatureInfo._attributes, k0x0008_MaskCreatureInfo_preferBackRow) || !_vm->getRandomNumber(4) || !getFlag(AL0446_i_CreatureAttributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) &&
(L0459_i_CreatureSize == k0_MaskCreatureSizeQuarter) &&
(L0445_ps_ActiveGroup->_cells != k255_CreatureTypeSingleCenteredCreature) &&
- ((AL0446_i_Cell = M50_getCreatureValue(L0445_ps_ActiveGroup->_cells, AL0447_i_CreatureIndex)) != L0454_i_PrimaryDirectionToOrFromParty) &&
+ ((AL0446_i_Cell = getCreatureValue(L0445_ps_ActiveGroup->_cells, AL0447_i_CreatureIndex)) != L0454_i_PrimaryDirectionToOrFromParty) &&
(AL0446_i_Cell != returnNextVal(L0454_i_PrimaryDirectionToOrFromParty))) { /* If the creature cannot cast spells (range = 1) and is not on a cell where it can attack the party directly and is a quarter square sized creature not in the center of the square then the creature moves to another cell and attack does not occur immediately */
if (!L0460_ui_CreatureCount && _vm->getRandomNumber(2)) {
L0445_ps_ActiveGroup->_cells = k255_CreatureTypeSingleCenteredCreature;
@@ -1034,12 +1034,12 @@ T0209096_SetBehavior0_Wander:
} else {
AL0446_i_Cell++;
}
- if (!f176_getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = normalizeModulo4(AL0446_i_Cell)) ||
- (_vm->getRandomNumber(2) && !f176_getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = returnOppositeDir((Direction)AL0446_i_Cell)))) { /* If the selected cell (or the opposite cell) is not already occupied by a creature */
+ if (!getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = normalizeModulo4(AL0446_i_Cell)) ||
+ (_vm->getRandomNumber(2) && !getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = returnOppositeDir((Direction)AL0446_i_Cell)))) { /* If the selected cell (or the opposite cell) is not already occupied by a creature */
if (_vm->_projexpl->f218_projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */
goto T0209139_Return;
if (_vm->_projexpl->_g364_creatureDamageOutcome != k1_outcomeKilledSomeCreaturesInGroup) {
- L0445_ps_ActiveGroup->_cells = f178_getGroupValueUpdatedWithCreatureValue(L0445_ps_ActiveGroup->_cells, AL0447_i_CreatureIndex, AL0446_i_Cell);
+ L0445_ps_ActiveGroup->_cells = getGroupValueUpdatedWithCreatureValue(L0445_ps_ActiveGroup->_cells, AL0447_i_CreatureIndex, AL0446_i_Cell);
}
}
}
@@ -1047,27 +1047,27 @@ T0209096_SetBehavior0_Wander:
L0465_s_NextEvent._type = eventType;
goto T0209135;
}
- L0464_l_NextAspectUpdateTime = f179_getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, f207_isCreatureAttacking(L0444_ps_Group, eventMapX, eventMapY, AL0447_i_CreatureIndex));
+ L0464_l_NextAspectUpdateTime = getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, AL0447_i_CreatureIndex, isCreatureAttacking(L0444_ps_Group, eventMapX, eventMapY, AL0447_i_CreatureIndex));
L0465_s_NextEvent._mapTime += (L0448_s_CreatureInfo._animationTicks & 0xF) + _vm->getRandomNumber(2);
} else {
L0444_ps_Group->setBehaviour(k7_behavior_APPROACH);
if (L0460_ui_CreatureCount) {
- f182_stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
+ stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
}
goto T0209081_RunTowardParty;
}
} else {
/* If the party is visible, update target coordinates */
- if (f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
+ if (groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
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));
+ setGroupDirection(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);
} else { /* If the party is not visible, move to the target (last known party location) */
L0444_ps_Group->setBehaviour(k7_behavior_APPROACH);
if (L0460_ui_CreatureCount) {
- f182_stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
+ stopAttacking(L0445_ps_ActiveGroup, eventMapX, eventMapY);
}
goto T0209082_WalkTowardTarget;
}
@@ -1082,7 +1082,7 @@ T0209134_SetEvent37:
}
T0209135:
if (!L0464_l_NextAspectUpdateTime) {
- L0464_l_NextAspectUpdateTime = f179_getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, kM1_wholeCreatureGroup, false);
+ L0464_l_NextAspectUpdateTime = getCreatureAspectUpdateTime(L0445_ps_ActiveGroup, kM1_wholeCreatureGroup, false);
}
T0209136:
if (L0455_B_CurrentEventTypeIsNotUpdateBehavior) {
@@ -1090,12 +1090,12 @@ T0209136:
} else {
L0464_l_NextAspectUpdateTime += ticks;
}
- f208_groupAddEvent(&L0465_s_NextEvent, L0464_l_NextAspectUpdateTime);
+ addGroupEvent(&L0465_s_NextEvent, L0464_l_NextAspectUpdateTime);
T0209139_Return:
;
}
-bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16 mapY, uint16 dir, bool allowMovementOverImaginaryPitsAndFakeWalls) {
+bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16 mapY, uint16 dir, bool allowMovementOverImaginaryPitsAndFakeWalls) {
int16 L0428_i_MapX;
int16 L0429_i_MapY;
uint16 L0430_ui_Square = 0;
@@ -1103,10 +1103,10 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i
Teleporter *L0432_ps_Teleporter;
Thing L0433_T_Thing;
- _g384_groupMovementTestedDirections[dir] = true;
- _g388_groupMovementBlockedByGroupThing = Thing::_endOfList;
- _g389_groupMovementBlockedByDoor = false;
- _g390_groupMovementBlockedByParty = false;
+ _groupMovementTestedDirections[dir] = true;
+ _groupMovementBlockedByGroupThing = Thing::_endOfList;
+ _groupMovementBlockedByDoor = false;
+ _groupMovementBlockedByParty = false;
if (creatureInfo->_movementTicks == k255_immobile) {
return false;
}
@@ -1115,7 +1115,7 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i
L0429_i_MapY = mapY;
L0430_ui_Square = _vm->_dungeonMan->_currMapData[L0428_i_MapX][L0429_i_MapY];
L0431_i_SquareType = Square(L0430_ui_Square).getType();
- _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter =
+ _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter =
!(((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) &&
@@ -1123,7 +1123,7 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i
((L0431_i_SquareType != k2_ElementTypePit) || (getFlag(L0430_ui_Square, k0x0001_PitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(L0430_ui_Square, k0x0008_PitOpen) || getFlag(creatureInfo->_attributes, k0x0020_MaskCreatureInfo_levitation)) &&
((L0431_i_SquareType != k6_ElementTypeFakeWall) || getFlag(L0430_ui_Square, k0x0004_FakeWallOpen) || (getFlag(L0430_ui_Square, k0x0001_FakeWallImaginary) && allowMovementOverImaginaryPitsAndFakeWalls)));
- if (_g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter)
+ if (_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter)
return false;
if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) {
@@ -1132,9 +1132,9 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i
if ((L0433_T_Thing).getType() == k15_ExplosionThingType) {
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++;
- _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = true;
+ _fluxCages[dir] = true;
+ _fluxCageCount++;
+ _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = true;
return false;
}
}
@@ -1143,32 +1143,32 @@ bool GroupMan::f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, i
}
if ((L0431_i_SquareType == k5_ElementTypeTeleporter) && getFlag(L0430_ui_Square, k0x0008_TeleporterOpen) && (creatureInfo->getWariness() >= 10)) {
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;
+ if (getFlag(L0432_ps_Teleporter->getScope(), k0x0001_TelepScopeCreatures) && !_vm->_dungeonMan->isCreatureAllowedOnMap(_currGroupThing, L0432_ps_Teleporter->getTargetMapIndex())) {
+ _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = true;
return false;
}
}
- _g390_groupMovementBlockedByParty = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0428_i_MapX == _vm->_dungeonMan->_partyMapX) && (L0429_i_MapY == _vm->_dungeonMan->_partyMapY);
- if (_g390_groupMovementBlockedByParty)
+ _groupMovementBlockedByParty = (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0428_i_MapX == _vm->_dungeonMan->_partyMapX) && (L0429_i_MapY == _vm->_dungeonMan->_partyMapY);
+ if (_groupMovementBlockedByParty)
return false;
if (L0431_i_SquareType == k4_DoorElemType) {
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;
+ _groupMovementBlockedByDoor = true;
return false;
}
}
- return (_g388_groupMovementBlockedByGroupThing = f175_groupGetThing(L0428_i_MapX, L0429_i_MapY)) == Thing::_endOfList;
+ return (_groupMovementBlockedByGroupThing = groupGetThing(L0428_i_MapX, L0429_i_MapY)) == Thing::_endOfList;
}
-int16 GroupMan::f226_getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
+int16 GroupMan::getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
return ((((srcMapX -= destMapX) < 0) ? -srcMapX : srcMapX) +
(((srcMapY -= destMapY) < 0) ? -srcMapY : srcMapY));
}
-int16 GroupMan::f200_groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY) {
+int16 GroupMan::groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY) {
int16 L0420_i_CreatureDirection;
int16 L0421_i_CreatureViewDirectionCount; /* Count of directions to test in L0425_ai_CreatureViewDirections */
int16 L0422_i_Multiple;
@@ -1185,7 +1185,7 @@ int16 GroupMan::f200_groupGetDistanceToVisibleParty(Group *group, int16 creature
}
if (getFlag(L0424_ps_CreatureInfo->_attributes, k0x0004_MaskCreatureInfo_sideAttack)) /* If creature can see in all directions */
goto T0200011;
- L0423_ui_GroupDirections = _g375_activeGroups[group->getActiveGroupIndex()]._directions;
+ L0423_ui_GroupDirections = _activeGroups[group->getActiveGroupIndex()]._directions;
if (creatureIndex < 0) { /* Negative index means test if each creature in the group can see the party in their respective direction */
L0421_i_CreatureViewDirectionCount = 0;
for (creatureIndex = group->getCount(); creatureIndex >= 0; creatureIndex--) {
@@ -1200,26 +1200,26 @@ T0200006:
;
}
} else { /* Positive index means test only if the specified creature in the group can see the party in its direction */
- L0425_ai_CreatureViewDirections[0] = M50_getCreatureValue(L0423_ui_GroupDirections, creatureIndex);
+ L0425_ai_CreatureViewDirections[0] = getCreatureValue(L0423_ui_GroupDirections, creatureIndex);
L0421_i_CreatureViewDirectionCount = 1;
}
while (L0421_i_CreatureViewDirectionCount--) {
- if (f227_isDestVisibleFromSource(L0425_ai_CreatureViewDirections[L0421_i_CreatureViewDirectionCount], mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) {
+ if (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)) {
AL0422_i_SightRange -= _vm->_displayMan->_dungeonViewPaletteIndex >> 1;
}
- if (_g381_currGroupDistanceToParty > MAX((int16)1, AL0422_i_SightRange)) {
+ if (_currGroupDistanceToParty > MAX((int16)1, AL0422_i_SightRange)) {
return 0;
}
- return f199_getDistanceBetweenUnblockedSquares(mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::f197_isViewPartyBlocked);
+ return getDistanceBetweenUnblockedSquares(mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::isViewPartyBlocked);
}
}
return 0;
}
-int16 GroupMan::f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 srcMapY,
+int16 GroupMan::getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 srcMapY,
int16 destMapX, int16 destMapY, bool (GroupMan::*isBlocked)(uint16, uint16)) {
int16 L0410_i_XAxisStep;
int16 L0411_i_YAxisStep;
@@ -1263,10 +1263,10 @@ int16 GroupMan::f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 src
}
}
} while (getDistance(AL0412_i_PathMapX, AL0413_i_PathMapY, srcMapX, srcMapY) > 1);
- return f226_getDistanceBetweenSquares(srcMapX, srcMapY, destMapX, destMapY);
+ return getDistanceBetweenSquares(srcMapX, srcMapY, destMapX, destMapY);
}
-bool GroupMan::f197_isViewPartyBlocked(uint16 mapX, uint16 mapY) {
+bool GroupMan::isViewPartyBlocked(uint16 mapX, uint16 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) {
@@ -1277,7 +1277,7 @@ bool GroupMan::f197_isViewPartyBlocked(uint16 mapX, uint16 mapY) {
return (L0405_i_SquareType == k0_ElementTypeWall) || ((L0405_i_SquareType == k6_ElementTypeFakeWall) && !getFlag(L0404_ui_Square, k0x0004_FakeWallOpen));
}
-int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 creatureIndex, bool isAttacking) {
+int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 creatureIndex, bool isAttacking) {
uint16 L0326_ui_Multiple;
#define AL0326_ui_Aspect L0326_ui_Multiple
#define AL0326_ui_AnimationTicks L0326_ui_Multiple
@@ -1319,7 +1319,7 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16
if (getFlag(AL0326_ui_Aspect, k0x0080_MaskActiveGroupIsAttacking) && (L0331_ui_CreatureType == k18_CreatureTypeAnimatedArmourDethKnight)) {
if (_vm->getRandomNumber(2)) {
toggleFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
- _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _g378_currentGroupMapX, _g379_currentGroupMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
}
} else if (!getFlag(AL0326_ui_Aspect, k0x0080_MaskActiveGroupIsAttacking) || !getFlag(L0327_ui_CreatureGraphicInfo, k0x0400_CreatureInfoGraphicMaskFlipDuringAttack)) {
if (_vm->getRandomNumber(2))
@@ -1338,7 +1338,7 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16
toggleFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
L1635_ui_SoundIndex = _vm->_moveSens->f514_getSound(k13_CreatureTypeCouatl);
if (L1635_ui_SoundIndex <= k34_D13_soundCount)
- _vm->_sound->f064_SOUND_RequestPlay_CPSD(L1635_ui_SoundIndex, _g378_currentGroupMapX, _g379_currentGroupMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->f064_SOUND_RequestPlay_CPSD(L1635_ui_SoundIndex, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
}
} else if (_vm->getRandomNumber(2))
setFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
@@ -1355,29 +1355,29 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16
return _vm->_gameTime + (isAttacking ? ((AL0326_ui_AnimationTicks >> 8) & 0xF) : ((AL0326_ui_AnimationTicks >> 4) & 0xF)) + _vm->getRandomNumber(2);
}
-void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures) {
+void GroupMan::setGroupDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures) {
uint16 L0435_ui_GroupDirections;
static ActiveGroup *G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup;
- if (twoHalfSquareSizedCreatures && (_vm->_gameTime == _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
+ if (twoHalfSquareSizedCreatures && (_vm->_gameTime == twoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
return;
}
L0435_ui_GroupDirections = activeGroup->_directions;
- if (normalizeModulo4(M50_getCreatureValue(L0435_ui_GroupDirections, creatureIndex) - dir) == 2) { /* If current and new direction are opposites then change direction only one step at a time */
+ if (normalizeModulo4(getCreatureValue(L0435_ui_GroupDirections, creatureIndex) - dir) == 2) { /* If current and new direction are opposites then change direction only one step at a time */
dir = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + dir);
- L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex, dir);
+ L0435_ui_GroupDirections = getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex, dir);
} else {
- L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex, dir);
+ L0435_ui_GroupDirections = getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex, dir);
}
if (twoHalfSquareSizedCreatures) {
- L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex ^ 1, dir); /* Set direction of the second half square sized creature */
- _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_gameTime;
+ L0435_ui_GroupDirections = getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex ^ 1, dir); /* Set direction of the second half square sized creature */
+ twoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_gameTime;
G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup = activeGroup;
}
activeGroup->_directions = (Direction)L0435_ui_GroupDirections;
}
-void GroupMan::f208_groupAddEvent(TimelineEvent *event, uint32 time) {
+void GroupMan::addGroupEvent(TimelineEvent *event, uint32 time) {
warning(false, "potentially dangerous cast to uint32 below");
if (time < (uint32)filterTime(event->_mapTime)) {
event->_type -= 5;
@@ -1389,7 +1389,7 @@ void GroupMan::f208_groupAddEvent(TimelineEvent *event, uint32 time) {
_vm->_timeline->f238_addEventGetEventIndex(event);
}
-int16 GroupMan::f201_getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int16 mapY, int16 mapX) {
+int16 GroupMan::getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int16 mapY, int16 mapX) {
uint16 L0426_ui_SmellRange;
int16 L0427_i_ScentOrdinal;
@@ -1398,36 +1398,36 @@ 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->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::f198_isSmellPartyBlocked)) {
- _vm->_projexpl->_g363_secondaryDirToOrFromParty = _g383_currGroupSecondaryDirToParty;
- return _vm->indexToOrdinal(_g382_currGroupPrimaryDirToParty);
+ if ((((L0426_ui_SmellRange + 1) >> 1) >= _currGroupDistanceToParty) && getDistanceBetweenUnblockedSquares(mapY, mapX, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, &GroupMan::isSmellPartyBlocked)) {
+ _vm->_projexpl->_g363_secondaryDirToOrFromParty = _currGroupSecondaryDirToParty;
+ return _vm->indexToOrdinal(_currGroupPrimaryDirToParty);
}
if ((L0427_i_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapY, mapX)) && ((_vm->_championMan->_party._scentStrengths[_vm->ordinalToIndex(L0427_i_ScentOrdinal)] + _vm->getRandomNumber(4)) > (30 - (L0426_ui_SmellRange << 1)))) { /* If there is a fresh enough party scent on the group square */
- return _vm->indexToOrdinal(f228_getDirsWhereDestIsVisibleFromSource(mapY, mapX, _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapX(), _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapY()));
+ return _vm->indexToOrdinal(getDirsWhereDestIsVisibleFromSource(mapY, mapX, _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapX(), _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapY()));
}
return 0;
}
-bool GroupMan::f198_isSmellPartyBlocked(uint16 mapX, uint16 mapY) {
+bool GroupMan::isSmellPartyBlocked(uint16 mapX, uint16 mapY) {
uint16 L0408_ui_Square;
int16 L0409_i_SquareType;
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) {
+int16 GroupMan::getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 mapX, int16 mapY, bool allowMovementOverImaginaryPitsAndFakeWalls) {
int16 L0434_i_Direction;
for (L0434_i_Direction = kDirNorth; L0434_i_Direction <= kDirWest; L0434_i_Direction++) {
- if ((!_g384_groupMovementTestedDirections[L0434_i_Direction]) && f202_isMovementPossible(info, mapX, mapY, L0434_i_Direction, allowMovementOverImaginaryPitsAndFakeWalls)) {
+ if ((!_groupMovementTestedDirections[L0434_i_Direction]) && isMovementPossible(info, mapX, mapY, L0434_i_Direction, allowMovementOverImaginaryPitsAndFakeWalls)) {
return _vm->indexToOrdinal(L0434_i_Direction);
}
}
return 0;
}
-void GroupMan::f206_groupSetDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, int16 creatureSize) {
+void GroupMan::setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, int16 creatureSize) {
bool L0436_B_TwoHalfSquareSizedCreatures = creatureIndex && (creatureSize == k1_MaskCreatureSizeHalf);
if (L0436_B_TwoHalfSquareSizedCreatures)
@@ -1435,27 +1435,27 @@ void GroupMan::f206_groupSetDirGroup(ActiveGroup *activeGroup, int16 dir, int16
do {
if (!creatureIndex || _vm->getRandomNumber(2))
- f205_setDirection(activeGroup, dir, creatureIndex, L0436_B_TwoHalfSquareSizedCreatures);
+ setGroupDirection(activeGroup, dir, creatureIndex, L0436_B_TwoHalfSquareSizedCreatures);
} while (creatureIndex--);
}
-void GroupMan::f182_stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY) {
+void GroupMan::stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY) {
int16 L0337_i_CreatureIndex;
for (L0337_i_CreatureIndex = 0; L0337_i_CreatureIndex < 4; clearFlag(group->_aspect[L0337_i_CreatureIndex++], k0x0080_MaskActiveGroupIsAttacking));
- f181_groupDeleteEvents(mapX, mapY);
+ groupDeleteEvents(mapX, mapY);
}
-bool GroupMan::f204_isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, int16 mapY, uint16 dir) {
- if (_g385_fluxCages[dir]) {
+bool GroupMan::isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, int16 mapY, uint16 dir) {
+ if (_fluxCages[dir]) {
return false;
}
mapX += _vm->_dirIntoStepCountEast[dir], mapY += _vm->_dirIntoStepCountNorth[dir];
- return f202_isMovementPossible(info, mapX, mapY, dir, false);
+ return isMovementPossible(info, mapX, mapY, dir, false);
}
-bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 creatureIndex) {
+bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 creatureIndex) {
static const uint8 G0244_auc_Graphic559_CreatureAttackSounds[11] = { 3, 7, 14, 15, 19, 21, 29, 30, 31, 4, 16 }; /* Atari ST: { 3, 7, 14, 15, 19, 21, 4, 16 } */
uint16 L0437_ui_Multiple;
@@ -1472,17 +1472,17 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
#define AL0440_i_AttackSoundOrdinal L0440_i_Multiple
_vm->_projexpl->_g361_lastCreatureAttackTime = _vm->_gameTime;
- ActiveGroup L0443_s_ActiveGroup = _g375_activeGroups[group->getActiveGroupIndex()];
+ ActiveGroup L0443_s_ActiveGroup = _activeGroups[group->getActiveGroupIndex()];
CreatureInfo *L0441_ps_CreatureInfo = &g243_CreatureInfo[AL0437_ui_CreatureType = group->_type];
- uint16 L0438_ui_PrimaryDirectionToParty = _g382_currGroupPrimaryDirToParty;
+ uint16 L0438_ui_PrimaryDirectionToParty = _currGroupPrimaryDirToParty;
if ((AL0439_i_GroupCells = L0443_s_ActiveGroup._cells) == k255_CreatureTypeSingleCenteredCreature) {
AL0439_i_TargetCell = _vm->getRandomNumber(2);
} else {
- AL0439_i_TargetCell = ((M50_getCreatureValue(AL0439_i_GroupCells, creatureIndex) + 5 - L0438_ui_PrimaryDirectionToParty) & 0x0002) >> 1;
+ AL0439_i_TargetCell = ((getCreatureValue(AL0439_i_GroupCells, creatureIndex) + 5 - L0438_ui_PrimaryDirectionToParty) & 0x0002) >> 1;
}
AL0439_i_TargetCell += L0438_ui_PrimaryDirectionToParty;
AL0439_i_TargetCell &= 0x0003;
- if ((L0441_ps_CreatureInfo->getAttackRange() > 1) && ((_g381_currGroupDistanceToParty > 1) || _vm->getRandomNumber(2))) {
+ if ((L0441_ps_CreatureInfo->getAttackRange() > 1) && ((_currGroupDistanceToParty > 1) || _vm->getRandomNumber(2))) {
switch (AL0437_ui_CreatureType) {
case k14_CreatureTypeVexirk:
case k23_CreatureTypeLordChaos:
@@ -1527,7 +1527,7 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately);
- _vm->_projexpl->f212_projectileCreate(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_g382_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8);
+ _vm->_projexpl->f212_projectileCreate(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8);
} else {
if (getFlag(L0441_ps_CreatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) {
AL0439_i_ChampionIndex = _vm->getRandomNumber(4);
@@ -1543,9 +1543,9 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
}
}
if (AL0437_ui_CreatureType == k2_CreatureTypeGiggler) {
- f193_stealFromChampion(group, AL0439_i_ChampionIndex);
+ stealFromChampion(group, AL0439_i_ChampionIndex);
} else {
- AL0440_i_Damage = f230_getChampionDamage(group, AL0439_i_ChampionIndex) + 1;
+ AL0440_i_Damage = getChampionDamage(group, AL0439_i_ChampionIndex) + 1;
Champion *L0442_ps_Champion = &_vm->_championMan->_champions[AL0439_i_ChampionIndex];
if (AL0440_i_Damage > L0442_ps_Champion->_maximumDamageReceived) {
L0442_ps_Champion->_maximumDamageReceived = AL0440_i_Damage;
@@ -1560,7 +1560,7 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
return true;
}
-void GroupMan::f229_setOrderedCellsToAttack(signed char *orderedCellsToAttack, int16 targetMapX, int16 targetMapY, int16 attackerMapX, int16 attackerMapY, uint16 cellSource) {
+void GroupMan::setOrderedCellsToAttack(signed char *orderedCellsToAttack, int16 targetMapX, int16 targetMapY, int16 attackerMapX, int16 attackerMapY, uint16 cellSource) {
static signed char g23_orderedCellsToAttack[8][4] = { // @ G0023_aac_Graphic562_OrderedCellsToAttack
{0, 1, 3, 2}, /* Attack South from position Northwest or Southwest */
{1, 0, 2, 3}, /* Attack South from position Northeast or Southeast */
@@ -1573,7 +1573,7 @@ void GroupMan::f229_setOrderedCellsToAttack(signed char *orderedCellsToAttack, i
uint16 L0557_ui_OrderedCellsToAttackIndex;
- if (!((L0557_ui_OrderedCellsToAttackIndex = f228_getDirsWhereDestIsVisibleFromSource(targetMapX, targetMapY, attackerMapX, attackerMapY) << 1) & 0x0002)) {
+ if (!((L0557_ui_OrderedCellsToAttackIndex = getDirsWhereDestIsVisibleFromSource(targetMapX, targetMapY, attackerMapX, attackerMapY) << 1) & 0x0002)) {
cellSource++;
}
L0557_ui_OrderedCellsToAttackIndex += (cellSource >> 1) & 0x0001;
@@ -1581,7 +1581,7 @@ void GroupMan::f229_setOrderedCellsToAttack(signed char *orderedCellsToAttack, i
orderedCellsToAttack[i] = g23_orderedCellsToAttack[L0557_ui_OrderedCellsToAttackIndex][i];
}
-void GroupMan::f193_stealFromChampion(Group *group, uint16 championIndex) {
+void GroupMan::stealFromChampion(Group *group, uint16 championIndex) {
int16 L0391_i_Percentage;
uint16 L0392_ui_StealFromSlotIndex;
uint16 L0393_ui_Counter;
@@ -1615,12 +1615,12 @@ void GroupMan::f193_stealFromChampion(Group *group, uint16 championIndex) {
L0391_i_Percentage -= 20;
}
if (!_vm->getRandomNumber(8) || (L0396_B_ObjectStolen && _vm->getRandomNumber(2))) {
- _g375_activeGroups[group->getActiveGroupIndex()]._delayFleeingFromTarget = _vm->getRandomNumber(64) + 20;
+ _activeGroups[group->getActiveGroupIndex()]._delayFleeingFromTarget = _vm->getRandomNumber(64) + 20;
group->setBehaviour(k5_behavior_FLEE);
}
}
-int16 GroupMan::f230_getChampionDamage(Group *group, uint16 champIndex) {
+int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
unsigned char g24_woundProbabilityIndexToWoundMask[4] = {32, 16, 8, 4}; // @ G0024_auc_Graphic562_WoundProbabilityIndexToWoundMask
Champion *L0562_ps_Champion;
@@ -1694,26 +1694,26 @@ T0230014:
return 0;
}
-void GroupMan::f187_dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16 mapY) {
+void GroupMan::dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16 mapY) {
Group *L0363_ps_Group;
int16 L0364_i_CreatureType;
- if (_g391_dropMovingCreatureFixedPossCellCount) {
+ if (_dropMovingCreatureFixedPossCellCount) {
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);
+ while (_dropMovingCreatureFixedPossCellCount) {
+ dropCreatureFixedPossessions(L0364_i_CreatureType, mapX, mapY, _dropMovingCreatureFixedPossessionsCell[--_dropMovingCreatureFixedPossCellCount], k2_soundModePlayOneTickLater);
}
}
}
-void GroupMan::f180_startWanedring(int16 mapX, int16 mapY) {
+void GroupMan::startWanedring(int16 mapX, int16 mapY) {
Group *L0332_ps_Group;
TimelineEvent L0333_s_Event;
- L0332_ps_Group = (Group *)_vm->_dungeonMan->getThingData(f175_groupGetThing(mapX, mapY));
+ L0332_ps_Group = (Group *)_vm->_dungeonMan->getThingData(groupGetThing(mapX, mapY));
if (L0332_ps_Group->getBehaviour() >= k4_behavior_USELESS) {
L0332_ps_Group->setBehaviour(k0_behavior_WANDER);
}
@@ -1726,22 +1726,22 @@ void GroupMan::f180_startWanedring(int16 mapX, int16 mapY) {
_vm->_timeline->f238_addEventGetEventIndex(&L0333_s_Event);
}
-void GroupMan::f183_addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
+void GroupMan::addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
uint16 L0339_ui_CreatureIndex;
Group *L0340_ps_Group;
ActiveGroup *L0341_ps_ActiveGroup;
int16 L0344_i_ActiveGroupIndex;
- L0341_ps_ActiveGroup = _g375_activeGroups;
+ L0341_ps_ActiveGroup = _activeGroups;
L0344_i_ActiveGroupIndex = 0;
while (L0341_ps_ActiveGroup->_groupThingIndex >= 0) {
- if (++L0344_i_ActiveGroupIndex >= _g376_maxActiveGroupCount) {
+ if (++L0344_i_ActiveGroupIndex >= _maxActiveGroupCount) {
return;
}
L0341_ps_ActiveGroup++;
}
- _g377_currActiveGroupCount++;
+ _currActiveGroupCount++;
L0340_ps_Group = (Group *)(_vm->_dungeonMan->_thingData[k4_GroupThingType] +
g235_ThingDataWordCount[k4_GroupThingType] * (L0341_ps_ActiveGroup->_groupThingIndex = (thing).getIndex()));
@@ -1753,23 +1753,23 @@ void GroupMan::f183_addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
L0341_ps_ActiveGroup->_lastMoveTime = _vm->_gameTime - 127;
L0339_ui_CreatureIndex = L0340_ps_Group->getCount();
do {
- L0341_ps_ActiveGroup->_directions = (Direction)f178_getGroupValueUpdatedWithCreatureValue(L0341_ps_ActiveGroup->_directions, L0339_ui_CreatureIndex, L0340_ps_Group->getDir());
+ L0341_ps_ActiveGroup->_directions = (Direction)getGroupValueUpdatedWithCreatureValue(L0341_ps_ActiveGroup->_directions, L0339_ui_CreatureIndex, L0340_ps_Group->getDir());
L0341_ps_ActiveGroup->_aspect[L0339_ui_CreatureIndex] = 0;
} while (L0339_ui_CreatureIndex--);
- f179_getCreatureAspectUpdateTime(L0341_ps_ActiveGroup, kM1_wholeCreatureGroup, false);
+ getCreatureAspectUpdateTime(L0341_ps_ActiveGroup, kM1_wholeCreatureGroup, false);
}
-void GroupMan::f184_removeActiveGroup(uint16 activeGroupIndex) {
+void GroupMan::removeActiveGroup(uint16 activeGroupIndex) {
ActiveGroup *L0347_ps_ActiveGroup;
Group *L0348_ps_Group;
- if ((activeGroupIndex > _g376_maxActiveGroupCount) || (_g375_activeGroups[activeGroupIndex]._groupThingIndex < 0)) {
+ if ((activeGroupIndex > _maxActiveGroupCount) || (_activeGroups[activeGroupIndex]._groupThingIndex < 0)) {
return;
}
- L0347_ps_ActiveGroup = &_g375_activeGroups[activeGroupIndex];
+ L0347_ps_ActiveGroup = &_activeGroups[activeGroupIndex];
L0348_ps_Group = &((Group *)_vm->_dungeonMan->_thingData[k4_GroupThingType])[L0347_ps_ActiveGroup->_groupThingIndex];
- _g377_currActiveGroupCount--;
+ _currActiveGroupCount--;
L0348_ps_Group->_cells = L0347_ps_ActiveGroup->_cells;
L0348_ps_Group->setDir(normalizeModulo4(L0347_ps_ActiveGroup->_directions));
if (L0348_ps_Group->getBehaviour() >= k4_behavior_USELESS) {
@@ -1778,15 +1778,15 @@ void GroupMan::f184_removeActiveGroup(uint16 activeGroupIndex) {
L0347_ps_ActiveGroup->_groupThingIndex = -1;
}
-void GroupMan::f194_removeAllActiveGroups() {
- for (int16 L0397_ui_ActiveGroupIndex = 0; _g377_currActiveGroupCount > 0; L0397_ui_ActiveGroupIndex++) {
- if (_g375_activeGroups[L0397_ui_ActiveGroupIndex]._groupThingIndex >= 0) {
- f184_removeActiveGroup(L0397_ui_ActiveGroupIndex);
+void GroupMan::removeAllActiveGroups() {
+ for (int16 L0397_ui_ActiveGroupIndex = 0; _currActiveGroupCount > 0; L0397_ui_ActiveGroupIndex++) {
+ if (_activeGroups[L0397_ui_ActiveGroupIndex]._groupThingIndex >= 0) {
+ removeActiveGroup(L0397_ui_ActiveGroupIndex);
}
}
}
-void GroupMan::f195_addAllActiveGroups() {
+void GroupMan::addAllActiveGroups() {
uint16 L0398_ui_MapX;
uint16 L0399_ui_MapY;
Thing L0400_T_Thing;
@@ -1802,9 +1802,9 @@ void GroupMan::f195_addAllActiveGroups() {
L0400_T_Thing = *L0402_pT_SquareFirstThing++;
do {
if (L0400_T_Thing.getType() == k4_GroupThingType) {
- f181_groupDeleteEvents(L0398_ui_MapX, L0399_ui_MapY);
- f183_addActiveGroup(L0400_T_Thing, L0398_ui_MapX, L0399_ui_MapY);
- f180_startWanedring(L0398_ui_MapX, L0399_ui_MapY);
+ groupDeleteEvents(L0398_ui_MapX, L0399_ui_MapY);
+ addActiveGroup(L0400_T_Thing, L0398_ui_MapX, L0399_ui_MapY);
+ startWanedring(L0398_ui_MapX, L0399_ui_MapY);
break;
}
} while ((L0400_T_Thing = _vm->_dungeonMan->getNextThing(L0400_T_Thing)) != Thing::_endOfList);
@@ -1813,7 +1813,7 @@ void GroupMan::f195_addAllActiveGroups() {
}
}
-Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY) {
+Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY) {
Thing L0349_T_GroupThing;
uint16 L0350_ui_BaseHealth;
uint16 L0351_ui_Cell = 0;
@@ -1823,7 +1823,7 @@ Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplie
bool L0355_B_SeveralCreaturesInGroup;
- if (((_g377_currActiveGroupCount >= (_g376_maxActiveGroupCount - 5)) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) || ((L0349_T_GroupThing = _vm->_dungeonMan->getUnusedThing(k4_GroupThingType)) == Thing::_none)) {
+ if (((_currActiveGroupCount >= (_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->getThingData(L0349_T_GroupThing);
@@ -1842,7 +1842,7 @@ Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplie
do {
L0353_ps_Group->_health[creatureCount] = (L0350_ui_BaseHealth * healthMultiplier) + _vm->getRandomNumber((L0350_ui_BaseHealth >> 2) + 1);
if (L0355_B_SeveralCreaturesInGroup) {
- L0352_ui_GroupCells = f178_getGroupValueUpdatedWithCreatureValue(L0352_ui_GroupCells, creatureCount, L0351_ui_Cell++);
+ L0352_ui_GroupCells = getGroupValueUpdatedWithCreatureValue(L0352_ui_GroupCells, creatureCount, L0351_ui_Cell++);
if (getFlag(L0354_ps_CreatureInfo->_attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
L0351_ui_Cell++;
}
@@ -1857,29 +1857,29 @@ Thing GroupMan::f185_groupGetGenerated(int16 creatureType, int16 healthMultiplie
return L0349_T_GroupThing;
}
-bool GroupMan::f223_isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY) {
+bool GroupMan::isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY) {
int16 L0544_i_SquareType;
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));
}
-int16 GroupMan::f177_getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16 partyX, int16 partyY, uint16 champCell) {
+int16 GroupMan::getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16 partyX, int16 partyY, uint16 champCell) {
uint16 L0321_ui_Counter;
int16 L0322_i_CreatureOrdinal;
Thing L0323_T_GroupThing;
Group* L0324_ps_Group;
signed char L0325_auc_OrderedCellsToAttack[4];
- L0323_T_GroupThing = f175_groupGetThing(groupX, groupY);
+ L0323_T_GroupThing = groupGetThing(groupX, groupY);
if (L0323_T_GroupThing == Thing::_endOfList)
return 0;
L0324_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0323_T_GroupThing);
- f229_setOrderedCellsToAttack(L0325_auc_OrderedCellsToAttack, groupX, groupY, partyX, partyY, champCell);
+ setOrderedCellsToAttack(L0325_auc_OrderedCellsToAttack, groupX, groupY, partyX, partyY, champCell);
L0321_ui_Counter = 0;
for (;;) { /*_Infinite loop_*/
- L0322_i_CreatureOrdinal = f176_getCreatureOrdinalInCell(L0324_ps_Group, L0325_auc_OrderedCellsToAttack[L0321_ui_Counter]);
+ L0322_i_CreatureOrdinal = getCreatureOrdinalInCell(L0324_ps_Group, L0325_auc_OrderedCellsToAttack[L0321_ui_Counter]);
if (L0322_i_CreatureOrdinal)
return L0322_i_CreatureOrdinal;
@@ -1887,7 +1887,7 @@ int16 GroupMan::f177_getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, i
}
}
-int16 GroupMan::f231_getMeleeActionDamage(Champion* champ, int16 champIndex, Group* group, int16 creatureIndex, int16 mapX, int16 mapY, uint16 actionHitProbability, uint16 actionDamageFactor, int16 skillIndex) {
+int16 GroupMan::getMeleeActionDamage(Champion* champ, int16 champIndex, Group* group, int16 creatureIndex, int16 mapX, int16 mapY, uint16 actionHitProbability, uint16 actionDamageFactor, int16 skillIndex) {
int16 L0565_i_Damage = 0;
int16 L0566_i_Damage = 0;
int16 L0567_i_DoubledMapDifficulty;
@@ -1953,7 +1953,7 @@ T0231009:
if (_vm->getRandomNumber(64) < _vm->_championMan->getSkillLevel(champIndex, skillIndex)) {
L0565_i_Damage += L0565_i_Damage + 10;
}
- L0569_i_Outcome = f190_groupGetDamageCreatureOutcome(group, creatureIndex, mapX, mapY, L0565_i_Damage, true);
+ L0569_i_Outcome = groupGetDamageCreatureOutcome(group, creatureIndex, mapX, mapY, L0565_i_Damage, true);
_vm->_championMan->addSkillExperience(champIndex, skillIndex, (L0565_i_Damage * L0572_ps_CreatureInfo->getExperience() >> 4) + 3);
_vm->_championMan->decrementStamina(champIndex, _vm->getRandomNumber(4) + 4);
goto T0231016;
@@ -1965,12 +1965,12 @@ T0231015:
T0231016:
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
if (L0569_i_Outcome != k2_outcomeKilledAllCreaturesInGroup) {
- f209_processEvents29to41(mapX, mapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
+ processEvents29to41(mapX, mapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
}
return L0565_i_Damage;
}
-void GroupMan::f224_fluxCageAction(int16 mapX, int16 mapY) {
+void GroupMan::fluxCageAction(int16 mapX, int16 mapY) {
Thing L0545_T_Thing;
int16 L0546_i_Multiple;
#define AL0546_i_SquareType L0546_i_Multiple
@@ -1996,41 +1996,41 @@ void GroupMan::f224_fluxCageAction(int16 mapX, int16 mapY) {
L0547_s_Event._B._location._mapY = mapY;
L0547_s_Event._B._location._mapY = mapY;
_vm->_timeline->f238_addEventGetEventIndex(&L0547_s_Event);
- if (f222_isLordChaosOnSquare(mapX, mapY - 1)) {
+ if (isLordChaosOnSquare(mapX, mapY - 1)) {
mapY--;
- AL0546_i_FluxcageCount = f221_isFluxcageOnSquare(mapX + 1, mapY);
+ AL0546_i_FluxcageCount = isFluxcageOnSquare(mapX + 1, mapY);
goto T0224005;
}
- if (f222_isLordChaosOnSquare(mapX - 1, mapY)) {
+ if (isLordChaosOnSquare(mapX - 1, mapY)) {
mapX--;
- AL0546_i_FluxcageCount = f221_isFluxcageOnSquare(mapX, mapY + 1);
+ AL0546_i_FluxcageCount = isFluxcageOnSquare(mapX, mapY + 1);
T0224005:
- AL0546_i_FluxcageCount += f221_isFluxcageOnSquare(mapX, mapY - 1) + f221_isFluxcageOnSquare(mapX - 1, mapY);
+ AL0546_i_FluxcageCount += isFluxcageOnSquare(mapX, mapY - 1) + isFluxcageOnSquare(mapX - 1, mapY);
} else {
- if (f222_isLordChaosOnSquare(mapX + 1, mapY)) {
+ if (isLordChaosOnSquare(mapX + 1, mapY)) {
mapX++;
- AL0546_i_FluxcageCount = f221_isFluxcageOnSquare(mapX, mapY - 1);
+ AL0546_i_FluxcageCount = isFluxcageOnSquare(mapX, mapY - 1);
goto T0224008;
}
- if (f222_isLordChaosOnSquare(mapX, mapY + 1)) {
+ if (isLordChaosOnSquare(mapX, mapY + 1)) {
mapY++;
- AL0546_i_FluxcageCount = f221_isFluxcageOnSquare(mapX - 1, mapY);
+ AL0546_i_FluxcageCount = isFluxcageOnSquare(mapX - 1, mapY);
T0224008:
- AL0546_i_FluxcageCount += f221_isFluxcageOnSquare(mapX, mapY + 1) + f221_isFluxcageOnSquare(mapX + 1, mapY);
+ AL0546_i_FluxcageCount += isFluxcageOnSquare(mapX, mapY + 1) + isFluxcageOnSquare(mapX + 1, mapY);
} else {
AL0546_i_FluxcageCount = 0;
}
}
if (AL0546_i_FluxcageCount == 2) {
- f209_processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
+ processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
}
}
-uint16 GroupMan::f222_isLordChaosOnSquare(int16 mapX, int16 mapY) {
+uint16 GroupMan::isLordChaosOnSquare(int16 mapX, int16 mapY) {
Thing L0542_T_Thing;
Group* L0543_ps_Group;
- L0542_T_Thing = f175_groupGetThing(mapX, mapY);
+ L0542_T_Thing = groupGetThing(mapX, mapY);
if (L0542_T_Thing == Thing::_endOfList)
return 0;
@@ -2041,7 +2041,7 @@ uint16 GroupMan::f222_isLordChaosOnSquare(int16 mapX, int16 mapY) {
return 0;
}
-bool GroupMan::f221_isFluxcageOnSquare(int16 mapX, int16 mapY) {
+bool GroupMan::isFluxcageOnSquare(int16 mapX, int16 mapY) {
Thing L0540_T_Thing;
int16 L0541_i_SquareType;
@@ -2059,7 +2059,7 @@ bool GroupMan::f221_isFluxcageOnSquare(int16 mapX, int16 mapY) {
return false;
}
-void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) {
+void GroupMan::fuseAction(uint16 mapX, uint16 mapY) {
int16 L0548_i_MapX;
int16 L0549_i_MapY;
uint16 L0551_ui_FluxcageCount;
@@ -2073,12 +2073,12 @@ void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) {
}
_vm->_projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, 255, mapX, mapY, k255_CreatureTypeSingleCenteredCreature); /* BUG0_17 The game crashes after the Fuse action is performed while looking at a wall on a map boundary. An explosion thing is created on the square in front of the party but there is no check to ensure the square coordinates are in the map bounds. This corrupts a memory location and leads to a game crash */
- L0555_T_LordChaosThing = Thing(f222_isLordChaosOnSquare(mapX, mapY));
+ L0555_T_LordChaosThing = Thing(isLordChaosOnSquare(mapX, mapY));
if (L0555_T_LordChaosThing.toUint16()) {
- L0551_ui_FluxcageCount = (L0554_aB_Fluxcages[0] = f221_isFluxcageOnSquare(mapX - 1, mapY)) +
- (L0554_aB_Fluxcages[1] = f221_isFluxcageOnSquare(mapX + 1, mapY)) +
- (L0554_aB_Fluxcages[2] = f221_isFluxcageOnSquare(mapX, mapY - 1)) +
- (L0554_aB_Fluxcages[3] = f221_isFluxcageOnSquare(mapX, mapY + 1));
+ L0551_ui_FluxcageCount = (L0554_aB_Fluxcages[0] = isFluxcageOnSquare(mapX - 1, mapY)) +
+ (L0554_aB_Fluxcages[1] = isFluxcageOnSquare(mapX + 1, mapY)) +
+ (L0554_aB_Fluxcages[2] = isFluxcageOnSquare(mapX, mapY - 1)) +
+ (L0554_aB_Fluxcages[3] = isFluxcageOnSquare(mapX, mapY + 1));
while (L0551_ui_FluxcageCount++ < 4) {
L0548_i_MapX = mapX;
L0549_i_MapY = mapY;
@@ -2102,9 +2102,9 @@ void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) {
break;
}
}
- if (f223_isSquareACorridorTeleporterPitOrDoor(L0548_i_MapX, L0549_i_MapY)) {
+ if (isSquareACorridorTeleporterPitOrDoor(L0548_i_MapX, L0549_i_MapY)) {
if (!_vm->_moveSens->f267_getMoveResult(L0555_T_LordChaosThing, mapX, mapY, L0548_i_MapX, L0549_i_MapY)) {
- f180_startWanedring(L0548_i_MapX, L0549_i_MapY);
+ startWanedring(L0548_i_MapX, L0549_i_MapY);
}
return;
}
@@ -2113,9 +2113,9 @@ void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) {
}
}
-void GroupMan::save1_ActiveGroupPart(Common::OutSaveFile* file) {
- for (uint16 i = 0; i < _g376_maxActiveGroupCount; ++i) {
- ActiveGroup *group = &_g375_activeGroups[i];
+void GroupMan::saveActiveGroupPart(Common::OutSaveFile* file) {
+ for (uint16 i = 0; i < _maxActiveGroupCount; ++i) {
+ ActiveGroup *group = &_activeGroups[i];
file->writeUint16BE(group->_groupThingIndex);
file->writeUint16BE(group->_directions);
file->writeByte(group->_cells);
@@ -2132,9 +2132,9 @@ void GroupMan::save1_ActiveGroupPart(Common::OutSaveFile* file) {
}
}
-void GroupMan::load1_ActiveGroupPart(Common::InSaveFile* file) {
- for (uint16 i = 0; i < _g376_maxActiveGroupCount; ++i) {
- ActiveGroup *group = &_g375_activeGroups[i];
+void GroupMan::loadActiveGroupPart(Common::InSaveFile* file) {
+ for (uint16 i = 0; i < _maxActiveGroupCount; ++i) {
+ ActiveGroup *group = &_activeGroups[i];
group->_groupThingIndex = file->readUint16BE();
group->_directions = (Direction)file->readUint16BE();
group->_cells = file->readByte();
diff --git a/engines/dm/group.h b/engines/dm/group.h
index 8fe1eba3ef..66278266fe 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -25,7 +25,6 @@
* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
*/
-
#ifndef DM_GROUP_H
#define DM_GROUP_H
@@ -155,101 +154,99 @@ int32 M32_setTime(int32 &map_time, int32 time); // @ M32_SET_TIME
class GroupMan {
DMEngine *_vm;
- byte _g392_dropMovingCreatureFixedPossessionsCell[4]; // @ G0392_auc_DropMovingCreatureFixedPossessionsCells
- uint16 _g391_dropMovingCreatureFixedPossCellCount; // @ G0391_ui_DropMovingCreatureFixedPossessionsCellCount
- uint16 _g386_fluxCageCount; // @ G0386_ui_FluxCageCount
- int16 _g385_fluxCages[4]; // @ G0385_ac_FluxCages
- int16 _g378_currentGroupMapX; // @ G0378_i_CurrentGroupMapX
- int16 _g379_currentGroupMapY; // @ G0379_i_CurrentGroupMapY
- Thing _g380_currGroupThing; // @ G0380_T_CurrentGroupThing
- int16 _g384_groupMovementTestedDirections[4]; // @ G0384_auc_GroupMovementTestedDirections
- uint16 _g381_currGroupDistanceToParty; // @ G0381_ui_CurrentGroupDistanceToParty
- int16 _g382_currGroupPrimaryDirToParty; // @ G0382_i_CurrentGroupPrimaryDirectionToParty
- int16 _g383_currGroupSecondaryDirToParty; // @ G0383_i_CurrentGroupSecondaryDirectionToParty
-
- Thing _g388_groupMovementBlockedByGroupThing; // @ G0388_T_GroupMovementBlockedByGroupThing
- bool _g389_groupMovementBlockedByDoor; // @ G0389_B_GroupMovementBlockedByDoor
- bool _g390_groupMovementBlockedByParty; // @ G0390_B_GroupMovementBlockedByParty
- bool _g387_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter; // @ G0387_B_GroupMovementBlockedByWallStairsPitFakeWallFluxcageTeleporter
- int32 _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime; // @ G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime
+ byte _dropMovingCreatureFixedPossessionsCell[4]; // @ G0392_auc_DropMovingCreatureFixedPossessionsCells
+ uint16 _dropMovingCreatureFixedPossCellCount; // @ G0391_ui_DropMovingCreatureFixedPossessionsCellCount
+ uint16 _fluxCageCount; // @ G0386_ui_FluxCageCount
+ int16 _fluxCages[4]; // @ G0385_ac_FluxCages
+ int16 _currentGroupMapX; // @ G0378_i_CurrentGroupMapX
+ int16 _currentGroupMapY; // @ G0379_i_CurrentGroupMapY
+ Thing _currGroupThing; // @ G0380_T_CurrentGroupThing
+ int16 _groupMovementTestedDirections[4]; // @ G0384_auc_GroupMovementTestedDirections
+ uint16 _currGroupDistanceToParty; // @ G0381_ui_CurrentGroupDistanceToParty
+ int16 _currGroupPrimaryDirToParty; // @ G0382_i_CurrentGroupPrimaryDirectionToParty
+ int16 _currGroupSecondaryDirToParty; // @ G0383_i_CurrentGroupSecondaryDirectionToParty
+
+ Thing _groupMovementBlockedByGroupThing; // @ G0388_T_GroupMovementBlockedByGroupThing
+ bool _groupMovementBlockedByDoor; // @ G0389_B_GroupMovementBlockedByDoor
+ bool _groupMovementBlockedByParty; // @ G0390_B_GroupMovementBlockedByParty
+ bool _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter; // @ G0387_B_GroupMovementBlockedByWallStairsPitFakeWallFluxcageTeleporter
+ int32 twoHalfSquareSizedCreaturesGroupLastDirectionSetTime; // @ G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime
public:
- uint16 _g376_maxActiveGroupCount; // @ G0376_ui_MaximumActiveGroupCount
- ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups
- uint16 _g377_currActiveGroupCount; // @ G0377_ui_CurrentActiveGroupCount
+ uint16 _maxActiveGroupCount; // @ G0376_ui_MaximumActiveGroupCount
+ ActiveGroup *_activeGroups; // @ G0375_ps_ActiveGroups
+ uint16 _currActiveGroupCount; // @ G0377_ui_CurrentActiveGroupCount
explicit GroupMan(DMEngine *vm);
~GroupMan();
- void f196_initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
- uint16 f145_getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells
- uint16 f147_getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
- int16 f176_getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
- uint16 M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
- void f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode); // @ F0188_GROUP_DropGroupPossessions
- void f186_dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell,
+ void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
+ uint16 getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells
+ uint16 getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
+ int16 getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
+ uint16 getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
+ void dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode); // @ F0188_GROUP_DropGroupPossessions
+ void dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell,
int16 mode); // @ F0186_GROUP_DropCreatureFixedPossessions
- int16 f228_getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY,
+ int16 getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY,
int16 destMapX, int16 destMapY); // @ F0228_GROUP_GetDirectionsWhereDestinationIsVisibleFromSource
- bool f227_isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX,
+ bool isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX,
int16 destMapY); // @ F0227_GROUP_IsDestinationVisibleFromSource
- bool f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack,
+ bool groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 attack,
bool magicAttack, int16 ticks); // @ F0232_GROUP_IsDoorDestroyedByAttack
- Thing f175_groupGetThing(int16 mapX, int16 mapY); // @ F0175_GROUP_GetThing
- int16 f190_groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex,
+ Thing groupGetThing(int16 mapX, int16 mapY); // @ F0175_GROUP_GetThing
+ int16 groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex,
int16 mapX, int16 mapY, int16 damage, bool notMoving); // @ F0190_GROUP_GetDamageCreatureOutcome
- void f189_delete(int16 mapX, int16 mapY); // @ F0189_GROUP_Delete
- void f181_groupDeleteEvents(int16 mapX, int16 mapY); // @ F0181_GROUP_DeleteEvents
- uint16 f178_getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 creatureIndex, uint16 creatreVal); // @ F0178_GROUP_GetGroupValueUpdatedWithCreatureValue
- int16 f191_getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving); // @ F0191_GROUP_GetDamageAllCreaturesOutcome
- int16 f192_groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack); // @ F0192_GROUP_GetResistanceAdjustedPoisonAttack
- void f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks); // @ F0209_GROUP_ProcessEvents29to41
- bool f202_isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16 mapY,
+ void groupDelete(int16 mapX, int16 mapY); // @ F0189_GROUP_Delete
+ void groupDeleteEvents(int16 mapX, int16 mapY); // @ F0181_GROUP_DeleteEvents
+ uint16 getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 creatureIndex, uint16 creatreVal); // @ F0178_GROUP_GetGroupValueUpdatedWithCreatureValue
+ int16 getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving); // @ F0191_GROUP_GetDamageAllCreaturesOutcome
+ int16 groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack); // @ F0192_GROUP_GetResistanceAdjustedPoisonAttack
+ void processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks); // @ F0209_GROUP_ProcessEvents29to41
+ bool isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16 mapY,
uint16 dir, bool allowMovementOverImaginaryPitsAndFakeWalls); // @ F0202_GROUP_IsMovementPossible
- int16 f226_getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 destMapX,
+ int16 getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 destMapX,
int16 destMapY); // @ F0226_GROUP_GetDistanceBetweenSquares
- int16 f200_groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY); // @ F0200_GROUP_GetDistanceToVisibleParty
- int16 f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 srcMapY,
+ int16 groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY); // @ F0200_GROUP_GetDistanceToVisibleParty
+ int16 getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 srcMapY,
int16 destMapX, int16 destMapY, bool (GroupMan::*isBlocked)(uint16, uint16)); // @ F0199_GROUP_GetDistanceBetweenUnblockedSquares
- bool f197_isViewPartyBlocked(uint16 mapX, uint16 mapY); // @ F0197_GROUP_IsViewPartyBlocked
- int32 f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 creatureIndex,
+ bool isViewPartyBlocked(uint16 mapX, uint16 mapY); // @ F0197_GROUP_IsViewPartyBlocked
+ int32 getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 creatureIndex,
bool isAttacking); // @ F0179_GROUP_GetCreatureAspectUpdateTime
- void f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures); // @ F0205_GROUP_SetDirection
- void f208_groupAddEvent(TimelineEvent *event, uint32 time); // @ F0208_GROUP_AddEvent
- int16 f201_getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int16 mapY, int16 mapX); // @ F0201_GROUP_GetSmelledPartyPrimaryDirectionOrdinal
- bool f198_isSmellPartyBlocked(uint16 mapX, uint16 mapY); // @ F0198_GROUP_IsSmellPartyBlocked
- int16 f203_getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 mapX, int16 mapY,
+ void setGroupDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures); // @ F0205_GROUP_SetDirection
+ void addGroupEvent(TimelineEvent *event, uint32 time); // @ F0208_GROUP_AddEvent
+ int16 getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int16 mapY, int16 mapX); // @ F0201_GROUP_GetSmelledPartyPrimaryDirectionOrdinal
+ bool isSmellPartyBlocked(uint16 mapX, uint16 mapY); // @ F0198_GROUP_IsSmellPartyBlocked
+ int16 getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 mapX, int16 mapY,
bool allowMovementOverImaginaryPitsAndFakeWalls); // @ F0203_GROUP_GetFirstPossibleMovementDirectionOrdinal
- void f206_groupSetDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex,
+ void setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex,
int16 creatureSize); // @ F0206_GROUP_SetDirectionGroup
- void f182_stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY);// @ F0182_GROUP_StopAttacking
- bool f204_isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, int16 mapY, uint16 dir); // @ F0204_GROUP_IsArchenemyDoubleMovementPossible
- bool f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 creatureIndex); // @ F0207_GROUP_IsCreatureAttacking
- void f229_setOrderedCellsToAttack(signed char * orderedCellsToAttack, int16 targetMapX,
+ void stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY);// @ F0182_GROUP_StopAttacking
+ bool isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, int16 mapY, uint16 dir); // @ F0204_GROUP_IsArchenemyDoubleMovementPossible
+ bool isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16 creatureIndex); // @ F0207_GROUP_IsCreatureAttacking
+ void setOrderedCellsToAttack(signed char * orderedCellsToAttack, int16 targetMapX,
int16 targetMapY, int16 attackerMapX, int16 attackerMapY, uint16 cellSource); // @ F0229_GROUP_SetOrderedCellsToAttack
- void f193_stealFromChampion(Group *group, uint16 championIndex); // @ F0193_GROUP_StealFromChampion
- int16 f230_getChampionDamage(Group *group, uint16 champIndex); // @ F0230_GROUP_GetChampionDamage
- void f187_dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16 mapY); // @ F0187_GROUP_DropMovingCreatureFixedPossessions
- void f180_startWanedring(int16 mapX, int16 mapY); // @ F0180_GROUP_StartWandering
- void f183_addActiveGroup(Thing thing, int16 mapX, int16 mapY); // @ F0183_GROUP_AddActiveGroup
- void f184_removeActiveGroup(uint16 activeGroupIndex); // @ F0184_GROUP_RemoveActiveGroup
- void f194_removeAllActiveGroups(); // @ F0194_GROUP_RemoveAllActiveGroups
- void f195_addAllActiveGroups(); // @ F0195_GROUP_AddAllActiveGroups
- Thing f185_groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY); // @ F0185_GROUP_GetGenerated
- bool f223_isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY); // @ F0223_GROUP_IsSquareACorridorTeleporterPitOrDoor
- int16 f177_getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16 partyX, int16 paryY,
+ void stealFromChampion(Group *group, uint16 championIndex); // @ F0193_GROUP_StealFromChampion
+ int16 getChampionDamage(Group *group, uint16 champIndex); // @ F0230_GROUP_GetChampionDamage
+ void dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16 mapY); // @ F0187_GROUP_DropMovingCreatureFixedPossessions
+ void startWanedring(int16 mapX, int16 mapY); // @ F0180_GROUP_StartWandering
+ void addActiveGroup(Thing thing, int16 mapX, int16 mapY); // @ F0183_GROUP_AddActiveGroup
+ void removeActiveGroup(uint16 activeGroupIndex); // @ F0184_GROUP_RemoveActiveGroup
+ void removeAllActiveGroups(); // @ F0194_GROUP_RemoveAllActiveGroups
+ void addAllActiveGroups(); // @ F0195_GROUP_AddAllActiveGroups
+ Thing groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY); // @ F0185_GROUP_GetGenerated
+ bool isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY); // @ F0223_GROUP_IsSquareACorridorTeleporterPitOrDoor
+ int16 getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16 partyX, int16 paryY,
uint16 champCell); // @ F0177_GROUP_GetMeleeTargetCreatureOrdinal
- int16 f231_getMeleeActionDamage(Champion *champ, int16 champIndex, Group *group, int16 creatureIndex,
+ int16 getMeleeActionDamage(Champion *champ, int16 champIndex, Group *group, int16 creatureIndex,
int16 mapX, int16 mapY, uint16 actionHitProbability, uint16 actionDamageFactor, int16 skillIndex); // @ F0231_GROUP_GetMeleeActionDamage
- void f224_fluxCageAction(int16 mapX, int16 mapY); // @ F0224_GROUP_FluxCageAction
- uint16 f222_isLordChaosOnSquare(int16 mapX, int16 mapY); // @ F0222_GROUP_IsLordChaosOnSquare
- bool f221_isFluxcageOnSquare(int16 mapX, int16 mapY); // @ F0221_GROUP_IsFluxcageOnSquare
- void f225_fuseAction(uint16 mapX, uint16 mapY); // @ F0225_GROUP_FuseAction
- void save1_ActiveGroupPart(Common::OutSaveFile *file);
- void load1_ActiveGroupPart(Common::InSaveFile* file);
+ void fluxCageAction(int16 mapX, int16 mapY); // @ F0224_GROUP_FluxCageAction
+ uint16 isLordChaosOnSquare(int16 mapX, int16 mapY); // @ F0222_GROUP_IsLordChaosOnSquare
+ bool isFluxcageOnSquare(int16 mapX, int16 mapY); // @ F0221_GROUP_IsFluxcageOnSquare
+ void fuseAction(uint16 mapX, uint16 mapY); // @ F0225_GROUP_FuseAction
+ void saveActiveGroupPart(Common::OutSaveFile *file);
+ void loadActiveGroupPart(Common::InSaveFile* file);
};
-
-
}
#endif
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index 17a9b4fd90..4442c6cd22 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -102,20 +102,20 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
_timeline->_g372_eventCount = file->readUint16BE();
_timeline->_g373_firstUnusedEventIndex = file->readUint16BE();
_timeline->_g369_eventMaxCount = file->readUint16BE();
- _groupMan->_g377_currActiveGroupCount = file->readUint16BE();
+ _groupMan->_currActiveGroupCount = file->readUint16BE();
_projexpl->_g361_lastCreatureAttackTime = file->readSint32BE();
_projexpl->_g362_lastPartyMovementTime = file->readSint32BE();
_disabledMovementTicks = file->readSint16BE();
_projectileDisableMovementTicks = file->readSint16BE();
_lastProjectileDisabledMovementDirection = file->readSint16BE();
_championMan->_leaderHandObject = Thing(file->readUint16BE());
- _groupMan->_g376_maxActiveGroupCount = file->readUint16BE();
+ _groupMan->_maxActiveGroupCount = file->readUint16BE();
if (!_restartGameRequest) {
_timeline->f233_initTimeline();
- _groupMan->f196_initActiveGroups();
+ _groupMan->initActiveGroups();
}
- _groupMan->load1_ActiveGroupPart(file);
+ _groupMan->loadActiveGroupPart(file);
_championMan->loadPartyPart2(file);
_timeline->load3_eventsPart(file);
_timeline->load4_timelinePart(file);
@@ -130,7 +130,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
if (_newGameFl) {
_timeline->f233_initTimeline();
- _groupMan->f196_initActiveGroups();
+ _groupMan->initActiveGroups();
if (L1366_B_FadePalette) {
_displayMan->startEndFadeToPalette(_displayMan->_blankBuffer);
@@ -318,17 +318,17 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
file->writeUint16BE(_timeline->_g372_eventCount);
file->writeUint16BE(_timeline->_g373_firstUnusedEventIndex);
file->writeUint16BE(_timeline->_g369_eventMaxCount);
- file->writeUint16BE(_groupMan->_g377_currActiveGroupCount);
+ file->writeUint16BE(_groupMan->_currActiveGroupCount);
file->writeSint32BE(_projexpl->_g361_lastCreatureAttackTime);
file->writeSint32BE(_projexpl->_g362_lastPartyMovementTime);
file->writeSint16BE(_disabledMovementTicks);
file->writeSint16BE(_projectileDisableMovementTicks);
file->writeSint16BE(_lastProjectileDisabledMovementDirection);
file->writeUint16BE(_championMan->_leaderHandObject.toUint16());
- file->writeUint16BE(_groupMan->_g376_maxActiveGroupCount);
+ file->writeUint16BE(_groupMan->_maxActiveGroupCount);
// write C1_SAVE_PART_ACTIVE_GROUP part
- _groupMan->save1_ActiveGroupPart(file);
+ _groupMan->saveActiveGroupPart(file);
// write C2_SAVE_PART_PARTY part
_championMan->savePartyPart2(file);
// write C3_SAVE_PART_EVENTS part
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index c42616fa92..adc151ebc0 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -1085,7 +1085,7 @@ bool MenuMan::f407_isActionPerformed(uint16 champIndex, int16 actionIndex) {
L1251_i_MapX = _vm->_dungeonMan->_partyMapX;
L1252_i_MapY = _vm->_dungeonMan->_partyMapY;
L1251_i_MapX += _vm->_dirIntoStepCountEast[L1247_ps_Champion->_dir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[L1247_ps_Champion->_dir];
- _g517_actionTargetGroupThing = _vm->_groupMan->f175_groupGetThing(L1251_i_MapX, L1252_i_MapY);
+ _g517_actionTargetGroupThing = _vm->_groupMan->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);
@@ -1131,7 +1131,7 @@ T0407014:
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->_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->_groupMan->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->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
break;
}
@@ -1239,14 +1239,14 @@ T0407032:
}
case k35_ChampionActionFluxcage:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
- _vm->_groupMan->f224_fluxCageAction(L1251_i_MapX, L1252_i_MapY);
+ _vm->_groupMan->fluxCageAction(L1251_i_MapX, L1252_i_MapY);
break;
case k43_ChampionActionFuse:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
L1251_i_MapX = _vm->_dungeonMan->_partyMapX;
L1252_i_MapY = _vm->_dungeonMan->_partyMapY;
L1251_i_MapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], L1252_i_MapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
- _vm->_groupMan->f225_fuseAction(L1251_i_MapX, L1252_i_MapY);
+ _vm->_groupMan->fuseAction(L1251_i_MapX, L1252_i_MapY);
break;
case k36_ChampionActionHeal:
/* CHANGE2_17_IMPROVEMENT Heal action is much more effective
@@ -1283,7 +1283,7 @@ T0407032:
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->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->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->_partyMapX, _vm->_dungeonMan->_partyMapY, L1251_i_MapX, L1252_i_MapY);
@@ -1472,7 +1472,7 @@ bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int
_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->_partyMapX, _vm->_dungeonMan->_partyMapY, AL1236_ui_ChampionCell = champ->_cell);
+ L1238_i_CreatureOrdinal = _vm->_groupMan->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 */
@@ -1493,7 +1493,7 @@ T0402005: /* Check if there is another champion in front */
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->getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
+ _g513_actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
return true;
}
T0402010:
@@ -1540,10 +1540,10 @@ bool MenuMan::f401_isGroupFrightenedByAction(int16 champIndex, uint16 actionInde
if (((L1230_ui_FearResistance = L1234_ps_CreatureInfo->getFearResistance()) > _vm->getRandomNumber(L1229_i_FrightAmount)) || (L1230_ui_FearResistance == k15_immuneToFear)) {
L1231_ui_Experience >>= 1;
} else {
- L1235_ps_ActiveGroup = &_vm->_groupMan->_g375_activeGroups[L1233_ps_Group->getActiveGroupIndex()];
+ L1235_ps_ActiveGroup = &_vm->_groupMan->_activeGroups[L1233_ps_Group->getActiveGroupIndex()];
if (L1233_ps_Group->getBehaviour() == k6_behavior_ATTACK) {
- _vm->_groupMan->f182_stopAttacking(L1235_ps_ActiveGroup, mapX, mapY);
- _vm->_groupMan->f180_startWanedring(mapX, mapY);
+ _vm->_groupMan->stopAttacking(L1235_ps_ActiveGroup, mapX, mapY);
+ _vm->_groupMan->startWanedring(mapX, mapY);
}
L1233_ps_Group->setBehaviour(k5_behavior_FLEE);
L1235_ps_ActiveGroup->_delayFleeingFromTarget = ((16 - L1230_ui_FearResistance) << 2) / L1234_ps_CreatureInfo->_movementTicks;
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 25b8e349c0..98da742b40 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -361,13 +361,13 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
} else {
if (L0710_i_ThingType == k4_GroupThingType) {
_vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource);
- AL0727_ui_Outcome = _vm->_groupMan->f191_getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(thing), mapX, mapY, 20, false);
+ AL0727_ui_Outcome = _vm->_groupMan->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;
if (AL0727_ui_Outcome == k1_outcomeKilledSomeCreaturesInGroup) {
- _vm->_groupMan->f187_dropMovingCreatureFixedPossession(thing, destMapX, destMapY);
+ _vm->_groupMan->dropMovingCreatureFixedPossession(thing, destMapX, destMapY);
}
}
}
@@ -389,11 +389,11 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
}
}
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->_groupMan->dropMovingCreatureFixedPossession(thing, destMapX, destMapY);
+ _vm->_groupMan->dropGroupPossessions(destMapX, destMapY, thing, k2_soundModePlayOneTickLater);
_vm->_dungeonMan->setCurrentMap(L0714_ui_MapIndexSource);
if (mapX >= 0) {
- _vm->_groupMan->f189_delete(mapX, mapY);
+ _vm->_groupMan->groupDelete(mapX, mapY);
}
return true; /* The specified group thing cannot be moved because it was killed by a fall or because it is not allowed on the destination map */
}
@@ -454,9 +454,9 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
if (destMapX >= 0) {
if (thing == Thing::_party) {
_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 ((thing = _vm->_groupMan->groupGetThing(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) != Thing::_endOfList) { /* Delete group if party moves onto its square */
+ _vm->_groupMan->dropGroupPossessions(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, thing, k1_soundModePlayIfPrioritized);
+ _vm->_groupMan->groupDelete(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
}
if (L0715_ui_MapIndexDestination == L0714_ui_MapIndexSource) {
f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, Thing::_party, L0725_B_PartySquare, true);
@@ -469,13 +469,13 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
_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->_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 */
+ if (((L0715_ui_MapIndexDestination == _vm->_dungeonMan->_partyMapIndex) && (destMapX == _vm->_dungeonMan->_partyMapX) && (destMapY == _vm->_dungeonMan->_partyMapY)) || (_vm->_groupMan->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);
+ _vm->_groupMan->groupDeleteEvents(mapX, mapY);
}
if (L0721_B_GroupOnPartyMap) {
- _vm->_groupMan->f184_removeActiveGroup(AL0708_i_ActiveGroupIndex);
+ _vm->_groupMan->removeActiveGroup(AL0708_i_ActiveGroupIndex);
}
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 */
@@ -485,11 +485,11 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L1638_ui_MovementSoundIndex, destMapX, destMapY, k1_soundModePlayIfPrioritized);
}
if (L0721_B_GroupOnPartyMap && (L0715_ui_MapIndexDestination != _vm->_dungeonMan->_partyMapIndex)) { /* If the group leaves the party map */
- _vm->_groupMan->f184_removeActiveGroup(AL0708_i_ActiveGroupIndex);
+ _vm->_groupMan->removeActiveGroup(AL0708_i_ActiveGroupIndex);
L0720_ui_MoveGroupResult = true;
} else {
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);
+ _vm->_groupMan->addActiveGroup(thing, destMapX, destMapY);
L0720_ui_MoveGroupResult = true;
}
}
@@ -499,15 +499,15 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
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->_groupMan->startWanedring(destMapX, destMapY);
}
_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);
+ _vm->_groupMan->stopAttacking(&_vm->_groupMan->_activeGroups[L0720_ui_MoveGroupResult - 2], mapX, mapY);
} else {
if (L0720_ui_MoveGroupResult) { /* If the group was teleported or leaved the party map or entered the party map */
- _vm->_groupMan->f181_groupDeleteEvents(mapX, mapY);
+ _vm->_groupMan->groupDeleteEvents(mapX, mapY);
}
}
}
@@ -575,7 +575,7 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa
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)) {
+ if (_vm->_groupMan->getCreatureOrdinalInCell(L0701_ps_Group, AL0699_ui_Cell)) {
L0707_auc_ChampionOrCreatureOrdinalInCell[AL0699_ui_Cell] = _vm->indexToOrdinal(AL0699_ui_Cell);
}
}
@@ -584,7 +584,7 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa
}
}
if ((destMapX >= 0) && ((abs(srcMapX - destMapX) + abs(srcMapY - destMapY)) == 1)) { /* If source and destination squares are adjacent (if party or group is not being teleported) */
- AL0699_ui_PrimaryDirection = _vm->_groupMan->f228_getDirsWhereDestIsVisibleFromSource(srcMapX, srcMapY, destMapX, destMapY);
+ AL0699_ui_PrimaryDirection = _vm->_groupMan->getDirsWhereDestIsVisibleFromSource(srcMapX, srcMapY, destMapX, destMapY);
AL0700_i_SecondaryDirection = returnNextVal(AL0699_ui_PrimaryDirection);
for (int16 i = 0; i < 4; ++i)
L0706_auc_IntermediaryChampionOrCreatureOrdinalInCell[i] = 0;
@@ -704,7 +704,7 @@ int16 MovesensMan::f262_getTeleporterRotatedGroupResult(Teleporter* teleporter,
L0686_ps_Group = (Group *)_vm->_dungeonMan->getThingData(thing);
L0683_i_Rotation = teleporter->getRotation();
- L0684_ui_GroupDirections = _vm->_groupMan->f147_getGroupDirections(L0686_ps_Group, mapIndex);
+ L0684_ui_GroupDirections = _vm->_groupMan->getGroupDirections(L0686_ps_Group, mapIndex);
L0689_B_AbsoluteRotation = teleporter->getAbsoluteRotation();
if (L0689_B_AbsoluteRotation) {
@@ -713,20 +713,20 @@ int16 MovesensMan::f262_getTeleporterRotatedGroupResult(Teleporter* teleporter,
L0685_ui_UpdatedGroupDirections = normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation);
}
- L0687_ui_UpdatedGroupCells = _vm->_groupMan->f145_getGroupCells(L0686_ps_Group, mapIndex);
+ L0687_ui_UpdatedGroupCells = _vm->_groupMan->getGroupCells(L0686_ps_Group, mapIndex);
if (L0687_ui_UpdatedGroupCells != k255_CreatureTypeSingleCenteredCreature) {
L0690_ui_GroupCells = L0687_ui_UpdatedGroupCells;
L0691_i_CreatureSize = getFlag(g243_CreatureInfo[L0686_ps_Group->_type]._attributes, k0x0003_MaskCreatureInfo_size);
L0692_i_RelativeRotation = normalizeModulo4(4 + L0685_ui_UpdatedGroupDirections - L0684_ui_GroupDirections);
for (L0688_i_CreatureIndex = 0; L0688_i_CreatureIndex <= L0686_ps_Group->getCount(); L0688_i_CreatureIndex++) {
- L0685_ui_UpdatedGroupDirections = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0685_ui_UpdatedGroupDirections, L0688_i_CreatureIndex, L0689_B_AbsoluteRotation ? L0683_i_Rotation : normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation));
+ L0685_ui_UpdatedGroupDirections = _vm->_groupMan->getGroupValueUpdatedWithCreatureValue(L0685_ui_UpdatedGroupDirections, L0688_i_CreatureIndex, L0689_B_AbsoluteRotation ? L0683_i_Rotation : normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation));
if (L0691_i_CreatureSize == k0_MaskCreatureSizeQuarter) {
L0692_i_RelativeRotation = !L0689_B_AbsoluteRotation;
if (L0692_i_RelativeRotation)
L0692_i_RelativeRotation = L0683_i_Rotation;
}
if (L0692_i_RelativeRotation) {
- L0687_ui_UpdatedGroupCells = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0687_ui_UpdatedGroupCells, L0688_i_CreatureIndex, normalizeModulo4(L0690_ui_GroupCells + L0692_i_RelativeRotation));
+ L0687_ui_UpdatedGroupCells = _vm->_groupMan->getGroupValueUpdatedWithCreatureValue(L0687_ui_UpdatedGroupCells, L0688_i_CreatureIndex, normalizeModulo4(L0690_ui_GroupCells + L0692_i_RelativeRotation));
}
L0684_ui_GroupDirections >>= 2;
L0690_ui_GroupCells >>= 2;
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 4fdda2ede0..8ef401313d 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -170,7 +170,7 @@ T0217004:
return false;
}
L0488_i_Attack = f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) + 1;
- _vm->_groupMan->f232_groupIsDoorDestoryedByAttack(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->getRandomNumber(L0488_i_Attack), false, 0);
+ _vm->_groupMan->groupIsDoorDestoryedByAttack(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->getRandomNumber(L0488_i_Attack), false, 0);
break;
case kM2_ChampionElemType:
if ((AP0456_i_ChampionIndex = _vm->_championMan->getIndexInCell(cell)) < 0) {
@@ -179,8 +179,8 @@ 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->getThingData(_vm->_groupMan->f175_groupGetThing(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY));
- if (!(L0512_ui_CreatureIndex = _vm->_groupMan->f176_getCreatureOrdinalInCell(L0491_ps_Group, cell))) {
+ L0491_ps_Group = (Group *)_vm->_dungeonMan->getThingData(_vm->_groupMan->groupGetThing(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY));
+ if (!(L0512_ui_CreatureIndex = _vm->_groupMan->getCreatureOrdinalInCell(L0491_ps_Group, cell))) {
return false;
}
L0512_ui_CreatureIndex--;
@@ -195,8 +195,8 @@ T0217004:
}
L0488_i_Attack = (uint16)((unsigned long)f216_projectileGetImpactAttack(L0490_ps_Projectile, L0486_T_ProjectileAssociatedThing) << 6) / L0493_ps_CreatureInfo->_defense;
if (L0488_i_Attack) {
- if ((AL0487_i_Outcome = _vm->_groupMan->f190_groupGetDamageCreatureOutcome(L0491_ps_Group, L0512_ui_CreatureIndex, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->_groupMan->f192_groupGetResistanceAdjustedPoisonAttack(L0511_ui_CreatureType, _g366_projectilePoisonAttack), true)) != k0_outcomeKilledNoCreaturesInGroup) {
- _vm->_groupMan->f209_processEvents29to41(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, kM2_TMEventTypeCreateReactionEvent30HitByProjectile, 0);
+ if ((AL0487_i_Outcome = _vm->_groupMan->groupGetDamageCreatureOutcome(L0491_ps_Group, L0512_ui_CreatureIndex, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, L0488_i_Attack + _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(L0511_ui_CreatureType, _g366_projectilePoisonAttack), true)) != k0_outcomeKilledNoCreaturesInGroup) {
+ _vm->_groupMan->processEvents29to41(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, kM2_TMEventTypeCreateReactionEvent30HitByProjectile, 0);
}
_g364_creatureDamageOutcome = AL0487_i_Outcome;
if (!L0505_B_CreateExplosionOnImpact &&
@@ -350,7 +350,7 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC
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 */
+ if ((L0473_T_Thing = _vm->_groupMan->groupGetThing(AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY)) != Thing::_endOfList) { /* ASSEMBLY_COMPILATION_DIFFERENCE jmp */
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();
@@ -359,7 +359,7 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC
attack >>= 2;
}
if ((attack -= _vm->getRandomNumber((L0469_i_CreatureFireResistance << 1) + 1)) > 0) {
- _g364_creatureDamageOutcome = _vm->_groupMan->f191_getDamageAllCreaturesOutcome(L0472_ps_Group, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, attack, true);
+ _g364_creatureDamageOutcome = _vm->_groupMan->getDamageAllCreaturesOutcome(L0472_ps_Group, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, attack, true);
}
}
}
@@ -450,7 +450,7 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) {
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)) {
+ if ((_vm->_groupMan->groupGetThing(L0523_i_DestinationMapX, L0524_i_DestinationMapY) != Thing::_endOfList) && f217_projectileHasImpactOccurred(kM1_CreatureElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) {
return;
}
if (L0520_ps_Projectile->_kineticEnergy <= (AL0516_ui_StepEnergy = L0519_ps_Event->_C._projectile.getStepEnergy())) {
@@ -534,7 +534,7 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) {
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) {
+ if ((L0535_T_GroupThing = _vm->_groupMan->groupGetThing(L0528_ui_MapX, L0529_ui_MapY)) != Thing::_endOfList) {
L0533_ps_Group = (Group*)_vm->_dungeonMan->getThingData(L0535_T_GroupThing);
L0534_ps_CreatureInfo = &g243_CreatureInfo[AL0537_ui_CreatureType = L0533_ps_Group->_type];
}
@@ -552,7 +552,7 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) {
break;
case 0xFF80:
if (AL0531_i_SquareType == k4_DoorElemType) {
- _vm->_groupMan->f232_groupIsDoorDestoryedByAttack(L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true, 0);
+ _vm->_groupMan->groupIsDoorDestoryedByAttack(L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true, 0);
}
break;
case 0xFF83:
@@ -563,12 +563,12 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) {
AL0537_ui_NonMaterialAdditionalAttack++;
AL0531_i_CreatureCount = L0533_ps_Group->getCount();
do {
- if (getFlag(_vm->_groupMan->_g375_activeGroups[L0533_ps_Group->getActiveGroupIndex()]._aspect[AL0531_i_CreatureCount], k0x0080_MaskActiveGroupIsAttacking)) { /* Materializer / Zytaz can only be damaged while they are attacking */
- _vm->_groupMan->f190_groupGetDamageCreatureOutcome(L0533_ps_Group, AL0531_i_CreatureCount, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack + _vm->getRandomNumber(AL0537_ui_NonMaterialAdditionalAttack) + _vm->getRandomNumber(4), true);
+ if (getFlag(_vm->_groupMan->_activeGroups[L0533_ps_Group->getActiveGroupIndex()]._aspect[AL0531_i_CreatureCount], k0x0080_MaskActiveGroupIsAttacking)) { /* Materializer / Zytaz can only be damaged while they are attacking */
+ _vm->_groupMan->groupGetDamageCreatureOutcome(L0533_ps_Group, AL0531_i_CreatureCount, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack + _vm->getRandomNumber(AL0537_ui_NonMaterialAdditionalAttack) + _vm->getRandomNumber(4), true);
}
} while (--AL0531_i_CreatureCount >= 0);
} else {
- _vm->_groupMan->f191_getDamageAllCreaturesOutcome(L0533_ps_Group, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true);
+ _vm->_groupMan->getDamageAllCreaturesOutcome(L0533_ps_Group, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true);
}
}
break;
@@ -586,8 +586,8 @@ void ProjExpl::f220_explosionProcessEvent25_explosion(TimelineEvent* event) {
if (L0538_B_ExplosionOnPartySquare) {
_vm->_championMan->getDamagedChampionCount(L0530_i_Attack, k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
} else {
- if ((L0535_T_GroupThing != Thing::_endOfList) && (L0530_i_Attack = _vm->_groupMan->f192_groupGetResistanceAdjustedPoisonAttack(AL0537_ui_CreatureType, L0530_i_Attack)) && (_vm->_groupMan->f191_getDamageAllCreaturesOutcome(L0533_ps_Group, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true) != k2_outcomeKilledAllCreaturesInGroup) && (L0530_i_Attack > 2)) {
- _vm->_groupMan->f209_processEvents29to41(L0528_ui_MapX, L0529_ui_MapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
+ if ((L0535_T_GroupThing != Thing::_endOfList) && (L0530_i_Attack = _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(AL0537_ui_CreatureType, L0530_i_Attack)) && (_vm->_groupMan->getDamageAllCreaturesOutcome(L0533_ps_Group, L0528_ui_MapX, L0529_ui_MapY, L0530_i_Attack, true) != k2_outcomeKilledAllCreaturesInGroup) && (L0530_i_Attack > 2)) {
+ _vm->_groupMan->processEvents29to41(L0528_ui_MapX, L0529_ui_MapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
}
}
if (L0532_ps_Explosion->getAttack() >= 6) {
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index b1a60daf53..1e19c223b9 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -277,7 +277,7 @@ void Timeline::f261_processTimeline() {
_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);
+ _vm->_groupMan->processEvents29to41(L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, AL0680_ui_EventType, L0682_s_Event._C._ticks);
} else {
switch (AL0680_ui_EventType) {
case k48_TMEventTypeMoveProjectileIgnoreImpacts:
@@ -428,10 +428,10 @@ 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->getCreatureAttributes(L0599_T_GroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if (((L0599_T_GroupThing = _vm->_groupMan->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->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);
+ if (_vm->_groupMan->getDamageAllCreaturesOutcome((Group*)_vm->_dungeonMan->getThingData(L0599_T_GroupThing), L0593_ui_MapX, L0594_ui_MapY, 5, true) != k2_outcomeKilledAllCreaturesInGroup) {
+ _vm->_groupMan->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);
L0597_puc_Square->setDoorState(L0596_i_DoorState);
@@ -481,7 +481,7 @@ void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) {
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->getCreatureAttributes(L0606_T_Thing), k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if (((L0606_T_Thing = _vm->_groupMan->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 {
@@ -557,7 +557,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
_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) {
+ if ((L0645_T_Thing = _vm->_groupMan->groupGetThing(mapX, mapY)) != Thing::_endOfList) {
_vm->_moveSens->f267_getMoveResult(L0645_T_Thing, mapX, mapY, mapX, mapY);
}
L0645_T_Thing = _vm->_dungeonMan->getSquareFirstObject(mapX, mapY);
@@ -838,7 +838,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
if (AL0618_ui_HealthMultiplier == 0) {
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);
+ _vm->_groupMan->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->getAttrAudibleA()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L0616_ui_MapX, L0617_ui_MapY, k1_soundModePlayIfPrioritized);
}
@@ -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->_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 (((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) || (L0656_ui_MapX != _vm->_dungeonMan->_partyMapX) || (L0657_ui_MapY != _vm->_dungeonMan->_partyMapY)) && (_vm->_groupMan->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);
}
@@ -901,7 +901,7 @@ T0252001:
case 3:
L0657_ui_MapY++;
}
- if (_vm->_groupMan->f223_isSquareACorridorTeleporterPitOrDoor(L0656_ui_MapX, L0657_ui_MapY))
+ if (_vm->_groupMan->isSquareACorridorTeleporterPitOrDoor(L0656_ui_MapX, L0657_ui_MapY))
goto T0252001;
}
}