aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2007-04-15 10:43:31 +0000
committerPaul Gilbert2007-04-15 10:43:31 +0000
commite01efe4004bdd2faeb40ea69261253c8b9061239 (patch)
tree43d7003826afd3e48c3f806a1d0318ebdc435f33 /engines
parentc838ae690b85337b558ad582c9757dcf1bd349eb (diff)
downloadscummvm-rg350-e01efe4004bdd2faeb40ea69261253c8b9061239.tar.gz
scummvm-rg350-e01efe4004bdd2faeb40ea69261253c8b9061239.tar.bz2
scummvm-rg350-e01efe4004bdd2faeb40ea69261253c8b9061239.zip
Added new script methods
svn-id: r26485
Diffstat (limited to 'engines')
-rw-r--r--engines/lure/scripts.cpp35
-rw-r--r--engines/lure/scripts.h8
2 files changed, 32 insertions, 11 deletions
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 3542a00720..6256bd018d 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -439,6 +439,14 @@ void Script::setVillageSkorlTickProc(uint16 v1, uint16 v2, uint16 v3) {
hotspot->tickProcOffset = 0x7efa;
}
+// Free Goewin from captivity
+
+void Script::freeGoewin(uint16 v1, uint16 v2, uint16 v3) {
+ HotspotData *goewin = Resources::getReference().getHotspot(GOEWIN_ID);
+ goewin->actions = 0x820C00; // Enable Talk To, Give, Bribe, and Ask for
+ goewin->actionCtr = 1;
+}
+
// Barman serving the player
void Script::barmanServe(uint16 v1, uint16 v2, uint16 v3) {
@@ -461,6 +469,16 @@ void Script::getNumGroats(uint16 v1, uint16 v2, uint16 v3) {
fields.setField(GENERAL, fields.numGroats());
}
+// Enables the talk action on the two gargoyles
+
+void Script::enableGargoylesTalk(uint16 v1, uint16 v2, uint16 v3) {
+ Resources &res = Resources::getReference();
+ HotspotData *g1 = res.getHotspot(0x42C);
+ HotspotData *g2 = res.getHotspot(0x42D);
+ g1->actions = 1 << (TALK_TO - 1);
+ g2->actions = 1 << (TALK_TO - 1);
+}
+
// Loads the specified animation, completely bypassing the standard process
// of checking for a load proc/sequence
@@ -549,8 +567,10 @@ SequenceMethodRecord scriptMethods[] = {
{50, Script::givePlayerItem},
{51, Script::decreaseNumGroats},
{54, Script::setVillageSkorlTickProc},
+ {55, Script::freeGoewin},
{56, Script::barmanServe},
{57, Script::getNumGroats},
+ {59, Script::enableGargoylesTalk},
{62, Script::animationLoad},
{63, Script::addActions},
{64, Script::randomToGeneral},
@@ -911,9 +931,9 @@ bool HotspotScript::execute(Hotspot *h)
opcode = nextVal(scriptData, offset);
switch (opcode) {
- case S2_OPCODE_TIMEOUT:
+ case S2_OPCODE_FRAME_CTR:
param1 = nextVal(scriptData, offset);
- debugC(ERROR_DETAILED, kLureDebugScripts, "SET TIMEOUT = %d", param1);
+ debugC(ERROR_DETAILED, kLureDebugScripts, "SET FRAME_CTR = %d", param1);
h->setTickCtr(param1);
h->setScript(offset);
@@ -964,22 +984,21 @@ bool HotspotScript::execute(Hotspot *h)
h->setAnimation(param1);
break;
- case S2_OPCODE_UNKNOWN_247:
+ case S2_OPCODE_PLAY_SOUND:
param1 = nextVal(scriptData, offset);
param2 = nextVal(scriptData, offset);
- debugC(ERROR_DETAILED, kLureDebugScripts, "SUB_247(%d,%d)", param1, param2);
-
+ debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param1, param2);
// warning("UNKNOWN_247 stub called");
break;
- case S2_OPCODE_UNKNOWN_258:
+ case S2_OPCODE_STOP_SOUND:
param1 = nextVal(scriptData, offset);
- debugC(ERROR_DETAILED, kLureDebugScripts, "SUB_258()");
+ debugC(ERROR_DETAILED, kLureDebugScripts, "STOP_SOUND()");
// warning("UNKNOWN_258 stub called");
break;
case S2_OPCODE_ACTIONS:
- param1 = nextVal(scriptData, offset) << 4;
+ param1 = nextVal(scriptData, offset);
param2 = nextVal(scriptData, offset);
actions = (uint32) param1 | ((uint32) param2 << 16);
diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h
index 1e985b955a..5977fc0b3e 100644
--- a/engines/lure/scripts.h
+++ b/engines/lure/scripts.h
@@ -57,15 +57,15 @@ namespace Lure {
#define S_OPCODE_ABORT3 24
#define S_OPCODE_RANDOM 25
-#define S2_OPCODE_TIMEOUT -1
+#define S2_OPCODE_FRAME_CTR -1
#define S2_OPCODE_POSITION -2
#define S2_OPCODE_CHANGE_POS -3
#define S2_OPCODE_UNLOAD -4
#define S2_OPCODE_DIMENSIONS -5
#define S2_OPCODE_JUMP -6
#define S2_OPCODE_ANIMATION -7
-#define S2_OPCODE_UNKNOWN_247 -8
-#define S2_OPCODE_UNKNOWN_258 -9
+#define S2_OPCODE_PLAY_SOUND -8
+#define S2_OPCODE_STOP_SOUND -9
#define S2_OPCODE_ACTIONS -10
@@ -116,8 +116,10 @@ public:
static void givePlayerItem(uint16 hotspotId, uint16 v2, uint16 v3);
static void decreaseNumGroats(uint16 characterId, uint16 numGroats, uint16 v3);
static void setVillageSkorlTickProc(uint16 v1, uint16 v2, uint16 v3);
+ static void freeGoewin(uint16 v1, uint16 v2, uint16 v3);
static void barmanServe(uint16 v1, uint16 v2, uint16 v3);
static void getNumGroats(uint16 v1, uint16 v2, uint16 v3);
+ static void enableGargoylesTalk(uint16 v1, uint16 v2, uint16 v3);
static void animationLoad(uint16 hotspotId, uint16 v2, uint16 v3);
static void addActions(uint16 hotspotId, uint16 actions, uint16 v3);
static void randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3);