[Scummvm-git-logs] scummvm master -> 5dd35734a4ddc32f88f80e36d14c865a7fb83207
dreammaster
noreply at scummvm.org
Fri Jun 12 11:31:10 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
75aae29046 MADS: FOREST: Implemented room 308
5dd35734a4 MADS: FOREST: Implemented room 321
Commit: 75aae2904673b3be51ba207cb14a588320ac0f65
https://github.com/scummvm/scummvm/commit/75aae2904673b3be51ba207cb14a588320ac0f65
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-12T21:31:01+10:00
Commit Message:
MADS: FOREST: Implemented room 308
Changed paths:
engines/mads/madsv2/forest/global.cpp
engines/mads/madsv2/forest/global.h
engines/mads/madsv2/forest/rooms/room308.cpp
diff --git a/engines/mads/madsv2/forest/global.cpp b/engines/mads/madsv2/forest/global.cpp
index 96b4c21eca6..476693e6ac2 100644
--- a/engines/mads/madsv2/forest/global.cpp
+++ b/engines/mads/madsv2/forest/global.cpp
@@ -36,6 +36,7 @@ namespace Forest {
int16 flags[40];
bool room_203_flag;
+bool inv_enable_command;
namespace Rooms {
diff --git a/engines/mads/madsv2/forest/global.h b/engines/mads/madsv2/forest/global.h
index 7de3fd09301..f5db0c4fecb 100644
--- a/engines/mads/madsv2/forest/global.h
+++ b/engines/mads/madsv2/forest/global.h
@@ -256,6 +256,7 @@ struct AnimationInfo {
extern int16 flags[40];
extern bool room_203_flag;
+extern bool inv_enable_command;
extern void global_section_constructor();
extern void sync_room(Common::Serializer &s);
diff --git a/engines/mads/madsv2/forest/rooms/room308.cpp b/engines/mads/madsv2/forest/rooms/room308.cpp
index 247e246d499..b25277516da 100644
--- a/engines/mads/madsv2/forest/rooms/room308.cpp
+++ b/engines/mads/madsv2/forest/rooms/room308.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -19,18 +19,18 @@
*
*/
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/digi.h"
+#include "mads/madsv2/forest/extra.h"
+#include "mads/madsv2/forest/journal.h"
#include "mads/madsv2/core/game.h"
#include "mads/madsv2/core/imath.h"
#include "mads/madsv2/core/inter.h"
#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/forest/mads/inventory.h"
-#include "mads/madsv2/forest/mads/sounds.h"
-#include "mads/madsv2/forest/mads/words.h"
+#include "mads/madsv2/core/object.h"
+#include "mads/madsv2/core/player.h"
+#include "mads/madsv2/core/sprite.h"
#include "mads/madsv2/forest/global.h"
-#include "mads/madsv2/forest/rooms/section1.h"
+#include "mads/madsv2/forest/rooms/section3.h"
#include "mads/madsv2/forest/rooms/room308.h"
namespace MADS {
@@ -39,44 +39,1348 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* Sprite series handles */
- int16 sequence[10]; /* Sequence handles */
- int16 animation[10]; /* Animation handles */
- AnimationInfo animation_info[10];
+ int16 sprite[10]; // 0x00â0x13
+ int16 sequence[10]; // 0x14â0x27
+ int16 animation[10]; // 0x28â0x3B
+ AnimationInfo animation_info[10]; // 0x3Câ0x8B
+ int16 _8c; // 0x8C
+ int16 _8e; // 0x8E
+ int16 _90; // 0x90
+ int16 _92; // 0x92
+ int16 _94; // 0x94
+ int16 _96; // 0x96
+ int16 _98; // 0x98
+ int16 _9a; // 0x9A
+ int16 _9c; // 0x9C
+ int16 _9e; // 0x9E
+ int16 _a0; // 0xA0
+ int16 _a2; // 0xA2
+ int16 _a4; // 0xA4
+ int16 _a6; // 0xA6
+ int16 _a8; // 0xA8
+ int16 _aa; // 0xAA
+ int16 _ac; // 0xAC
+ int16 _ae; // 0xAE
+ int16 _b0; // 0xB0
+ int16 _b2; // 0xB2
+ int16 _b4; // 0xB4
+ int16 _b6; // 0xB6
+ int16 _b8; // 0xB8
+ int16 _ba; // 0xBA
+ int16 _bc; // 0xBC
+ int16 _be; // 0xBE
+ int16 _c0; // 0xC0
+ byte _c2; // 0xC2
+ byte _c2hi; // 0xC3
+ byte _c4; // 0xC4
+ byte _c5; // 0xC5
+ byte _c6; // 0xC6
};
static Scratch scratch;
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
+#define local (&scratch)
+#define ss local->sprite
+#define seq local->sequence
+#define aa local->animation
#define aainfo scratch.animation_info
+static void room_308_anim1() {
+ int16 cur = kernel_anim[ss[4]].frame;
+ if (cur == aainfo[0]._active)
+ return;
+ aainfo[0]._active = cur;
+
+ switch (cur) {
+ case 40:
+ global[player_score] = 0;
+ break;
+ case 56:
+ case 84:
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 3);
+ break;
+ case 65:
+ digi_play_build(308, 'b', 1, 1);
+ scratch._b4 = -1;
+ break;
+ case 70:
+ global[g009] = 0;
+ global_digi_play(9);
+ break;
+ case 88:
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 3, 2);
+ break;
+ case 102:
+ digi_play_build(308, '_', 6, 2);
+ break;
+ case 107:
+ digi_play_build(308, 'b', 2, 1);
+ scratch._b4 = -1;
+ break;
+ case 119:
+ digi_play_build(101, '_', 2, 2);
+ break;
+ case 121:
+ digi_play_build(308, 'e', 1, 1);
+ scratch._b4 = -1;
+ break;
+ default:
+ break;
+ }
+}
+
+static void room_308_anim2() {
+ int16 cur = kernel_anim[ss[5]].frame;
+ if (cur == aainfo[0]._val3)
+ return;
+ aainfo[0]._val3 = cur;
+ if (cur == 6) {
+ digi_play_build(308, 't', 1, 1);
+ scratch._b4 = -1;
+ }
+}
+
+static void room_308_anim3() {
+ int16 cur = kernel_anim[ss[6]].frame;
+ if (cur == aainfo[1]._active)
+ return;
+ aainfo[1]._active = cur;
+ switch (cur) {
+ case 2:
+ digi_play_build(308, 'r', 1, 1);
+ scratch._b4 = -1;
+ break;
+ case 4:
+ case 8:
+ case 13:
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ break;
+ default:
+ break;
+ }
+}
+
+static void room_308_anim4() {
+ int16 cur = kernel_anim[ss[7]].frame;
+ if (cur == aainfo[1]._val3)
+ return;
+ aainfo[1]._val3 = cur;
+
+ if (cur == 13) {
+ digi_play_build(308, 't', 2, 1);
+ scratch._b4 = -1;
+ return;
+ }
+
+ bool in_e72 = (cur == 1 || cur == 5) ||
+ (cur >= 10 && cur <= 58 && cur % 4 == 2);
+ if (in_e72 && (digi_val1 == 0 || (cur != 10 && cur != 14))) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ }
+}
+
+static void room_308_anim5() {
+ int16 cur = kernel_anim[ss[8]].frame;
+ if (cur == aainfo[2]._active)
+ return;
+ aainfo[2]._active = cur;
+
+ if (cur == 30 || cur == 104) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 2, 1);
+ scratch._b4 = -1;
+ return;
+ }
+ if (cur % 4 == 1 && cur <= 117) {
+ if (cur == 1) {
+ digi_play_build(308, 'e', 2, 1);
+ scratch._b4 = -1;
+ }
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ }
+}
+
+static void room_308_anim7() {
+ int16 cur = kernel_anim[ss[9]].frame;
+ if (cur == aainfo[2]._val3)
+ return;
+ aainfo[2]._val3 = cur;
+ if (cur == 1 || cur == 5) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ }
+}
+
+static void room_308_anim8() {
+ int16 cur = kernel_anim[seq[5]].frame;
+ if (cur == aainfo[6]._val4)
+ return;
+ aainfo[6]._val4 = cur;
+
+ if (cur == 57) {
+ player.commands_allowed = -1;
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[5]);
+ aainfo[2]._frame = 0;
+
+ seq[0] = kernel_run_animation(kernel_name('t', 11), 0);
+ aainfo[2]._val4 = -1;
+ aainfo[3]._frame = 0;
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+
+ seq[1] = kernel_run_animation(kernel_name('t', 19), 0);
+ aainfo[3]._val3 = -1;
+ aainfo[4]._active = 0;
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+
+ seq[2] = kernel_run_animation(kernel_name('t', 13), 0);
+ aainfo[4]._frame = -1;
+ aainfo[4]._val4 = 0;
+ kernel_synch(KERNEL_ANIM, seq[2], KERNEL_NOW, 0);
+
+ seq[3] = kernel_run_animation(kernel_name('t', 18), 0);
+ aainfo[5]._active = -1;
+ aainfo[5]._val3 = 0;
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_NOW, 0);
+
+ global[player_score] = -1;
+ return;
+ }
+ if (cur > 57)
+ return;
+ if (cur == 6) {
+ digi_play_build(308, 'e', 3, 1);
+ scratch._b4 = -1;
+ return;
+ }
+ if (cur == 27) {
+ digi_play_build(308, 'b', 3, 1);
+ scratch._b4 = -1;
+ }
+}
+
+static void room_308_anim9() {
+ int16 cur = kernel_anim[seq[0]].frame;
+ if (cur == aainfo[3]._active)
+ return;
+ aainfo[3]._active = cur;
+
+ int16 result = -1;
+ if (cur == 11) {
+ result = 10;
+ } else if (cur < 11) {
+ if (cur == 1) {
+ if (aainfo[5]._val3 == 1) {
+ result = 1;
+ aainfo[5]._val3 = 0;
+ } else {
+ result = 0;
+ }
+ } else if (cur == 5) {
+ result = 0;
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[0], result);
+ aainfo[3]._active = result;
+ }
+}
+
+static void room_308_anim10() {
+ int16 cur = kernel_anim[seq[1]].frame;
+ if (cur == aainfo[3]._val4)
+ return;
+ aainfo[3]._val4 = cur;
+
+ int16 result = -1;
+ if (cur == 17) {
+ scratch._be++;
+ if (scratch._be == 4) {
+ kernel_timing_trigger(20, 108);
+ aainfo[4]._active = 0;
+ scratch._c2 = 4;
+ scratch._be++;
+ result = 0;
+ } else if (scratch._be > 4) {
+ result = 0;
+ } else {
+ scratch._c2 = 8;
+ result = 7;
+ }
+ } else if (cur < 17) {
+ if (cur == 1) {
+ if (scratch._c2 == 8)
+ scratch._c2 = 0;
+ int16 active = aainfo[4]._active;
+ if (active == 0) {
+ if (scratch._be == 0) {
+ result = 0;
+ } else if (imath_random(1, 15) == 1 && scratch._c2 == 0) {
+ result = 7;
+ scratch._c2 = 8;
+ } else {
+ result = 0;
+ }
+ } else if (active == 9) {
+ result = 7;
+ }
+ } else if (cur == 6) {
+ result = 5;
+ } else if (cur == 9) {
+ aainfo[5]._val3 = 4;
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[1], result);
+ aainfo[3]._val4 = result;
+ }
+}
+
+static void room_308_anim11() {
+ int16 cur = kernel_anim[seq[2]].frame;
+ if (cur == aainfo[4]._val3)
+ return;
+ aainfo[4]._val3 = cur;
+
+ int16 result = -1;
+ if (cur == 6) {
+ result = 5;
+ } else if (cur == 1 || (cur >= 8 && cur <= 10)) {
+ int16 v = aainfo[4]._val4;
+ if (v == 0) {
+ result = 0;
+ } else if (v == 3) {
+ result = imath_random(7, 9);
+ } else if (v == 6) {
+ if (scratch._c2 == 0 || scratch._c2 == 7) {
+ aainfo[4]._val4 = 0;
+ kernel_reset_animation(seq[0], 10);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_ANIM, seq[2]);
+ kernel_reset_animation(seq[3], 14);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_ANIM, seq[2]);
+ result = 5;
+ seq[6] = kernel_run_animation(kernel_name('t', 10), 0);
+ aainfo[7]._active = -1;
+ kernel_synch(KERNEL_ANIM, seq[6], KERNEL_ANIM, seq[2]);
+ } else {
+ result = cur - 1;
+ }
+ } else if (v == 7) {
+ if (scratch._c2 == 0) {
+ result = cur - 1;
+ } else {
+ aainfo[4]._val4 = 0;
+ if (scratch._b8 == 0) {
+ kernel_reset_animation(seq[0], 10);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_ANIM, seq[2]);
+ kernel_reset_animation(seq[3], 14);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_ANIM, seq[2]);
+ result = 5;
+ seq[6] = kernel_run_animation(kernel_name('t', 10), 0);
+ aainfo[7]._active = -1;
+ kernel_synch(KERNEL_ANIM, seq[6], KERNEL_ANIM, seq[2]);
+ } else {
+ result = 5;
+ seq[7] = kernel_run_animation(kernel_name('t', 14), 0);
+ aainfo[7]._val4 = -1;
+ aainfo[8]._frame = 13;
+ kernel_synch(KERNEL_ANIM, seq[7], KERNEL_ANIM, seq[2]);
+ digi_play_build(101, '_', 1, 2);
+ }
+ }
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[2], result);
+ aainfo[4]._val3 = result;
+ }
+}
+
+static void room_308_anim12() {
+ int16 cur = kernel_anim[seq[3]].frame;
+ if (cur == aainfo[5]._frame)
+ return;
+ aainfo[5]._frame = cur;
+
+ int16 result = -1;
+ bool do_e0 = false;
+
+ if (cur == 2) {
+ aainfo[5]._val3 = 1;
+ } else if (cur == 7 || cur == 13) {
+ result = 0;
+ } else if (cur == 14) {
+ result = 13;
+ } else if (cur == 1 || (cur >= 16 && cur <= 22)) {
+ if (scratch._c2 == 1 || scratch._c2 == 2 || scratch._c2 == 7 || scratch._c2 == 5)
+ scratch._c2 = 0;
+ if (scratch._ba == 0) {
+ do_e0 = true;
+ } else {
+ scratch._ba = 0;
+ if (global[walker_converse_state] == 0) {
+ aainfo[5]._val3 = (scratch._c0 != 0) ? 11 : 10;
+ do_e0 = true;
+ } else if (scratch._b8 == 0) {
+ aainfo[4]._val4 = 0;
+ scratch._b6 = 1;
+ aainfo[4]._val4 = 7;
+ kernel_reset_animation(seq[0], 10);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_ANIM, seq[2]);
+ kernel_reset_animation(seq[3], 13);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_ANIM, seq[2]);
+ aainfo[5]._frame = 13;
+ kernel_reset_animation(seq[2], 5);
+ seq[6] = kernel_run_animation(kernel_name('t', 10), 0);
+ aainfo[7]._active = -1;
+ kernel_synch(KERNEL_ANIM, seq[6], KERNEL_ANIM, seq[2]);
+ return;
+ } else if (scratch._c0 == 0) {
+ kernel_reset_animation(seq[2], 5);
+ seq[7] = kernel_run_animation(kernel_name('t', 14), 0);
+ aainfo[7]._val4 = -1;
+ aainfo[8]._frame = 13;
+ kernel_synch(KERNEL_ANIM, seq[7], KERNEL_ANIM, seq[2]);
+ aainfo[5]._val3 = 8;
+ do_e0 = true;
+ } else {
+ aainfo[5]._val3 = 11;
+ do_e0 = true;
+ }
+ }
+ }
+
+ if (do_e0) {
+ if (scratch._bc != 0) {
+ aainfo[5]._val3 = 12;
+ scratch._bc = 0;
+ }
+ switch (aainfo[5]._val3) {
+ case 0:
+ if (scratch._c2 == 0) {
+ if (imath_random(1, 15) == 1) {
+ result = 1;
+ scratch._c2 = 7;
+ } else {
+ result = 0;
+ scratch._c2 = 0;
+ }
+ } else {
+ result = aainfo[5]._frame - 1;
+ }
+ break;
+ case 3:
+ result = imath_random(15, 21);
+ scratch._c2 = 4;
+ break;
+ case 4:
+ result = 7;
+ aainfo[5]._val3 = 0;
+ scratch._c2 = 5;
+ break;
+ case 8:
+ result = 0;
+ scratch._c2 = 3;
+ break;
+ case 10:
+ seq[8] = kernel_run_animation(kernel_name('t', 21), 0);
+ aainfo[8]._val3 = -1;
+ kernel_synch(KERNEL_ANIM, seq[8], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[1], 5);
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[3], 13);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_NOW, 0);
+ scratch._c2 = 2;
+ break;
+ case 11:
+ if (scratch._c0 != 0) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[7]);
+ aainfo[7]._val4 = 0;
+ }
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[3]);
+ aainfo[5]._active = 0;
+ seq[9] = kernel_run_animation(kernel_name('t', 20), 0);
+ aainfo[9]._active = -1;
+ kernel_synch(KERNEL_ANIM, seq[9], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[1], 5);
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+ scratch._c2 = 9;
+ break;
+ case 12:
+ aa[0] = kernel_run_animation(kernel_name('t', 15), 0);
+ kernel_reset_animation(aa[0], 6);
+ aainfo[9]._val3 = -1;
+ kernel_synch(KERNEL_ANIM, aa[0], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[0], 10);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+ aainfo[5]._val3 = 0;
+ scratch._c2 = 1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[3], result);
+ aainfo[5]._frame = result;
+ }
+}
+
+static void room_308_anim13() {
+ int16 cur = kernel_anim[seq[4]].frame;
+ if (cur == aainfo[6]._active)
+ return;
+ aainfo[6]._active = cur;
+
+ int16 result = -1;
+ if (cur == 8) {
+ digi_stop(2);
+ digi_play_build(308, '_', 4, 2);
+ } else if (cur == 10) {
+ digi_stop(2);
+ digi_play_build(203, '_', 1, 2);
+ } else if (cur == 11) {
+ scratch._c2hi++;
+ if (scratch._c2hi == 3) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[4]);
+ aainfo[5]._val4 = 0;
+ aa[1] = kernel_run_animation(kernel_name('t', 23), 0);
+ kernel_reset_animation(aa[1], 2);
+ scratch._8c = -1;
+ kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+ } else {
+ result = 7;
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[4], result);
+ aainfo[6]._active = result;
+ }
+}
+
+static void room_308_anim14() {
+ int16 cur = kernel_anim[seq[6]].frame;
+ if (cur == aainfo[7]._frame)
+ return;
+ aainfo[7]._frame = cur;
+
+ if (cur == 6) {
+ digi_play_build(101, '_', 1, 2);
+ } else if (cur == 9) {
+ ss[2] = kernel_seq_stamp(ss[0], 0, -1);
+ kernel_seq_depth(ss[2], 4);
+ kernel_seq_loc(ss[2], 99, 125);
+ kernel_synch(KERNEL_SERIES, ss[2], KERNEL_ANIM, seq[6]);
+ scratch._b8 = -1;
+ global[g072] = -1;
+ } else if (cur == 10) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[6]);
+ aainfo[7]._active = 0;
+ if (scratch._b6 == 0) {
+ kernel_reset_animation(seq[1], 7);
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_ANIM, seq[2]);
+ kernel_reset_animation(seq[2], 0);
+ kernel_synch(KERNEL_ANIM, seq[2], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[0], 0);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[3], 0);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_ANIM, seq[7]);
+ } else if (scratch._b6 == 1) {
+ seq[7] = kernel_run_animation(kernel_name('t', 14), 0);
+ aainfo[7]._val4 = -1;
+ aainfo[8]._frame = 13;
+ kernel_synch(KERNEL_ANIM, seq[7], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[0], 0);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[3], 0);
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_ANIM, seq[7]);
+ }
+ }
+}
+
+static void room_308_anim15() {
+ int16 cur = kernel_anim[seq[7]].frame;
+ if (cur == aainfo[8]._active)
+ return;
+ aainfo[8]._active = cur;
+
+ int16 result = -1;
+ if (cur == 7) {
+ if (global[walker_converse_state] != 0) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[7]);
+ aainfo[7]._val4 = 0;
+ scratch._c0 = 100;
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[3]);
+ aainfo[5]._active = 0;
+ seq[9] = kernel_run_animation(kernel_name('t', 20), 0);
+ aainfo[9]._active = -1;
+ kernel_synch(KERNEL_ANIM, seq[9], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[1], 5);
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+ return;
+ }
+ if (scratch._c2 == 6)
+ scratch._c2 = 0;
+ if (scratch._c0 <= 3) {
+ scratch._c2 = 6;
+ } else {
+ if (aainfo[8]._frame != 0 || scratch._c0 == 0 || scratch._c2 != 0 || imath_random(1, 15) != 1) {
+ result = 6;
+ } else {
+ result = 7;
+ scratch._c2 = 6;
+ }
+ }
+ } else if (cur == 10) {
+ aainfo[5]._val3 = 4;
+ } else if (cur == 12) {
+ digi_play_build(308, '_', 4, 2);
+ } else if (cur == 13) {
+ global[g073] = -1;
+ scratch._c0++;
+ if (scratch._c0 == 3) {
+ kernel_timing_trigger(20, 109);
+ aainfo[8]._frame = 0;
+ scratch._c2 = 4;
+ scratch._c0++;
+ }
+ result = 6;
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[7], result);
+ aainfo[8]._active = result;
+ }
+}
+
+static void room_308_anim16() {
+ int16 cur = kernel_anim[seq[8]].frame;
+ if (cur == aainfo[8]._val4)
+ return;
+ aainfo[8]._val4 = cur;
+
+ if (cur == 1) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 3, 2);
+ } else if (cur == 8) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[8]);
+ aainfo[8]._val3 = 0;
+ kernel_reset_animation(seq[1], 0);
+ aainfo[4]._active = 0;
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+ kernel_reset_animation(seq[3], 0);
+ aainfo[5]._val3 = 0;
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_NOW, 0);
+ player.commands_allowed = -1;
+ }
+}
+
+static void room_308_anim17() {
+ int16 cur = kernel_anim[seq[9]].frame;
+ if (cur == aainfo[9]._frame)
+ return;
+ aainfo[9]._frame = cur;
+
+ int16 result = -1;
+ if (cur == 1) {
+ digi_play_build(308, '_', 3, 2);
+ } else if (cur == 13) {
+ kernel_reset_animation(seq[0], 10);
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+ seq[4] = kernel_run_animation(kernel_name('t', 22), 0);
+ aainfo[5]._val4 = -1;
+ kernel_synch(KERNEL_ANIM, seq[4], KERNEL_ANIM, seq[9]);
+ } else if (cur == 14) {
+ result = 13;
+ } else if (cur == 23) {
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[9]);
+ aainfo[9]._active = 0;
+ aa[2] = kernel_run_animation(kernel_name('t', 24), 0);
+ kernel_reset_animation(aa[2], 4);
+ scratch._90 = -1;
+ kernel_synch(KERNEL_ANIM, aa[2], KERNEL_NOW, 0);
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(seq[9], result);
+ aainfo[9]._frame = result;
+ }
+}
+
+static void room_308_anim18() {
+ int16 cur = kernel_anim[aa[0]].frame;
+ if (cur == aainfo[9]._val4)
+ return;
+ aainfo[9]._val4 = cur;
+
+ if (cur == 6) {
+ digi_play_build(203, '_', 4, 2);
+ kernel_timing_trigger(25, 111);
+ } else if (cur == 11) {
+ digi_play_build(308, '_', 4, 2);
+ } else if (cur == 15) {
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[0]);
+ aainfo[9]._val3 = 0;
+ kernel_reset_animation(seq[0], 0);
+ aainfo[3]._frame = 0;
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+ player.commands_allowed = -1;
+ }
+}
+
+static void room_308_anim19() {
+ int16 cur = kernel_anim[aa[1]].frame;
+ if (cur == scratch._8e)
+ return;
+ scratch._8e = cur;
+
+ int16 result = -1;
+ if (cur == 2) {
+ digi_play_build(203, '_', 4, 2);
+ kernel_timing_trigger(20, 111);
+ } else if (cur == 9 || cur == 11 || cur == 13) {
+ digi_stop(2);
+ digi_play_build(308, '_', 5, 2);
+ } else if (cur == 14) {
+ scratch._c4++;
+ if (scratch._c4 == 2) {
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[1]);
+ scratch._8c = 0;
+ dont_frag_the_palette();
+ kernel_abort_animation(seq[9]);
+ aainfo[9]._active = 0;
+ aa[2] = kernel_run_animation(kernel_name('t', 24), 0);
+ scratch._90 = -1;
+ kernel_synch(KERNEL_ANIM, aa[2], KERNEL_NOW, 0);
+ } else {
+ result = 8;
+ }
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(aa[1], result);
+ scratch._8e = result;
+ }
+}
+
+static void room_308_anim20() {
+ int16 cur = kernel_anim[aa[2]].frame;
+ if (cur == scratch._92)
+ return;
+ scratch._92 = cur;
+
+ int16 result = -1;
+ if (cur == 6) {
+ global[g009] = 0;
+ global_digi_play(5);
+ digi_play_build(308, 't', 5, 1);
+ scratch._94 = 3;
+ scratch._b4 = 3;
+ } else if (cur == 7 || cur == 8 || cur == 9) {
+ if (scratch._94 == 3)
+ result = imath_random(6, 8);
+ } else if (cur == 11) {
+ kernel_seq_delete(ss[2]);
+ } else if (cur == 17) {
+ digi_play_build(203, '_', 1, 2);
+ } else if (cur == 20) {
+ digi_stop(2);
+ digi_play_build(322, '_', 1, 2);
+ } else if (cur == 27) {
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[2]);
+ scratch._90 = 0;
+ aa[3] = kernel_run_animation(kernel_name('t', 30), 0);
+ scratch._96 = -1;
+ kernel_synch(KERNEL_ANIM, aa[3], KERNEL_NOW, 0);
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(aa[2], result);
+ scratch._92 = result;
+ }
+}
+
+static void room_308_anim21() {
+ int16 cur = kernel_anim[aa[3]].frame;
+ if (cur == scratch._98)
+ return;
+ scratch._98 = cur;
+
+ int16 result = -1;
+ if (cur == 3) {
+ digi_play_build(308, 'r', 4, 1);
+ scratch._b4 = 4;
+ scratch._9a = 3;
+ } else if (cur >= 4 && cur <= 9) {
+ if (scratch._9a == 3)
+ result = imath_random(7, 9);
+ } else if (cur == 15) {
+ kernel_abort_animation(aa[3]);
+ scratch._96 = 0;
+ aa[4] = kernel_run_animation(kernel_name('t', 26), 0);
+ scratch._9c = -1;
+ kernel_synch(KERNEL_ANIM, aa[4], KERNEL_NOW, 0);
+ digi_play_build(308, 'b', 4, 1);
+ scratch._b4 = -1;
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(aa[3], result);
+ scratch._98 = result;
+ }
+}
+
+static void room_308_anim22() {
+ int16 cur = kernel_anim[aa[4]].frame;
+ if (cur == scratch._9e)
+ return;
+ scratch._9e = cur;
+
+ if (cur == 70) {
+ if (global[walker_converse_state] != 0) {
+ global[walker_converse_state] = 0;
+ close_journal(3);
+ }
+ object_set_quality(5, -1, -1);
+ object_set_quality(1, -1, -1);
+ object_set_quality(15, -1, -1);
+ inter_move_object(1, 1);
+ inter_move_object(15, 1);
+ inter_move_object(4, 2);
+ inter_move_object(14, 2);
+ global[player_score] = -1;
+ new_room = 401;
+ }
+}
+
+static void room_308_anim23() {
+ int16 cur = kernel_anim[aa[5]].frame;
+ if (cur == scratch._a4)
+ return;
+ scratch._a4 = cur;
+
+ if (cur == 47) {
+ aa[6] = kernel_run_animation(kernel_name('t', 25), 110);
+ scratch._a8 = -1;
+ scratch._ac = 3;
+ kernel_synch(KERNEL_ANIM, aa[6], KERNEL_NOW, 0);
+ } else if (cur == 48 || cur == 64 || cur == 88 || cur == 108 || cur == 140) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ } else if (cur == 164) {
+ object_set_quality(5, -1, -1);
+ object_set_quality(1, -1, -1);
+ object_set_quality(15, -1, -1);
+ inter_move_object(4, 2);
+ inter_move_object(14, 2);
+ global[player_score] = -1;
+ if (global[g064] != 0)
+ new_room = 322;
+ else
+ new_room = 307;
+ }
+}
+
+static void room_308_anim24() {
+ int16 cur = kernel_anim[aa[6]].frame;
+ if (cur == scratch._aa)
+ return;
+ scratch._aa = cur;
+
+ int16 result = -1;
+ if (cur == 1 || cur == 28) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 3, 1);
+ scratch._b4 = -1;
+ } else if (cur == 20) {
+ digi_play_build(308, 't', 7, 1);
+ scratch._b4 = 5;
+ } else if (cur >= 21 && cur <= 26) {
+ if (scratch._ac == 3)
+ result = imath_random(20, 25);
+ } else if (cur == 29) {
+ global[g009] = 0;
+ global_digi_play(5);
+ }
+
+ if (result >= 0) {
+ kernel_reset_animation(aa[6], result);
+ scratch._aa = result;
+ }
+}
+
+static void room_308_anim25() {
+ int16 cur = kernel_anim[aa[7]].frame;
+ if (cur == scratch._b0)
+ return;
+ scratch._b0 = cur;
+
+ if (cur == 64) {
+ aa[6] = kernel_run_animation(kernel_name('t', 25), 110);
+ scratch._a8 = -1;
+ scratch._ac = 3;
+ kernel_synch(KERNEL_ANIM, aa[6], KERNEL_NOW, 0);
+ } else if (cur == 67 || cur == 92 || cur == 116) {
+ digi_initial_volume(60);
+ digi_play_build(308, '_', 1, 2);
+ } else if (cur == 122) {
+ object_set_quality(5, -1, -1);
+ object_set_quality(1, -1, -1);
+ object_set_quality(15, -1, -1);
+ inter_move_object(1, 1);
+ inter_move_object(15, 1);
+ kernel_timing_trigger(140, 112);
+ }
+}
+
static void room_308_init() {
+ inter_move_object(4, 1);
+ inter_move_object(14, 1);
+
+ if (!player_has_been_in_room(401)) {
+ if (previous_room == 307 || previous_room == 322) {
+ object_set_quality(5, 0, 0);
+ object_set_quality(1, 0, 0);
+ object_set_quality(15, 0, 0);
+ }
+ }
+
+ if (previous_room != 199 && flags[22] != 3)
+ flags[22]++;
+
+ global[perform_displacements] = 180;
+
+ if (player_has_been_in_room(401)) {
+ kernel_flip_hotspot(189, 0);
+ kernel_flip_hotspot(170, 0);
+ }
+
+ player.walker_visible = 0;
+
+ if (previous_room != KERNEL_RESTORING_GAME) {
+ aa[9] = 0;
+ aainfo[0]._frame = 0;
+ aainfo[0]._val4 = 0;
+ aainfo[1]._frame = 0;
+ aainfo[1]._val4 = 0;
+ aainfo[2]._frame = 0;
+ aainfo[6]._val3 = 0;
+ aainfo[2]._val4 = 0;
+ aainfo[3]._val3 = 0;
+ aainfo[4]._frame = 0;
+ aainfo[5]._active = 0;
+ aainfo[5]._val4 = 0;
+ aainfo[7]._active = 0;
+ aainfo[7]._val4 = 0;
+ aainfo[8]._val3 = 0;
+ aainfo[9]._active = 0;
+ aainfo[9]._val3 = 0;
+ scratch._8c = 0;
+ scratch._90 = 0;
+ scratch._96 = 0;
+ scratch._9c = 0;
+ scratch._a2 = 0;
+ scratch._a8 = 0;
+ scratch._ae = 0;
+ scratch._ba = 0;
+ scratch._c2 = 0;
+ scratch._c0 = 0;
+ }
+
+ scratch._c6 = 0;
+ scratch._b4 = -1;
+ scratch._b8 = -1;
+ scratch._b2 = 0;
+ scratch._bc = 0;
+ scratch._be = 0;
+ scratch._c4 = 0;
+ scratch._c5 = 0;
+ stop_speech_on_run_animation = true;
+
+ kernel_flip_hotspot(40, 0);
+ kernel_flip_hotspot(46, 0);
+
+ if (!player_has_been_in_room(401)) {
+ ss[0] = kernel_load_series(kernel_name('p', 3), 0);
+ if (global[g072] != 0) {
+ ss[2] = kernel_seq_stamp(ss[0], false, -1);
+ kernel_seq_depth(ss[2], 4);
+ kernel_seq_loc(ss[2], 99, 125);
+ kernel_synch(KERNEL_SERIES, ss[2], KERNEL_ANIM, seq[6]);
+ scratch._c0 = 100;
+ scratch._ba = -1;
+ }
+ }
+
+ if (previous_room == 401) {
+ player.commands_allowed = 0;
+ aa[5] = kernel_run_animation(kernel_name('t', 27), 0);
+ scratch._a2 = -1;
+ return;
+ }
+
+ if (previous_room == 307 || previous_room == 322) {
+ player.commands_allowed = 0;
+ if (player_has_been_in_room(401)) {
+ aa[7] = kernel_run_animation(kernel_name('t', 40), 0);
+ kernel_reset_animation(aa[7], 13);
+ scratch._ae = -1;
+ return;
+ }
+ if (player.been_here_before && player_has(5) && player_has(1) && player_has(15)) {
+ ss[7] = kernel_run_animation(kernel_name('t', 8), 103);
+ aainfo[1]._frame = -1;
+ kernel_synch(KERNEL_ANIM, ss[7], KERNEL_NOW, 0);
+ global[g009] = -1;
+ global_digi_play(15);
+ player.commands_allowed = 0;
+ return;
+ }
+ if (!player.been_here_before) {
+ ss[4] = kernel_run_animation(kernel_name('t', 1), 100);
+ kernel_reset_animation(ss[4], 13);
+ aa[9] = -1;
+ return;
+ }
+ if (!player_has(5) || !player_has(1)) {
+ ss[8] = kernel_run_animation(kernel_name('t', 6), 104);
+ aainfo[1]._val4 = -1;
+ kernel_synch(KERNEL_ANIM, ss[8], KERNEL_NOW, 0);
+ global[g009] = -1;
+ global_digi_play(15);
+ return;
+ }
+ if (player_has(15)) {
+ ss[4] = kernel_run_animation(kernel_name('t', 1), 100);
+ kernel_reset_animation(ss[4], 13);
+ aa[9] = -1;
+ return;
+ }
+ ss[8] = kernel_run_animation(kernel_name('t', 6), 104);
+ aainfo[1]._val4 = -1;
+ kernel_synch(KERNEL_ANIM, ss[8], KERNEL_NOW, 0);
+ global[g009] = -1;
+ global_digi_play(15);
+ return;
+ }
+
+ if (previous_room != KERNEL_RESTORING_GAME &&
+ !player_has_been_in_room(401) &&
+ previous_room != 199)
+ return;
+
+ seq[0] = kernel_run_animation(kernel_name('t', 11), 0);
+ aainfo[2]._val4 = -1;
+ aainfo[3]._frame = 0;
+ kernel_synch(KERNEL_ANIM, seq[0], KERNEL_NOW, 0);
+
+ seq[1] = kernel_run_animation(kernel_name('t', 19), 0);
+ aainfo[3]._val3 = -1;
+ aainfo[4]._active = 0;
+ kernel_synch(KERNEL_ANIM, seq[1], KERNEL_NOW, 0);
+
+ seq[2] = kernel_run_animation(kernel_name('t', 13), 0);
+ aainfo[4]._frame = -1;
+ aainfo[4]._val4 = 0;
+ kernel_synch(KERNEL_ANIM, seq[2], KERNEL_NOW, 0);
+
+ seq[3] = kernel_run_animation(kernel_name('t', 18), 0);
+ aainfo[5]._active = -1;
+ aainfo[5]._val3 = 0;
+ kernel_synch(KERNEL_ANIM, seq[3], KERNEL_NOW, 0);
+
+ if (global[g073] == 0) {
+ global[g009] = -1;
+ global_digi_play(15);
+ return;
+ }
+
+ kernel_reset_animation(seq[2], 6);
+ seq[7] = kernel_run_animation(kernel_name('t', 14), 0);
+ kernel_reset_animation(seq[7], 7);
+ aainfo[7]._val4 = -1;
+ aainfo[8]._frame = 0;
+ scratch._c2 = 100;
+ global[g009] = -1;
+ global_digi_play(15);
}
static void room_308_daemon() {
+ switch (kernel.trigger) {
+ case 7:
+ switch (scratch._b4) {
+ case 1:
+ display_interface();
+ aainfo[5]._val3 = 0;
+ scratch._b4 = -1;
+ player.commands_allowed = -1;
+ scratch._c2 = 0;
+ break;
+ case 2:
+ display_interface();
+ aainfo[5]._val3 = 0;
+ aainfo[8]._frame = 0;
+ scratch._b4 = -1;
+ player.commands_allowed = -1;
+ scratch._c2 = 0;
+ break;
+ case 3:
+ scratch._94 = 0;
+ break;
+ case 4:
+ scratch._9a = 0;
+ break;
+ case 5:
+ scratch._ac = 0;
+ break;
+ }
+ break;
+
+ case 100:
+ dont_frag_the_palette();
+ kernel_abort_animation(ss[4]);
+ aa[9] = 0;
+ ss[5] = kernel_run_animation(kernel_name('t', 3), 101);
+ aainfo[0]._frame = -1;
+ kernel_synch(KERNEL_ANIM, ss[5], KERNEL_NOW, 0);
+ break;
+
+ case 101:
+ dont_frag_the_palette();
+ kernel_abort_animation(ss[5]);
+ aainfo[0]._frame = 0;
+ ss[6] = kernel_run_animation(kernel_name('t', 5), 102);
+ aainfo[0]._val4 = -1;
+ kernel_synch(KERNEL_ANIM, ss[6], KERNEL_NOW, 0);
+ global[g009] = -1;
+ global_digi_play(15);
+ break;
+
+ case 102:
+ dont_frag_the_palette();
+ kernel_abort_animation(ss[6]);
+ aainfo[0]._val4 = 0;
+ if (player_has(5) && player_has(1) && player_has(15)) {
+ ss[7] = kernel_run_animation(kernel_name('t', 8), 103);
+ aainfo[1]._frame = -1;
+ kernel_synch(KERNEL_ANIM, ss[7], KERNEL_NOW, 0);
+ } else {
+ global[player_score] = -1;
+ ss[8] = kernel_run_animation(kernel_name('t', 6), 104);
+ aainfo[1]._val4 = -1;
+ kernel_synch(KERNEL_ANIM, ss[8], KERNEL_NOW, 0);
+ }
+ break;
+
+ case 103:
+ dont_frag_the_palette();
+ kernel_abort_animation(ss[7]);
+ aainfo[1]._frame = 0;
+ ss[9] = kernel_run_animation(kernel_name('t', 7), 105);
+ kernel_reset_animation(ss[9], 6);
+ aainfo[2]._frame = -1;
+ kernel_synch(KERNEL_ANIM, ss[9], KERNEL_NOW, 0);
+ break;
+
+ case 104:
+ object_set_quality(5, -1, -1);
+ object_set_quality(1, -1, -1);
+ object_set_quality(15, -1, -1);
+ inter_move_object(4, 2);
+ inter_move_object(14, 2);
+ global[player_score] = -1;
+ if (global[g064] != 0)
+ new_room = 322;
+ else
+ new_room = 307;
+ break;
+
+ case 105:
+ dont_frag_the_palette();
+ kernel_abort_animation(ss[9]);
+ aainfo[2]._frame = 0;
+ seq[5] = kernel_run_animation(kernel_name('t', 9), 0);
+ kernel_reset_animation(seq[5], 6);
+ aainfo[6]._val3 = -1;
+ kernel_synch(KERNEL_ANIM, seq[5], KERNEL_NOW, 0);
+ break;
+
+ case 108:
+ digi_play_build(308, 't', 3, 1);
+ aainfo[5]._val3 = 3;
+ scratch._b4 = 1;
+ break;
+
+ case 109:
+ digi_play_build(308, 't', 4, 1);
+ aainfo[5]._val3 = 3;
+ scratch._b4 = 2;
+ break;
+
+ case 110:
+ kernel_abort_animation(aa[6]);
+ scratch._a8 = 0;
+ break;
+
+ case 111:
+ digi_stop(2);
+ break;
+
+ case 112:
+ inter_move_object(4, 2);
+ inter_move_object(14, 2);
+ global[player_score] = -1;
+ new_room = 401;
+ break;
+
+ default:
+ break;
+ }
+
+ if (aa[9] != 0) room_308_anim1();
+ if (aainfo[0]._frame != 0) room_308_anim2();
+ if (aainfo[0]._val4 != 0) room_308_anim3();
+ if (aainfo[1]._frame != 0) room_308_anim4();
+ if (aainfo[1]._val4 != 0) room_308_anim5();
+ if (aainfo[2]._frame != 0) room_308_anim7();
+ if (aainfo[6]._val3 != 0) room_308_anim8();
+ if (aainfo[2]._val4 != 0) room_308_anim9();
+ if (aainfo[3]._val3 != 0) room_308_anim10();
+ if (aainfo[4]._frame != 0) room_308_anim11();
+ if (aainfo[5]._active != 0) room_308_anim12();
+ if (aainfo[5]._val4 != 0) room_308_anim13();
+ if (aainfo[7]._active != 0) room_308_anim14();
+ if (aainfo[7]._val4 != 0) room_308_anim15();
+ if (aainfo[8]._val3 != 0) room_308_anim16();
+ if (aainfo[9]._active != 0) room_308_anim17();
+ if (aainfo[9]._val3 != 0) room_308_anim18();
+ if (scratch._8c != 0) room_308_anim19();
+ if (scratch._90 != 0) room_308_anim20();
+ if (scratch._96 != 0) room_308_anim21();
+ if (scratch._9c != 0) room_308_anim22();
+ if (scratch._a2 != 0) room_308_anim23();
+ if (scratch._a8 != 0) room_308_anim24();
+ if (scratch._ae != 0) room_308_anim25();
}
static void room_308_pre_parser() {
+ if (player_parse(13, 40, 0)) {
+ if (global[g064] != 0)
+ player.walk_off_edge_to_room = 322;
+ else
+ player.walk_off_edge_to_room = 307;
+ }
+
+ if (player_parse(13, 46, 0))
+ player.walk_off_edge_to_room = 401;
}
static void room_308_parser() {
+ int sel;
+
+ if (global[walker_converse_state] != 0) {
+ scratch._bc = -1;
+ player.commands_allowed = 0;
+ aainfo[5]._val3 = 8;
+ goto handled;
+ }
+
+ if (player_parse(189, 0)) {
+ scratch._bc = -1;
+ player.commands_allowed = 0;
+ goto handled;
+ }
+
+ if (player_parse(170, 0)) {
+ scratch._be = -1;
+ player.commands_allowed = 0;
+ goto handled;
+ }
+
+ sel = global[player_selected_object];
+ if (sel < 0)
+ goto done;
+
+ if (sel == 15 || sel == 1) {
+ inv_enable_command = false;
+ object_set_quality(1, 0, -1);
+ object_set_quality(15, 0, -1);
+ object_set_quality(5, 0, -1);
+ scratch._b8 = 1;
+ aainfo[4]._val4 = 7;
+ aainfo[5]._val3 = 8;
+ goto handled;
+ }
+
+ if (sel == 5) {
+ inv_enable_command = false;
+ object_set_quality(5, 0, -1);
+ scratch._b8 = 0;
+ aainfo[4]._val4 = 6;
+ aainfo[5]._val3 = 8;
+ goto handled;
+ }
+
+ goto done;
+handled:
+ player.command_ready = false;
+done:
+ ;
}
void room_308_synchronize(Common::Serializer &s) {
for (int16 &v : scratch.sprite) s.syncAsSint16LE(v);
for (int16 &v : scratch.sequence) s.syncAsSint16LE(v);
for (int16 &v : scratch.animation) s.syncAsSint16LE(v);
+ for (auto &ai : scratch.animation_info) ai.synchronize(s);
+ s.syncAsSint16LE(scratch._8c);
+ s.syncAsSint16LE(scratch._90);
+ s.syncAsSint16LE(scratch._96);
+ s.syncAsSint16LE(scratch._9c);
+ s.syncAsSint16LE(scratch._a2);
+ s.syncAsSint16LE(scratch._a8);
+ s.syncAsSint16LE(scratch._ae);
+ s.syncAsSint16LE(scratch._b2);
+ s.syncAsSint16LE(scratch._b4);
+ s.syncAsSint16LE(scratch._b8);
+ s.syncAsSint16LE(scratch._ba);
+ s.syncAsSint16LE(scratch._bc);
+ s.syncAsSint16LE(scratch._be);
+ s.syncAsSint16LE(scratch._c0);
+ s.syncAsByte(scratch._c2);
+ s.syncAsByte(scratch._c2hi);
+ s.syncAsByte(scratch._c4);
+ s.syncAsByte(scratch._c5);
+ s.syncAsByte(scratch._c6);
}
void room_308_preload() {
- room_init_code_pointer = room_308_init;
+ room_init_code_pointer = room_308_init;
room_pre_parser_code_pointer = room_308_pre_parser;
- room_parser_code_pointer = room_308_parser;
- room_daemon_code_pointer = room_308_daemon;
+ room_parser_code_pointer = room_308_parser;
+ room_daemon_code_pointer = room_308_daemon;
global_section_walker();
global_section_interface();
Commit: 5dd35734a4ddc32f88f80e36d14c865a7fb83207
https://github.com/scummvm/scummvm/commit/5dd35734a4ddc32f88f80e36d14c865a7fb83207
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-12T21:31:01+10:00
Commit Message:
MADS: FOREST: Implemented room 321
Changed paths:
engines/mads/madsv2/forest/rooms/room321.cpp
diff --git a/engines/mads/madsv2/forest/rooms/room321.cpp b/engines/mads/madsv2/forest/rooms/room321.cpp
index e4a6aeee089..2ce5ff1a7b7 100644
--- a/engines/mads/madsv2/forest/rooms/room321.cpp
+++ b/engines/mads/madsv2/forest/rooms/room321.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -20,16 +20,21 @@
*/
#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/digi.h"
#include "mads/madsv2/core/game.h"
#include "mads/madsv2/core/imath.h"
#include "mads/madsv2/core/inter.h"
#include "mads/madsv2/core/kernel.h"
+#include "mads/madsv2/core/matte.h"
+#include "mads/madsv2/core/player.h"
#include "mads/madsv2/core/sound.h"
+#include "mads/madsv2/core/sprite.h"
#include "mads/madsv2/core/text.h"
#include "mads/madsv2/forest/mads/inventory.h"
#include "mads/madsv2/forest/mads/sounds.h"
#include "mads/madsv2/forest/mads/words.h"
#include "mads/madsv2/forest/global.h"
+#include "mads/madsv2/forest/journal.h"
#include "mads/madsv2/forest/rooms/section1.h"
#include "mads/madsv2/forest/rooms/room321.h"
@@ -39,10 +44,26 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* Sprite series handles */
- int16 sequence[10]; /* Sequence handles */
- int16 animation[10]; /* Animation handles */
+ int16 sprite[10];
+ int16 sequence[10];
+ int16 animation[10];
AnimationInfo animation_info[10];
+ int16 _8c;
+ int16 _8e;
+ int16 _90;
+ int16 _92;
+ int16 _94;
+ int16 _96;
+ int16 _98;
+ int16 _9a;
+ int16 _9c;
+ int16 _9e;
+ int16 _a0;
+ int16 _a2;
+ int16 _a4;
+ int16 _a6;
+ int16 _a8;
+ int16 _aa;
};
static Scratch scratch;
@@ -54,29 +75,826 @@ static Scratch scratch;
#define aainfo scratch.animation_info
+static void room_321_init1() {
+ global[g131] = 0;
+ global[g141] = 0;
+
+ scratch._9c = kernel_run_animation_disp('r', 6, 0);
+ kernel_position_anim(scratch._9c, 83, 131, 92, 6);
+ scratch._9a = kernel_run_animation_disp('e', 6, 0);
+ kernel_position_anim(scratch._9a, 109, 139, 94, 5);
+
+ aa[4] = kernel_run_animation(kernel_name('L', 5), 104);
+ aainfo[4]._active = -1;
+ aa[6] = kernel_run_animation(kernel_name('L', 4), 104);
+ aainfo[6]._active = -1;
+
+ if (global[g071] != 0) {
+ aa[5] = kernel_run_animation(kernel_name('H', 1), 104);
+ aainfo[5]._active = -1;
+ }
+
+ aa[7] = kernel_run_animation(kernel_name('L', 3), 104);
+ aainfo[7]._active = -1;
+ aa[8] = kernel_run_animation(kernel_name('L', 2), 104);
+ aainfo[8]._active = -1;
+
+ if (previous_room != KERNEL_RESTORING_GAME) {
+ player.x = 138;
+ player.y = 130;
+ player.facing = 6;
+ }
+
+ if (previous_room == KERNEL_RESTORING_GAME || previous_room == 199) {
+ restore_player();
+ } else if (previous_room == 302) {
+ if (scratch._aa != 0) {
+ ss[5] = kernel_load_series(kernel_name('f', 2), 0);
+ seq[5] = kernel_seq_stamp(ss[5], false, -1);
+ kernel_seq_depth(seq[5], 3);
+ kernel_seq_loc(seq[5], 274, 154);
+ kernel_seq_scale(seq[5], 100);
+ }
+ aa[0] = kernel_run_animation("*RM303y1", 100);
+ aainfo[0]._active = -1;
+ scratch._92 = 51;
+ return;
+ }
+
+ global[g131] = -1;
+ global[g141] = -1;
+ kernel_reset_animation(scratch._9a, 2);
+ kernel_reset_animation(scratch._9c, 2);
+ global[g133] = 0;
+ global[g143] = 0;
+ player.commands_allowed = -1;
+ player.walker_visible = -1;
+}
+
static void room_321_init() {
+ scratch._a4 = 0;
+ scratch._a6 = -1;
+ scratch._aa = 0;
+
+ if (player_has(6))
+ kernel_flip_hotspot(132, 0);
+
+ if (global[g068] == 0) {
+ ss[0] = kernel_load_series(kernel_name('p', 6), 0);
+ seq[0] = kernel_seq_stamp(ss[0], false, -1);
+ kernel_seq_depth(seq[0], 14);
+ kernel_seq_loc(seq[0], 278, 126);
+ kernel_seq_scale(seq[0], 91);
+ } else {
+ kernel_flip_hotspot(125, 0);
+ }
+
+ if (global[g071] == 0) {
+ ss[4] = kernel_load_series(kernel_name('p', 2), 0);
+ seq[4] = kernel_seq_stamp(ss[4], false, -1);
+ kernel_seq_depth(seq[4], 15);
+ kernel_seq_loc(seq[4], 230, 105);
+ kernel_seq_scale(seq[4], 83);
+ kernel_flip_hotspot(177, 0);
+ global_digi_play(13);
+ } else {
+ global_digi_play(3);
+ }
+
+ global[g009] = -1;
+
+ if (previous_room != KERNEL_RESTORING_GAME) {
+ if (previous_room != 199) {
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
+ }
+
+ for (int16 i = 0; i < 10; i++) {
+ aainfo[i]._active = 0;
+ aainfo[i]._frame = 1;
+ aainfo[i]._val3 = 0;
+ aainfo[i]._val4 = 0;
+ }
+
+ if (previous_room != 199 && flags[24] != 3)
+ flags[24]++;
+ }
+
+ if (flags[24] == 1)
+ scratch._aa = -1;
+ room_321_init1();
+}
+
+static void room_321_anim1() {
+ int16 cur = kernel_anim[aa[0]].frame;
+ if (cur != aainfo[0]._frame)
+ aainfo[0]._frame = cur;
+
+ if (global[player_hyperwalked] != -1)
+ return;
+
+ aainfo[0]._frame = scratch._92 - 1;
+ kernel_reset_animation(aa[0], aainfo[0]._frame);
+}
+
+static void room_321_anim2() {
+ int16 cur = kernel_anim[aa[1]].frame;
+ if (cur != aainfo[1]._frame)
+ aainfo[1]._frame = cur;
+
+ if (global[player_hyperwalked] == -1) {
+ if (cur <= 23) {
+ aainfo[1]._frame = 23;
+ kernel_reset_animation(aa[1], 23);
+ } else {
+ aainfo[1]._frame = 44;
+ kernel_reset_animation(aa[1], 44);
+ }
+ kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+ } else {
+ if (cur == 45) {
+ aainfo[1]._frame = 44;
+ kernel_reset_animation(aa[1], 44);
+ kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+ }
+ }
+}
+
+static void room_321_anim3() {
+ int16 var_2;
+ int16 cur = kernel_anim[aa[2]].frame;
+ if (cur != aainfo[2]._frame) {
+ aainfo[2]._frame = cur;
+
+ if (scratch._a6 == 1) {
+ if (cur == 15) {
+ if (aainfo[2]._val3 == 13) {
+ aainfo[2]._frame = 13;
+ kernel_reset_animation(aa[2], 13);
+ }
+ } else if (cur < 15) {
+ if (cur == 7) {
+ aainfo[2]._val3 = 11;
+ digi_play_build_ii('e', 2, 1);
+ scratch._a8 = 7;
+ } else if (cur == 12) {
+ if (aainfo[2]._val3 == 11) {
+ aainfo[2]._frame = 7;
+ kernel_reset_animation(aa[2], 7);
+ }
+ }
+ }
+ } else if (scratch._a6 == 2) {
+ if (cur == 36) {
+ aainfo[2]._val3 = 11;
+ digi_play_build_ii('e', 4, 1);
+ scratch._a8 = 43;
+ } else if (cur == 41) {
+ if (aainfo[2]._val3 == 11) {
+ aainfo[2]._frame = 36;
+ kernel_reset_animation(aa[2], 36);
+ }
+ } else if (cur == 44) {
+ if (aainfo[2]._val3 == 13) {
+ aainfo[2]._frame = 42;
+ kernel_reset_animation(aa[2], 42);
+ }
+ }
+ }
+ }
+
+ if (kernel.trigger != 7 && kernel.trigger != 28)
+ return;
+
+ var_2 = scratch._a8;
+ if (var_2 == 45) {
+ aainfo[2]._val3 = 14;
+ aainfo[2]._frame = 43;
+ kernel_reset_animation(aa[2], 43);
+ scratch._a8 = -1;
+ } else if ((uint16)var_2 > 45) {
+ return;
+ } else if (var_2 == 9) {
+ aainfo[2]._val3 = 14;
+ aainfo[2]._frame = 13;
+ kernel_reset_animation(aa[2], 13);
+ scratch._a8 = -1;
+ } else if (var_2 > 9) {
+ if (var_2 == 43) {
+ kernel_timing_trigger(30, 28);
+ aainfo[2]._val3 = 13;
+ scratch._a8 = 44;
+ } else if (var_2 == 44) {
+ aainfo[2]._val3 = 11;
+ aainfo[2]._frame = 36;
+ kernel_reset_animation(aa[2], 36);
+ digi_play_build_ii('e', 10, 1);
+ scratch._a8 = 45;
+ }
+ } else if (var_2 == 7) {
+ kernel_timing_trigger(30, 28);
+ aainfo[2]._val3 = 13;
+ scratch._a8 = 8;
+ } else if (var_2 == 8) {
+ aainfo[2]._val3 = 11;
+ aainfo[2]._frame = 7;
+ kernel_reset_animation(aa[2], 7);
+ digi_play_build_ii('e', 10, 1);
+ scratch._a8 = 9;
+ }
+}
+
+static void room_321_anim4() {
+ int16 cur = kernel_anim[aa[3]].frame;
+ if (cur != aainfo[3]._frame) {
+ aainfo[3]._frame = cur;
+
+ if (scratch._a6 == 1) {
+ if (cur == 48) {
+ if (aainfo[3]._val3 == 13) {
+ digi_play_build(101, '_', 1, 2);
+ scratch._a8 = 48;
+ }
+ } else if (cur < 48) {
+ if (cur == 9) {
+ aainfo[3]._val3 = 11;
+ digi_play_build(303, 'e', 2, 1);
+ scratch._a8 = 9;
+ } else if (cur == 15) {
+ if (aainfo[3]._val3 == 11) {
+ aainfo[3]._frame = 9;
+ kernel_reset_animation(aa[3], 9);
+ }
+ } else if (cur == 35) {
+ if (aainfo[3]._val3 == 13) {
+ digi_play_build(303, '_', 1, 2);
+ scratch._a8 = 35;
+ }
+ }
+ }
+ } else if (scratch._a6 == 2) {
+ if (cur == 2) {
+ kernel_seq_delete(seq[0]);
+ } else if (cur == 4) {
+ aainfo[3]._val3 = 11;
+ digi_play_build(303, 'e', 700, 1);
+ scratch._a8 = 40;
+ } else if (cur == 9) {
+ if (aainfo[3]._val3 == 11) {
+ aainfo[3]._frame = 4;
+ kernel_reset_animation(aa[3], 4);
+ }
+ } else if (cur == 53) {
+ digi_play_build(101, '_', 1, 2);
+ scratch._a8 = 530;
+ }
+ }
+ }
+
+ if (kernel.trigger == 7 || kernel.trigger == 28) {
+ int16 a8 = scratch._a8;
+ if (a8 == 9) {
+ aainfo[3]._val3 = 13;
+ aainfo[3]._frame = 16;
+ kernel_reset_animation(aa[3], 16);
+ scratch._a8 = -1;
+ return;
+ } else if (a8 == 40) {
+ aainfo[3]._val3 = 13;
+ aainfo[3]._frame = 10;
+ kernel_reset_animation(aa[3], 10);
+ scratch._a8 = -1;
+ return;
+ }
+ }
+
+ if (kernel.trigger == 8 || kernel.trigger == 28) {
+ int16 a8 = scratch._a8;
+ if (a8 == 35 || a8 == 48 || a8 == 530)
+ scratch._a8 = -1;
+ }
+}
+
+static void room_321_anim5() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[4]].frame;
+ if (cur == aainfo[4]._frame)
+ return;
+ aainfo[4]._frame = cur;
+
+ int16 idx = cur - 5;
+ if (idx >= 0 && idx <= 13) {
+ switch (idx) {
+ case 0: case 7: case 13:
+ var_2 = 1;
+ break;
+ case 2:
+ digi_initial_volume(40);
+ digi_play_build(308, '_', 1, 2);
+ break;
+ case 4:
+ digi_play_build(321, '_', 503, 1);
+ scratch._a8 = -1;
+ break;
+ case 9:
+ digi_play_build(321, '_', 504, 2);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (var_2 >= 0) {
+ aainfo[4]._frame = var_2;
+ kernel_reset_animation(aa[4], var_2);
+ }
+}
+
+static void room_321_anim7() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[6]].frame;
+ if (cur == aainfo[6]._frame)
+ return;
+ aainfo[6]._frame = cur;
+
+ if (cur == 9) {
+ if (imath_random(0, 100) > 85)
+ var_2 = 6;
+ else
+ var_2 = 0;
+ }
+
+ if (var_2 >= 0) {
+ aainfo[6]._frame = var_2;
+ kernel_reset_animation(aa[6], var_2);
+ }
+}
+
+static void room_321_anim8() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[7]].frame;
+ if (cur == aainfo[7]._frame)
+ return;
+ aainfo[7]._frame = cur;
+
+ switch (cur) {
+ case 1:
+ var_2 = 0;
+ break;
+ case 6: case 18: case 30: case 40: case 53: case 63:
+ digi_play_build(321, '_', 2, 2);
+ break;
+ case 77:
+ digi_stop(2);
+ var_2 = 0;
+ break;
+ default:
+ break;
+ }
+
+ if (var_2 >= 0) {
+ aainfo[7]._frame = var_2;
+ kernel_reset_animation(aa[7], var_2);
+ }
+}
+
+static void room_321_anim6() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[5]].frame;
+ if (cur == aainfo[5]._frame)
+ return;
+ aainfo[5]._frame = cur;
+
+ switch (cur) {
+ case 1:
+ var_2 = 0;
+ break;
+ case 2:
+ digi_play_build(305, 'h', 4, 1);
+ scratch._a8 = 501;
+ break;
+ case 12:
+ var_2 = 10;
+ break;
+ case 17:
+ var_2 = 16;
+ break;
+ default:
+ break;
+ }
+
+ if (var_2 >= 0) {
+ aainfo[5]._frame = var_2;
+ kernel_reset_animation(aa[5], var_2);
+ }
+}
+
+static void room_321_anim9() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[8]].frame;
+ if (cur == aainfo[8]._frame)
+ return;
+ aainfo[8]._frame = cur;
+
+ switch (cur) {
+ case 1:
+ var_2 = 0;
+ break;
+ case 3: case 15:
+ digi_initial_volume(80);
+ digi_play_build(308, '_', 1, 2);
+ break;
+ case 17:
+ var_2 = 0;
+ player.commands_allowed = -1;
+ break;
+ default:
+ break;
+ }
+
+ if (var_2 >= 0) {
+ aainfo[8]._frame = var_2;
+ kernel_reset_animation(aa[8], var_2);
+ }
+}
+
+static void room_321_anim10() {
+ int16 var_2 = -1;
+ int16 cur = kernel_anim[aa[9]].frame;
+ if (cur == aainfo[9]._frame)
+ return;
+ aainfo[9]._frame = cur;
+
+ if (cur == 5) {
+ digi_play_build(321, 'f', 1, 1);
+ scratch._a8 = 500;
+ } else if (cur == 10) {
+ var_2 = 5;
+ }
+
+ if (var_2 >= 0) {
+ aainfo[9]._frame = var_2;
+ kernel_reset_animation(aa[9], var_2);
+ }
}
static void room_321_daemon() {
+ switch (kernel.trigger) {
+ case 7:
+ switch (scratch._a8) {
+ case -666:
+ global[walker_converse_state] = 0;
+ close_journal(3);
+ player.commands_allowed = -1;
+ break;
+
+ case 300:
+ dont_frag_the_palette();
+ kernel_abort_animation(scratch._9e);
+ scratch._a8 = -1;
+ scratch._a4 = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ scratch._a6 = 2;
+ player.walker_visible = -1;
+ global[g150] = -1;
+ scratch._90 = 6;
+ break;
+
+ case 400:
+ dont_frag_the_palette();
+ kernel_abort_animation(scratch._9e);
+ scratch._a8 = -1;
+ scratch._a4 = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ scratch._a6 = 1;
+ player.walker_visible = -1;
+ global[g150] = -1;
+ scratch._90 = 6;
+ break;
+
+ case 500:
+ scratch._a8 = -1;
+ aainfo[9]._frame = 10;
+ kernel_reset_animation(aa[9], 10);
+ player.commands_allowed = -1;
+ break;
+
+ case 501:
+ scratch._a8 = -1;
+ aainfo[5]._frame = 0;
+ kernel_reset_animation(aa[5], 0);
+ player.commands_allowed = -1;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 24: {
+ int16 t = scratch._8c - 3;
+ if (t == 0) {
+ aa[2] = kernel_run_animation(kernel_name('E', 1), 102);
+ aainfo[2]._active = -1;
+ scratch._96 = 3;
+ } else if (t == 2) {
+ if (scratch._a6 == 1) {
+ aa[2] = kernel_run_animation(kernel_name('F', 1), 102);
+ } else if (scratch._a6 == 2) {
+ aa[2] = kernel_run_animation(kernel_name('F', 2), 102);
+ } else {
+ break;
+ }
+ aainfo[2]._active = -1;
+ scratch._96 = 2;
+ } else {
+ break;
+ }
+ kernel_reset_animation(scratch._9a, 0);
+ kernel_synch(KERNEL_ANIM, aa[2], KERNEL_ANIM, scratch._9a);
+ global[g133] = 1;
+ break;
+ }
+
+ case 25:
+ if (scratch._8e - 2 != 0)
+ break;
+ aa[1] = kernel_run_animation(kernel_name('R', 1), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 1;
+ kernel_reset_animation(scratch._9c, 0);
+ kernel_synch(KERNEL_ANIM, aa[1], KERNEL_ANIM, scratch._9c);
+ global[g143] = 1;
+ break;
+
+ case 26: {
+ int16 t = scratch._90 - 1;
+ if (t == 0) {
+ kernel_reset_animation(scratch._9a, 0);
+ kernel_reset_animation(scratch._9c, 0);
+ global[g133] = 1;
+ global[g143] = 1;
+ } else if (t == 5) {
+ if (scratch._a6 == 1) {
+ room_321_anim1();
+ aa[3] = kernel_run_animation(kernel_name('P', 1), 103);
+ } else if (scratch._a6 == 2) {
+ room_321_anim1();
+ aa[3] = kernel_run_animation(kernel_name('P', 2), 103);
+ } else {
+ break;
+ }
+ aainfo[3]._active = -1;
+ scratch._98 = 3;
+ kernel_reset_animation(scratch._9a, 0);
+ kernel_reset_animation(scratch._9c, 0);
+ kernel_synch(KERNEL_ANIM, aa[3], KERNEL_NOW, 0);
+ global[g133] = 1;
+ global[g143] = 1;
+ }
+ break;
+ }
+
+ case 100:
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[0]);
+ aainfo[0]._active = 0;
+ global[g131] = -1;
+ global[g141] = -1;
+ kernel_reset_animation(scratch._9a, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+ kernel_reset_animation(scratch._9c, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+ player.walker_visible = -1;
+ global[g133] = 0;
+ global[g143] = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ if (scratch._aa == 0) {
+ player.commands_allowed = -1;
+ break;
+ }
+ kernel_seq_delete(seq[5]);
+ matte_deallocate_series(ss[5], -1);
+ aa[9] = kernel_run_animation(kernel_name('L', 1), 105);
+ aainfo[9]._active = -1;
+ break;
+
+ case 101:
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[scratch._94]);
+ aainfo[scratch._94]._active = 0;
+ kernel_reset_animation(scratch._9c, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+ global[g143] = 0;
+ player.commands_allowed = -1;
+ break;
+
+ case 102:
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[scratch._96]);
+ aainfo[scratch._96]._active = 0;
+ kernel_reset_animation(scratch._9a, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+ global[g133] = 0;
+ player.commands_allowed = -1;
+ break;
+
+ case 103:
+ if (scratch._a6 == 1) {
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[3]);
+ aainfo[3]._active = 0;
+ kernel_reset_animation(scratch._9c, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+ global[g143] = 0;
+ kernel_reset_animation(scratch._9a, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+ global[g133] = 0;
+ room_321_anim2();
+ kernel_flip_hotspot(132, 0);
+ inter_move_object(6, 2);
+ global[player_score] = -1;
+ player.commands_allowed = -1;
+ } else if (scratch._a6 == 2) {
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[3]);
+ aainfo[3]._active = 0;
+ kernel_reset_animation(scratch._9c, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+ global[g143] = 0;
+ kernel_reset_animation(scratch._9a, 1);
+ kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+ global[g133] = 0;
+ room_321_anim2();
+ kernel_flip_hotspot(125, 0);
+ if (!player_has(5))
+ inter_move_object(5, 2);
+ global[g068] = -1;
+ global[player_score] = -1;
+ player.commands_allowed = -1;
+ }
+ break;
+
+ case 105:
+ dont_frag_the_palette();
+ kernel_abort_animation(aa[9]);
+ aainfo[9]._active = 0;
+ player.commands_allowed = -1;
+ break;
+
+ default:
+ break;
+ }
+
+
+ global_anim1(6, scratch._9a, global[g131], &global[g132]);
+ global_anim2(6, scratch._9c, global[g141], &global[g142]);
+ if (scratch._a4 != 0)
+ kernel_random_frame(scratch._9e, &global[g151], global[g154]);
+ if (aainfo[0]._active != 0) room_321_anim1();
+ if (aainfo[1]._active != 0) room_321_anim2();
+ if (aainfo[2]._active != 0) room_321_anim3();
+ if (aainfo[3]._active != 0) room_321_anim4();
+ if (aainfo[4]._active != 0) room_321_anim5();
+ if (aainfo[5]._active != 0) room_321_anim6();
+ if (aainfo[6]._active != 0) room_321_anim7();
+ if (aainfo[7]._active != 0) room_321_anim8();
+ if (aainfo[8]._active != 0) room_321_anim9();
+ if (aainfo[9]._active != 0) room_321_anim10();
}
static void room_321_pre_parser() {
+ if (player_parse(13, 35, 0))
+ player.walk_off_edge_to_room = 302;
}
static void room_321_parser() {
+ if (global[walker_converse_state] != 0) {
+ player.commands_allowed = 0;
+ digi_play_build_ii('c', 1, 1);
+ scratch._a8 = -666;
+ goto handled;
+ }
+
+ if (global[player_selected_object] >= 0) {
+ goto handled;
+ }
+
+ if (player_parse(114, 77, 0)) {
+ global[player_score] = 0;
+ digi_stop(3);
+ player.commands_allowed = 0;
+ global[g135] = -1;
+ scratch._8c = 5;
+ scratch._a6 = 1;
+ goto handled;
+ }
+
+ if (player_parse(114, 103, 0)) {
+ global[player_score] = 0;
+ digi_stop(3);
+ player.commands_allowed = 0;
+ global[g135] = -1;
+ scratch._8c = 5;
+ scratch._a6 = 2;
+ goto handled;
+ }
+
+ if (player_parse(126, 132, 0)) {
+ global[g154] = 2;
+ global[player_score] = 0;
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ scratch._9e = kernel_run_animation_talk('b', 1, 0);
+ kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+ kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
+ digi_play_build_ii('b', 3, 1);
+ scratch._a8 = 400;
+ scratch._a4 = -1;
+ goto handled;
+ }
+
+ if (player_parse(126, 125, 0)) {
+ global[g154] = 2;
+ global[player_score] = 0;
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ scratch._9e = kernel_run_animation_talk('b', 3, 0);
+ kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+ kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
+ digi_play_build_ii('b', 3, 1);
+ scratch._a8 = 300;
+ scratch._a4 = -1;
+ goto handled;
+ }
+
+ if (player_parse(78, 181, 0)) {
+ aainfo[8]._frame = 1;
+ kernel_reset_animation(aa[8], 1);
+ player.commands_allowed = 0;
+ goto handled;
+ }
+
+ if (player_parse(78, 182, 0)) {
+ aainfo[7]._frame = 5;
+ kernel_reset_animation(aa[7], 5);
+ goto handled;
+ }
+
+ if (player_parse(78, 177, 0)) {
+ aainfo[5]._frame = 1;
+ kernel_reset_animation(aa[5], 1);
+ player.commands_allowed = 0;
+ goto handled;
+ }
+
+ if (player_parse(78, 185, 0)) {
+ aainfo[4]._frame = 5;
+ kernel_reset_animation(aa[4], 5);
+ goto handled;
+ }
+
+ if (player_parse(78, 184, 0)) {
+ aainfo[4]._frame = 12;
+ kernel_reset_animation(aa[4], 12);
+ goto handled;
+ }
+
+ goto done;
+handled:
+ player.command_ready = false;
+done:
+ ;
}
void room_321_synchronize(Common::Serializer &s) {
for (int16 &v : scratch.sprite) s.syncAsSint16LE(v);
for (int16 &v : scratch.sequence) s.syncAsSint16LE(v);
for (int16 &v : scratch.animation) s.syncAsSint16LE(v);
+ for (auto &ai : scratch.animation_info) ai.synchronize(s);
+ s.syncAsSint16LE(scratch._8c);
+ s.syncAsSint16LE(scratch._8e);
+ s.syncAsSint16LE(scratch._90);
+ s.syncAsSint16LE(scratch._92);
+ s.syncAsSint16LE(scratch._94);
+ s.syncAsSint16LE(scratch._96);
+ s.syncAsSint16LE(scratch._98);
+ s.syncAsSint16LE(scratch._9a);
+ s.syncAsSint16LE(scratch._9c);
+ s.syncAsSint16LE(scratch._9e);
+ s.syncAsSint16LE(scratch._a0);
+ s.syncAsSint16LE(scratch._a2);
+ s.syncAsSint16LE(scratch._a4);
+ s.syncAsSint16LE(scratch._a6);
+ s.syncAsSint16LE(scratch._a8);
+ s.syncAsSint16LE(scratch._aa);
}
void room_321_preload() {
- room_init_code_pointer = room_321_init;
+ room_init_code_pointer = room_321_init;
room_pre_parser_code_pointer = room_321_pre_parser;
- room_parser_code_pointer = room_321_parser;
- room_daemon_code_pointer = room_321_daemon;
+ room_parser_code_pointer = room_321_parser;
+ room_daemon_code_pointer = room_321_daemon;
global_section_walker();
global_section_interface();
More information about the Scummvm-git-logs
mailing list