aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorStrangerke2016-09-09 07:12:36 +0200
committerStrangerke2016-09-09 07:12:36 +0200
commit1b482a1e129b2bf00f49a9c4ef5c8d84470be1af (patch)
treefa9cda092a19e49647a092c38900fc5d5dbdaa5a /engines/dm
parentb365338293ab1bbad4deef5f2979639f360d77db (diff)
downloadscummvm-rg350-1b482a1e129b2bf00f49a9c4ef5c8d84470be1af.tar.gz
scummvm-rg350-1b482a1e129b2bf00f49a9c4ef5c8d84470be1af.tar.bz2
scummvm-rg350-1b482a1e129b2bf00f49a9c4ef5c8d84470be1af.zip
DM: Rename enums ChampionIndex, ChampionAttribute, ChampionWound, ChampionStatisticType, ChampionStatisticValue
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp388
-rw-r--r--engines/dm/champion.h96
-rw-r--r--engines/dm/dm.cpp8
-rw-r--r--engines/dm/eventman.cpp106
-rw-r--r--engines/dm/group.cpp2
-rw-r--r--engines/dm/inventory.cpp42
-rw-r--r--engines/dm/menus.cpp46
-rw-r--r--engines/dm/movesens.cpp12
-rw-r--r--engines/dm/projexpl.cpp6
-rw-r--r--engines/dm/timeline.cpp14
10 files changed, 361 insertions, 359 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 6385547433..f550e678dd 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -169,21 +169,21 @@ ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) {
_partyChampionCount = 0;
_partyDead = false;
_leaderHandObject = Thing(0);
- _leaderIndex = kM1_ChampionNone;
+ _leaderIndex = kDMChampionNone;
_candidateChampionOrdinal = 0;
_partyIsSleeping = false;
_actingChampionOrdinal = 0;
_leaderHandObjectIconIndex = (IconIndice)0;
_leaderEmptyHanded = false;
_party.resetToZero();
- _magicCasterChampionIndex = kM1_ChampionNone;
+ _magicCasterChampionIndex = kDMChampionNone;
_mousePointerHiddenToDrawChangedObjIconOnScreen = false;
initConstants();
}
bool ChampionMan::isLeaderHandObjectThrown(int16 side) {
- if (_leaderIndex == kM1_ChampionNone)
+ if (_leaderIndex == kDMChampionNone)
return false;
return isObjectThrown(_leaderIndex, kM1_ChampionSlotLeaderHand, side);
@@ -287,7 +287,7 @@ Common::String ChampionMan::getStringFromInteger(uint16 val, bool padding, uint1
}
void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, int16 iconIndex, int16 modifierFactor, Thing thing) {
- int16 statIndex = k0_ChampionStatLuck;
+ int16 statIndex = kDMChampionStatLuck;
int16 modifier = 0;
ThingType thingType = thing.getType();
@@ -304,7 +304,7 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
if (cursed) {
- statIndex = k0_ChampionStatLuck;
+ statIndex = kDMChampionStatLuck;
modifier = -3;
}
}
@@ -312,53 +312,53 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
if (!cursed) {
statIndex = (ChampionStatisticType)thingType; // variable sharing
- if ((iconIndex == k137_IconIndiceJunkRabbitsFoot) && (slotIndex < k30_ChampionSlotChest_1)) {
- statIndex = k0_ChampionStatLuck;
+ if ((iconIndex == kDMIconIndiceJunkRabbitsFoot) && (slotIndex < k30_ChampionSlotChest_1)) {
+ statIndex = kDMChampionStatLuck;
modifier = 10;
} else if (slotIndex == k1_ChampionSlotActionHand) {
- if (iconIndex == k45_IconIndiceWeaponMaceOfOrder) {
- statIndex = k1_ChampionStatStrength;
+ if (iconIndex == kDMIconIndiceWeaponMaceOfOrder) {
+ statIndex = kDMChampionStatStrength;
modifier = 5;
} else {
- statIndex = k8_ChampionStatMana;
- if ((iconIndex >= k20_IconIndiceWeaponStaffOfClawsEmpty) && (iconIndex <= k22_IconIndiceWeaponStaffOfClawsFull)) {
+ statIndex = kDMChampionStatMana;
+ if ((iconIndex >= kDMIconIndiceWeaponStaffOfClawsEmpty) && (iconIndex <= kDMIconIndiceWeaponStaffOfClawsFull)) {
modifier = 4;
} else {
switch (iconIndex) {
- case k38_IconIndiceWeaponDeltaSideSplitter:
+ case kDMIconIndiceWeaponDeltaSideSplitter:
modifier = 1;
break;
- case k41_IconIndiceWeaponTheInquisitorDragonFang:
+ case kDMIconIndiceWeaponTheInquisitorDragonFang:
modifier = 2;
break;
- case k40_IconIndiceWeaponVorpalBlade:
+ case kDMIconIndiceWeaponVorpalBlade:
modifier = 4;
break;
- case k58_IconIndiceWeaponStaff:
+ case kDMIconIndiceWeaponStaff:
modifier = 2;
break;
- case k59_IconIndiceWeaponWand:
+ case kDMIconIndiceWeaponWand:
modifier = 1;
break;
- case k60_IconIndiceWeaponTeowand:
+ case kDMIconIndiceWeaponTeowand:
modifier = 6;
break;
- case k61_IconIndiceWeaponYewStaff:
+ case kDMIconIndiceWeaponYewStaff:
modifier = 4;
break;
- case k62_IconIndiceWeaponStaffOfManarStaffOfIrra:
+ case kDMIconIndiceWeaponStaffOfManarStaffOfIrra:
modifier = 10;
break;
- case k63_IconIndiceWeaponSnakeStaffCrossOfNeta:
+ case kDMIconIndiceWeaponSnakeStaffCrossOfNeta:
modifier = 8;
break;
- case k64_IconIndiceWeaponTheConduitSerpentStaff:
+ case kDMIconIndiceWeaponTheConduitSerpentStaff:
modifier = 16;
break;
- case k65_IconIndiceWeaponDragonSpit:
+ case kDMIconIndiceWeaponDragonSpit:
modifier = 7;
break;
- case k66_IconIndiceWeaponSceptreOfLyf:
+ case kDMIconIndiceWeaponSceptreOfLyf:
modifier = 5;
break;
default:
@@ -367,18 +367,18 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
}
} else if (slotIndex == k4_ChampionSlotLegs) {
- if (iconIndex == k142_IconIndiceArmourPowertowers) {
- statIndex = k1_ChampionStatStrength;
+ if (iconIndex == kDMIconIndiceArmourPowertowers) {
+ statIndex = kDMChampionStatStrength;
modifier = 10;
}
} else if (slotIndex == k2_ChampionSlotHead) {
switch (iconIndex) {
- case k104_IconIndiceArmourCrownOfNerra:
- statIndex = k3_ChampionStatWisdom;
+ case kDMIconIndiceArmourCrownOfNerra:
+ statIndex = kDMChampionStatWisdom;
modifier = 10;
break;
- case k140_IconIndiceArmourDexhelm:
- statIndex = k2_ChampionStatDexterity;
+ case kDMIconIndiceArmourDexhelm:
+ statIndex = kDMChampionStatDexterity;
modifier = 10;
break;
default:
@@ -386,12 +386,12 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
} else if (slotIndex == k3_ChampionSlotTorso) {
switch (iconIndex) {
- case k141_IconIndiceArmourFlamebain:
- statIndex = k6_ChampionStatAntifire;
+ case kDMIconIndiceArmourFlamebain:
+ statIndex = kDMChampionStatAntifire;
modifier = 12;
break;
- case k81_IconIndiceArmourCloakOfNight:
- statIndex = k2_ChampionStatDexterity;
+ case kDMIconIndiceArmourCloakOfNight:
+ statIndex = kDMChampionStatDexterity;
modifier = 8;
break;
default:
@@ -399,17 +399,17 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
} else if (slotIndex == k10_ChampionSlotNeck) {
switch (iconIndex) {
- case k10_IconIndiceJunkJewelSymalUnequipped:
- case k11_IconIndiceJunkJewelSymalEquipped:
- statIndex = k5_ChampionStatAntimagic;
+ case kDMIconIndiceJunkJewelSymalUnequipped:
+ case kDMIconIndiceJunkJewelSymalEquipped:
+ statIndex = kDMChampionStatAntimagic;
modifier = 15;
break;
- case k81_IconIndiceArmourCloakOfNight:
- statIndex = k2_ChampionStatDexterity;
+ case kDMIconIndiceArmourCloakOfNight:
+ statIndex = kDMChampionStatDexterity;
modifier = 8;
break;
- case k122_IconIndiceJunkMoonstone:
- statIndex = k8_ChampionStatMana;
+ case kDMIconIndiceJunkMoonstone:
+ statIndex = kDMChampionStatMana;
modifier = 3;
break;
default:
@@ -421,10 +421,10 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
if (modifier) {
modifier *= modifierFactor;
//statIndex is set when modifier is set
- if (statIndex == k8_ChampionStatMana) {
+ if (statIndex == kDMChampionStatMana) {
champ->_maxMana += modifier;
- } else if (statIndex < k6_ChampionStatAntifire + 1) {
- for (uint16 statValIndex = k0_ChampionStatMaximum; statValIndex <= k2_ChampionStatMinimum; ++statValIndex) {
+ } else if (statIndex < kDMChampionStatAntifire + 1) {
+ for (uint16 statValIndex = kDMChampionStatMaximum; statValIndex <= kDMChampionStatMinimum; ++statValIndex) {
champ->getStatistic((ChampionStatisticType)statIndex, (ChampionStatisticValue)statValIndex) += modifier;
}
}
@@ -435,9 +435,9 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing)
ObjectMan &objMan = *_vm->_objectMan;
IconIndice currIconIndex = objMan.getIconIndexInSlotBox(slotBoxIndex);
- if (((currIconIndex < k32_IconIndiceWeaponDagger) && (currIconIndex >= k0_IconIndiceJunkCompassNorth))
- || ((currIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (currIconIndex <= k163_IconIndicePotionWaterFlask))
- || (currIconIndex == k195_IconIndicePotionEmptyFlask)) {
+ if (((currIconIndex < kDMIconIndiceWeaponDagger) && (currIconIndex >= kDMIconIndiceJunkCompassNorth))
+ || ((currIconIndex >= kDMIconIndicePotionMaPotionMonPotion) && (currIconIndex <= kDMIconIndicePotionWaterFlask))
+ || (currIconIndex == kDMIconIndicePotionEmptyFlask)) {
IconIndice newIconIndex = objMan.getIconIndex(thing);
if (newIconIndex != currIconIndex) {
if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) {
@@ -464,9 +464,9 @@ void ChampionMan::drawChangedObjectIcons() {
_mousePointerHiddenToDrawChangedObjIconOnScreen = false;
IconIndice leaderHandObjIconIndex = _leaderHandObjectIconIndex;
- if (((leaderHandObjIconIndex < k32_IconIndiceWeaponDagger) && (leaderHandObjIconIndex >= k0_IconIndiceJunkCompassNorth)) // < instead of <= is correct
- || ((leaderHandObjIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (leaderHandObjIconIndex <= k163_IconIndicePotionWaterFlask))
- || (leaderHandObjIconIndex == k195_IconIndicePotionEmptyFlask)) {
+ if (((leaderHandObjIconIndex < kDMIconIndiceWeaponDagger) && (leaderHandObjIconIndex >= kDMIconIndiceJunkCompassNorth)) // < instead of <= is correct
+ || ((leaderHandObjIconIndex >= kDMIconIndicePotionMaPotionMonPotion) && (leaderHandObjIconIndex <= kDMIconIndicePotionWaterFlask))
+ || (leaderHandObjIconIndex == kDMIconIndicePotionEmptyFlask)) {
IconIndice iconIndex = objMan.getIconIndex(_leaderHandObject);
if (iconIndex != leaderHandObjIconIndex) {
_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
@@ -511,7 +511,7 @@ void ChampionMan::drawChangedObjectIcons() {
}
if (drawViewport) {
- champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
+ champ->setAttributeFlag(kDMChampionAttributeViewport, true);
drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
@@ -538,7 +538,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
}
champ->_load += dunMan.getObjectWeight(thing);
- champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
+ champ->setAttributeFlag(kDMChampionAttributeLoad, true);
IconIndice iconIndex = objMan.getIconIndex(thing);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal);
applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
@@ -546,31 +546,31 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if (slotIndex < k2_ChampionSlotHead) {
if (slotIndex == k1_ChampionSlotActionHand) {
- champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
+ champ->setAttributeFlag(kDMChampionAttributeActionHand, true);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
menuMan.clearActingChampion();
- if ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)) {
+ if ((iconIndex >= kDMIconIndiceScrollOpen) && (iconIndex <= kDMIconIndiceScrollClosed)) {
((Scroll *)rawObjPtr)->setClosed(false);
drawChangedObjectIcons();
}
}
- if (iconIndex == k4_IconIndiceWeaponTorchUnlit) {
+ if (iconIndex == kDMIconIndiceWeaponTorchUnlit) {
((Weapon *)rawObjPtr)->setLit(true);
_vm->_inventoryMan->setDungeonViewPalette();
drawChangedObjectIcons();
} else if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand) &&
- ((iconIndex == k144_IconIndiceContainerChestClosed) || ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)))) {
- champ->setAttributeFlag(k0x0800_ChampionAttributePanel, true);
+ ((iconIndex == kDMIconIndiceContainerChestClosed) || ((iconIndex >= kDMIconIndiceScrollOpen) && (iconIndex <= kDMIconIndiceScrollClosed)))) {
+ champ->setAttributeFlag(kDMChampionAttributePanel, true);
}
} else if (slotIndex == k10_ChampionSlotNeck) {
- if ((iconIndex >= k12_IconIndiceJunkIllumuletUnequipped) && (iconIndex <= k13_IconIndiceJunkIllumuletEquipped)) {
+ if ((iconIndex >= kDMIconIndiceJunkIllumuletUnequipped) && (iconIndex <= kDMIconIndiceJunkIllumuletEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
_party._magicalLightAmount += _lightPowerToLightAmount[2];
_vm->_inventoryMan->setDungeonViewPalette();
iconIndex = (IconIndice)(iconIndex + 1);
- } else if ((iconIndex >= k10_IconIndiceJunkJewelSymalUnequipped) && (iconIndex <= k11_IconIndiceJunkJewelSymalEquipped)) {
+ } else if ((iconIndex >= kDMIconIndiceJunkJewelSymalUnequipped) && (iconIndex <= kDMIconIndiceJunkJewelSymalEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
iconIndex = (IconIndice)(iconIndex + 1);
}
@@ -578,7 +578,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
drawSlot(champIndex, slotIndex);
if (isInventoryChampion)
- champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
+ champ->setAttributeFlag(kDMChampionAttributeViewport, true);
}
int16 ChampionMan::getScentOrdinal(int16 mapX, int16 mapY) {
@@ -606,14 +606,14 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() {
if (leaderHandObject != Thing::_none) {
_leaderHandObject = Thing::_none;
- _leaderHandObjectIconIndex = kM1_IconIndiceNone;
+ _leaderHandObjectIconIndex = kDMIconIndiceNone;
_vm->_eventMan->showMouse();
_vm->_objectMan->clearLeaderObjectName();
_vm->_eventMan->setMousePointer();
_vm->_eventMan->hideMouse();
- if (_leaderIndex != kM1_ChampionNone) {
+ if (_leaderIndex != kDMChampionNone) {
_champions[_leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(leaderHandObject);
- setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad);
+ setFlag(_champions[_leaderIndex]._attributes, kDMChampionAttributeLoad);
drawChampionState(_leaderIndex);
}
}
@@ -622,7 +622,7 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() {
uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) {
Champion *curChampion = &_champions[champIndex];
- int16 strength = _vm->getRandomNumber(16) + curChampion->_statistics[k1_ChampionStatStrength][k1_ChampionStatCurrent];
+ int16 strength = _vm->getRandomNumber(16) + curChampion->_statistics[kDMChampionStatStrength][kDMChampionStatCurrent];
Thing curThing = curChampion->_slots[slotIndex];
uint16 objectWeight = _vm->_dungeonMan->getObjectWeight(curThing);
uint16 oneSixteenthMaximumLoad = getMaximumLoad(curChampion) >> 4;
@@ -654,7 +654,7 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) {
strength += skillLevel << 1;
}
strength = getStaminaAdjustedValue(curChampion, strength);
- if (getFlag(curChampion->_wounds, (slotIndex == k0_ChampionSlotReadyHand) ? k0x0001_ChampionWoundReadHand : k0x0002_ChampionWoundActionHand)) {
+ if (getFlag(curChampion->_wounds, (slotIndex == k0_ChampionSlotReadyHand) ? kDMChampionWoundReadHand : kDMChampionWoundActionHand)) {
strength >>= 1;
}
return getBoundedValue(0, strength >> 1, 100);
@@ -682,32 +682,32 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
Weapon *curWeapon = (Weapon *)_vm->_dungeonMan->getThingData(curThing);
if (slotIndex == k10_ChampionSlotNeck) {
- if ((curIconIndex >= k12_IconIndiceJunkIllumuletUnequipped) && (curIconIndex <= k13_IconIndiceJunkIllumuletEquipped)) {
+ if ((curIconIndex >= kDMIconIndiceJunkIllumuletUnequipped) && (curIconIndex <= kDMIconIndiceJunkIllumuletEquipped)) {
((Junk *)curWeapon)->setChargeCount(0);
_party._magicalLightAmount -= _lightPowerToLightAmount[2];
_vm->_inventoryMan->setDungeonViewPalette();
- } else if ((curIconIndex >= k10_IconIndiceJunkJewelSymalUnequipped) && (curIconIndex <= k11_IconIndiceJunkJewelSymalEquipped)) {
+ } else if ((curIconIndex >= kDMIconIndiceJunkJewelSymalUnequipped) && (curIconIndex <= kDMIconIndiceJunkJewelSymalEquipped)) {
((Junk *)curWeapon)->setChargeCount(0);
}
}
drawSlot(champIndex, slotIndex);
if (isInventoryChampion)
- setFlag(curChampion->_attributes, k0x4000_ChampionAttributeViewport);
+ setFlag(curChampion->_attributes, kDMChampionAttributeViewport);
if (slotIndex < k2_ChampionSlotHead) {
if (slotIndex == k1_ChampionSlotActionHand) {
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
_vm->_menuMan->clearActingChampion();
- if ((curIconIndex >= k30_IconIndiceScrollOpen) && (curIconIndex <= k31_IconIndiceScrollClosed)) {
+ if ((curIconIndex >= kDMIconIndiceScrollOpen) && (curIconIndex <= kDMIconIndiceScrollClosed)) {
((Scroll *)curWeapon)->setClosed(true);
drawChangedObjectIcons();
}
}
- if ((curIconIndex >= k4_IconIndiceWeaponTorchUnlit) && (curIconIndex <= k7_IconIndiceWeaponTorchLit)) {
+ if ((curIconIndex >= kDMIconIndiceWeaponTorchUnlit) && (curIconIndex <= kDMIconIndiceWeaponTorchLit)) {
curWeapon->setLit(false);
_vm->_inventoryMan->setDungeonViewPalette();
drawChangedObjectIcons();
@@ -715,12 +715,12 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand)) {
switch (curIconIndex) {
- case k144_IconIndiceContainerChestClosed:
+ case kDMIconIndiceContainerChestClosed:
_vm->_inventoryMan->closeChest();
// No break on purpose
- case k30_IconIndiceScrollOpen:
- case k31_IconIndiceScrollClosed:
- setFlag(curChampion->_attributes, k0x0800_ChampionAttributePanel);
+ case kDMIconIndiceScrollOpen:
+ case kDMIconIndiceScrollClosed:
+ setFlag(curChampion->_attributes, kDMChampionAttributePanel);
break;
default:
break;
@@ -728,12 +728,12 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
}
}
curChampion->_load -= _vm->_dungeonMan->getObjectWeight(curThing);
- setFlag(curChampion->_attributes, k0x0200_ChampionAttributeLoad);
+ setFlag(curChampion->_attributes, kDMChampionAttributeLoad);
return curThing;
}
void ChampionMan::decrementStamina(int16 championIndex, int16 decrement) {
- if (championIndex == kM1_ChampionNone)
+ if (championIndex == kDMChampionNone)
return;
Champion *curChampion = &_champions[championIndex];
@@ -742,12 +742,12 @@ void ChampionMan::decrementStamina(int16 championIndex, int16 decrement) {
int16 stamina = curChampion->_currStamina;
if (stamina <= 0) {
curChampion->_currStamina = 0;
- addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
+ addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, kDMChampionWoundNone, k0_attackType_NORMAL);
} else if (stamina > curChampion->_maxStamina) {
curChampion->_currStamina = curChampion->_maxStamina;
}
- setFlag(curChampion->_attributes, k0x0200_ChampionAttributeLoad | k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeLoad | kDMChampionAttributeStatistics);
}
int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 attack, int16 allowedWounds, uint16 attackType) {
@@ -774,7 +774,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
switch (attackType) {
case k6_attackType_PSYCHIC:
{
- int16 wisdomFactor = 115 - curChampion->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent];
+ int16 wisdomFactor = 115 - curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatCurrent];
if (wisdomFactor <= 0) {
attack = 0;
} else {
@@ -785,12 +785,12 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
}
break;
case k5_attackType_MAGIC:
- attack = getStatisticAdjustedAttack(curChampion, k5_ChampionStatAntimagic, attack);
+ attack = getStatisticAdjustedAttack(curChampion, kDMChampionStatAntimagic, attack);
attack -= _party._spellShieldDefense;
skipScaling = true;
break;
case k1_attackType_FIRE:
- attack = getStatisticAdjustedAttack(curChampion, k6_ChampionStatAntifire, attack);
+ attack = getStatisticAdjustedAttack(curChampion, kDMChampionStatAntifire, attack);
attack -= _party._fireShieldDefense;
break;
case k2_attackType_SELF:
@@ -818,7 +818,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
if (attack <= 0)
return 0;
- int16 adjustedAttack = getStatisticAdjustedAttack(curChampion, k4_ChampionStatVitality, _vm->getRandomNumber(128) + 10);
+ int16 adjustedAttack = getStatisticAdjustedAttack(curChampion, kDMChampionStatVitality, _vm->getRandomNumber(128) + 10);
if (attack > adjustedAttack) {
/* BUG0_45
This bug is not perceptible because of BUG0_41 that ignores Vitality while determining the
@@ -858,7 +858,7 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
}
}
- int16 woundDefense = _vm->getRandomNumber((curChampion->_statistics[k4_ChampionStatVitality][k1_ChampionStatCurrent] >> 3) + 1);
+ int16 woundDefense = _vm->getRandomNumber((curChampion->_statistics[kDMChampionStatVitality][kDMChampionStatCurrent] >> 3) + 1);
if (useSharpDefense)
woundDefense >>= 1;
@@ -881,7 +881,7 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
}
uint16 ChampionMan::getStatisticAdjustedAttack(Champion *champ, uint16 statIndex, uint16 attack) {
- int16 factor = 170 - champ->_statistics[statIndex][k1_ChampionStatCurrent];
+ int16 factor = 170 - champ->_statistics[statIndex][kDMChampionStatCurrent];
/* BUG0_41
The Antifire and Antimagic statistics are completely ignored. The Vitality statistic is ignored
@@ -939,7 +939,7 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
}
_vm->_timeline->deleteEvent(eventIndex);
} else {
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x0008_ChampionAttributeDisableAction);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand | kDMChampionAttributeDisableAction);
drawChampionState((ChampionIndex)champIndex);
}
setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime);
@@ -961,7 +961,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
else
baseSkillIndex = skillIndex;
- uint16 skillLevelBefore = getSkillLevel(champIndex, baseSkillIndex | (k0x4000_IgnoreObjectModifiers | k0x8000_IgnoreTemporaryExperience));
+ uint16 skillLevelBefore = getSkillLevel(champIndex, baseSkillIndex | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience));
if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_lastCreatureAttackTime > _vm->_gameTime - 25))
exp <<= 1;
@@ -975,7 +975,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
if (skillIndex >= k4_ChampionSkillSwing)
curSkill->_experience += exp;
- uint16 skillLevelAfter = getSkillLevel(champIndex, baseSkillIndex | (k0x4000_IgnoreObjectModifiers | k0x8000_IgnoreTemporaryExperience));
+ uint16 skillLevelAfter = getSkillLevel(champIndex, baseSkillIndex | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience));
if (skillLevelAfter > skillLevelBefore) {
int16 newBaseSkillLevel = skillLevelAfter;
int16 minorStatIncrease = _vm->getRandomNumber(2);
@@ -984,34 +984,34 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
if (baseSkillIndex != k2_ChampionSkillPriest) {
vitalityAmount &= skillLevelAfter; /* For non Priest skills the amount is 0 for even skill levels. The amount is 0 or 1 for odd skill levels */
}
- curChampion->_statistics[k4_ChampionStatVitality][k0_ChampionStatMaximum] += vitalityAmount;
+ curChampion->_statistics[kDMChampionStatVitality][kDMChampionStatMaximum] += vitalityAmount;
uint16 staminaAmount = curChampion->_maxStamina;
- curChampion->_statistics[k6_ChampionStatAntifire][k0_ChampionStatMaximum] += _vm->getRandomNumber(2) & ~skillLevelAfter; /* The amount is 0 for odd skill levels. The amount is 0 or 1 for even skill levels */
+ curChampion->_statistics[kDMChampionStatAntifire][kDMChampionStatMaximum] += _vm->getRandomNumber(2) & ~skillLevelAfter; /* The amount is 0 for odd skill levels. The amount is 0 or 1 for even skill levels */
bool increaseManaFl = false;
switch (baseSkillIndex) {
case k0_ChampionSkillFighter:
staminaAmount >>= 4;
skillLevelAfter *= 3;
- curChampion->_statistics[k1_ChampionStatStrength][k0_ChampionStatMaximum] += majorStatIncrease;
- curChampion->_statistics[k2_ChampionStatDexterity][k0_ChampionStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMChampionStatStrength][kDMChampionStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMChampionStatDexterity][kDMChampionStatMaximum] += minorStatIncrease;
break;
case k1_ChampionSkillNinja:
staminaAmount /= 21;
skillLevelAfter <<= 1;
- curChampion->_statistics[k1_ChampionStatStrength][k0_ChampionStatMaximum] += minorStatIncrease;
- curChampion->_statistics[k2_ChampionStatDexterity][k0_ChampionStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMChampionStatStrength][kDMChampionStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMChampionStatDexterity][kDMChampionStatMaximum] += majorStatIncrease;
break;
case k3_ChampionSkillWizard:
staminaAmount >>= 5;
curChampion->_maxMana += skillLevelAfter + (skillLevelAfter >> 1);
- curChampion->_statistics[k3_ChampionStatWisdom][k0_ChampionStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatMaximum] += majorStatIncrease;
increaseManaFl = true;
break;
case k2_ChampionSkillPriest:
staminaAmount /= 25;
curChampion->_maxMana += skillLevelAfter;
skillLevelAfter += (skillLevelAfter + 1) >> 1;
- curChampion->_statistics[k3_ChampionStatWisdom][k0_ChampionStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatMaximum] += minorStatIncrease;
increaseManaFl = true;
break;
default:
@@ -1020,7 +1020,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
if (increaseManaFl) {
if ((curChampion->_maxMana += MIN(_vm->getRandomNumber(4), (uint16)(newBaseSkillLevel - 1))) > 900)
curChampion->_maxMana = 900;
- curChampion->_statistics[k5_ChampionStatAntimagic][k0_ChampionStatMaximum] += _vm->getRandomNumber(3);
+ curChampion->_statistics[kDMChampionStatAntimagic][kDMChampionStatMaximum] += _vm->getRandomNumber(3);
}
if ((curChampion->_maxHealth += skillLevelAfter + _vm->getRandomNumber((skillLevelAfter >> 1) + 1)) > 999)
@@ -1029,7 +1029,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
if ((curChampion->_maxStamina += staminaAmount + _vm->getRandomNumber((staminaAmount >> 1) + 1)) > 9999)
curChampion->_maxStamina = 9999;
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
drawChampionState((ChampionIndex)champIndex);
_vm->_textMan->printLineFeed();
Color curChampionColor = _championColor[champIndex];
@@ -1060,7 +1060,7 @@ int16 ChampionMan::getDamagedChampionCount(uint16 attack, int16 wounds, int16 at
randomMax <<= 1;
int16 damagedChampionCount = 0;
- for (int16 championIndex = k0_ChampionFirst; championIndex < _partyChampionCount; championIndex++) {
+ for (int16 championIndex = kDMChampionFirst; championIndex < _partyChampionCount; championIndex++) {
// Actual attack is attack +/- (attack / 8)
if (addPendingDamageAndWounds_getDamage(championIndex, MAX(1, reducedAttack + _vm->getRandomNumber(randomMax)), wounds, attackType))
damagedChampionCount++;
@@ -1079,11 +1079,11 @@ int16 ChampionMan::getTargetChampionIndex(int16 mapX, int16 mapY, uint16 cell) {
return championIndex;
}
}
- return kM1_ChampionNone;
+ return kDMChampionNone;
}
int16 ChampionMan::getDexterity(Champion *champ) {
- int16 dexterity = _vm->getRandomNumber(8) + champ->_statistics[k2_ChampionStatDexterity][k1_ChampionStatCurrent];
+ int16 dexterity = _vm->getRandomNumber(8) + champ->_statistics[kDMChampionStatDexterity][kDMChampionStatCurrent];
dexterity -= ((int32)(dexterity >> 1) * (int32)champ->_load) / getMaximumLoad(champ);
if (_partyIsSleeping)
dexterity >>= 1;
@@ -1095,21 +1095,21 @@ bool ChampionMan::isLucky(Champion *champ, uint16 percentage) {
if (_vm->getRandomNumber(2) && (_vm->getRandomNumber(100) > percentage))
return true;
- unsigned char *curStat = champ->_statistics[k0_ChampionStatLuck];
- bool isLucky = (_vm->getRandomNumber(curStat[k1_ChampionStatCurrent]) > percentage);
- curStat[k1_ChampionStatCurrent] = getBoundedValue<char>(curStat[k2_ChampionStatMinimum], curStat[k1_ChampionStatCurrent] + (isLucky ? -2 : 2), curStat[k0_ChampionStatMaximum]);
+ unsigned char *curStat = champ->_statistics[kDMChampionStatLuck];
+ bool isLucky = (_vm->getRandomNumber(curStat[kDMChampionStatCurrent]) > percentage);
+ curStat[kDMChampionStatCurrent] = getBoundedValue<char>(curStat[kDMChampionStatMinimum], curStat[kDMChampionStatCurrent] + (isLucky ? -2 : 2), curStat[kDMChampionStatMaximum]);
return isLucky;
}
void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
- if ((champIndex == kM1_ChampionNone) || (_vm->indexToOrdinal(champIndex) == _candidateChampionOrdinal))
+ if ((champIndex == kDMChampionNone) || (_vm->indexToOrdinal(champIndex) == _candidateChampionOrdinal))
return;
Champion *curChampion = &_champions[champIndex];
- addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMChampionWoundNone, k0_attackType_NORMAL);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
- setFlag(curChampion->_attributes, k0x0800_ChampionAttributePanel);
+ setFlag(curChampion->_attributes, kDMChampionAttributePanel);
}
if (--attack) {
@@ -1134,7 +1134,7 @@ void ChampionMan::setPartyDirection(int16 dir) {
L0834_i_Delta += 4;
Champion *curChampion = _champions;
- for (int16 i = k0_ChampionFirst; i < _partyChampionCount; i++) {
+ for (int16 i = kDMChampionFirst; i < _partyChampionCount; i++) {
curChampion->_cell = (ViewCell)normalizeModulo4(curChampion->_cell + L0834_i_Delta);
curChampion->_dir = (Direction)normalizeModulo4(curChampion->_dir + L0834_i_Delta);
curChampion++;
@@ -1206,9 +1206,9 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) {
_vm->_eventMan->setPointerToObject(_vm->_objectMan->_objectIconForMousePointer);
_vm->_eventMan->hideMouse();
- if (_leaderIndex != kM1_ChampionNone) {
+ if (_leaderIndex != kDMChampionNone) {
_champions[_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thing);
- setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad);
+ setFlag(_champions[_leaderIndex]._attributes, kDMChampionAttributeLoad);
drawChampionState(_leaderIndex);
}
}
@@ -1235,10 +1235,10 @@ int16 ChampionMan::getMovementTicks(Champion *champ) {
woundTicks = 2;
}
- if (getFlag(champ->_wounds, k0x0020_ChampionWoundFeet))
+ if (getFlag(champ->_wounds, kDMChampionWoundFeet))
ticks += woundTicks;
- if (_vm->_objectMan->getIconIndex(champ->_slots[k5_ChampionSlotFeet]) == k194_IconIndiceArmourBootOfSpeed)
+ if (_vm->_objectMan->getIconIndex(champ->_slots[k5_ChampionSlotFeet]) == kDMIconIndiceArmourBootOfSpeed)
ticks--;
return ticks;
@@ -1267,15 +1267,15 @@ bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 wea
}
void ChampionMan::drawAllChampionStates() {
- for (int16 i = k0_ChampionFirst; i < _partyChampionCount; i++)
+ for (int16 i = kDMChampionFirst; i < _partyChampionCount; i++)
drawChampionState((ChampionIndex)i);
}
void ChampionMan::viAltarRebirth(uint16 champIndex) {
Champion *curChampion = &_champions[champIndex];
- if (getIndexInCell(curChampion->_cell) != kM1_ChampionNone) {
+ if (getIndexInCell(curChampion->_cell) != kDMChampionNone) {
uint16 numCell = k0_CellNorthWest;
- while (getIndexInCell(numCell) != kM1_ChampionNone)
+ while (getIndexInCell(numCell) != kDMChampionNone)
numCell++;
curChampion->_cell = (ViewCell)numCell;
@@ -1286,7 +1286,7 @@ void ChampionMan::viAltarRebirth(uint16 champIndex) {
curChampion->_currHealth = curChampion->_maxHealth >> 1;
_vm->_menuMan->drawSpellAreaControls(_magicCasterChampionIndex);
curChampion->_dir = _vm->_dungeonMan->_partyDir;
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x1000_ChampionAttributeStatusBox | k0x0400_ChampionAttributeIcon);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand | kDMChampionAttributeStatusBox | kDMChampionAttributeIcon);
drawChampionState((ChampionIndex)champIndex);
}
@@ -1344,7 +1344,7 @@ bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 ki
return false;
curChampion->_currMana -= requiredManaAmount;
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
int16 stepEnergy = 10 - MIN(8, curChampion->_maxMana >> 3);
if (kineticEnergy < (stepEnergy << 2)) {
kineticEnergy += 3;
@@ -1364,7 +1364,7 @@ void ChampionMan::championShootProjectile(Champion *champ, Thing thing, int16 ki
void ChampionMan::applyAndDrawPendingDamageAndWounds() {
Champion *championPtr = _champions;
- for (uint16 championIndex = k0_ChampionFirst; championIndex < _partyChampionCount; championIndex++, championPtr++) {
+ for (uint16 championIndex = kDMChampionFirst; championIndex < _partyChampionCount; championIndex++, championPtr++) {
int16 pendingWounds = _championPendingWounds[championIndex];
setFlag(championPtr->_wounds, pendingWounds);
_championPendingWounds[championIndex] = 0;
@@ -1385,9 +1385,9 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
championKill(championIndex);
} else {
championPtr->_currHealth = curHealth;
- setFlag(championPtr->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(championPtr->_attributes, kDMChampionAttributeStatistics);
if (pendingWounds) {
- setFlag(championPtr->_attributes, k0x2000_ChampionAttributeWounds);
+ setFlag(championPtr->_attributes, kDMChampionAttributeWounds);
}
int16 textPosX = championIndex * k69_ChampionStatusBoxSpacing;
@@ -1449,7 +1449,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
void ChampionMan::championKill(uint16 champIndex) {
Champion *curChampion = &_champions[champIndex];
curChampion->_currHealth = 0;
- setFlag(curChampion->_attributes, k0x1000_ChampionAttributeStatusBox);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatusBox);
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingEye) {
_vm->_pressingEye = false;
@@ -1465,7 +1465,7 @@ void ChampionMan::championKill(uint16 champIndex) {
_vm->_eventMan->_hideMousePointerRequestCount = 1;
_vm->_eventMan->hideMouse();
}
- _vm->_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
+ _vm->_inventoryMan->toggleInventory(kDMChampionCloseInventory);
}
dropAllObjects(champIndex);
Thing unusedThing = _vm->_dungeonMan->getUnusedThing(k0x8000_championBones | k10_JunkThingType);
@@ -1485,7 +1485,7 @@ void ChampionMan::championKill(uint16 champIndex) {
uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_partyDir);
if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap) {
_vm->_eventMan->_mousePointerBitmapUpdated = true;
- _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
+ _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
}
if (curChampion->_poisonEventCount)
@@ -1558,7 +1558,7 @@ void ChampionMan::dropAllObjects(uint16 champIndex) {
}
void ChampionMan::unpoison(int16 champIndex) {
- if (champIndex == kM1_ChampionNone)
+ if (champIndex == kDMChampionNone)
return;
TimelineEvent *eventPtr = _vm->_timeline->_events;
@@ -1591,11 +1591,11 @@ void ChampionMan::applyTimeEffects() {
uint16 gameTime = _vm->_gameTime & 0xFFFF;
uint16 timeCriteria = (((gameTime & 0x0080) + ((gameTime & 0x0100) >> 2)) + ((gameTime & 0x0040) << 2)) >> 2;
Champion *championPtr = _champions;
- for (uint16 championIndex = k0_ChampionFirst; championIndex < _partyChampionCount; championIndex++, championPtr++) {
+ for (uint16 championIndex = kDMChampionFirst; championIndex < _partyChampionCount; championIndex++, championPtr++) {
if (championPtr->_currHealth && (_vm->indexToOrdinal(championIndex) != _candidateChampionOrdinal)) {
uint16 wizardSkillLevel = getSkillLevel(championIndex, k3_ChampionSkillWizard) + getSkillLevel(championIndex, k2_ChampionSkillPriest);
if ((championPtr->_currMana < championPtr->_maxMana)
- && (timeCriteria < championPtr->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent] + wizardSkillLevel)) {
+ && (timeCriteria < championPtr->_statistics[kDMChampionStatWisdom][kDMChampionStatCurrent] + wizardSkillLevel)) {
int16 manaGain = championPtr->_maxMana / 40;
if (_partyIsSleeping)
manaGain <<= 1;
@@ -1658,35 +1658,35 @@ void ChampionMan::applyTimeEffects() {
if (championPtr->_water < -1024)
championPtr->_water = -1024;
- if ((championPtr->_currHealth < championPtr->_maxHealth) && (championPtr->_currStamina >= (championPtr->_maxStamina >> 2)) && (timeCriteria < (championPtr->_statistics[k4_ChampionStatVitality][k1_ChampionStatCurrent] + 12))) {
+ if ((championPtr->_currHealth < championPtr->_maxHealth) && (championPtr->_currStamina >= (championPtr->_maxStamina >> 2)) && (timeCriteria < (championPtr->_statistics[kDMChampionStatVitality][kDMChampionStatCurrent] + 12))) {
int16 healthGain = (championPtr->_maxHealth >> 7) + 1;
if (_partyIsSleeping)
healthGain <<= 1;
- if (_vm->_objectMan->getIconIndex(championPtr->_slots[k10_ChampionSlotNeck]) == k121_IconIndiceJunkEkkhardCross)
+ if (_vm->_objectMan->getIconIndex(championPtr->_slots[k10_ChampionSlotNeck]) == kDMIconIndiceJunkEkkhardCross)
healthGain += (healthGain >> 1) + 1;
championPtr->_currHealth += MIN(healthGain, (int16)(championPtr->_maxHealth - championPtr->_currHealth));
}
if (!((int)_vm->_gameTime & (_partyIsSleeping ? 63 : 255))) {
- for (uint16 i = k0_ChampionStatLuck; i <= k6_ChampionStatAntifire; i++) {
+ for (uint16 i = kDMChampionStatLuck; i <= kDMChampionStatAntifire; i++) {
byte *curStatistic = championPtr->_statistics[i];
- uint16 statisticMaximum = curStatistic[k0_ChampionStatMaximum];
- if (curStatistic[k1_ChampionStatCurrent] < statisticMaximum)
- curStatistic[k1_ChampionStatCurrent]++;
- else if (curStatistic[k1_ChampionStatCurrent] > statisticMaximum)
- curStatistic[k1_ChampionStatCurrent] -= curStatistic[k1_ChampionStatCurrent] / statisticMaximum;
+ uint16 statisticMaximum = curStatistic[kDMChampionStatMaximum];
+ if (curStatistic[kDMChampionStatCurrent] < statisticMaximum)
+ curStatistic[kDMChampionStatCurrent]++;
+ else if (curStatistic[kDMChampionStatCurrent] > statisticMaximum)
+ curStatistic[kDMChampionStatCurrent] -= curStatistic[kDMChampionStatCurrent] / statisticMaximum;
}
}
if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_partyDir) && (_vm->_projexpl->_lastCreatureAttackTime + 60 < _vm->_gameTime)) {
championPtr->_dir = _vm->_dungeonMan->_partyDir;
championPtr->_maximumDamageReceived = 0;
- setFlag(championPtr->_attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(championPtr->_attributes, kDMChampionAttributeIcon);
}
- setFlag(championPtr->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(championPtr->_attributes, kDMChampionAttributeStatistics);
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
- setFlag(championPtr->_attributes, k0x0800_ChampionAttributePanel);
+ setFlag(championPtr->_attributes, kDMChampionAttributePanel);
}
}
}
@@ -1824,7 +1824,7 @@ ChampionIndex ChampionMan::getIndexInCell(int16 cell) {
return (ChampionIndex)i;
}
- return kM1_ChampionNone;
+ return kDMChampionNone;
}
void ChampionMan::resetDataToStartGame() {
@@ -1832,34 +1832,34 @@ void ChampionMan::resetDataToStartGame() {
Thing handThing = _leaderHandObject;
if (handThing == Thing::_none) {
_leaderEmptyHanded = true;
- _leaderHandObjectIconIndex = kM1_IconIndiceNone;
+ _leaderHandObjectIconIndex = kDMIconIndiceNone;
_vm->_eventMan->setMousePointer();
} else
putObjectInLeaderHand(handThing, true); /* This call will add the weight of the leader hand object to the Load of the leader a first time */
Champion *curChampion = _champions;
for (int16 idx = 0; idx < _partyChampionCount; idx++, curChampion++) {
- clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x1000_ChampionAttributeStatusBox | k0x0400_ChampionAttributeIcon);
+ clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand | kDMChampionAttributeStatusBox | kDMChampionAttributeIcon);
}
drawAllChampionStates();
ChampionIndex championIndex = _leaderIndex;
- if (championIndex != kM1_ChampionNone) {
- _leaderIndex = kM1_ChampionNone;
+ if (championIndex != kDMChampionNone) {
+ _leaderIndex = kDMChampionNone;
_vm->_eventMan->commandSetLeader(championIndex);
}
championIndex = _magicCasterChampionIndex;
- if (championIndex != kM1_ChampionNone) {
- _magicCasterChampionIndex = kM1_ChampionNone;
+ if (championIndex != kDMChampionNone) {
+ _magicCasterChampionIndex = kDMChampionNone;
_vm->_menuMan->setMagicCasterAndDrawSpellArea(championIndex);
}
return;
}
_leaderHandObject = Thing::_none;
- _leaderHandObjectIconIndex = kM1_IconIndiceNone;
+ _leaderHandObjectIconIndex = kDMIconIndiceNone;
_leaderEmptyHanded = true;
}
@@ -1881,11 +1881,11 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
championPtr->_hideDamageReceivedIndex = -1;
championPtr->_dir = _vm->_dungeonMan->_partyDir;
uint16 viewCell = k0_ViewCellFronLeft;
- while (getIndexInCell(normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir)) != kM1_ChampionNone)
+ while (getIndexInCell(normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir)) != kDMChampionNone)
viewCell++;
championPtr->_cell = (ViewCell)normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir);
- championPtr->_attributes = k0x0400_ChampionAttributeIcon;
+ championPtr->_attributes = kDMChampionAttributeIcon;
championPtr->_directionMaximumDamageReceived = _vm->_dungeonMan->_partyDir;
championPtr->_food = 1500 + _vm->getRandomNumber(256);
championPtr->_water = 1500 + _vm->getRandomNumber(256);
@@ -1919,7 +1919,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
}
championPtr->_title[charIdx] = '\0';
if (*decodedStringPtr++ == 'M')
- setFlag(championPtr->_attributes, k0x0010_ChampionAttributeMale);
+ setFlag(championPtr->_attributes, kDMChampionAttributeMale);
decodedStringPtr++;
championPtr->_currHealth = championPtr->_maxHealth = getDecodedValue(decodedStringPtr, 4);
@@ -1929,12 +1929,12 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
championPtr->_currMana = championPtr->_maxMana = getDecodedValue(decodedStringPtr, 4);
decodedStringPtr += 4;
decodedStringPtr++;
- for (int16 statIdx = k0_ChampionStatLuck; statIdx <= k6_ChampionStatAntifire; statIdx++) {
- championPtr->_statistics[statIdx][k2_ChampionStatMinimum] = 30;
- championPtr->_statistics[statIdx][k1_ChampionStatCurrent] = championPtr->_statistics[statIdx][k0_ChampionStatMaximum] = getDecodedValue(decodedStringPtr, 2);
+ for (int16 statIdx = kDMChampionStatLuck; statIdx <= kDMChampionStatAntifire; statIdx++) {
+ championPtr->_statistics[statIdx][kDMChampionStatMinimum] = 30;
+ championPtr->_statistics[statIdx][kDMChampionStatCurrent] = championPtr->_statistics[statIdx][kDMChampionStatMaximum] = getDecodedValue(decodedStringPtr, 2);
decodedStringPtr += 2;
}
- championPtr->_statistics[k0_ChampionStatLuck][k2_ChampionStatMinimum] = 10;
+ championPtr->_statistics[kDMChampionStatLuck][kDMChampionStatMinimum] = 10;
decodedStringPtr++;
for (uint16 skillIdx = k4_ChampionSkillSwing; skillIdx <= k19_ChampionSkillWater; skillIdx++) {
int skillValue = *decodedStringPtr++ - 'A';
@@ -1951,7 +1951,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
}
_candidateChampionOrdinal = previousPartyChampionCount + 1;
if (++_partyChampionCount == 1) {
- _vm->_eventMan->commandSetLeader(k0_ChampionFirst);
+ _vm->_eventMan->commandSetLeader(kDMChampionFirst);
_vm->_menuMan->_refreshActionArea = true;
} else {
_vm->_menuMan->clearActingChampion();
@@ -2098,13 +2098,13 @@ uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) {
}
uint16 ChampionMan::getMaximumLoad(Champion *champ) {
- uint16 maximumLoad = champ->getStatistic(k1_ChampionStatStrength, k1_ChampionStatCurrent) * 8 + 100;
+ uint16 maximumLoad = champ->getStatistic(kDMChampionStatStrength, kDMChampionStatCurrent) * 8 + 100;
maximumLoad = getStaminaAdjustedValue(champ, maximumLoad);
int16 wounds = champ->getWounds();
if (wounds)
- maximumLoad -= maximumLoad >> (champ->getWoundsFlag(k0x0010_ChampionWoundLegs) ? 2 : 3);
+ maximumLoad -= maximumLoad >> (champ->getWoundsFlag(kDMChampionWoundLegs) ? 2 : 3);
- if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots)
+ if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == kDMIconIndiceArmourElvenBoots)
maximumLoad += maximumLoad * 16;
maximumLoad += 9;
@@ -2119,13 +2119,13 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
int16 championStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing;
Champion *curChampion = &_champions[champIndex];
uint16 championAttributes = curChampion->_attributes;
- if (!getFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand))
+ if (!getFlag(championAttributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand))
return;
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal);
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_eventMan->showMouse();
- if (getFlag(championAttributes, k0x1000_ChampionAttributeStatusBox)) {
+ if (getFlag(championAttributes, kDMChampionAttributeStatusBox)) {
Box box;
box._y1 = 0;
box._y2 = 28;
@@ -2152,26 +2152,26 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
if (isInventoryChampion) {
_vm->_inventoryMan->drawStatusBoxPortrait(champIndex);
- setFlag(championAttributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(championAttributes, kDMChampionAttributeStatistics);
} else
- setFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand);
+ setFlag(championAttributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeWounds | kDMChampionAttributeActionHand);
} else {
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k8_StatusBoxDeadChampion), &box, k40_byteWidth, kM1_ColorNoTransparency, 29);
_vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, curChampion->_name);
_vm->_menuMan->drawActionIcon(champIndex);
- clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
_vm->_eventMan->hideMouse();
return;
}
}
if (!(curChampion->_currHealth)) {
- clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
_vm->_eventMan->hideMouse();
return;
}
- if (getFlag(championAttributes, k0x0080_ChampionAttributeNameTitle)) {
+ if (getFlag(championAttributes, kDMChampionAttributeNameTitle)) {
Color nameColor = (champIndex == _leaderIndex) ? k9_ColorGold : k13_ColorLightestGray;
if (isInventoryChampion) {
char *championName = curChampion->_name;
@@ -2182,7 +2182,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
championTitleX += 6;
_vm->_textMan->printToViewport(championTitleX, 7, nameColor, curChampion->_title);
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
} else {
Box box;
box._y1 = 0;
@@ -2193,7 +2193,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
_vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, nameColor, k1_ColorDarkGary, curChampion->_name);
}
}
- if (getFlag(championAttributes, k0x0100_ChampionAttributeStatistics)) {
+ if (getFlag(championAttributes, kDMChampionAttributeStatistics)) {
drawChampionBarGraphs(champIndex);
if (isInventoryChampion) {
drawHealthStaminaManaValues(curChampion);
@@ -2205,24 +2205,24 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxMouth, k16_byteWidth, k12_ColorDarkestGray, 18);
nativeBitmapIndex = k33_SlotBoxNormalIndice;
- for (int i = k1_ChampionStatStrength; i <= k6_ChampionStatAntifire; i++) {
- if ((curChampion->_statistics[i][k1_ChampionStatCurrent] < curChampion->_statistics[i][k0_ChampionStatMaximum])) {
+ for (int i = kDMChampionStatStrength; i <= kDMChampionStatAntifire; i++) {
+ if ((curChampion->_statistics[i][kDMChampionStatCurrent] < curChampion->_statistics[i][kDMChampionStatMaximum])) {
nativeBitmapIndex = k34_SlotBoxWoundedIndice;
break;
}
}
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxEye, k16_byteWidth, k12_ColorDarkestGray, 18);
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
}
}
- if (getFlag(championAttributes, k0x2000_ChampionAttributeWounds)) {
+ if (getFlag(championAttributes, kDMChampionAttributeWounds)) {
for (int i = isInventoryChampion ? k5_ChampionSlotFeet : k1_ChampionSlotActionHand; i >= k0_ChampionSlotReadyHand; i--)
drawSlot(champIndex, i);
if (isInventoryChampion)
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
}
- if (getFlag(championAttributes, k0x0200_ChampionAttributeLoad) && isInventoryChampion) {
+ if (getFlag(championAttributes, kDMChampionAttributeLoad) && isInventoryChampion) {
uint16 maxLoad = getMaximumLoad(curChampion);
Color loadColor;
if (curChampion->_load > maxLoad)
@@ -2256,14 +2256,14 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
strcat(_vm->_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
strcat(_vm->_stringBuildBuffer, " KG");
_vm->_textMan->printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer);
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
}
uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir);
- if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) {
+ if (getFlag(championAttributes, kDMChampionAttributeIcon) && (_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) {
_vm->_displayMan->fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]);
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen);
}
- if (getFlag(championAttributes, k0x0800_ChampionAttributePanel) && isInventoryChampion) {
+ if (getFlag(championAttributes, kDMChampionAttributePanel) && isInventoryChampion) {
if (_vm->_pressingMouth)
_vm->_inventoryMan->drawPanelFoodWaterPoisoned();
else if (_vm->_pressingEye) {
@@ -2272,18 +2272,18 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
} else
_vm->_inventoryMan->drawPanel();
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
}
- if (getFlag(championAttributes, k0x8000_ChampionAttributeActionHand)) {
+ if (getFlag(championAttributes, kDMChampionAttributeActionHand)) {
drawSlot(champIndex, k1_ChampionSlotActionHand);
_vm->_menuMan->drawActionIcon(champIndex);
if (isInventoryChampion)
- setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
+ setFlag(championAttributes, kDMChampionAttributeViewport);
}
- if (getFlag(championAttributes, k0x4000_ChampionAttributeViewport))
+ if (getFlag(championAttributes, kDMChampionAttributeViewport))
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
- clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
_vm->_eventMan->hideMouse();
}
@@ -2330,7 +2330,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
int16 iconIndex;
if (thing == Thing::_none) {
if (slotIndex <= k5_ChampionSlotFeet) {
- iconIndex = k212_IconIndiceReadyHand + (slotIndex << 1);
+ iconIndex = kDMIconIndiceReadyHand + (slotIndex << 1);
if (champ->getWoundsFlag((ChampionWound)(1 << slotIndex))) {
iconIndex++;
nativeBitmapIndex = k34_SlotBoxWoundedIndice;
@@ -2338,13 +2338,13 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
nativeBitmapIndex = k33_SlotBoxNormalIndice;
} else {
if ((slotIndex >= k10_ChampionSlotNeck) && (slotIndex <= k13_ChampionSlotBackpackLine_1_1))
- iconIndex = k208_IconIndiceNeck + (slotIndex - k10_ChampionSlotNeck);
+ iconIndex = kDMIconIndiceNeck + (slotIndex - k10_ChampionSlotNeck);
else
- iconIndex = k204_IconIndiceEmptyBox;
+ iconIndex = kDMIconIndiceEmptyBox;
}
} else {
iconIndex = _vm->_objectMan->getIconIndex(thing); // BUG0_35
- if (isInventoryChamp && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == k144_IconIndiceContainerChestClosed) || (iconIndex == k30_IconIndiceScrollOpen))) {
+ if (isInventoryChamp && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == kDMIconIndiceContainerChestClosed) || (iconIndex == kDMIconIndiceScrollOpen))) {
iconIndex++;
} // BUG2_00
if (slotIndex <= k5_ChampionSlotFeet) {
@@ -2439,7 +2439,7 @@ void ChampionMan::renameChampion(Champion *champ) {
renamedChampionString[curCharacterIndex] = '\0';
bool found = false;
- for (uint16 idx = k0_ChampionFirst; idx < _partyChampionCount - 1; idx++) {
+ for (uint16 idx = kDMChampionFirst; idx < _partyChampionCount - 1; idx++) {
if (!strcmp(_champions[idx]._name, renamedChampionString)) {
// If an existing champion already has the specified name for the new champion
found = true;
@@ -2548,9 +2548,9 @@ uint16 ChampionMan::getSkillLevel(int16 champIndex, uint16 skillIndex) {
if (_partyIsSleeping)
return 1;
- bool ignoreTmpExp = getFlag(skillIndex, k0x8000_IgnoreTemporaryExperience);
- bool ignoreObjModifiers = getFlag(skillIndex, k0x4000_IgnoreObjectModifiers);
- clearFlag(skillIndex, k0x8000_IgnoreTemporaryExperience | k0x4000_IgnoreObjectModifiers);
+ bool ignoreTmpExp = getFlag(skillIndex, kDMIgnoreTemporaryExperience);
+ bool ignoreObjModifiers = getFlag(skillIndex, kDMIgnoreObjectModifiers);
+ clearFlag(skillIndex, kDMIgnoreTemporaryExperience | kDMIgnoreObjectModifiers);
Champion *champ = &_champions[champIndex];
Skill *skill = &champ->_skills[skillIndex];
int32 exp = skill->_experience;
@@ -2573,28 +2573,28 @@ uint16 ChampionMan::getSkillLevel(int16 champIndex, uint16 skillIndex) {
}
if (!ignoreObjModifiers) {
int16 actionHandIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k1_ChampionSlotActionHand]);
- if (actionHandIconIndex == k27_IconIndiceWeaponTheFirestaff)
+ if (actionHandIconIndex == kDMIconIndiceWeaponTheFirestaff)
skillLevel++;
- else if (actionHandIconIndex == k28_IconIndiceWeaponTheFirestaffComplete)
+ else if (actionHandIconIndex == kDMIconIndiceWeaponTheFirestaffComplete)
skillLevel += 2;
int16 neckIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k10_ChampionSlotNeck]);
switch (skillIndex) {
case k3_ChampionSkillWizard:
- if (neckIconIndex == k124_IconIndiceJunkPendantFeral)
+ if (neckIconIndex == kDMIconIndiceJunkPendantFeral)
skillLevel += 1;
break;
case k13_ChampionSkillHeal:
// The skill modifiers of these two objects are not cumulative
- if ((neckIconIndex == k120_IconIndiceJunkGemOfAges) || (actionHandIconIndex == k66_IconIndiceWeaponSceptreOfLyf))
+ if ((neckIconIndex == kDMIconIndiceJunkGemOfAges) || (actionHandIconIndex == kDMIconIndiceWeaponSceptreOfLyf))
skillLevel += 1;
break;
case k14_ChampionSkillInfluence:
- if (neckIconIndex == k122_IconIndiceJunkMoonstone)
+ if (neckIconIndex == kDMIconIndiceJunkMoonstone)
skillLevel += 1;
break;
case k15_ChampionSkillDefend:
- if (neckIconIndex == k121_IconIndiceJunkEkkhardCross)
+ if (neckIconIndex == kDMIconIndiceJunkEkkhardCross)
skillLevel += 1;
break;
default:
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index fe8f0fb258..3ddf097051 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -173,57 +173,57 @@ enum IconIndice {
};
enum ChampionIndex {
- kM1_ChampionNone = -1, // @ CM1_CHAMPION_NONE
- k0_ChampionFirst = 0, // @ C00_CHAMPION_FIRST
- k1_ChampionSecond = 1,
- k2_ChampionThird = 2,
- k3_ChampionFourth = 3,
- k4_ChampionCloseInventory = 4, // @ C04_CHAMPION_CLOSE_INVENTORY
- k5_ChampionSpecialInventory = 5 // @ C05_CHAMPION_SPECIAL_INVENTORY
+ kDMChampionNone = -1, // @ CM1_CHAMPION_NONE
+ kDMChampionFirst = 0, // @ C00_CHAMPION_FIRST
+ kDMChampionSecond = 1,
+ kDMChampionThird = 2,
+ kDMChampionFourth = 3,
+ kDMChampionCloseInventory = 4, // @ C04_CHAMPION_CLOSE_INVENTORY
+ kDMChampionSpecialInventory = 5 // @ C05_CHAMPION_SPECIAL_INVENTORY
};
enum ChampionAttribute {
- k0x0000_ChampionAttributNone = 0x0000, // @ MASK0x0000_NONE
- k0x0008_ChampionAttributeDisableAction = 0x0008, // @ MASK0x0008_DISABLE_ACTION
- k0x0010_ChampionAttributeMale = 0x0010, // @ MASK0x0010_MALE
- k0x0080_ChampionAttributeNameTitle = 0x0080, // @ MASK0x0080_NAME_TITLE
- k0x0100_ChampionAttributeStatistics = 0x0100, // @ MASK0x0100_STATISTICS
- k0x0200_ChampionAttributeLoad = 0x0200, // @ MASK0x0200_LOAD
- k0x0400_ChampionAttributeIcon = 0x0400, // @ MASK0x0400_ICON
- k0x0800_ChampionAttributePanel = 0x0800, // @ MASK0x0800_PANEL
- k0x1000_ChampionAttributeStatusBox = 0x1000, // @ MASK0x1000_STATUS_BOX
- k0x2000_ChampionAttributeWounds = 0x2000, // @ MASK0x2000_WOUNDS
- k0x4000_ChampionAttributeViewport = 0x4000, // @ MASK0x4000_VIEWPORT
- k0x8000_ChampionAttributeActionHand = 0x8000 // @ MASK0x8000_ACTION_HAND
+ kDMChampionAttributNone = 0x0000, // @ MASK0x0000_NONE
+ kDMChampionAttributeDisableAction = 0x0008, // @ MASK0x0008_DISABLE_ACTION
+ kDMChampionAttributeMale = 0x0010, // @ MASK0x0010_MALE
+ kDMChampionAttributeNameTitle = 0x0080, // @ MASK0x0080_NAME_TITLE
+ kDMChampionAttributeStatistics = 0x0100, // @ MASK0x0100_STATISTICS
+ kDMChampionAttributeLoad = 0x0200, // @ MASK0x0200_LOAD
+ kDMChampionAttributeIcon = 0x0400, // @ MASK0x0400_ICON
+ kDMChampionAttributePanel = 0x0800, // @ MASK0x0800_PANEL
+ kDMChampionAttributeStatusBox = 0x1000, // @ MASK0x1000_STATUS_BOX
+ kDMChampionAttributeWounds = 0x2000, // @ MASK0x2000_WOUNDS
+ kDMChampionAttributeViewport = 0x4000, // @ MASK0x4000_VIEWPORT
+ kDMChampionAttributeActionHand = 0x8000 // @ MASK0x8000_ACTION_HAND
};
enum ChampionWound {
- k0x0000_ChampionWoundNone = 0x0000, // @ MASK0x0000_NO_WOUND
- k0x0001_ChampionWoundReadHand = 0x0001, // @ MASK0x0001_READY_HAND
- k0x0002_ChampionWoundActionHand = 0x0002, // @ MASK0x0002_ACTION_HAND
- k0x0004_ChampionWoundHead = 0x0004, // @ MASK0x0004_HEAD
- k0x0008_ChampionWoundTorso = 0x0008, // @ MASK0x0008_TORSO
- k0x0010_ChampionWoundLegs = 0x0010, // @ MASK0x0010_LEGS
- k0x0020_ChampionWoundFeet = 0x0020 // @ MASK0x0020_FEET
+ kDMChampionWoundNone = 0x0000, // @ MASK0x0000_NO_WOUND
+ kDMChampionWoundReadHand = 0x0001, // @ MASK0x0001_READY_HAND
+ kDMChampionWoundActionHand = 0x0002, // @ MASK0x0002_ACTION_HAND
+ kDMChampionWoundHead = 0x0004, // @ MASK0x0004_HEAD
+ kDMChampionWoundTorso = 0x0008, // @ MASK0x0008_TORSO
+ kDMChampionWoundLegs = 0x0010, // @ MASK0x0010_LEGS
+ kDMChampionWoundFeet = 0x0020 // @ MASK0x0020_FEET
};
enum ChampionStatisticType {
- k0_ChampionStatLuck = 0, // @ C0_STATISTIC_LUCK
- k1_ChampionStatStrength = 1, // @ C1_STATISTIC_STRENGTH
- k2_ChampionStatDexterity = 2, // @ C2_STATISTIC_DEXTERITY
- k3_ChampionStatWisdom = 3, // @ C3_STATISTIC_WISDOM
- k4_ChampionStatVitality = 4, // @ C4_STATISTIC_VITALITY
- k5_ChampionStatAntimagic = 5, // @ C5_STATISTIC_ANTIMAGIC
- k6_ChampionStatAntifire = 6, // @ C6_STATISTIC_ANTIFIRE
- k8_ChampionStatMana = 8 // @ C8_STATISTIC_MANA /* Used as a fake statistic index for objects granting a Mana bonus */
+ kDMChampionStatLuck = 0, // @ C0_STATISTIC_LUCK
+ kDMChampionStatStrength = 1, // @ C1_STATISTIC_STRENGTH
+ kDMChampionStatDexterity = 2, // @ C2_STATISTIC_DEXTERITY
+ kDMChampionStatWisdom = 3, // @ C3_STATISTIC_WISDOM
+ kDMChampionStatVitality = 4, // @ C4_STATISTIC_VITALITY
+ kDMChampionStatAntimagic = 5, // @ C5_STATISTIC_ANTIMAGIC
+ kDMChampionStatAntifire = 6, // @ C6_STATISTIC_ANTIFIRE
+ kDMChampionStatMana = 8 // @ C8_STATISTIC_MANA /* Used as a fake statistic index for objects granting a Mana bonus */
};
enum ChampionStatisticValue {
- k0_ChampionStatMaximum = 0, // @ C0_MAXIMUM
- k1_ChampionStatCurrent = 1, // @ C1_CURRENT
- k2_ChampionStatMinimum = 2 // @ C2_MINIMUM
+ kDMChampionStatMaximum = 0, // @ C0_MAXIMUM
+ kDMChampionStatCurrent = 1, // @ C1_CURRENT
+ kDMChampionStatMinimum = 2 // @ C2_MINIMUM
};
enum ChampionSkill {
@@ -339,14 +339,16 @@ enum ChampionAction {
k255_ChampionActionNone = 255 // @ C255_ACTION_NONE
};
-#define k0_attackType_NORMAL 0 // @ C0_ATTACK_NORMAL
-#define k1_attackType_FIRE 1 // @ C1_ATTACK_FIRE
-#define k2_attackType_SELF 2 // @ C2_ATTACK_SELF
-#define k3_attackType_BLUNT 3 // @ C3_ATTACK_BLUNT
-#define k4_attackType_SHARP 4 // @ C4_ATTACK_SHARP
-#define k5_attackType_MAGIC 5 // @ C5_ATTACK_MAGIC
-#define k6_attackType_PSYCHIC 6 // @ C6_ATTACK_PSYCHIC
-#define k7_attackType_LIGHTNING 7 // @ C7_ATTACK_LIGHTNING
+enum AttackType {
+ k0_attackType_NORMAL = 0, // @ C0_ATTACK_NORMAL
+ k1_attackType_FIRE = 1, // @ C1_ATTACK_FIRE
+ k2_attackType_SELF = 2, // @ C2_ATTACK_SELF
+ k3_attackType_BLUNT = 3, // @ C3_ATTACK_BLUNT
+ k4_attackType_SHARP = 4, // @ C4_ATTACK_SHARP
+ k5_attackType_MAGIC = 5, // @ C5_ATTACK_MAGIC
+ k6_attackType_PSYCHIC = 6, // @ C6_ATTACK_PSYCHIC
+ k7_attackType_LIGHTNING = 7 // @ C7_ATTACK_LIGHTNING
+};
class Skill {
public:
@@ -401,12 +403,12 @@ public:
uint16 getAttributes() { return _attributes; }
uint16 getAttributes(ChampionAttribute flag) { return _attributes & flag; }
void setAttributeFlag(ChampionAttribute flag, bool value);
- void clearAttributes(ChampionAttribute attribute = k0x0000_ChampionAttributNone) { _attributes = attribute; }
+ void clearAttributes(ChampionAttribute attribute = kDMChampionAttributNone) { _attributes = attribute; }
uint16 getWounds() { return _wounds; }
void setWoundsFlag(ChampionWound flag, bool value);
uint16 getWoundsFlag(ChampionWound wound) { return _wounds & wound; }
- void clearWounds() { _wounds = k0x0000_ChampionWoundNone; }
+ void clearWounds() { _wounds = kDMChampionWoundNone; }
void resetSkillsToZero() {
for (int16 i = 0; i < 20; ++i)
_skills[i].resetToZero();
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 443a39d927..a20293cd16 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -318,9 +318,9 @@ void DMEngine::startGame() {
_highlightBoxInversionRequested = false;
_eventMan->_highlightBoxEnabled = false;
_championMan->_partyIsSleeping = false;
- _championMan->_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone);
+ _championMan->_actingChampionOrdinal = indexToOrdinal(kDMChampionNone);
_menuMan->_actionAreaContainsIcons = true;
- _eventMan->_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone);
+ _eventMan->_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kDMChampionNone);
_eventMan->_primaryMouseInput = _eventMan->_primaryMouseInputInterface;
_eventMan->_secondaryMouseInput = _eventMan->_secondaryMouseInputMovement;
@@ -643,7 +643,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
if (_gameWon) {
// Strangerke: Related to portraits. Game data could be missing for earlier versions of the game.
_displayMan->fillScreen(k12_ColorDarkestGray);
- for (int16 championIndex = k0_ChampionFirst; championIndex < _championMan->_partyChampionCount; championIndex++) {
+ for (int16 championIndex = kDMChampionFirst; championIndex < _championMan->_partyChampionCount; championIndex++) {
int16 textPosY = championIndex * 48;
Champion *curChampion = &_championMan->_champions[championIndex];
_displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(k208_wallOrn_43_champMirror), &championMirrorBox, k32_byteWidth, k10_ColorFlesh, 43);
@@ -917,7 +917,7 @@ void DMEngine::entranceDrawCredits() {
void DMEngine::fuseSequence() {
_gameWon = true;
if (_inventoryMan->_inventoryChampionOrdinal)
- _inventoryMan->toggleInventory(k4_ChampionCloseInventory);
+ _inventoryMan->toggleInventory(kDMChampionCloseInventory);
_eventMan->highlightBoxDisable();
_championMan->_party._magicalLightAmount = 200;
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index d2ee2f85e4..fdf66b73b3 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -469,7 +469,7 @@ void EventManager::setPointerToObject(byte *bitmap) {
void EventManager::mouseDropChampionIcon() {
_preventBuildPointerScreenArea = true;
uint16 championIconIndex = _vm->ordinalToIndex(_useChampionIconOrdinalAsMousePointerBitmap);
- _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
+ _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
_mousePointerBitmapUpdated = true;
bool useByteBoxCoordinatesBackup = _vm->_displayMan->_useByteBoxCoordinates;
_vm->_displayMan->blitToScreen(_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18);
@@ -577,7 +577,7 @@ void EventManager::buildpointerScreenArea(int16 mousePosX, int16 mousePosY) {
void EventManager::setMousePointer() {
if (_vm->_championMan->_leaderEmptyHanded)
- setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand);
+ setMousePointerToNormal((_vm->_championMan->_leaderIndex == kDMChampionNone) ? k0_pointerArrow : k1_pointerHand);
else
setPointerToObject(_vm->_objectMan->_objectIconForMousePointer);
}
@@ -763,7 +763,7 @@ void EventManager::processCommandQueue() {
}
if ((cmdType >= k28_CommandClickOnSlotBoxInventoryReadyHand) && (cmdType < (k65_CommandClickOnSlotBoxChest_8 + 1))) {
- if (_vm->_championMan->_leaderIndex != kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex != kDMChampionNone)
_vm->_championMan->clickOnSlotBox(cmdType - k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand);
return;
@@ -779,21 +779,21 @@ void EventManager::processCommandQueue() {
}
int16 championIndex = cmdType - k7_CommandToggleInventoryChampion_0;
- if (((championIndex == k4_ChampionCloseInventory) || (championIndex < _vm->_championMan->_partyChampionCount)) && !_vm->_championMan->_candidateChampionOrdinal)
+ if (((championIndex == kDMChampionCloseInventory) || (championIndex < _vm->_championMan->_partyChampionCount)) && !_vm->_championMan->_candidateChampionOrdinal)
_vm->_inventoryMan->toggleInventory((ChampionIndex)championIndex);
return;
}
if (cmdType == k83_CommandToggleInventoryLeader) {
- if (_vm->_championMan->_leaderIndex != kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex != kDMChampionNone)
_vm->_inventoryMan->toggleInventory(_vm->_championMan->_leaderIndex);
return;
}
if (cmdType == k100_CommandClickInSpellArea) {
- if ((!_vm->_championMan->_candidateChampionOrdinal) && (_vm->_championMan->_magicCasterChampionIndex != kM1_ChampionNone))
+ if ((!_vm->_championMan->_candidateChampionOrdinal) && (_vm->_championMan->_magicCasterChampionIndex != kDMChampionNone))
commandProcessType100_clickInSpellArea(commandX, commandY);
return;
@@ -831,7 +831,7 @@ void EventManager::processCommandQueue() {
if (cmdType == k145_CommandSleep) {
if (!_vm->_championMan->_candidateChampionOrdinal) {
if (_vm->_inventoryMan->_inventoryChampionOrdinal)
- _vm->_inventoryMan->toggleInventory(k4_ChampionCloseInventory);
+ _vm->_inventoryMan->toggleInventory(kDMChampionCloseInventory);
_vm->_menuMan->drawDisabledMenu();
_vm->_championMan->_partyIsSleeping = true;
@@ -970,7 +970,7 @@ void EventManager::commandMoveParty(CommandType cmdType) {
_vm->_stopWaitingForPlayerInput = true;
Champion *championsPtr = _vm->_championMan->_champions;
- for (uint16 idx = k0_ChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++) {
+ for (uint16 idx = kDMChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++) {
_vm->_championMan->decrementStamina(idx, ((championsPtr->_load * 3) / _vm->_championMan->getMaximumLoad(championsPtr)) + 1); /* BUG0_50 When a champion is brought back to life at a Vi Altar, his current stamina is lower than what it was before dying. Each time the party moves the current stamina of all champions is decreased, including for dead champions, by an amount that depends on the current load of the champion. For a dead champion the load before he died is used */
championsPtr++;
}
@@ -1009,9 +1009,9 @@ void EventManager::commandMoveParty(CommandType cmdType) {
movementArrowIdx += (_vm->_dungeonMan->_partyDir + 2);
int16 L1124_i_FirstDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, normalizeModulo4(movementArrowIdx));
int16 L1125_i_SecondDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, returnNextVal(movementArrowIdx));
- int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs, k2_attackType_SELF);
+ int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, kDMChampionWoundTorso | kDMChampionWoundLegs, k2_attackType_SELF);
if (L1124_i_FirstDamagedChampionIndex != L1125_i_SecondDamagedChampionIndex)
- damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs, k2_attackType_SELF);
+ damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, kDMChampionWoundTorso | kDMChampionWoundLegs, k2_attackType_SELF);
if (damage)
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
@@ -1036,7 +1036,7 @@ void EventManager::commandMoveParty(CommandType cmdType) {
uint16 disabledMovtTicks = 1;
championsPtr = _vm->_championMan->_champions;
- for (uint16 idx = k0_ChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++) {
+ for (uint16 idx = kDMChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++) {
if (championsPtr->_currHealth)
disabledMovtTicks = MAX((int32)disabledMovtTicks, (int32)_vm->_championMan->getMovementTicks(championsPtr));
@@ -1105,19 +1105,19 @@ void EventManager::commandSetLeader(ChampionIndex champIndex) {
ChampionMan &cm = *_vm->_championMan;
ChampionIndex leaderIndex;
- if ((cm._leaderIndex == champIndex) || ((champIndex != kM1_ChampionNone) && !cm._champions[champIndex]._currHealth))
+ if ((cm._leaderIndex == champIndex) || ((champIndex != kDMChampionNone) && !cm._champions[champIndex]._currHealth))
return;
- if (cm._leaderIndex != kM1_ChampionNone) {
+ if (cm._leaderIndex != kDMChampionNone) {
leaderIndex = cm._leaderIndex;
- cm._champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
- cm._champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
+ cm._champions[leaderIndex].setAttributeFlag(kDMChampionAttributeLoad, true);
+ cm._champions[leaderIndex].setAttributeFlag(kDMChampionAttributeNameTitle, true);
cm._champions[leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(cm._leaderHandObject);
- cm._leaderIndex = kM1_ChampionNone;
+ cm._leaderIndex = kDMChampionNone;
cm.drawChampionState(leaderIndex);
}
- if (champIndex == kM1_ChampionNone) {
- cm._leaderIndex = kM1_ChampionNone;
+ if (champIndex == kDMChampionNone) {
+ cm._leaderIndex = kDMChampionNone;
return;
}
cm._leaderIndex = champIndex;
@@ -1125,8 +1125,8 @@ void EventManager::commandSetLeader(ChampionIndex champIndex) {
champion->_dir = _vm->_dungeonMan->_partyDir;
cm._champions[champIndex]._load += _vm->_dungeonMan->getObjectWeight(cm._leaderHandObject);
if (_vm->indexToOrdinal(champIndex) != cm._candidateChampionOrdinal) {
- champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true);
- champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
+ champion->setAttributeFlag(kDMChampionAttributeIcon, true);
+ champion->setAttributeFlag(kDMChampionAttributeNameTitle, true);
cm.drawChampionState(champIndex);
}
}
@@ -1150,7 +1150,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
};
if (_vm->_dungeonMan->_squareAheadElement == k17_ElementTypeDoorFront) {
- if (_vm->_championMan->_leaderIndex == kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex == kDMChampionNone)
return;
int16 L1155_i_MapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir];
@@ -1234,10 +1234,10 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
uint16 championIndex = champMan._partyChampionCount - 1;
Champion *champ = &champMan._champions[championIndex];
if (commandType == k162_CommandClickInPanelCancel) {
- invMan.toggleInventory(k4_ChampionCloseInventory);
- champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ invMan.toggleInventory(kDMChampionCloseInventory);
+ champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kDMChampionNone);
if (champMan._partyChampionCount == 1) {
- commandSetLeader(kM1_ChampionNone);
+ commandSetLeader(kDMChampionNone);
}
champMan._partyChampionCount--;
Box box;
@@ -1253,7 +1253,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
return;
}
- champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kDMChampionNone);
int16 mapX = dunMan._partyMapX + _vm->_dirIntoStepCountEast[dunMan._partyDir];
int16 mapY = dunMan._partyMapY + _vm->_dirIntoStepCountNorth[dunMan._partyDir];
@@ -1280,15 +1280,15 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
for (uint16 i = 0; i < 12; i++) {
uint16 statIndex = _vm->getRandomNumber(7);
- champ->getStatistic((ChampionStatisticType)statIndex, k1_ChampionStatCurrent)++; // returns reference
- champ->getStatistic((ChampionStatisticType)statIndex, k0_ChampionStatMaximum)++; // returns reference
+ champ->getStatistic((ChampionStatisticType)statIndex, kDMChampionStatCurrent)++; // returns reference
+ champ->getStatistic((ChampionStatisticType)statIndex, kDMChampionStatMaximum)++; // returns reference
}
}
if (champMan._partyChampionCount == 1) {
_vm->_projexpl->_lastPartyMovementTime = _vm->_gameTime;
- commandSetLeader(k0_ChampionFirst);
- _vm->_menuMan->setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
+ commandSetLeader(kDMChampionFirst);
+ _vm->_menuMan->setMagicCasterAndDrawSpellArea(kDMChampionFirst);
} else
_vm->_menuMan->drawSpellAreaControls(champMan._magicCasterChampionIndex);
@@ -1309,9 +1309,9 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
break;
}
- invMan.toggleInventory(k4_ChampionCloseInventory);
+ invMan.toggleInventory(kDMChampionCloseInventory);
_vm->_menuMan->drawEnabledMenus();
- setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand);
+ setMousePointerToNormal((_vm->_championMan->_leaderIndex == kDMChampionNone) ? k0_pointerArrow : k1_pointerHand);
}
void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
@@ -1321,7 +1321,7 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
CommandType commandType;
switch (invMan._panelContent) {
case k4_PanelContentChest:
- if (champMan._leaderIndex == kM1_ChampionNone) // if no leader
+ if (champMan._leaderIndex == kDMChampionNone) // if no leader
return;
commandType = getCommandTypeFromMouseInput(_mouseInputPanelChest, Common::Point(x, y), k1_LeftMouseButton);
if (commandType != k0_CommandNone)
@@ -1340,7 +1340,7 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
}
void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell) {
- if (_vm->_championMan->_leaderIndex == kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex == kDMChampionNone)
return;
int16 mapX = _vm->_dungeonMan->_partyMapX;
@@ -1365,7 +1365,7 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16
}
void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell) {
- if (_vm->_championMan->_leaderIndex == kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex == kDMChampionNone)
return;
int16 mapX = _vm->_dungeonMan->_partyMapX;
@@ -1454,7 +1454,7 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
_preventBuildPointerScreenArea = true;
if (!_useChampionIconOrdinalAsMousePointerBitmap) {
- if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir)) == kM1_ChampionNone) {
+ if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir)) == kDMChampionNone) {
_preventBuildPointerScreenArea = false;
return;
}
@@ -1473,22 +1473,22 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
} else {
_mousePointerBitmapUpdated = true;
uint16 championIconIndex = _vm->ordinalToIndex(_useChampionIconOrdinalAsMousePointerBitmap);
- _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
+ _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir));
if (championIconIndex == champIconIndex) {
- setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championCellIndex);
} else {
int16 championIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir));
if (championIndex >= 0) {
_vm->_championMan->_champions[championIndex]._cell = (ViewCell)normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir);
- setFlag(_vm->_championMan->_champions[championIndex]._attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championIndex]._attributes, kDMChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
} else
_vm->_displayMan->fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], k0_ColorBlack);
_vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir);
- setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championCellIndex);
}
}
@@ -1497,49 +1497,49 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
}
void EventManager::commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY) {
- ChampionIndex championIndex = kM1_ChampionNone;
+ ChampionIndex championIndex = kDMChampionNone;
if (posY <= 48) {
switch (_vm->_championMan->_magicCasterChampionIndex) {
case 0:
if ((posX >= 280) && (posX <= 291))
- championIndex = k1_ChampionSecond;
+ championIndex = kDMChampionSecond;
else if ((posX >= 294) && (posX <= 305))
- championIndex = k2_ChampionThird;
+ championIndex = kDMChampionThird;
else if (posX >= 308)
- championIndex = k3_ChampionFourth;
+ championIndex = kDMChampionFourth;
break;
case 1:
if ((posX >= 233) && (posX <= 244))
- championIndex = k0_ChampionFirst;
+ championIndex = kDMChampionFirst;
else if ((posX >= 294) && (posX <= 305))
- championIndex = k2_ChampionThird;
+ championIndex = kDMChampionThird;
else if (posX >= 308)
- championIndex = k3_ChampionFourth;
+ championIndex = kDMChampionFourth;
break;
case 2:
if ((posX >= 233) && (posX <= 244))
- championIndex = k0_ChampionFirst;
+ championIndex = kDMChampionFirst;
else if ((posX >= 247) && (posX <= 258))
- championIndex = k1_ChampionSecond;
+ championIndex = kDMChampionSecond;
else if (posX >= 308)
- championIndex = k3_ChampionFourth;
+ championIndex = kDMChampionFourth;
break;
case 3:
if ((posX >= 247) && (posX <= 258))
- championIndex = k1_ChampionSecond;
+ championIndex = kDMChampionSecond;
else if ((posX >= 261) && (posX <= 272))
- championIndex = k2_ChampionThird;
+ championIndex = kDMChampionThird;
else if (posX <= 244)
- championIndex = k0_ChampionFirst;
+ championIndex = kDMChampionFirst;
break;
default:
break;
}
- if ((championIndex != kM1_ChampionNone) && (championIndex < _vm->_championMan->_partyChampionCount))
+ if ((championIndex != kDMChampionNone) && (championIndex < _vm->_championMan->_partyChampionCount))
_vm->_menuMan->setMagicCasterAndDrawSpellArea(championIndex);
return;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index bb0bab1f2a..78c76b8d9c 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1613,7 +1613,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
uint16 poisonAttack = creatureInfo._poisonAttack;
if (poisonAttack && _vm->getRandomNumber(2)) {
- poisonAttack = _vm->_championMan->getStatisticAdjustedAttack(curChampion, k4_ChampionStatVitality, poisonAttack);
+ poisonAttack = _vm->_championMan->getStatisticAdjustedAttack(curChampion, kDMChampionStatVitality, poisonAttack);
if (poisonAttack >= 0)
_vm->_championMan->championPoison(champIndex, poisonAttack);
}
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 9435a8b697..e5540b5b4e 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -86,7 +86,7 @@ InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
void InventoryMan::toggleInventory(ChampionIndex championIndex) {
static Box boxFloppyZzzCross(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
- if ((championIndex != k4_ChampionCloseInventory) && !_vm->_championMan->_champions[championIndex]._currHealth)
+ if ((championIndex != kDMChampionCloseInventory) && !_vm->_championMan->_champions[championIndex]._currHealth)
return;
if (_vm->_pressingMouth || _vm->_pressingEye)
@@ -95,22 +95,22 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
_vm->_stopWaitingForPlayerInput = true;
uint16 inventoryChampionOrdinal = _inventoryChampionOrdinal;
if (_vm->indexToOrdinal(championIndex) == inventoryChampionOrdinal)
- championIndex = k4_ChampionCloseInventory;
+ championIndex = kDMChampionCloseInventory;
_vm->_eventMan->showMouse();
if (inventoryChampionOrdinal) {
- _inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ _inventoryChampionOrdinal = _vm->indexToOrdinal(kDMChampionNone);
closeChest();
Champion *champion = &_vm->_championMan->_champions[_vm->ordinalToIndex(inventoryChampionOrdinal)];
if (champion->_currHealth && !_vm->_championMan->_candidateChampionOrdinal) {
- setFlag(champion->_attributes, k0x1000_ChampionAttributeStatusBox);
+ setFlag(champion->_attributes, kDMChampionAttributeStatusBox);
_vm->_championMan->drawChampionState((ChampionIndex)_vm->ordinalToIndex(inventoryChampionOrdinal));
}
if (_vm->_championMan->_partyIsSleeping) {
_vm->_eventMan->hideMouse();
return;
}
- if (championIndex == k4_ChampionCloseInventory) {
+ if (championIndex == kDMChampionCloseInventory) {
_vm->_eventMan->_refreshMousePointerInMainLoop = true;
_vm->_menuMan->drawMovementArrows();
_vm->_eventMan->hideMouse();
@@ -152,7 +152,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
for (uint16 i = k0_ChampionSlotReadyHand; i < k30_ChampionSlotChest_1; i++)
_vm->_championMan->drawSlot(championIndex, i);
- setFlag(champion->_attributes, k0x4000_ChampionAttributeViewport | k0x1000_ChampionAttributeStatusBox | k0x0800_ChampionAttributePanel | k0x0200_ChampionAttributeLoad | k0x0100_ChampionAttributeStatistics | k0x0080_ChampionAttributeNameTitle);
+ setFlag(champion->_attributes, kDMChampionAttributeViewport | kDMChampionAttributeStatusBox | kDMChampionAttributePanel | kDMChampionAttributeLoad | kDMChampionAttributeStatistics | kDMChampionAttributeNameTitle);
_vm->_championMan->drawChampionState(championIndex);
_vm->_eventMan->_mousePointerBitmapUpdated = true;
_vm->_eventMan->hideMouse();
@@ -822,10 +822,10 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
textPosY += 7;
}
textPosY = 86;
- for (uint16 idx = k1_ChampionStatStrength; idx <= k6_ChampionStatAntifire; idx++) {
+ for (uint16 idx = kDMChampionStatStrength; idx <= kDMChampionStatAntifire; idx++) {
_vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, statisticNames[idx]);
- int16 statisticCurrentValue = curChampion->_statistics[idx][k1_ChampionStatCurrent];
- uint16 statisticMaximumValue = curChampion->_statistics[idx][k0_ChampionStatMaximum];
+ int16 statisticCurrentValue = curChampion->_statistics[idx][kDMChampionStatCurrent];
+ uint16 statisticMaximumValue = curChampion->_statistics[idx][kDMChampionStatMaximum];
int16 statisticColor;
if (statisticCurrentValue < statisticMaximumValue)
statisticColor = k8_ColorRed;
@@ -932,16 +932,16 @@ void InventoryMan::clickOnMouth() {
switch (((Potion *)junkData)->getType()) {
case k6_PotionTypeRos:
- adjustStatisticCurrentValue(curChampion, k2_ChampionStatDexterity, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMChampionStatDexterity, adjustedPotionPower);
break;
case k7_PotionTypeKu:
- adjustStatisticCurrentValue(curChampion, k1_ChampionStatStrength, (((Potion *)junkData)->getPower() / 35) + 5); /* Value between 5 and 12 */
+ adjustStatisticCurrentValue(curChampion, kDMChampionStatStrength, (((Potion *)junkData)->getPower() / 35) + 5); /* Value between 5 and 12 */
break;
case k8_PotionTypeDane:
- adjustStatisticCurrentValue(curChampion, k3_ChampionStatWisdom, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMChampionStatWisdom, adjustedPotionPower);
break;
case k9_PotionTypeNeta:
- adjustStatisticCurrentValue(curChampion, k4_ChampionStatVitality, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMChampionStatVitality, adjustedPotionPower);
break;
case k10_PotionTypeAntivenin:
_vm->_championMan->unpoison(championIndex);
@@ -961,7 +961,7 @@ void InventoryMan::clickOnMouth() {
newEvent._priority = championIndex;
newEvent._B._defense = adjustedPotionPower;
_vm->_timeline->addEventGetEventIndex(&newEvent);
- setFlag(curChampion->_attributes, k0x1000_ChampionAttributeStatusBox);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatusBox);
}
break;
case k13_PotionTypeEe: {
@@ -985,7 +985,7 @@ void InventoryMan::clickOnMouth() {
healWoundIterationCount = 1;
} while ((wounds == curChampion->_wounds) && --counter); /* Loop until at least one wound is healed or there are no more heal iterations */
}
- setFlag(curChampion->_attributes, k0x0200_ChampionAttributeLoad | k0x2000_ChampionAttributeWounds);
+ setFlag(curChampion->_attributes, kDMChampionAttributeLoad | kDMChampionAttributeWounds);
}
break;
case k15_PotionTypeWaterFlask:
@@ -1015,13 +1015,13 @@ void InventoryMan::clickOnMouth() {
} else {
_vm->_championMan->drawChangedObjectIcons();
_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(handThing) - handThingWeight;
- setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad);
+ setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, kDMChampionAttributeLoad);
}
_vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
if (_panelContent == k0_PanelContentFoodWaterPoisoned)
- setFlag(curChampion->_attributes, k0x0800_ChampionAttributePanel);
+ setFlag(curChampion->_attributes, kDMChampionAttributePanel);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
_vm->_eventMan->hideMouse();
@@ -1030,7 +1030,7 @@ void InventoryMan::clickOnMouth() {
void InventoryMan::adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta) {
int16 delta;
if (valueDelta >= 0) {
- int16 currentValue = champ->_statistics[statIndex][k1_ChampionStatCurrent];
+ int16 currentValue = champ->_statistics[statIndex][kDMChampionStatCurrent];
if (currentValue > 120) {
valueDelta >>= 1;
if (currentValue > 150) {
@@ -1040,9 +1040,9 @@ void InventoryMan::adjustStatisticCurrentValue(Champion *champ, uint16 statIndex
}
delta = MIN(valueDelta, (int16)(170 - currentValue));
} else { /* BUG0_00 Useless code. The function is always called with valueDelta having a positive value */
- delta = MAX(valueDelta, int16(champ->_statistics[statIndex][k2_ChampionStatMinimum] - champ->_statistics[statIndex][k1_ChampionStatCurrent]));
+ delta = MAX(valueDelta, int16(champ->_statistics[statIndex][kDMChampionStatMinimum] - champ->_statistics[statIndex][kDMChampionStatCurrent]));
}
- champ->_statistics[statIndex][k1_ChampionStatCurrent] += delta;
+ champ->_statistics[statIndex][kDMChampionStatCurrent] += delta;
}
void InventoryMan::clickOnEye() {
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 81a341b850..bcbe89f7b6 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -175,9 +175,9 @@ void MenuMan::clearActingChampion() {
ChampionMan &cm = *_vm->_championMan;
if (cm._actingChampionOrdinal) {
cm._actingChampionOrdinal--;
- cm._champions[cm._actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
+ cm._champions[cm._actingChampionOrdinal].setAttributeFlag(kDMChampionAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._actingChampionOrdinal);
- cm._actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ cm._actingChampionOrdinal = _vm->indexToOrdinal(kDMChampionNone);
_refreshActionArea = true;
}
}
@@ -221,7 +221,7 @@ T0386006:
box2._y1 = 95;
box2._y2 = 110;
dm.blitToScreen(bitmapIcon, &box2, k8_byteWidth, kM1_ColorNoTransparency, 16);
- if (champion.getAttributes(k0x0008_ChampionAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) {
+ if (champion.getAttributes(kDMChampionAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) {
_vm->_displayMan->shadeScreenBox(&box, k0_ColorBlack);
}
}
@@ -259,7 +259,7 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
return;
} else {
champ = champMan._champions;
- int16 champIndex = k0_ChampionFirst;
+ int16 champIndex = kDMChampionFirst;
do {
if ((champIndex != champMan._leaderIndex)
@@ -268,7 +268,7 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
&& (champ->_dir != champ->_directionMaximumDamageReceived)) {
champ->_dir = (Direction)champ->_directionMaximumDamageReceived;
- champ->setAttributeFlag(k0x0400_ChampionAttributeIcon, true);
+ champ->setAttributeFlag(kDMChampionAttributeIcon, true);
champMan.drawChampionState((ChampionIndex)champIndex);
}
champ->_maximumDamageReceived = 0;
@@ -288,7 +288,7 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
}
} else {
_actionAreaContainsIcons = false;
- champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
+ champ->setAttributeFlag(kDMChampionAttributeActionHand, true);
champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._actingChampionOrdinal));
drawActionArea();
}
@@ -307,7 +307,7 @@ void MenuMan::drawActionArea() {
dispMan._useByteBoxCoordinates = false;
dispMan.fillScreenBox(_boxActionArea, k0_ColorBlack);
if (_actionAreaContainsIcons) {
- for (uint16 champIndex = k0_ChampionFirst; champIndex < champMan._partyChampionCount; ++champIndex)
+ for (uint16 champIndex = kDMChampionFirst; champIndex < champMan._partyChampionCount; ++champIndex)
drawActionIcon((ChampionIndex)champIndex);
} else if (champMan._actingChampionOrdinal) {
Box box = _boxActionArea3ActionMenu;
@@ -453,16 +453,16 @@ void MenuMan::setMagicCasterAndDrawSpellArea(ChampionIndex champIndex) {
static Box boxSpellAreaLine3(224, 319, 62, 73); // @ K0076_s_Box_SpellAreaLine3
if ((champIndex == _vm->_championMan->_magicCasterChampionIndex)
- || ((champIndex != kM1_ChampionNone) && !_vm->_championMan->_champions[champIndex]._currHealth))
+ || ((champIndex != kDMChampionNone) && !_vm->_championMan->_champions[champIndex]._currHealth))
return;
- if (_vm->_championMan->_magicCasterChampionIndex == kM1_ChampionNone) {
+ if (_vm->_championMan->_magicCasterChampionIndex == kDMChampionNone) {
_vm->_eventMan->showMouse();
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33);
_vm->_eventMan->hideMouse();
}
- if (champIndex == kM1_ChampionNone) {
- _vm->_championMan->_magicCasterChampionIndex = kM1_ChampionNone;
+ if (champIndex == kDMChampionNone) {
+ _vm->_championMan->_magicCasterChampionIndex = kDMChampionNone;
_vm->_eventMan->showMouse();
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->fillScreenBox(_boxSpellArea, k0_ColorBlack);
@@ -485,7 +485,7 @@ void MenuMan::drawEnabledMenus() {
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
} else {
ChampionIndex casterChampionIndex = _vm->_championMan->_magicCasterChampionIndex;
- _vm->_championMan->_magicCasterChampionIndex = kM1_ChampionNone; /* Force next function to draw the spell area */
+ _vm->_championMan->_magicCasterChampionIndex = kDMChampionNone; /* Force next function to draw the spell area */
setMagicCasterAndDrawSpellArea(casterChampionIndex);
if (!_vm->_championMan->_actingChampionOrdinal)
_actionAreaContainsIcons = true;
@@ -493,7 +493,7 @@ void MenuMan::drawEnabledMenus() {
drawActionArea();
int16 AL1462_i_InventoryChampionOrdinal = _vm->_inventoryMan->_inventoryChampionOrdinal;
if (AL1462_i_InventoryChampionOrdinal) {
- _vm->_inventoryMan->_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ _vm->_inventoryMan->_inventoryChampionOrdinal = _vm->indexToOrdinal(kDMChampionNone);
_vm->_inventoryMan->toggleInventory((ChampionIndex)_vm->ordinalToIndex(AL1462_i_InventoryChampionOrdinal));
} else {
_vm->_displayMan->drawFloorAndCeiling();
@@ -540,7 +540,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
if (skillLevel < requiredSkillLevel) {
int16 missingSkillLevelCount = requiredSkillLevel - skillLevel;
while (missingSkillLevelCount--) {
- if (_vm->getRandomNumber(128) > MIN(curChampion->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent] + 15, 115)) {
+ if (_vm->getRandomNumber(128) > MIN(curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatCurrent] + 15, 115)) {
_vm->_championMan->addSkillExperience(champIndex, curSpell->_skillIndex, experience >> (requiredSkillLevel - skillLevel));
menusPrintSpellFailureMessage(curChampion, k0_failureNeedsMorePractice, curSpell->_skillIndex);
return k0_spellCastFailure;
@@ -561,7 +561,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
curChampion->_load += _vm->_dungeonMan->getObjectWeight(newObject) - emptyFlaskWeight;
_vm->_championMan->drawChangedObjectIcons();
if (_vm->_inventoryMan->_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)) {
- setFlag(curChampion->_attributes, k0x0200_ChampionAttributeLoad);
+ setFlag(curChampion->_attributes, kDMChampionAttributeLoad);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
}
@@ -569,7 +569,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
case k2_spellKindProjectile:
if (curChampion->_dir != _vm->_dungeonMan->_partyDir) {
curChampion->_dir = _vm->_dungeonMan->_partyDir;
- setFlag(curChampion->_attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(curChampion->_attributes, kDMChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
if (curSpell->getType() == k4_spellType_projectileOpenDoor)
@@ -889,7 +889,7 @@ void MenuMan::addChampionSymbol(int16 symbolIndex) {
if (manaCost <= casterChampion->_currMana) {
casterChampion->_currMana -= manaCost;
- setFlag(casterChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(casterChampion->_attributes, kDMChampionAttributeStatistics);
casterChampion->_symbols[symbolStep] = 96 + (symbolStep * 6) + symbolIndex;
casterChampion->_symbols[symbolStep + 1] = '\0';
casterChampion->_symbolStep = symbolStep = returnNextVal(symbolStep);
@@ -932,7 +932,7 @@ bool MenuMan::didClickTriggerAction(int16 actionListIndex) {
if (_actionDisabledTicks[actionIndex])
curChampion->_actionDefense += _vm->_timeline->_actionDefense[actionIndex];
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
retVal = isActionPerformed(championIndex, actionIndex);
curChampion->_actionIndex = (ChampionAction)actionIndex;
}
@@ -1249,7 +1249,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
if (curChampion->_currMana < 0)
curChampion->_currMana = 0;
- setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
actionPerformed = true;
}
}
@@ -1340,7 +1340,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
void MenuMan::setChampionDirectionToPartyDirection(Champion *champ) {
if (champ->_dir != _vm->_dungeonMan->_partyDir) {
champ->_dir = _vm->_dungeonMan->_partyDir;
- setFlag(champ->_attributes, k0x0400_ChampionAttributeIcon);
+ setFlag(champ->_attributes, kDMChampionAttributeIcon);
}
}
@@ -1476,7 +1476,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
case k3_ViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
uint16 cellDelta = (viewCell == k2_ViewCellBackRight) ? 3 : 1;
/* Check if there is another champion in front */
- if (_vm->_championMan->getIndexInCell(normalizeModulo4(championCell + cellDelta)) != kM1_ChampionNone) {
+ if (_vm->_championMan->getIndexInCell(normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
_actionDamage = kM1_damageCantReach;
return false;
}
@@ -1627,7 +1627,7 @@ void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) {
};
Champion *curChampion = &_vm->_championMan->_champions[champIndex];
- if (getFlag(curChampion->_attributes, k0x0008_ChampionAttributeDisableAction) || !curChampion->_currHealth)
+ if (getFlag(curChampion->_attributes, kDMChampionAttributeDisableAction) || !curChampion->_currHealth)
return;
uint16 actionSetIndex;
@@ -1645,7 +1645,7 @@ void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) {
_vm->_championMan->_actingChampionOrdinal = _vm->indexToOrdinal(champIndex);
setActionList(actionSet);
_actionAreaContainsIcons = false;
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
drawActionArea();
drawActionArea();
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 7604479a76..77717de6e4 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -82,7 +82,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
if (processedSensorType == k0_SensorDisabled)
continue;
- if ((_vm->_championMan->_leaderIndex == kM1_ChampionNone) && (processedSensorType != k127_SensorWallChampionPortrait))
+ if ((_vm->_championMan->_leaderIndex == kDMChampionNone) && (processedSensorType != k127_SensorWallChampionPortrait))
continue;
if (cellIdx != cellParam)
@@ -327,11 +327,11 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
if (_vm->_championMan->_partyChampionCount > 0) {
if (_useRopeToClimbDownPit) {
Champion *curChampion = _vm->_championMan->_champions;
- for (int16 championIdx = k0_ChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
+ for (int16 championIdx = kDMChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
if (curChampion->_currHealth)
_vm->_championMan->decrementStamina(championIdx, ((curChampion->_load * 25) / _vm->_championMan->getMaximumLoad(curChampion)) + 1);
}
- } else if (_vm->_championMan->getDamagedChampionCount(20, k0x0010_ChampionWoundLegs | k0x0020_ChampionWoundFeet, k2_attackType_SELF))
+ } else if (_vm->_championMan->getDamagedChampionCount(20, kDMChampionWoundLegs | kDMChampionWoundFeet, k2_attackType_SELF))
_vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
}
_useRopeToClimbDownPit = false;
@@ -863,7 +863,7 @@ bool MovesensMan::isObjectInPartyPossession(int16 objectType) {
uint16 slotIdx = 0;
Thing curThing;
Thing *curSlotThing = nullptr;
- for (championIdx = k0_ChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
+ for (championIdx = kDMChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
if (curChampion->_currHealth) {
curSlotThing = curChampion->_slots;
for (slotIdx = k0_ChampionSlotReadyHand; (slotIdx < k30_ChampionSlotChest_1) || !leaderHandObjectProcessed; slotIdx++) {
@@ -938,12 +938,12 @@ void MovesensMan::triggerLocalEffect(int16 localEffect, int16 effX, int16 effY,
void MovesensMan::addSkillExperience(int16 skillIndex, uint16 exp, bool leaderOnly) {
if (leaderOnly) {
- if (_vm->_championMan->_leaderIndex != kM1_ChampionNone)
+ if (_vm->_championMan->_leaderIndex != kDMChampionNone)
_vm->_championMan->addSkillExperience(_vm->_championMan->_leaderIndex, skillIndex, exp);
} else {
exp /= _vm->_championMan->_partyChampionCount;
Champion *curChampion = _vm->_championMan->_champions;
- for (int16 championIdx = k0_ChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
+ for (int16 championIdx = kDMChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
if (curChampion->_currHealth)
_vm->_championMan->addSkillExperience(championIdx, skillIndex, exp);
}
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 15ccc52b3a..48f122c03d 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -195,7 +195,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
break;
}
if (championAttack && _projectilePoisonAttack && _vm->getRandomNumber(2)
- && _vm->_championMan->addPendingDamageAndWounds_getDamage(championIndex, attack, k0x0004_ChampionWoundHead | k0x0008_ChampionWoundTorso, _projectileAttackType))
+ && _vm->_championMan->addPendingDamageAndWounds_getDamage(championIndex, attack, kDMChampionWoundHead | kDMChampionWoundTorso, _projectileAttackType))
_vm->_championMan->championPoison(championIndex, _projectilePoisonAttack);
if (createExplosionOnImpact || removePotion) {
@@ -325,7 +325,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
attack += _vm->getRandomNumber(attack) + 1;
if ((explThing == Thing::_explFireBall) || (attack >>= 1)) {
if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (projectileMapX == _vm->_dungeonMan->_partyMapX) && (projectileMapY == _vm->_dungeonMan->_partyMapY)) {
- int16 wounds = k0x0001_ChampionWoundReadHand | k0x0002_ChampionWoundActionHand | k0x0004_ChampionWoundHead | k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs | k0x0020_ChampionWoundFeet;
+ int16 wounds = kDMChampionWoundReadHand | kDMChampionWoundActionHand | kDMChampionWoundHead | kDMChampionWoundTorso | kDMChampionWoundLegs | kDMChampionWoundFeet;
_vm->_championMan->getDamagedChampionCount(attack, wounds, k1_attackType_FIRE);
} else {
unusedThing = _vm->_groupMan->groupGetThing(projectileMapX, projectileMapY);
@@ -536,7 +536,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFF87:
if (explosionOnPartySquare)
- _vm->_championMan->getDamagedChampionCount(attack, k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
+ _vm->_championMan->getDamagedChampionCount(attack, kDMChampionWoundNone, k0_attackType_NORMAL);
else if ((groupThing != Thing::_endOfList)
&& (attack = _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(creatureType, attack))
&& (_vm->_groupMan->getDamageAllCreaturesOutcome(group, mapX, mapY, attack, true) != k2_outcomeKilledAllCreaturesInGroup)
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 9100f9b856..234881eb9f 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -333,7 +333,7 @@ void Timeline::processTimeline() {
break;
case k72_TMEventTypeChampionShield:
_vm->_championMan->_champions[newEvent._priority]._shieldDefense -= newEvent._B._defense;
- setFlag(_vm->_championMan->_champions[newEvent._priority]._attributes, k0x1000_ChampionAttributeStatusBox);
+ setFlag(_vm->_championMan->_champions[newEvent._priority]._attributes, kDMChampionAttributeStatusBox);
_vm->_championMan->drawChampionState((ChampionIndex)newEvent._priority);
break;
case k73_TMEventTypeThievesEye:
@@ -400,7 +400,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
// Strangerke
// Original bug fixed - A closing horizontal door wounds champions to the head instead of to the hands. Missing parenthesis in the condition cause all doors to wound the head in addition to the torso
// See BUG0_78
- int16 wounds = k0x0008_ChampionWoundTorso | (verticalDoorFl ? k0x0004_ChampionWoundHead : k0x0001_ChampionWoundReadHand | k0x0002_ChampionWoundActionHand);
+ int16 wounds = kDMChampionWoundTorso | (verticalDoorFl ? kDMChampionWoundHead : kDMChampionWoundReadHand | kDMChampionWoundActionHand);
if (_vm->_championMan->getDamagedChampionCount(5, wounds, k2_attackType_SELF))
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, mapX, mapY, k1_soundModePlayIfPrioritized);
}
@@ -815,7 +815,7 @@ void Timeline::procesEventEnableGroupGenerator(TimelineEvent *event) {
void Timeline::processEventEnableChampionAction(uint16 champIndex) {
Champion *curChampion = &_vm->_championMan->_champions[champIndex];
curChampion->_enableActionEventIndex = -1;
- clearFlag(curChampion->_attributes, k0x0008_ChampionAttributeDisableAction);
+ clearFlag(curChampion->_attributes, kDMChampionAttributeDisableAction);
if (curChampion->_actionIndex != k255_ChampionActionNone) {
curChampion->_actionDefense -= _actionDefense[curChampion->_actionDefense];
}
@@ -832,7 +832,7 @@ void Timeline::processEventEnableChampionAction(uint16 champIndex) {
}
}
}
- setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMChampionAttributeActionHand);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
curChampion->_actionIndex = k255_ChampionActionNone;
@@ -872,7 +872,7 @@ void Timeline::processEventHideDamageReceived(uint16 champIndex) {
_vm->_inventoryMan->drawStatusBoxPortrait((ChampionIndex)champIndex);
_vm->_eventMan->hideMouse();
} else {
- setFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle);
+ setFlag(curChampion->_attributes, kDMChampionAttributeNameTitle);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
}
@@ -904,8 +904,8 @@ void Timeline::processEventLight(TimelineEvent *event) {
}
void Timeline::refreshAllChampionStatusBoxes() {
- for (uint16 idx = k0_ChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++)
- setFlag(_vm->_championMan->_champions[idx]._attributes, k0x1000_ChampionAttributeStatusBox);
+ for (uint16 idx = kDMChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++)
+ setFlag(_vm->_championMan->_champions[idx]._attributes, kDMChampionAttributeStatusBox);
_vm->_championMan->drawAllChampionStates();
}