diff options
author | Paul Gilbert | 2015-02-17 21:47:01 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-17 21:47:01 -0500 |
commit | 7b3c10b09c76c4a8cbd5dbfabb0ceeaeccbbce26 (patch) | |
tree | a2de490ac41dcea07ce7cb6c56f00cd2d8b46a30 /engines/xeen/interface.cpp | |
parent | c045adae76e414a8e6b57e48a651ea6c29ed280a (diff) | |
download | scummvm-rg350-7b3c10b09c76c4a8cbd5dbfabb0ceeaeccbbce26.tar.gz scummvm-rg350-7b3c10b09c76c4a8cbd5dbfabb0ceeaeccbbce26.tar.bz2 scummvm-rg350-7b3c10b09c76c4a8cbd5dbfabb0ceeaeccbbce26.zip |
XEEN: Implemented Cast Spell dialog
Diffstat (limited to 'engines/xeen/interface.cpp')
-rw-r--r-- | engines/xeen/interface.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index a8396288ee..3bd3ef12b6 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -31,6 +31,7 @@ #include "xeen/dialogs_query.h" #include "xeen/dialogs_quests.h" #include "xeen/dialogs_quick_ref.h" +#include "xeen/dialogs_spells.h" #include "xeen/resources.h" #include "xeen/xeen.h" @@ -267,6 +268,7 @@ void Interface::perform() { Map &map = *_vm->_map; Party &party = *_vm->_party; Scripts &scripts = *_vm->_scripts; + Spells &spells = *_vm->_spells; const Common::Rect waitBounds(8, 8, 224, 140); events.updateGameCounter(); @@ -517,6 +519,14 @@ void Interface::perform() { } break; + case Common::KEYCODE_c: { + // Cast spell + int spellId = CastSpell::show(_vm, _vm->_mode); + if (spellId != -1) + spells.castSpell(spellId); + break; + } + case Common::KEYCODE_i: // Show Info dialog _vm->_moveMonsters = false; @@ -585,8 +595,10 @@ void Interface::stepTime() { } void Interface::doStepCode() { + Combat &combat = *_vm->_combat; Map &map = *_vm->_map; Party &party = *_vm->_party; + Scripts &scripts = *_vm->_scripts; int damage = 0; party._stepped = true; @@ -642,8 +654,11 @@ void Interface::doStepCode() { _flipGround = !_flipGround; draw3d(true); - warning("TODO: apply damage"); + int oldVal = scripts._v2; + scripts._v2 = 0; + combat.giveCharDamage(damage, combat._damageType, 0); + scripts._v2 = oldVal; _flipGround = !_flipGround; } else if (party._partyDead) { draw3d(true); @@ -1825,6 +1840,7 @@ void Interface::doCombat() { Party &party = *_vm->_party; Screen &screen = *_vm->_screen; Scripts &scripts = *_vm->_scripts; + Spells &spells = *_vm->_spells; SoundManager &sound = *_vm->_sound; bool upDoorText = _upDoorText; bool reloadMap = false; @@ -1933,14 +1949,13 @@ void Interface::doCombat() { nextChar(); break; - case Common::KEYCODE_c: - // Cast Spell - if (combat.castSpell(false)) { - nextChar(); - } else { - highlightChar(combat._combatParty[combat._whosTurn]->_rosterId); - } + case Common::KEYCODE_c: { + // Cast spell + int spellId = CastSpell::show(_vm, _vm->_mode); + if (spellId != -1) + spells.castSpell(spellId); break; + } case Common::KEYCODE_f: // Quick Fight |