diff options
author | Paul Gilbert | 2007-01-31 02:24:55 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-01-31 02:24:55 +0000 |
commit | ee606dc1435e8e2012bd73597dc08bdef32c1f7b (patch) | |
tree | e7d5f06752f70327c2b060d943e25df1a23d7e7a /engines | |
parent | 6166c0ca19ec44faa6c527ea482a3c25d49d0e64 (diff) | |
download | scummvm-rg350-ee606dc1435e8e2012bd73597dc08bdef32c1f7b.tar.gz scummvm-rg350-ee606dc1435e8e2012bd73597dc08bdef32c1f7b.tar.bz2 scummvm-rg350-ee606dc1435e8e2012bd73597dc08bdef32c1f7b.zip |
Added script methods needed for leaving the dungeon
svn-id: r25297
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/scripts.cpp | 46 | ||||
-rw-r--r-- | engines/lure/scripts.h | 3 |
2 files changed, 49 insertions, 0 deletions
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 635941b640..d867ae45c0 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -212,6 +212,49 @@ void Script::isSkorlInCell(uint16 v1, uint16 v2, uint16 v3) { res.fieldList().setField(GENERAL, v); } +// Called by the script when Ratpouch is pushing the bricks in the Outer Cell + +void Script::ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3) +{ + Resources &res = Resources::getReference(); + + // Mark the bricks exit as now open + RoomExitJoinData *joinRec = res.getExitJoin(BRICKS_ID); + joinRec->blocked = 0; + + // Set Ratpouch moving through the new exit to room #7 + Hotspot *ratpouchHotspot = res.getActiveHotspot(RATPOUCH_ID); + ratpouchHotspot->setActions(0); // Make sure he can't be interrupted + ratpouchHotspot->currentActions().clear(); + ratpouchHotspot->currentActions().addBack(DISPATCH_ACTION, 7); +} + +// Causes the current character to change to the specified room and position + +void Script::characterChangeRoom(uint16 y, uint16 x, uint16 roomNumber) { + Resources &res = Resources::getReference(); + ValueTableData &fields = res.fieldList(); + Hotspot *charHotspot = res.getActiveHotspot(fields.getField(CHARACTER_HOTSPOT_ID)); + assert(charHotspot); + + uint16 newRoomNumber = roomNumber & 0xff; + Direction newDirection = (Direction)(roomNumber >> 8); + + Support::characterChangeRoom(*charHotspot, newRoomNumber, + (int16) (x - 0x80), (int16) (y - 0x80), newDirection); +} + +// Pauses Ratpouch for a long period (as good as idefinite) + +void Script::pauseRatpouch(uint16 v1, uint16 v2, uint16 v3) +{ + Resources &res = Resources::getReference(); + Hotspot *ratpouch = res.getActiveHotspot(RATPOUCH_ID); + assert(ratpouch); + ratpouch->setCharacterMode(CHARMODE_PAUSED); + ratpouch->setDelayCtr(0x7fff); +} + // Sets a character to a given hotspot script, and sets the character's current // action to executing a script @@ -462,6 +505,9 @@ SequenceMethodRecord scriptMethods[] = { {21, Script::playMusic}, {22, Script::getDoorBlocked}, {23, Script::isSkorlInCell}, + {24, Script::ratpouchPushBricks}, + {25, Script::characterChangeRoom}, + {26, Script::pauseRatpouch}, {27, Script::setBlockingHotspotScript}, {28, Script::decrInventoryItems}, {29, Script::setTalking}, diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h index f9ac3a9f72..5c1cc2b135 100644 --- a/engines/lure/scripts.h +++ b/engines/lure/scripts.h @@ -93,6 +93,9 @@ public: static void playMusic(uint16 musicNum, uint16 v2, uint16 v3); static void getDoorBlocked(uint16 hotspotId, uint16 v2, uint16 v3); static void isSkorlInCell(uint16 v1, uint16 v2, uint16 v3); + static void ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3); + static void characterChangeRoom(uint16 y, uint16 x, uint16 roomNumber); + static void pauseRatpouch(uint16 v1, uint16 v2, uint16 v3); static void setBlockingHotspotScript(uint16 charId, uint16 scriptIndex, uint16 v3); static void decrInventoryItems(uint16 v1, uint16 v2, uint16 v3); static void setTalking(uint16 characterId, uint16 destHotspot, uint16 messageId); |