[Scummvm-git-logs] scummvm master -> 9bb74a8d0bf82dded27595c6a5d57d7a8d4f8d03
dreammaster
noreply at scummvm.org
Sat Aug 10 05:18:42 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9bb74a8d0b M4: RIDDLE: Added room 402 init
Commit: 9bb74a8d0bf82dded27595c6a5d57d7a8d4f8d03
https://github.com/scummvm/scummvm/commit/9bb74a8d0bf82dded27595c6a5d57d7a8d4f8d03
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-08-09T22:18:36-07:00
Commit Message:
M4: RIDDLE: Added room 402 init
Changed paths:
engines/m4/riddle/rooms/section4/room402.cpp
engines/m4/riddle/rooms/section4/room402.h
engines/m4/riddle/rooms/section4/section4.cpp
engines/m4/riddle/rooms/section4/section4.h
diff --git a/engines/m4/riddle/rooms/section4/room402.cpp b/engines/m4/riddle/rooms/section4/room402.cpp
index dea4c43d858..3efdc2a7abc 100644
--- a/engines/m4/riddle/rooms/section4/room402.cpp
+++ b/engines/m4/riddle/rooms/section4/room402.cpp
@@ -20,6 +20,7 @@
*/
#include "m4/riddle/rooms/section4/room402.h"
+#include "m4/riddle/rooms/section4/section4.h"
#include "m4/graphics/gr_series.h"
#include "m4/riddle/vars.h"
@@ -27,12 +28,262 @@ namespace M4 {
namespace Riddle {
namespace Rooms {
+void Room402::preload() {
+ _G(player).walker_type = 1;
+ _G(player).shadow_type = 1;
+ LoadWSAssets("OTHER SCRIPT");
+}
+
void Room402::init() {
+ player_set_commands_allowed(false);
+
+ if (_G(game).previous_room != KERNEL_RESTORING_GAME) {
+ _val1 = 0;
+ _val2 = -1;
+ _val3 = 0;
+ _val4 = 0;
+ _val5 = -1;
+ _val6 = 0;
+ _val7 = 0;
+ _val8 = 0;
+ _val9 = -1;
+ _val10 = 0;
+ _val11 = 0;
+ _val12 = 0;
+ _val13 = 0;
+ }
+
+ hotspot_set_active("WOLF", false);
+ hotspot_set_active("TOPIARY", false);
+ hotspot_set_active("TOPIARY ", false);
+
+ _wolfie = series_place_sprite("WOLFIE WHLBRW OUTSIDE CASTLE", 0, 0, 0, 100, 0x300);
+ _shadow3 = series_load("SAFARI SHADOW 3");
+
+ digi_preload("950_s19");
+ digi_preload("950_s20");
+ digi_preload("950_s21");
+ digi_preload("950_s23");
+
+ if (!_G(flags)[GLB_TEMP_12] && !_G(flags)[V117]) {
+ if (!_G(flags)[V110])
+ _G(flags)[V131] = 402;
+ else if (inv_player_has("TURTLE"))
+ _G(flags)[V131] = 408;
+ else
+ _G(flags)[V131] = _G(flags)[V124] ? 402 : 403;
+ }
+
+ if (inv_player_has("PLANK")) {
+ _G(flags)[V139] = 1;
+ } else if (inv_player_has("STEP LADDER")) {
+ _G(flags)[V139] = 2;
+ } else if (inv_player_has("EDGER")) {
+ _G(flags)[V139] = inv_player_has("TURTLE") ? 3 : 4;
+ } else {
+ ws_walk_load_walker_series(S4_NORMAL_DIRS, S4_NORMAL_NAMES);
+ ws_walk_load_shadow_series(S4_SHADOW_DIRS, S4_SHADOW_NAMES);
+
+ if (!player_been_here(402)) {
+ digi_preload("950_s22");
+ hotspot_set_active("WOLF", true);
+ hotspot_set_active("TOPIARY", true);
+
+ _G(flags)[V131] = 402;
+ _G(flags)[V318] = 0;
+
+ _ripPaysWolfie = series_load("RIP PAYS WOLFIE");
+ _ripTalkWolf = series_load("RIP TALKS TO WOLF");
+ _ripTalker = series_load("RIP TREK TALKER POS3");
+ _wolfClipping = series_load("WOLF CLIPPING LOOP");
+ _wolfClippersDown = series_load("WOLF CLPRS DOWN TURNS POS9");
+ _wolfShakesHead = series_load("WOLF TALKS SHAKES HEAD");
+ _wolfWantsMoney = series_load("WOLF WANTS MONEY");
+ _ripHeadTurn = series_load("RIP TREK HEAD TURN POS3");
+
+ _wolfieMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, -53, 100, 0x200, 0,
+ triggerMachineByHashCallbackNegative, "WOLFIE");
+ sendWSMessage_10000(1, _wolfieMach, _wolfClipping, 1, 10, 110,
+ _wolfClipping, 10, 10, 0);
+ _val12 = 2001;
+ _val13 = 2300;
+ ws_demand_facing(11);
+
+ // The original uses a getenv("KITTY") call
+#ifdef KITTY_SCREAMING
+ ws_demand_location(425, 285);
+ player_set_commands_allowed(true);
+#else
+ digi_preload("950_s22");
+ _ripDownStairs = series_load("RIP DOWN STAIRS");
+ ws_hide_walker();
+ _ripLeaving = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x600, 0,
+ triggerMachineByHashCallbackNegative, "rip leaving castle");
+ sendWSMessage_10000(1, _ripLeaving, _ripDownStairs, 1, 27, 55,
+ _ripDownStairs, 27, 27, 0);
+#endif
+
+ } else if (_G(flags)[V131] != 402) {
+ hotspot_set_active("TOPIARY ", true);
+
+ switch (_G(game).previous_room) {
+ case KERNEL_RESTORING_GAME:
+ digi_preload("950_s22");
+
+ if (_G(flags)[V117]) {
+ _branch = series_place_sprite("sprite of the pulled out branch",
+ 0, 0, -53, 100, 0x300);
+ }
+
+ player_set_commands_allowed(true);
+ break;
+
+ case 404:
+ digi_preload("950_s22");
+ _ripDownStairs = series_load("RIP DOWN STAIRS");
+ ws_hide_walker();
+ _ripLeaving = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x600, 0,
+ triggerMachineByHashCallbackNegative, "rip leaving castle");
+ sendWSMessage_10000(1, _ripLeaving, _ripDownStairs, 1, 27, 55,
+ _ripDownStairs, 27, 27, 0);
+ break;
+
+ case 408:
+ ws_demand_location(517, 239, 3);
+ ws_walk(510, 260, 0, 50, 8);
+ break;
+
+ default:
+ digi_preload("950_s22");
+ ws_demand_location(660, 290, 3);
+ ws_walk(612, 287, nullptr, 50, 9);
+ midi_fade_volume(0, 120);
+ break;
+ }
+ } else {
+ if (!_G(flags)[V117]) {
+ hotspot_set_active("WOLF", true);
+ hotspot_set_active("TOPIARY", true);
+
+ _ripPaysWolfie = series_load("RIP PAYS WOLFIE");
+ _ripTalkWolf = series_load("RIP TALKS TO WOLF");
+ _ripTalker = series_load("RIP TREK TALKER POS3");
+ _wolfClipping = series_load("WOLF CLIPPING LOOP");
+ _wolfClippersDown = series_load("WOLF CLPRS DOWN TURNS POS9");
+ _wolfShakesHead = series_load("WOLF TALKS SHAKES HEAD");
+ _wolfWantsMoney = series_load("WOLF WANTS MONEY");
+
+ _wolfieMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, -53, 100, 0x200, 0,
+ triggerMachineByHashCallbackNegative, "WOLFIE");
+
+ if (_val6) {
+ sendWSMessage_10000(1, _wolfieMach, _wolfWantsMoney, 16, 16, -1,
+ _wolfWantsMoney, 16, 16, 0);
+ } else {
+ _val12 = 2001;
+ _val13 = 2300;
+ sendWSMessage_10000(1, _wolfieMach, _wolfClipping, 1, 10, 110,
+ _wolfClipping, 10, 10, 0);
+ }
+ }
+
+ switch (_G(game).previous_room) {
+ case KERNEL_RESTORING_GAME:
+ digi_preload("950_s22");
+
+ if (_G(flags)[V117])
+ _branch = series_place_sprite("sprite of the pulled out branch", 0, 0, -53, 100, 0x300);
+ player_set_commands_allowed(true);
+ break;
+
+ case 404:
+ digi_preload("950_s22");
+ _ripDownStairs = series_load("RIP DOWN STAIRS");
+ ws_hide_walker();
+
+ _ripLeaving = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x600, 0,
+ triggerMachineByHashCallbackNegative, "rip leaving castle");
+ sendWSMessage_10000(1, _ripLeaving, _ripDownStairs, 1, 27, 55,
+ _ripDownStairs, 27, 27, 0);
+ break;
+
+ case 408:
+ if (_G(flags)[V125] == 3) {
+ _G(flags)[GLB_TEMP_12] = 1;
+ _G(flags)[V125] = 4;
+ _G(flags)[V131] = 999;
+
+ _wolfClipping = series_load("WOLF CLIPPING LOOP");
+ _wolfClippersDown = series_load("WOLF CLPRS DOWN TURNS POS9");
+ _wolfTurnsClipping = series_load("WOLF TURNS CLPNG TO POS1");
+ _turtlePopup = series_load("402 TURTLE POPUP");
+ _ripLeanWall = series_load("Rip leans against far wall");
+
+ _wolfieMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, -53, 100, 0x200, 0,
+ triggerMachineByHashCallbackNegative, "WOLFIE");
+ _val12 = 2001;
+ _val13 = 2300;
+
+ sendWSMessage_10000(1, _wolfieMach, _wolfClipping, 1, 10, 100,
+ _wolfClipping, 10, 10, 0);
+ ws_demand_location(517, 239, 3);
+ ws_walk(503, 248, nullptr, 350, 7);
+ } else if (_G(flags)[V117] != 0 && inv_player_has("TURTLE")) {
+ _G(flags)[V117] = 0;
+ hotspot_set_active("TOPIARY ", true);
+ _G(flags)[V131] = 408;
+ ws_demand_location(517, 239, 3);
+
+ _wolfWalker = triggerMachineByHash_3000(8, 8, S4_NORMAL_DIRS, S4_SHADOW_DIRS,
+ 475, 300, 11, triggerMachineByHashCallback3000, "wolf_walker");
+ sendWSMessage_10000(_wolfWalker, 549, 239, 9, 42, 0);
+ kernel_timing_trigger(90, 40);
+ } else {
+ ws_demand_location(517, 239, 3);
+ ws_walk(449, 317, nullptr, 30, 3);
+ }
+ break;
+
+ default:
+ digi_preload("950_s22");
+ ws_demand_location(660, 290, 3);
+ ws_walk(449, 317, nullptr, 30, 3);
+ midi_fade_volume(0, 120);
+
+ if (inv_player_has("TURTLE"))
+ inv_move_object("STEP LADDER", NOWHERE);
+ break;
+ }
+ }
+ }
+
+ if (_G(flags)[V139]) {
+ _wolfClipping = series_load("WOLF CLIPPING LOOP");
+ _wolfieMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, -53, 100, 0x200, 0,
+ triggerMachineByHashCallbackNegative, "WOLFIE");
+ _val12 = 2001;
+ _val13 = 2300;
+
+ sendWSMessage_10000(1, _wolfieMach, _wolfClipping, 1, 10, 110,
+ _wolfClipping, 10, 10, 0);
+ ws_demand_location(517, 239, 3);
+ ws_walk(510, 260, nullptr, 370, 8);
+ }
+
+ digi_play_loop("950_s22", 3, 120);
}
void Room402::daemon() {
}
+void Room402::pre_parser() {
+
+}
+
+void Room402::parser() {
+
+}
+
} // namespace Rooms
} // namespace Riddle
} // namespace M4
diff --git a/engines/m4/riddle/rooms/section4/room402.h b/engines/m4/riddle/rooms/section4/room402.h
index 54b06f07a16..369abcb5bb4 100644
--- a/engines/m4/riddle/rooms/section4/room402.h
+++ b/engines/m4/riddle/rooms/section4/room402.h
@@ -29,12 +29,48 @@ namespace Riddle {
namespace Rooms {
class Room402 : public Room {
+private:
+ int _val1 = 0;
+ int _val2 = 0;
+ int _val3 = 0;
+ int _val4 = 0;
+ int _val5 = 0;
+ int _val6 = 0;
+ int _val7 = 0;
+ int _val8 = 0;
+ int _val9 = 0;
+ int _val10 = 0;
+ int _val11 = 0;
+ int _val12 = 0;
+ int _val13 = 0;
+ machine *_wolfie = nullptr;
+ machine *_wolfieMach = nullptr;
+ int _shadow3 = 0;
+ int _ripPaysWolfie = 0;
+ int _ripTalkWolf = 0;
+ int _ripTalker = 0;
+ int _wolfClipping = 0;
+ int _wolfClippersDown = 0;
+ int _wolfShakesHead = 0;
+ int _wolfWantsMoney = 0;
+ int _ripHeadTurn = 0;
+ int _ripDownStairs = 0;
+ machine *_ripLeaving = nullptr;
+ machine *_branch = nullptr;
+ int _wolfTurnsClipping = 0;
+ int _turtlePopup = 0;
+ int _ripLeanWall = 0;
+ machine *_wolfWalker = nullptr;
+
public:
Room402() : Room() {}
~Room402() override {}
+ void preload() override;
void init() override;
void daemon() override;
+ void pre_parser() override;
+ void parser() override;
};
} // namespace Rooms
diff --git a/engines/m4/riddle/rooms/section4/section4.cpp b/engines/m4/riddle/rooms/section4/section4.cpp
index 016c203d76e..f50de524192 100644
--- a/engines/m4/riddle/rooms/section4/section4.cpp
+++ b/engines/m4/riddle/rooms/section4/section4.cpp
@@ -26,6 +26,18 @@ namespace M4 {
namespace Riddle {
namespace Rooms {
+const int16 S4_NORMAL_DIRS[] = { 200, 201, -1 };
+const char *S4_NORMAL_NAMES[] = {
+ "wolf walker pos1",
+ "wolf walker pos3"
+};
+const int16 S4_SHADOW_DIRS[] = { 210, 211, -1 };
+const char *S4_SHADOW_NAMES[] = {
+ "wolf shadow pos1",
+ "wolf shadow pos3"
+};
+
+
Section4::Section4() : Rooms::Section() {
add(401, &_room401);
add(402, &_room402);
diff --git a/engines/m4/riddle/rooms/section4/section4.h b/engines/m4/riddle/rooms/section4/section4.h
index e91f825e81d..7f7709fbe7c 100644
--- a/engines/m4/riddle/rooms/section4/section4.h
+++ b/engines/m4/riddle/rooms/section4/section4.h
@@ -43,6 +43,12 @@ namespace M4 {
namespace Riddle {
namespace Rooms {
+extern const int16 S4_NORMAL_DIRS[];
+extern const char *S4_NORMAL_NAMES[];
+extern const int16 S4_SHADOW_DIRS[];
+extern const char *S4_SHADOW_NAMES[];
+
+
class Section4 : public Section {
private:
Room401 _room401;
More information about the Scummvm-git-logs
mailing list