aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-09-18 11:18:11 +0200
committerStrangerke2016-09-18 11:18:11 +0200
commitebe014f4be5ef81c95b8c2bdae7928b18ce61c1c (patch)
treec2e62cab67074430d48d45bde4113e541f79bfd8 /engines
parenta6d71c941d9ee2c63f7af6f447862c172544f843 (diff)
downloadscummvm-rg350-ebe014f4be5ef81c95b8c2bdae7928b18ce61c1c.tar.gz
scummvm-rg350-ebe014f4be5ef81c95b8c2bdae7928b18ce61c1c.tar.bz2
scummvm-rg350-ebe014f4be5ef81c95b8c2bdae7928b18ce61c1c.zip
DM: Rename Creature masks, move SoundMode to sound.h
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/gfx.cpp2
-rw-r--r--engines/dm/group.cpp38
-rw-r--r--engines/dm/group.h33
-rw-r--r--engines/dm/menus.cpp2
-rw-r--r--engines/dm/movesens.cpp4
-rw-r--r--engines/dm/projexpl.cpp8
-rw-r--r--engines/dm/sounds.h7
-rw-r--r--engines/dm/timeline.cpp4
8 files changed, 49 insertions, 49 deletions
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 974e949df3..9195258f08 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3283,7 +3283,7 @@ T0115015_DrawProjectileAsObject:
activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()];
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
creatureAspectStruct = &_creatureAspects219[creatureInfo->_creatureAspectIndex];
- creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size);
+ creatureSize = getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
creatureGraphicInfoGreen = creatureInfo->_graphicInfo;
}
objectAspect = (ObjectAspect *)creatureAspectStruct;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 364523fbc0..95d118808d 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -110,7 +110,7 @@ int16 GroupMan::getCreatureOrdinalInCell(Group *group, uint16 cell) {
int retval = 0;
byte creatureIndex = group->getCount();
- if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
+ if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize) == k1_MaskCreatureSizeHalf) {
if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
cell = _vm->turnDirLeft(cell);
@@ -140,7 +140,7 @@ uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, SoundMode soundMode) {
Group *group = (Group *)_vm->_dungeonMan->getThingData(groupThing);
CreatureType creatureType = group->_type;
- if ((soundMode != kDMSoundModeDoNotPlaySound) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
+ if ((soundMode != kDMSoundModeDoNotPlaySound) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, kDMCreatureMaskDropFixedPoss)) {
int16 creatureIndex = group->getCount();
uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
do {
@@ -388,7 +388,7 @@ Thing GroupMan::groupGetThing(int16 mapX, int16 mapY) {
int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex, int16 mapX, int16 mapY, int16 damage, bool notMoving) {
CreatureType creatureType = group->_type;
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[creatureType];
- if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) /* Lord Chaos cannot be damaged */
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskArchenemy)) /* Lord Chaos cannot be damaged */
return k0_outcomeKilledNoCreaturesInGroup;
if (group->_health[creatureIndex] <= damage) {
@@ -405,7 +405,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
retVal = k2_outcomeKilledAllCreaturesInGroup;
} else { /* If there are several creatures in the group */
uint16 groupDirections = getGroupDirections(group, _vm->_dungeonMan->_currMapIndex);
- if (getFlag(creatureInfo->_attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskDropFixedPoss)) {
if (notMoving)
dropCreatureFixedPossessions(creatureType, mapX, mapY, cell, kDMSoundModePlayOneTickLater);
else
@@ -466,7 +466,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
retVal = k1_outcomeKilledSomeCreaturesInGroup;
}
- uint16 creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size);
+ uint16 creatureSize = getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
uint16 attack;
if (creatureSize == kDMCreatureSizeQuarter)
attack = 110;
@@ -619,7 +619,7 @@ T0209005_AddEventAndReturn:
return;
}
/* If the creature is Lord Chaos then ignore the event if the game is won. Initialize data to analyze Fluxcages */
- bool isArchEnemy = getFlag(creatureInfo._attributes, k0x2000_MaskCreatureInfo_archenemy);
+ bool isArchEnemy = getFlag(creatureInfo._attributes, kDMCreatureMaskArchenemy);
if (isArchEnemy) {
if (_vm->_gameWon)
return;
@@ -662,7 +662,7 @@ T0209005_AddEventAndReturn:
}
AL0447_i_Behavior = curGroup->getBehaviour();
uint16 creatureCount = curGroup->getCount();
- int16 creatureSize = getFlag(creatureInfo._attributes, k0x0003_MaskCreatureInfo_size);
+ int16 creatureSize = getFlag(creatureInfo._attributes, kDMCreatureMaskSize);
AL0450_i_DistanceXToParty = ABS(eventMapX - _vm->_dungeonMan->_partyMapX);
AL0451_i_DistanceYToParty = ABS(eventMapY - _vm->_dungeonMan->_partyMapY);
_currentGroupMapX = eventMapX;
@@ -977,14 +977,14 @@ T0209096_SetBehavior0_Wander:
}
/* If the creature can see the party and is looking in the party direction or can attack in all direction */
if (distanceToVisibleParty &&
- (getFlag(creatureInfo._attributes, k0x0004_MaskCreatureInfo_sideAttack) ||
+ (getFlag(creatureInfo._attributes, kDMCreatureMaskSideAttack) ||
getCreatureValue(activeGroup->_directions, AL0447_i_CreatureIndex) == primaryDirectionToOrFromParty)) {
/* If the creature is in range to attack the party and random test succeeds */
if ((distanceToVisibleParty <= (AL0446_i_Range = creatureInfo.getAttackRange())) &&
(!AL0450_i_DistanceXToParty || !AL0451_i_DistanceYToParty) &&
(AL0446_i_Range <= (_vm->getRandomNumber(16) + 1))) {
if ((AL0446_i_Range == 1) &&
- (!getFlag(AL0446_i_CreatureAttributes = creatureInfo._attributes, k0x0008_MaskCreatureInfo_preferBackRow) || !_vm->getRandomNumber(4) || !getFlag(AL0446_i_CreatureAttributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) &&
+ (!getFlag(AL0446_i_CreatureAttributes = creatureInfo._attributes, kDMCreatureMaskPreferBackRow) || !_vm->getRandomNumber(4) || !getFlag(AL0446_i_CreatureAttributes, kDMCreatureMaskAttackAnyChamp)) &&
(creatureSize == kDMCreatureSizeQuarter) &&
(activeGroup->_cells != k255_CreatureTypeSingleCenteredCreature) &&
((AL0446_i_Cell = getCreatureValue(activeGroup->_cells, AL0447_i_CreatureIndex)) != primaryDirectionToOrFromParty) &&
@@ -1073,13 +1073,13 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
((mapY >= 0) && (mapY < _vm->_dungeonMan->_currMapHeight)) &&
(curSquareType != kDMElementTypeWall) &&
(curSquareType != kDMElementTypeStairs) &&
- ((curSquareType != kDMElementTypePit) || (getFlag(curSquare, kDMSquareMaskPitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(curSquare, kDMSquareMaskPitOpen) || getFlag(creatureInfo->_attributes, k0x0020_MaskCreatureInfo_levitation)) &&
+ ((curSquareType != kDMElementTypePit) || (getFlag(curSquare, kDMSquareMaskPitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(curSquare, kDMSquareMaskPitOpen) || getFlag(creatureInfo->_attributes, kDMCreatureMaskLevitation)) &&
((curSquareType != kDMElementTypeFakeWall) || getFlag(curSquare, kDMSquareMaskFakeWallOpen) || (getFlag(curSquare, kDMSquareMaskFakeWallImaginary) && allowMovementOverImaginaryPitsAndFakeWalls)));
if (_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter)
return false;
- if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskArchenemy)) {
Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
while (curThing != Thing::_endOfList) {
if ((curThing).getType() == kDMThingTypeExplosion) {
@@ -1108,7 +1108,7 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
if (curSquareType == kDMElementTypeDoor) {
Teleporter *curTeleporter = (Teleporter *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY);
- if (((Square(curSquare).getDoorState()) > (((Door *)curTeleporter)->opensVertically() ? CreatureInfo::getHeight(creatureInfo->_attributes) : 1)) && ((Square(curSquare).getDoorState()) != kDMDoorStateDestroyed) && !getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if (((Square(curSquare).getDoorState()) > (((Door *)curTeleporter)->opensVertically() ? CreatureInfo::getHeight(creatureInfo->_attributes) : 1)) && ((Square(curSquare).getDoorState()) != kDMDoorStateDestroyed) && !getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)) {
_groupMovementBlockedByDoor = true;
return false;
}
@@ -1125,13 +1125,13 @@ int16 GroupMan::getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 de
int16 GroupMan::groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY) {
uint16 groupDirections;
CreatureInfo *groupCreatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
- if (_vm->_championMan->_party._event71Count_Invisibility && !getFlag(groupCreatureInfo->_attributes, k0x0800_MaskCreatureInfo_seeInvisible))
+ if (_vm->_championMan->_party._event71Count_Invisibility && !getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskSeeInvisible))
return 0;
bool alwaysSee = false;
int16 checkDirectionsCount; /* Count of directions to test in L0425_ai_CreatureViewDirections */
int16 creatureViewDirections[4]; /* List of directions to test */
- if (getFlag(groupCreatureInfo->_attributes, k0x0004_MaskCreatureInfo_sideAttack)) { /* If creature can see in all directions */
+ if (getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskSideAttack)) { /* If creature can see in all directions */
alwaysSee = true;
checkDirectionsCount = 1;
creatureViewDirections[0] = kDMDirNorth;
@@ -1161,7 +1161,7 @@ int16 GroupMan::groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex
while (checkDirectionsCount--) {
if (alwaysSee || isDestVisibleFromSource(creatureViewDirections[checkDirectionsCount], mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) {
int16 sightRange = groupCreatureInfo->getSightRange();
- if (!getFlag(groupCreatureInfo->_attributes, k0x1000_MaskCreatureInfo_nightVision))
+ if (!getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskNightVision))
sightRange -= _vm->_displayMan->_dungeonViewPaletteIndex >> 1;
if (_currGroupDistanceToParty > MAX<int16>(1, sightRange))
@@ -1478,7 +1478,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
_vm->_projexpl->createProjectile(projectileThing, mapX, mapY, targetCell, (Direction)_currGroupPrimaryDirToParty, CLIP<byte>(20, kineticEnergy, 255), creatureInfo->_dexterity, 8);
} else {
int16 championIndex;
- if (getFlag(creatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskAttackAnyChamp)) {
championIndex = _vm->getRandomNumber(4);
int cpt;
for (cpt = 0; (cpt < 4) && !_vm->_championMan->_champions[championIndex]._currHealth; cpt++)
@@ -1752,7 +1752,7 @@ Thing GroupMan::groupGetGenerated(CreatureType creatureType, int16 healthMultipl
group->_health[creatureCount] = (baseHealth * healthMultiplier) + _vm->getRandomNumber((baseHealth >> 2) + 1);
if (severalCreaturesInGroup) {
groupCells = getGroupValueUpdatedWithCreatureValue(groupCells, creatureCount, cell++);
- if (getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf)
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskSize) == k1_MaskCreatureSizeHalf)
cell++;
cell &= 0x0003;
@@ -1814,7 +1814,7 @@ int16 GroupMan::getMeleeActionDamage(Champion *champ, int16 champIndex, Group *g
if (actionHitsNonMaterialCreatures)
clearFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures);
- if ((!getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial) || actionHitsNonMaterialCreatures) &&
+ if ((!getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial) || actionHitsNonMaterialCreatures) &&
((_vm->_championMan->getDexterity(champ) > (_vm->getRandomNumber(32) + creatureInfo->_dexterity + doubledMapDifficulty - 16)) ||
(!_vm->getRandomNumber(4)) ||
(_vm->_championMan->isLucky(champ, 75 - actionHitProbability)))) {
@@ -1854,7 +1854,7 @@ T0231009:
L0565_i_Damage >>= 2;
L0565_i_Damage += _vm->getRandomNumber(4) + 1;
if ((actionHandObjectIconIndex == kDMIconIndiceWeaponVorpalBlade)
- && !getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)
+ && !getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)
&& !(L0565_i_Damage >>= 1))
goto T0231015;
diff --git a/engines/dm/group.h b/engines/dm/group.h
index 8d63bd7d44..08ce611464 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -29,6 +29,7 @@
#define DM_GROUP_H
#include "dm/dm.h"
+#include "dm/sounds.h"
namespace DM {
class Champion;
@@ -73,30 +74,22 @@ enum CreatureSize {
k2_MaskCreatureSizeFull = 2 // @ C2_SIZE_FULL_SQUARE
};
-#define k0x0003_MaskCreatureInfo_size 0x0003 // @ MASK0x0003_SIZE
-#define k0x0004_MaskCreatureInfo_sideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK
-#define k0x0008_MaskCreatureInfo_preferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW
-#define k0x0010_MaskCreatureInfo_attackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION
-#define k0x0020_MaskCreatureInfo_levitation 0x0020 // @ MASK0x0020_LEVITATION
-#define k0x0040_MaskCreatureInfo_nonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL
-#define k0x0200_MaskCreatureInfo_dropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS
-#define k0x0400_MaskCreatureInfo_keepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
-#define k0x0800_MaskCreatureInfo_seeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE
-#define k0x1000_MaskCreatureInfo_nightVision 0x1000 // @ MASK0x1000_NIGHT_VISION
-#define k0x2000_MaskCreatureInfo_archenemy 0x2000 // @ MASK0x2000_ARCHENEMY
-#define k0x4000_MaskCreatureInfo_magicmap 0x4000 // @ MASK0x4000_MAGICMAP
-
+#define kDMCreatureMaskSize 0x0003 // @ MASK0x0003_SIZE
+#define kDMCreatureMaskSideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK
+#define kDMCreatureMaskPreferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW
+#define kDMCreatureMaskAttackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION
+#define kDMCreatureMaskLevitation 0x0020 // @ MASK0x0020_LEVITATION
+#define kDMCreatureMaskNonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL
+#define kDMCreatureMaskDropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS
+#define kDMCreatureMaskKeepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
+#define kDMCreatureMaskSeeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE
+#define kDMCreatureMaskNightVision 0x1000 // @ MASK0x1000_NIGHT_VISION
+#define kDMCreatureMaskArchenemy 0x2000 // @ MASK0x2000_ARCHENEMY
+#define kDMCreatureMaskMagicMap 0x4000 // @ MASK0x4000_MAGICMAP
#define k0x0040_MaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP
#define k0x0080_MaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING
-enum SoundMode {
- kDMSoundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
- kDMSoundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
- kDMSoundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
- kDMSoundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
-};
-
class ActiveGroup {
public:
int16 _groupThingIndex;
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 2e5f92f993..4a41136395 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -1502,7 +1502,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
break;
}
- if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
+ if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), kDMCreatureMaskNonMaterial))
return false;
uint16 actionHitProbability = actionHitProbabilityArray[actionIndex];
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index ee9b9e9788..b80f006e8c 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -487,7 +487,7 @@ bool MovesensMan::isLevitating(Thing thing) {
ThingType thingType = thing.getType();
bool retVal = false;
if (thingType == kDMThingTypeGroup)
- retVal = getFlag(_vm->_dungeonMan->getCreatureAttributes(thing), k0x0020_MaskCreatureInfo_levitation);
+ retVal = getFlag(_vm->_dungeonMan->getCreatureAttributes(thing), kDMCreatureMaskLevitation);
else if ((thingType == kDMThingTypeProjectile) || (thingType == kDMThingTypeExplosion))
// Fix original bug involving explosions falling in pits
retVal = true;
@@ -655,7 +655,7 @@ int16 MovesensMan::getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing
uint16 updatedGroupCells = _vm->_groupMan->getGroupCells(group, mapIndex);
if (updatedGroupCells != k255_CreatureTypeSingleCenteredCreature) {
int16 groupCells = updatedGroupCells;
- int16 creatureSize = getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, k0x0003_MaskCreatureInfo_size);
+ int16 creatureSize = getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize);
int16 relativeRotation = _vm->normalizeModulo4(4 + updatedGroupDirections - groupDirections);
for (int16 creatureIdx = 0; creatureIdx <= group->getCount(); creatureIdx++) {
updatedGroupDirections = _vm->_groupMan->getGroupValueUpdatedWithCreatureValue(updatedGroupDirections, creatureIdx, absoluteRotation ? (uint16)rotation : _vm->normalizeModulo4(groupDirections + rotation));
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index d19247b4e7..33ae021280 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -170,7 +170,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
*curCreatureHealth = MIN(1000, *curCreatureHealth + getProjectileImpactAttack(projectileThingData, projectileAssociatedThing));
goto T0217044;
}
- if (getFlag(curCreatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial) && (projectileAssociatedThing != Thing::_explHarmNonMaterial))
+ if (getFlag(curCreatureInfo->_attributes, kDMCreatureMaskNonMaterial) && (projectileAssociatedThing != Thing::_explHarmNonMaterial))
return false;
attack = (uint16)((unsigned long)getProjectileImpactAttack(projectileThingData, projectileAssociatedThing) << 6) / curCreatureInfo->_defense;
@@ -182,7 +182,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
_creatureDamageOutcome = outcome;
if (!createExplosionOnImpact && (outcome == k0_outcomeKilledNoCreaturesInGroup)
&& (projectileAssociatedThingType == kDMThingTypeWeapon)
- && getFlag(curCreatureInfo->_attributes, k0x0400_MaskCreatureInfo_keepThrownSharpWeapon)) {
+ && getFlag(curCreatureInfo->_attributes, kDMCreatureMaskKeepThrownSharpWeapon)) {
Weapon *weapon = (Weapon *)_vm->_dungeonMan->getThingData(projectileAssociatedThing);
WeaponType weaponType = weapon->getType();
if ((weaponType == kDMWeaponDagger) || (weaponType == kDMWeaponArrow)
@@ -334,7 +334,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[creatureGroup->_type];
int16 creatureFireResistance = creatureInfo->getFireResistance();
if (creatureFireResistance != kDMImmuneToFire) {
- if (getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial))
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial))
attack >>= 2;
if ((attack -= _vm->getRandomNumber((creatureFireResistance << 1) + 1)) > 0)
@@ -508,7 +508,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFF83:
- if ((groupThing != Thing::_endOfList) && getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if ((groupThing != Thing::_endOfList) && getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)) {
if ((creatureType == kDMCreatureTypeMaterializerZytaz) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) {
int16 nonMaterialAdditionalAttack = attack >> 3;
attack -= nonMaterialAdditionalAttack;
diff --git a/engines/dm/sounds.h b/engines/dm/sounds.h
index 92b9340dbd..fe0c0f446f 100644
--- a/engines/dm/sounds.h
+++ b/engines/dm/sounds.h
@@ -32,6 +32,13 @@
namespace DM {
+enum SoundMode {
+ kDMSoundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
+ kDMSoundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
+ kDMSoundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
+ kDMSoundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+};
+
#define k34_D13_soundCount 34 // @ D13_SOUND_COUNT
class SoundData {
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index c502481483..8c3f11c288 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -410,7 +410,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
}
Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
uint16 creatureAttributes = _vm->_dungeonMan->getCreatureAttributes(groupThing);
- if ((groupThing != Thing::_endOfList) && !getFlag(creatureAttributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if ((groupThing != Thing::_endOfList) && !getFlag(creatureAttributes, kDMCreatureMaskNonMaterial)) {
if (doorState >= (verticalDoorFl ? CreatureInfo::getHeight(creatureAttributes) : 1)) { /* Creature height or 1 */
if (_vm->_groupMan->getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(groupThing), mapX, mapY, 5, true) != k2_outcomeKilledAllCreaturesInGroup)
_vm->_groupMan->processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
@@ -460,7 +460,7 @@ void Timeline::processEventSquareFakewall(TimelineEvent *event) {
addEventGetEventIndex(event);
} else {
Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
- if ((groupThing != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(groupThing), k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if ((groupThing != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(groupThing), kDMCreatureMaskNonMaterial)) {
event->_mapTime++;
addEventGetEventIndex(event);
} else