aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorStrangerke2016-09-09 07:32:32 +0200
committerStrangerke2016-09-09 07:32:32 +0200
commit93fb0efc0bd297be9399cd03b3523cb9f8117691 (patch)
treea5dbd542b44c19d7ca7e9db9394f8944d8918d0e /engines/dm
parent1b482a1e129b2bf00f49a9c4ef5c8d84470be1af (diff)
downloadscummvm-rg350-93fb0efc0bd297be9399cd03b3523cb9f8117691.tar.gz
scummvm-rg350-93fb0efc0bd297be9399cd03b3523cb9f8117691.tar.bz2
scummvm-rg350-93fb0efc0bd297be9399cd03b3523cb9f8117691.zip
DM: More renaming in champion.h
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp264
-rw-r--r--engines/dm/champion.h181
-rw-r--r--engines/dm/dm.cpp2
-rw-r--r--engines/dm/eventman.cpp22
-rw-r--r--engines/dm/group.cpp6
-rw-r--r--engines/dm/inventory.cpp38
-rw-r--r--engines/dm/menus.cpp40
-rw-r--r--engines/dm/movesens.cpp4
-rw-r--r--engines/dm/projexpl.cpp6
-rw-r--r--engines/dm/timeline.cpp12
10 files changed, 287 insertions, 288 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index f550e678dd..eeea8bf045 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -230,9 +230,9 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
experience += weaponKineticEnergy >> 2;
}
}
- addSkillExperience(champIndex, k10_ChampionSkillThrow, experience);
+ addSkillExperience(champIndex, kDMSkillThrow, experience);
kineticEnergy += weaponKineticEnergy;
- int16 skillLevel = getSkillLevel((ChampionIndex)champIndex, k10_ChampionSkillThrow);
+ int16 skillLevel = getSkillLevel((ChampionIndex)champIndex, kDMSkillThrow);
kineticEnergy += _vm->getRandomNumber(16) + (kineticEnergy >> 1) + skillLevel;
int16 attack = getBoundedValue((uint16)40, (uint16)((skillLevel << 3) + _vm->getRandomNumber(32)), (uint16)200);
int16 stepEnergy = MAX(5, 11 - skillLevel);
@@ -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 = kDMChampionStatLuck;
+ int16 statIndex = kDMStatLuck;
int16 modifier = 0;
ThingType thingType = thing.getType();
@@ -304,23 +304,23 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
if (cursed) {
- statIndex = kDMChampionStatLuck;
+ statIndex = kDMStatLuck;
modifier = -3;
}
}
if (!cursed) {
- statIndex = (ChampionStatisticType)thingType; // variable sharing
+ statIndex = (ChampionStatType)thingType; // variable sharing
if ((iconIndex == kDMIconIndiceJunkRabbitsFoot) && (slotIndex < k30_ChampionSlotChest_1)) {
- statIndex = kDMChampionStatLuck;
+ statIndex = kDMStatLuck;
modifier = 10;
} else if (slotIndex == k1_ChampionSlotActionHand) {
if (iconIndex == kDMIconIndiceWeaponMaceOfOrder) {
- statIndex = kDMChampionStatStrength;
+ statIndex = kDMStatStrength;
modifier = 5;
} else {
- statIndex = kDMChampionStatMana;
+ statIndex = kDMStatMana;
if ((iconIndex >= kDMIconIndiceWeaponStaffOfClawsEmpty) && (iconIndex <= kDMIconIndiceWeaponStaffOfClawsFull)) {
modifier = 4;
} else {
@@ -368,17 +368,17 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
}
} else if (slotIndex == k4_ChampionSlotLegs) {
if (iconIndex == kDMIconIndiceArmourPowertowers) {
- statIndex = kDMChampionStatStrength;
+ statIndex = kDMStatStrength;
modifier = 10;
}
} else if (slotIndex == k2_ChampionSlotHead) {
switch (iconIndex) {
case kDMIconIndiceArmourCrownOfNerra:
- statIndex = kDMChampionStatWisdom;
+ statIndex = kDMStatWisdom;
modifier = 10;
break;
case kDMIconIndiceArmourDexhelm:
- statIndex = kDMChampionStatDexterity;
+ statIndex = kDMStatDexterity;
modifier = 10;
break;
default:
@@ -387,11 +387,11 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
} else if (slotIndex == k3_ChampionSlotTorso) {
switch (iconIndex) {
case kDMIconIndiceArmourFlamebain:
- statIndex = kDMChampionStatAntifire;
+ statIndex = kDMStatAntifire;
modifier = 12;
break;
case kDMIconIndiceArmourCloakOfNight:
- statIndex = kDMChampionStatDexterity;
+ statIndex = kDMStatDexterity;
modifier = 8;
break;
default:
@@ -401,15 +401,15 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
switch (iconIndex) {
case kDMIconIndiceJunkJewelSymalUnequipped:
case kDMIconIndiceJunkJewelSymalEquipped:
- statIndex = kDMChampionStatAntimagic;
+ statIndex = kDMStatAntimagic;
modifier = 15;
break;
case kDMIconIndiceArmourCloakOfNight:
- statIndex = kDMChampionStatDexterity;
+ statIndex = kDMStatDexterity;
modifier = 8;
break;
case kDMIconIndiceJunkMoonstone:
- statIndex = kDMChampionStatMana;
+ statIndex = kDMStatMana;
modifier = 3;
break;
default:
@@ -421,11 +421,11 @@ void ChampionMan::applyModifiersToStatistics(Champion *champ, int16 slotIndex, i
if (modifier) {
modifier *= modifierFactor;
//statIndex is set when modifier is set
- if (statIndex == kDMChampionStatMana) {
+ if (statIndex == kDMStatMana) {
champ->_maxMana += modifier;
- } else if (statIndex < kDMChampionStatAntifire + 1) {
- for (uint16 statValIndex = kDMChampionStatMaximum; statValIndex <= kDMChampionStatMinimum; ++statValIndex) {
- champ->getStatistic((ChampionStatisticType)statIndex, (ChampionStatisticValue)statValIndex) += modifier;
+ } else if (statIndex < kDMStatAntifire + 1) {
+ for (uint16 statValIndex = kDMStatMaximum; statValIndex <= kDMStatMinimum; ++statValIndex) {
+ champ->getStatistic((ChampionStatType)statIndex, (ChampionStatValue)statValIndex) += modifier;
}
}
}
@@ -511,7 +511,7 @@ void ChampionMan::drawChangedObjectIcons() {
}
if (drawViewport) {
- champ->setAttributeFlag(kDMChampionAttributeViewport, true);
+ champ->setAttributeFlag(kDMAttributeViewport, 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(kDMChampionAttributeLoad, true);
+ champ->setAttributeFlag(kDMAttributeLoad, true);
IconIndice iconIndex = objMan.getIconIndex(thing);
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal);
applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
@@ -546,7 +546,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if (slotIndex < k2_ChampionSlotHead) {
if (slotIndex == k1_ChampionSlotActionHand) {
- champ->setAttributeFlag(kDMChampionAttributeActionHand, true);
+ champ->setAttributeFlag(kDMAttributeActionHand, true);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
menuMan.clearActingChampion();
@@ -562,7 +562,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
drawChangedObjectIcons();
} else if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand) &&
((iconIndex == kDMIconIndiceContainerChestClosed) || ((iconIndex >= kDMIconIndiceScrollOpen) && (iconIndex <= kDMIconIndiceScrollClosed)))) {
- champ->setAttributeFlag(kDMChampionAttributePanel, true);
+ champ->setAttributeFlag(kDMAttributePanel, true);
}
} else if (slotIndex == k10_ChampionSlotNeck) {
if ((iconIndex >= kDMIconIndiceJunkIllumuletUnequipped) && (iconIndex <= kDMIconIndiceJunkIllumuletEquipped)) {
@@ -578,7 +578,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
drawSlot(champIndex, slotIndex);
if (isInventoryChampion)
- champ->setAttributeFlag(kDMChampionAttributeViewport, true);
+ champ->setAttributeFlag(kDMAttributeViewport, true);
}
int16 ChampionMan::getScentOrdinal(int16 mapX, int16 mapY) {
@@ -613,7 +613,7 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() {
_vm->_eventMan->hideMouse();
if (_leaderIndex != kDMChampionNone) {
_champions[_leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(leaderHandObject);
- setFlag(_champions[_leaderIndex]._attributes, kDMChampionAttributeLoad);
+ setFlag(_champions[_leaderIndex]._attributes, kDMAttributeLoad);
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[kDMChampionStatStrength][kDMChampionStatCurrent];
+ int16 strength = _vm->getRandomNumber(16) + curChampion->_statistics[kDMStatStrength][kDMStatCurrent];
Thing curThing = curChampion->_slots[slotIndex];
uint16 objectWeight = _vm->_dungeonMan->getObjectWeight(curThing);
uint16 oneSixteenthMaximumLoad = getMaximumLoad(curChampion) >> 4;
@@ -643,18 +643,18 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) {
uint16 skillLevel = 0;
uint16 weaponClass = weaponInfo->_class;
if ((weaponClass == k0_WeaponClassSwingWeapon) || (weaponClass == k2_WeaponClassDaggerAndAxes)) {
- skillLevel = getSkillLevel(champIndex, k4_ChampionSkillSwing);
+ skillLevel = getSkillLevel(champIndex, kDMSkillSwing);
}
if ((weaponClass != k0_WeaponClassSwingWeapon) && (weaponClass < k16_WeaponClassFirstBow)) {
- skillLevel += getSkillLevel(champIndex, k10_ChampionSkillThrow);
+ skillLevel += getSkillLevel(champIndex, kDMSkillThrow);
}
if ((weaponClass >= k16_WeaponClassFirstBow) && (weaponClass < k112_WeaponClassFirstMagicWeapon)) {
- skillLevel += getSkillLevel(champIndex, k11_ChampionSkillShoot);
+ skillLevel += getSkillLevel(champIndex, kDMSkillShoot);
}
strength += skillLevel << 1;
}
strength = getStaminaAdjustedValue(curChampion, strength);
- if (getFlag(curChampion->_wounds, (slotIndex == k0_ChampionSlotReadyHand) ? kDMChampionWoundReadHand : kDMChampionWoundActionHand)) {
+ if (getFlag(curChampion->_wounds, (slotIndex == k0_ChampionSlotReadyHand) ? kDMWoundReadHand : kDMWoundActionHand)) {
strength >>= 1;
}
return getBoundedValue(0, strength >> 1, 100);
@@ -693,11 +693,11 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
drawSlot(champIndex, slotIndex);
if (isInventoryChampion)
- setFlag(curChampion->_attributes, kDMChampionAttributeViewport);
+ setFlag(curChampion->_attributes, kDMAttributeViewport);
if (slotIndex < k2_ChampionSlotHead) {
if (slotIndex == k1_ChampionSlotActionHand) {
- setFlag(curChampion->_attributes, kDMChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand);
if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
_vm->_menuMan->clearActingChampion();
@@ -720,7 +720,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
// No break on purpose
case kDMIconIndiceScrollOpen:
case kDMIconIndiceScrollClosed:
- setFlag(curChampion->_attributes, kDMChampionAttributePanel);
+ setFlag(curChampion->_attributes, kDMAttributePanel);
break;
default:
break;
@@ -728,7 +728,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
}
}
curChampion->_load -= _vm->_dungeonMan->getObjectWeight(curThing);
- setFlag(curChampion->_attributes, kDMChampionAttributeLoad);
+ setFlag(curChampion->_attributes, kDMAttributeLoad);
return curThing;
}
@@ -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, kDMChampionWoundNone, k0_attackType_NORMAL);
+ addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, kDMWoundNone, k0_attackType_NORMAL);
} else if (stamina > curChampion->_maxStamina) {
curChampion->_currStamina = curChampion->_maxStamina;
}
- setFlag(curChampion->_attributes, kDMChampionAttributeLoad | kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeLoad | kDMAttributeStatistics);
}
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[kDMChampionStatWisdom][kDMChampionStatCurrent];
+ int16 wisdomFactor = 115 - curChampion->_statistics[kDMStatWisdom][kDMStatCurrent];
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, kDMChampionStatAntimagic, attack);
+ attack = getStatisticAdjustedAttack(curChampion, kDMStatAntimagic, attack);
attack -= _party._spellShieldDefense;
skipScaling = true;
break;
case k1_attackType_FIRE:
- attack = getStatisticAdjustedAttack(curChampion, kDMChampionStatAntifire, attack);
+ attack = getStatisticAdjustedAttack(curChampion, kDMStatAntifire, 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, kDMChampionStatVitality, _vm->getRandomNumber(128) + 10);
+ int16 adjustedAttack = getStatisticAdjustedAttack(curChampion, kDMStatVitality, _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[kDMChampionStatVitality][kDMChampionStatCurrent] >> 3) + 1);
+ int16 woundDefense = _vm->getRandomNumber((curChampion->_statistics[kDMStatVitality][kDMStatCurrent] >> 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][kDMChampionStatCurrent];
+ int16 factor = 170 - champ->_statistics[statIndex][kDMStatCurrent];
/* 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, kDMChampionAttributeActionHand | kDMChampionAttributeDisableAction);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand | kDMAttributeDisableAction);
drawChampionState((ChampionIndex)champIndex);
}
setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime);
@@ -947,7 +947,7 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
}
void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint16 exp) {
- if ((skillIndex >= k4_ChampionSkillSwing) && (skillIndex <= k11_ChampionSkillShoot) && (_vm->_projexpl->_lastCreatureAttackTime < _vm->_gameTime - 150))
+ if ((skillIndex >= kDMSkillSwing) && (skillIndex <= kDMSkillShoot) && (_vm->_projexpl->_lastCreatureAttackTime < _vm->_gameTime - 150))
exp >>= 1;
if (exp) {
@@ -956,14 +956,14 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
Champion *curChampion = &_champions[champIndex];
uint16 baseSkillIndex;
- if (skillIndex >= k4_ChampionSkillSwing)
- baseSkillIndex = (skillIndex - k4_ChampionSkillSwing) >> 2;
+ if (skillIndex >= kDMSkillSwing)
+ baseSkillIndex = (skillIndex - kDMSkillSwing) >> 2;
else
baseSkillIndex = skillIndex;
uint16 skillLevelBefore = getSkillLevel(champIndex, baseSkillIndex | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience));
- if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_lastCreatureAttackTime > _vm->_gameTime - 25))
+ if ((skillIndex >= kDMSkillSwing) && (_vm->_projexpl->_lastCreatureAttackTime > _vm->_gameTime - 25))
exp <<= 1;
Skill *curSkill = &curChampion->_skills[skillIndex];
@@ -972,7 +972,7 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
curSkill->_temporaryExperience += getBoundedValue(1, exp >> 3, 100);
curSkill = &curChampion->_skills[baseSkillIndex];
- if (skillIndex >= k4_ChampionSkillSwing)
+ if (skillIndex >= kDMSkillSwing)
curSkill->_experience += exp;
uint16 skillLevelAfter = getSkillLevel(champIndex, baseSkillIndex | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience));
@@ -981,37 +981,37 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
int16 minorStatIncrease = _vm->getRandomNumber(2);
int16 majorStatIncrease = 1 + _vm->getRandomNumber(2);
uint16 vitalityAmount = _vm->getRandomNumber(2); /* For Priest skill, the amount is 0 or 1 for all skill levels */
- if (baseSkillIndex != k2_ChampionSkillPriest) {
+ if (baseSkillIndex != kDMSkillPriest) {
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[kDMChampionStatVitality][kDMChampionStatMaximum] += vitalityAmount;
+ curChampion->_statistics[kDMStatVitality][kDMStatMaximum] += vitalityAmount;
uint16 staminaAmount = curChampion->_maxStamina;
- 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 */
+ curChampion->_statistics[kDMStatAntifire][kDMStatMaximum] += _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:
+ case kDMSkillFighter:
staminaAmount >>= 4;
skillLevelAfter *= 3;
- curChampion->_statistics[kDMChampionStatStrength][kDMChampionStatMaximum] += majorStatIncrease;
- curChampion->_statistics[kDMChampionStatDexterity][kDMChampionStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMStatStrength][kDMStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMStatDexterity][kDMStatMaximum] += minorStatIncrease;
break;
- case k1_ChampionSkillNinja:
+ case kDMSkillNinja:
staminaAmount /= 21;
skillLevelAfter <<= 1;
- curChampion->_statistics[kDMChampionStatStrength][kDMChampionStatMaximum] += minorStatIncrease;
- curChampion->_statistics[kDMChampionStatDexterity][kDMChampionStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMStatStrength][kDMStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMStatDexterity][kDMStatMaximum] += majorStatIncrease;
break;
- case k3_ChampionSkillWizard:
+ case kDMSkillWizard:
staminaAmount >>= 5;
curChampion->_maxMana += skillLevelAfter + (skillLevelAfter >> 1);
- curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatMaximum] += majorStatIncrease;
+ curChampion->_statistics[kDMStatWisdom][kDMStatMaximum] += majorStatIncrease;
increaseManaFl = true;
break;
- case k2_ChampionSkillPriest:
+ case kDMSkillPriest:
staminaAmount /= 25;
curChampion->_maxMana += skillLevelAfter;
skillLevelAfter += (skillLevelAfter + 1) >> 1;
- curChampion->_statistics[kDMChampionStatWisdom][kDMChampionStatMaximum] += minorStatIncrease;
+ curChampion->_statistics[kDMStatWisdom][kDMStatMaximum] += 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[kDMChampionStatAntimagic][kDMChampionStatMaximum] += _vm->getRandomNumber(3);
+ curChampion->_statistics[kDMStatAntimagic][kDMStatMaximum] += _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, kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
drawChampionState((ChampionIndex)champIndex);
_vm->_textMan->printLineFeed();
Color curChampionColor = _championColor[champIndex];
@@ -1083,7 +1083,7 @@ int16 ChampionMan::getTargetChampionIndex(int16 mapX, int16 mapY, uint16 cell) {
}
int16 ChampionMan::getDexterity(Champion *champ) {
- int16 dexterity = _vm->getRandomNumber(8) + champ->_statistics[kDMChampionStatDexterity][kDMChampionStatCurrent];
+ int16 dexterity = _vm->getRandomNumber(8) + champ->_statistics[kDMStatDexterity][kDMStatCurrent];
dexterity -= ((int32)(dexterity >> 1) * (int32)champ->_load) / getMaximumLoad(champ);
if (_partyIsSleeping)
dexterity >>= 1;
@@ -1095,9 +1095,9 @@ bool ChampionMan::isLucky(Champion *champ, uint16 percentage) {
if (_vm->getRandomNumber(2) && (_vm->getRandomNumber(100) > percentage))
return true;
- 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]);
+ unsigned char *curStat = champ->_statistics[kDMStatLuck];
+ bool isLucky = (_vm->getRandomNumber(curStat[kDMStatCurrent]) > percentage);
+ curStat[kDMStatCurrent] = getBoundedValue<char>(curStat[kDMStatMinimum], curStat[kDMStatCurrent] + (isLucky ? -2 : 2), curStat[kDMStatMaximum]);
return isLucky;
}
@@ -1106,10 +1106,10 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
return;
Champion *curChampion = &_champions[champIndex];
- addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMChampionWoundNone, k0_attackType_NORMAL);
- setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
+ addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMWoundNone, k0_attackType_NORMAL);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
- setFlag(curChampion->_attributes, kDMChampionAttributePanel);
+ setFlag(curChampion->_attributes, kDMAttributePanel);
}
if (--attack) {
@@ -1208,7 +1208,7 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) {
_vm->_eventMan->hideMouse();
if (_leaderIndex != kDMChampionNone) {
_champions[_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thing);
- setFlag(_champions[_leaderIndex]._attributes, kDMChampionAttributeLoad);
+ setFlag(_champions[_leaderIndex]._attributes, kDMAttributeLoad);
drawChampionState(_leaderIndex);
}
}
@@ -1235,7 +1235,7 @@ int16 ChampionMan::getMovementTicks(Champion *champ) {
woundTicks = 2;
}
- if (getFlag(champ->_wounds, kDMChampionWoundFeet))
+ if (getFlag(champ->_wounds, kDMWoundFeet))
ticks += woundTicks;
if (_vm->_objectMan->getIconIndex(champ->_slots[k5_ChampionSlotFeet]) == kDMIconIndiceArmourBootOfSpeed)
@@ -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, kDMChampionAttributeActionHand | kDMChampionAttributeStatusBox | kDMChampionAttributeIcon);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand | kDMAttributeStatusBox | kDMAttributeIcon);
drawChampionState((ChampionIndex)champIndex);
}
@@ -1344,7 +1344,7 @@ bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 ki
return false;
curChampion->_currMana -= requiredManaAmount;
- setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
int16 stepEnergy = 10 - MIN(8, curChampion->_maxMana >> 3);
if (kineticEnergy < (stepEnergy << 2)) {
kineticEnergy += 3;
@@ -1385,9 +1385,9 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
championKill(championIndex);
} else {
championPtr->_currHealth = curHealth;
- setFlag(championPtr->_attributes, kDMChampionAttributeStatistics);
+ setFlag(championPtr->_attributes, kDMAttributeStatistics);
if (pendingWounds) {
- setFlag(championPtr->_attributes, kDMChampionAttributeWounds);
+ setFlag(championPtr->_attributes, kDMAttributeWounds);
}
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, kDMChampionAttributeStatusBox);
+ setFlag(curChampion->_attributes, kDMAttributeStatusBox);
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingEye) {
_vm->_pressingEye = false;
@@ -1593,9 +1593,9 @@ void ChampionMan::applyTimeEffects() {
Champion *championPtr = _champions;
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);
+ uint16 wizardSkillLevel = getSkillLevel(championIndex, kDMSkillWizard) + getSkillLevel(championIndex, kDMSkillPriest);
if ((championPtr->_currMana < championPtr->_maxMana)
- && (timeCriteria < championPtr->_statistics[kDMChampionStatWisdom][kDMChampionStatCurrent] + wizardSkillLevel)) {
+ && (timeCriteria < championPtr->_statistics[kDMStatWisdom][kDMStatCurrent] + wizardSkillLevel)) {
int16 manaGain = championPtr->_maxMana / 40;
if (_partyIsSleeping)
manaGain <<= 1;
@@ -1606,7 +1606,7 @@ void ChampionMan::applyTimeEffects() {
} else if (championPtr->_currMana > championPtr->_maxMana)
championPtr->_currMana--;
- for (int16 idx = k19_ChampionSkillWater; idx >= k0_ChampionSkillFighter; idx--) {
+ for (int16 idx = kDMSkillWater; idx >= kDMSkillFighter; idx--) {
if (championPtr->_skills[idx]._temporaryExperience > 0)
championPtr->_skills[idx]._temporaryExperience--;
}
@@ -1658,7 +1658,7 @@ void ChampionMan::applyTimeEffects() {
if (championPtr->_water < -1024)
championPtr->_water = -1024;
- if ((championPtr->_currHealth < championPtr->_maxHealth) && (championPtr->_currStamina >= (championPtr->_maxStamina >> 2)) && (timeCriteria < (championPtr->_statistics[kDMChampionStatVitality][kDMChampionStatCurrent] + 12))) {
+ if ((championPtr->_currHealth < championPtr->_maxHealth) && (championPtr->_currStamina >= (championPtr->_maxStamina >> 2)) && (timeCriteria < (championPtr->_statistics[kDMStatVitality][kDMStatCurrent] + 12))) {
int16 healthGain = (championPtr->_maxHealth >> 7) + 1;
if (_partyIsSleeping)
healthGain <<= 1;
@@ -1669,24 +1669,24 @@ void ChampionMan::applyTimeEffects() {
championPtr->_currHealth += MIN(healthGain, (int16)(championPtr->_maxHealth - championPtr->_currHealth));
}
if (!((int)_vm->_gameTime & (_partyIsSleeping ? 63 : 255))) {
- for (uint16 i = kDMChampionStatLuck; i <= kDMChampionStatAntifire; i++) {
+ for (uint16 i = kDMStatLuck; i <= kDMStatAntifire; i++) {
byte *curStatistic = championPtr->_statistics[i];
- uint16 statisticMaximum = curStatistic[kDMChampionStatMaximum];
- if (curStatistic[kDMChampionStatCurrent] < statisticMaximum)
- curStatistic[kDMChampionStatCurrent]++;
- else if (curStatistic[kDMChampionStatCurrent] > statisticMaximum)
- curStatistic[kDMChampionStatCurrent] -= curStatistic[kDMChampionStatCurrent] / statisticMaximum;
+ uint16 statisticMaximum = curStatistic[kDMStatMaximum];
+ if (curStatistic[kDMStatCurrent] < statisticMaximum)
+ curStatistic[kDMStatCurrent]++;
+ else if (curStatistic[kDMStatCurrent] > statisticMaximum)
+ curStatistic[kDMStatCurrent] -= curStatistic[kDMStatCurrent] / 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, kDMChampionAttributeIcon);
+ setFlag(championPtr->_attributes, kDMAttributeIcon);
}
- setFlag(championPtr->_attributes, kDMChampionAttributeStatistics);
+ setFlag(championPtr->_attributes, kDMAttributeStatistics);
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
- setFlag(championPtr->_attributes, kDMChampionAttributePanel);
+ setFlag(championPtr->_attributes, kDMAttributePanel);
}
}
}
@@ -1839,8 +1839,8 @@ void ChampionMan::resetDataToStartGame() {
Champion *curChampion = _champions;
for (int16 idx = 0; idx < _partyChampionCount; idx++, curChampion++) {
- clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
- setFlag(curChampion->_attributes, kDMChampionAttributeActionHand | kDMChampionAttributeStatusBox | kDMChampionAttributeIcon);
+ clearFlag(curChampion->_attributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand | kDMAttributeStatusBox | kDMAttributeIcon);
}
drawAllChampionStates();
@@ -1885,7 +1885,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
viewCell++;
championPtr->_cell = (ViewCell)normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir);
- championPtr->_attributes = kDMChampionAttributeIcon;
+ championPtr->_attributes = kDMAttributeIcon;
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, kDMChampionAttributeMale);
+ setFlag(championPtr->_attributes, kDMAttributeMale);
decodedStringPtr++;
championPtr->_currHealth = championPtr->_maxHealth = getDecodedValue(decodedStringPtr, 4);
@@ -1929,19 +1929,19 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
championPtr->_currMana = championPtr->_maxMana = getDecodedValue(decodedStringPtr, 4);
decodedStringPtr += 4;
decodedStringPtr++;
- for (int16 statIdx = kDMChampionStatLuck; statIdx <= kDMChampionStatAntifire; statIdx++) {
- championPtr->_statistics[statIdx][kDMChampionStatMinimum] = 30;
- championPtr->_statistics[statIdx][kDMChampionStatCurrent] = championPtr->_statistics[statIdx][kDMChampionStatMaximum] = getDecodedValue(decodedStringPtr, 2);
+ for (int16 statIdx = kDMStatLuck; statIdx <= kDMStatAntifire; statIdx++) {
+ championPtr->_statistics[statIdx][kDMStatMinimum] = 30;
+ championPtr->_statistics[statIdx][kDMStatCurrent] = championPtr->_statistics[statIdx][kDMStatMaximum] = getDecodedValue(decodedStringPtr, 2);
decodedStringPtr += 2;
}
- championPtr->_statistics[kDMChampionStatLuck][kDMChampionStatMinimum] = 10;
+ championPtr->_statistics[kDMStatLuck][kDMStatMinimum] = 10;
decodedStringPtr++;
- for (uint16 skillIdx = k4_ChampionSkillSwing; skillIdx <= k19_ChampionSkillWater; skillIdx++) {
+ for (uint16 skillIdx = kDMSkillSwing; skillIdx <= kDMSkillWater; skillIdx++) {
int skillValue = *decodedStringPtr++ - 'A';
if (skillValue > 0)
championPtr->_skills[skillIdx]._experience = 125L << skillValue;
}
- for (uint16 skillIdx = k0_ChampionSkillFighter; skillIdx <= k3_ChampionSkillWizard; skillIdx++) {
+ for (uint16 skillIdx = kDMSkillFighter; skillIdx <= kDMSkillWizard; skillIdx++) {
int32 baseSkillExperience = 0;
int16 hiddenSkillIndex = (skillIdx + 1) << 2;
for (uint16 hiddenIdx = 0; hiddenIdx < 4; hiddenIdx++)
@@ -2098,11 +2098,11 @@ uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) {
}
uint16 ChampionMan::getMaximumLoad(Champion *champ) {
- uint16 maximumLoad = champ->getStatistic(kDMChampionStatStrength, kDMChampionStatCurrent) * 8 + 100;
+ uint16 maximumLoad = champ->getStatistic(kDMStatStrength, kDMStatCurrent) * 8 + 100;
maximumLoad = getStaminaAdjustedValue(champ, maximumLoad);
int16 wounds = champ->getWounds();
if (wounds)
- maximumLoad -= maximumLoad >> (champ->getWoundsFlag(kDMChampionWoundLegs) ? 2 : 3);
+ maximumLoad -= maximumLoad >> (champ->getWoundsFlag(kDMWoundLegs) ? 2 : 3);
if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == kDMIconIndiceArmourElvenBoots)
maximumLoad += maximumLoad * 16;
@@ -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, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand))
+ if (!getFlag(championAttributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand))
return;
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal);
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_eventMan->showMouse();
- if (getFlag(championAttributes, kDMChampionAttributeStatusBox)) {
+ if (getFlag(championAttributes, kDMAttributeStatusBox)) {
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, kDMChampionAttributeStatistics);
+ setFlag(championAttributes, kDMAttributeStatistics);
} else
- setFlag(championAttributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeWounds | kDMChampionAttributeActionHand);
+ setFlag(championAttributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeWounds | kDMAttributeActionHand);
} 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, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand);
_vm->_eventMan->hideMouse();
return;
}
}
if (!(curChampion->_currHealth)) {
- clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand);
_vm->_eventMan->hideMouse();
return;
}
- if (getFlag(championAttributes, kDMChampionAttributeNameTitle)) {
+ if (getFlag(championAttributes, kDMAttributeNameTitle)) {
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, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
} 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, kDMChampionAttributeStatistics)) {
+ if (getFlag(championAttributes, kDMAttributeStatistics)) {
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 = kDMChampionStatStrength; i <= kDMChampionStatAntifire; i++) {
- if ((curChampion->_statistics[i][kDMChampionStatCurrent] < curChampion->_statistics[i][kDMChampionStatMaximum])) {
+ for (int i = kDMStatStrength; i <= kDMStatAntifire; i++) {
+ if ((curChampion->_statistics[i][kDMStatCurrent] < curChampion->_statistics[i][kDMStatMaximum])) {
nativeBitmapIndex = k34_SlotBoxWoundedIndice;
break;
}
}
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxEye, k16_byteWidth, k12_ColorDarkestGray, 18);
- setFlag(championAttributes, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
}
}
- if (getFlag(championAttributes, kDMChampionAttributeWounds)) {
+ if (getFlag(championAttributes, kDMAttributeWounds)) {
for (int i = isInventoryChampion ? k5_ChampionSlotFeet : k1_ChampionSlotActionHand; i >= k0_ChampionSlotReadyHand; i--)
drawSlot(champIndex, i);
if (isInventoryChampion)
- setFlag(championAttributes, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
}
- if (getFlag(championAttributes, kDMChampionAttributeLoad) && isInventoryChampion) {
+ if (getFlag(championAttributes, kDMAttributeLoad) && 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, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
}
uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir);
- if (getFlag(championAttributes, kDMChampionAttributeIcon) && (_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) {
+ if (getFlag(championAttributes, kDMAttributeIcon) && (_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, kDMChampionAttributePanel) && isInventoryChampion) {
+ if (getFlag(championAttributes, kDMAttributePanel) && 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, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
}
- if (getFlag(championAttributes, kDMChampionAttributeActionHand)) {
+ if (getFlag(championAttributes, kDMAttributeActionHand)) {
drawSlot(champIndex, k1_ChampionSlotActionHand);
_vm->_menuMan->drawActionIcon(champIndex);
if (isInventoryChampion)
- setFlag(championAttributes, kDMChampionAttributeViewport);
+ setFlag(championAttributes, kDMAttributeViewport);
}
- if (getFlag(championAttributes, kDMChampionAttributeViewport))
+ if (getFlag(championAttributes, kDMAttributeViewport))
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
- clearFlag(curChampion->_attributes, kDMChampionAttributeNameTitle | kDMChampionAttributeStatistics | kDMChampionAttributeLoad | kDMChampionAttributeIcon | kDMChampionAttributePanel | kDMChampionAttributeStatusBox | kDMChampionAttributeWounds | kDMChampionAttributeViewport | kDMChampionAttributeActionHand);
+ clearFlag(curChampion->_attributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand);
_vm->_eventMan->hideMouse();
}
@@ -2557,9 +2557,9 @@ uint16 ChampionMan::getSkillLevel(int16 champIndex, uint16 skillIndex) {
if (!ignoreTmpExp)
exp += skill->_temporaryExperience;
- if (skillIndex > k3_ChampionSkillWizard) {
+ if (skillIndex > kDMSkillWizard) {
// Hidden skill
- skill = &champ->_skills[(skillIndex - k4_ChampionSkillSwing) >> 2];
+ skill = &champ->_skills[(skillIndex - kDMSkillSwing) >> 2];
exp += skill->_experience; // Add experience in the base skill
if (!ignoreTmpExp)
exp += skill->_temporaryExperience;
@@ -2580,20 +2580,20 @@ uint16 ChampionMan::getSkillLevel(int16 champIndex, uint16 skillIndex) {
int16 neckIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[k10_ChampionSlotNeck]);
switch (skillIndex) {
- case k3_ChampionSkillWizard:
+ case kDMSkillWizard:
if (neckIconIndex == kDMIconIndiceJunkPendantFeral)
skillLevel += 1;
break;
- case k13_ChampionSkillHeal:
+ case kDMSkillHeal:
// The skill modifiers of these two objects are not cumulative
if ((neckIconIndex == kDMIconIndiceJunkGemOfAges) || (actionHandIconIndex == kDMIconIndiceWeaponSceptreOfLyf))
skillLevel += 1;
break;
- case k14_ChampionSkillInfluence:
+ case kDMSkillInfluence:
if (neckIconIndex == kDMIconIndiceJunkMoonstone)
skillLevel += 1;
break;
- case k15_ChampionSkillDefend:
+ case kDMSkillDefend:
if (neckIconIndex == kDMIconIndiceJunkEkkhardCross)
skillLevel += 1;
break;
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index 3ddf097051..ef47994704 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -183,70 +183,69 @@ enum ChampionIndex {
};
enum ChampionAttribute {
- 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
+ kDMAttributNone = 0x0000, // @ MASK0x0000_NONE
+ kDMAttributeDisableAction = 0x0008, // @ MASK0x0008_DISABLE_ACTION
+ kDMAttributeMale = 0x0010, // @ MASK0x0010_MALE
+ kDMAttributeNameTitle = 0x0080, // @ MASK0x0080_NAME_TITLE
+ kDMAttributeStatistics = 0x0100, // @ MASK0x0100_STATISTICS
+ kDMAttributeLoad = 0x0200, // @ MASK0x0200_LOAD
+ kDMAttributeIcon = 0x0400, // @ MASK0x0400_ICON
+ kDMAttributePanel = 0x0800, // @ MASK0x0800_PANEL
+ kDMAttributeStatusBox = 0x1000, // @ MASK0x1000_STATUS_BOX
+ kDMAttributeWounds = 0x2000, // @ MASK0x2000_WOUNDS
+ kDMAttributeViewport = 0x4000, // @ MASK0x4000_VIEWPORT
+ kDMAttributeActionHand = 0x8000 // @ MASK0x8000_ACTION_HAND
};
-
enum ChampionWound {
- 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
+ kDMWoundNone = 0x0000, // @ MASK0x0000_NO_WOUND
+ kDMWoundReadHand = 0x0001, // @ MASK0x0001_READY_HAND
+ kDMWoundActionHand = 0x0002, // @ MASK0x0002_ACTION_HAND
+ kDMWoundHead = 0x0004, // @ MASK0x0004_HEAD
+ kDMWoundTorso = 0x0008, // @ MASK0x0008_TORSO
+ kDMWoundLegs = 0x0010, // @ MASK0x0010_LEGS
+ kDMWoundFeet = 0x0020 // @ MASK0x0020_FEET
};
-enum ChampionStatisticType {
- 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 ChampionStatType {
+ kDMStatLuck = 0, // @ C0_STATISTIC_LUCK
+ kDMStatStrength = 1, // @ C1_STATISTIC_STRENGTH
+ kDMStatDexterity = 2, // @ C2_STATISTIC_DEXTERITY
+ kDMStatWisdom = 3, // @ C3_STATISTIC_WISDOM
+ kDMStatVitality = 4, // @ C4_STATISTIC_VITALITY
+ kDMStatAntimagic = 5, // @ C5_STATISTIC_ANTIMAGIC
+ kDMStatAntifire = 6, // @ C6_STATISTIC_ANTIFIRE
+ kDMStatMana = 8 // @ C8_STATISTIC_MANA /* Used as a fake statistic index for objects granting a Mana bonus */
};
-enum ChampionStatisticValue {
- kDMChampionStatMaximum = 0, // @ C0_MAXIMUM
- kDMChampionStatCurrent = 1, // @ C1_CURRENT
- kDMChampionStatMinimum = 2 // @ C2_MINIMUM
+enum ChampionStatValue {
+ kDMStatMaximum = 0, // @ C0_MAXIMUM
+ kDMStatCurrent = 1, // @ C1_CURRENT
+ kDMStatMinimum = 2 // @ C2_MINIMUM
};
enum ChampionSkill {
- k0_ChampionSkillFighter = 0, // @ C00_SKILL_FIGHTER
- k1_ChampionSkillNinja = 1, // @ C01_SKILL_NINJA
- k2_ChampionSkillPriest = 2, // @ C02_SKILL_PRIEST
- k3_ChampionSkillWizard = 3, // @ C03_SKILL_WIZARD
- k4_ChampionSkillSwing = 4, // @ C04_SKILL_SWING
- k5_ChampionSkillThrust = 5, // @ C05_SKILL_THRUST
- k6_ChampionSkillClub = 6, // @ C06_SKILL_CLUB
- k7_ChampionSkillParry = 7, // @ C07_SKILL_PARRY
- k8_ChampionSkillSteal = 8, // @ C08_SKILL_STEAL
- k9_ChampionSkillFight = 9, // @ C09_SKILL_FIGHT
- k10_ChampionSkillThrow = 10, // @ C10_SKILL_THROW
- k11_ChampionSkillShoot = 11, // @ C11_SKILL_SHOOT
- k12_ChampionSkillIdentify = 12, // @ C12_SKILL_IDENTIFY
- k13_ChampionSkillHeal = 13, // @ C13_SKILL_HEAL
- k14_ChampionSkillInfluence = 14, // @ C14_SKILL_INFLUENCE
- k15_ChampionSkillDefend = 15, // @ C15_SKILL_DEFEND
- k16_ChampionSkillFire = 16, // @ C16_SKILL_FIRE
- k17_ChampionSkillAir = 17, // @ C17_SKILL_AIR
- k18_ChampionSkillEarth = 18, // @ C18_SKILL_EARTH
- k19_ChampionSkillWater = 19 // @ C19_SKILL_WATER
+ kDMSkillFighter = 0, // @ C00_SKILL_FIGHTER
+ kDMSkillNinja = 1, // @ C01_SKILL_NINJA
+ kDMSkillPriest = 2, // @ C02_SKILL_PRIEST
+ kDMSkillWizard = 3, // @ C03_SKILL_WIZARD
+ kDMSkillSwing = 4, // @ C04_SKILL_SWING
+ kDMSkillThrust = 5, // @ C05_SKILL_THRUST
+ kDMSkillClub = 6, // @ C06_SKILL_CLUB
+ kDMSkillParry = 7, // @ C07_SKILL_PARRY
+ kDMSkillSteal = 8, // @ C08_SKILL_STEAL
+ kDMSkillFight = 9, // @ C09_SKILL_FIGHT
+ kDMSkillThrow = 10, // @ C10_SKILL_THROW
+ kDMSkillShoot = 11, // @ C11_SKILL_SHOOT
+ kDMSkillIdentify = 12, // @ C12_SKILL_IDENTIFY
+ kDMSkillHeal = 13, // @ C13_SKILL_HEAL
+ kDMSkillInfluence = 14, // @ C14_SKILL_INFLUENCE
+ kDMSkillDefend = 15, // @ C15_SKILL_DEFEND
+ kDMSkillFire = 16, // @ C16_SKILL_FIRE
+ kDMSkillAir = 17, // @ C17_SKILL_AIR
+ kDMSkillEarth = 18, // @ C18_SKILL_EARTH
+ kDMSkillWater = 19 // @ C19_SKILL_WATER
};
enum ChampionSlot {
@@ -350,6 +349,40 @@ enum AttackType {
k7_attackType_LIGHTNING = 7 // @ C7_ATTACK_LIGHTNING
};
+#define k0x0000_maskDoNotUseSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
+#define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
+
+#define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
+
+#define k0_spellCastFailure 0 // @ C0_SPELL_CAST_FAILURE
+#define k1_spellCastSuccess 1 // @ C1_SPELL_CAST_SUCCESS
+#define k3_spellCastFailureNeedsFlask 3 // @ C3_SPELL_CAST_FAILURE_NEEDS_FLASK
+
+#define k0_failureNeedsMorePractice 0 // @ C00_FAILURE_NEEDS_MORE_PRACTICE
+#define k1_failureMeaninglessSpell 1 // @ C01_FAILURE_MEANINGLESS_SPELL
+#define k10_failureNeedsFlaskInHand 10 // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
+#define k11_failureNeedsMagicMapInHand 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
+
+#define k1_spellKindPotion 1 // @ C1_SPELL_KIND_POTION
+#define k2_spellKindProjectile 2 // @ C2_SPELL_KIND_PROJECTILE
+#define k3_spellKindOther 3 // @ C3_SPELL_KIND_OTHER
+#define k4_spellKindMagicMap 4 // @ C4_SPELL_KIND_MAGIC_MAP
+
+#define k4_spellType_projectileOpenDoor 4 // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
+#define k0_spellType_otherLight 0 // @ C0_SPELL_TYPE_OTHER_LIGHT
+#define k1_spellType_otherDarkness 1 // @ C1_SPELL_TYPE_OTHER_DARKNESS
+#define k2_spellType_otherThievesEye 2 // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
+#define k3_spellType_otherInvisibility 3 // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
+#define k4_spellType_otherPartyShield 4 // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
+#define k5_spellType_otherMagicTorch 5 // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
+#define k6_spellType_otherFootprints 6 // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
+#define k7_spellType_otherZokathra 7 // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
+#define k8_spellType_otherFireshield 8 // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
+#define k0_spellType_magicMap0 0 // @ C0_SPELL_TYPE_MAGIC_MAP
+#define k1_spellType_magicMap1 1 // @ C1_SPELL_TYPE_MAGIC_MAP
+#define k2_spellType_magicMap2 2 // @ C2_SPELL_TYPE_MAGIC_MAP
+#define k3_spellType_magicMap3 3 // @ C3_SPELL_TYPE_MAGIC_MAP
+
class Skill {
public:
int16 _temporaryExperience;
@@ -397,18 +430,18 @@ public:
void setSkillExp(ChampionSkill skill, int32 val) { _skills[skill]._experience = val; }
void setSkillTempExp(ChampionSkill skill, int16 val) { _skills[skill]._temporaryExperience= val; }
- byte& getStatistic(ChampionStatisticType type, ChampionStatisticValue valType) { return _statistics[type][valType]; }
- void setStatistic(ChampionStatisticType type, ChampionStatisticValue valType, byte newVal) { _statistics[type][valType] = newVal; }
+ byte& getStatistic(ChampionStatType type, ChampionStatValue valType) { return _statistics[type][valType]; }
+ void setStatistic(ChampionStatType type, ChampionStatValue valType, byte newVal) { _statistics[type][valType] = newVal; }
uint16 getAttributes() { return _attributes; }
uint16 getAttributes(ChampionAttribute flag) { return _attributes & flag; }
void setAttributeFlag(ChampionAttribute flag, bool value);
- void clearAttributes(ChampionAttribute attribute = kDMChampionAttributNone) { _attributes = attribute; }
+ void clearAttributes(ChampionAttribute attribute = kDMAttributNone) { _attributes = attribute; }
uint16 getWounds() { return _wounds; }
void setWoundsFlag(ChampionWound flag, bool value);
uint16 getWoundsFlag(ChampionWound wound) { return _wounds & wound; }
- void clearWounds() { _wounds = kDMChampionWoundNone; }
+ void clearWounds() { _wounds = kDMWoundNone; }
void resetSkillsToZero() {
for (int16 i = 0; i < 20; ++i)
_skills[i].resetToZero();
@@ -417,40 +450,6 @@ public:
}; // @ CHAMPION_INCLUDING_PORTRAIT
-#define k0x0000_maskDoNotUseSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
-#define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
-
-#define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
-
-#define k0_spellCastFailure 0 // @ C0_SPELL_CAST_FAILURE
-#define k1_spellCastSuccess 1 // @ C1_SPELL_CAST_SUCCESS
-#define k3_spellCastFailureNeedsFlask 3 // @ C3_SPELL_CAST_FAILURE_NEEDS_FLASK
-
-#define k0_failureNeedsMorePractice 0 // @ C00_FAILURE_NEEDS_MORE_PRACTICE
-#define k1_failureMeaninglessSpell 1 // @ C01_FAILURE_MEANINGLESS_SPELL
-#define k10_failureNeedsFlaskInHand 10 // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
-#define k11_failureNeedsMagicMapInHand 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
-
-#define k1_spellKindPotion 1 // @ C1_SPELL_KIND_POTION
-#define k2_spellKindProjectile 2 // @ C2_SPELL_KIND_PROJECTILE
-#define k3_spellKindOther 3 // @ C3_SPELL_KIND_OTHER
-#define k4_spellKindMagicMap 4 // @ C4_SPELL_KIND_MAGIC_MAP
-
-#define k4_spellType_projectileOpenDoor 4 // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
-#define k0_spellType_otherLight 0 // @ C0_SPELL_TYPE_OTHER_LIGHT
-#define k1_spellType_otherDarkness 1 // @ C1_SPELL_TYPE_OTHER_DARKNESS
-#define k2_spellType_otherThievesEye 2 // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
-#define k3_spellType_otherInvisibility 3 // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
-#define k4_spellType_otherPartyShield 4 // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
-#define k5_spellType_otherMagicTorch 5 // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
-#define k6_spellType_otherFootprints 6 // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
-#define k7_spellType_otherZokathra 7 // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
-#define k8_spellType_otherFireshield 8 // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
-#define k0_spellType_magicMap0 0 // @ C0_SPELL_TYPE_MAGIC_MAP
-#define k1_spellType_magicMap1 1 // @ C1_SPELL_TYPE_MAGIC_MAP
-#define k2_spellType_magicMap2 2 // @ C2_SPELL_TYPE_MAGIC_MAP
-#define k3_spellType_magicMap3 3 // @ C3_SPELL_TYPE_MAGIC_MAP
-
class Spell {
public:
Spell() {}
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index a20293cd16..78ef3a79e5 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -655,7 +655,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
textPosX += 6;
_textMan->printEndGameString(textPosX, textPosY++, k9_ColorGold, curChampion->_title);
- for (int16 idx = k0_ChampionSkillFighter; idx <= k3_ChampionSkillWizard; idx++) {
+ for (int16 idx = kDMSkillFighter; idx <= kDMSkillWizard; idx++) {
uint16 skillLevel = MIN<uint16>(16, _championMan->getSkillLevel(championIndex, idx | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience)));
if (skillLevel == 1)
continue;
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index fdf66b73b3..cb33642cd4 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -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, kDMChampionWoundTorso | kDMChampionWoundLegs, k2_attackType_SELF);
+ int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, k2_attackType_SELF);
if (L1124_i_FirstDamagedChampionIndex != L1125_i_SecondDamagedChampionIndex)
- damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, kDMChampionWoundTorso | kDMChampionWoundLegs, k2_attackType_SELF);
+ damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, k2_attackType_SELF);
if (damage)
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
@@ -1110,8 +1110,8 @@ void EventManager::commandSetLeader(ChampionIndex champIndex) {
if (cm._leaderIndex != kDMChampionNone) {
leaderIndex = cm._leaderIndex;
- cm._champions[leaderIndex].setAttributeFlag(kDMChampionAttributeLoad, true);
- cm._champions[leaderIndex].setAttributeFlag(kDMChampionAttributeNameTitle, true);
+ cm._champions[leaderIndex].setAttributeFlag(kDMAttributeLoad, true);
+ cm._champions[leaderIndex].setAttributeFlag(kDMAttributeNameTitle, true);
cm._champions[leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(cm._leaderHandObject);
cm._leaderIndex = kDMChampionNone;
cm.drawChampionState(leaderIndex);
@@ -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(kDMChampionAttributeIcon, true);
- champion->setAttributeFlag(kDMChampionAttributeNameTitle, true);
+ champion->setAttributeFlag(kDMAttributeIcon, true);
+ champion->setAttributeFlag(kDMAttributeNameTitle, true);
cm.drawChampionState(champIndex);
}
}
@@ -1280,8 +1280,8 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
for (uint16 i = 0; i < 12; i++) {
uint16 statIndex = _vm->getRandomNumber(7);
- champ->getStatistic((ChampionStatisticType)statIndex, kDMChampionStatCurrent)++; // returns reference
- champ->getStatistic((ChampionStatisticType)statIndex, kDMChampionStatMaximum)++; // returns reference
+ champ->getStatistic((ChampionStatType)statIndex, kDMStatCurrent)++; // returns reference
+ champ->getStatistic((ChampionStatType)statIndex, kDMStatMaximum)++; // returns reference
}
}
@@ -1476,19 +1476,19 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir));
if (championIconIndex == champIconIndex) {
- setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMAttributeIcon);
_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, kDMChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championIndex]._attributes, kDMAttributeIcon);
_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, kDMChampionAttributeIcon);
+ setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championCellIndex);
}
}
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 78c76b8d9c..89efd6b478 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1577,7 +1577,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
int16 doubledMapDifficulty = _vm->_dungeonMan->_currMap->_difficulty << 1;
CreatureInfo creatureInfo = _vm->_dungeonMan->_creatureInfos[group->_type];
- _vm->_championMan->addSkillExperience(champIndex, k7_ChampionSkillParry, creatureInfo.getExperience());
+ _vm->_championMan->addSkillExperience(champIndex, kDMSkillParry, creatureInfo.getExperience());
if (_vm->_championMan->_partyIsSleeping || (((_vm->_championMan->getDexterity(curChampion) < (_vm->getRandomNumber(32) + creatureInfo._dexterity + doubledMapDifficulty - 16)) || !_vm->getRandomNumber(4)) && !_vm->_championMan->isLucky(curChampion, 60))) {
uint16 allowedWound;
uint16 woundTest = _vm->getRandomNumber(65536);
@@ -1592,7 +1592,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
} else
allowedWound = woundTest & 0x0001; /* 0 (Ready hand) or 1 (action hand) */
- int16 attack = (_vm->getRandomNumber(16) + creatureInfo._attack + doubledMapDifficulty) - (_vm->_championMan->getSkillLevel(champIndex, k7_ChampionSkillParry) << 1);
+ int16 attack = (_vm->getRandomNumber(16) + creatureInfo._attack + doubledMapDifficulty) - (_vm->_championMan->getSkillLevel(champIndex, kDMSkillParry) << 1);
if (attack <= 1) {
if (_vm->getRandomNumber(2))
return 0;
@@ -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, kDMChampionStatVitality, poisonAttack);
+ poisonAttack = _vm->_championMan->getStatisticAdjustedAttack(curChampion, kDMStatVitality, poisonAttack);
if (poisonAttack >= 0)
_vm->_championMan->championPoison(champIndex, poisonAttack);
}
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index e5540b5b4e..07c7a5b02f 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -103,7 +103,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
closeChest();
Champion *champion = &_vm->_championMan->_champions[_vm->ordinalToIndex(inventoryChampionOrdinal)];
if (champion->_currHealth && !_vm->_championMan->_candidateChampionOrdinal) {
- setFlag(champion->_attributes, kDMChampionAttributeStatusBox);
+ setFlag(champion->_attributes, kDMAttributeStatusBox);
_vm->_championMan->drawChampionState((ChampionIndex)_vm->ordinalToIndex(inventoryChampionOrdinal));
}
if (_vm->_championMan->_partyIsSleeping) {
@@ -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, kDMChampionAttributeViewport | kDMChampionAttributeStatusBox | kDMChampionAttributePanel | kDMChampionAttributeLoad | kDMChampionAttributeStatistics | kDMChampionAttributeNameTitle);
+ setFlag(champion->_attributes, kDMAttributeViewport | kDMAttributeStatusBox | kDMAttributePanel | kDMAttributeLoad | kDMAttributeStatistics | kDMAttributeNameTitle);
_vm->_championMan->drawChampionState(championIndex);
_vm->_eventMan->_mousePointerBitmapUpdated = true;
_vm->_eventMan->hideMouse();
@@ -515,7 +515,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
descString = str;
} else if ((thingType == k8_PotionThingType)
&& (iconIndex != kDMIconIndicePotionWaterFlask)
- && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
+ && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), kDMSkillPriest) > 1)) {
str = ('_' + ((Potion *)rawThingPtr)->getPower() / 40);
str += " ";
str += objMan._objectNames[iconIndex];
@@ -802,7 +802,7 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
Champion *curChampion = &_vm->_championMan->_champions[championIndex];
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73);
int16 textPosY = 58;
- for (uint16 idx = k0_ChampionSkillFighter; idx <= k3_ChampionSkillWizard; idx++) {
+ for (uint16 idx = kDMSkillFighter; idx <= kDMSkillWizard; idx++) {
int16 skillLevel = MIN((uint16)16, _vm->_championMan->getSkillLevel(championIndex, idx | kDMIgnoreTemporaryExperience));
if (skillLevel == 1)
continue;
@@ -822,10 +822,10 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
textPosY += 7;
}
textPosY = 86;
- for (uint16 idx = kDMChampionStatStrength; idx <= kDMChampionStatAntifire; idx++) {
+ for (uint16 idx = kDMStatStrength; idx <= kDMStatAntifire; idx++) {
_vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, statisticNames[idx]);
- int16 statisticCurrentValue = curChampion->_statistics[idx][kDMChampionStatCurrent];
- uint16 statisticMaximumValue = curChampion->_statistics[idx][kDMChampionStatMaximum];
+ int16 statisticCurrentValue = curChampion->_statistics[idx][kDMStatCurrent];
+ uint16 statisticMaximumValue = curChampion->_statistics[idx][kDMStatMaximum];
int16 statisticColor;
if (statisticCurrentValue < statisticMaximumValue)
statisticColor = k8_ColorRed;
@@ -932,16 +932,16 @@ void InventoryMan::clickOnMouth() {
switch (((Potion *)junkData)->getType()) {
case k6_PotionTypeRos:
- adjustStatisticCurrentValue(curChampion, kDMChampionStatDexterity, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMStatDexterity, adjustedPotionPower);
break;
case k7_PotionTypeKu:
- adjustStatisticCurrentValue(curChampion, kDMChampionStatStrength, (((Potion *)junkData)->getPower() / 35) + 5); /* Value between 5 and 12 */
+ adjustStatisticCurrentValue(curChampion, kDMStatStrength, (((Potion *)junkData)->getPower() / 35) + 5); /* Value between 5 and 12 */
break;
case k8_PotionTypeDane:
- adjustStatisticCurrentValue(curChampion, kDMChampionStatWisdom, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMStatWisdom, adjustedPotionPower);
break;
case k9_PotionTypeNeta:
- adjustStatisticCurrentValue(curChampion, kDMChampionStatVitality, adjustedPotionPower);
+ adjustStatisticCurrentValue(curChampion, kDMStatVitality, 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, kDMChampionAttributeStatusBox);
+ setFlag(curChampion->_attributes, kDMAttributeStatusBox);
}
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, kDMChampionAttributeLoad | kDMChampionAttributeWounds);
+ setFlag(curChampion->_attributes, kDMAttributeLoad | kDMAttributeWounds);
}
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, kDMChampionAttributeLoad);
+ setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, kDMAttributeLoad);
}
_vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
- setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
if (_panelContent == k0_PanelContentFoodWaterPoisoned)
- setFlag(curChampion->_attributes, kDMChampionAttributePanel);
+ setFlag(curChampion->_attributes, kDMAttributePanel);
_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][kDMChampionStatCurrent];
+ int16 currentValue = champ->_statistics[statIndex][kDMStatCurrent];
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][kDMChampionStatMinimum] - champ->_statistics[statIndex][kDMChampionStatCurrent]));
+ delta = MAX(valueDelta, int16(champ->_statistics[statIndex][kDMStatMinimum] - champ->_statistics[statIndex][kDMStatCurrent]));
}
- champ->_statistics[statIndex][kDMChampionStatCurrent] += delta;
+ champ->_statistics[statIndex][kDMStatCurrent] += delta;
}
void InventoryMan::clickOnEye() {
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index bcbe89f7b6..4ad8646ade 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -175,7 +175,7 @@ void MenuMan::clearActingChampion() {
ChampionMan &cm = *_vm->_championMan;
if (cm._actingChampionOrdinal) {
cm._actingChampionOrdinal--;
- cm._champions[cm._actingChampionOrdinal].setAttributeFlag(kDMChampionAttributeActionHand, true);
+ cm._champions[cm._actingChampionOrdinal].setAttributeFlag(kDMAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._actingChampionOrdinal);
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(kDMChampionAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) {
+ if (champion.getAttributes(kDMAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) {
_vm->_displayMan->shadeScreenBox(&box, k0_ColorBlack);
}
}
@@ -268,7 +268,7 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
&& (champ->_dir != champ->_directionMaximumDamageReceived)) {
champ->_dir = (Direction)champ->_directionMaximumDamageReceived;
- champ->setAttributeFlag(kDMChampionAttributeIcon, true);
+ champ->setAttributeFlag(kDMAttributeIcon, true);
champMan.drawChampionState((ChampionIndex)champIndex);
}
champ->_maximumDamageReceived = 0;
@@ -288,7 +288,7 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
}
} else {
_actionAreaContainsIcons = false;
- champ->setAttributeFlag(kDMChampionAttributeActionHand, true);
+ champ->setAttributeFlag(kDMAttributeActionHand, true);
champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._actingChampionOrdinal));
drawActionArea();
}
@@ -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[kDMChampionStatWisdom][kDMChampionStatCurrent] + 15, 115)) {
+ if (_vm->getRandomNumber(128) > MIN(curChampion->_statistics[kDMStatWisdom][kDMStatCurrent] + 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, kDMChampionAttributeLoad);
+ setFlag(curChampion->_attributes, kDMAttributeLoad);
_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, kDMChampionAttributeIcon);
+ setFlag(curChampion->_attributes, kDMAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
if (curSpell->getType() == k4_spellType_projectileOpenDoor)
@@ -744,7 +744,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
const char *messagesFR[5] = {" DOIT PRATIQUER DAVANTAGE SON ", "ENVOUTEMENT.", " MARMONNE UNE CONJURATION IMCOMPREHENSIBLE.",
" DOIT AVOIR UN FLACON VIDE EN MAIN POUR LA POTION.", "EXORCISME."};
- if (skillIndex > k3_ChampionSkillWizard)
+ if (skillIndex > kDMSkillWizard)
skillIndex = (skillIndex - 4) / 4;
_vm->_textMan->printLineFeed();
@@ -768,7 +768,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
case k0_failureNeedsMorePractice:
_vm->_textMan->printMessage(k4_ColorCyan, messages[0]);
_vm->_textMan->printMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
- if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == k3_ChampionSkillWizard)
+ if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == kDMSkillWizard)
message = messages[1];
else
message = messages[4];
@@ -889,7 +889,7 @@ void MenuMan::addChampionSymbol(int16 symbolIndex) {
if (manaCost <= casterChampion->_currMana) {
casterChampion->_currMana -= manaCost;
- setFlag(casterChampion->_attributes, kDMChampionAttributeStatistics);
+ setFlag(casterChampion->_attributes, kDMAttributeStatistics);
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, kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
retVal = isActionPerformed(championIndex, actionIndex);
curChampion->_actionIndex = (ChampionAction)actionIndex;
}
@@ -1055,7 +1055,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
uint16 targetSquare = _vm->_dungeonMan->getSquare(nextMapX, nextMapY).toByte();
int16 requiredManaAmount = 0;
- if (((actionSkillIndex >= k16_ChampionSkillFire) && (actionSkillIndex <= k19_ChampionSkillWater)) || (actionSkillIndex == k3_ChampionSkillWizard))
+ if (((actionSkillIndex >= kDMSkillFire) && (actionSkillIndex <= kDMSkillWater)) || (actionSkillIndex == kDMSkillWizard))
requiredManaAmount = 7 - MIN<uint16>(6, _vm->_championMan->getSkillLevel(champIndex, actionSkillIndex));
bool setDirectionFl = false;
@@ -1160,7 +1160,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
setChampionDirectionToPartyDirection(curChampion);
Thing removedObject = _vm->_championMan->getObjectRemovedFromSlot(champIndex, k0_ChampionSlotReadyHand);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
- _vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, k11_ChampionSkillShoot)) << 1, stepEnergy);
+ _vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, kDMSkillShoot)) << 1, stepEnergy);
}
break;
case k5_ChampionActionFlip: {
@@ -1234,7 +1234,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
Experience gain is 2 + 2 * heal cycle count */
int16 missingHealth = curChampion->_maxHealth - curChampion->_currHealth;
if ((missingHealth > 0) && curChampion->_currMana) {
- int16 healingCapability = MIN((uint16)10, _vm->_championMan->getSkillLevel(champIndex, k13_ChampionSkillHeal));
+ int16 healingCapability = MIN((uint16)10, _vm->_championMan->getSkillLevel(champIndex, kDMSkillHeal));
actionExperienceGain = 2;
uint16 healingAmount;
do {
@@ -1249,7 +1249,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
if (curChampion->_currMana < 0)
curChampion->_currMana = 0;
- setFlag(curChampion->_attributes, kDMChampionAttributeStatistics);
+ setFlag(curChampion->_attributes, kDMAttributeStatistics);
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, kDMChampionAttributeIcon);
+ setFlag(champ->_attributes, kDMAttributeIcon);
}
}
@@ -1528,7 +1528,7 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
experience = 45;
break;
}
- frightAmount += _vm->_championMan->getSkillLevel(champIndex, k14_ChampionSkillInfluence);
+ frightAmount += _vm->_championMan->getSkillLevel(champIndex, kDMSkillInfluence);
Group *targetGroup = (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing);
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[targetGroup->_type];
uint16 fearResistance = creatureInfo->getFearResistance();
@@ -1544,7 +1544,7 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
activeGroup->_delayFleeingFromTarget = ((16 - fearResistance) << 2) / creatureInfo->_movementTicks;
isGroupFrightenedByAction = true;
}
- _vm->_championMan->addSkillExperience(champIndex, k14_ChampionSkillInfluence, experience);
+ _vm->_championMan->addSkillExperience(champIndex, kDMSkillInfluence, experience);
return isGroupFrightenedByAction;
}
@@ -1627,7 +1627,7 @@ void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) {
};
Champion *curChampion = &_vm->_championMan->_champions[champIndex];
- if (getFlag(curChampion->_attributes, kDMChampionAttributeDisableAction) || !curChampion->_currHealth)
+ if (getFlag(curChampion->_attributes, kDMAttributeDisableAction) || !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, kDMChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
drawActionArea();
drawActionArea();
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 77717de6e4..2475ebcc28 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -331,7 +331,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
if (curChampion->_currHealth)
_vm->_championMan->decrementStamina(championIdx, ((curChampion->_load * 25) / _vm->_championMan->getMaximumLoad(curChampion)) + 1);
}
- } else if (_vm->_championMan->getDamagedChampionCount(20, kDMChampionWoundLegs | kDMChampionWoundFeet, k2_attackType_SELF))
+ } else if (_vm->_championMan->getDamagedChampionCount(20, kDMWoundLegs | kDMWoundFeet, k2_attackType_SELF))
_vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
}
_useRopeToClimbDownPit = false;
@@ -927,7 +927,7 @@ void MovesensMan::triggerEffect(Sensor *sensor, int16 effect, int16 mapX, int16
void MovesensMan::triggerLocalEffect(int16 localEffect, int16 effX, int16 effY, int16 effCell) {
if (localEffect == k10_SensorEffAddExp) {
- addSkillExperience(k8_ChampionSkillSteal, 300, localEffect != kM1_CellAny);
+ addSkillExperience(kDMSkillSteal, 300, localEffect != kM1_CellAny);
return;
}
_sensorRotationEffect = localEffect;
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 48f122c03d..cbf00852d8 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, kDMChampionWoundHead | kDMChampionWoundTorso, _projectileAttackType))
+ && _vm->_championMan->addPendingDamageAndWounds_getDamage(championIndex, attack, kDMWoundHead | kDMWoundTorso, _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 = kDMChampionWoundReadHand | kDMChampionWoundActionHand | kDMChampionWoundHead | kDMChampionWoundTorso | kDMChampionWoundLegs | kDMChampionWoundFeet;
+ int16 wounds = kDMWoundReadHand | kDMWoundActionHand | kDMWoundHead | kDMWoundTorso | kDMWoundLegs | kDMWoundFeet;
_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, kDMChampionWoundNone, k0_attackType_NORMAL);
+ _vm->_championMan->getDamagedChampionCount(attack, kDMWoundNone, 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 234881eb9f..f92a09fe10 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, kDMChampionAttributeStatusBox);
+ setFlag(_vm->_championMan->_champions[newEvent._priority]._attributes, kDMAttributeStatusBox);
_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 = kDMChampionWoundTorso | (verticalDoorFl ? kDMChampionWoundHead : kDMChampionWoundReadHand | kDMChampionWoundActionHand);
+ int16 wounds = kDMWoundTorso | (verticalDoorFl ? kDMWoundHead : kDMWoundReadHand | kDMWoundActionHand);
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, kDMChampionAttributeDisableAction);
+ clearFlag(curChampion->_attributes, kDMAttributeDisableAction);
if (curChampion->_actionIndex != k255_ChampionActionNone) {
curChampion->_actionDefense -= _actionDefense[curChampion->_actionDefense];
}
@@ -832,7 +832,7 @@ void Timeline::processEventEnableChampionAction(uint16 champIndex) {
}
}
}
- setFlag(curChampion->_attributes, kDMChampionAttributeActionHand);
+ setFlag(curChampion->_attributes, kDMAttributeActionHand);
_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, kDMChampionAttributeNameTitle);
+ setFlag(curChampion->_attributes, kDMAttributeNameTitle);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
}
@@ -905,7 +905,7 @@ void Timeline::processEventLight(TimelineEvent *event) {
void Timeline::refreshAllChampionStatusBoxes() {
for (uint16 idx = kDMChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++)
- setFlag(_vm->_championMan->_champions[idx]._attributes, kDMChampionAttributeStatusBox);
+ setFlag(_vm->_championMan->_champions[idx]._attributes, kDMAttributeStatusBox);
_vm->_championMan->drawAllChampionStates();
}