diff options
author | Paul Gilbert | 2018-03-10 07:14:43 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-03-10 07:14:43 -0500 |
commit | aaee8772500ab3727dfcff724b5cd6b491d98476 (patch) | |
tree | c9ec1f488185ad0cbe1e436ce6e8c29bd68cdaa1 /engines | |
parent | 44ea691154db466fe9a07addea302e7fa5b24cab (diff) | |
download | scummvm-rg350-aaee8772500ab3727dfcff724b5cd6b491d98476.tar.gz scummvm-rg350-aaee8772500ab3727dfcff724b5cd6b491d98476.tar.bz2 scummvm-rg350-aaee8772500ab3727dfcff724b5cd6b491d98476.zip |
XEEN: Cleanup up usage of RangeType enum
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/combat.cpp | 10 | ||||
-rw-r--r-- | engines/xeen/combat.h | 5 | ||||
-rw-r--r-- | engines/xeen/item.h | 6 |
3 files changed, 9 insertions, 12 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 35283f2866..0c0836af66 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -1201,7 +1201,7 @@ void Combat::attack(Character &c, RangeType rangeType) { int monsterDataIndex = monster._spriteId; MonsterStruct &monsterData = map._monsterData[monsterDataIndex]; - if (rangeType) { + if (rangeType != RT_SINGLE) { if (_shootType != ST_1 || _damageType == DT_MAGIC_ARROW) { if (!monsterData._magicResistence || monsterData._magicResistence <= _vm->getRandomNumber(1, 100 + _oldCharacter->getCurrentLevel())) { @@ -1396,7 +1396,7 @@ void Combat::attack2(int damage, RangeType rangeType) { MonsterStruct &monsterData = *monster._monsterData; bool monsterDied = false; - if (!isDarkCc && damage && rangeType && monster._spriteId == 89) + if (!isDarkCc && damage && rangeType != RT_SINGLE && monster._spriteId == 89) damage = 0; if (!damage) { @@ -1432,7 +1432,7 @@ void Combat::attack2(int damage, RangeType rangeType) { if (monsterResist > 0) { _pow[_attackDurationCtr]._elemFrame = _attackWeapon->getElementalCategory(); _pow[_attackDurationCtr]._elemScale = getDamageScale(monsterResist); - } else if (rangeType != 3) { + } else if (rangeType != RT_HIT) { _pow[_attackDurationCtr]._elemFrame = 0; } @@ -1441,7 +1441,7 @@ void Combat::attack2(int damage, RangeType rangeType) { monster._effect1 = 0; } - if (rangeType && monsterSavingThrow(monster._spriteId)) { + if (rangeType != RT_SINGLE && monsterSavingThrow(monster._spriteId)) { switch (_damageType) { case DT_FINGEROFDEATH: case DT_MASS_DISTORTION: @@ -1680,7 +1680,7 @@ void Combat::getWeaponDamage(Character &c, RangeType rangeType) { for (int idx = 0; idx < INV_ITEMS_TOTAL; ++idx) { XeenItem &weapon = c._weapons[idx]; bool flag; - if (rangeType) { + if (rangeType != RT_SINGLE) { flag = weapon._frame == 4; } else { flag = weapon._frame == 1 || weapon._frame == 13; diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index e01d4df02e..f081add8c3 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -26,7 +26,6 @@ #include "common/scummsys.h" #include "common/rect.h" #include "xeen/files.h" -#include "xeen/item.h" #include "xeen/sprites.h" namespace Xeen { @@ -71,6 +70,10 @@ enum PowType { POW_SPARKLES = 14, POW_DEADLY_SWARM = 15 }; +enum RangeType { + RT_SINGLE = 0, RT_GROUP = 1, RT_ALL = 2, RT_HIT = 3 +}; + class XeenEngine; class Character; class XeenItem; diff --git a/engines/xeen/item.h b/engines/xeen/item.h index 6e81004298..d951353851 100644 --- a/engines/xeen/item.h +++ b/engines/xeen/item.h @@ -47,10 +47,6 @@ enum AttributeCategory { ATTR_ARMOR_CLASS = 8, ATTR_THIEVERY = 9 }; -enum RangeType { - RT_SINGLE = 0, RT_GROUP = 1, RT_ALL = 2, RT_HIT = 3 -}; - enum ElementalCategory { ELEM_FIRE = 0, ELEM_ELECTRICITY = 1, ELEM_COLD = 2, ELEM_ACID_POISON = 3, ELEM_ENERGY = 4, ELEM_MAGIC = 5 @@ -94,8 +90,6 @@ public: * Gets the attribute category for the item */ AttributeCategory getAttributeCategory() const; - - void getWeaponDamage(Character &c, RangeType rangeType); }; class InventoryItems : public Common::Array<XeenItem> { |