diff options
author | Florian Kagerer | 2009-06-03 19:58:06 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-06-03 19:58:06 +0000 |
commit | f77142c55cbe3dc0aed73ce3d2c8eb180a2c890a (patch) | |
tree | d42fd0a117804a45748bf5d52af174df342009d2 /engines/kyra | |
parent | 8c868054152d0ffb6866b1316219607c2fd0f028 (diff) | |
download | scummvm-rg350-f77142c55cbe3dc0aed73ce3d2c8eb180a2c890a.tar.gz scummvm-rg350-f77142c55cbe3dc0aed73ce3d2c8eb180a2c890a.tar.bz2 scummvm-rg350-f77142c55cbe3dc0aed73ce3d2c8eb180a2c890a.zip |
LOL: implemented guardian spell
svn-id: r41148
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/lol.cpp | 39 | ||||
-rw-r--r-- | engines/kyra/lol.h | 2 |
2 files changed, 38 insertions, 3 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 98b5abc949..6d0d32d17e 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -1915,7 +1915,7 @@ int LoLEngine::castUnk(ActiveSpell *a) { } int LoLEngine::castGuardian(ActiveSpell *a) { - processMagicGuardian(a->charNum, a->level); + processMagicGuardian(a->charNum); return 1; } @@ -2655,6 +2655,7 @@ void LoLEngine::processMagicSwarm(int charNum, int damage) { mov->close(); _screen->copyPage(12, 0); + _screen->updateScreen(); updateDrawPage2(); snd_playQueuedEffects(); @@ -2663,7 +2664,41 @@ void LoLEngine::processMagicSwarm(int charNum, int damage) { delete mov; } -void LoLEngine::processMagicGuardian(int charNum, int spellLevel) { +void LoLEngine::processMagicGuardian(int charNum) { + uint16 targetBlock = 0; + int dist = getSpellTargetBlock(_currentBlock, _currentDirection, 3, targetBlock); + + int cp = _screen->setCurPage(2); + _screen->copyPage(0, 2); + _screen->copyPage(2, 12); + + WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen); + mov->open("guardian.wsa", 0, 0); + if (!mov->opened()) + error("Guardian: Unable to load guardian.wsa"); + snd_playSoundEffect(156, -1); + playSpellAnimation(mov, 0, 37, 2, 112, 0, 0, 0, 0, 0, false); + + _screen->copyPage(2, 12); + + uint16 bl = calcNewBlockPosition(_currentBlock, _currentDirection); + bool a = (_levelBlockProperties[bl].assignedObjects & 0x8000) ? true : false; + inflictMagicalDamageForBlock(bl, charNum, 200, 0x80); + + _screen->copyPage(12, 2); + updateDrawPage2(); + gui_drawScene(2); + + _screen->copyPage(2, 12); + snd_playSoundEffect(176, -1); + playSpellAnimation(mov, 38, 48, 8, 112, 0, 0, 0, 0, 0, false); + + mov->close(); + delete mov; + + _screen->setCurPage(cp); + gui_drawPlayField(); + updateDrawPage2(); } void LoLEngine::callbackProcessMagicSwarm(WSAMovie_v2 *mov, int x, int y) { diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index a07446d0f8..4e9b39b88d 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -1340,7 +1340,7 @@ private: void processMagicLightning(int charNum, int spellLevel); void processMagicFog(); void processMagicSwarm(int charNum, int damage); - void processMagicGuardian(int charNum, int spellLevel); + void processMagicGuardian(int charNum); void callbackProcessMagicSwarm(WSAMovie_v2 *mov, int x, int y); void callbackProcessMagicLightning(WSAMovie_v2 *mov, int x, int y); |