aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks/mechanical.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2011-02-13 17:14:56 +0100
committerBastien Bouclet2011-02-15 21:43:36 +0100
commit7e52ae2f5e3534ba0c2f425361c4a3bc51f813f4 (patch)
treec3b358cb4d7384da95a32d39b5fa8c235ea75365 /engines/mohawk/myst_stacks/mechanical.cpp
parenta76badf30746aea70745f0bf5bb87d44df2d9116 (diff)
downloadscummvm-rg350-7e52ae2f5e3534ba0c2f425361c4a3bc51f813f4.tar.gz
scummvm-rg350-7e52ae2f5e3534ba0c2f425361c4a3bc51f813f4.tar.bz2
scummvm-rg350-7e52ae2f5e3534ba0c2f425361c4a3bc51f813f4.zip
MOHAWK: Implement Mechanical opcodes 203 and 104, snake box
Diffstat (limited to 'engines/mohawk/myst_stacks/mechanical.cpp')
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp43
1 files changed, 8 insertions, 35 deletions
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index 46aade250d..c8652d4951 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -51,7 +51,7 @@ MystScriptParser_Mechanical::~MystScriptParser_Mechanical() {
void MystScriptParser_Mechanical::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, o_throneEnablePassage);
- OPCODE(104, opcode_104);
+ OPCODE(104, o_snakeBoxTrigger);
OPCODE(105, o_fortressStaircaseMovie);
OPCODE(121, opcode_121);
OPCODE(122, opcode_122);
@@ -70,7 +70,7 @@ void MystScriptParser_Mechanical::setupOpcodes() {
OPCODE(200, o_throne_init);
OPCODE(201, opcode_201);
OPCODE(202, opcode_202);
- OPCODE(203, opcode_203);
+ OPCODE(203, o_snakeBox_init);
OPCODE(204, opcode_204);
OPCODE(205, opcode_205);
OPCODE(206, opcode_206);
@@ -85,7 +85,6 @@ void MystScriptParser_Mechanical::setupOpcodes() {
void MystScriptParser_Mechanical::disablePersistentScripts() {
opcode_201_disable();
opcode_202_disable();
- opcode_203_disable();
opcode_204_disable();
opcode_205_disable();
opcode_206_disable();
@@ -95,7 +94,6 @@ void MystScriptParser_Mechanical::disablePersistentScripts() {
void MystScriptParser_Mechanical::runPersistentScripts() {
opcode_201_run();
opcode_202_run();
- opcode_203_run();
opcode_204_run();
opcode_205_run();
opcode_206_run();
@@ -227,17 +225,11 @@ void MystScriptParser_Mechanical::o_throneEnablePassage(uint16 op, uint16 var, u
_vm->_resources[argv[0]]->setEnabled(getVar(var));
}
-void MystScriptParser_Mechanical::opcode_104(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
+void MystScriptParser_Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op);
// Used on Mechanical Card 6043 (Weapons Rack with Snake Box)
- if (argc == 0) {
- debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op);
-
- // TODO: Trigger Type 6 To Play Snake Movie.. Resource #3 on card.
- } else
- unknown(op, var, argc, argv);
-
+ _snakeBox->playMovie();
}
void MystScriptParser_Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -437,29 +429,10 @@ void MystScriptParser_Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc,
unknown(op, var, argc, argv);
}
-static struct {
- bool enabled;
-} g_opcode203Parameters;
-
-void MystScriptParser_Mechanical::opcode_203_run() {
- if (g_opcode203Parameters.enabled) {
- // Used for Card 6043 (Weapons Rack with Snake Box)
- // TODO: Fill in Logic for Snake Box...
- }
-}
-
-void MystScriptParser_Mechanical::opcode_203_disable() {
- g_opcode203Parameters.enabled = false;
-}
+void MystScriptParser_Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Snake box init", op);
-void MystScriptParser_Mechanical::opcode_203(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
-
- // Used for Card 6043 (Weapons Rack with Snake Box)
- if (argc == 0)
- g_opcode203Parameters.enabled = true;
- else
- unknown(op, var, argc, argv);
+ _snakeBox = static_cast<MystResourceType6 *>(_invokingResource);
}
static struct {