[Scummvm-git-logs] scummvm master -> 8de74f70deecde422af8a79e88e196c57801626e
Strangerke
noreply at scummvm.org
Sat Oct 12 14:39:02 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b133f68eba M4: RIDDLE: Remove extra space/tabs in room 801, remove an extra semi-column
8de74f70de M4: RIDDLE: finish the implementation of room 802 (parser added)
Commit: b133f68eba6d4daa43c1d2fc1dca9c35b23f8bd6
https://github.com/scummvm/scummvm/commit/b133f68eba6d4daa43c1d2fc1dca9c35b23f8bd6
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-10-12T16:37:14+01:00
Commit Message:
M4: RIDDLE: Remove extra space/tabs in room 801, remove an extra semi-column
Changed paths:
engines/m4/riddle/rooms/section8/room801.cpp
diff --git a/engines/m4/riddle/rooms/section8/room801.cpp b/engines/m4/riddle/rooms/section8/room801.cpp
index 5b5c20148e7..37065fa8121 100644
--- a/engines/m4/riddle/rooms/section8/room801.cpp
+++ b/engines/m4/riddle/rooms/section8/room801.cpp
@@ -84,10 +84,10 @@ void Room801::init() {
}
if (_G(game).previous_room == 850) {
- _G(flags) [V250] = 0;
- _G(flags) [V251] = 0;
- _G(flags) [V252] = 0;
- _G(flags) [V273] = 0;
+ _G(flags)[V250] = 0;
+ _G(flags)[V251] = 0;
+ _G(flags)[V252] = 0;
+ _G(flags)[V273] = 0;
_roomStates_tt = 0;
hotspot_set_active(_G(currentSceneDef).hotspots, "root cellar ", true);
@@ -210,7 +210,7 @@ void Room801::parser() {
}
else if (lookFl && _G(walker).ripley_said(SAID)) {
- ; // Yep, nothing
+ // Nothing (though it's important to keep it because of the cascade of checks
}
else if (lookFl && player_said("house")) {
Commit: 8de74f70deecde422af8a79e88e196c57801626e
https://github.com/scummvm/scummvm/commit/8de74f70deecde422af8a79e88e196c57801626e
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-10-12T16:37:14+01:00
Commit Message:
M4: RIDDLE: finish the implementation of room 802 (parser added)
Changed paths:
engines/m4/riddle/rooms/section8/room802.cpp
diff --git a/engines/m4/riddle/rooms/section8/room802.cpp b/engines/m4/riddle/rooms/section8/room802.cpp
index e7c8818d54f..5ca31e240a3 100644
--- a/engines/m4/riddle/rooms/section8/room802.cpp
+++ b/engines/m4/riddle/rooms/section8/room802.cpp
@@ -27,6 +27,14 @@ namespace M4 {
namespace Riddle {
namespace Rooms {
+static const char *const SAID[][2] = {
+ {"urn", "802r10"},
+ {"urn ", "802r11"},
+ {"potatoes", "802r12"},
+ {"stairs", "802r13"},
+ {nullptr, nullptr}
+};
+
void Room802::preload() {
mouse_show();
LoadWSAssets("OTHER SCRIPT", _G(master_palette));
@@ -38,12 +46,9 @@ void Room802::init() {
digi_preload("801_s02", -1);
digi_play_loop("801_s02", 3, 35, -1, -1);
if (!player_been_here(802)) {
- _G(flags)
- [V253] = 0;
- _G(flags)
- [V254] = 0;
- _G(flags)
- [V255] = 0;
+ _G(flags)[V253] = 0;
+ _G(flags)[V254] = 0;
+ _G(flags)[V255] = 0;
}
digi_preload("802_s01", -1);
@@ -148,8 +153,9 @@ void Room802::pre_parser() {
if (player_said("look"))
lookFl = true;
- if (player_said("push") || player_said("pull") || player_said("gear") || player_said("open") || player_said("close"))
- ; // CHECKME: completely useless -> suspicious
+ if (player_said("push") || player_said("pull") || player_said("gear") || player_said("open") || player_said("close")) {
+ // CHECKME: completely useless -> suspicious
+ }
if (player_said("go") && player_said("root cellar")) {
digi_play("802R13", 1, 255, -1, -1);
@@ -163,10 +169,304 @@ void Room802::pre_parser() {
_G(player).ready_to_walk = true;
_G(player).waiting_for_walk = false;
}
-
}
void Room802::parser() {
+ bool lookFl = false;
+ bool takeFl = false;
+ bool gearFl = false;
+ bool climbFl = false;
+
+ if (player_said("look") || player_said("look at"))
+ lookFl = true;
+
+ if (player_said("talk") || player_said("talk to")) {
+ // Nothing...
+ }
+
+ if (player_said("take"))
+ takeFl = true;
+
+ if (player_said("gear"))
+ gearFl = true;
+
+ if (player_said("go") || player_said("climb"))
+ climbFl = true;
+
+ if (lookFl && _G(walker).ripley_said(SAID)) {
+ // Nothing on purpose
+ }
+
+ else if (lookFl && (player_said("rice sack") || player_said("rice sack "))) {
+ _G(kernel).trigger_mode = KT_DAEMON;
+ kernel_trigger_dispatchx(kernel_trigger_create(14));
+ _G(kernel).trigger_mode = KT_PARSE;
+ }
+
+ else if (lookFl && player_said("wall") && _G(flags)[V255] == 0) {
+ if (_G(flags)[V252]) {
+ _G(kernel).trigger_mode = KT_DAEMON;
+ kernel_trigger_dispatchx(kernel_trigger_create(14));
+ _G(kernel).trigger_mode = KT_PARSE;
+ } else {
+ digi_play("802R03", 1, 255, -1, -1);
+ }
+ }
+
+ else if ((climbFl && player_said("hole ")) || (lookFl && player_said("hole "))) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ interface_hide();
+ ws_unhide_walker(_G(my_walker));
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "rip lights match");
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _lookWithMatch, 1, 12, 10, _lookWithMatch, 12, 12, 0);
+ break;
+ case 1:
+ digi_play("802r16", 1, 255, 2, 802);
+ break;
+ case 2:
+ kernel_timing_trigger(90, 3, nullptr);
+ break;
+ case 3:
+ disable_player_commands_and_fade_init(4);
+ break;
+ case 4:
+ inv_move_object("match", 999);
+ terminateMachine(_ripWalksDownstairsMach);
+ player_set_commands_allowed(true);
+ _G(flags)[V260] = 1;
+ adv_kill_digi_between_rooms(false);
+ digi_play_loop("801_s02", 3, 100, -1, -1);
+ _G(game).new_room = 801;
+ break;
+ case 10:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _lookWithMatch, 13, 18, 1, _lookWithMatch, 19, 22, 1);
+ digi_play("802_s05", 2, 255, -1, -1);
+ break;
+ default:
+ break;
+ }
+ }
+
+ else if (lookFl && (player_said("hand") || player_said("hole"))) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ ws_hide_walker(_G(my_walker));
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "rip bends down to look in hole / at hand");
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripLooksAtHand, 1, 17, 1, _ripLooksAtHand, 17, 17, 0);
+ break;
+ case 1:
+ if (player_said("hole")) {
+ digi_play("802r09", 1, 255, 2, -1);
+ } else if (_G(flags)[V254]){
+ digi_play("802r15", 1, 255, 2, -1);
+ } else if (_G(flags)[V252]) {
+ digi_play("802r02", 1, 255, 2, -1);
+ } else {
+ digi_play("802r03", 1, 255, 2, -1);
+ }
+ break;
+ case 2:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripLooksAtHand, 17, 1, 3, _ripLooksAtHand, 1, 1, 0);
+ break;
+ case 3:
+ terminateMachine(_ripWalksDownstairsMach);
+ ws_unhide_walker(_G(my_walker));
+ break;
+ default:
+ break;
+ }
+ }
+
+ else if (lookFl && player_said("root cellar")) {
+ // Nothing on purpose
+ }
+
+ else if (gearFl && player_said("rice sack")) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "rip moves sack of rice");
+ ws_hide_walker(_G(my_walker));
+ terminateMachine(_sackAgainstWallMach);
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDragsSack, 1, 15, 10, _ripDragsSack, 15, 15, 0);
+ break;
+ case 1:
+ digi_play("802r05", 1, 255, 2, -1);
+ break;
+ case 2:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDragsSack, 41, 46, 3, _ripDragsSack, 46, 46, 0);
+ break;
+ case 3:
+ terminateMachine(_ripWalksDownstairsMach);
+ ws_unhide_walker(_G(my_walker));
+ _handInWallMach = series_place_sprite("HAND IN WALL", 0, 0, 0, 100, 512);
+ series_unload(_ripDragsSack);
+ series_unload(_sackAgainstWall);
+ _G(flags)[253] = 1;
+ hotspot_set_active(_G(currentSceneDef).hotspots, "rice sack", false);
+ hotspot_set_active(_G(currentSceneDef).hotspots, "rice sack ", true);
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hand", true);
+ player_set_commands_allowed(true);
+ break;
+ case 10:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDragsSack, 16, 25, 11, _ripDragsSack, 25, 25, 0);
+ digi_play("802_s01", 2, 255, -1, -1);
+ break;
+ case 11:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDragsSack, 26, 40, 1, _ripDragsSack, 40, 40, 0);
+ digi_stop(2);
+ break;
+ default:
+ break;
+ }
+ }
+
+ else if ((player_said("farmer's shovel", "hand") || player_said("farmer's shovel", "wall")) && _G(flags)[254] == 0) {
+ if (_G(flags)[V253]) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ ws_hide_walker(_G(my_walker));
+ terminateMachine(_handInWallMach);
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "802 rip digs at wall");
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDigsWall, 1, 24, 10, _ripDigsWall, 24, 24, 0);
+ break;
+ case 1:
+ terminateMachine(_ripWalksDownstairsMach);
+ ws_unhide_walker((_G(my_walker)));
+ _handInWallMach = series_place_sprite("HAND IN WALL PARTLY DUG ", 0, 0, 0, 100, 512);
+ _G(flags)[V254] = 1;
+ player_set_commands_allowed(true);
+ break;
+ case 10:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDigsWall, 25, 54, 11, _ripDigsWall, 54, 54, 0);
+ digi_play("802_s04", 2, 255, -1, -1);
+ break;
+ case 11:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripDigsWall, 55, 66, 1, _ripDigsWall, 66, 66, 0);
+ digi_stop(2);
+ break;
+ default:
+ break;
+ }
+ } else {
+ digi_play("802r04", 1, 255, -1, -1);
+ }
+ }
+
+ else if ((gearFl || takeFl) && player_said("hand")) {
+ if (inv_player_has("farmer's shovel") && _G(flags)[V254]) {
+ if (_G(flags)[V254] >= 1) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ ws_unhide_walker(_G(my_walker));
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "rip tugs at hand and removes it");
+ terminateMachine(_handInWallMach);
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsOnArm, 1, 36, 10, _ripTugsOnArm, 36, 36, 0);
+ break;
+ case 10:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsOnArm, 37, 68, 20, _ripTugsOnArm, 68, 68, 0);
+ digi_play("802_s03", 2, 255, -1, -1);
+ break;
+ case 20:
+ terminateMachine(_ripWalksDownstairsMach);
+ ws_unhide_walker(_G(my_walker));
+ _holeInWallMach = series_place_sprite("HOLE IN WALL", 0, 0, 0, 100, 512);
+ _sackAgainstWallMach = series_place_sprite("802SACK2", 0, 0, 0, 100, 768);
+
+ if (inv_player_has("match")) {
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hole", true);
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hole ", false);
+ } else {
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hole", false);
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hole ", true);
+ }
+
+ hotspot_set_active(_G(currentSceneDef).hotspots, "hand", false);
+ hotspot_set_active(_G(currentSceneDef).hotspots, "wall", false);
+
+ _G(flags)[V255] = 1;
+ player_set_commands_allowed(true);
+ break;
+ default:
+ break;
+ }
+ }
+
+ } else {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ ws_hide_walker(_G(my_walker));
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 512, 0, triggerMachineByHashCallbackNegative, "rip tugs at hand (noshovel)");
+ terminateMachine(_handInWallMach);
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsBeforeDigging, 1, 15, 10, _ripTugsBeforeDigging, 15, 15, 0);
+ break;
+ case 1:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsBeforeDigging, 26, 20, 2, _ripTugsBeforeDigging, 19, 19, 0);
+ break;
+ case 2:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsBeforeDigging, 19, 15, 13, _ripTugsBeforeDigging, 15, 15, 0);
+ if (inv_player_has("farmer's shovel")) {
+ if (_G(flags)[V254] == 1)
+ digi_play("802r07", 1, 255, -1, -1);
+ } else {
+ digi_play("802r06", 1, 255, -1, -1);
+ }
+ break;
+ case 3:
+ terminateMachine(_ripWalksDownstairsMach);
+ ws_unhide_walker(_G(my_walker));
+ _handInWallMach = series_place_sprite("HAND IN WALL", 0, 0, 0, 100, 512);
+ player_set_commands_allowed(true);
+ break;
+ case 10:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsBeforeDigging, 16, 26, 1, _ripTugsBeforeDigging, 26, 26, 0);
+ digi_play("802_s02", 2, 255, -1, -1);
+ break;
+ case 13:
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripTugsBeforeDigging, 14, 1, 3, _ripTugsBeforeDigging, 1, 1, 0);
+ digi_stop(2);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ else if (takeFl && (player_said("urn") || player_said("urn ") || player_said("potatoes"))) {
+ digi_play("802r14", 1, 255, -1, -1);
+ }
+
+ else if (climbFl && player_said("stairs")) {
+ switch (_G(kernel).trigger) {
+ case -1:
+ player_set_commands_allowed(false);
+ _ripWalksDownstairsMach = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 768, 0, triggerMachineByHashCallbackNegative, "rip walks up stairs");
+ ws_hide_walker(_G(my_walker));
+ sendWSMessage_10000(1, _ripWalksDownstairsMach, _ripUpStairs, 1, 23, 1, _ripUpStairs, 24, 29, 0);
+ break;
+ case 1:
+ disable_player_commands_and_fade_init(2);
+ break;
+ case 2:
+ terminateMachine(_ripWalksDownstairsMach);
+ _G(game).new_room = 801;
+ break;
+ default:
+ break;
+ }
+ }
+
+ else if (player_said("journal") && (takeFl || lookFl || gearFl)) {
+ digi_play("com042", 1, 255, -1, 997);
+ }
+
+ _G(player).command_ready = false;
}
void Room802::daemon() {
More information about the Scummvm-git-logs
mailing list