From babaaa8acc3717eb647e6e05ab209ae3c51050cc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Aug 2023 21:59:17 -0700 Subject: [PATCH] M4: Adding room 137 methods --- engines/m4/burger/burger.cpp | 44 ++-- engines/m4/burger/gui/interface.cpp | 4 +- engines/m4/burger/rooms/section1/room101.cpp | 44 ++-- engines/m4/burger/rooms/section1/room102.cpp | 32 +-- engines/m4/burger/rooms/section1/room103.cpp | 26 +-- engines/m4/burger/rooms/section1/room104.cpp | 10 +- engines/m4/burger/rooms/section1/room105.cpp | 4 +- .../m4/burger/rooms/section1/room133_136.cpp | 6 +- engines/m4/burger/rooms/section1/room135.cpp | 6 +- engines/m4/burger/rooms/section1/room137.cpp | 198 +++++++++++++++++- engines/m4/burger/rooms/section1/room137.h | 14 +- engines/m4/burger/rooms/section1/room142.cpp | 22 +- engines/m4/burger/vars.h | 2 +- 13 files changed, 308 insertions(+), 104 deletions(-) diff --git a/engines/m4/burger/burger.cpp b/engines/m4/burger/burger.cpp index 2e62b1f7f3f..a2da933d67d 100644 --- a/engines/m4/burger/burger.cpp +++ b/engines/m4/burger/burger.cpp @@ -322,13 +322,13 @@ void BurgerEngine::global_daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 10001: ws_unhide_walker(_G(my_walker)); player_set_commands_allowed(true); _G(flags)[V299] = 0; _G(flags)[V298] = 0; - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; break; case 10002: _G(flags)[V299] = 0; @@ -338,7 +338,7 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10013; + _G(wilbur_should) = 10013; series_play_with_breaks(PLAY_BREAKS1, "999wbw", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 7, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; @@ -346,7 +346,7 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10012; + _G(wilbur_should) = 10012; series_play_with_breaks(PLAY_BREAKS2, "999wbj", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 6, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; @@ -354,7 +354,7 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10009; + _G(wilbur_should) = 10009; series_play_with_breaks(PLAY_BREAKS3, "600wek", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 6, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; @@ -362,7 +362,7 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10001; + _G(wilbur_should) = 10001; series_play_with_breaks(PLAY_BREAKS4, "999wsdu", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 7, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; @@ -370,7 +370,7 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10014; + _G(wilbur_should) = 10014; series_play_with_breaks(PLAY_BREAKS5, "999wtpe", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 6, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; @@ -378,38 +378,38 @@ void BurgerEngine::global_daemon() { player_set_commands_allowed(false); player_update_info(_G(my_walker), &_G(player_info)); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 10001; + _G(wilbur_should) = 10001; series_play_with_breaks(PLAY_BREAKS6, "999wtpf", UNKNOWN_DEPTH_1, gCHANGE_WILBUR_ANIMATION, 3, 6, UNKNOWN_SCALE_1, _G(player_info).x, _G(player_info).y); break; case 10009: ws_unhide_walker(_G(my_walker)); - _G(roomVal1) = 10018; + _G(wilbur_should) = 10018; _G(walker).wilbur_speech("602w012x", gCHANGE_WILBUR_ANIMATION); break; case 10010: - _G(roomVal1) = 10011; + _G(wilbur_should) = 10011; _G(walker).wilbur_speech("602w012y", gCHANGE_WILBUR_ANIMATION); break; case 10011: player_set_commands_allowed(true); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; _G(walker).wilbur_speech("602w012z"); break; case 10012: player_set_commands_allowed(true); ws_unhide_walker(_G(my_walker)); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; _G(walker).wilbur_speech("300w055"); break; case 10013: player_set_commands_allowed(true); ws_unhide_walker(_G(my_walker)); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; break; case 10014: enable_player(); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; _G(walker).wilbur_speech("999w208"); break; case 10017: @@ -451,7 +451,7 @@ void BurgerEngine::global_daemon() { case 10022: if (_G(game).room_id < 200) { - _G(roomVal1) = 10017; + _G(wilbur_should) = 10017; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else { error_show(FL, 'Burg', "Time to abduct Wilbur in space?"); @@ -460,7 +460,7 @@ void BurgerEngine::global_daemon() { case 10023: if (_G(game).room_id < 700) { - _G(roomVal1) = 10018; + _G(wilbur_should) = 10018; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } break; @@ -512,7 +512,7 @@ void BurgerEngine::global_parser() { } else if (_G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { _G(flags)[V123] = 1; - _G(roomVal1) = 10004; + _G(wilbur_should) = 10004; ws_turn_to_face(_G(my_walker), 3, gCHANGE_WILBUR_ANIMATION); goto done; } @@ -521,35 +521,35 @@ void BurgerEngine::global_parser() { if (player_said("WHISTLE") && player_said_any("GEAR", "WILBUR") && _G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { - _G(roomVal1) = 10003; + _G(wilbur_should) = 10003; ws_turn_to_face(_G(my_walker), 7, gCHANGE_WILBUR_ANIMATION); goto done; } if (player_said("kibble") && player_said_any("gear", "wilbur") && _G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { - _G(roomVal1) = 10005; + _G(wilbur_should) = 10005; ws_turn_to_face(_G(my_walker), 9, gCHANGE_WILBUR_ANIMATION); goto done; } if (player_said("rubber ducky") && player_said_any("gear", "wilbur") && _G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { - _G(roomVal1) = 10006; + _G(wilbur_should) = 10006; ws_turn_to_face(_G(my_walker), 9, gCHANGE_WILBUR_ANIMATION); goto done; } if (player_said("broken puz dispenser") && player_said_any("gear", "wilbur") && _G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { - _G(roomVal1) = 10007; + _G(wilbur_should) = 10007; ws_turn_to_face(_G(my_walker), 5, 10016); goto done; } if (player_said("puz dispenser") && player_said_any("gear", "wilbur") && _G(my_walker) && _G(player).walker_in_this_scene && _G(roomVal2)) { - _G(roomVal1) = 10008; + _G(wilbur_should) = 10008; ws_turn_to_face(_G(my_walker), 5, gCHANGE_WILBUR_ANIMATION); goto done; } diff --git a/engines/m4/burger/gui/interface.cpp b/engines/m4/burger/gui/interface.cpp index e0a858eabf8..03176ebc58a 100644 --- a/engines/m4/burger/gui/interface.cpp +++ b/engines/m4/burger/gui/interface.cpp @@ -338,13 +338,13 @@ void Interface::trackIcons() { if (_G(game).section_id == 1) { term_message("Abduct me now!"); - _G(roomVal1) = 10017; + _G(wilbur_should) = 10017; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else if (_G(game).section_id == 7) { _G(walker).wilbur_speech("999w023"); } else { term_message("Fail me now!"); - _G(roomVal1) = 10015; + _G(wilbur_should) = 10015; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } break; diff --git a/engines/m4/burger/rooms/section1/room101.cpp b/engines/m4/burger/rooms/section1/room101.cpp index 5de512acbe0..780f59f488b 100644 --- a/engines/m4/burger/rooms/section1/room101.cpp +++ b/engines/m4/burger/rooms/section1/room101.cpp @@ -141,12 +141,12 @@ void Room101::init() { _G(flags)[ROOM101_FLAG1] = 0; ws_demand_facing(_G(my_walker), 10); ws_demand_location(_G(my_walker), 338, 265); - _G(roomVal1) = 16; + _G(wilbur_should) = 16; } else { ws_demand_facing(_G(my_walker), 4); ws_demand_location(_G(my_walker), 264, 259); - _G(roomVal1) = 10; + _G(wilbur_should) = 10; } ws_hide_walker(_G(my_walker)); @@ -159,27 +159,27 @@ void Room101::init() { ws_demand_location(_G(my_walker), 197, 276); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 6; + _G(wilbur_should) = 6; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 104: - _G(roomVal1) = 2; + _G(wilbur_should) = 2; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 106: - _G(roomVal1) = 3; + _G(wilbur_should) = 3; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 135: - _G(roomVal1) = 4; + _G(wilbur_should) = 4; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 142: - _G(roomVal1) = 5; + _G(wilbur_should) = 5; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -428,7 +428,7 @@ void Room101::daemon() { case 21: digi_play("101_002", 2, 255, -1); - _G(roomVal1) = 18; + _G(wilbur_should) = 18; series_play("101ha01", 3840, 0, gCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 14, -1); break; @@ -473,7 +473,7 @@ void Room101::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 2: player_set_commands_allowed(true); ws_demand_location(_G(my_walker), 336, 184); @@ -503,7 +503,7 @@ void Room101::daemon() { break; case 6: - _G(roomVal1) = 7; + _G(wilbur_should) = 7; series_play_with_breaks(PLAY_BREAKS1, "101wi05", 256, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53); break; @@ -514,7 +514,7 @@ void Room101::daemon() { case 8: // Barbershop door open - _G(roomVal1) = 9; + _G(wilbur_should) = 9; terminateMachineAndNull(_doorMachine); series_play_with_breaks(PLAY_BREAKS2, "101wi01", 3072, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0); break; @@ -525,7 +525,7 @@ void Room101::daemon() { break; case 10: - _G(roomVal1) = 11; + _G(wilbur_should) = 11; series_play_with_breaks(PLAY_BREAKS3, "101wi02", 256, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53); break; @@ -537,22 +537,22 @@ void Room101::daemon() { case 14: terminateMachineAndNull(_doorMachine); - _G(roomVal1) = 15; + _G(wilbur_should) = 15; series_play_with_breaks(PLAY_BREAKS2, "101wi01", 3072, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0); break; case 15: - _G(roomVal1) = 16; + _G(wilbur_should) = 16; digi_play("101h001", 1, 255, gCHANGE_WILBUR_ANIMATION); break; case 16: - _G(roomVal1) = 17; + _G(wilbur_should) = 17; series_play_with_breaks(PLAY_BREAKS2, "101wi03", 3072, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0); break; case 17: - _G(roomVal1) = 19; + _G(wilbur_should) = 19; _val2 = 12; if (_G(flags)[V005]) { @@ -578,12 +578,12 @@ void Room101::daemon() { break; case 20: - _G(roomVal1) = 21; + _G(wilbur_should) = 21; series_play_with_breaks(PLAY_BREAKS4, "101wi04", 256, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53); break; case 21: - _G(roomVal1) = 22; + _G(wilbur_should) = 22; pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1003); break; @@ -646,25 +646,25 @@ void Room101::parser() { if (_G(flags)[V012] == 2) { player_set_commands_allowed(false); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 8; + _G(wilbur_should) = 8; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else if (_G(flags)[V013]) { ws_demand_location(_G(my_walker), 338, 265); ws_demand_facing(_G(my_walker), 10); ws_hide_walker(_G(my_walker)); player_set_commands_allowed(false); - _G(roomVal1) = 14; + _G(wilbur_should) = 14; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else { player_set_commands_allowed(false); ws_hide_walker(_G(my_walker)); - _G(roomVal1) = 8; + _G(wilbur_should) = 8; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } } else if (player_said("ENTER", "FIRE ESCAPE") || player_said("gear", "fire escape")) { player_set_commands_allowed(false); - _G(roomVal1) = 20; + _G(wilbur_should) = 20; ws_hide_walker(_G(my_walker)); kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); diff --git a/engines/m4/burger/rooms/section1/room102.cpp b/engines/m4/burger/rooms/section1/room102.cpp index fba13b55d3e..c2adc79ffac 100644 --- a/engines/m4/burger/rooms/section1/room102.cpp +++ b/engines/m4/burger/rooms/section1/room102.cpp @@ -155,7 +155,7 @@ void Room102::init() { ws_hide_walker(); } } else { - _G(roomVal1) = 1; + _G(wilbur_should) = 1; _val16 = 1; digi_preload("102_038"); digi_play("102_038", 2, 255, gCHANGE_WILBUR_ANIMATION); @@ -975,21 +975,21 @@ void Room102::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 1: digi_unload("102_038"); ws_demand_location(628, 325); ws_demand_facing(9); - _G(roomVal1) = 2; + _G(wilbur_should) = 2; ws_walk(435, 329, 0, gCHANGE_WILBUR_ANIMATION, 9, 1); break; case 2: if (_G(flags)[V012] == 2) { - _G(roomVal1) = 3; + _G(wilbur_should) = 3; _G(walker).wilbur_speech("102w003", gCHANGE_WILBUR_ANIMATION); } else if (_G(flags)[V012] == 0) { - _G(roomVal1) = 5; + _G(wilbur_should) = 5; if (_G(flags)[V018]) { _G(walker).wilbur_speech("102w002", gCHANGE_WILBUR_ANIMATION); @@ -1001,7 +1001,7 @@ void Room102::daemon() { case 3: _G(walker).wilbur_speech("102w004", gCHANGE_WILBUR_ANIMATION); - _G(roomVal1) = 4; + _G(wilbur_should) = 4; break; case 4: @@ -1034,7 +1034,7 @@ void Room102::daemon() { case 71: ws_hide_walker(); - _G(roomVal1) = 72; + _G(wilbur_should) = 72; digi_preload_stream_breaks(STREAMS6); series_play("102wi07s", 2816, 0, -1, 6, 0, 100, 0, 0, 0, -1); series_stream_with_breaks(STREAMS6, "102wi07", 6, 256, gCHANGE_WILBUR_ANIMATION); @@ -1048,7 +1048,7 @@ void Room102::daemon() { case 73: ws_hide_walker(); - _G(roomVal1) = 74; + _G(wilbur_should) = 74; digi_preload_stream_breaks(STREAMS7); series_play("102wi06s", 2816, 0, -1, 6, 0, 100, 0, 0, 0, -1); series_stream_with_breaks(STREAMS7, "102wi06", 6, 256, gCHANGE_WILBUR_ANIMATION); @@ -1062,7 +1062,7 @@ void Room102::daemon() { case 75: ws_hide_walker(); - _G(roomVal1) = 76; + _G(wilbur_should) = 76; digi_preload_stream_breaks(STREAMS6); series_play("102wi11s", 257, 0, -1, 6, 0, 100, 0, 0, 0, -1); series_stream_with_breaks(STREAMS6, "102wi11", 6, 256, gCHANGE_WILBUR_ANIMATION); @@ -1076,7 +1076,7 @@ void Room102::daemon() { case 77: ws_hide_walker(); - _G(roomVal1) = 78; + _G(wilbur_should) = 78; digi_preload_stream_breaks(STREAMS7); series_play("102wi10s", 257, 0, -1, 6, 0, 100, 0, 0, 0, -1); series_stream_with_breaks(STREAMS7, "102wi10", 6, 256, gCHANGE_WILBUR_ANIMATION); @@ -1093,7 +1093,7 @@ void Room102::daemon() { terminateMachineAndNull(_laz1); terminateMachineAndNull(_laz2); _G(flags)[V019] = 1; - _G(roomVal1) = 80; + _G(wilbur_should) = 80; if (!_G(flags)[V020]) digi_preload("102w008"); @@ -1123,7 +1123,7 @@ void Room102::daemon() { terminateMachineAndNull(_laz1); terminateMachineAndNull(_laz2); _G(flags)[V019] = 0; - _G(roomVal1) = 83; + _G(wilbur_should) = 83; series_play_with_breaks(PLAY4, "102wi08", 256, gCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0); break; @@ -1185,7 +1185,7 @@ void Room102::parser() { _G(walker).wilbur_speech("102W003"); if (player_said("USE", "GO", "DOORWAY")) { - _G(roomVal1) = 1; + _G(wilbur_should) = 1; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } @@ -1199,7 +1199,7 @@ void Room102::parser() { } else if (player_said("GEAR", "LAZY SUSAN")) { if (_G(flags)[V012]) { player_set_commands_allowed(false); - _G(roomVal1) = _G(flags)[V019] ? 82 : 79; + _G(wilbur_should) = _G(flags)[V019] ? 82 : 79; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else { queuePlay("102h005"); @@ -1209,7 +1209,7 @@ void Room102::parser() { } else if (player_said("take", "hair wax") || player_said("take", "hair wax ")) { if (_G(flags)[V012]) { player_set_commands_allowed(false); - _G(roomVal1) = player_said("hair wax") ? 71 : 75; + _G(wilbur_should) = player_said("hair wax") ? 71 : 75; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else { queuePlay("102h007"); @@ -1223,7 +1223,7 @@ void Room102::parser() { } else if (player_said("take", "hair wax ") || player_said("take", "hair wax ")) { if (_G(flags)[V012]) { player_set_commands_allowed(false); - _G(roomVal1) = player_said("hair wax ") ? 73 : 77; + _G(wilbur_should) = player_said("hair wax ") ? 73 : 77; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else { queuePlay("102h007"); diff --git a/engines/m4/burger/rooms/section1/room103.cpp b/engines/m4/burger/rooms/section1/room103.cpp index 2907017f305..3a00c49bfa0 100644 --- a/engines/m4/burger/rooms/section1/room103.cpp +++ b/engines/m4/burger/rooms/section1/room103.cpp @@ -127,7 +127,7 @@ void Room103::init() { player_set_commands_allowed(false); ws_hide_walker(); - _G(roomVal1) = 1; + _G(wilbur_should) = 1; digi_preload_stream_breaks(SERIES1); series_play("103wi01s", 0x100); series_stream_with_breaks(SERIES1, "103wi01", 6, 0xa00, 10016); @@ -476,7 +476,7 @@ void Room103::daemon() { case 17: _G(flags)[V023] = 0; - _G(roomVal1) = 6; + _G(wilbur_should) = 6; _G(flags)[V298] = 0; ws_walk(325, 173, 0, 10016); break; @@ -553,17 +553,17 @@ void Room103::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 1: digi_unload_stream_breaks(SERIES1); player_set_commands_allowed(true); ws_unhide_walker(); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; break; case 2: ws_hide_walker(); - _G(roomVal1) = 3; + _G(wilbur_should) = 3; digi_preload_stream_breaks(SERIES3); series_play("103wi04s", 0x100, 0, -1, 6, 0, 100, 0, 0, 0, 9); series_stream_with_breaks(SERIES3, "103wi04", 6, 0x100, gCHANGE_WILBUR_ANIMATION); @@ -573,12 +573,12 @@ void Room103::daemon() { digi_unload_stream_breaks(SERIES3); player_set_commands_allowed(true); ws_unhide_walker(); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; wilbur_speech("103w012"); break; case 4: - _G(roomVal1) = 5; + _G(wilbur_should) = 5; terminateMachineAndNull(_series1); ws_hide_walker(); series_play("103wi03s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, 19); @@ -587,19 +587,19 @@ void Room103::daemon() { case 5: ws_unhide_walker(); - _G(roomVal1) = 10002; + _G(wilbur_should) = 10002; _series1 = series_play("103wi06", 0x500, 0, -1, 100, -1, 100, 0, 0, 0, 0); digi_play(Common::String::format("103h001%c", 'a' + imath_ranged_rand(0, 4)).c_str(), 2, 255, 14); break; case 6: - _G(roomVal1) = 7; + _G(wilbur_should) = 7; kernel_timing_trigger(1, gCHANGE_WILBUR_ANIMATION); break; case 7: - _G(roomVal1) = 8; + _G(wilbur_should) = 8; ws_hide_walker(); series_play_with_breaks(PLAY1, "103wi02", 0xa00, gCHANGE_WILBUR_ANIMATION, 2); series_play("103wi02s", 0x100, 0, -1, 6, 0, 100, 0, 0, 0, 27); @@ -638,20 +638,20 @@ void Room103::parser() { if (!_G(walker).wilbur_said(SAID)) { if (player_said("gear", "satellite dish") && _G(flags)[V023] == 0) { - _G(roomVal1) = 4; + _G(wilbur_should) = 4; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); player_set_commands_allowed(false); _G(player).command_ready = false; } else if (player_said("gear", "door") || player_said("gear", "stairway")) { - _G(roomVal1) = 2; + _G(wilbur_should) = 2; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); player_set_commands_allowed(false); _G(player).command_ready = false; } else if (player_said("ENTER", "FIRE ESCAPE") || player_said("gear", "FIRE ESCAPE")) { _val2 = 1; - _G(roomVal1) = 6; + _G(wilbur_should) = 6; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); player_set_commands_allowed(false); _G(player).command_ready = false; diff --git a/engines/m4/burger/rooms/section1/room104.cpp b/engines/m4/burger/rooms/section1/room104.cpp index f9798eb4386..957fa6ff066 100644 --- a/engines/m4/burger/rooms/section1/room104.cpp +++ b/engines/m4/burger/rooms/section1/room104.cpp @@ -63,24 +63,24 @@ void Room104::init() { break; case 101: - _G(roomVal1) = 1; + _G(wilbur_should) = 1; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 105: - _G(roomVal1) = 2; + _G(wilbur_should) = 2; digi_preload("104_005"); digi_play("104_005", 2, 255, 2); kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 107: - _G(roomVal1) = 3; + _G(wilbur_should) = 3; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; case 170: - _G(roomVal1) = 4; + _G(wilbur_should) = 4; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -423,7 +423,7 @@ void Room104::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 1: ws_demand_location(315, 373); ws_demand_facing(10); diff --git a/engines/m4/burger/rooms/section1/room105.cpp b/engines/m4/burger/rooms/section1/room105.cpp index 8bd1e5d6b7a..e35d320f633 100644 --- a/engines/m4/burger/rooms/section1/room105.cpp +++ b/engines/m4/burger/rooms/section1/room105.cpp @@ -284,7 +284,7 @@ void Room105::init() { case 104: ws_demand_location(310, 353, 11); - _G(roomVal1) = 62; + _G(wilbur_should) = 62; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -1281,7 +1281,7 @@ void Room105::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 62: if (_G(flags)[V112] && !_G(flags)[V034]) { player_set_commands_allowed(false); diff --git a/engines/m4/burger/rooms/section1/room133_136.cpp b/engines/m4/burger/rooms/section1/room133_136.cpp index 1e2a14ec424..f72a37ed4f7 100644 --- a/engines/m4/burger/rooms/section1/room133_136.cpp +++ b/engines/m4/burger/rooms/section1/room133_136.cpp @@ -77,7 +77,7 @@ void Room133_136::init() { case 134: case 135: - _G(roomVal1) = 3; + _G(wilbur_should) = 3; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -86,7 +86,7 @@ void Room133_136::init() { break; case 137: - _G(roomVal1) = 4; + _G(wilbur_should) = 4; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -248,7 +248,7 @@ void Room133_136::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 3: player_set_commands_allowed(true); player_first_walk(639, 264, 9, 588, 252, 9, true); diff --git a/engines/m4/burger/rooms/section1/room135.cpp b/engines/m4/burger/rooms/section1/room135.cpp index 9c2adc80817..735ca69836b 100644 --- a/engines/m4/burger/rooms/section1/room135.cpp +++ b/engines/m4/burger/rooms/section1/room135.cpp @@ -104,7 +104,7 @@ void Room135::init() { if (_G(flags)[V000] == 1002) _G(flags)[V039] = 1; - _G(roomVal1) = 37; + _G(wilbur_should) = 37; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -113,7 +113,7 @@ void Room135::init() { if (_G(flags)[V000] == 1002) _G(flags)[V039] = 1; - _G(roomVal1) = 38; + _G(wilbur_should) = 38; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); break; @@ -746,7 +746,7 @@ void Room135::daemon() { break; case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 37: player_set_commands_allowed(true); player_first_walk(639, 373, 9, 579, 359, 9, true); diff --git a/engines/m4/burger/rooms/section1/room137.cpp b/engines/m4/burger/rooms/section1/room137.cpp index fc162103fb1..f7b21600986 100644 --- a/engines/m4/burger/rooms/section1/room137.cpp +++ b/engines/m4/burger/rooms/section1/room137.cpp @@ -28,19 +28,211 @@ namespace M4 { namespace Burger { namespace Rooms { +static const char *SAID[][4] = { + { "PATROL CAR", "137W002", "137W003", "137W004" }, + { "TRUNK", nullptr, "137W008", "137W008" }, + { "JAWZ O' LIFE", "137W010", nullptr, nullptr }, + { "SIGN", "137W012", "137W008", "137W008" }, + { "CAR WINDOW", nullptr, "137W008", "137W008" }, + { "HIGHWAY 2", "137W013", "137W008", "137W008" }, + { "FORK IN THE ROAD", nullptr, "137W008", "137W008" }, + { "KEYS", "137W009", nullptr, nullptr }, + { nullptr, nullptr, nullptr, nullptr } +}; + +static const seriesStreamBreak SERIES1[] = { + { 9, "100_010", 1, 255, -1, 0, 0, 0 }, + { 20, nullptr, 1, 255, 12, 0, 0, 0 }, + STREAM_BREAK_END +}; + +static const seriesPlayBreak PLAY1[] = { + { 0, 24, nullptr, 1, 255, -1, 0, 0, nullptr, 0 }, + { 25, 32, "137_005", 1, 255, -1, 0, 0, nullptr, 0 }, + { 33, 33, nullptr, 1, 255, 16, 0, 0, nullptr, 0 }, + { 34, 40, nullptr, 1, 255, 22, 0, 0, nullptr, 0 }, + { 41, -1, nullptr, 1, 255, 19, 0, 0, nullptr, 0 }, + PLAY_BREAK_END +}; + +static const seriesPlayBreak PLAY2[] = { + { 0, 7, nullptr, 1, 255, -1, 0, 0, nullptr, 0 }, + { 8, 8, nullptr, 1, 255, 17, 0, 0, nullptr, 0 }, + { 9, 13, nullptr, 1, 255, -1, 0, 0, nullptr, 0 }, + { 14, 14, nullptr, 1, 255, 21, 0, 0, nullptr, 0 }, + { 14, 14, "137_006", 1, 255, -1, 0, 0, nullptr, 0 }, + { 15, -1, nullptr, 1, 255, 18, 0, 0, nullptr, 0 }, + PLAY_BREAK_END +}; + +static const seriesPlayBreak PLAY3[] = { + { 0, 11, nullptr, 1, 255, -1, 0, 0, nullptr, 0 }, + { 12, 12, nullptr, 1, 255, 20, 0, 0, nullptr, 0 }, + { 13, -1, "137_007", 1, 255, -1, 0, 0, nullptr, 0 }, + PLAY_BREAK_END +}; + void Room137::init() { _G(player).walker_in_this_scene = true; + player_set_commands_allowed(true); + _G(kernel).call_daemon_every_loop = true; + _volume = 255; + _flag1 = true; + _flag2 = false; + _flag3 = false; + + switch (_G(game).previous_room) { + case RESTORING_GAME: + if (_G(flags)[V048]) + _G(flags)[V048] = 1; + break; + + case 136: + player_set_commands_allowed(false); + _G(wilbur_should) = 3; + kernel_timing_trigger(1, gCHANGE_WILBUR_ANIMATION); + break; + + case 138: + ws_demand_facing(2); + + if (_G(flags)[V048] >= 200) { + ws_demand_location(264, 347); + _flag1 = false; + digi_preload("137_003"); + } else { + ws_demand_location(290, 334); + ws_hide_walker(); + player_set_commands_allowed(false); + _G(wilbur_should) = 1; + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + } + + if (_G(flags)[V048] < 200 && _G(flags)[V048] && _G(flags)[V047] == 4) + _G(flags)[V047] = 5; + break; + + default: + ws_demand_location(183, 216, 8); + break; + } + + _series1 = series_play("137do01", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0); + + const char *NAMES[18] = { + "137_120", "137_021", "137_022", "137_023", "137_024", "137_025", + "137_026", "137_027", "137_028", "137_013", "137_014", "137_026", + "137_027", "137_028", "137_013", "137_014", "137_015", "137_016" + }; + for (int i = 0; i < 18; ++i) + digi_preload(NAMES[i]); + + if (inv_object_in_scene("keys", 138) && _G(flags)[V047] != 2) { + digi_preload("137_001"); + digi_play_loop("137_001", 3); + } else { + digi_preload("137_002"); + digi_play_loop("137_002", 3); + } + + if (_G(flags)[V048] < 200) { + _mode1 = 27; + } else { + _mode1 = _G(flags)[V047] == 2 || _G(flags)[V047] == 3 || _G(flags)[V047] == 4 ? 34 : 27; + digi_play("137_003", 1); + } + + _mode2 = 27; + kernel_trigger_dispatch_now(2); } void Room137::daemon() { -} - -void Room137::pre_parser() { + // TODO } void Room137::parser() { + _G(kernel).trigger_mode = KT_DAEMON; + + if (_G(flags)[V046] && (player_said("gear", "trunk") || player_said("gear", "trunk "))) { + _G(wilbur_should) = 7; + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + + } else if (player_said("conv15")) { + conv15(); + + } else if (_G(walker).wilbur_said(SAID)) { + // Nothing needed + } else if (player_said("LOOK AT", "TRUNK") || player_said("LOOK AT", "TRUNK ")) { + if (!_G(flags)[V046]) { + wilbur_speech("137w005"); + } else { + wilbur_speech(inv_object_is_here("JAWZ O' LIFE") ? "137w006" : "137w007"); + } + } else if (player_said("keys", "trunk")) { + _G(wilbur_should) = 6; + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + + } else if (player_said("take", "jawz o' life") && inv_object_is_here("jawz o' life")) { + _G(wilbur_should) = 8; + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + + } else if ((player_said("take", "keys") || player_said("gear", "keys")) && + !inv_player_has("keys")) { + _G(wilbur_should) = 7; + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + + } else if (player_said("gear", "jawz o' life") && inv_object_is_here("jawz o' life")) { + wilbur_speech("137w011"); + + } else if (player_said("ENTER", "FORK IN THE ROAD") || + player_said("look at", "FORK IN THE ROAD")) { + player_set_commands_allowed(false); + pal_fade_init(1009); + + } else if (player_said("LOOK AT", "CAR WINDOW")) { + _G(wilbur_should) = 35; + player_set_commands_allowed(false); + kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); + } else { + return; + } + + _G(player).command_ready = false; } +void Room137::conv15() { + _G(kernel).trigger_mode = KT_PARSE; + int who = conv_whos_talking(); + int node = conv_current_node(); + int entry = conv_current_entry(); + + if (_G(kernel).trigger == 14) { + if (who <= 0) { + if (node == 7) { + _mode3 = 25; + } else { + _mode3 = 22; + conv_resume_curr(); + } + } else if (who == 1) { + conv_resume_curr(); + } + } else if (conv_sound_to_play()) { + if (who <= 0) { + if (node == 3 || node == 9 || node == 12 || node == 13 || node == 19 || node == 11) + _flag3 = true; + _mode3 = (node == 20 && entry == 1) || (node == 21 && entry == 1) ? 24 : 23; + _digi1 = conv_sound_to_play(); + + } else if (who == 1) { + wilbur_speech(conv_sound_to_play(), 14); + } + } else { + conv_resume_curr(); + } +} + + } // namespace Rooms } // namespace Burger } // namespace M4 diff --git a/engines/m4/burger/rooms/section1/room137.h b/engines/m4/burger/rooms/section1/room137.h index c7f596eac58..4718868882f 100644 --- a/engines/m4/burger/rooms/section1/room137.h +++ b/engines/m4/burger/rooms/section1/room137.h @@ -29,13 +29,25 @@ namespace Burger { namespace Rooms { class Room137 : public Room { +private: + bool _flag1 = false; + bool _flag2 = false; + bool _flag3 = false; + int _volume = 255; + machine *_series1 = nullptr; + int _mode1 = 0; + int _mode2 = 0; + int _mode3 = 0; + const char *_digi1 = nullptr; + + void conv15(); + public: Room137() : Room() {} ~Room137() override {} void init() override; void daemon() override; - void pre_parser() override; void parser() override; }; diff --git a/engines/m4/burger/rooms/section1/room142.cpp b/engines/m4/burger/rooms/section1/room142.cpp index a534bf5fc00..6ae3ca490f6 100644 --- a/engines/m4/burger/rooms/section1/room142.cpp +++ b/engines/m4/burger/rooms/section1/room142.cpp @@ -167,9 +167,9 @@ void Room142::init() { _MATCH.push_back(WilburMatch("LOOK AT", "PARKING LOT", 5, &_G(flags)[V058], 0, &_val2, 13)); _MATCH.push_back(WilburMatch("GEAR", "ICE BOX", gCHANGE_WILBUR_ANIMATION, - &_G(flags)[V059], 0, &_G(roomVal1), 1)); + &_G(flags)[V059], 0, &_G(wilbur_should), 1)); _MATCH.push_back(WilburMatch("TAKE", "FANBELT", gCHANGE_WILBUR_ANIMATION, - nullptr, 0, &_G(roomVal1), 9)); + nullptr, 0, &_G(wilbur_should), 9)); _MATCH.push_back(WilburMatch("GEAR", "BACK DOOR", 6, nullptr, 0, nullptr, 0)); @@ -181,7 +181,7 @@ void Room142::init() { case RESTORING_GAME: if (_G(flags)[V059]) { ws_hide_walker(); - _G(roomVal1) = 2; + _G(wilbur_should) = 2; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } break; @@ -413,11 +413,11 @@ void Room142::daemon() { case gCHANGE_WILBUR_ANIMATION: - switch (_G(roomVal1)) { + switch (_G(wilbur_should)) { case 1: terminateMachineAndNull(_series5); disable_player(); - _G(roomVal1) = 2; + _G(wilbur_should) = 2; series_play_with_breaks(PLAY9, "142wi04", 0xdff, gCHANGE_WILBUR_ANIMATION, 3); break; @@ -436,7 +436,7 @@ void Room142::daemon() { player_set_commands_allowed(false); terminateMachineAndNull(_series6); terminateMachineAndNull(_series7); - _G(roomVal1) = 4; + _G(wilbur_should) = 4; series_play_with_breaks(PLAY11, "142wi04", 0xdff, gCHANGE_WILBUR_ANIMATION, 3); } @@ -454,7 +454,7 @@ void Room142::daemon() { player_set_commands_allowed(false); terminateMachineAndNull(_series6); terminateMachineAndNull(_series7); - _G(roomVal1) = 6; + _G(wilbur_should) = 6; series_play_with_breaks(PLAY10, "142wi02", 0xdff, gCHANGE_WILBUR_ANIMATION, 3); break; @@ -470,7 +470,7 @@ void Room142::daemon() { player_set_commands_allowed(false); terminateMachineAndNull(_series6); terminateMachineAndNull(_series7); - _G(roomVal1) = 8; + _G(wilbur_should) = 8; series_play_with_breaks(PLAY10, "142wi04", 0xdff, gCHANGE_WILBUR_ANIMATION, 3); break; @@ -485,7 +485,7 @@ void Room142::daemon() { case 9: disable_player(); - _G(roomVal1) = 10; + _G(wilbur_should) = 10; series_play_with_breaks(PLAY12, "142wi05", 0x400, gCHANGE_WILBUR_ANIMATION, 3); break; @@ -604,7 +604,7 @@ void Room142::pre_parser() { _G(player).need_to_walk = false; if (player_said("GEAR", "ICE BOX")) { - _G(roomVal1) = 5; + _G(wilbur_should) = 5; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } else if (player_said("ICE")) { if (player_said("LOOK AT")) { @@ -627,7 +627,7 @@ void Room142::pre_parser() { term_message("ERROR - don't know what to do with ice!!!"); } } else { - _G(roomVal1) = 7; + _G(wilbur_should) = 7; kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION); } diff --git a/engines/m4/burger/vars.h b/engines/m4/burger/vars.h index 8256d7e36de..837d0b2a85c 100644 --- a/engines/m4/burger/vars.h +++ b/engines/m4/burger/vars.h @@ -100,7 +100,7 @@ public: bool _menuSystemInitialized = false; bool _gameMenuFromMain = false; int _room902Flag = 0; - int _roomVal1 = 0; + int _wilbur_should = 0; int _roomVal2 = 0; int _roomVal3 = 0; int _walkTrigger = 0;