aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/group.cpp
diff options
context:
space:
mode:
authorBendegúz Nagy2016-07-12 07:56:59 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit9aa6c28fabd95d3aeaf5840386fb5d3327247d62 (patch)
treec23daa36db754528c9af372d7119e825b72a5924 /engines/dm/group.cpp
parente8342f2d2abe58f03788c6db3302f6b29ac1bfe4 (diff)
downloadscummvm-rg350-9aa6c28fabd95d3aeaf5840386fb5d3327247d62.tar.gz
scummvm-rg350-9aa6c28fabd95d3aeaf5840386fb5d3327247d62.tar.bz2
scummvm-rg350-9aa6c28fabd95d3aeaf5840386fb5d3327247d62.zip
DM: Add f245_timlineProcessEvent5_squareCorridor
Diffstat (limited to 'engines/dm/group.cpp')
-rw-r--r--engines/dm/group.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index a39065bbba..73c21198ac 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1766,4 +1766,47 @@ void GroupMan::f195_addAllActiveGroups() {
}
}
}
+
+Thing GroupMan::f185_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;
+ uint16 L0352_ui_GroupCells = 0;
+ Group* L0353_ps_Group;
+ CreatureInfo* L0354_ps_CreatureInfo;
+ bool L0355_B_SeveralCreaturesInGroup;
+
+
+ if (((_g377_currActiveGroupCount >= (_vm->_groupMan->_g376_maxActiveGroupCount - 5)) && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex)) || ((L0349_T_GroupThing = _vm->_dungeonMan->f166_getUnusedThing(k4_GroupThingType)) == Thing::_none)) {
+ return Thing::_none;
+ }
+ L0353_ps_Group = (Group*)_vm->_dungeonMan->f156_getThingData(L0349_T_GroupThing);
+ L0353_ps_Group->_slot = Thing::_endOfList;
+ L0353_ps_Group->setDoNotDiscard(false);
+ L0353_ps_Group->setDir(dir);
+ L0353_ps_Group->setCount(creatureCount);
+ if (L0355_B_SeveralCreaturesInGroup = creatureCount) {
+ L0351_ui_Cell = _vm->getRandomNumber(4);
+ } else {
+ L0352_ui_GroupCells = k255_CreatureTypeSingleCenteredCreature;
+ }
+ L0354_ps_CreatureInfo = &g243_CreatureInfo[L0353_ps_Group->_type = creatureType];
+ L0350_ui_BaseHealth = L0354_ps_CreatureInfo->_baseHealth;
+ 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++);
+ if (getFlag(L0354_ps_CreatureInfo->_attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
+ L0351_ui_Cell++;
+ }
+ L0351_ui_Cell &= 0x0003;
+ }
+ } while (creatureCount--);
+ L0353_ps_Group->_cells = L0352_ui_GroupCells;
+ if (_vm->_movsens->f267_getMoveResult(L0349_T_GroupThing, kM1_MapXNotOnASquare, 0, mapX, mapY)) { /* If F0267_MOVE_GetMoveResult_CPSCE returns true then the group was either killed by a projectile impact (in which case the thing data was marked as unused) or the party is on the destination square and an event is created to move the creature into the dungeon later (in which case the thing is referenced in the event) */
+ return Thing::_none;
+ }
+ warning(false, "MISSING CODE: F0064_SOUND_RequestPlay_CPSD");
+ return L0349_T_GroupThing;
+}
}