From ee7b9271a2ca245a8b18e44a7379fc70b2362e27 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Tue, 11 Aug 2009 04:18:14 +0000 Subject: Implemented GPL command WalkOnPlay. svn-id: r43255 --- engines/draci/script.cpp | 23 ++++++++++++++++++++++- engines/draci/script.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'engines/draci') diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index eefc90d9c0..19b59dff48 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -60,7 +60,7 @@ void Script::setupCommandList() { { 9, 5, "ResetBlock", 1, { 3 }, &Script::resetBlock }, { 10, 1, "WalkOn", 3, { 1, 1, 3 }, &Script::walkOn }, { 10, 2, "StayOn", 3, { 1, 1, 3 }, &Script::walkOn }, // HACK: not a proper implementation - { 10, 3, "WalkOnPlay", 3, { 1, 1, 3 }, &Script::walkOn }, // HACK: not a proper implementation + { 10, 3, "WalkOnPlay", 3, { 1, 1, 3 }, &Script::walkOnPlay }, { 11, 1, "LoadPalette", 1, { 2 }, NULL }, { 12, 1, "SetPalette", 0, { 0 }, NULL }, { 12, 2, "BlackPalette", 0, { 0 }, NULL }, @@ -582,6 +582,27 @@ void Script::walkOn(Common::Queue ¶ms) { _vm->_game->walkHero(x, y); } +void Script::walkOnPlay(Common::Queue ¶ms) { + if (_vm->_game->getLoopStatus() == kStatusInventory) { + return; + } + + int x = params.pop(); + int y = params.pop(); + params.pop(); // facing direction, not used yet + + // HACK: This should be an onDest action when hero walking is properly implemented + _vm->_game->setExitLoop(true); + + _vm->_game->walkHero(x, y); + + _vm->_game->setLoopStatus(kStatusStrange); + _vm->_game->loop(); + _vm->_game->setLoopStatus(kStatusOrdinary); + + _vm->_game->setExitLoop(false); +} + void Script::newRoom(Common::Queue ¶ms) { if (_vm->_game->getLoopStatus() == kStatusInventory) { diff --git a/engines/draci/script.h b/engines/draci/script.h index b1f9ed9bbd..5483bf4e6a 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -115,6 +115,7 @@ private: void execLook(Common::Queue ¶ms); void execUse(Common::Queue ¶ms); void walkOn(Common::Queue ¶ms); + void walkOnPlay(Common::Queue ¶ms); void play(Common::Queue ¶ms); void startPlay(Common::Queue ¶ms); void newRoom(Common::Queue ¶ms); -- cgit v1.2.3