diff options
author | athrxx | 2011-08-06 00:40:53 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-12-26 16:18:13 +0100 |
commit | bac0caeb0ff712fe9002985c44c1ea651b86e018 (patch) | |
tree | 5fbfbe57957f441f07e7b644ba402fb21c5f1f40 /engines/kyra/magic_eob.cpp | |
parent | aab9e62247af1c22772bb79821675fbab06c047d (diff) | |
download | scummvm-rg350-bac0caeb0ff712fe9002985c44c1ea651b86e018.tar.gz scummvm-rg350-bac0caeb0ff712fe9002985c44c1ea651b86e018.tar.bz2 scummvm-rg350-bac0caeb0ff712fe9002985c44c1ea651b86e018.zip |
KYRA: (EOB) - lots of fixes towards EOB1 playability
also implement some new code (EOB1 portals, burning hands spell, etc.)
Diffstat (limited to 'engines/kyra/magic_eob.cpp')
-rw-r--r-- | engines/kyra/magic_eob.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp index 3eb7591413..12d2524545 100644 --- a/engines/kyra/magic_eob.cpp +++ b/engines/kyra/magic_eob.cpp @@ -142,7 +142,7 @@ void EobCoreEngine::usePotion(int charIndex, int weaponSlot) { } void EobCoreEngine::useWand(int charIndex, int weaponSlot) { - int v = _items[_characters[charIndex].inventory[weaponSlot]].value - 1; + int v = _items[_characters[charIndex].inventory[weaponSlot]].value; if (!v) { _txt->printMessage(_wandStrings[0]); return; @@ -535,7 +535,7 @@ bool EobCoreEngine::magicObjectDamageHit(EobFlyingObject *fo, int dcTimes, int d if (!fo->item && (_characters[c].effectFlags & 8)) { res = true; } else { - if ((_characters[c].flags & 1) && hitTest && !monsterAttackHitTest(&_monsters[0], c)) { + if ((_characters[c].flags & 1) && (!hitTest || monsterAttackHitTest(&_monsters[0], c))) { int dmg = rollDice(dcTimes, dcPips, dcOffs) * level; res = true; calcAndInflictCharacterDamage(c, 0, 0, dmg, dmgFlag, s, dmgType); @@ -638,7 +638,31 @@ void EobCoreEngine::spellCallback_start_armor() { } void EobCoreEngine::spellCallback_start_burningHands() { + static const int16 bX[] = { 0, 152, 24, 120, 56, 88 }; + static const int8 bY[] = { 64, 64, 56, 56, 56, 56 }; + for (int i = 0; i < 6; i++) + drawBlockObject(i & 1, 0, _firebeamShapes[(5 - i) >> 1], bX[i], bY[i], 0); + _screen->updateScreen(); + delay(2 * _tickLength); + + int cl = getCharacterMageLevel(_openBookChar); + int bl = calcNewBlockPosition(_currentBlock, _currentDirection); + + const int8 *pos = getMonsterBlockPositions(bl); + _preventMonsterFlash = true; + + int numDest = (_flags.gameID == GI_EOB1) ? 2 : 6; + const uint8 *d = &_burningHandsDest[_currentDirection * (_flags.gameID == GI_EOB1 ? 2 : 8)]; + + for (int i = 0; i < numDest; i++, d++) { + if (pos[*d] == -1) + continue; + calcAndInflictMonsterDamage(&_monsters[pos[*d]], 1, 3, cl << 1, 0x21, 4, 0); + } + + updateAllMonsterShapes(); + _sceneUpdateRequired = true; } void EobCoreEngine::spellCallback_start_detectMagic() { @@ -949,6 +973,10 @@ void EobCoreEngine::spellCallback_start_turnUndead() { _preventMonsterFlash = false; } +bool EobCoreEngine::spellCallback_end_kuotoaAttack(EobFlyingObject *fo) { + return magicObjectDamageHit(fo, 0, 0, 12, 1); +} + bool EobCoreEngine::spellCallback_end_unk1Passive(EobFlyingObject *fo) { bool res = false; if (_partyEffectFlags & 0x20000) { |