[Scummvm-cvs-logs] SF.net SVN: scummvm: [25297] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Wed Jan 31 03:24:56 CET 2007
Revision: 25297
http://scummvm.svn.sourceforge.net/scummvm/?rev=25297&view=rev
Author: dreammaster
Date: 2007-01-30 18:24:55 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
Added script methods needed for leaving the dungeon
Modified Paths:
--------------
scummvm/trunk/engines/lure/scripts.cpp
scummvm/trunk/engines/lure/scripts.h
Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp 2007-01-31 00:16:21 UTC (rev 25296)
+++ scummvm/trunk/engines/lure/scripts.cpp 2007-01-31 02:24:55 UTC (rev 25297)
@@ -212,6 +212,49 @@
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 @@
{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},
Modified: scummvm/trunk/engines/lure/scripts.h
===================================================================
--- scummvm/trunk/engines/lure/scripts.h 2007-01-31 00:16:21 UTC (rev 25296)
+++ scummvm/trunk/engines/lure/scripts.h 2007-01-31 02:24:55 UTC (rev 25297)
@@ -93,6 +93,9 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list