aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/scripts.cpp
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/lure/scripts.cpp
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/lure/scripts.cpp')
-rw-r--r--engines/lure/scripts.cpp35
1 files changed, 27 insertions, 8 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);