aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp10
-rw-r--r--engines/dm/champion.h50
-rw-r--r--engines/dm/menus.cpp26
-rw-r--r--engines/dm/movesens.cpp2
4 files changed, 46 insertions, 42 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index ea48f85ea9..6b895063ea 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -764,7 +764,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
for (int16 woundIndex = kDMSlotReadyHand; woundIndex <= kDMSlotFeet; woundIndex++) {
if (allowedWounds & (1 << woundIndex)) {
woundCount++;
- defense += getWoundDefense(champIndex, woundIndex | ((attackType == kDMAttackTypeSharp) ? k0x8000_maskUseSharpDefense : k0x0000_maskDoNotUseSharpDefense));
+ defense += getWoundDefense(champIndex, woundIndex | ((attackType == kDMAttackTypeSharp) ? kDMMaskSharpDefense : kDMMaskNoSharpDefense));
}
}
if (woundCount)
@@ -843,9 +843,9 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
static const byte woundDefenseFactor[6] = {5, 5, 4, 6, 3, 1}; // @ G0050_auc_Graphic562_WoundDefenseFactor
Champion *curChampion = &_champions[champIndex];
- bool useSharpDefense = getFlag(woundIndex, k0x8000_maskUseSharpDefense);
+ bool useSharpDefense = getFlag(woundIndex, kDMMaskSharpDefense);
if (useSharpDefense)
- clearFlag(woundIndex, k0x8000_maskUseSharpDefense);
+ clearFlag(woundIndex, kDMMaskSharpDefense);
uint16 armorShieldDefense = 0;
for (int16 slotIndex = kDMSlotReadyHand; slotIndex <= kDMSlotActionHand; slotIndex++) {
@@ -1164,9 +1164,9 @@ void ChampionMan::deleteScent(uint16 scentIndex) {
void ChampionMan::addScentStrength(int16 mapX, int16 mapY, int32 cycleCount) {
int16 scentIndex = _party._scentCount;
if (scentIndex) {
- bool mergeFl = getFlag(cycleCount, k0x8000_mergeCycles);
+ bool mergeFl = getFlag(cycleCount, kDMMaskMergeCycles);
if (mergeFl)
- clearFlag(cycleCount, k0x8000_mergeCycles);
+ clearFlag(cycleCount, kDMMaskMergeCycles);
Scent newScent; /* BUG0_00 Useless code */
newScent.setMapX(mapX); /* BUG0_00 Useless code */
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index 013f118d6e..2eb4d28299 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -348,10 +348,6 @@ enum AttackType {
kDMAttackTypeLightning = 7 // @ C7_ATTACK_LIGHTNING
};
-#define k0x0000_maskDoNotUseSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
-#define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
-#define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
-
enum SpellCastResult {
kDMSpellCastFailure = 0, // @ C0_SPELL_CAST_FAILURE
kDMSpellCastSuccess = 1, // @ C1_SPELL_CAST_SUCCESS
@@ -365,25 +361,33 @@ enum SpellFailure {
kDMFailureNeedsMagicMapInHand = 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
};
-#define k1_spellKindPotion 1 // @ C1_SPELL_KIND_POTION
-#define k2_spellKindProjectile 2 // @ C2_SPELL_KIND_PROJECTILE
-#define k3_spellKindOther 3 // @ C3_SPELL_KIND_OTHER
-#define k4_spellKindMagicMap 4 // @ C4_SPELL_KIND_MAGIC_MAP
-
-#define k4_spellType_projectileOpenDoor 4 // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
-#define k0_spellType_otherLight 0 // @ C0_SPELL_TYPE_OTHER_LIGHT
-#define k1_spellType_otherDarkness 1 // @ C1_SPELL_TYPE_OTHER_DARKNESS
-#define k2_spellType_otherThievesEye 2 // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
-#define k3_spellType_otherInvisibility 3 // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
-#define k4_spellType_otherPartyShield 4 // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
-#define k5_spellType_otherMagicTorch 5 // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
-#define k6_spellType_otherFootprints 6 // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
-#define k7_spellType_otherZokathra 7 // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
-#define k8_spellType_otherFireshield 8 // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
-#define k0_spellType_magicMap0 0 // @ C0_SPELL_TYPE_MAGIC_MAP
-#define k1_spellType_magicMap1 1 // @ C1_SPELL_TYPE_MAGIC_MAP
-#define k2_spellType_magicMap2 2 // @ C2_SPELL_TYPE_MAGIC_MAP
-#define k3_spellType_magicMap3 3 // @ C3_SPELL_TYPE_MAGIC_MAP
+enum SpellKind {
+ kDMSpellKindPotion = 1, // @ C1_SPELL_KIND_POTION
+ kDMSpellKindProjectile = 2, // @ C2_SPELL_KIND_PROJECTILE
+ kDMSpellKindOther = 3, // @ C3_SPELL_KIND_OTHER
+ kDMSpellKindMagicMap = 4 // @ C4_SPELL_KIND_MAGIC_MAP
+};
+
+enum SpellType {
+ kDMSpellTypeProjectileOpenDoor = 4, // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
+ kDMSpellTypeOtherLight = 0, // @ C0_SPELL_TYPE_OTHER_LIGHT
+ kDMSpellTypeOtherDarkness = 1, // @ C1_SPELL_TYPE_OTHER_DARKNESS
+ kDMSpellTypeOtherThievesEye = 2, // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
+ kDMSpellTypeOtherInvisibility = 3, // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
+ kDMSpellTypeOtherPartyShield = 4, // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
+ kDMSpellTypeOtherMagicTorch = 5, // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
+ kDMSpellTypeOtherFootprints = 6, // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
+ kDMSpellTypeOtherZokathra = 7, // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
+ kDMSpellTypeOtherFireshield = 8, // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
+ kDMSpellTypeMagicMap0 = 0, // @ C0_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap1 = 1, // @ C1_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap2 = 2, // @ C2_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap3 = 3 // @ C3_SPELL_TYPE_MAGIC_MAP
+};
+
+#define kDMMaskNoSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
+#define kDMMaskSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
+#define kDMMaskMergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
class Skill {
public:
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 3454379fae..e3bc0880b1 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -548,7 +548,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
}
}
switch (curSpell->getKind()) {
- case k1_spellKindPotion: {
+ case kDMSpellKindPotion: {
Thing newObject;
Potion *newPotion = getEmptyFlaskInHand(curChampion, &newObject);
if (!newPotion) {
@@ -566,24 +566,24 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
}
}
break;
- case k2_spellKindProjectile:
+ case kDMSpellKindProjectile:
if (curChampion->_dir != _vm->_dungeonMan->_partyDir) {
curChampion->_dir = _vm->_dungeonMan->_partyDir;
setFlag(curChampion->_attributes, kDMAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
- if (curSpell->getType() == k4_spellType_projectileOpenDoor)
+ if (curSpell->getType() == kDMSpellTypeProjectileOpenDoor)
skillLevel <<= 1;
_vm->_championMan->isProjectileSpellCast(champIndex, Thing(curSpell->getType() + Thing::_firstExplosion.toUint16()), getBoundedValue(21, (powerSymbolOrdinal + 2) * (4 + (skillLevel << 1)), 255), 0);
break;
- case k3_spellKindOther: {
+ case kDMSpellKindOther: {
TimelineEvent newEvent;
newEvent._priority = 0;
uint16 spellPower = (powerSymbolOrdinal + 1) << 2;
uint16 ticks;
switch (curSpell->getType()) {
- case k0_spellType_otherLight: {
+ case kDMSpellTypeOtherLight: {
ticks = 10000 + ((spellPower - 8) << 9);
uint16 lightPower = (spellPower >> 1);
lightPower--;
@@ -591,7 +591,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
createEvent70_light(-lightPower, ticks);
}
break;
- case k5_spellType_otherMagicTorch: {
+ case kDMSpellTypeOtherMagicTorch: {
ticks = 2000 + ((spellPower - 3) << 7);
uint16 lightPower = (spellPower >> 2);
lightPower++;
@@ -599,13 +599,13 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
createEvent70_light(-lightPower, ticks);
}
break;
- case k1_spellType_otherDarkness: {
+ case kDMSpellTypeOtherDarkness: {
uint16 lightPower = (spellPower >> 2);
_vm->_championMan->_party._magicalLightAmount -= _vm->_championMan->_lightPowerToLightAmount[lightPower];
createEvent70_light(lightPower, 98);
}
break;
- case k2_spellType_otherThievesEye: {
+ case kDMSpellTypeOtherThievesEye: {
newEvent._type = k73_TMEventTypeThievesEye;
_vm->_championMan->_party._event73Count_ThievesEye++;
spellPower = (spellPower >> 1);
@@ -614,7 +614,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
- case k3_spellType_otherInvisibility: {
+ case kDMSpellTypeOtherInvisibility: {
newEvent._type = k71_TMEventTypeInvisibility;
_vm->_championMan->_party._event71Count_Invisibility++;
uint16 spellTicks = spellPower;
@@ -622,7 +622,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
- case k4_spellType_otherPartyShield: {
+ case kDMSpellTypeOtherPartyShield: {
newEvent._type = k74_TMEventTypePartyShield;
newEvent._B._defense = spellPower;
if (_vm->_championMan->_party._shieldDefense > 50)
@@ -635,7 +635,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
- case k6_spellType_otherFootprints: {
+ case kDMSpellTypeOtherFootprints: {
newEvent._type = k79_TMEventTypeFootprints;
_vm->_championMan->_party._event79Count_Footprints++;
_vm->_championMan->_party._firstScentIndex = _vm->_championMan->_party._scentCount;
@@ -649,7 +649,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
- case k7_spellType_otherZokathra: {
+ case kDMSpellTypeOtherZokathra: {
Thing unusedObject = _vm->_dungeonMan->getUnusedThing(k10_JunkThingType);
if (unusedObject == Thing::_none)
break;
@@ -672,7 +672,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
}
break;
- case k8_spellType_otherFireshield:
+ case kDMSpellTypeOtherFireshield:
isPartySpellOrFireShieldSuccessful(curChampion, false, (spellPower * spellPower) + 100, false);
break;
default:
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 815442a6c7..bca61fe5bb 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -402,7 +402,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_championMan->_party._scents[scentIndex].setMapY(destMapY);
_vm->_championMan->_party._scents[scentIndex].setMapIndex(mapIndexDestination);
_vm->_championMan->_party._scentStrengths[scentIndex] = 0;
- _vm->_championMan->addScentStrength(destMapX, destMapY, k0x8000_mergeCycles | 24);
+ _vm->_championMan->addScentStrength(destMapX, destMapY, kDMMaskMergeCycles | 24);
destinationSquareData = oldDestinationSquare;
}
if (mapIndexDestination != mapIndexSource)