aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorStrangerke2016-09-10 14:31:49 +0200
committerStrangerke2016-09-10 14:31:49 +0200
commitd2b0829476e6e045a1d322b94bde64b0fcb87234 (patch)
tree7b82955f942230da9a5fa6c1d233d8e519fe1ee8 /engines/dm
parentd588e15dad218c4b797a16cf694a954e4d5b35b7 (diff)
downloadscummvm-rg350-d2b0829476e6e045a1d322b94bde64b0fcb87234.tar.gz
scummvm-rg350-d2b0829476e6e045a1d322b94bde64b0fcb87234.tar.bz2
scummvm-rg350-d2b0829476e6e045a1d322b94bde64b0fcb87234.zip
DM: Change constants into enums in champion.h, renaming
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp20
-rw-r--r--engines/dm/champion.h125
-rw-r--r--engines/dm/eventman.cpp4
-rw-r--r--engines/dm/menus.cpp140
-rw-r--r--engines/dm/movesens.cpp2
-rw-r--r--engines/dm/projexpl.cpp14
-rw-r--r--engines/dm/timeline.cpp8
7 files changed, 159 insertions, 154 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 4f02db19a6..ea48f85ea9 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -52,7 +52,7 @@ void Champion::resetToZero() {
memset(_title, '\0', 20);
_dir = kDirNorth;
_cell = k0_ViewCellFronLeft;
- _actionIndex = k0_ChampionActionN;
+ _actionIndex = kDMActionN;
_symbolStep = 0;
memset(_symbols, '\0', 5);
_directionMaximumDamageReceived = _maximumDamageReceived = _poisonEventCount = _enableActionEventIndex = 0;
@@ -742,7 +742,7 @@ void ChampionMan::decrementStamina(int16 championIndex, int16 decrement) {
int16 stamina = curChampion->_currStamina;
if (stamina <= 0) {
curChampion->_currStamina = 0;
- addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, kDMWoundNone, k0_attackType_NORMAL);
+ addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, kDMWoundNone, kDMAttackTypeNormal);
} else if (stamina > curChampion->_maxStamina) {
curChampion->_currStamina = curChampion->_maxStamina;
}
@@ -758,13 +758,13 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
if (!curChampion->_currHealth)
return 0;
- if (attackType != k0_attackType_NORMAL) {
+ if (attackType != kDMAttackTypeNormal) {
uint16 defense = 0;
uint16 woundCount = 0;
for (int16 woundIndex = kDMSlotReadyHand; woundIndex <= kDMSlotFeet; woundIndex++) {
if (allowedWounds & (1 << woundIndex)) {
woundCount++;
- defense += getWoundDefense(champIndex, woundIndex | ((attackType == k4_attackType_SHARP) ? k0x8000_maskUseSharpDefense : k0x0000_maskDoNotUseSharpDefense));
+ defense += getWoundDefense(champIndex, woundIndex | ((attackType == kDMAttackTypeSharp) ? k0x8000_maskUseSharpDefense : k0x0000_maskDoNotUseSharpDefense));
}
}
if (woundCount)
@@ -772,7 +772,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
bool skipScaling = false;
switch (attackType) {
- case k6_attackType_PSYCHIC:
+ case kDMAttackTypePsychic:
{
int16 wisdomFactor = 115 - curChampion->_statistics[kDMStatWisdom][kDMStatCurrent];
if (wisdomFactor <= 0) {
@@ -784,16 +784,16 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
skipScaling = true;
}
break;
- case k5_attackType_MAGIC:
+ case kDMAttackTypeMagic:
attack = getStatisticAdjustedAttack(curChampion, kDMStatAntimagic, attack);
attack -= _party._spellShieldDefense;
skipScaling = true;
break;
- case k1_attackType_FIRE:
+ case kDMAttackTypeFire:
attack = getStatisticAdjustedAttack(curChampion, kDMStatAntifire, attack);
attack -= _party._fireShieldDefense;
break;
- case k2_attackType_SELF:
+ case kDMAttackTypeSelf:
defense >>= 1;
break;
default:
@@ -1106,7 +1106,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
return;
Champion *curChampion = &_champions[champIndex];
- addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMWoundNone, k0_attackType_NORMAL);
+ addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMWoundNone, kDMAttackTypeNormal);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
setFlag(curChampion->_attributes, kDMAttributePanel);
@@ -1876,7 +1876,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
// Strangerke - TODO: Check if the new code is possible to run on the older version (example: the portraits could be missing in the data)
_vm->_displayMan->_useByteBoxCoordinates = true;
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(k26_ChampionPortraitsIndice), championPtr->_portrait, _boxChampionPortrait, getChampionPortraitX(championPortraitIndex), getChampionPortraitY(championPortraitIndex), k128_byteWidth, k16_byteWidth, kM1_ColorNoTransparency, 87, 29);
- championPtr->_actionIndex = k255_ChampionActionNone;
+ championPtr->_actionIndex = kDMActionNone;
championPtr->_enableActionEventIndex = -1;
championPtr->_hideDamageReceivedIndex = -1;
championPtr->_dir = _vm->_dungeonMan->_partyDir;
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index bc2ee7c409..013f118d6e 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -290,77 +290,80 @@ enum ChampionSlot {
};
enum ChampionAction {
- k0_ChampionActionN = 0, // @ C000_ACTION_N
- k1_ChampionActionBlock = 1, // @ C001_ACTION_BLOCK
- k2_ChampionActionChop = 2, // @ C002_ACTION_CHOP
- k3_ChampionActionX_C003 = 3, // @ C003_ACTION_X
- k4_ChampionActionBlowHorn = 4, // @ C004_ACTION_BLOW_HORN
- k5_ChampionActionFlip = 5, // @ C005_ACTION_FLIP
- k6_ChampionActionPunch = 6, // @ C006_ACTION_PUNCH
- k7_ChampionActionKick = 7, // @ C007_ACTION_KICK
- k8_ChampionActionWarCry = 8, // @ C008_ACTION_WAR_CRY
- k9_ChampionActionStab_C009 = 9, // @ C009_ACTION_STAB
- k10_ChampionActionClimbDown = 10, // @ C010_ACTION_CLIMB_DOWN
- k11_ChampionActionFreezeLife = 11, // @ C011_ACTION_FREEZE_LIFE
- k12_ChampionActionHit = 12, // @ C012_ACTION_HIT
- k13_ChampionActionSwing = 13, // @ C013_ACTION_SWING
- k14_ChampionActionStab_C014 = 14, // @ C014_ACTION_STAB
- k15_ChampionActionThrust = 15, // @ C015_ACTION_THRUST
- k16_ChampionActionJab = 16, // @ C016_ACTION_JAB
- k17_ChampionActionParry = 17, // @ C017_ACTION_PARRY
- k18_ChampionActionHack = 18, // @ C018_ACTION_HACK
- k19_ChampionActionBerzerk = 19, // @ C019_ACTION_BERZERK
- k20_ChampionActionFireball = 20, // @ C020_ACTION_FIREBALL
- k21_ChampionActionDispel = 21, // @ C021_ACTION_DISPELL
- k22_ChampionActionConfuse = 22, // @ C022_ACTION_CONFUSE
- k23_ChampionActionLightning = 23, // @ C023_ACTION_LIGHTNING
- k24_ChampionActionDisrupt = 24, // @ C024_ACTION_DISRUPT
- k25_ChampionActionMelee = 25, // @ C025_ACTION_MELEE
- k26_ChampionActionX_C026 = 26, // @ C026_ACTION_X
- k27_ChampionActionInvoke = 27, // @ C027_ACTION_INVOKE
- k28_ChampionActionSlash = 28, // @ C028_ACTION_SLASH
- k29_ChampionActionCleave = 29, // @ C029_ACTION_CLEAVE
- k30_ChampionActionBash = 30, // @ C030_ACTION_BASH
- k31_ChampionActionStun = 31, // @ C031_ACTION_STUN
- k32_ChampionActionShoot = 32, // @ C032_ACTION_SHOOT
- k33_ChampionActionSpellshield = 33, // @ C033_ACTION_SPELLSHIELD
- k34_ChampionActionFireshield = 34, // @ C034_ACTION_FIRESHIELD
- k35_ChampionActionFluxcage = 35, // @ C035_ACTION_FLUXCAGE
- k36_ChampionActionHeal = 36, // @ C036_ACTION_HEAL
- k37_ChampionActionCalm = 37, // @ C037_ACTION_CALM
- k38_ChampionActionLight = 38, // @ C038_ACTION_LIGHT
- k39_ChampionActionWindow = 39, // @ C039_ACTION_WINDOW
- k40_ChampionActionSpit = 40, // @ C040_ACTION_SPIT
- k41_ChampionActionBrandish = 41, // @ C041_ACTION_BRANDISH
- k42_ChampionActionThrow = 42, // @ C042_ACTION_THROW
- k43_ChampionActionFuse = 43, // @ C043_ACTION_FUSE
- k255_ChampionActionNone = 255 // @ C255_ACTION_NONE
+ kDMActionN = 0, // @ C000_ACTION_N
+ kDMActionBlock = 1, // @ C001_ACTION_BLOCK
+ kDMActionChop = 2, // @ C002_ACTION_CHOP
+ kDMActionX = 3, // @ C003_ACTION_X
+ kDMActionBlowHorn = 4, // @ C004_ACTION_BLOW_HORN
+ kDMActionFlip = 5, // @ C005_ACTION_FLIP
+ kDMActionPunch = 6, // @ C006_ACTION_PUNCH
+ kDMActionKick = 7, // @ C007_ACTION_KICK
+ kDMActionWarCry = 8, // @ C008_ACTION_WAR_CRY
+ kDMActionStab9 = 9, // @ C009_ACTION_STAB
+ kDMActionClimbDown = 10, // @ C010_ACTION_CLIMB_DOWN
+ kDMActionFreezeLife = 11, // @ C011_ACTION_FREEZE_LIFE
+ kDMActionHit = 12, // @ C012_ACTION_HIT
+ kDMActionSwing = 13, // @ C013_ACTION_SWING
+ kDMActionStab14 = 14, // @ C014_ACTION_STAB
+ kDMActionThrust = 15, // @ C015_ACTION_THRUST
+ kDMActionJab = 16, // @ C016_ACTION_JAB
+ kDMActionParry = 17, // @ C017_ACTION_PARRY
+ kDMActionHack = 18, // @ C018_ACTION_HACK
+ kDMActionBerzerk = 19, // @ C019_ACTION_BERZERK
+ kDMActionFireball = 20, // @ C020_ACTION_FIREBALL
+ kDMActionDispel = 21, // @ C021_ACTION_DISPELL
+ kDMActionConfuse = 22, // @ C022_ACTION_CONFUSE
+ kDMActionLightning = 23, // @ C023_ACTION_LIGHTNING
+ kDMActionDisrupt = 24, // @ C024_ACTION_DISRUPT
+ kDMActionMelee = 25, // @ C025_ACTION_MELEE
+ kDMActionX_C026 = 26, // @ C026_ACTION_X
+ kDMActionInvoke = 27, // @ C027_ACTION_INVOKE
+ kDMActionSlash = 28, // @ C028_ACTION_SLASH
+ kDMActionCleave = 29, // @ C029_ACTION_CLEAVE
+ kDMActionBash = 30, // @ C030_ACTION_BASH
+ kDMActionStun = 31, // @ C031_ACTION_STUN
+ kDMActionShoot = 32, // @ C032_ACTION_SHOOT
+ kDMActionSpellshield = 33, // @ C033_ACTION_SPELLSHIELD
+ kDMActionFireshield = 34, // @ C034_ACTION_FIRESHIELD
+ kDMActionFluxcage = 35, // @ C035_ACTION_FLUXCAGE
+ kDMActionHeal = 36, // @ C036_ACTION_HEAL
+ kDMActionCalm = 37, // @ C037_ACTION_CALM
+ kDMActionLight = 38, // @ C038_ACTION_LIGHT
+ kDMActionWindow = 39, // @ C039_ACTION_WINDOW
+ kDMActionSpit = 40, // @ C040_ACTION_SPIT
+ kDMActionBrandish = 41, // @ C041_ACTION_BRANDISH
+ kDMActionThrow = 42, // @ C042_ACTION_THROW
+ kDMActionFuse = 43, // @ C043_ACTION_FUSE
+ kDMActionNone = 255 // @ C255_ACTION_NONE
};
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
+ kDMAttackTypeNormal = 0, // @ C0_ATTACK_NORMAL
+ kDMAttackTypeFire = 1, // @ C1_ATTACK_FIRE
+ kDMAttackTypeSelf = 2, // @ C2_ATTACK_SELF
+ kDMAttackTypeBlunt = 3, // @ C3_ATTACK_BLUNT
+ kDMAttackTypeSharp = 4, // @ C4_ATTACK_SHARP
+ kDMAttackTypeMagic = 5, // @ C5_ATTACK_MAGIC
+ kDMAttackTypePsychic = 6, // @ C6_ATTACK_PSYCHIC
+ kDMAttackTypeLightning = 7 // @ C7_ATTACK_LIGHTNING
};
#define k0x0000_maskDoNotUseSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
#define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
-
#define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
-#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
+enum SpellCastResult {
+ kDMSpellCastFailure = 0, // @ C0_SPELL_CAST_FAILURE
+ kDMSpellCastSuccess = 1, // @ C1_SPELL_CAST_SUCCESS
+ kDMSpellCastFailureNeedsFlask = 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
+enum SpellFailure {
+ kDMFailureNeedsMorePractice = 0, // @ C00_FAILURE_NEEDS_MORE_PRACTICE
+ kDMFailureMeaninglessSpell = 1, // @ C01_FAILURE_MEANINGLESS_SPELL
+ kDMFailureNeedsFlaskInHand = 10, // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
+ kDMFailureNeedsMagicMapInHand = 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
+};
#define k1_spellKindPotion 1 // @ C1_SPELL_KIND_POTION
#define k2_spellKindProjectile 2 // @ C2_SPELL_KIND_PROJECTILE
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 97fd534dde..e7095ce4a7 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, kDMWoundTorso | kDMWoundLegs, k2_attackType_SELF);
+ int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, kDMAttackTypeSelf);
if (L1124_i_FirstDamagedChampionIndex != L1125_i_SecondDamagedChampionIndex)
- damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, k2_attackType_SELF);
+ damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, kDMAttackTypeSelf);
if (damage)
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 5da7321659..3454379fae 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -311,9 +311,9 @@ void MenuMan::drawActionArea() {
drawActionIcon((ChampionIndex)champIndex);
} else if (champMan._actingChampionOrdinal) {
Box box = _boxActionArea3ActionMenu;
- if (_actionList._actionIndices[2] == k255_ChampionActionNone)
+ if (_actionList._actionIndices[2] == kDMActionNone)
box = _boxActionArea2ActionMenu;
- if (_actionList._actionIndices[1] == k255_ChampionActionNone)
+ if (_actionList._actionIndices[1] == kDMActionNone)
box = _boxActionArea1ActionMenu;
dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k10_MenuActionAreaIndice),
&box, k48_byteWidth, kM1_ColorNoTransparency, 45);
@@ -342,7 +342,7 @@ const char *MenuMan::getActionName(ChampionAction actionIndex) {
"BRANDISH", "THROW", "FUSE"
};
- return (actionIndex == k255_ChampionActionNone) ? "" : championActionNames[actionIndex];
+ return (actionIndex == kDMActionNone) ? "" : championActionNames[actionIndex];
}
void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
@@ -509,12 +509,12 @@ int16 MenuMan::getClickOnSpellCastResult() {
_vm->_eventMan->highlightBoxDisable();
int16 spellCastResult = getChampionSpellCastResult(_vm->_championMan->_magicCasterChampionIndex);
- if (spellCastResult != k3_spellCastFailureNeedsFlask) {
+ if (spellCastResult != kDMSpellCastFailureNeedsFlask) {
casterChampion->_symbols[0] = '\0';
drawAvailableSymbols(casterChampion->_symbolStep = 0);
drawChampionSymbols(casterChampion);
} else
- spellCastResult = k0_spellCastFailure;
+ spellCastResult = kDMSpellCastFailure;
_vm->_eventMan->hideMouse();
return spellCastResult;
@@ -522,16 +522,16 @@ int16 MenuMan::getClickOnSpellCastResult() {
int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
if (champIndex >= _vm->_championMan->_partyChampionCount)
- return k0_spellCastFailure;
+ return kDMSpellCastFailure;
Champion *curChampion = &_vm->_championMan->_champions[champIndex];
if (!curChampion->_currHealth)
- return k0_spellCastFailure;
+ return kDMSpellCastFailure;
Spell *curSpell = getSpellFromSymbols((unsigned char *)curChampion->_symbols);
if (!curSpell) {
- menusPrintSpellFailureMessage(curChampion, k1_spellCastSuccess, 0);
- return k0_spellCastFailure;
+ menusPrintSpellFailureMessage(curChampion, kDMSpellCastSuccess, 0);
+ return kDMSpellCastFailure;
}
int16 powerSymbolOrdinal = curChampion->_symbols[0] - '_'; /* Values 1 to 6 */
uint16 requiredSkillLevel = curSpell->_baseRequiredSkillLevel + powerSymbolOrdinal;
@@ -542,8 +542,8 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
while (missingSkillLevelCount--) {
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;
+ menusPrintSpellFailureMessage(curChampion, kDMFailureNeedsMorePractice, curSpell->_skillIndex);
+ return kDMSpellCastFailure;
}
}
}
@@ -552,8 +552,8 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
Thing newObject;
Potion *newPotion = getEmptyFlaskInHand(curChampion, &newObject);
if (!newPotion) {
- menusPrintSpellFailureMessage(curChampion, k10_failureNeedsFlaskInHand, 0);
- return k3_spellCastFailureNeedsFlask;
+ menusPrintSpellFailureMessage(curChampion, kDMFailureNeedsFlaskInHand, 0);
+ return kDMSpellCastFailureNeedsFlask;
}
uint16 emptyFlaskWeight = _vm->_dungeonMan->getObjectWeight(newObject);
newPotion->setType((PotionType)curSpell->getType());
@@ -682,7 +682,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
}
_vm->_championMan->addSkillExperience(champIndex, curSpell->_skillIndex, experience);
_vm->_championMan->disableAction(champIndex, curSpell->getDuration());
- return k1_spellCastSuccess;
+ return kDMSpellCastSuccess;
}
Spell *MenuMan::getSpellFromSymbols(byte *symbols) {
@@ -765,7 +765,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
const char *message = nullptr;
switch (failureType) {
- case k0_failureNeedsMorePractice:
+ case kDMFailureNeedsMorePractice:
_vm->_textMan->printMessage(k4_ColorCyan, messages[0]);
_vm->_textMan->printMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == kDMSkillWizard)
@@ -774,12 +774,14 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
message = messages[4];
break;
- case k1_failureMeaninglessSpell:
+ case kDMFailureMeaninglessSpell:
message = messages[2];
break;
- case k10_failureNeedsFlaskInHand:
+ case kDMFailureNeedsFlaskInHand:
message = messages[3];
break;
+ default:
+ break;
}
_vm->_textMan->printMessage(k4_ColorCyan, message);
}
@@ -918,7 +920,7 @@ void MenuMan::deleteChampionSymbol() {
bool MenuMan::didClickTriggerAction(int16 actionListIndex) {
bool retVal = false;
- if (!_vm->_championMan->_actingChampionOrdinal || (actionListIndex != -1 && (_actionList._actionIndices[actionListIndex] == k255_ChampionActionNone)))
+ if (!_vm->_championMan->_actingChampionOrdinal || (actionListIndex != -1 && (_actionList._actionIndices[actionListIndex] == kDMActionNone)))
return retVal;
uint16 championIndex = _vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal);
@@ -1063,32 +1065,32 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
Thing explosionThing = Thing::_none;
bool actionPerformed = true;
switch (actionIndex) {
- case k23_ChampionActionLightning:
+ case kDMActionLightning:
kineticEnergy = 180;
explosionThing = Thing::_explLightningBolt;
setDirectionFl = true;
break;
- case k21_ChampionActionDispel:
+ case kDMActionDispel:
kineticEnergy = 150;
explosionThing = Thing::_explHarmNonMaterial;
setDirectionFl = true;
break;
- case k20_ChampionActionFireball:
+ case kDMActionFireball:
kineticEnergy = 150;
explosionThing = Thing::_explFireBall;
setDirectionFl = true;
break;
- case k40_ChampionActionSpit:
+ case kDMActionSpit:
kineticEnergy = 250;
explosionThing = Thing::_explFireBall;
setDirectionFl = true;
break;
- case k30_ChampionActionBash:
- case k18_ChampionActionHack:
- case k19_ChampionActionBerzerk:
- case k7_ChampionActionKick:
- case k13_ChampionActionSwing:
- case k2_ChampionActionChop:
+ case kDMActionBash:
+ case kDMActionHack:
+ case kDMActionBerzerk:
+ case kDMActionKick:
+ case kDMActionSwing:
+ case kDMActionChop:
if ((Square(targetSquare).getType() == k4_DoorElemType) && (Square(targetSquare).getDoorState() == k4_doorState_CLOSED)) {
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
actionDisabledTicks = 6;
@@ -1096,37 +1098,37 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
_vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
break;
}
- case k24_ChampionActionDisrupt:
- case k16_ChampionActionJab:
- case k17_ChampionActionParry:
- case k14_ChampionActionStab_C014:
- case k9_ChampionActionStab_C009:
- case k31_ChampionActionStun:
- case k15_ChampionActionThrust:
- case k25_ChampionActionMelee:
- case k28_ChampionActionSlash:
- case k29_ChampionActionCleave:
- case k6_ChampionActionPunch:
+ case kDMActionDisrupt:
+ case kDMActionJab:
+ case kDMActionParry:
+ case kDMActionStab14:
+ case kDMActionStab9:
+ case kDMActionStun:
+ case kDMActionThrust:
+ case kDMActionMelee:
+ case kDMActionSlash:
+ case kDMActionCleave:
+ case kDMActionPunch:
if (!(actionPerformed = isMeleeActionPerformed(champIndex, curChampion, actionIndex, nextMapX, nextMapY, actionSkillIndex))) {
actionExperienceGain >>= 1;
actionDisabledTicks >>= 1;
}
break;
- case k22_ChampionActionConfuse:
+ case kDMActionConfuse:
decrementCharges(curChampion);
// No break on purpose
- case k8_ChampionActionWarCry:
- case k37_ChampionActionCalm:
- case k41_ChampionActionBrandish:
- case k4_ChampionActionBlowHorn:
- if (actionIndex == k8_ChampionActionWarCry)
+ case kDMActionWarCry:
+ case kDMActionCalm:
+ case kDMActionBrandish:
+ case kDMActionBlowHorn:
+ if (actionIndex == kDMActionWarCry)
_vm->_sound->requestPlay(k28_soundWAR_CRY, nextMapX, nextMapY, k0_soundModePlayImmediately);
- else if (actionIndex == k4_ChampionActionBlowHorn)
+ else if (actionIndex == kDMActionBlowHorn)
_vm->_sound->requestPlay(k25_soundBLOW_HORN, nextMapX, nextMapY, k0_soundModePlayImmediately);
actionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, nextMapX, nextMapY);
break;
- case k32_ChampionActionShoot: {
+ case kDMActionShoot: {
if (Thing(curChampion->_slots[kDMSlotReadyHand]).getType() != k5_WeaponThingType) {
_actionDamage = kM2_damageNoAmmunition;
actionExperienceGain = 0;
@@ -1163,7 +1165,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
_vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, kDMSkillShoot)) << 1, stepEnergy);
}
break;
- case k5_ChampionActionFlip: {
+ case kDMActionFlip: {
const char *messagesEN[2] = {"IT COMES UP HEADS.", "IT COMES UP TAILS."};
const char *messagesDE[2] = {"DIE KOPFSEITE IST OBEN.", "DIE ZAHL IST OBEN."};
const char *messagesFR[2] = {"C'EST FACE.", "C'EST PILE."};
@@ -1187,16 +1189,16 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
}
break;
- case k33_ChampionActionSpellshield:
- case k34_ChampionActionFireshield:
- if (!isPartySpellOrFireShieldSuccessful(curChampion, actionIndex == k33_ChampionActionSpellshield, 280, true)) {
+ case kDMActionSpellshield:
+ case kDMActionFireshield:
+ if (!isPartySpellOrFireShieldSuccessful(curChampion, actionIndex == kDMActionSpellshield, 280, true)) {
actionExperienceGain >>= 2;
actionDisabledTicks >>= 1;
} else
decrementCharges(curChampion);
break;
- case k27_ChampionActionInvoke:
+ case kDMActionInvoke:
kineticEnergy = _vm->getRandomNumber(128) + 100;
switch (_vm->getRandomNumber(6)) {
case 0:
@@ -1215,18 +1217,18 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
setDirectionFl = true;
break;
- case k35_ChampionActionFluxcage:
+ case kDMActionFluxcage:
setChampionDirectionToPartyDirection(curChampion);
_vm->_groupMan->fluxCageAction(nextMapX, nextMapY);
break;
- case k43_ChampionActionFuse:
+ case kDMActionFuse:
setChampionDirectionToPartyDirection(curChampion);
nextMapX = _vm->_dungeonMan->_partyMapX;
nextMapY = _vm->_dungeonMan->_partyMapY;
nextMapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], nextMapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
_vm->_groupMan->fuseAction(nextMapX, nextMapY);
break;
- case k36_ChampionActionHeal: {
+ case kDMActionHeal: {
/* CHANGE2_17_IMPROVEMENT Heal action is much more effective
Heal cycles occur as long as the champion has missing health and enough mana. Cycle count = Min(Current Mana / 2, Missing health / Min(10, Heal skill level))
Healing amount is Min(Missing health, Min(10, Heal skill level)) * heal cycle count
@@ -1254,7 +1256,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
}
}
break;
- case k39_ChampionActionWindow: {
+ case kDMActionWindow: {
int16 windowTicks = _vm->getRandomNumber(_vm->_championMan->getSkillLevel(champIndex, actionSkillIndex) + 8) + 5;
TimelineEvent newEvent;
newEvent._priority = 0;
@@ -1265,7 +1267,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
decrementCharges(curChampion);
}
break;
- case k10_ChampionActionClimbDown:
+ case kDMActionClimbDown:
nextMapX = _vm->_dungeonMan->_partyMapX;
nextMapY = _vm->_dungeonMan->_partyMapY;
nextMapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir];
@@ -1282,7 +1284,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
actionDisabledTicks = 0;
}
break;
- case k11_ChampionActionFreezeLife: {
+ case kDMActionFreezeLife: {
int16 freezeTicks;
if (weaponInHand->getType() == k42_JunkTypeMagicalBoxBlue) {
freezeTicks = 30;
@@ -1299,12 +1301,12 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
_vm->_championMan->_party._freezeLifeTicks = MIN(200, _vm->_championMan->_party._freezeLifeTicks + freezeTicks);
}
break;
- case k38_ChampionActionLight:
+ case kDMActionLight:
_vm->_championMan->_party._magicalLightAmount += _vm->_championMan->_lightPowerToLightAmount[2];
createEvent70_light(-2, 2500);
decrementCharges(curChampion);
break;
- case k42_ChampionActionThrow:
+ case kDMActionThrow:
setChampionDirectionToPartyDirection(curChampion);
actionPerformed = _vm->_championMan->isObjectThrown(champIndex, kDMSlotActionHand, (curChampion->_cell == returnNextVal(_vm->_dungeonMan->_partyDir)) || (curChampion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_partyDir)));
if (actionPerformed)
@@ -1483,12 +1485,12 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
break;
}
- if ((actionIndex == k24_ChampionActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
+ if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
return false;
uint16 actionHitProbability = actionHitProbabilityArray[actionIndex];
uint16 actionDamageFactor = actionDamageFactorArray[actionIndex];
- if ((_vm->_objectMan->getIconIndex(champ->_slots[kDMSlotActionHand]) == kDMIconIndiceWeaponVorpalBlade) || (actionIndex == k24_ChampionActionDisrupt)) {
+ if ((_vm->_objectMan->getIconIndex(champ->_slots[kDMSlotActionHand]) == kDMIconIndiceWeaponVorpalBlade) || (actionIndex == kDMActionDisrupt)) {
setFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures);
}
_actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing), _vm->ordinalToIndex(targetCreatureOrdinal), targetMapX, targetMapY, actionHitProbability, actionDamageFactor, skillIndex);
@@ -1507,23 +1509,23 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
int16 frightAmount = 0;
switch (actionIndex) {
- case k8_ChampionActionWarCry:
+ case kDMActionWarCry:
frightAmount = 3;
experience = 12; /* War Cry gives experience in priest skill k14_ChampionSkillInfluence below. The War Cry action also has an experience gain of 7 defined in G0497_auc_Graphic560_ActionExperienceGain in the same skill (versions 1.1 and below) or in the fighter skill k7_ChampionSkillParry (versions 1.2 and above). In versions 1.2 and above, this is the only action that gives experience in two skills */
break;
- case k37_ChampionActionCalm:
+ case kDMActionCalm:
frightAmount = 7;
experience = 35;
break;
- case k41_ChampionActionBrandish:
+ case kDMActionBrandish:
frightAmount = 6;
experience = 30;
break;
- case k4_ChampionActionBlowHorn:
+ case kDMActionBlowHorn:
frightAmount = 6;
experience = 20;
break;
- case k22_ChampionActionConfuse:
+ case kDMActionConfuse:
frightAmount = 12;
experience = 45;
break;
@@ -1658,7 +1660,7 @@ void MenuMan::setActionList(ActionSet *actionSet) {
for (uint16 idx = 1; idx < 3; idx++) {
uint16 actionIndex = actionSet->_actionIndices[idx];
- if (actionIndex == k255_ChampionActionNone)
+ if (actionIndex == kDMActionNone)
continue;
uint16 minimumSkillLevel = actionSet->_actionProperties[idx - 1];
@@ -1675,7 +1677,7 @@ void MenuMan::setActionList(ActionSet *actionSet) {
_actionCount = nextAvailableActionListIndex;
for (uint16 idx = nextAvailableActionListIndex; idx < 3; idx++)
- _actionList._actionIndices[idx] = k255_ChampionActionNone;
+ _actionList._actionIndices[idx] = kDMActionNone;
}
int16 MenuMan::getActionObjectChargeCount() {
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 8787e50a24..815442a6c7 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, kDMWoundLegs | kDMWoundFeet, k2_attackType_SELF))
+ } else if (_vm->_championMan->getDamagedChampionCount(20, kDMWoundLegs | kDMWoundFeet, kDMAttackTypeSelf))
_vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
}
_useRopeToClimbDownPit = false;
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index cbf00852d8..c9682a18e1 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -232,7 +232,7 @@ T0217044:
uint16 ProjExpl::getProjectileImpactAttack(Projectile *projectile, Thing thing) {
_projectilePoisonAttack = 0;
- _projectileAttackType = k3_attackType_BLUNT;
+ _projectileAttackType = kDMAttackTypeBlunt;
uint16 kineticEnergy = projectile->_kineticEnergy;
ThingType thingType = thing.getType();
@@ -241,7 +241,7 @@ uint16 ProjExpl::getProjectileImpactAttack(Projectile *projectile, Thing thing)
if (thingType == k5_WeaponThingType) {
WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(thing);
attack = weaponInfo->_kineticEnergy;
- _projectileAttackType = k3_attackType_BLUNT;
+ _projectileAttackType = kDMAttackTypeBlunt;
} else
attack = _vm->getRandomNumber(4);
@@ -252,17 +252,17 @@ uint16 ProjExpl::getProjectileImpactAttack(Projectile *projectile, Thing thing)
attack += _vm->getRandomNumber(32);
} else {
if (thing.toUint16() >= Thing::_explHarmNonMaterial.toUint16()) {
- _projectileAttackType = k5_attackType_MAGIC;
+ _projectileAttackType = kDMAttackTypeMagic;
if (thing == Thing::_explPoisonBolt) {
_projectilePoisonAttack = kineticEnergy;
return 1;
}
return 0;
}
- _projectileAttackType = k1_attackType_FIRE;
+ _projectileAttackType = kDMAttackTypeFire;
attack = _vm->getRandomNumber(16) + _vm->getRandomNumber(16) + 10;
if (thing == Thing::_explLightningBolt) {
- _projectileAttackType = k7_attackType_LIGHTNING;
+ _projectileAttackType = kDMAttackTypeLightning;
attack *= 5;
}
}
@@ -326,7 +326,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
if ((explThing == Thing::_explFireBall) || (attack >>= 1)) {
if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (projectileMapX == _vm->_dungeonMan->_partyMapX) && (projectileMapY == _vm->_dungeonMan->_partyMapY)) {
int16 wounds = kDMWoundReadHand | kDMWoundActionHand | kDMWoundHead | kDMWoundTorso | kDMWoundLegs | kDMWoundFeet;
- _vm->_championMan->getDamagedChampionCount(attack, wounds, k1_attackType_FIRE);
+ _vm->_championMan->getDamagedChampionCount(attack, wounds, kDMAttackTypeFire);
} else {
unusedThing = _vm->_groupMan->groupGetThing(projectileMapX, projectileMapY);
if (unusedThing != Thing::_endOfList) {
@@ -536,7 +536,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFF87:
if (explosionOnPartySquare)
- _vm->_championMan->getDamagedChampionCount(attack, kDMWoundNone, k0_attackType_NORMAL);
+ _vm->_championMan->getDamagedChampionCount(attack, kDMWoundNone, kDMAttackTypeNormal);
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 0bbe4009ac..8ec70f7f53 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -401,7 +401,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
// 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 = kDMWoundTorso | (verticalDoorFl ? kDMWoundHead : kDMWoundReadHand | kDMWoundActionHand);
- if (_vm->_championMan->getDamagedChampionCount(5, wounds, k2_attackType_SELF))
+ if (_vm->_championMan->getDamagedChampionCount(5, wounds, kDMAttackTypeSelf))
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, mapX, mapY, k1_soundModePlayIfPrioritized);
}
event->_mapTime++;
@@ -816,11 +816,11 @@ void Timeline::processEventEnableChampionAction(uint16 champIndex) {
Champion *curChampion = &_vm->_championMan->_champions[champIndex];
curChampion->_enableActionEventIndex = -1;
clearFlag(curChampion->_attributes, kDMAttributeDisableAction);
- if (curChampion->_actionIndex != k255_ChampionActionNone) {
+ if (curChampion->_actionIndex != kDMActionNone) {
curChampion->_actionDefense -= _actionDefense[curChampion->_actionDefense];
}
if (curChampion->_currHealth) {
- if ((curChampion->_actionIndex == k32_ChampionActionShoot) && (curChampion->_slots[kDMSlotReadyHand] == Thing::_none)) {
+ if ((curChampion->_actionIndex == kDMActionShoot) && (curChampion->_slots[kDMSlotReadyHand] == Thing::_none)) {
int16 slotIndex = kDMSlotQuiverLine1_1;
if (_vm->_championMan->isAmmunitionCompatibleWithWeapon(champIndex, kDMSlotActionHand, slotIndex))
_vm->_championMan->addObjectInSlot((ChampionIndex)champIndex, _vm->_championMan->getObjectRemovedFromSlot(champIndex, slotIndex), kDMSlotReadyHand);
@@ -835,7 +835,7 @@ void Timeline::processEventEnableChampionAction(uint16 champIndex) {
setFlag(curChampion->_attributes, kDMAttributeActionHand);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
- curChampion->_actionIndex = k255_ChampionActionNone;
+ curChampion->_actionIndex = kDMActionNone;
}
void Timeline::processEventMoveWeaponFromQuiverToSlot(uint16 champIndex, uint16 slotIndex) {