aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/eobcommon.cpp
diff options
context:
space:
mode:
authorathrxx2018-10-27 14:43:21 +0200
committerathrxx2018-10-28 15:48:42 +0100
commit05f6cf388b23e6d14a7f510767018f1dc61bf795 (patch)
tree44fbad5ecebec5e55a4f84ab43de280f60556ce8 /engines/kyra/eobcommon.cpp
parent3ae1d92f179d7062bb3291eb69748be060a046f3 (diff)
downloadscummvm-rg350-05f6cf388b23e6d14a7f510767018f1dc61bf795.tar.gz
scummvm-rg350-05f6cf388b23e6d14a7f510767018f1dc61bf795.tar.bz2
scummvm-rg350-05f6cf388b23e6d14a7f510767018f1dc61bf795.zip
KYRA: (EOB) - minor fix for EOB 1 monster hit chance calculation
Diffstat (limited to 'engines/kyra/eobcommon.cpp')
-rw-r--r--engines/kyra/eobcommon.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index 2264d99dde..b8887528e4 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -66,6 +66,8 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_redSplatShape = _greenSplatShape = _deadCharShape = _disabledCharGrid = 0;
_blackBoxSmallGrid = _weaponSlotGrid = _blackBoxWideGrid = _lightningColumnShape = 0;
+ _monsterAcHitChanceTable1 = _monsterAcHitChanceTable2 = 0;
+
_monsterDustStrings = 0;
_enemyMageSpellList = 0;
_enemyMageSfx = 0;
@@ -2366,13 +2368,10 @@ int EoBCoreEngine::getDexHitChanceModifier(int charIndex) {
}
int EoBCoreEngine::getMonsterAcHitChanceModifier(int charIndex, int monsterAc) {
- static const uint8 mod1[] = { 1, 3, 3, 2 };
- static const uint8 mod2[] = { 1, 1, 2, 1 };
-
int l = _characters[charIndex].level[0] - 1;
int cm = _charClassModifier[_characters[charIndex].cClass];
- return (20 - ((l / mod1[cm]) * mod2[cm])) - monsterAc;
+ return (20 - ((l / _monsterAcHitChanceTable1[cm]) * _monsterAcHitChanceTable2[cm])) - monsterAc;
}
void EoBCoreEngine::explodeMonster(EoBMonsterInPlay *m) {