Initial commit
This commit is contained in:
848
engines/m4/burger/rooms/section1/room101.cpp
Normal file
848
engines/m4/burger/rooms/section1/room101.cpp
Normal file
@@ -0,0 +1,848 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room101.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/core/imath.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS1[] = {
|
||||
{ 0, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 5, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 14, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 16, nullptr, 1, 255, 11, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS2[] = {
|
||||
{ 0, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 6, nullptr, 2, 255, 5, 0, nullptr, 0 },
|
||||
{ 17, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 24, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 26, nullptr, 1, 255, 14, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS3[] = {
|
||||
{ 0, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 5, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 14, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 16, nullptr, 1, 255, 17, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS4[] = {
|
||||
{ 0, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 7, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 13, nullptr, 1, 255, 20, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS5[] = {
|
||||
{ 0, "100_010", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 19, "100_011", 1, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak STREAM_BREAKS6[] = {
|
||||
{ 9, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 19, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 28, nullptr, 2, 255, 4, 0, nullptr, 0 },
|
||||
{ 32, nullptr, 1, 255, 8, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY_BREAKS1[] = {
|
||||
{ 0, 10, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 11, -1, "101_004", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY_BREAKS2[] = {
|
||||
{ 0, 2, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, -1, "102_038", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY_BREAKS3[] = {
|
||||
{ 0, 8, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 9, -1, "101_002", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY_BREAKS4[] = {
|
||||
{ 0, 6, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 9, "101w005", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 10, -1, nullptr, 1, 255, kCHANGE_WILBUR_ANIMATION, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const char *SAID1[][4] = {
|
||||
{ "BARBERSHOP", nullptr, "101W003", "101W003" },
|
||||
{ "DOOR", "101W006", nullptr, nullptr },
|
||||
{ "FIRE ESCAPE", "101W004", nullptr, nullptr },
|
||||
{ "TOWN HALL", nullptr, "101W003", nullptr },
|
||||
{ "ALLEY", nullptr, "101W003", nullptr },
|
||||
{ "VERA'S DINER", nullptr, "101W003", nullptr },
|
||||
{ "OLD BRIDGE", nullptr, "101W003", nullptr },
|
||||
{ "HARDWARE STORE", "101W006b", "101W003", "101W003" },
|
||||
{ "BANK", "101W007", "101W003", "101W003" },
|
||||
{ "THEATRE", "101W008", "101W003", "101W003" },
|
||||
{ "POLICE STATION", "101W009", "101W003", "101W003" },
|
||||
{ "PET AND FEED STORE", "101W010", "101W003", "101W011" },
|
||||
{ "FIRE STATION", "101W012", "101W003", "101W003" },
|
||||
{ "FIRE HYDRANT", "101W013", "101W003", nullptr },
|
||||
{ "PICKUP TRUCK", "101W015", "101W003", "101W016" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
void Room101::init() {
|
||||
_val1 = 255;
|
||||
|
||||
digi_stop(1);
|
||||
digi_preload("101_001");
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
|
||||
if (_G(game).previous_room != 102)
|
||||
door();
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
// Do nothing
|
||||
break;
|
||||
|
||||
case 102:
|
||||
// Exiting barber shop
|
||||
player_set_commands_allowed(false);
|
||||
if (_G(flags)[V014]) {
|
||||
_G(flags)[V014] = 0;
|
||||
ws_demand_facing(_G(my_walker), 10);
|
||||
ws_demand_location(_G(my_walker), 338, 265);
|
||||
_G(wilbur_should) = 16;
|
||||
|
||||
} else {
|
||||
ws_demand_facing(_G(my_walker), 4);
|
||||
ws_demand_location(_G(my_walker), 264, 259);
|
||||
_G(wilbur_should) = 10;
|
||||
}
|
||||
|
||||
ws_hide_walker(_G(my_walker));
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 103:
|
||||
// Returning from rooftop
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_facing(_G(my_walker), 1);
|
||||
ws_demand_location(_G(my_walker), 197, 276);
|
||||
ws_hide_walker(_G(my_walker));
|
||||
|
||||
_G(wilbur_should) = 6;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 104:
|
||||
// From Town Hall
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 106:
|
||||
// Leaving alley
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 134:
|
||||
case 135:
|
||||
// From Old Bridge
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 142:
|
||||
// From Vera's Diner
|
||||
_G(wilbur_should) = 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Have been beamed down
|
||||
ws_demand_location(_G(my_walker), 320, 271);
|
||||
ws_demand_facing(_G(my_walker), 5);
|
||||
|
||||
if (_G(game).previous_section > 1) {
|
||||
if (_G(flags)[kFirstTestPassed]) {
|
||||
ws_demand_location(_G(my_walker), 280, 309);
|
||||
ws_demand_facing(_G(my_walker), 8);
|
||||
player_set_commands_allowed(false);
|
||||
}
|
||||
|
||||
kernel_timing_trigger(60, 6);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
digi_play_loop("101_001", 3, 200, -1);
|
||||
}
|
||||
|
||||
void Room101::daemon() {
|
||||
if (player_commands_allowed() && _G(player).walker_visible && INTERFACE_VISIBLE) {
|
||||
player_update_info(_G(my_walker), &_G(player_info));
|
||||
|
||||
if (_G(player_info).y > 374 && player_said("old bridge")) {
|
||||
// Changing to Old Bridge
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, GOTO_OLD_BRIDGE);
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
|
||||
} else if (_G(player_info.y < 205) && player_said("town hall")) {
|
||||
// Changing to Town Hall
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), 16, 255, 0, 30, GOTO_TOWN_HALL);
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
if (_val2 == 12) {
|
||||
const int frame = imath_ranged_rand(8, 10);
|
||||
series_play("101ha01", 3840, 0, 1, 6, 0, 100, 0, 0, frame, frame);
|
||||
} else {
|
||||
digi_preload("101_002");
|
||||
series_play("101ha01", 3840, 0, 21, 6, 0, 100, 0, 0, 11, 13);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Finished gathering items from past tests
|
||||
digi_stop(2);
|
||||
unloadSounds();
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker(_G(my_walker));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
digi_play(Common::String::format("101_0%d", imath_ranged_rand(10, 17)).c_str(), 2, 255, -1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
digi_play("101_017", 2, 255, -1);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (!_G(flags)[kFirstTestPassed]) {
|
||||
// No tests passed yet
|
||||
const uint idx = _G(flags)[kNEURO_TEST_COUNTER];
|
||||
assert(idx < 8);
|
||||
|
||||
static const char *const NAMES[8] = {
|
||||
"101w500", "101w500", "101w501", "101w502",
|
||||
"101w503", "101w504", "101w505", "101w506"
|
||||
};
|
||||
|
||||
_G(walker).wilbur_speech(NAMES[idx], 23);
|
||||
|
||||
} else if (!_G(flags)[kSecondTestPassed]) {
|
||||
// Second test failed
|
||||
if (_G(flags)[V242] <= 1) {
|
||||
// Oh well, at least I passed the first test
|
||||
_G(walker).wilbur_speech("101w520", 7);
|
||||
|
||||
} else if (_G(flags)[V249] && !_G(flags)[kKnowHowToNukeGerbils]) {
|
||||
// I know how to nuke those mutant gerbils
|
||||
_G(walker).wilbur_speech("101w522", 7);
|
||||
_G(flags)[kKnowHowToNukeGerbils] = 1;
|
||||
|
||||
} else if (_G(flags)[V248] && !_G(flags)[kGerbilsAreNasty]) {
|
||||
// Those mutant gerbils are nasty
|
||||
_G(walker).wilbur_speech("101w521", 7);
|
||||
_G(flags)[kGerbilsAreNasty] = 1;
|
||||
|
||||
} else {
|
||||
// Sigh...
|
||||
_G(walker).wilbur_speech("101w524", 7);
|
||||
}
|
||||
} else if (!_G(flags)[kThirdTestPassed]) {
|
||||
// Third test failed
|
||||
if (_G(flags)[V100] <= 1) {
|
||||
_G(walker).wilbur_speech("101w530", 7);
|
||||
} else if (!_G(flags)[V113] && !_G(flags)[kGetRidOfPerkins]) {
|
||||
// Need to get rid of Perkins
|
||||
_G(walker).wilbur_speech("101w531", 7);
|
||||
_G(flags)[kGetRidOfPerkins] = 1;
|
||||
} else if (_G(flags)[V113] && !_G(flags)[kNeedToFindBurger]) {
|
||||
// Gotten rid of Perkins, need to find burger
|
||||
_G(walker).wilbur_speech("101w533", 7);
|
||||
_G(flags)[kNeedToFindBurger] = 1;
|
||||
} else if (_G(flags)[V113] && _G(flags)[V100] >= 5 &&
|
||||
!_G(flags)[kAmplifyMySenses]) {
|
||||
// Amplify my senses? Hmmm..
|
||||
_G(walker).wilbur_speech("101w534", 7);
|
||||
_G(flags)[kAmplifyMySenses] = 1;
|
||||
} else {
|
||||
_G(walker).wilbur_speech("101w532", 7);
|
||||
}
|
||||
} else if (!_G(flags)[kFourthTestPassed]) {
|
||||
// Fourth test failed
|
||||
switch (_G(flags)[V185]) {
|
||||
case 0:
|
||||
case 1:
|
||||
_G(walker).wilbur_speech("101w550", 7);
|
||||
break;
|
||||
case 2:
|
||||
_G(walker).wilbur_speech("101w552", 7);
|
||||
break;
|
||||
default:
|
||||
if (_G(flags)[V194] && !_G(flags)[ROOM101_FLAG19]) {
|
||||
_G(walker).wilbur_speech("101w551", 7);
|
||||
_G(flags)[ROOM101_FLAG19] = 1;
|
||||
} else {
|
||||
kernel_timing_trigger(60, 7);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (!_G(flags)[kFifthTestPassed]) {
|
||||
// Fifth test failed
|
||||
switch (_G(flags)[V153]) {
|
||||
case 0:
|
||||
case 1:
|
||||
_G(walker).wilbur_speech("101w570", 7);
|
||||
break;
|
||||
case 2:
|
||||
_G(walker).wilbur_speech("101w571", 7);
|
||||
break;
|
||||
default:
|
||||
kernel_timing_trigger(60, 7);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
kernel_trigger_dispatch_now(7);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
loadSounds();
|
||||
ws_hide_walker(_G(my_walker));
|
||||
|
||||
if (_G(flags)[kSecondTestPassed] || _G(flags)[kFourthTestPassed])
|
||||
series_load("101wi13s", -1, nullptr);
|
||||
if (_G(flags)[kThirdTestPassed])
|
||||
series_load("101wi12s", -1, nullptr);
|
||||
if (_G(flags)[kFifthTestPassed])
|
||||
series_load("101wi11s", -1, nullptr);
|
||||
|
||||
_machine1 = series_play("101wi14s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
|
||||
_machine2 = series_stream_with_breaks(STREAM_BREAKS6, "101wi14", 6, 0x100, 2);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
kernel_timing_trigger(1, 9);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
daemon9();
|
||||
|
||||
if (_G(flags)[kSecondTestPassed] || _G(flags)[V250] ||
|
||||
_G(flags)[V280] || _G(flags)[V002]) {
|
||||
terminateMachineAndNull(_machine1);
|
||||
terminateMachineAndNull(_machine2);
|
||||
kernel_trigger_dispatch_now(10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_machine1 = series_play("101wi13s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
|
||||
_machine2 = series_stream_with_breaks(STREAM_BREAKS1, "101wi13", 6, 0x100, 2);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
kernel_timing_trigger(1, 12);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
daemon12();
|
||||
|
||||
if (_G(flags)[kSecondTestPassed]) {
|
||||
if (_G(flags)[kThirdTestPassed] || _G(flags)[kPerkinsLostIsland] ||
|
||||
_G(flags)[V080] || _G(flags)[V126]) {
|
||||
terminateMachineAndNull(_machine1);
|
||||
terminateMachineAndNull(_machine2);
|
||||
kernel_timing_trigger(1, 13);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_machine1 = series_play("101wi12s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
|
||||
_machine2 = series_stream_with_breaks(STREAM_BREAKS2, "101wi12", 6, 0x100, 2);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
kernel_timing_trigger(1, 15);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
daemon15();
|
||||
|
||||
if (_G(flags)[kThirdTestPassed] && (_G(flags)[kFourthTestPassed] || _G(flags)[V220])) {
|
||||
terminateMachineAndNull(_machine1);
|
||||
terminateMachineAndNull(_machine2);
|
||||
kernel_timing_trigger(1, 16);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
_machine1 = series_play("101wi13s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
|
||||
_machine2 = series_stream_with_breaks(STREAM_BREAKS3, "101wi13", 6, 0x100, 2);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
kernel_timing_trigger(1, 18);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
daemon18();
|
||||
|
||||
if (_G(flags)[kFourthTestPassed]) {
|
||||
if (_G(flags)[kFifthTestPassed] || _G(flags)[V220]) {
|
||||
terminateMachineAndNull(_machine1);
|
||||
terminateMachineAndNull(_machine2);
|
||||
kernel_timing_trigger(1, 19);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_machine1 = series_play("101wi11s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, -1);
|
||||
_machine2 = series_stream_with_breaks(STREAM_BREAKS4, "101wi11", 6, 0x100, 2);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
daemon20();
|
||||
break;
|
||||
|
||||
case 21:
|
||||
digi_play("101_002", 2, 255, -1);
|
||||
_G(wilbur_should) = 18;
|
||||
series_play("101ha01", 3840, 0, kCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 14, -1);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
if (_G(player_info).x < 218 || (_G(player_info).x < 349 && _G(player_info).y > 277)) {
|
||||
kernel_trigger_dispatch_now(27);
|
||||
} else {
|
||||
digi_preload_stream_breaks(STREAM_BREAKS5);
|
||||
series_stream_with_breaks(STREAM_BREAKS5, "101dt01", 6, 1024, 25);
|
||||
}
|
||||
break;
|
||||
|
||||
case 25:
|
||||
_val1 -= 10;
|
||||
if (_val1 > 0) {
|
||||
digi_change_volume(2, _val1);
|
||||
kernel_timing_trigger(3, 25);
|
||||
} else {
|
||||
digi_stop(1);
|
||||
digi_unload_stream_breaks(STREAM_BREAKS5);
|
||||
digi_stop(2);
|
||||
digi_unload("100_013");
|
||||
player_set_commands_allowed(true);
|
||||
_val1 = 255;
|
||||
}
|
||||
break;
|
||||
|
||||
case 26:
|
||||
door();
|
||||
_G(walker).reset_walker_sprites();
|
||||
digi_preload_stream_breaks(STREAM_BREAKS5);
|
||||
series_stream_with_breaks(STREAM_BREAKS5, "101dt01", 6, 1, 25);
|
||||
break;
|
||||
|
||||
case 27:
|
||||
terminateMachineAndNull(_doorMachine);
|
||||
Section1::updateWalker(226, 281, 8, 26);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 2:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(_G(my_walker), 336, 184);
|
||||
ws_demand_facing(_G(my_walker), 5);
|
||||
ws_walk(_G(my_walker), 335, 195, nullptr, -1, 5);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(_G(my_walker), 482, 208);
|
||||
ws_demand_facing(_G(my_walker), 9);
|
||||
ws_walk(_G(my_walker), 410, 218, nullptr, -1, 9);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(_G(my_walker), 224, 373);
|
||||
ws_demand_facing(_G(my_walker), 2);
|
||||
ws_walk(_G(my_walker), 282, 342, nullptr, -1, 2);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(_G(my_walker), 0, 288);
|
||||
ws_demand_facing(_G(my_walker), 3);
|
||||
ws_walk(_G(my_walker), 30, 288, nullptr, -1, 3);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_G(wilbur_should) = 7;
|
||||
series_play_with_breaks(PLAY_BREAKS1, "101wi05", 0x100, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ws_unhide_walker(_G(my_walker));
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
// Barbershop door open
|
||||
_G(wilbur_should) = 9;
|
||||
terminateMachineAndNull(_doorMachine);
|
||||
series_play_with_breaks(PLAY_BREAKS2, "101wi01", 3072, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
// Fade out for switching to Barbershop
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1002);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_G(wilbur_should) = 11;
|
||||
series_play_with_breaks(PLAY_BREAKS3, "101wi02", 0x100, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 18:
|
||||
door();
|
||||
ws_unhide_walker(_G(my_walker));
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
terminateMachineAndNull(_doorMachine);
|
||||
_G(wilbur_should) = 15;
|
||||
series_play_with_breaks(PLAY_BREAKS2, "101wi01", 3072, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
_G(wilbur_should) = 16;
|
||||
digi_play("101h001", 1, 255, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
_G(wilbur_should) = 17;
|
||||
series_play_with_breaks(PLAY_BREAKS2, "101wi03", 3072, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_G(wilbur_should) = 19;
|
||||
_val2 = 12;
|
||||
|
||||
if (_G(flags)[V005]) {
|
||||
const Common::String name = Common::String::format("101h003%c", 'a' + imath_ranged_rand(0, 5));
|
||||
digi_play(name.c_str(), 1, 255, kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
digi_play("101h002", 1, 255, kCHANGE_WILBUR_ANIMATION);
|
||||
_G(flags)[V005] = 1;
|
||||
}
|
||||
|
||||
series_play("101ha01", 3840, 0, 1, 6, 0, 100, 0, 0, 0, 7);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_val2 = 13;
|
||||
break;
|
||||
|
||||
case 20:
|
||||
_G(wilbur_should) = 21;
|
||||
series_play_with_breaks(PLAY_BREAKS4, "101wi04", 0x100, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, -53);
|
||||
break;
|
||||
|
||||
case 21:
|
||||
_G(wilbur_should) = 22;
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1003);
|
||||
break;
|
||||
|
||||
case 22:
|
||||
series_play("101wi04", 0x100, 0, -1, 10, -1, 100, 0, -53, 16, 16);
|
||||
series_play("101wi04s", 0x100, 0, -1, 10, -1, 100, 0, -53, 16, 16);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlEntersTown:
|
||||
if (_G(flags)[kRoadOpened]) {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
|
||||
} else if (player_commands_allowed() && _G(player).walker_visible &&
|
||||
INTERFACE_VISIBLE && !digi_play_state(1)) {
|
||||
Section1::updateDisablePlayer();
|
||||
digi_preload("100_013");
|
||||
digi_play("100_013", 2, 255, -1);
|
||||
kernel_timing_trigger(240, 24);
|
||||
} else {
|
||||
kernel_timing_trigger(60, kBurlEntersTown);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room101::pre_parser() {
|
||||
const bool lookAt = player_said_any("look", "look at");
|
||||
|
||||
if (player_said("vera's diner") && !player_said_any("enter", "gear", "look", "look at"))
|
||||
player_hotspot_walk_override_just_face(9);
|
||||
|
||||
if (player_said("alley") && !player_said_any("enter", "gear", "look", "look at"))
|
||||
player_hotspot_walk_override_just_face(3);
|
||||
|
||||
_G(kernel).call_daemon_every_loop = player_said("ENTER", "OLD BRIDGE") ||
|
||||
player_said("gear", "old bridge") ||
|
||||
player_said("old bridge") ||
|
||||
player_said("ENTER", "TOWN HALL") ||
|
||||
player_said("gear", "town hall") ||
|
||||
(lookAt && player_said("town hall"));
|
||||
}
|
||||
|
||||
void Room101::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID1)) {
|
||||
// Nothing
|
||||
} else if (player_said("ENTER", "DOOR") || player_said("gear", "door")) {
|
||||
if (_G(flags)[V012] == 2) {
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker(_G(my_walker));
|
||||
_G(wilbur_should) = 8;
|
||||
kernel_trigger_dispatch_now(kCHANGE_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(wilbur_should) = 14;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker(_G(my_walker));
|
||||
_G(wilbur_should) = 8;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
|
||||
} else if (player_said("ENTER", "FIRE ESCAPE") || player_said("gear", "fire escape")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 20;
|
||||
ws_hide_walker(_G(my_walker));
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
|
||||
} else if (player_said("ENTER", "TOWN HALL") || player_said("gear", "town hall") ||
|
||||
(lookFlag && player_said("town hall"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1004);
|
||||
|
||||
} else if (player_said("ENTER", "ALLEY") || player_said("gear", "alley") ||
|
||||
(lookFlag && player_said("alley"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1006);
|
||||
|
||||
} else if (player_said("ENTER", "OLD BRIDGE") || player_said("gear", "old bridge") ||
|
||||
(lookFlag && player_said("old bridge"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1008);
|
||||
|
||||
} else if (player_said("ENTER", "VERA'S DINER") || player_said("gear", "vera's diner") ||
|
||||
(lookFlag && player_said("vera's diner"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1014);
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) &&
|
||||
player_said_any("alley", "town hall", "vera's diner", "old bridge")) {
|
||||
_G(walker).wilbur_speech("101w003");
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) && player_said("fire hydrant")) {
|
||||
_G(walker).wilbur_speech("101w014");
|
||||
|
||||
} else if (lookFlag && player_said("barbershop")) {
|
||||
_G(walker).wilbur_speech(_G(flags)[V013] ? "101w002" : "101w001");
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room101::door() {
|
||||
_doorMachine = series_play("101door", 3840, 0, -1, 10, -1, 100, 0, -53, 0, 0);
|
||||
}
|
||||
|
||||
void Room101::loadSounds() {
|
||||
digi_preload("101_010");
|
||||
digi_preload("101_011");
|
||||
digi_preload("101_012");
|
||||
digi_preload("101_013");
|
||||
digi_preload("101_014");
|
||||
digi_preload("101_015");
|
||||
digi_preload("101_016");
|
||||
digi_preload("101_017");
|
||||
}
|
||||
|
||||
void Room101::unloadSounds() {
|
||||
digi_unload("101_010");
|
||||
digi_unload("101_011");
|
||||
digi_unload("101_012");
|
||||
digi_unload("101_013");
|
||||
digi_unload("101_014");
|
||||
digi_unload("101_015");
|
||||
digi_unload("101_016");
|
||||
digi_unload("101_017");
|
||||
}
|
||||
|
||||
void Room101::daemon9() {
|
||||
_G(flags)[V019] = 1;
|
||||
_G(flags)[V017] = 1;
|
||||
|
||||
if (_G(flags)[V021] == 10032)
|
||||
_G(flags)[V001] = 12;
|
||||
|
||||
if (_G(flags)[V021] == 10033)
|
||||
_G(flags)[V013] = 1;
|
||||
|
||||
_G(flags).set_boonsville_time(600);
|
||||
}
|
||||
|
||||
void Room101::daemon12() {
|
||||
if (_G(flags)[V250] || _G(flags)[kSecondTestPassed])
|
||||
inv_give_to_player("BLOCK OF ICE");
|
||||
|
||||
if (_G(flags)[V280] || _G(flags)[kSecondTestPassed])
|
||||
inv_give_to_player("PANTYHOSE");
|
||||
|
||||
if (_G(flags)[V002]) {
|
||||
inv_give_to_player("PHONE BILL");
|
||||
inv_give_to_player("WHISTLE");
|
||||
_G(flags)[V079] = 0;
|
||||
_G(flags)[V080] = 1;
|
||||
}
|
||||
|
||||
_G(flags).set_boonsville_time(2400);
|
||||
}
|
||||
|
||||
void Room101::daemon15() {
|
||||
if (_G(flags)[V002] || !_G(flags)[V126] || _G(flags)[kThirdTestPassed]) {
|
||||
inv_give_to_player("PHONE BILL");
|
||||
inv_give_to_player("WHISTLE");
|
||||
_G(flags)[V079] = 0;
|
||||
_G(flags)[V080] = 1;
|
||||
} else {
|
||||
_G(flags)[V079] = 1;
|
||||
_G(flags)[V080] = 0;
|
||||
}
|
||||
|
||||
if (_G(flags)[V126] || _G(flags)[kThirdTestPassed]) {
|
||||
inv_give_to_player("CARROT JUICE");
|
||||
_G(flags)[V088] = 1;
|
||||
_G(flags)[V091] = 1;
|
||||
} else {
|
||||
_G(flags)[V088] = 0;
|
||||
_G(flags)[V091] = 0;
|
||||
}
|
||||
|
||||
if (_G(flags)[V113] || _G(flags)[kThirdTestPassed]) {
|
||||
_G(flags).set_boonsville_time(6001);
|
||||
_G(flags)[V000] = 1002;
|
||||
_G(flags)[V001] = 0;
|
||||
inv_move_object("MONEY", NOWHERE);
|
||||
_G(flags)[V039] = 1;
|
||||
_G(flags)[kRoadOpened] = 1;
|
||||
inv_give_to_player("DEED");
|
||||
_G(flags)[kPerkinsLostIsland] = 1;
|
||||
} else {
|
||||
_G(flags)[V000] = 1000;
|
||||
if (_G(flags)[V021] == 10032)
|
||||
_G(flags)[V001] = 12;
|
||||
|
||||
_G(flags)[V039] = 0;
|
||||
_G(flags)[kRoadOpened] = 0;
|
||||
_G(flags)[kTourBusAtDiner] = 0;
|
||||
}
|
||||
|
||||
_G(flags)[V063] = 0;
|
||||
_G(flags)[V092] = 0;
|
||||
|
||||
if (_G(flags)[kThirdTestPassed])
|
||||
_G(flags).set_boonsville_time(6600);
|
||||
}
|
||||
|
||||
void Room101::daemon18() {
|
||||
if (_G(flags)[V220] || _G(flags)[kFourthTestPassed]) {
|
||||
inv_give_to_player("laxative");
|
||||
inv_give_to_player("amplifier");
|
||||
_G(flags)[kDrumzFled] = 1;
|
||||
_G(flags)[kTourBusAtDiner] = 1;
|
||||
_G(flags).set_boonsville_time(19200);
|
||||
}
|
||||
}
|
||||
|
||||
void Room101::daemon20() {
|
||||
if (_G(flags)[V177] || _G(flags)[kFifthTestPassed]) {
|
||||
inv_move_object("KEYS", 138);
|
||||
inv_give_to_player("JAWZ O' LIFE");
|
||||
_G(flags)[V046] = 0;
|
||||
}
|
||||
|
||||
_G(flags)[kPoliceState] = 0;
|
||||
_G(flags)[kPoliceCheckCtr] = 0;
|
||||
_G(flags).set_boonsville_time(22800);
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
62
engines/m4/burger/rooms/section1/room101.h
Normal file
62
engines/m4/burger/rooms/section1/room101.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM101_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM101_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room101 : public Room {
|
||||
private:
|
||||
int _val1 = 0;
|
||||
int _val2 = 0;
|
||||
machine *_doorMachine = nullptr;
|
||||
machine *_machine1 = nullptr;
|
||||
machine *_machine2 = nullptr;
|
||||
|
||||
void door();
|
||||
void loadSounds();
|
||||
void unloadSounds();
|
||||
void daemon9();
|
||||
void daemon12();
|
||||
void daemon15();
|
||||
void daemon18();
|
||||
void daemon20();
|
||||
|
||||
public:
|
||||
Room101() : Room() {}
|
||||
~Room101() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1710
engines/m4/burger/rooms/section1/room102.cpp
Normal file
1710
engines/m4/burger/rooms/section1/room102.cpp
Normal file
File diff suppressed because it is too large
Load Diff
90
engines/m4/burger/rooms/section1/room102.h
Normal file
90
engines/m4/burger/rooms/section1/room102.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM102_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM102_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room102 : public Room {
|
||||
private:
|
||||
int _val1 = 0;
|
||||
int _val3 = -1;
|
||||
int32 _val4 = 0;
|
||||
int _val5 = 0;
|
||||
int _val6 = 0;
|
||||
int _val8 = 0;
|
||||
int _val9 = 0;
|
||||
uint32 _val10 = 99999;
|
||||
int _harryMode = 0;
|
||||
int _harryShould = 0;
|
||||
int _wilburChairShould = 0;
|
||||
int _wilburChairMode = 0;
|
||||
int _val16 = 0;
|
||||
int _trigger = -1;
|
||||
KernelTriggerType _triggerMode = KT_DAEMON;
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series1s = nullptr;
|
||||
machine *_series3 = nullptr;
|
||||
Series _wilburChair;
|
||||
machine *_series6 = nullptr;
|
||||
machine *_series7 = nullptr;
|
||||
machine *_laz1 = nullptr;
|
||||
machine *_laz2 = nullptr;
|
||||
machine *_stream1 = nullptr;
|
||||
int _index1 = 0, _index2 = 0;
|
||||
int _index3 = 0, _index4 = 0;
|
||||
int _index5 = 0;
|
||||
const char *_play1 = nullptr;
|
||||
bool _flag1 = false;
|
||||
|
||||
void setup(int val1 = 0, int val2 = 1);
|
||||
void setupWax();
|
||||
void setupLaz();
|
||||
const char *getDigi1(int num) const;
|
||||
const char *getDigi2(int num) const;
|
||||
void freeWilburChair();
|
||||
void queuePlay(const char *filename, int trigger = 29, KernelTriggerType triggerMode = KT_DAEMON);
|
||||
void freshen();
|
||||
void conv04();
|
||||
void conv05();
|
||||
void conv06();
|
||||
void flagAction(const char *name1, const char *name2);
|
||||
|
||||
public:
|
||||
Room102() : Room() {}
|
||||
~Room102() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
684
engines/m4/burger/rooms/section1/room103.cpp
Normal file
684
engines/m4/burger/rooms/section1/room103.cpp
Normal file
@@ -0,0 +1,684 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room103.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_CROW1_ANIMATION = 10,
|
||||
kCHANGE_CROW2_ANIMATION = 11,
|
||||
kCHANGE_CROW3_ANIMATION = 12,
|
||||
kCHANGE_CROW4_ANIMATION = 13,
|
||||
kCHANGE_HARRY_ANIMATION = 20
|
||||
};
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "SATELLITE DISH", "103W001", "103W002", nullptr },
|
||||
{ "FIRE ESCAPE", "103W005", "103W006", nullptr },
|
||||
{ "SCARECROW", "103W008", "103W009", "103W009" },
|
||||
{ "DOOR", "103W010", "103W011", nullptr },
|
||||
{ "STAIRWAY", "103W010", "103W011", nullptr },
|
||||
{ "AIR VENT", "103W013", "103W014", "103W015" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room103::SERIES1[] = {
|
||||
{ 0, "103_004", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 5, nullptr, 2, 255, -1, 2048, nullptr, 0 },
|
||||
{ 7, "103_007", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room103::SERIES2[] = {
|
||||
{ 13, "103_006", 2, 125, -1, 0, nullptr, 0 },
|
||||
{ 19, nullptr, 1, 125, 6, 0, nullptr, 0 },
|
||||
{ 54, nullptr, 1, 125, 16, 0, nullptr, 0 },
|
||||
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room103::SERIES3[] = {
|
||||
{ 5, "103_005", 2, 255, -1, 0, &_val0, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room103::SERIES4[] = {
|
||||
{ 7, "103_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 1, 15, nullptr, 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 16, -1, "103_004", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 0, "103_002", 2, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, 2, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, "103_002", 2, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, "103_002", 2, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, 2, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, "103_002", 2, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, 2, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, 2, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY4[] = {
|
||||
{ 0, 0, "103_006", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 5, "103h006", 1, 255, 23, 0, 0, nullptr, 0 },
|
||||
{ 6, 11, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
int32 Room103::_val0 = 0;
|
||||
|
||||
void Room103::init() {
|
||||
_flag1 = false;
|
||||
_val2 = 0;
|
||||
_val3 = 0;
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
// WORKAROUND: If you save a game after moving the satellite dish, but before Harry arrives,
|
||||
// restoring the save wouldn't have Harry arrive, and you'd softlock trying to leave the roof
|
||||
_G(flags)[kHarryComingToRoof] = 0;
|
||||
break;
|
||||
|
||||
case 101:
|
||||
ws_demand_location(327, 178, 7);
|
||||
_G(flags)[V012] = 0;
|
||||
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 1;
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_play("103wi01s", 0x100);
|
||||
series_stream_with_breaks(SERIES1, "103wi01", 6, 0xa00, 10016);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(320, 271, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_G(flags)[kHarryComingToRoof]) {
|
||||
_series1 = series_play("103wi06", 0x500, 0, -1, 100, -1, 100, 0, 0, 0, 0);
|
||||
} else {
|
||||
_series1 = series_play("103wi05", 0x500, 0, -1, 100, -1, 100, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
_series2 = series_play("103door", 0x800, 0, -1, 100, -1, 100, 0, 0, 0, 0);
|
||||
series_play("103vent", 0x100, 0, -1, 6, -1, 100, 0, 0, 0, 3);
|
||||
|
||||
_crow1Should = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_CROW1_ANIMATION);
|
||||
_crow3Should = 19;
|
||||
kernel_trigger_dispatch_now(kCHANGE_CROW3_ANIMATION);
|
||||
_crow4Should = 21;
|
||||
kernel_trigger_dispatch_now(kCHANGE_CROW4_ANIMATION);
|
||||
|
||||
digi_play_loop("103_001", 3, 60);
|
||||
}
|
||||
|
||||
void Room103::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
term_message("death timer");
|
||||
|
||||
if (_flag1) {
|
||||
term_message("++");
|
||||
|
||||
if (++_val7 < 5 || (_val2 != 0 && _val2 != 2)) {
|
||||
kernel_timing_trigger(60, 1);
|
||||
|
||||
} else if (_val2 == 2) {
|
||||
kernel_timing_trigger(1, 3);
|
||||
player_set_commands_allowed(false);
|
||||
_flag1 = false;
|
||||
term_message("left");
|
||||
|
||||
} else if (player_commands_allowed() && _G(player).walker_visible && INTERFACE_VISIBLE) {
|
||||
term_message("caught");
|
||||
kernel_timing_trigger(1, 8);
|
||||
intr_freshen_sentence();
|
||||
Section1::walk();
|
||||
player_set_commands_allowed(false);
|
||||
_flag1 = false;
|
||||
|
||||
} else {
|
||||
term_message("again");
|
||||
kernel_timing_trigger(60, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (++_val0 >= 5) {
|
||||
static const char *NAMES[7] = {
|
||||
"103h002a", "103h002b", "103h002c", "103h002d",
|
||||
"103h002e", "103h002f", "103h002g"
|
||||
};
|
||||
assert(_digi1 >= 1 && _digi1 <= 7);
|
||||
digi_play(NAMES[_digi1 - 1], 2, 255, 1);
|
||||
} else {
|
||||
kernel_timing_trigger(60, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
terminateMachineAndNull(_series2);
|
||||
series_load("103ha03");
|
||||
series_load("103ha03s");
|
||||
digi_preload("103H005");
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
series_play("103ha01s", 0x201);
|
||||
series_stream_with_breaks(SERIES2, "103ha01", 6, 0x200, 4);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
digi_unload_stream_breaks(SERIES2);
|
||||
series_play_with_breaks(PLAY2, "103ha03", 0x200, 9, 3, 12);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
digi_play("103H005", 1, 255, 7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_G(flags)[kHarryComingToRoof] = 0;
|
||||
_G(flags)[V009] = _G(flags).get_boonsville_time_and_display() + 1800;
|
||||
_G(flags)[V012] = 2;
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1001);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
player_update_info();
|
||||
digi_stop(1);
|
||||
|
||||
if ((_G(player_info).x > 391 && _G(player_info).y < 321) ||
|
||||
(_G(player_info).x > 490 && _G(player_info).y < 374) ||
|
||||
(_G(player_info).x > 215 && _G(player_info).y < 267) ||
|
||||
(_G(player_info).y < 224)) {
|
||||
ws_walk(271, 265, nullptr, 19, 2);
|
||||
term_message("walk to caught");
|
||||
|
||||
} else {
|
||||
kernel_timing_trigger(1, 19);
|
||||
term_message("don't walk to caught");
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
series_play_with_breaks(PLAY3, "103ha03", 0x201, 9, 3, 12);
|
||||
series_play_with_breaks(PLAY2, "103ha03", 0x200, 9, 3, 12);
|
||||
break;
|
||||
|
||||
case kCHANGE_CROW1_ANIMATION:
|
||||
switch (_crow1Should) {
|
||||
case 12:
|
||||
if (imath_ranged_rand(1, 3) == 1) {
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
} else {
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 60, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
switch (imath_ranged_rand(1, 8)) {
|
||||
case 1:
|
||||
_crow1Should = 12;
|
||||
Series::series_play("103cr01", 0x100, 2, kCHANGE_CROW1_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 6, 0, 100, 0, 0, 7, 15);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
_crow1Should = 14;
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 30, 0, 100, 0, 0, 3, 4);
|
||||
break;
|
||||
|
||||
default:
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 60, 0, 100, 0, 0, 2, 2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_crow1Should = 13;
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 6, 0, 100, 0, 0, 5, 15);
|
||||
} else {
|
||||
Series::series_play("103cr01", 0x100, 0, kCHANGE_CROW1_ANIMATION, 60, 0, 100, 0, 0, 4, 4);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_CROW2_ANIMATION:
|
||||
switch (_crow2Should) {
|
||||
case 15:
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_crow2Should = 16;
|
||||
series_play("103cr02", 0x100, 0, kCHANGE_CROW2_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
series_play("103cr02s", 0x100, 0, -1, 30, 0, 100, 0, 0, 1, 2);
|
||||
} else {
|
||||
series_play("103cr02", 0x100, 0, kCHANGE_CROW2_ANIMATION, 70, 0, 100, 0, 0, 0, 0);
|
||||
series_play("103cr02s", 0x100, 0, -1, 70, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
switch (imath_ranged_rand(1, 5)) {
|
||||
case 1:
|
||||
_crow2Should = 15;
|
||||
series_play("103cr02", 0x100, 2, kCHANGE_CROW2_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
series_play("103cr02s", 0x100, 2, -1, 30, 0, 100, 0, 0, 1, 2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_crow2Should = 17;
|
||||
series_play("103cr02", 0x100, 0, kCHANGE_CROW2_ANIMATION, 30, 0, 100, 0, 0, 3, 4);
|
||||
series_play("103cr02s", 0x100, 0, -1, 30, 0, 100, 0, 0, 3, 4);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("103cr02", 0x100, 0, kCHANGE_CROW2_ANIMATION, 70, 0, 100, 0, 0, 2, 2);
|
||||
series_play("103cr02s", 0x100, 0, -1, 70, 0, 100, 0, 0, 2, 2);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 17:
|
||||
switch (imath_ranged_rand(1, 6)) {
|
||||
case 1:
|
||||
_crow2Should = 16;
|
||||
series_play("103cr02", 0x100, 2, 11, 30, 0, 100, 0, 0, 3, 4);
|
||||
series_play("103cr02s", 0x100, 2, -1, 30, 0, 100, 0, 0, 3, 4);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_crow2Should = 18;
|
||||
series_play("103cr02", 0x100, 0, 11, 30, 0, 100, 0, 0, 5, 8);
|
||||
series_play("103cr02s", 0x100, 0, -1, 30, 0, 100, 0, 0, 5, 8);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("103cr02", 0x100, 0, 11, 70, 0, 100, 0, 0, 4, 4);
|
||||
series_play("103cr02s", 0x100, 0, -1, 70, 0, 100, 0, 0, 4, 4);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 18:
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_crow2Should = 17;
|
||||
series_play("103cr02", 0x100, 0, 11, 30, 0, 100, 0, 0, 9, 12);
|
||||
series_play("103cr02s", 0x100, 0, -1, 30, 0, 100, 0, 0, 9, 12);
|
||||
} else {
|
||||
series_play("103cr02", 0x100, 0, 11, 70, 0, 100, 0, 0, 8, 8);
|
||||
series_play("103cr02s", 0x100, 0, -1, 70, 0, 100, 0, 0, 8, 8);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_CROW3_ANIMATION:
|
||||
switch (_crow3Should) {
|
||||
case 19:
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_crow3Should = 20;
|
||||
series_play("103cr03", 0x100, 0, kCHANGE_CROW3_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
series_play("103cr03s", 0x100, 0, -1, 30, 0, 100, 0, 0, 1, 2);
|
||||
} else {
|
||||
series_play("103cr03", 0x100, 0, kCHANGE_CROW3_ANIMATION, 80, 0, 100, 0, 0, 0, 0);
|
||||
series_play("103cr03s", 0x100, 0, -1, 80, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 20:
|
||||
switch (imath_ranged_rand(1, 6)) {
|
||||
case 1:
|
||||
_crow3Should = 19;
|
||||
series_play("103cr03", 0x100, 0, kCHANGE_CROW3_ANIMATION, 80, 0, 100, 0, 0, 4, 4);
|
||||
series_play("103cr03s", 0x100, 0, -1, 80, 0, 100, 0, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
series_play("103cr03", 0x100, 0, kCHANGE_CROW3_ANIMATION, 80, 0, 100, 0, 0, 2, 2);
|
||||
series_play("103cr03s", 0x100, 0, -1, 80, 0, 100, 0, 0, 2, 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("103cr03", 0x100, 0, kCHANGE_CROW3_ANIMATION, 80, 0, 100, 0, 0, 3, 3);
|
||||
series_play("103cr03s", 0x100, 0, -1, 80, 0, 100, 0, 0, 3, 3);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_CROW4_ANIMATION:
|
||||
switch (_crow4Should) {
|
||||
case 21:
|
||||
switch (imath_ranged_rand(1, 6)) {
|
||||
case 1:
|
||||
series_play("103cr04", 0x100, 0, kCHANGE_CROW4_ANIMATION, 6, 0, 100, 0, 0, 5, 9);
|
||||
series_play("103cr04s", 0x100, 0, -1, 6, 0, 100, 0, 0, 5, 9);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_crow4Should = 22;
|
||||
series_play("103cr04", 0x100, 0, kCHANGE_CROW4_ANIMATION, 30, 0, 100, 0, 0, 1, 2);
|
||||
series_play("103cr04s", 0x100, 0, -1, 30, 0, 100, 0, 0, 1, 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("103cr04", 0x100, 0, kCHANGE_CROW4_ANIMATION, 90, 0, 100, 0, 0, 0, 0);
|
||||
series_play("103cr04s", 0x100, 0, -1, 90, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 22:
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_crow4Should = 21;
|
||||
series_play("103cr04", 0x100, 2, kCHANGE_CROW4_ANIMATION, 30, 0, 100, 0, 0, 0, 1);
|
||||
series_play("103cr04s", 0x100, 2, -1, 30, 0, 100, 0, 0, 0, 1);
|
||||
} else {
|
||||
series_play("103cr04", 0x100, 0, kCHANGE_CROW4_ANIMATION, 90, 0, 100, 0, 0, 0, 2);
|
||||
series_play("103cr04s", 0x100, 0, -1, 90, 0, 100, 0, 0, 2, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
_digi1 = imath_ranged_rand(1, 7);
|
||||
preloadDigi1();
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
|
||||
if (_G(flags)[V024]) {
|
||||
player_set_commands_allowed(true);
|
||||
kernel_timing_trigger(60, 2);
|
||||
} else {
|
||||
wilbur_speech("103w003", 15);
|
||||
}
|
||||
|
||||
_G(flags)[kHarryComingToRoof] = 1;
|
||||
_G(flags)[V024] = 1;
|
||||
_flag1 = true;
|
||||
_val7 = 0;
|
||||
_val0 = 0;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
player_set_commands_allowed(true);
|
||||
kernel_timing_trigger(1, 2);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
terminateMachineAndNull(_series1);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_G(flags)[kHarryComingToRoof] = 0;
|
||||
_G(wilbur_should) = 6;
|
||||
_G(flags)[kDisableFootsteps] = 0;
|
||||
ws_walk(325, 173, nullptr, 10016);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
terminateMachineAndNull(_series2);
|
||||
series_play_with_breaks(PLAY4, "103ha02", 0x100, kCHANGE_HARRY_ANIMATION, 2, 10, 100, 0, 0);
|
||||
_frame = 10;
|
||||
_harryShould = 9;
|
||||
break;
|
||||
|
||||
case kCHANGE_HARRY_ANIMATION:
|
||||
switch (_harryShould) {
|
||||
case 9:
|
||||
if (imath_ranged_rand(1, 2) == 1) {
|
||||
if (++_frame >= 17)
|
||||
_frame = 15;
|
||||
} else {
|
||||
if (--_frame <= 10)
|
||||
_frame = 12;
|
||||
}
|
||||
|
||||
series_play("103ha02", 0x101, 0, kCHANGE_HARRY_ANIMATION, 10, 0, 100, 0, 0, _frame, _frame);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
series_play("103ha02", 0x101, 0, 22, 6, 0, 100, 0, 0, 17, 22);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 21:
|
||||
_harryShould = 10;
|
||||
kernel_timing_trigger(1, 24);
|
||||
break;
|
||||
|
||||
case 22:
|
||||
series_play("103ha02", 0x101, 0, -1, 6, -1, 100, 0, 0, 22, 22);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
if (_G(flags)[V010] == 2 || _G(flags)[V013]) {
|
||||
switch (imath_ranged_rand(1, 3)) {
|
||||
case 1:
|
||||
digi_play("103h008a", 1, 255, 21);
|
||||
break;
|
||||
case 2:
|
||||
digi_play("103h008b", 1, 255, 21);
|
||||
break;
|
||||
case 3:
|
||||
digi_play("103h008c", 1, 255, 21);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
digi_play("103h007", 1, 255, 21);
|
||||
}
|
||||
|
||||
_G(flags)[V009] = _G(flags).get_boonsville_time_and_display() + 1800;
|
||||
_G(flags)[V012] = 2;
|
||||
ws_walk(271, 265, nullptr, 24, 2);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
if (++_val3 > 1) {
|
||||
wilbur_speech("103w004", 17, -1, 0, 75);
|
||||
_G(flags)[V013] = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_hide_walker();
|
||||
_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, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
digi_unload_stream_breaks(SERIES3);
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech("103w012");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_G(wilbur_should) = 5;
|
||||
terminateMachineAndNull(_series1);
|
||||
ws_hide_walker();
|
||||
series_play("103wi03s", 0x101, 0, -1, 6, 0, 100, 0, 0, 0, 19);
|
||||
series_stream_with_breaks(SERIES4, "103wi03", 6, 0x100, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ws_unhide_walker();
|
||||
_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(wilbur_should) = 7;
|
||||
kernel_timing_trigger(1, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_G(wilbur_should) = 8;
|
||||
ws_hide_walker();
|
||||
series_play_with_breaks(PLAY1, "103wi02", 0xa00, kCHANGE_WILBUR_ANIMATION, 2);
|
||||
series_play("103wi02s", 0x100, 0, -1, 6, 0, 100, 0, 0, 0, 27);
|
||||
player_set_commands_allowed(false);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_val2 = 2;
|
||||
|
||||
if (!_G(flags)[kHarryComingToRoof])
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1001);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room103::pre_parser() {
|
||||
if (player_said("gear", "satellite dish"))
|
||||
player_hotspot_walk_override(225, 257, 8);
|
||||
|
||||
if (player_said("gear", "door") || player_said("gear", "stairway"))
|
||||
player_hotspot_walk_override(391, 264, 1);
|
||||
}
|
||||
|
||||
void Room103::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (!_G(walker).wilbur_said(SAID)) {
|
||||
if (player_said("gear", "satellite dish") && _G(flags)[kHarryComingToRoof] == 0) {
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
player_set_commands_allowed(false);
|
||||
_G(player).command_ready = false;
|
||||
|
||||
} else if (player_said("gear", "door") || player_said("gear", "stairway")) {
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_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(wilbur_should) = 6;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
player_set_commands_allowed(false);
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
} else {
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Room103::preloadDigi1() {
|
||||
const char *NAMES[7] = {
|
||||
"103h002a", "103h002b", "103h002c", "103h002d",
|
||||
"103h002e", "103h002f", "103h002g"
|
||||
};
|
||||
|
||||
assert(_digi1 >= 1 && _digi1 <= 7);
|
||||
digi_preload(NAMES[_digi1 - 1]);
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
68
engines/m4/burger/rooms/section1/room103.h
Normal file
68
engines/m4/burger/rooms/section1/room103.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM103_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM103_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room103 : public Room {
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesStreamBreak SERIES2[];
|
||||
static const seriesStreamBreak SERIES3[];
|
||||
static const seriesStreamBreak SERIES4[];
|
||||
private:
|
||||
static int32 _val0;
|
||||
bool _flag1 = false;
|
||||
int _val2 = 0;
|
||||
int _val3 = 0;
|
||||
int _crow1Should = 0;
|
||||
int _crow3Should = 0;
|
||||
int _crow4Should = 0;
|
||||
int _val7 = 0;
|
||||
int _harryShould = 0;
|
||||
int _crow2Should = 0;
|
||||
int _frame = 0;
|
||||
int _digi1 = 0;
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
|
||||
void preloadDigi1();
|
||||
|
||||
public:
|
||||
Room103() : Room() {}
|
||||
~Room103() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
548
engines/m4/burger/rooms/section1/room104.cpp
Normal file
548
engines/m4/burger/rooms/section1/room104.cpp
Normal file
@@ -0,0 +1,548 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room104.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/core/imath.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_STOLIE_ANIMATION = 3
|
||||
};
|
||||
|
||||
static const char *SAID1[][4] = {
|
||||
{ "TOWN HALL", "104W001", "104W002", "104w002" },
|
||||
{ "DOORS", "104W003", "104W002", nullptr },
|
||||
{ "STOLIE", "104W004", "104W002", "104W002" },
|
||||
{ "MAIN STREET", nullptr, "104W002", "104W002" },
|
||||
{ "AUNT POLLY'S HOUSE", nullptr, "104W002", "104W002" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 1, 3, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 23, "104S101", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 18, 28, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 29, 47, "104_003", 2, 150, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
void Room104::init() {
|
||||
_stolieSleepCtr = 0;
|
||||
_stolieShould = 14;
|
||||
_val3 = 0;
|
||||
|
||||
digi_preload("104_001");
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case 20:
|
||||
break;
|
||||
|
||||
case 101:
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 105:
|
||||
_G(wilbur_should) = 2;
|
||||
digi_preload("104_005");
|
||||
digi_play("104_005", 2, 255, 2);
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 107:
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 170:
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(213, 297, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
static const char *NAMES[14] = {
|
||||
"104W101", "104W100A", "104W100B", "104W100C", "104W100D",
|
||||
"104W100E", "104W100F", "104W100G", "104s100a", "104s100b",
|
||||
"104s100c", "104s100d", "104s100e", "104s101"
|
||||
};
|
||||
for (int i = 0; i < 14; ++i)
|
||||
digi_preload(NAMES[i]);
|
||||
|
||||
digi_play_loop("104_001", 3, 200, -1);
|
||||
_G(flags)[V028] = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_STOLIE_ANIMATION);
|
||||
}
|
||||
|
||||
void Room104::daemon() {
|
||||
int frame, frameRate;
|
||||
|
||||
if (player_commands_allowed() && _G(player).walker_visible && INTERFACE_VISIBLE) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y > 374) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1001);
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
digi_play("104_006", 2, 255, 1005);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
digi_unload("104_005");
|
||||
break;
|
||||
|
||||
case kCHANGE_STOLIE_ANIMATION:
|
||||
switch (_stolieShould) {
|
||||
case 6:
|
||||
_flag1 = false;
|
||||
_stolieShould = 9;
|
||||
Series::series_play("104dr04", 0x200, 2, kCHANGE_STOLIE_ANIMATION, 6, 0, 100, 0, 0, 0, 10);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_flag1 = false;
|
||||
_stolieShould = 13;
|
||||
Series::series_play("104dr04", 0x200, 2, kCHANGE_STOLIE_ANIMATION, 6, 0, 100, 0, 0, 0, 10);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_flag1 = false;
|
||||
_stolieShould = 14;
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, 6, 0, 100, 0, 0, 0, 7);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
digi_stop(2);
|
||||
freeSeries();
|
||||
_flag1 = true;
|
||||
_series1.play("104DR04", 0x200, 16, 4, 6, 0, 100, 0, 0, 0, 10);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
freeSeries();
|
||||
_stolieShould = 10;
|
||||
series_play_with_breaks(PLAY1, "104DR03", 0x200, kCHANGE_STOLIE_ANIMATION, 1);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_flag1 = false;
|
||||
_stolieShould = 9;
|
||||
series_play_with_breaks(PLAY2, "104dr01", 0x200, kCHANGE_STOLIE_ANIMATION, 1);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
if (!digi_play_state(2)) {
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_stolieShould = 15;
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, 8, 0, 100, 0, 0, 13, 14);
|
||||
return;
|
||||
}
|
||||
_stolieSleepCtr = 0;
|
||||
|
||||
switch (getRandom()) {
|
||||
case 1:
|
||||
digi_play("104s100a", 2, 125, -1);
|
||||
break;
|
||||
case 2:
|
||||
digi_play("104s100b", 2, 125, -1);
|
||||
_stolieSleepCtr = 100;
|
||||
break;
|
||||
case 3:
|
||||
digi_play("104s100c", 2, 125, -1);
|
||||
break;
|
||||
case 4:
|
||||
digi_play("104s100d", 2, 125, -1);
|
||||
break;
|
||||
case 5:
|
||||
digi_play("104s100e", 2, 125, -1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_flag1 = false;
|
||||
++_stolieSleepCtr;
|
||||
|
||||
frame = 0;
|
||||
if (_stolieSleepCtr < 3)
|
||||
frame = 22;
|
||||
else if (_stolieSleepCtr < 14)
|
||||
frame = 23;
|
||||
else {
|
||||
switch (imath_ranged_rand(1, 3)) {
|
||||
case 1:
|
||||
frame = 21;
|
||||
break;
|
||||
case 2:
|
||||
frame = 24;
|
||||
break;
|
||||
case 3:
|
||||
frame = 25;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
frameRate = _stolieSleepCtr < 14 ? 15 : imath_ranged_rand(6, 15);
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION,
|
||||
frameRate, 0, 100, 0, 0, frame, frame);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (!digi_play_state(2)) {
|
||||
switch (imath_ranged_rand(1, 6)) {
|
||||
case 1:
|
||||
_stolieShould = 14;
|
||||
Series::series_play("104dr02", 0x200, 2, kCHANGE_STOLIE_ANIMATION, 8, 0, 100, 0, 0, 13, 14);
|
||||
return;
|
||||
case 2:
|
||||
_stolieShould = 16;
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, 8, 0, 100, 0, 0, 20, 20);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_stolieSleepCtr = 0;
|
||||
|
||||
switch (getRandom()) {
|
||||
case 1:
|
||||
digi_play("104s100a", 2, 125, -1);
|
||||
break;
|
||||
case 2:
|
||||
digi_play("104s100b", 2, 125, -1);
|
||||
_stolieSleepCtr = 100;
|
||||
break;
|
||||
case 3:
|
||||
digi_play("104s100c", 2, 125, -1);
|
||||
break;
|
||||
case 4:
|
||||
digi_play("104s100d", 2, 125, -1);
|
||||
break;
|
||||
case 5:
|
||||
digi_play("104s100e", 2, 125, -1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_flag1 = false;
|
||||
++_stolieSleepCtr;
|
||||
|
||||
frame = 0;
|
||||
if (_stolieSleepCtr < 3)
|
||||
frame = 11;
|
||||
else if (_stolieSleepCtr < 14)
|
||||
frame = 10;
|
||||
else {
|
||||
switch (imath_ranged_rand(1, 3)) {
|
||||
case 1:
|
||||
frame = 8;
|
||||
break;
|
||||
case 2:
|
||||
frame = 9;
|
||||
break;
|
||||
case 3:
|
||||
frame = 12;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
frameRate = _stolieSleepCtr < 14 ? 15 : imath_ranged_rand(6, 15);
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, frameRate, 0, 100, 0, 0, frame, frame);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
if (!digi_play_state(2)) {
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
_stolieShould = 15;
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, 8, 0, 100, 0, 0, 20, 20);
|
||||
break;
|
||||
} else {
|
||||
_stolieSleepCtr = 0;
|
||||
|
||||
switch (getRandom()) {
|
||||
case 1:
|
||||
digi_play("104s100a", 2, 125, -1);
|
||||
break;
|
||||
case 2:
|
||||
digi_play("104s100b", 2, 125, -1);
|
||||
_stolieSleepCtr = 100;
|
||||
break;
|
||||
case 3:
|
||||
digi_play("104s100c", 2, 125, -1);
|
||||
break;
|
||||
case 4:
|
||||
digi_play("104s100d", 2, 125, -1);
|
||||
break;
|
||||
case 5:
|
||||
digi_play("104s100e", 2, 125, -1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_flag1 = false;
|
||||
++_stolieSleepCtr;
|
||||
|
||||
frame = 0;
|
||||
if (_stolieSleepCtr < 3)
|
||||
frame = 16;
|
||||
else if (_stolieSleepCtr < 14)
|
||||
frame = 18;
|
||||
else {
|
||||
switch (imath_ranged_rand(1, 3)) {
|
||||
case 1:
|
||||
frame = 15;
|
||||
break;
|
||||
case 2:
|
||||
frame = 17;
|
||||
break;
|
||||
case 3:
|
||||
frame = 19;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
frameRate = (_stolieSleepCtr < 14) ? 15 : imath_ranged_rand(6, 15);
|
||||
Series::series_play("104dr02", 0x200, 0, kCHANGE_STOLIE_ANIMATION, frameRate, 0, 100, 0, 0, frame, frame);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
freeSeries();
|
||||
_flag1 = true;
|
||||
_stolieShould = 18;
|
||||
_series1.play("104DR04", 0x200, 4, -1, 6, -1, 100, 0, 0, 11, 15);
|
||||
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_STOLIE_ANIMATION);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
freeSeries();
|
||||
_flag1 = true;
|
||||
_series1.show("104DR04", 0x200, 0, -1, -1, 11);
|
||||
conv_resume_curr();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
conv_load_and_prepare("conv16", 5, false);
|
||||
conv_export_pointer_curr(&_G(flags)[WAKE_UP_STOLIE_COUNT], 0);
|
||||
conv_play_curr();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
term_message("WAKE UP STOLIE COUNT = %d", _G(flags)[WAKE_UP_STOLIE_COUNT]);
|
||||
if (!_G(flags)[WAKE_UP_STOLIE_COUNT]) {
|
||||
term_message("AT END OF CONV? COUNT = %d", _G(flags)[WAKE_UP_STOLIE_COUNT]);
|
||||
_G(flags)[V028] = 0;
|
||||
_G(flags)[WAKE_UP_STOLIE_COUNT]++;
|
||||
}
|
||||
|
||||
freeSeries();
|
||||
|
||||
switch (_G(flags)[WAKE_UP_STOLIE_COUNT]) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 7:
|
||||
case 11:
|
||||
_stolieShould = 6;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 5:
|
||||
case 6:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
_stolieShould = 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_STOLIE_ANIMATION);
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
ws_demand_location(315, 373);
|
||||
ws_demand_facing(10);
|
||||
ws_walk(271, 348, nullptr, -1, 10);
|
||||
break;
|
||||
case 2:
|
||||
ws_demand_location(208, 243);
|
||||
ws_demand_facing(7);
|
||||
ws_walk(180, 287, nullptr, -1, 7);
|
||||
break;
|
||||
case 3:
|
||||
ws_demand_location(417, 361);
|
||||
ws_demand_facing(3);
|
||||
break;
|
||||
case 4:
|
||||
ws_demand_location(0, 326);
|
||||
ws_demand_facing(3);
|
||||
ws_walk(36, 338, nullptr, -1, 3);
|
||||
break;
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room104::pre_parser() {
|
||||
_G(kernel).call_daemon_every_loop = player_said("MAIN STREET") &&
|
||||
player_said_any("look at", "enter");
|
||||
}
|
||||
|
||||
void Room104::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (!_G(walker).wilbur_said(SAID1)) {
|
||||
if (player_said("MAIN STREET") && player_said_any("look at", "enter")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1001);
|
||||
|
||||
} else if (player_said("ENTER", "DOORS") || player_said("ENTER", "DOOR HANDLE") ||
|
||||
player_said("gear", "doors") || player_said("gear", "door handle")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1);
|
||||
|
||||
} else if (player_said("LOOK AT", "AUNT POLLY'S HOUSE")) {
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1017);
|
||||
|
||||
} else if (player_said("ENTER", "AUNT POLLY'S HOUSE")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(master_palette), _G(kernel).first_fade, 255, 0, 30, 1017);
|
||||
|
||||
} else if (player_said("talk to", "stolie")) {
|
||||
if (_G(flags)[V028]) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
switch (_G(flags)[WAKE_UP_STOLIE_COUNT]) {
|
||||
case 0:
|
||||
_stolieShould = 12;
|
||||
_G(walker).wilbur_speech_random("104W100A", "104W100B", "104W100C",
|
||||
"104W100D", "104W100E", "104W100F", "104W100G");
|
||||
break;
|
||||
case 12:
|
||||
_G(walker).wilbur_speech("104W101");
|
||||
_G(flags)[V028] = 0;
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
default:
|
||||
_stolieShould = 10;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_G(walker).wilbur_speech("104W101");
|
||||
}
|
||||
} else if (player_said("conv16")) {
|
||||
conv();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room104::conv() {
|
||||
if (conv_sound_to_play()) {
|
||||
switch (conv_whos_talking()) {
|
||||
case 0:
|
||||
_stolieShould = 17;
|
||||
kernel_trigger_dispatch_now(kCHANGE_STOLIE_ANIMATION);
|
||||
break;
|
||||
case 1:
|
||||
_G(walker).wilbur_speech(conv_sound_to_play(), 10001);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room104::freeSeries() {
|
||||
if (_flag1) {
|
||||
_series1.terminate();
|
||||
_flag1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
int Room104::getRandom() const {
|
||||
if (imath_ranged_rand(1, 4) == 1) {
|
||||
return imath_ranged_rand(3, 4);
|
||||
} else {
|
||||
switch (imath_ranged_rand(1, 5)) {
|
||||
case 1:
|
||||
case 2:
|
||||
return 1;
|
||||
case 3:
|
||||
return 2;
|
||||
default:
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
57
engines/m4/burger/rooms/section1/room104.h
Normal file
57
engines/m4/burger/rooms/section1/room104.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM104_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM104_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room104 : public Room {
|
||||
private:
|
||||
int _stolieSleepCtr = 0;
|
||||
int _stolieShould = 14;
|
||||
int _val3 = 0;
|
||||
bool _flag1 = false;
|
||||
Series _series1;
|
||||
|
||||
void conv();
|
||||
void freeSeries();
|
||||
int getRandom() const;
|
||||
|
||||
public:
|
||||
Room104() : Room() {}
|
||||
~Room104() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1787
engines/m4/burger/rooms/section1/room105.cpp
Normal file
1787
engines/m4/burger/rooms/section1/room105.cpp
Normal file
File diff suppressed because it is too large
Load Diff
91
engines/m4/burger/rooms/section1/room105.h
Normal file
91
engines/m4/burger/rooms/section1/room105.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM105_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM105_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room105 : public Room {
|
||||
private:
|
||||
int _val1 = 0;
|
||||
int _elgusShould = 0;
|
||||
int _elgusMode = 0;
|
||||
KernelTriggerType _savedMode = (KernelTriggerType)0;
|
||||
int _savedTrigger = 0;
|
||||
//int _val7 = 0;
|
||||
int _val8 = 0;
|
||||
bool _flag1 = false;
|
||||
bool _flag2 = false;
|
||||
bool _flag3 = false;
|
||||
bool _flag4 = false;
|
||||
bool _flag5 = false;
|
||||
const char *_digi1 = nullptr;
|
||||
int _series1[12];
|
||||
int _series2[4];
|
||||
int _series3[12];
|
||||
int _series4[5];
|
||||
machine *_series5 = nullptr;
|
||||
machine *_series6 = nullptr;
|
||||
machine *_series7 = nullptr;
|
||||
machine *_series8 = nullptr;
|
||||
machine *_series9 = nullptr;
|
||||
machine *_series10 = nullptr;
|
||||
int _series11 = 0;
|
||||
int _series12 = 0;
|
||||
|
||||
void conv10();
|
||||
void conv11();
|
||||
void conv12();
|
||||
void conv13();
|
||||
void startConv13();
|
||||
void mayorsDoor();
|
||||
void loadAssets1();
|
||||
void loadAssets2();
|
||||
void loadAssets3();
|
||||
void loadAssets4();
|
||||
void unloadAssets1();
|
||||
void unloadAssets2();
|
||||
void unloadAssets3();
|
||||
void unloadAssets4();
|
||||
void townRecords();
|
||||
void complaintsDept();
|
||||
void mayorsOffice();
|
||||
|
||||
public:
|
||||
Room105() : Room() {}
|
||||
~Room105() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
427
engines/m4/burger/rooms/section1/room106.cpp
Normal file
427
engines/m4/burger/rooms/section1/room106.cpp
Normal file
@@ -0,0 +1,427 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room106.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kWILBUR_SPEECH = 2,
|
||||
kCHANGE_DOG_ANIMATION = 3,
|
||||
kWILBUR_ARRESTED1 = 4,
|
||||
kWILBUR_ARRESTED2 = 5
|
||||
};
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "GARBAGE CANS", "106w002", "106w003", nullptr },
|
||||
{ "POLICE STATION", "106w004", "106w004z", "106w004z" },
|
||||
{ "JAIL CELL", "106w005", "106w004z", "106w004z" },
|
||||
{ "BARRED WINDOW", "106w006", "106w004z", nullptr },
|
||||
{ "FENCE ", "106w008", "106w004z", "106w009" },
|
||||
{ "RAZOR WIRE", "106w010", "106w011", "106w011" },
|
||||
{ "GATE", "106w012", "106w004z", "106w013" },
|
||||
{ "SIGN", "106w015", nullptr, nullptr },
|
||||
{ "TIRE", "106w016", "106w017", "106w018" },
|
||||
{ "TOW TRUCK", "106w019", "106w004z", "106w020" },
|
||||
{ "PEGLEG", "106w021", "106w022", "106w022" },
|
||||
{ "PEGLEG ", "106w021", "106w022", "106w022" },
|
||||
{ "TIRE ", "106w023", "106w020", "106w020" },
|
||||
{ "MAIN STREET", nullptr, "106w004z", nullptr },
|
||||
{ "DOG COLLAR ", "106w900", nullptr, "106w901" },
|
||||
{ "DOG COLLAR ", "106w900", nullptr, "106w901" },
|
||||
{ "HOOK ", "106w903", "106w904", "106w004z" },
|
||||
{ "WINCH", "106w902", "106w004z", "106w904" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const WilburMatch Room106::MATCH[] = {
|
||||
{ "JAWZ O' LIFE", "GATE", 2, nullptr, 0, &_speechNum, 2 },
|
||||
{ "JAWZ O' LIFE", "CHAIN", 2, nullptr, 0, &_speechNum, 2 },
|
||||
{ "JAWZ O' LIFE", "LOCK", 2, nullptr, 0, &_speechNum, 2 },
|
||||
WILBUR_MATCH_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY1[] = {
|
||||
{ 0, -1, "106d003a", 2, 255, -1, 0, 0, &_dogState, 1 },
|
||||
{ 0, -1, "106d003b", 2, 255, -1, 0, 0, &_dogState, 2 },
|
||||
{ 0, -1, "106d003c", 2, 255, -1, 0, 0, &_dogState, 3 },
|
||||
{ 0, -1, "106d003d", 2, 255, -1, 0, 0, &_dogState, 4 },
|
||||
{ 0, -1, "106d003e", 2, 255, -1, 0, 0, &_dogState, 5 },
|
||||
{ 0, -1, "106d003f", 2, 255, -1, 0, 0, &_dogState, 6 },
|
||||
{ 0, -1, "106d003g", 2, 255, -1, 0, 0, &_dogState, 7 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY2[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY3[] = {
|
||||
{ 0, -1, "106d001a", 2, 255, -1, 0, -1, &_dogState, 1 },
|
||||
{ 0, -1, "106d001b", 2, 255, -1, 0, -1, &_dogState, 2 },
|
||||
{ 0, -1, "106d001c", 2, 255, -1, 0, -1, &_dogState, 3 },
|
||||
{ 0, -1, "106d001d", 2, 255, -1, 0, -1, &_dogState, 4 },
|
||||
{ 0, -1, "106d001e", 2, 255, -1, 0, -1, &_dogState, 5 },
|
||||
{ 0, -1, "106d001f", 2, 255, -1, 0, -1, &_dogState, 6 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY4[] = {
|
||||
{ 0, -1, "106d002a", 2, 255, -1, 0, -1, &_dogState, 1 },
|
||||
{ 0, -1, "106d002b", 2, 255, -1, 0, -1, &_dogState, 2 },
|
||||
{ 0, -1, "106d002c", 2, 255, -1, 0, -1, &_dogState, 3 },
|
||||
{ 0, -1, "106d002d", 2, 255, -1, 0, -1, &_dogState, 4 },
|
||||
{ 0, -1, "106d002e", 2, 255, -1, 0, -1, &_dogState, 5 },
|
||||
{ 0, -1, "106d002f", 2, 255, -1, 0, -1, &_dogState, 6 },
|
||||
{ 0, -1, "106d002g", 2, 255, -1, 0, -1, &_dogState, 7 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY5[] = {
|
||||
{ 0, 4, "106d006a", 2, 255, -1, 0, 0, &_dogState, 1 },
|
||||
{ 0, 4, "106d006b", 2, 255, -1, 0, 0, &_dogState, 2 },
|
||||
{ 0, 4, "106d006c", 2, 255, -1, 0, 0, &_dogState, 3 },
|
||||
{ 5, -1, "106_005", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY6[] = {
|
||||
{ 0, 4, "106_005", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, -1, "106d007a", 2, 255, -1, 0, 0, &_dogState, 1 },
|
||||
{ 5, -1, "106d007b", 2, 255, -1, 0, 0, &_dogState, 2 },
|
||||
{ 5, -1, "106d007c", 2, 255, -1, 0, 0, &_dogState, 3 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room106::PLAY7[] = {
|
||||
{ 0, -1, "106d005", 2, 255, -1, 0, 0, &_dogState, 1 },
|
||||
{ 0, -1, "106d005b", 2, 255, -1, 0, 0, &_dogState, 2 },
|
||||
{ 0, -1, "106d005c", 2, 255, -1, 0, 0, &_dogState, 3 },
|
||||
{ 0, -1, "106d005d", 2, 255, -1, 0, 0, &_dogState, 4 },
|
||||
{ 0, -1, "106d005e", 2, 255, -1, 0, 0, &_dogState, 5 },
|
||||
{ 0, -1, "106d005f", 2, 255, -1, 0, 0, &_dogState, 6 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
int32 Room106::_speechNum;
|
||||
int32 Room106::_dogState;
|
||||
|
||||
void Room106::preload() {
|
||||
_G(player).walker_in_this_scene = _G(game).room_id != 137 &&
|
||||
_G(game).room_id != 138;
|
||||
}
|
||||
|
||||
void Room106::init() {
|
||||
_dogState = 0;
|
||||
|
||||
digi_preload("100_001");
|
||||
digi_preload("106_101");
|
||||
_digi1 = "100_001";
|
||||
|
||||
kernel_trigger_dispatch_now(1);
|
||||
player_set_commands_allowed(false);
|
||||
_speechNum = 0;
|
||||
|
||||
setHotspots();
|
||||
loadSeries();
|
||||
|
||||
if (_G(game).previous_room == -1) {
|
||||
_dogShould = _G(flags)[V172] == 10023 ? 9 : 15;
|
||||
} else {
|
||||
_dogShould = imath_ranged_rand(1, 2) == 1 ? 5 : 6;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
series_show("106gate", 0x4fd);
|
||||
series_show("106gates", 0x4fe);
|
||||
series_show("106tt", 0x600);
|
||||
series_show("106tire", 0x600);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case 101:
|
||||
ws_demand_location(-40, 317, 3);
|
||||
ws_walk(62, 340, nullptr, 0);
|
||||
break;
|
||||
|
||||
case 137:
|
||||
case 138:
|
||||
// Wilbur was arrested
|
||||
digi_play("106_102", 1, 255, kWILBUR_ARRESTED1);
|
||||
break;
|
||||
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(169, 336, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room106::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
_digi1 = !strcmp(_digi1, "106_101") ? "100_001" : "106_101";
|
||||
digi_play(_digi1, 3, 255, 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (_speechNum) {
|
||||
case 1:
|
||||
player_set_commands_allowed(true);
|
||||
_G(walker).wilbur_speech_random("106w001a", "106w001b", "106w001c");
|
||||
break;
|
||||
case 2:
|
||||
wilbur_speech("106w014");
|
||||
break;
|
||||
case 3:
|
||||
wilbur_speech("106w501", kWILBUR_ARRESTED2);
|
||||
break;
|
||||
case 4:
|
||||
wilbur_speech("106w500", kAbduction);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_DOG_ANIMATION:
|
||||
switch (_dogShould) {
|
||||
case 5:
|
||||
_dogState = imath_ranged_rand(1, 7);
|
||||
_dogShould = 7;
|
||||
series_play_with_breaks(PLAY1, "106dg01", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_dogShould = 7;
|
||||
series_play_with_breaks(PLAY2, "106dg02", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_dogState = imath_ranged_rand(1, 6);
|
||||
_dogShould = _G(game).previous_room == 137 || _G(game).previous_room == 138 ? 9 : 8;
|
||||
series_play_with_breaks(PLAY3, "106dg04", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_speechNum = 1;
|
||||
ws_turn_to_face(calc_facing(415, 234), 2);
|
||||
_dogShould = 9;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_G(flags)[V172] = 10023;
|
||||
|
||||
switch (imath_ranged_rand(1, 6)) {
|
||||
case 1:
|
||||
_dogShould = 10;
|
||||
break;
|
||||
case 2:
|
||||
_dogShould = 11;
|
||||
break;
|
||||
case 3:
|
||||
_dogShould = 12;
|
||||
break;
|
||||
default:
|
||||
_dogShould = 9;
|
||||
break;
|
||||
}
|
||||
|
||||
series_show("106dg07", 0x501, 0, kCHANGE_DOG_ANIMATION, 120);
|
||||
series_show("106dg07s", 0x502, 0, -1, 120);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (digi_play_state(1)) {
|
||||
_dogShould = 9;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
} else {
|
||||
_dogState = imath_ranged_rand(1, 7);
|
||||
_dogShould = 9;
|
||||
series_play_with_breaks(PLAY4, "106dg05", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
if (digi_play_state(1)) {
|
||||
_dogShould = 9;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
} else {
|
||||
_dogState = imath_ranged_rand(1, 3);
|
||||
_dogShould = 15;
|
||||
series_play_with_breaks(PLAY5, "106dg07", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
if (digi_play_state(1)) {
|
||||
_dogShould = 9;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
} else {
|
||||
_dogState = imath_ranged_rand(1, 6);
|
||||
_dogShould = 9;
|
||||
series_play_with_breaks(PLAY3, "106dg04", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
if (digi_play_state(1)) {
|
||||
_dogShould = 15;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
} else {
|
||||
_dogState = imath_ranged_rand(1, 6);
|
||||
_dogShould = 15;
|
||||
series_play_with_breaks(PLAY3, "106dg09", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
if (digi_play_state(1)) {
|
||||
_dogShould = 15;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DOG_ANIMATION);
|
||||
} else {
|
||||
_dogState = imath_ranged_rand(1, 3);
|
||||
_dogShould = 9;
|
||||
series_play_with_breaks(PLAY6, "106dg11", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
_G(flags)[V172] = 10024;
|
||||
|
||||
switch (imath_ranged_rand(1, 4)) {
|
||||
case 1:
|
||||
_dogShould = 13;
|
||||
break;
|
||||
case 2:
|
||||
_dogShould = 14;
|
||||
break;
|
||||
default:
|
||||
_dogShould = 15;
|
||||
break;
|
||||
}
|
||||
|
||||
series_show("106dg07", 0x501, 0, kCHANGE_DOG_ANIMATION, 120, 8);
|
||||
series_show("106dg07s", 0x502, 0, -1, 120, 8);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
_dogState = imath_ranged_rand(1, 6);
|
||||
_dogShould = 11;
|
||||
series_play_with_breaks(PLAY7, "106dg06", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_dogState = imath_ranged_rand(1, 6);
|
||||
_dogShould = 13;
|
||||
series_play_with_breaks(PLAY7, "106dg10", 0x501, kCHANGE_DOG_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kWILBUR_ARRESTED1:
|
||||
_speechNum = 3;
|
||||
digi_play("106s001", 1, 255, kWILBUR_SPEECH);
|
||||
break;
|
||||
|
||||
case kWILBUR_ARRESTED2:
|
||||
_speechNum = 4;
|
||||
digi_play("106_103", 1, 255, kWILBUR_SPEECH);
|
||||
break;
|
||||
|
||||
case 10008:
|
||||
_dogShould = _G(flags)[V172] == 10023 ? 16 : 17;
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room106::pre_parser() {
|
||||
if (player_said("SKY"))
|
||||
player_set_facing_hotspot();
|
||||
|
||||
if (player_said("MAIN STREET") && !player_said_any("GEAR", "LOOK AT")) {
|
||||
player_set_facing_at(-40, 317);
|
||||
}
|
||||
}
|
||||
|
||||
void Room106::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("MAIN STREET")) {
|
||||
disable_player_commands_and_fade_init(1001);
|
||||
_G(player).command_ready = false;
|
||||
} else if (!_G(walker).wilbur_match(MATCH)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room106::setHotspots() {
|
||||
hotspot_set_active("PEGLEG", false);
|
||||
hotspot_set_active("PEGLEG ", false);
|
||||
hotspot_set_active("DOG COLLAR ", false);
|
||||
hotspot_set_active("DOG COLLAR ", false);
|
||||
|
||||
switch (_G(flags)[V172]) {
|
||||
case 10023:
|
||||
hotspot_set_active("PEGLEG", true);
|
||||
hotspot_set_active("DOG COLLAR ", true);
|
||||
break;
|
||||
|
||||
case 10024:
|
||||
hotspot_set_active("PEGLEG ", true);
|
||||
hotspot_set_active("DOG COLLAR ", true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room106::loadSeries() {
|
||||
series_load("106dg04");
|
||||
series_load("106dg04s");
|
||||
series_load("106dg07");
|
||||
series_load("106dg07s");
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
65
engines/m4/burger/rooms/section1/room106.h
Normal file
65
engines/m4/burger/rooms/section1/room106.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM106_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM106_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
#include "m4/burger/walker.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room106 : public Room {
|
||||
static const WilburMatch MATCH[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
private:
|
||||
const char *_digi1 = nullptr;
|
||||
static int32 _speechNum;
|
||||
int _dogShould = 0;
|
||||
static int32 _dogState;
|
||||
|
||||
void setHotspots();
|
||||
void loadSeries();
|
||||
|
||||
public:
|
||||
Room106() : Room() {}
|
||||
~Room106() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
52
engines/m4/burger/rooms/section1/room120.cpp
Normal file
52
engines/m4/burger/rooms/section1/room120.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room120.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
void Room120::preload() {
|
||||
_G(player).walker_in_this_scene = false;
|
||||
}
|
||||
|
||||
void Room120::init() {
|
||||
player_set_commands_allowed(false);
|
||||
kernel_timing_trigger(200, 1);
|
||||
}
|
||||
|
||||
void Room120::daemon() {
|
||||
// After reimplementing for ScummVM the massive mess of multi-level switch
|
||||
// statements that are the previous rooms' daemons, I seriously love
|
||||
// the simplicity of this room's daemon. It's awesome!
|
||||
if (_G(kernel).trigger == 1) {
|
||||
_G(game).setRoom(_G(game).previous_room);
|
||||
} else {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
45
engines/m4/burger/rooms/section1/room120.h
Normal file
45
engines/m4/burger/rooms/section1/room120.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM120_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM120_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room120 : public Room {
|
||||
public:
|
||||
Room120() : Room() {}
|
||||
~Room120() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
363
engines/m4/burger/rooms/section1/room133_136.cpp
Normal file
363
engines/m4/burger/rooms/section1/room133_136.cpp
Normal file
@@ -0,0 +1,363 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room133_136.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "SIGN", "136w001", "136W003", nullptr },
|
||||
{ "SIGN ", "136w002", "136W003", "136w005" },
|
||||
{ "CONSTRUCTION", nullptr, "136W008", "136W008" },
|
||||
{ "OLD BRIDGE", nullptr, "136W008", nullptr },
|
||||
{ "TOWN LIMITS", nullptr, "136W008", nullptr },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 12, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 13, 30, "136_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 31, 57, "136_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 58, -1, nullptr, 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak SERIES1[] = {
|
||||
{ 6, nullptr, 2, 255, 9, 0, nullptr, 0 },
|
||||
{ 10, "100_022", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak SERIES2[] = {
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak SERIES3[] = {
|
||||
{ 0, "100_010", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 14, "100_011", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 20, nullptr, 1, 255, 14, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
void Room133_136::init() {
|
||||
_flag = true;
|
||||
_volume = 255;
|
||||
_walkCodes = nullptr;
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 134:
|
||||
case 135:
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 136:
|
||||
ws_demand_location(444, 230, 2);
|
||||
break;
|
||||
|
||||
case 137:
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(320, 271, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
setupSign();
|
||||
setupSignWalkAreas();
|
||||
digi_preload("136_001");
|
||||
digi_play_loop("136_001", 3, 180);
|
||||
}
|
||||
|
||||
void Room133_136::daemon() {
|
||||
if (player_commands_allowed() && _G(player).walker_visible) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y < 188 && _flag) {
|
||||
_flag = false;
|
||||
kernel_timing_trigger(120, 1);
|
||||
player_set_commands_allowed(false);
|
||||
intr_freshen_sentence();
|
||||
series_play("136cw01", 0xf00, 0, 2, 6, 0, 100, 0, 0, 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
Section1::walk();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
digi_play("136c001", 1, 255, 5, 136);
|
||||
_val1 = 1;
|
||||
kernel_trigger_dispatch_now(3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (_val1 == 1) {
|
||||
const int frame = imath_ranged_rand(8, 10);
|
||||
series_play("136cw01", 0xf00, 0, 3, 6, 0, 100, 0, 0, frame, frame);
|
||||
} else {
|
||||
ws_walk(217, 268, nullptr, 4, 2);
|
||||
series_play("136cw01", 0xf00, 2, -1, 6, 0, 100, 0, 0, 0, 10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
wilbur_speech("136w009");
|
||||
_flag = true;
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_G(flags)[kDisableFootsteps] = 0;
|
||||
_val1 = 2;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
pal_fade_set_start(0);
|
||||
terminateMachineAndNull(_sign1);
|
||||
terminateMachineAndNull(_sign2);
|
||||
ws_hide_walker();
|
||||
gr_backup_palette();
|
||||
digi_preload("100_022");
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
kernel_timing_trigger(30, 7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
series_stream_with_breaks(SERIES1, "120dt01", 9, 0, 1009);
|
||||
kernel_timing_trigger(1, 8);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
pal_fade_init(15, 255, 100, 0, -1);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
digi_change_volume(2, 0);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
terminateMachineAndNull(_sign1);
|
||||
terminateMachineAndNull(_sign2);
|
||||
|
||||
if (_G(flags)[kRoadOpened]) {
|
||||
Section1::updateWalker(413, 281, 9, 15, true);
|
||||
} else {
|
||||
Section1::updateWalker(238, 226, 4, 15);
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
if ((_G(player_info).x < 320 && _G(player_info).y > 250) ||
|
||||
(_G(player_info).y > 227 && !_G(flags)[kRoadOpened])) {
|
||||
kernel_trigger_dispatch_now(11);
|
||||
} else if (!_G(flags)[kRoadOpened]) {
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
series_stream_with_breaks(SERIES2, "136dt01", 6, 0x400, 14);
|
||||
} else {
|
||||
kernel_trigger_dispatch_now(11);
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
if (!_G(flags)[kRoadOpened]) {
|
||||
_volume -= 10;
|
||||
if (_volume > 0) {
|
||||
digi_change_volume(2, _volume);
|
||||
kernel_timing_trigger(3, 14);
|
||||
} else {
|
||||
digi_stop(1);
|
||||
digi_unload_stream_breaks(SERIES2);
|
||||
digi_stop(2);
|
||||
digi_unload("100_013");
|
||||
player_set_commands_allowed(true);
|
||||
_volume = 255;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
setupSign();
|
||||
_G(walker).reset_walker_sprites();
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
|
||||
if (_G(flags)[kRoadOpened]) {
|
||||
_G(flags)[V000] = 1002;
|
||||
series_stream_with_breaks(SERIES3, "136dt02", 6, 0x200, 6);
|
||||
} else {
|
||||
series_stream_with_breaks(SERIES2, "136dt01", 6, 0x200, 14);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
ws_demand_location(398, 297, 8);
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_sign1);
|
||||
terminateMachineAndNull(_sign2);
|
||||
player_set_commands_allowed(false);
|
||||
series_play_with_breaks(PLAY1, "136wi01", 0x300, 17, 3);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_G(flags)[kRoadOpened] = 1;
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
setupSign();
|
||||
setupSignWalkAreas();
|
||||
wilbur_speech("136w004");
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 3:
|
||||
player_set_commands_allowed(true);
|
||||
player_first_walk(639, 264, 9, 588, 252, 9, true);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
player_first_walk(0, 355, 3, 96, 340, 3, true);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlEntersTown:
|
||||
if (player_commands_allowed() && _G(player).walker_visible &&
|
||||
INTERFACE_VISIBLE && !digi_play_state(1)) {
|
||||
Section1::updateDisablePlayer();
|
||||
digi_preload("100_013");
|
||||
digi_play("100_013", 2);
|
||||
kernel_timing_trigger(240, 13);
|
||||
} else {
|
||||
kernel_timing_trigger(60, 10028);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room133_136::pre_parser() {
|
||||
if (player_said("gear", "sign") && !_G(flags)[kRoadOpened])
|
||||
player_hotspot_walk_override(246, 247, 8);
|
||||
|
||||
if (player_said("old bridge") &&
|
||||
!player_said_any("enter", "gear", "look", "look at"))
|
||||
player_hotspot_walk_override_just_face(3);
|
||||
|
||||
if (player_said("town limits") &&
|
||||
!player_said_any("enter", "gear", "look", "look at"))
|
||||
player_hotspot_walk_override_just_face(9);
|
||||
|
||||
if (player_said("enter", "construction"))
|
||||
player_hotspot_walk_override(292, 173, 1);
|
||||
}
|
||||
|
||||
void Room133_136::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (player_said("gear", "sign") && !_G(flags)[kRoadOpened]) {
|
||||
kernel_trigger_dispatch_now(16);
|
||||
|
||||
} else if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
|
||||
} else if (lookFlag && player_said("construction")) {
|
||||
wilbur_speech(_G(flags)[V000] == 1002 ? "136w006" : "136w007");
|
||||
|
||||
} else if (player_said("enter", "old bridge") || player_said("gear", "old bridge") ||
|
||||
(lookFlag && player_said("old bridge"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1008);
|
||||
|
||||
} else if (player_said("enter", "town limits") || player_said("gear", "town limits") ||
|
||||
(lookFlag && player_said("town limits"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1010);
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) &&
|
||||
player_said_any("old bridge", "town limits", "construction")) {
|
||||
wilbur_speech("136w008");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room133_136::setupSign() {
|
||||
if (_G(flags)[kRoadOpened]) {
|
||||
hotspot_set_active("sign", false);
|
||||
hotspot_set_active("sign ", true);
|
||||
_sign1 = series_play("136signr", 0x800, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
_sign2 = series_play("136sinrs", 0x801, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
|
||||
} else {
|
||||
hotspot_set_active("sign ", false);
|
||||
hotspot_set_active("sign", true);
|
||||
|
||||
_sign1 = series_play("136signl", 0xa00, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
_sign2 = series_play("136sinls", 0xa01, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Room133_136::setupSignWalkAreas() {
|
||||
if (_G(flags)[kRoadOpened]) {
|
||||
intr_add_no_walk_rect(294, 263, 332, 278, 297, 292);
|
||||
intr_add_no_walk_rect(332, 278, 380, 300, 297, 292);
|
||||
|
||||
if (_walkCodes)
|
||||
intr_remove_no_walk_rect(_walkCodes);
|
||||
} else {
|
||||
_walkCodes = intr_add_no_walk_rect(144, 241, 244, 252, 167, 272);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
57
engines/m4/burger/rooms/section1/room133_136.h
Normal file
57
engines/m4/burger/rooms/section1/room133_136.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM133_136_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM133_136_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room133_136 : public Room {
|
||||
private:
|
||||
bool _flag = false;
|
||||
int _volume = 255;
|
||||
noWalkRect *_walkCodes = nullptr;
|
||||
machine *_sign1 = nullptr;
|
||||
machine *_sign2 = nullptr;
|
||||
int _val1 = 0;
|
||||
|
||||
void setupSign();
|
||||
void setupSignWalkAreas();
|
||||
|
||||
public:
|
||||
Room133_136() : Room() {}
|
||||
~Room133_136() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1033
engines/m4/burger/rooms/section1/room134_135.cpp
Normal file
1033
engines/m4/burger/rooms/section1/room134_135.cpp
Normal file
File diff suppressed because it is too large
Load Diff
79
engines/m4/burger/rooms/section1/room134_135.h
Normal file
79
engines/m4/burger/rooms/section1/room134_135.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM134_135_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM134_135_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room134_135 : public Room {
|
||||
private:
|
||||
int _volume = 0;
|
||||
int _val2 = 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;
|
||||
bool _flag1 = false;
|
||||
bool _odieLoaded = false;
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
machine *_series3 = nullptr;
|
||||
machine *_series4 = nullptr;
|
||||
machine *_series5 = nullptr;
|
||||
machine *_series6 = nullptr;
|
||||
machine *_play1 = nullptr;
|
||||
machine *_play2 = nullptr;
|
||||
machine *_play3 = nullptr;
|
||||
machine *_play4 = nullptr;
|
||||
int _xp = 0, _yp = 0;
|
||||
int _frame = 0;
|
||||
const char *_name1 = nullptr;
|
||||
|
||||
void conv01();
|
||||
void conv02();
|
||||
void conv03();
|
||||
void loadOdie();
|
||||
void loadDigi();
|
||||
|
||||
public:
|
||||
Room134_135() : Room() {}
|
||||
~Room134_135() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
912
engines/m4/burger/rooms/section1/room137.cpp
Normal file
912
engines/m4/burger/rooms/section1/room137.cpp
Normal file
@@ -0,0 +1,912 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room137.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_SHERRIF_ANIMATION = 1,
|
||||
kCHANGE_DEPUTY_ANIMATION = 2,
|
||||
kSOMEONE_TOOK_KEYS = 4
|
||||
};
|
||||
|
||||
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, nullptr, 0 },
|
||||
{ 20, nullptr, 1, 255, 12, 0, nullptr, 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() {
|
||||
player_set_commands_allowed(true);
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_volume = 255;
|
||||
_flag1 = true;
|
||||
_flag2 = false;
|
||||
_arrested = false;
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
if (_G(flags)[kPoliceCheckCtr])
|
||||
_G(flags)[kPoliceCheckCtr] = 1;
|
||||
break;
|
||||
|
||||
case 136:
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_timing_trigger(1, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 138:
|
||||
ws_demand_facing(2);
|
||||
|
||||
if (_G(flags)[kPoliceCheckCtr] >= 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(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
|
||||
if (_G(flags)[kPoliceCheckCtr] < 200 && _G(flags)[kPoliceCheckCtr] && _G(flags)[kPoliceState] == 4)
|
||||
_G(flags)[kPoliceState] = 5;
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(183, 216, 8);
|
||||
break;
|
||||
}
|
||||
|
||||
_door = series_play("137do01", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
jawz();
|
||||
|
||||
const char *NAMES[18] = {
|
||||
"137_020", "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)[kPoliceState] != 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)[kPoliceCheckCtr] < 200) {
|
||||
_deputyShould = 27;
|
||||
} else {
|
||||
_deputyShould = _G(flags)[kPoliceState] == 2 || _G(flags)[kPoliceState] == 3 || _G(flags)[kPoliceState] == 4 ? 34 : 27;
|
||||
digi_play("137_003", 1);
|
||||
}
|
||||
|
||||
_deputyMode = 27;
|
||||
kernel_trigger_dispatch_now(kCHANGE_DEPUTY_ANIMATION);
|
||||
}
|
||||
|
||||
void Room137::daemon() {
|
||||
int frame;
|
||||
|
||||
if (player_commands_allowed() && _G(player).walker_visible && INTERFACE_VISIBLE) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y < 235 && player_said("FORK IN THE ROAD")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1009);
|
||||
}
|
||||
}
|
||||
|
||||
if (!digi_play_state(2) && _flag1 && imath_ranged_rand(1, 3000) == 235) {
|
||||
// Occasional actions. *VERY* occasional actions
|
||||
if (_flag2 && inv_object_in_scene("keys", 138)) {
|
||||
digi_play("137_022", 2, 100);
|
||||
_flag2 = false;
|
||||
} else if (inv_object_in_scene("keys", 138)) {
|
||||
digi_play(imath_ranged_rand(1, 7) == 1 ? "137_020" : "137_021", 2);
|
||||
|
||||
} else {
|
||||
digi_play(Common::String::format("137_0%d", imath_ranged_rand(23, 28)).c_str(), 2, 150);
|
||||
}
|
||||
}
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_SHERRIF_ANIMATION:
|
||||
switch (_sherrifMode) {
|
||||
case 5:
|
||||
switch (_sherrifShould) {
|
||||
case 10:
|
||||
_sherrifShould = 11;
|
||||
series_play("137sh01", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 17);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
_sherrifShould = 12;
|
||||
series_play("137sh07", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 8);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
startPoliceTalk();
|
||||
_sherrifShould = 22;
|
||||
_sherrifMode = 10;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
_sherrifShould = 15;
|
||||
series_play("137sh01", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 17);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
startPoliceTalk();
|
||||
_sherrifMode = 14;
|
||||
_sherrifShould = 22;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_sherrifShould = 18;
|
||||
series_play("137sh01", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 17);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
_sherrifShould = 19;
|
||||
series_play("137sh07", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 8);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_sherrifShould = 20;
|
||||
series_play("137sh09", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 8);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
startPoliceTalk();
|
||||
_sherrifShould = 22;
|
||||
_sherrifMode = 17;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
switch (_sherrifShould) {
|
||||
case 22:
|
||||
series_play("137sh08", 0x800, 0, 1, 10, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_sherrifMode = 13;
|
||||
series_play("137sh08", 0x800, 0, 1, 6, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
if (_sherrifShould == 23) {
|
||||
frame = imath_ranged_rand(0, 6);
|
||||
series_play("137sh08", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, frame, frame);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 14);
|
||||
_digi1 = nullptr;
|
||||
}
|
||||
} else {
|
||||
_sherrifMode = 10;
|
||||
series_play("137sh08", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
switch (_sherrifShould) {
|
||||
case 22:
|
||||
if (imath_ranged_rand(1, 30) == 2) {
|
||||
series_play("137sh04", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, 0, 14);
|
||||
} else {
|
||||
series_play("137sh01", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 12, 0, 100, 0, 0, 17, 17);
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_sherrifMode = 16;
|
||||
series_play("137sh03", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
_sherrifShould = 23;
|
||||
series_play("137sh05", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, 0, 17);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 14);
|
||||
_digi1 = nullptr;
|
||||
}
|
||||
break;
|
||||
|
||||
case 25:
|
||||
_sherrifShould = 26;
|
||||
series_play("137sh06", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, 0, 23);
|
||||
break;
|
||||
|
||||
case 26:
|
||||
conv_resume_curr();
|
||||
_sherrifShould = 22;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
if (_sherrifShould == 23) {
|
||||
frame = imath_ranged_rand(0, 8);
|
||||
series_play("137sh03", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, frame, frame);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 14);
|
||||
_digi1 = nullptr;
|
||||
}
|
||||
} else {
|
||||
_sherrifMode = 14;
|
||||
series_play("137sh03", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 17:
|
||||
switch (_sherrifShould) {
|
||||
case 22:
|
||||
series_play("137sh09", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_sherrifMode = 21;
|
||||
series_play("137sh10", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 21:
|
||||
if (_sherrifShould == 23) {
|
||||
frame = imath_ranged_rand(0, 5);
|
||||
series_play("137sh10", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 6, 0, 100, 0, 0, frame, frame);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 14);
|
||||
_digi1 = nullptr;
|
||||
}
|
||||
} else {
|
||||
_sherrifMode = 17;
|
||||
series_play("137sh10", 0x800, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_DEPUTY_ANIMATION:
|
||||
switch (_deputyMode) {
|
||||
case 27:
|
||||
switch (_deputyShould) {
|
||||
case 27:
|
||||
movementCheck();
|
||||
kernel_timing_trigger(10, kCHANGE_DEPUTY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 29:
|
||||
_deputyShould = 30;
|
||||
series_play("137dp02", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 8, 0, 100, 0, 0, 0, 7);
|
||||
break;
|
||||
|
||||
case 30:
|
||||
terminateMachineAndNull(_door);
|
||||
_deputyMode = 31;
|
||||
series_play("137dp03", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 8, 0, 100, 0, 0, 0, 14);
|
||||
digi_play("137_003", 1, 255);
|
||||
break;
|
||||
|
||||
case 34:
|
||||
movementCheck();
|
||||
_deputyShould = 29;
|
||||
series_play("137dp01", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 60, 0, 100, 0, 0, 6, 6);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 31:
|
||||
if (imath_ranged_rand(1, 20) == 1) {
|
||||
_deputyMode = 32;
|
||||
series_play("137dp04", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
|
||||
} else {
|
||||
series_play("137dp04", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 10, 0, 100, 0, 0, 7, 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case 32:
|
||||
if (imath_ranged_rand(1, 20) == 1) {
|
||||
_deputyMode = 33;
|
||||
series_play("137dp04", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, imath_ranged_rand(60, 90),
|
||||
0, 100, 0, 0, 0, 5);
|
||||
} else {
|
||||
series_play("137dp04", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 33:
|
||||
_deputyMode = 31;
|
||||
series_play("137dp04", 0x700, 0, kCHANGE_DEPUTY_ANIMATION, 10, 0, 100, 0, 0, 6, 7);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ws_walk(276, 292, nullptr, -1, 4);
|
||||
break;
|
||||
|
||||
case kSOMEONE_TOOK_KEYS:
|
||||
digi_play("137_014", 2, 200, 5);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
unloadAssets();
|
||||
|
||||
if (_G(flags)[kPoliceState] != 2 && _G(flags)[kPoliceState] != 3 && _G(flags)[kPoliceState] != 4)
|
||||
_deputyShould = 30;
|
||||
|
||||
_sherrifMode = 5;
|
||||
_sherrifShould = 10;
|
||||
|
||||
if (_G(player_info).y > 308) {
|
||||
_sherrifShould = 14;
|
||||
ws_walk(307, 349, nullptr, -1, 2);
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
digi_play("137_015", 2, 200, 7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_sherrifMode = 5;
|
||||
_sherrifShould = 14;
|
||||
unloadAssets();
|
||||
|
||||
if (_G(player_info).y < 308)
|
||||
_sherrifShould = 10;
|
||||
if (_G(flags)[kPoliceState] != 2 && _G(flags)[kPoliceState] != 3 && _G(flags)[kPoliceState] != 4)
|
||||
_deputyShould = 30;
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
terminateMachineAndNull(_door);
|
||||
|
||||
if (_G(flags)[V046]) {
|
||||
terminateMachineAndNull(_series3);
|
||||
|
||||
if (inv_object_is_here("jawz o' life"))
|
||||
terminateMachineAndNull(_series2);
|
||||
}
|
||||
|
||||
Section1::updateWalker(227, 309, 11, 13);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
if (_G(player_info).y >= 300) {
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "137dt01", 6, 0xf00, -1);
|
||||
} else {
|
||||
kernel_trigger_dispatch_now(9);
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
_volume -= 10;
|
||||
if (_volume > 0) {
|
||||
digi_change_volume(2, _volume);
|
||||
kernel_timing_trigger(4, 12);
|
||||
} else {
|
||||
digi_stop(1);
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
digi_stop(2);
|
||||
digi_unload("100_013");
|
||||
player_set_commands_allowed(true);
|
||||
_volume = 255;
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
jawz();
|
||||
_door = series_play("137do01", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
_G(walker).reset_walker_sprites();
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "137dt01", 0, 0xf00, -1);
|
||||
_G(flags)[V049] = 1;
|
||||
break;
|
||||
|
||||
case 14:
|
||||
switch (_sherrifShould) {
|
||||
case 22:
|
||||
if (imath_ranged_rand(1, 30) == 2) {
|
||||
series_play("137sh04", 0x800, 0, 1, 6, 0, 100, 0, 0, 0, 14);
|
||||
} else {
|
||||
series_play("137sh01", 0x800, 0, 1, 12, 0, 100, 0, 0, 17, 17);
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_sherrifMode = 16;
|
||||
series_play("137sh03", 0x800, 0, 1, 6, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
_sherrifShould = 23;
|
||||
series_play("137sh05", 0x800, 0, 1, 6, 0, 100, 0, 0, 0, 17);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 14);
|
||||
}
|
||||
break;
|
||||
|
||||
case 25:
|
||||
_sherrifShould = 26;
|
||||
series_play("137sh06", 0x800, 0, 1, 6, 0, 100, 0, 0, 0, 23);
|
||||
break;
|
||||
|
||||
case 26:
|
||||
conv_resume_curr();
|
||||
_sherrifShould = 22;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (_arrested) {
|
||||
// Arrested
|
||||
inv_move_object("keys", 138);
|
||||
inv_move_object("jawz o' life", 137);
|
||||
_G(flags)[V046] = 0;
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1006);
|
||||
|
||||
} else {
|
||||
// Just sent off
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1009);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
terminateMachineAndNull(_series3);
|
||||
inv_move_object("keys", NOWHERE);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
terminateMachineAndNull(_series3);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
_series3 = series_play("137tr02", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
inv_give_to_player("keys");
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_series3 = series_play("137tr01", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
terminateMachineAndNull(_series2);
|
||||
inv_give_to_player("jawz o' life");
|
||||
break;
|
||||
|
||||
case 21:
|
||||
if (inv_object_is_here("jawz o' life"))
|
||||
terminateMachineAndNull(_series2);
|
||||
break;
|
||||
|
||||
case 22:
|
||||
if (inv_object_is_here("jawz o' life"))
|
||||
_series2 = series_play("137jaws", 0x600, 0, -1, 7, -1, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
_G(wilbur_should) = 2;
|
||||
series_play("137wi01", 0x100, 2, kCHANGE_WILBUR_ANIMATION,
|
||||
6, 0, 100, 0, 0, 0, 9);
|
||||
series_play("137wi01s", 0x101, 2, -1, 6, 0, 100, 0, 0, 0, 9);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ws_demand_location(183, 216, 8);
|
||||
_G(wilbur_should) = 4;
|
||||
ws_walk(171, 236, nullptr, kCHANGE_WILBUR_ANIMATION, 5);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
|
||||
if (!_G(player).been_here_before)
|
||||
wilbur_speech("137w001");
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 9;
|
||||
player_set_commands_allowed(false);
|
||||
series_load("137jaws");
|
||||
series_play_with_breaks(PLAY1, "137wi02", 0x100, kCHANGE_WILBUR_ANIMATION,
|
||||
3, 6, 100, 0, 0);
|
||||
hotspot_set_active("keys", true);
|
||||
hotspot_set_active("trunk ", true);
|
||||
|
||||
if (inv_object_is_here("jawz o' life"))
|
||||
hotspot_set_active("jawz o' life", true);
|
||||
|
||||
_G(flags)[V046] = 1;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 9;
|
||||
series_play_with_breaks(PLAY2, "137wi03", 0x100, kCHANGE_WILBUR_ANIMATION,
|
||||
3, 6, 100, 0, 0);
|
||||
hotspot_set_active("keys", false);
|
||||
hotspot_set_active("trunk ", false);
|
||||
hotspot_set_active("jawz o' life", false);
|
||||
_G(flags)[V046] = 0;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 9;
|
||||
series_play_with_breaks(PLAY3, "137wi04", 0x100, kCHANGE_WILBUR_ANIMATION,
|
||||
3, 6, 100, 0, 0);
|
||||
hotspot_set_active("jawz o' life", false);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 35:
|
||||
_G(wilbur_should) = 36;
|
||||
ws_hide_walker();
|
||||
series_play("137wi01", 0x100, 0, kCHANGE_WILBUR_ANIMATION,
|
||||
6, 0, 100, 0, 0, 0, 9);
|
||||
series_play("137wi01s", 0x100, 0, -1, 6, 0, 100, 0, 0, 0, 9);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
series_play("137wi01", 0x100, 0, kCHANGE_WILBUR_ANIMATION,
|
||||
600, 0, 100, 0, 0, 9, 9);
|
||||
series_play("137wi01s", 0x100, 0, -1, 600, 0, 100, 0, 0, 9, 9);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1011);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlEntersTown:
|
||||
if (player_commands_allowed() && _G(player).walker_visible &&
|
||||
INTERFACE_VISIBLE && !digi_play_state(1)) {
|
||||
Section1::updateDisablePlayer();
|
||||
digi_preload("100_013");
|
||||
digi_play("100_013", 2);
|
||||
kernel_timing_trigger(240, 11);
|
||||
|
||||
} else {
|
||||
kernel_timing_trigger(60, kBurlEntersTown);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room137::pre_parser() {
|
||||
if (player_said("KEYS", "PATROL CAR")) {
|
||||
// Convenience added for ScummVM, using keys on the patrol car is
|
||||
// the same as using the keys on the trunk specifically
|
||||
player_hotspot_walk_override(500, 355, 10);
|
||||
}
|
||||
}
|
||||
|
||||
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(kCHANGE_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") || player_said("keys", "patrol car")) {
|
||||
_G(wilbur_should) = 6;
|
||||
kernel_trigger_dispatch_now(kCHANGE_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(kCHANGE_WILBUR_ANIMATION);
|
||||
|
||||
} else if ((player_said("take", "keys") || player_said("gear", "keys")) &&
|
||||
!inv_player_has("keys")) {
|
||||
_G(wilbur_should) = 7;
|
||||
kernel_trigger_dispatch_now(kCHANGE_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(_G(kernel).first_fade, 255, 0, 30, 1009);
|
||||
|
||||
} else if (player_said("LOOK AT", "CAR WINDOW")) {
|
||||
_G(wilbur_should) = 35;
|
||||
player_set_commands_allowed(false);
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room137::conv15() {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
const int who = conv_whos_talking();
|
||||
const int node = conv_current_node();
|
||||
const int entry = conv_current_entry();
|
||||
|
||||
if (_G(kernel).trigger == 14) {
|
||||
if (who <= 0) {
|
||||
if (node == 7) {
|
||||
_sherrifShould = 25;
|
||||
} else {
|
||||
_sherrifShould = 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)
|
||||
_arrested = true;
|
||||
_sherrifShould = (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();
|
||||
}
|
||||
}
|
||||
|
||||
void Room137::unloadAssets() {
|
||||
const char *NAMES[13] = {
|
||||
"137_020", "137_021", "137_022", "137_023", "137_024",
|
||||
"137_025", "137_026", "137_027", "138_028", "138_013",
|
||||
"137_014", "137_015", "137_016"
|
||||
};
|
||||
|
||||
for (int i = 0; i < 13; ++i)
|
||||
digi_unload(NAMES[i]);
|
||||
}
|
||||
|
||||
void Room137::jawz() {
|
||||
if (_G(flags)[V046]) {
|
||||
_series3 = series_play("137tr01", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
|
||||
if (inv_object_is_here("jawz o' life")) {
|
||||
_series2 = series_play("137jaws", 0x600, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
} else {
|
||||
hotspot_set_active("jawz o' life", false);
|
||||
}
|
||||
} else {
|
||||
_series3 = series_play("137tr02", 0x700, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
hotspot_set_active("keys", false);
|
||||
hotspot_set_active("trunk ", false);
|
||||
hotspot_set_active("jawz o' life", false);
|
||||
}
|
||||
}
|
||||
|
||||
void Room137::movementCheck() {
|
||||
if (_G(flags)[kPoliceCheckCtr] && player_commands_allowed()) {
|
||||
++_G(flags)[kPoliceCheckCtr];
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y < 300 && inv_player_has("keys")) {
|
||||
_G(flags)[kPoliceState] = 6;
|
||||
_G(flags)[kPoliceCheckCtr] = 201;
|
||||
}
|
||||
|
||||
if (_G(player_info).y < 308 && _G(flags)[V046])
|
||||
_G(flags)[kPoliceCheckCtr] = 201;
|
||||
|
||||
if (_G(flags)[kPoliceCheckCtr] >= 200) {
|
||||
player_set_commands_allowed(false);
|
||||
intr_freshen_sentence();
|
||||
_G(flags)[kPoliceCheckCtr] = 0;
|
||||
_flag1 = false;
|
||||
|
||||
if (_G(flags)[kPoliceState] == 6) {
|
||||
kernel_timing_trigger(100, 3);
|
||||
digi_play("137_013", 2, 200, kSOMEONE_TOOK_KEYS);
|
||||
|
||||
} else if (_G(player_info).x > 460) {
|
||||
ws_walk(307, 349, nullptr, -1, 2);
|
||||
|
||||
if (_G(flags)[V046]) {
|
||||
digi_play("137_013", 2, 200, 6);
|
||||
} else {
|
||||
digi_play("137_013", 2, 200, 7);
|
||||
}
|
||||
} else if (_G(flags)[kPoliceState] == 1 || _G(flags)[kPoliceState] == 2 ||
|
||||
_G(flags)[kPoliceState] == 3 || _G(flags)[kPoliceState] == 4) {
|
||||
kernel_timing_trigger(30, 7);
|
||||
} else {
|
||||
digi_play("137_013", 2, 200, 7);
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y < 308)
|
||||
kernel_timing_trigger(180, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room137::startPoliceTalk() {
|
||||
conv_load_and_prepare("conv15", 15);
|
||||
|
||||
switch (_G(flags)[kPoliceState]) {
|
||||
case 1:
|
||||
conv_export_value_curr(0, 0);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
conv_export_value_curr(1, 0);
|
||||
break;
|
||||
case 4:
|
||||
conv_export_value_curr(4, 0);
|
||||
break;
|
||||
case 5:
|
||||
conv_export_value_curr(2, 0);
|
||||
break;
|
||||
case 6:
|
||||
conv_export_value_curr(3, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
conv_export_value_curr(_G(flags)[V049], 2);
|
||||
conv_export_value_curr(_G(flags)[kRoadOpened], 3);
|
||||
conv_play_curr();
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
66
engines/m4/burger/rooms/section1/room137.h
Normal file
66
engines/m4/burger/rooms/section1/room137.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM137_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM137_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room137 : public Room {
|
||||
private:
|
||||
bool _flag1 = false;
|
||||
bool _flag2 = false;
|
||||
bool _arrested = false;
|
||||
int _volume = 255;
|
||||
int _deputyShould = 0;
|
||||
int _deputyMode = 0;
|
||||
int _sherrifShould = 0;
|
||||
int _sherrifMode = 0;
|
||||
const char *_digi1 = nullptr;
|
||||
machine *_door = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
machine *_series3 = nullptr;
|
||||
|
||||
void conv15();
|
||||
void unloadAssets();
|
||||
void jawz();
|
||||
void movementCheck();
|
||||
void startPoliceTalk();
|
||||
|
||||
public:
|
||||
Room137() : Room() {}
|
||||
~Room137() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
725
engines/m4/burger/rooms/section1/room138.cpp
Normal file
725
engines/m4/burger/rooms/section1/room138.cpp
Normal file
@@ -0,0 +1,725 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room138.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_DEPUTY_ANIMATION = 1,
|
||||
kCHANGE_SHERRIF_ANIMATION = 2,
|
||||
kCHANGE_WILBUR_ANIMATION = 3
|
||||
};
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "DONUTS", "138W002", "138W003", "138W003" },
|
||||
{ "IGNITION SWITCH", "138W006", "138W007", "138W006" },
|
||||
{ "HORN", "138W008", "138W007", nullptr },
|
||||
{ "RADIO", "138W009", "138W007", nullptr },
|
||||
{ "POLICE RADIO", "138W010", "138W007", "138W004" },
|
||||
{ "RADAR", "138W011", "138W007", "138W004" },
|
||||
{ "SHERIFF", "138W012", "138W013", "138W004" },
|
||||
{ "DEPUTY", "138W014", "138W013", "138W004" },
|
||||
{ "PATROL CAR", "138W015", "138W013", "138W016" },
|
||||
{ "EXIT", nullptr, "138W017", "138W017" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 3, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 4, nullptr, 1, 255, 8, 0, 0, nullptr, 0 },
|
||||
{ 5, -1, nullptr, 1, 255, 10, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 11, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 12, 12, "138_003", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 12, 12, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 12, 12, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 12, 12, nullptr, 1, 255, 5, 0, 0, nullptr, 0 },
|
||||
{ 12, 12, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 11, 0, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 6, 8, nullptr, 1, 255, 12, 0, 0, nullptr, 0 },
|
||||
{ 7, 6, "138_006", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 8, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 8, 6, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 7, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 7, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 6, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 8, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 8, 6, nullptr, 1, 255, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY4[] = {
|
||||
{ 25, 5, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 0, nullptr, 1, 255, 11, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
void Room138::preload() {
|
||||
_G(player).walker_in_this_scene = false;
|
||||
}
|
||||
|
||||
void Room138::init() {
|
||||
_assetsFreed = false;
|
||||
_series3 = -1;
|
||||
_flag1 = false;
|
||||
|
||||
static const char *NAMES[12] = {
|
||||
"138_004", "137_012", "137_013", "137_020", "137_021",
|
||||
"137_022", "137_023", "137_024", "137_025", "137_026",
|
||||
"137_027", "137_028"
|
||||
};
|
||||
for (int i = 0; i < 12; ++i)
|
||||
digi_preload(NAMES[i]);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
if (_G(flags)[kPoliceCheckCtr])
|
||||
_G(flags)[kPoliceCheckCtr] = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (inv_object_is_here("keys")) {
|
||||
digi_preload("138_001");
|
||||
digi_play_loop("138_001", 3, 255);
|
||||
|
||||
} else {
|
||||
digi_preload("138_002");
|
||||
digi_play_loop("138_002", 3, 255);
|
||||
}
|
||||
|
||||
if (inv_object_is_here("keys")) {
|
||||
hotspot_set_active("ignition switch", false);
|
||||
_series1 = series_play("138keys", 0xa00, 0, -1, 7, -1, 100, 0, 0, 0, 0);
|
||||
} else {
|
||||
hotspot_set_active("keys", false);
|
||||
}
|
||||
|
||||
_frame = 22;
|
||||
_deputyMode = 18;
|
||||
_deputyShould = 18;
|
||||
kernel_trigger_dispatch_now(1);
|
||||
_val4 = -1;
|
||||
_sherrifMode = 26;
|
||||
_sherrifShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
_wilburMode = 2;
|
||||
_wilburShould = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
_series2 = series_play("138donut", 0x400, 0, -1, 7, -1, 100, 0, 0, 0, 0);
|
||||
|
||||
if (!inv_object_is_here("keys"))
|
||||
kernel_timing_trigger(10, 13);
|
||||
|
||||
if (!player_been_here(138)) {
|
||||
player_set_commands_allowed(false);
|
||||
wilbur_speech("138w001");
|
||||
}
|
||||
|
||||
digi_play("137_021", 2);
|
||||
}
|
||||
|
||||
void Room138::daemon() {
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_DEPUTY_ANIMATION:
|
||||
switch (_deputyMode) {
|
||||
case 18:
|
||||
switch (_deputyShould) {
|
||||
case 18:
|
||||
case 23:
|
||||
case 25:
|
||||
if (_deputyShould == 23 && _frame == 42) {
|
||||
freeAssets();
|
||||
_deputyMode = 23;
|
||||
series_play("138cp06", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 7, 0, 100, 0, 0, 30, 45);
|
||||
|
||||
} else if (_deputyShould == 25 && _frame == 42) {
|
||||
_deputyShould = 18;
|
||||
series_play("138cp02", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 7, 0, 100, 0, 0, 31, 61);
|
||||
|
||||
} else if (_frame == 42 && imath_ranged_rand(1, 5) != 1) {
|
||||
series_play("138cp01", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 60, 0, 100, 0, 0, 23, 23);
|
||||
|
||||
} else {
|
||||
if (++_frame == 43)
|
||||
_frame = 23;
|
||||
|
||||
series_play("138cp01", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 7, 0, 100, 0, 0, _frame, _frame);
|
||||
}
|
||||
break;
|
||||
|
||||
case 22:
|
||||
freeAssets();
|
||||
_deputyMode = 22;
|
||||
series_play("138cp04", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 7, 0, 100, 0, 0, 10, 16);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 22:
|
||||
if (imath_ranged_rand(1, 10) == 1) {
|
||||
series_play("138cp04", 0x500, 1, kCHANGE_DEPUTY_ANIMATION, 7, 0, 100, 0, 0, 16, 18);
|
||||
} else {
|
||||
series_play("138cp04", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 10, 0, 100, 0, 0, 16, 16);
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_deputyMode = 24;
|
||||
series_play("138cp06", 0x500, 0, kCHANGE_DEPUTY_ANIMATION, 6, 0, 100, 0, 0, 46, 49);
|
||||
digi_play("138_004", 1, 255);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
series_play("138cp06", 0x500, 0, -1, 60, -1, 100, 0, 0, 49, 49);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_SHERRIF_ANIMATION:
|
||||
switch (_sherrifMode) {
|
||||
case 26:
|
||||
switch (_sherrifShould) {
|
||||
case 26:
|
||||
case 33:
|
||||
case 36:
|
||||
if (_sherrifShould == 33 && _val4 == 22) {
|
||||
freeAssets();
|
||||
term_message("xxx");
|
||||
_sherrifShould = 34;
|
||||
series_play("138cp06", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 18);
|
||||
digi_play("138_005", 2);
|
||||
|
||||
} else if (_sherrifShould == 36 && _val4 == 22) {
|
||||
_sherrifShould = 26;
|
||||
series_play("138cp02", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 0, 30);
|
||||
randomDigi();
|
||||
|
||||
} else if (_val4 == 22 && !inv_object_is_here("keys") &&
|
||||
imath_ranged_rand(1, 2) == 1) {
|
||||
term_message(".........................");
|
||||
_sherrifShould = 37;
|
||||
series_play("138cp02", 0x100, 2, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 25, 30);
|
||||
|
||||
} else if (_val4 == 22 && imath_ranged_rand(1, 6) != 1) {
|
||||
series_play("138cp01", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 60, 0, 100, 0, 0, 0, 0);
|
||||
|
||||
} else {
|
||||
_flag1 = false;
|
||||
|
||||
switch (++_val4) {
|
||||
case 13:
|
||||
digi_play("137_022", 2);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_val4 = 0;
|
||||
digi_play(imath_ranged_rand(1, 2) == 1 ? "137_020" : "137_021", 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
series_play("138cp01", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 7, 0, 100, 0, 0, _val4, _val4);
|
||||
}
|
||||
break;
|
||||
|
||||
case 31:
|
||||
freeAssets();
|
||||
_sherrifShould = 32;
|
||||
series_play("138cp04", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 7, 0, 100, 0, 0, 0, 7);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
kernel_timing_trigger(120, 7);
|
||||
|
||||
if (!inv_object_is_here("keys"))
|
||||
_G(flags)[kPoliceState] = 6;
|
||||
|
||||
_G(flags)[kPoliceCheckCtr] = 200;
|
||||
_sherrifMode = 31;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 34:
|
||||
terminateMachineAndNull(_series2);
|
||||
_sherrifShould = 35;
|
||||
series_play("138cp06", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 19, 29);
|
||||
break;
|
||||
|
||||
case 35:
|
||||
kernel_timing_trigger(120, 7);
|
||||
|
||||
if (!inv_object_is_here("keys"))
|
||||
_G(flags)[kPoliceState] = 6;
|
||||
|
||||
_G(flags)[kPoliceCheckCtr] = 200;
|
||||
_sherrifMode = 33;
|
||||
kernel_trigger_dispatch_now(kCHANGE_SHERRIF_ANIMATION);
|
||||
break;
|
||||
|
||||
case 37:
|
||||
_sherrifShould = 38;
|
||||
series_play("138cp02", 0x100, 2, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 10, 24);
|
||||
randomDigi();
|
||||
break;
|
||||
|
||||
case 38:
|
||||
_sherrifShould = 26;
|
||||
series_play("138cp02", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 8, 0, 100, 0, 0, 26, 30);
|
||||
_flag1 = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 31:
|
||||
if (imath_ranged_rand(1, 10) == 1) {
|
||||
series_play("138cp04", 0x100, 1, kCHANGE_SHERRIF_ANIMATION, 7, 0, 100, 0, 0, 7, 9);
|
||||
} else {
|
||||
series_play("138cp04", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 10, 0, 100, 0, 0, 7, 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case 33:
|
||||
if (imath_ranged_rand(1, 10) == 1) {
|
||||
series_play("138cp06", 0x100, 1, kCHANGE_SHERRIF_ANIMATION, 7, 0, 100, 0, 0, 27, 29);
|
||||
} else {
|
||||
series_play("138cp06", 0x100, 0, kCHANGE_SHERRIF_ANIMATION, 10, 0, 100, 0, 0, 27, 27);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_wilburMode) {
|
||||
case 2:
|
||||
switch (_wilburShould) {
|
||||
case 1:
|
||||
switch (imath_ranged_rand(1, 20)) {
|
||||
case 1:
|
||||
_wilburMode = 3;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_wilburMode = 6;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 17, 17);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 30, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
series_load("138wi03");
|
||||
digi_preload("138_002");
|
||||
_wilburShould = 8;
|
||||
series_play("138wi05", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 0, 11);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_wilburShould = 9;
|
||||
series_play_with_breaks(PLAY1, "138wi03", 0xa00, kCHANGE_WILBUR_ANIMATION, 2, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
player_set_commands_allowed(true);
|
||||
_wilburShould = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
_deputyShould = 25;
|
||||
_sherrifShould = 36;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_wilburShould = 1;
|
||||
series_play_with_breaks(PLAY2, "138wi05", 0xa00, kCHANGE_WILBUR_ANIMATION, 2, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
series_load("138wi06");
|
||||
digi_preload("138_002");
|
||||
_wilburShould = 12;
|
||||
series_play("138wi05", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 11);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
_wilburShould = 13;
|
||||
series_play_with_breaks(PLAY3, "138wi06", 0xa00, kCHANGE_WILBUR_ANIMATION, 2, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_wilburShould = 14;
|
||||
series_play("138wi05", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 11);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
_wilburShould = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
|
||||
if (inv_object_is_here("keys")) {
|
||||
_sherrifShould = 33;
|
||||
_deputyShould = 23;
|
||||
} else {
|
||||
player_set_commands_allowed(true);
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
_wilburMode = 15;
|
||||
_G(walker).wilbur_say();
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
series_load("138wi03");
|
||||
digi_preload("138_001");
|
||||
_wilburShould = 17;
|
||||
series_play_with_breaks(PLAY4, "138wi03", 0xa00, kCHANGE_WILBUR_ANIMATION, 2, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_wilburShould = 9;
|
||||
series_play("138wi05", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 0, 11);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (_wilburShould == 1) {
|
||||
switch (imath_ranged_rand(1, 20)) {
|
||||
case 1:
|
||||
_wilburMode = 2;
|
||||
series_play("138wi01", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_wilburMode = 4;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 4, 9);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 30, 0, 100, 0, 0, 3, 3);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_wilburMode = 4;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 4, 9);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (_wilburShould == 1) {
|
||||
switch (imath_ranged_rand(1, 20)) {
|
||||
case 1:
|
||||
_wilburMode = 3;
|
||||
series_play("138wi01", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 4, 9);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_wilburMode = 5;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 10, 12);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 30, 0, 100, 0, 0, 9, 9);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_wilburMode = 5;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 10, 12);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (_wilburShould == 1) {
|
||||
switch (imath_ranged_rand(1, 20)) {
|
||||
case 1:
|
||||
_wilburMode = 4;
|
||||
series_play("138wi01", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 10, 12);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_wilburMode = 6;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 13, 17);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 30, 0, 100, 0, 0, 12, 12);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_wilburMode = 6;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 13, 17);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (_wilburShould == 1) {
|
||||
switch (imath_ranged_rand(1, 20)) {
|
||||
case 1:
|
||||
_wilburMode = 5;
|
||||
series_play("138wi01", 0xa00, 2, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 13, 17);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_wilburMode = 2;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 30, 0, 100, 0, 0, 17, 17);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
_wilburMode = 2;
|
||||
series_play("138wi01", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 7, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (_wilburShould == 15) {
|
||||
loadSeries();
|
||||
const int frame = imath_ranged_rand(0, 4);
|
||||
series_play("138wi02", 0xa00, 0, kCHANGE_WILBUR_ANIMATION, 4, 0, 100, 0, 0, frame, frame);
|
||||
|
||||
} else {
|
||||
freeSeries();
|
||||
_wilburShould = 1;
|
||||
_wilburMode = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_sherrifShould = 31;
|
||||
_deputyShould = 22;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// Waking them up
|
||||
_sherrifShould = 33;
|
||||
_deputyShould = 23;
|
||||
player_set_commands_allowed(false);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1010);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
terminateMachineAndNull(_series1);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
digi_play_loop("138_002", 3, 255);
|
||||
_G(flags)[kPoliceState] = 4;
|
||||
inv_give_to_player("keys");
|
||||
hotspot_set_active("keys", false);
|
||||
hotspot_set_active("ignition switch", true);
|
||||
_G(flags)[kPoliceCheckCtr]++;
|
||||
kernel_timing_trigger(10, 13);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
digi_preload("138_001");
|
||||
digi_play_loop("138_001", 3, 255);
|
||||
_series1 = series_play("138keys", 0xa00, 0, -1, 7, -1, 100, 0, 0, 0, 0);
|
||||
_G(flags)[kPoliceState] = 0;
|
||||
_G(flags)[kPoliceCheckCtr] = 0;
|
||||
inv_move_object("keys", 138);
|
||||
hotspot_set_active("keys", true);
|
||||
hotspot_set_active("ignition switch", false);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
digi_play_loop("138_002", 3, 255);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
if (_G(flags)[kPoliceCheckCtr] && player_commands_allowed()) {
|
||||
if (++_G(flags)[kPoliceCheckCtr] >= 200) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(flags)[kPoliceState] = 4;
|
||||
_sherrifShould = 33;
|
||||
_deputyShould = 23;
|
||||
}
|
||||
}
|
||||
|
||||
kernel_timing_trigger(10, 13);
|
||||
break;
|
||||
|
||||
case kWILBURS_SPEECH_START:
|
||||
_wilburShould = 15;
|
||||
player_set_commands_allowed(false);
|
||||
break;
|
||||
|
||||
case kWILBURS_SPEECH_FINISHED:
|
||||
_wilburShould = 1;
|
||||
player_set_commands_allowed(true);
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room138::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Nothing needed
|
||||
} else if (player_said("keys", "ignition switch")) {
|
||||
_wilburShould = 16;
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
} else if ((player_said("donuts") || player_said("keys") ||
|
||||
player_said("ignition switch") || player_said("horn") ||
|
||||
player_said("radio") || player_said("police radio") ||
|
||||
player_said("radar") || player_said("deputy") ||
|
||||
player_said("patrol car")) && inv_player_has(_G(player).verb)) {
|
||||
wilbur_speech("138w004");
|
||||
|
||||
} else if (player_said("gear", "horn")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(flags)[kPoliceState] = 1;
|
||||
_wilburShould = 10;
|
||||
|
||||
} else if (player_said("gear", "radio")) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (inv_object_is_here("keys"))
|
||||
_G(flags)[kPoliceState] = 2;
|
||||
|
||||
_wilburShould = 11;
|
||||
|
||||
} else if (player_said("talk to") &&
|
||||
(player_said("sheriff") || player_said("deputy"))) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(flags)[kPoliceState] = 3;
|
||||
wilbur_speech("138w610", 6, 138);
|
||||
_wilburShould = 15;
|
||||
|
||||
} else if (player_said("take", "keys") && !inv_player_has("keys")) {
|
||||
_wilburShould = 7;
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
} else if (player_said("look at", "keys") && inv_object_is_here("keys")) {
|
||||
wilbur_speech("138w005");
|
||||
|
||||
} else if (player_said("gear", "keys")) {
|
||||
wilbur_speech("138w004");
|
||||
|
||||
} else if (player_said("keys") && inv_player_has(_G(player).verb)) {
|
||||
wilbur_speech("138w004");
|
||||
|
||||
} else if (player_said("exit") || player_said("look at", "exit")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1010);
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room138::freeAssets() {
|
||||
if (!_assetsFreed) {
|
||||
_assetsFreed = true;
|
||||
digi_stop(2);
|
||||
|
||||
static const char *NAMES[11] = {
|
||||
"137_020", "137_021", "137_022", "137_023", "137_024",
|
||||
"137_025", "137_026", "137_027", "137_028", "137_012",
|
||||
"137_013"
|
||||
};
|
||||
for (int i = 0; i < 11; ++i)
|
||||
digi_unload(NAMES[i]);
|
||||
|
||||
digi_unload(inv_object_is_here("keys") ? "138_002" : "138_001");
|
||||
}
|
||||
}
|
||||
|
||||
void Room138::randomDigi() {
|
||||
digi_play(Common::String::format("137_0%d", imath_ranged_rand(23, 27)).c_str(), 2);
|
||||
}
|
||||
|
||||
void Room138::loadSeries() {
|
||||
if (_series3 == -1)
|
||||
_series3 = series_load("138wi02");
|
||||
}
|
||||
|
||||
void Room138::freeSeries() {
|
||||
if (_series3 != -1) {
|
||||
series_unload(_series3);
|
||||
_series3 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
66
engines/m4/burger/rooms/section1/room138.h
Normal file
66
engines/m4/burger/rooms/section1/room138.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM138_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM138_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room138 : public Room {
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
int _series3 = 0;
|
||||
int _frame = 0;
|
||||
int _deputyMode = 0;
|
||||
int _deputyShould = 0;
|
||||
int _val4 = 0;
|
||||
int _sherrifMode = 0;
|
||||
int _sherrifShould = 0;
|
||||
int _wilburMode = 0;
|
||||
int _wilburShould = 0;
|
||||
bool _assetsFreed = false;
|
||||
bool _flag1 = false;
|
||||
|
||||
void freeAssets();
|
||||
void randomDigi();
|
||||
void loadSeries();
|
||||
void freeSeries();
|
||||
|
||||
public:
|
||||
Room138() : Room() {}
|
||||
~Room138() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
494
engines/m4/burger/rooms/section1/room139_144.cpp
Normal file
494
engines/m4/burger/rooms/section1/room139_144.cpp
Normal file
@@ -0,0 +1,494 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room139_144.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_BURL_ANIMATION = 9
|
||||
};
|
||||
|
||||
static const char *SAID1[][4] = {
|
||||
{ "ISLAND", nullptr, "999w011", "999w011" },
|
||||
{ "ROCK", "144W004", "999w011", "999w011" },
|
||||
{ "SHACK", "144W005", "999w011", nullptr },
|
||||
{ "SIGN", "144W006", nullptr, nullptr },
|
||||
{ "ROWBOAT", "144W007", nullptr, nullptr },
|
||||
{ "WATER", "144W008", "999w011", "144W009" },
|
||||
{ "BURL", "144W010", "999w011", "999w011" },
|
||||
{ "MOTORBOAT", "144W012", nullptr, "144W013" },
|
||||
{ "VERA'S DINER", nullptr, "999w011", "999w011" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const char *SAID2[][4] = {
|
||||
{ "ISLAND", "139W001", "139W002", "139W002" },
|
||||
{ "ROCK", nullptr, "139W002", "139W002" },
|
||||
{ "SHACK", "139W005", "139W002", nullptr },
|
||||
{ "SIGN", "139W006", nullptr, nullptr },
|
||||
{ "ROWBOAT", "139W007", nullptr, nullptr },
|
||||
{ "WATER", "139W008", "139W002", "139W009" },
|
||||
{ "VERA'S DINER", nullptr, "139W002", "139W002" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 32, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 33, 39, "139_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{40, 43, nullptr, 1, 255, 8, 0, 0, nullptr, 0},
|
||||
{44, 52, "139_003", 2, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
{52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0},
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 35, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 36, 39, "144_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 40, 46, nullptr, 1, 255, 8, 0, 0, nullptr, 0 },
|
||||
{ 47, 52, "144_003", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 52, 52, nullptr, 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak SERIES1[] = {
|
||||
{ 6, nullptr, 2, 255, 2, 0, nullptr, 0 },
|
||||
{ 10, "100_022", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesStreamBreak SERIES2[] = {
|
||||
{ 1, "144b001", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 45, nullptr, 1, 255, 5, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room139_144::init() {
|
||||
_val1 = 0;
|
||||
_burlFrame = 15;
|
||||
digi_preload("144_001");
|
||||
|
||||
if (_G(game).previous_room == 144)
|
||||
preloadDigi();
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 139:
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(470, 269, 8);
|
||||
_burlShould = 1;
|
||||
_burlMode = 3;
|
||||
kernel_trigger_dispatch_now(9);
|
||||
break;
|
||||
|
||||
case 141:
|
||||
ws_demand_location(250, 224, 4);
|
||||
break;
|
||||
|
||||
case 142:
|
||||
ws_demand_location(670, 257, 9);
|
||||
ws_walk(596, 245, nullptr, -1, 8);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(320, 271, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_G(game).previous_room != 139 && _G(flags)[V000] == 1002) {
|
||||
_burlShould = _burlMode = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_BURL_ANIMATION);
|
||||
}
|
||||
|
||||
if (_G(flags)[kPerkinsLostIsland]) {
|
||||
series_play("144mb01", 0x600, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
} else {
|
||||
hotspot_set_active("motorboat", false);
|
||||
}
|
||||
|
||||
_series1 = series_play((_G(flags)[V000] == 1002) ? "144rboat" : "139rboat",
|
||||
0xf00, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
digi_play_loop("144_001", 3);
|
||||
}
|
||||
|
||||
void Room139_144::daemon() {
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case 2:
|
||||
digi_change_volume(2, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Burl's truck crashing off of bridge
|
||||
pal_fade_set_start(0);
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_series1);
|
||||
gr_backup_palette();
|
||||
|
||||
digi_preload("100_022");
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "120dt01", 8, 0, 1012);
|
||||
kernel_timing_trigger(1, 4);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
pal_fade_init(15, 255, 100, 0, -1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
digi_play("144b003d", 1);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
player_set_commands_allowed(true);
|
||||
_burlShould = 3;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_series1);
|
||||
|
||||
if (_G(flags)[V000] == 1002) {
|
||||
series_play_with_breaks(PLAY2, "144wi01", 0xf00, -1, 3, 6, 100, 0, 0);
|
||||
} else {
|
||||
series_play_with_breaks(PLAY1, "139wi01", 0xf00, -1, 3, 6, 100, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1013);
|
||||
break;
|
||||
|
||||
case kCHANGE_BURL_ANIMATION:
|
||||
switch (_burlMode) {
|
||||
case 3:
|
||||
switch (_burlShould) {
|
||||
case 1:
|
||||
_burlShould = 2;
|
||||
series_play("144bu01s", 0x301, 0, -1, 8);
|
||||
digi_preload("144b003d");
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
series_stream_with_breaks(SERIES2, "144bu01", 8, 0x300, kCHANGE_BURL_ANIMATION);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
digi_unload_stream_breaks(SERIES2);
|
||||
player_set_commands_allowed(true);
|
||||
randomDigi();
|
||||
_burlShould = 3;
|
||||
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 15);
|
||||
series_play("144bu03s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 15);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (imath_ranged_rand(5, 10) < ++_val1) {
|
||||
switch (imath_ranged_rand(1, 4)) {
|
||||
case 1:
|
||||
_burlFrame = 25;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_burlFrame = 36;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_burlFrame = 41;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_burlFrame = 42;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (imath_ranged_rand(1, 10) == 1) {
|
||||
switch (imath_ranged_rand(1, 4)) {
|
||||
case 1:
|
||||
randomDigi();
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 10, 0, 100, 0, 0, 16, 24);
|
||||
series_play("144bu03s", 0x301, 0, -1, 10, 0, 100, 0, 0, 16, 24);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
randomDigi();
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 10, 0, 100, 0, 0, 26, 35);
|
||||
series_play("144bu03s", 0x301, 0, -1, 10, 0, 100, 0, 0, 26, 35);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
randomDigi();
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 10, 0, 100, 0, 0, 37, 40);
|
||||
series_play("144bu03s", 0x301, 0, -1, 10, 0, 100, 0, 0, 37, 40);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_burlShould = 7;
|
||||
series_play("144bu06", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 12);
|
||||
series_play("144bu06s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 12);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, _burlFrame, _burlFrame);
|
||||
series_play("144bu03s", 0x301, 0, -1, 7, 0, 100, 0, 0, _burlFrame, _burlFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
digi_play("144b002", 2);
|
||||
_burlMode = 6;
|
||||
series_play("144bu06", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 2);
|
||||
series_play("144bu06s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 2);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
digi_change_volume(2, 0);
|
||||
_burlMode = 7;
|
||||
series_play("144bu07", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 2);
|
||||
series_play("144bu07s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
switch (_burlShould) {
|
||||
case 4:
|
||||
series_play("144bu08", 0x300, 0, kCHANGE_BURL_ANIMATION, 10, 0, 100, 0, 0, 3, 3);
|
||||
series_play("144bu08s", 0x301, 0, -1, 10, 0, 100, 0, 0, 3, 3);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_burlMode = 5;
|
||||
series_play("144bu08", 0x300, 0, kCHANGE_BURL_ANIMATION, 4, 0, 100, 0, 0, 4, 7);
|
||||
series_play("144bu08s", 0x301, 0, -1, 4, 0, 100, 0, 0, 4, 7);
|
||||
break;
|
||||
|
||||
default:
|
||||
digi_play("144b002", 2);
|
||||
_burlMode = 3;
|
||||
_burlShould = 2;
|
||||
series_play("144bu08", 0x300, 2, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 3);
|
||||
series_play("144bu08s", 0x301, 2, -1, 7, 0, 100, 0, 0, 0, 3);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (_burlShould == 5) {
|
||||
const int frame = imath_ranged_rand(0, 2);
|
||||
series_play("144bu09", 0x300, 0, kCHANGE_BURL_ANIMATION, 4, 0, 100, 0, 0, frame, frame);
|
||||
series_play("144bu09s", 0x301, 0, -1, 4, 0, 100, 0, 0, frame, frame);
|
||||
|
||||
if (_digi1) {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
digi_play(_digi1, 1, 255, 1);
|
||||
_digi1 = nullptr;
|
||||
}
|
||||
} else {
|
||||
_burlMode = 4;
|
||||
series_play("144bu08", 0x300, 2, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 4, 7);
|
||||
series_play("144bu08s", 0x301, 2, -1, 7, 0, 100, 0, 0, 4, 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_burlMode = 4;
|
||||
series_play("144bu08", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 3);
|
||||
series_play("144bu08s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 3);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
if (_burlShould == 7) {
|
||||
if (imath_ranged_rand(1, 10) == 1) {
|
||||
randomDigi();
|
||||
_burlMode = 3;
|
||||
_burlShould = 3;
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 15);
|
||||
series_play("144bu03s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 15);
|
||||
} else {
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
|
||||
series_play("144bu03s", 0x301, 0, -1, 10, 0, 100, 0, 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
_burlMode = 3;
|
||||
series_play("144bu03", 0x300, 0, kCHANGE_BURL_ANIMATION, 7, 0, 100, 0, 0, 0, 15);
|
||||
series_play("144bu03s", 0x301, 0, -1, 7, 0, 100, 0, 0, 0, 15);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlEntersTown:
|
||||
if (!_G(flags)[kRoadOpened]) {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
} else if (player_commands_allowed() && _G(player).walker_visible && INTERFACE_VISIBLE) {
|
||||
Section1::updateDisablePlayer();
|
||||
kernel_timing_trigger(1, 3);
|
||||
} else {
|
||||
kernel_timing_trigger(60, kBurlEntersTown);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room139_144::pre_parser() {
|
||||
if (player_said("vera's diner") && player_said_any("enter", "look", "look at"))
|
||||
player_hotspot_walk_override_just_face(3);
|
||||
}
|
||||
|
||||
void Room139_144::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (player_said("talk to")) {
|
||||
conv_load_and_prepare("conv31", 6);
|
||||
conv_export_value_curr(_G(flags)[V052], 0);
|
||||
conv_export_value_curr(_G(flags)[kPerkinsLostIsland], 1);
|
||||
conv_play_curr();
|
||||
|
||||
} else if (_G(flags)[V000] == 1002 && _G(walker).wilbur_said(SAID1)) {
|
||||
// Do nothing
|
||||
} else if (_G(flags)[V000] == 1002 && _G(walker).wilbur_said(SAID2)) {
|
||||
// Do nothing
|
||||
} else if (player_said("conv31")) {
|
||||
conv31();
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) && _G(flags)[V000] == 1002 &&
|
||||
player_said_any("island", "rock")) {
|
||||
_G(walker).wilbur_speech("999w011");
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) && _G(flags)[V000] == 1002 &&
|
||||
player_said("burl")) {
|
||||
_G(walker).wilbur_speech("144w011");
|
||||
|
||||
} else if (inv_player_has(_G(player).verb) && _G(flags)[V000] != 1002 &&
|
||||
player_said_any("rock", "island")) {
|
||||
_G(walker).wilbur_speech("139w002");
|
||||
|
||||
} else if (lookFlag && player_said("rock")) {
|
||||
wilbur_speech(inv_player_has("deed") ? "139w004" : "139w003");
|
||||
|
||||
} else if (lookFlag && player_said("island") && _G(flags)[V000] == 1002) {
|
||||
wilbur_speech(_G(flags)[kPerkinsLostIsland] ? "144w002" : "144w001");
|
||||
|
||||
} else if (player_said("enter", "vera's diner") || (lookFlag && player_said("vera's diner"))) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 1014);
|
||||
|
||||
} else if (player_said("gear", "rowboat") || player_said("go island")) {
|
||||
player_set_commands_allowed(false);
|
||||
kernel_trigger_dispatch_now(7);
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room139_144::preloadDigi() {
|
||||
digi_preload("144b002");
|
||||
digi_preload("144b003a");
|
||||
digi_preload("144b003b");
|
||||
digi_preload("144b003c");
|
||||
}
|
||||
|
||||
void Room139_144::randomDigi() {
|
||||
if (!digi_play_state(2)) {
|
||||
digi_play(Common::String::format("144b003%c", 'a' + imath_ranged_rand(0, 2)).c_str(), 2, 255);
|
||||
}
|
||||
|
||||
digi_change_volume(2, 255);
|
||||
}
|
||||
|
||||
void Room139_144::conv31() {
|
||||
_G(kernel).trigger_mode = KT_PARSE;
|
||||
const int who = conv_whos_talking();
|
||||
|
||||
if (_G(kernel).trigger == 1) {
|
||||
if (who <= 0) {
|
||||
_burlShould = 4;
|
||||
conv_resume();
|
||||
} else if (who == 1) {
|
||||
conv_resume();
|
||||
sendWSMessage(0x150000, 0, _G(my_walker), 0, nullptr, 1);
|
||||
}
|
||||
} else if (conv_sound_to_play()) {
|
||||
if (who <= 0) {
|
||||
_burlShould = 5;
|
||||
_digi1 = conv_sound_to_play();
|
||||
} else if (who == 1) {
|
||||
wilbur_speech(conv_sound_to_play(), 1);
|
||||
}
|
||||
} else {
|
||||
conv_resume();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
58
engines/m4/burger/rooms/section1/room139_144.h
Normal file
58
engines/m4/burger/rooms/section1/room139_144.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM144_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM144_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room139_144 : public Room {
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
const char *_digi1 = nullptr;
|
||||
int _val1 = 0;
|
||||
int _burlFrame = 0;
|
||||
int _burlShould = 0;
|
||||
int _burlMode = 0;
|
||||
|
||||
void preloadDigi();
|
||||
void randomDigi();
|
||||
void conv31();
|
||||
|
||||
public:
|
||||
Room139_144() : Room() {}
|
||||
~Room139_144() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1065
engines/m4/burger/rooms/section1/room140_141.cpp
Normal file
1065
engines/m4/burger/rooms/section1/room140_141.cpp
Normal file
File diff suppressed because it is too large
Load Diff
63
engines/m4/burger/rooms/section1/room140_141.h
Normal file
63
engines/m4/burger/rooms/section1/room140_141.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM140_141_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM140_141_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room140_141 : public Room {
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
int _elmoMode = 0;
|
||||
int _elmoShould = 0;
|
||||
int _trufflesMode = 0;
|
||||
int _trufflesShould = 0;
|
||||
int _wilburMode = 0;
|
||||
int _wilburShould = 0;
|
||||
int _trufflesFrame = 0;
|
||||
bool _flag1 = false;
|
||||
bool _flag2 = false;
|
||||
|
||||
void conv20();
|
||||
void playRandom();
|
||||
void loadSeries();
|
||||
|
||||
public:
|
||||
Room140_141() : Room() {}
|
||||
~Room140_141() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
763
engines/m4/burger/rooms/section1/room142.cpp
Normal file
763
engines/m4/burger/rooms/section1/room142.cpp
Normal file
@@ -0,0 +1,763 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room142.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/burger.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "VERA'S DINER", "142w001", "142w002", "142w002" },
|
||||
{ "CAR", "142w003", nullptr, "142w004" },
|
||||
{ "FANBELT", "142w005", nullptr, "142w002" },
|
||||
{ "ICE BOX", "142w006", "142w002", nullptr },
|
||||
{ "ICE", nullptr, nullptr, "142w002" },
|
||||
{ "GARBAGE CANS", "142w010", "142w011", "142w012" },
|
||||
{ "BACK DOOR", "142w013", "142w002", nullptr },
|
||||
{ "PLANTS", "142w014", "142w015", "142w002" },
|
||||
{ "SIGN", "142w016", "142w017", "142w002" },
|
||||
{ "SIGN ", "142w018", "142w002", "142w002" },
|
||||
{ "FRONT DOOR", nullptr, "142w002", nullptr },
|
||||
{ "MAIN STREET", nullptr, "142w002", nullptr },
|
||||
{ "HANLON'S POINT", nullptr, "142w002", nullptr },
|
||||
{ "AUNT POLLY'S HOUSE", nullptr, "142w002", nullptr },
|
||||
{ "PARKING LOT", nullptr, "142w002", nullptr },
|
||||
{ "HIGHWAY 2", "142w020", "142w002", "142w021" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const WilburMatch Room142::MATCH[] = {
|
||||
{ "GEAR", "PARKING LOT", 9, &Flags::_flags[V000], 1003, &_val1, 18 },
|
||||
{ "LOOK AT", "PARKING LOT", 9, &Flags::_flags[V000], 1003, &_val1, 18 },
|
||||
{ "GEAR", "PARKING LOT", 5, &Flags::_flags[kTourBusAtDiner], 0, &_val2, 13 },
|
||||
{ "LOOK AT", "PARKING LOT", 5, &Flags::_flags[kTourBusAtDiner], 0, &_val2, 13 },
|
||||
{ "GEAR", "ICE BOX", kCHANGE_WILBUR_ANIMATION, &Flags::_flags[kIceBoxOpened], 0, &Vars::_wilbur_should, 1 },
|
||||
{ "TAKE", "FANBELT", kCHANGE_WILBUR_ANIMATION, nullptr, 0, &Vars::_wilbur_should, 9 },
|
||||
{ "GEAR", "BACK DOOR", 6, nullptr, 0, nullptr, 0 },
|
||||
WILBUR_MATCH_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY1[] = {
|
||||
{ 8, 12, "100_010", 2, 255, -1, 0, 0, &_val3, 1 },
|
||||
{ 8, 12, "100_011", 2, 255, -1, 0, 0, &_val3, 2 },
|
||||
{ 8, 12, "100_012", 2, 255, -1, 0, 0, &_val3, 3 },
|
||||
{ 13, -1, nullptr, 0, 0, 10, 0, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY2[] = {
|
||||
{ 0, -1, "100_015", 2, 255, -1, 1, 3, nullptr, 0 },
|
||||
{ 0, -1, "100_017", 2, 255, -1, 1, 3, nullptr, 0 },
|
||||
{ 1, 1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY3[] = {
|
||||
{ 0, 26, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 27, -1, nullptr, 0, 0, 14, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY4[] = {
|
||||
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, 6, "142b901", 2, 255, -1, 4, -1, nullptr, 0 },
|
||||
{ 7, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY5[] = {
|
||||
{ 1, 1, "100_021", 2, 255, -1, 0, 12, nullptr, 0 },
|
||||
{ 0, -1, "100_015", 2, 255, -1, 1, 4, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY6[] = {
|
||||
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 10, "100_010", 2, 255, -1, 0, 0, &_val3, 1 },
|
||||
{ 1, 10, "100_011", 2, 255, -1, 0, 0, &_val3, 2 },
|
||||
{ 1, 10, "100_012", 2, 255, -1, 0, 0, &_val3, 3 },
|
||||
{ 11, 14, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY7[] = {
|
||||
{ 15, -1, "100_010", 2, 255, -1, 0, 0, &_val3, 1 },
|
||||
{ 15, -1, "100_011", 2, 255, -1, 0, 0, &_val3, 2 },
|
||||
{ 15, -1, "100_012", 2, 255, -1, 0, 0, &_val3, 3 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY8[] = {
|
||||
{ 0, 5, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 25, nullptr, 0, 0, 13, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY9[] = {
|
||||
{ 0, 3, "142_003", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY10[] = {
|
||||
{ 3, 0, "142_002", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY11[] = {
|
||||
{ 4, 13, "142_001", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 14, -1, "142_002", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY12[] = {
|
||||
{ 0, -1, "142_005", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY13[] = {
|
||||
{ 0, 1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, 7, "100_010", 2, 255, -1, 0, 0, &_val3, 1 },
|
||||
{ 2, 7, "100_011", 2, 255, -1, 0, 0, &_val3, 2 },
|
||||
{ 2, 7, "100_012", 2, 255, -1, 0, 0, &_val3, 3 },
|
||||
{ -1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room142::PLAY14[] = {
|
||||
{ 0, 19, "142_007", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
int32 Room142::_val1;
|
||||
int32 Room142::_val2;
|
||||
int32 Room142::_val3;
|
||||
|
||||
Room142::Room142() : Room() {
|
||||
_val1 = 0;
|
||||
_val2 = 0;
|
||||
_val3 = 0;
|
||||
}
|
||||
|
||||
void Room142::init() {
|
||||
digi_preload("142_004");
|
||||
digi_play_loop("142_004", 3, 255, -1);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
if (_G(flags)[kIceBoxOpened]) {
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 101:
|
||||
ws_demand_location(120, 400, 2);
|
||||
ws_walk(120, 344, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
case 139:
|
||||
ws_demand_location(-40, 375, 2);
|
||||
ws_walk(25, 344, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
case 143:
|
||||
ws_demand_location(350, 270, 8);
|
||||
ws_walk(297, 275, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
case 145:
|
||||
ws_demand_location(293, 275, 7);
|
||||
ws_walk(282, 280, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
case 170:
|
||||
ws_demand_location(680, 325, 9);
|
||||
ws_walk(613, 331, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(270, 320);
|
||||
ws_demand_facing(5);
|
||||
break;
|
||||
}
|
||||
|
||||
series_play("142sm01", 0xf00, 4, -1, 6, -1);
|
||||
_series1 = series_show("142door", 0xe00);
|
||||
|
||||
if (inv_player_has("PANTYHOSE")) {
|
||||
hotspot_set_active("FANBELT", false);
|
||||
hotspot_set_active("ENGINE", true);
|
||||
} else {
|
||||
hotspot_set_active("FANBELT", true);
|
||||
hotspot_set_active("ENGINE", false);
|
||||
}
|
||||
|
||||
hotspot_set_active("TRUCK", false);
|
||||
|
||||
if (_G(flags)[V000] == 1003) {
|
||||
_noWalk = intr_add_no_walk_rect(230, 250, 294, 277, 229, 278,
|
||||
_G(screenCodeBuff)->get_buffer());
|
||||
_series2 = series_show("142dt01", 0xd00, 0, -1, -1, 22);
|
||||
_series3 = series_show("142dt01s", 0xd01, 0, -1, -1, 22);
|
||||
hotspot_set_active("TRUCK", true);
|
||||
}
|
||||
|
||||
hotspot_set_active("TOUR BUS", false);
|
||||
|
||||
if (_G(flags)[kTourBusAtDiner]) {
|
||||
_series4 = series_show("142ba01", 0xf00, 0, -1, -1, 21);
|
||||
hotspot_set_active("TOUR BUS", true);
|
||||
}
|
||||
|
||||
if (!_G(flags)[kIceBoxOpened]) {
|
||||
_series5 = series_show("142icedr", 0xe00);
|
||||
hotspot_set_active("ICE", false);
|
||||
}
|
||||
}
|
||||
|
||||
void Room142::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
terminateMachineAndNull(_series8);
|
||||
terminateMachineAndNull(_series5);
|
||||
terminateMachineAndNull(_series1);
|
||||
|
||||
if (_G(player_info.y) < 285) {
|
||||
Section1::updateWalker(getRoadEdgeX(_G(player_info).y), 285, 9, 2);
|
||||
} else {
|
||||
Section1::updateWalker(getRoadEdgeX(_G(player_info).y), _G(player_info).y, 9, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_series8 = series_play("142sm01", 0xf00, 4);
|
||||
_series5 = series_play("142icedr", 0xe00);
|
||||
_series1 = series_play("142door", 0xe00);
|
||||
_G(walker).reset_walker_sprites();
|
||||
play015();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
play015();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
digi_unload("142_006");
|
||||
digi_play_loop("142_004", 3);
|
||||
hotspot_set_active("TOUR BUS", true);
|
||||
_series4 = series_play("142ba01", 0xf00, 16, -1, 10, 0, 100, 0, 0, 20, 21);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
switch (_val2) {
|
||||
case 11:
|
||||
wilbur_speech("142w007");
|
||||
break;
|
||||
case 12:
|
||||
wilbur_speech(inv_player_has("BLOCK OF ICE") ?
|
||||
"142w007" : "142w008");
|
||||
break;
|
||||
case 13:
|
||||
wilbur_speech("142w019");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
player_set_commands_allowed(false);
|
||||
digi_play("142v901", 1, 255, 7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
digi_play("142e901", 1, 255, 8);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
switch (_val1) {
|
||||
case 14:
|
||||
_val3 = imath_ranged_rand(1, 3);
|
||||
_val1 = 15;
|
||||
_volume = 155;
|
||||
series_play_with_breaks(PLAY1, "142dt01", 0xd00, 9, 3, 6, 100);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
digi_stop(1);
|
||||
digi_unload("100_015");
|
||||
faceTruck();
|
||||
hotspot_set_active("TRUCK", true);
|
||||
_val1 = 16;
|
||||
series_play_with_breaks(PLAY2, "142dt02", 0xd00, 9, 3, 8, 100);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
_val1 = 17;
|
||||
series_play_with_breaks(PLAY3, "142bu01", 0xd00, 9, 3, 6, 100);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_noWalk = intr_add_no_walk_rect(230, 250, 294, 277, 229, 278);
|
||||
player_set_commands_allowed(true);
|
||||
_series2 = series_show("142dt01", 0xd00, 0, -1, -1, 22);
|
||||
_series3 = series_show("142dt01s", 0xd01, 0, -1, -1, 22);
|
||||
_series1 = series_show("142door", 0xe00);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
player_set_commands_allowed(false);
|
||||
ws_turn_to_face(3);
|
||||
series_play_with_breaks(PLAY4, "142bu02", 0xd00, 8, 2, 6, 100);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_val1 = 20;
|
||||
series_play_with_breaks(PLAY5, "142dt02", 0xd00, 9, 3, 8, 100);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
digi_preload("100_015");
|
||||
digi_play_loop("100_015", 1);
|
||||
_val3 = imath_ranged_rand(1, 3);
|
||||
_val1 = 21;
|
||||
series_play_with_breaks(PLAY6, "142dt03", 0xd00, 9, 3);
|
||||
break;
|
||||
|
||||
case 21:
|
||||
_val3 = imath_ranged_rand(1, 3);
|
||||
series_play_with_breaks(PLAY7, "142dt03", 0xf00, 8, 3);
|
||||
_volume = 255;
|
||||
kernel_trigger_dispatch_now(11);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_volume -= 10;
|
||||
if (_volume > 0) {
|
||||
term_message("fading truck theme, current volume = %d", _volume);
|
||||
digi_change_volume(3, _volume);
|
||||
kernel_timing_trigger(6, 10);
|
||||
} else {
|
||||
digi_stop(3);
|
||||
digi_unload("100_013");
|
||||
digi_play_loop("142_004", 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
_volume -= 20;
|
||||
if (_volume > 0) {
|
||||
term_message("fading truck noise, current volume = %d", _volume);
|
||||
digi_change_volume(1, _volume);
|
||||
kernel_timing_trigger(6, 11);
|
||||
} else {
|
||||
digi_stop(1);
|
||||
digi_stop(2);
|
||||
digi_unload("100_015");
|
||||
digi_unload("100_021");
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_series1 = series_show("142door", 0xe00);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
terminateMachineAndNull(_series1);
|
||||
break;
|
||||
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
terminateMachineAndNull(_series5);
|
||||
disable_player();
|
||||
_G(wilbur_should) = 2;
|
||||
series_play_with_breaks(PLAY9, "142wi04", 0xdff, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
player_set_commands_allowed(true);
|
||||
_G(flags)[kIceBoxOpened] = 1;
|
||||
hotspot_set_active("ICE", true);
|
||||
_series6 = series_show("142wi04", 0xdff, 0, -1, -1, 3);
|
||||
_series7 = series_show("142wi04s", 0xdfe, 0, -1, -1, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (inv_player_has("BLOCK OF ICE")) {
|
||||
wilbur_speech("142w009");
|
||||
} else {
|
||||
player_set_commands_allowed(false);
|
||||
terminateMachineAndNull(_series6);
|
||||
terminateMachineAndNull(_series7);
|
||||
_G(wilbur_should) = 4;
|
||||
|
||||
series_play_with_breaks(PLAY11, "142wi04", 0xdff, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_G(flags)[kIceBoxOpened] = 0;
|
||||
hotspot_set_active("ICE", false);
|
||||
_series5 = series_show("142icedr", 0xf00);
|
||||
enable_player();
|
||||
inv_give_to_player("BLOCK OF ICE");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
player_set_commands_allowed(false);
|
||||
terminateMachineAndNull(_series6);
|
||||
terminateMachineAndNull(_series7);
|
||||
_G(wilbur_should) = 6;
|
||||
|
||||
series_play_with_breaks(PLAY10, "142wi02", 0xdff, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_G(flags)[kIceBoxOpened] = 0;
|
||||
hotspot_set_active("ICE", false);
|
||||
_series5 = series_show("142icedr", 0xe00);
|
||||
enable_player();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
player_set_commands_allowed(false);
|
||||
terminateMachineAndNull(_series6);
|
||||
terminateMachineAndNull(_series7);
|
||||
_G(wilbur_should) = 8;
|
||||
|
||||
series_play_with_breaks(PLAY10, "142wi04", 0xdff, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_G(flags)[kIceBoxOpened] = 0;
|
||||
hotspot_set_active("ICE", false);
|
||||
_series5 = series_show("142icedr", 0xe00);
|
||||
enable_player();
|
||||
triggerParser();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 10;
|
||||
series_play_with_breaks(PLAY12, "142wi05", 0x400, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
enable_player();
|
||||
hotspot_set_active("FANBELT", false);
|
||||
inv_give_to_player("PANTYHOSE");
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlEntersTown:
|
||||
if (!_G(flags)[kRoadOpened]) {
|
||||
if (_series2) {
|
||||
terminateMachineAndNull(_series2);
|
||||
terminateMachineAndNull(_series3);
|
||||
}
|
||||
if (_series4) {
|
||||
terminateMachineAndNull(_series4);
|
||||
_G(flags)[kTourBusAtDiner] = 0;
|
||||
}
|
||||
|
||||
_G(flags)[V000] = 1003;
|
||||
|
||||
if (player_commands_allowed() && _G(player).walker_visible &&
|
||||
INTERFACE_VISIBLE && !digi_play_state(1)) {
|
||||
digi_preload("100_013");
|
||||
digi_play("100_013", 3, 155);
|
||||
Section1::updateDisablePlayer();
|
||||
preloadAssets2();
|
||||
|
||||
if (getRoadEdgeX(_G(player_info).y) > _G(player_info).x ||
|
||||
(_G(player_info).x < 298 && _G(player_info).y < 285)) {
|
||||
// Get off the road
|
||||
kernel_timing_trigger(240, 1);
|
||||
} else {
|
||||
// Not on road, so show truck arriving
|
||||
kernel_timing_trigger(240, 3);
|
||||
}
|
||||
} else {
|
||||
kernel_timing_trigger(15, 10028);
|
||||
}
|
||||
} else {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case kBurlLeavesTown:
|
||||
if (_G(flags)[V000] == 1002) {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
|
||||
} else {
|
||||
player_update_info();
|
||||
|
||||
if (player_commands_allowed() && _G(player).walker_visible &&
|
||||
INTERFACE_VISIBLE && !digi_play_state(1)) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (_G(player_info).y > 285) {
|
||||
faceTruck();
|
||||
} else {
|
||||
player_walk_to(267, 290, 262, 278);
|
||||
}
|
||||
|
||||
preloadAssets();
|
||||
_G(flags)[V000] = 1004;
|
||||
intr_remove_no_walk_rect(_noWalk);
|
||||
hotspot_set_active("TRUCK", false);
|
||||
|
||||
terminateMachineAndNull(_series1);
|
||||
terminateMachineAndNull(_series2);
|
||||
|
||||
_val1 = 19;
|
||||
series_play_with_breaks(PLAY8, "142bu03", 0xd00, 9, 3);
|
||||
} else {
|
||||
kernel_timing_trigger(15, kBurlLeavesTown);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kBandEntersTown:
|
||||
if (_series2) {
|
||||
terminateMachineAndNull(_series2);
|
||||
_G(flags)[V000] = _G(flags)[kRoadOpened] ? 1002 : 1004;
|
||||
}
|
||||
|
||||
if (!_G(flags)[kTourBusAtDiner]) {
|
||||
_G(flags)[kTourBusAtDiner] = 1;
|
||||
digi_preload("142_006");
|
||||
digi_play("142_006", 3, 255, 4);
|
||||
series_play_with_breaks(PLAY14, "142ba01", 0xf00, -1, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case kCALLED_EACH_LOOP:
|
||||
if (_actionType == 0) {
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
} else {
|
||||
checkAction();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room142::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(flags)[kIceBoxOpened]) {
|
||||
_G(player).ready_to_walk = false;
|
||||
_G(player).need_to_walk = false;
|
||||
|
||||
if (player_said("GEAR", "ICE BOX")) {
|
||||
_G(wilbur_should) = 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("ICE")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
if (_G(flags)[V040] && !inv_player_has("BLOCK OF ICE")) {
|
||||
wilbur_speech("142w008");
|
||||
} else {
|
||||
wilbur_speech("142w007");
|
||||
}
|
||||
} else if (player_said("TAKE")) {
|
||||
if (!_G(flags)[V040]) {
|
||||
wilbur_speech("142w017");
|
||||
} else if (inv_player_has("BLOCK_OF_ICE")) {
|
||||
wilbur_speech("142w009");
|
||||
} else {
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
} else if (player_said("GEAR")) {
|
||||
wilbur_speech("142w002");
|
||||
} else {
|
||||
term_message("ERROR - don't know what to do with ice!!!");
|
||||
}
|
||||
} else {
|
||||
_G(wilbur_should) = 7;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
|
||||
} else {
|
||||
if (_G(flags)[V000] == 1003 &&
|
||||
_G(player).walk_x >= 230 && _G(player).walk_x <= 294 &&
|
||||
_G(player).walk_y >= 250 && _G(player).walk_y <= 277) {
|
||||
player_hotspot_walk_override(_G(player).click_x, 278);
|
||||
} else if (player_said_any("GEAR", "LOOK AT")) {
|
||||
if (player_said("MAIN STREET")) {
|
||||
player_hotspot_walk_override(_G(player).walk_x, 400);
|
||||
checkAction();
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_G(player).command_ready = false;
|
||||
} else if (player_said("PARKING LOT") && _G(flags)[kTourBusAtDiner]) {
|
||||
checkAction();
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} else if (player_said("MAIN STREET")) {
|
||||
player_set_facing_at(120, 400);
|
||||
} else if (player_said("HANLON'S POINT")) {
|
||||
player_set_facing_at(-40, 375);
|
||||
} else if (player_said("AUNT POLLY'S HOUSE")) {
|
||||
player_set_facing_at(680, 325);
|
||||
} else if (player_said("FRONT DOOR")) {
|
||||
player_set_facing_at(350, 270);
|
||||
} else if (player_said("HIGHWAY 2")) {
|
||||
player_set_facing_at(192, 252);
|
||||
} else if (player_said("PARKING LOT")) {
|
||||
player_set_facing_at(303, 247);
|
||||
} else if (player_said("TOUR BUS")) {
|
||||
checkAction();
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room142::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (!_G(walker).wilbur_said(SAID)) {
|
||||
if (player_said_any("GEAR", "LOOK AT") && player_said("HANLON'S POINT")) {
|
||||
disable_player_commands_and_fade_init(1012);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("FRONT DOOR")) {
|
||||
disable_player_commands_and_fade_init(1015);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("AUNT POLLY'S HOUSE")) {
|
||||
disable_player_commands_and_fade_init(1017);
|
||||
} else if (!_G(walker).wilbur_match(MATCH)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room142::checkAction() {
|
||||
_actionType = 0;
|
||||
|
||||
if (player_said_any("GEAR", "LOOK AT", "GO TO")) {
|
||||
if (player_said("MAIN STREET")) {
|
||||
_actionType = 1;
|
||||
} else if (_G(flags)[kTourBusAtDiner] && (player_said("PARKING LOT") ||
|
||||
player_said("GO TO", "TOUR BUS"))) {
|
||||
_actionType = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (_actionType) {
|
||||
player_update_info();
|
||||
|
||||
if (_actionType == 1 && _G(player_info).y > 375 && player_commands_allowed()) {
|
||||
player_update_info();
|
||||
player_hotspot_walk_override(_G(player_info).x, 400);
|
||||
disable_player_commands_and_fade_init(1001);
|
||||
|
||||
} else if (_actionType == 2 && _G(player_info).y < 280 &&
|
||||
player_commands_allowed()) {
|
||||
disable_player_commands_and_fade_init(1016);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room142::faceTruck() {
|
||||
ws_turn_to_face(calc_facing(262, 277));
|
||||
}
|
||||
|
||||
void Room142::preloadAssets() {
|
||||
series_load("142dt02");
|
||||
series_load("142dt02s");
|
||||
series_load("142dt03");
|
||||
series_load("142dt03s");
|
||||
|
||||
digi_preload_play_breaks(PLAY5);
|
||||
digi_preload_play_breaks(PLAY6);
|
||||
digi_preload_play_breaks(PLAY7);
|
||||
}
|
||||
|
||||
void Room142::preloadAssets2() {
|
||||
series_load("142dt01");
|
||||
series_load("142dt01s");
|
||||
series_load("142dt02");
|
||||
series_load("142dt02s");
|
||||
digi_preload_play_breaks(PLAY1, true);
|
||||
digi_preload_play_breaks(PLAY1, true);
|
||||
}
|
||||
|
||||
void Room142::triggerParser() {
|
||||
_G(player).waiting_for_walk = true;
|
||||
_G(player).ready_to_walk = true;
|
||||
_G(player).need_to_walk = true;
|
||||
_G(player).command_ready = true;
|
||||
_G(kernel).trigger = -1;
|
||||
_G(kernel).trigger_mode = KT_PREPARSE;
|
||||
_G(player).walker_trigger = -1;
|
||||
|
||||
pre_parser();
|
||||
g_engine->global_pre_parser();
|
||||
}
|
||||
|
||||
void Room142::play015() {
|
||||
digi_preload("100_015");
|
||||
digi_play_loop("100_015", 1);
|
||||
|
||||
_val3 = imath_ranged_rand(1, 3);
|
||||
_val1 = 14;
|
||||
series_play_with_breaks(PLAY13, "142dt01", 0x100, 9, 3);
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
96
engines/m4/burger/rooms/section1/room142.h
Normal file
96
engines/m4/burger/rooms/section1/room142.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM142_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM142_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
#include "m4/burger/walker.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room142 : public Room {
|
||||
static const WilburMatch MATCH[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
static const seriesPlayBreak PLAY11[];
|
||||
static const seriesPlayBreak PLAY12[];
|
||||
static const seriesPlayBreak PLAY13[];
|
||||
static const seriesPlayBreak PLAY14[];
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
machine *_series3 = nullptr;
|
||||
machine *_series4 = nullptr;
|
||||
machine *_series5 = nullptr;
|
||||
machine *_series6 = nullptr;
|
||||
machine *_series7 = nullptr;
|
||||
machine *_series8 = nullptr;
|
||||
|
||||
noWalkRect *_noWalk = nullptr;
|
||||
int _actionType = 0;
|
||||
int _volume = 0;
|
||||
static int32 _val1;
|
||||
static int32 _val2;
|
||||
static int32 _val3;
|
||||
//int _val4 = 0;
|
||||
|
||||
void checkAction();
|
||||
void faceTruck();
|
||||
void preloadAssets();
|
||||
void preloadAssets2();
|
||||
void triggerParser();
|
||||
void play015();
|
||||
|
||||
/**
|
||||
* Gets the X position for the edge of the road, given a Y pos.
|
||||
* Used for the cutscene where Burl arrives, to determine whether
|
||||
* he honks the horn at Wilbur to get off the road
|
||||
*/
|
||||
int getRoadEdgeX(int y) const {
|
||||
return (int)((double)(-y + 126) * -1.428571428571429);
|
||||
}
|
||||
|
||||
public:
|
||||
Room142();
|
||||
~Room142() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1528
engines/m4/burger/rooms/section1/room143.cpp
Normal file
1528
engines/m4/burger/rooms/section1/room143.cpp
Normal file
File diff suppressed because it is too large
Load Diff
90
engines/m4/burger/rooms/section1/room143.h
Normal file
90
engines/m4/burger/rooms/section1/room143.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM143_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM143_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room143 : public Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
static const seriesPlayBreak PLAY11[];
|
||||
machine *_cheese = nullptr;
|
||||
machine *_mouseTrap = nullptr;
|
||||
machine *_plate = nullptr;
|
||||
machine *_eu02 = nullptr;
|
||||
machine *_wi03 = nullptr;
|
||||
machine *_wi03S = nullptr;
|
||||
machine *_ve03 = nullptr, *_ve03S = nullptr;
|
||||
Series _cat;
|
||||
Series _emptyPlates;
|
||||
noWalkRect *_walk1 = nullptr;
|
||||
const char *_digiName = nullptr;
|
||||
bool _flag1 = false;
|
||||
int _frame = 0;
|
||||
int _veraShould = 0;
|
||||
int _veraMode = 0;
|
||||
int _val3 = 0;
|
||||
int _catShould = 0;
|
||||
int _burlMode = 0;
|
||||
int _burlShould = 0;
|
||||
KernelTriggerType _digiMode = (KernelTriggerType)0;
|
||||
int _digiTrigger = 0;
|
||||
|
||||
void conv35();
|
||||
void conv30();
|
||||
void talkToVera();
|
||||
void talkToBurl();
|
||||
void loadCheese();
|
||||
void showEmptyPlates();
|
||||
void playDigi1();
|
||||
void playDigi2();
|
||||
|
||||
public:
|
||||
Room143() : Room() {}
|
||||
~Room143() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1001
engines/m4/burger/rooms/section1/room145.cpp
Normal file
1001
engines/m4/burger/rooms/section1/room145.cpp
Normal file
File diff suppressed because it is too large
Load Diff
105
engines/m4/burger/rooms/section1/room145.h
Normal file
105
engines/m4/burger/rooms/section1/room145.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM145_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM145_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
#include "m4/burger/walker.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room145 : public Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const WilburMatch MATCH[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
static const seriesPlayBreak PLAY11[];
|
||||
static const seriesPlayBreak PLAY12[];
|
||||
static const seriesPlayBreak PLAY13[];
|
||||
static const seriesPlayBreak PLAY14[];
|
||||
static const seriesPlayBreak PLAY15[];
|
||||
static const seriesPlayBreak PLAY16[];
|
||||
static const seriesPlayBreak PLAY17[];
|
||||
static const seriesPlayBreak PLAY18[];
|
||||
static const seriesPlayBreak PLAY19[];
|
||||
static const seriesPlayBreak PLAY20[];
|
||||
static const seriesPlayBreak PLAY21[];
|
||||
static const seriesPlayBreak PLAY22[];
|
||||
static const seriesPlayBreak PLAY23[];
|
||||
static int32 _state1;
|
||||
static int32 _state2;
|
||||
static int32 _state3;
|
||||
noWalkRect *_walk1 = nullptr;
|
||||
noWalkRect *_walk2 = nullptr;
|
||||
noWalkRect *_walk3 = nullptr;
|
||||
machine *_amplifier = nullptr;
|
||||
Series _vipe;
|
||||
Series _roxy;
|
||||
const char *_digiName1 = nullptr;
|
||||
const char *_digiName2 = nullptr;
|
||||
bool _flag1 = false;
|
||||
int _duration = 0;
|
||||
int _drumzState = 0;
|
||||
int _roxyTalkTo = 0;
|
||||
int _roxyState = 0;
|
||||
int _vipeState = 0;
|
||||
int _val5 = 0;
|
||||
|
||||
void loadDrum();
|
||||
void loadRx();
|
||||
void conv21();
|
||||
void conv22();
|
||||
void conv23();
|
||||
void vipeSpeaking();
|
||||
void roxySpeaking();
|
||||
void loadSeries1();
|
||||
int getRandomDrumzState() const;
|
||||
void resetRoxy();
|
||||
void playRandomDigi1();
|
||||
void playRandomDigi2();
|
||||
|
||||
public:
|
||||
Room145();
|
||||
~Room145() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
232
engines/m4/burger/rooms/section1/room170.cpp
Normal file
232
engines/m4/burger/rooms/section1/room170.cpp
Normal file
@@ -0,0 +1,232 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room170.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "HOUSE", "170w001", "170w002", "170w002" },
|
||||
{ "FRONT DOOR", nullptr, nullptr, nullptr },
|
||||
{ "VERA'S DINER", nullptr, "170w002", nullptr },
|
||||
{ "TOWN HALL", nullptr, "170w002", nullptr },
|
||||
{ "HIGHWAY 2", "170w009", "170w002", "170w009" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 9, "100_004", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 10, -1, "100_003", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 11, "170_001", 1, 50, -1, 0, 0, nullptr, 0 },
|
||||
{ 12, 19, "170_002", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 20, 20, "170w005", 1, 255, -1, 0, -1, nullptr, 0 },
|
||||
{ 21, 39, "170_002", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 40, 40, "170w006", 1, 125, -1, 0, -1, nullptr, 0 },
|
||||
{ 41, 52, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 0, "170_001", 1, 50, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 0, 12, "170_001", 1, 50, -1, 0, 0, nullptr, 0 },
|
||||
{ 23, 52, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 0, "170_001", 1, 50, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room170::init() {
|
||||
digi_preload("100_001");
|
||||
digi_play_loop("100_001", 3, 255);
|
||||
|
||||
_firstTime = !player_been_here(170);
|
||||
series_show("170box", 0xa00);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
kernel_trigger_dispatch_now(1);
|
||||
break;
|
||||
|
||||
case 104:
|
||||
ws_demand_location(494, 400, 10);
|
||||
ws_walk(355, 353, nullptr, 1);
|
||||
break;
|
||||
|
||||
case 142:
|
||||
ws_demand_location(-40, 375, 2);
|
||||
ws_walk(25, 350, nullptr, 1);
|
||||
break;
|
||||
|
||||
case 171:
|
||||
ws_demand_location(319, 192, 8);
|
||||
kernel_trigger_dispatch_now(1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(134, 307, 5);
|
||||
kernel_trigger_dispatch_now(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room170::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
if (_firstTime)
|
||||
wilbur_speech("170w001");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player_commands_and_fade_init(1018);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
series_play_with_breaks(PLAY1, "170wi01", 0x900, 2, 2, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 4;
|
||||
series_play_with_breaks(PLAY2, "170wi03", 0xa00, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
enable_player();
|
||||
wilbur_speech("170w007");
|
||||
_G(flags)[V080] = 1;
|
||||
_G(flags)[V079] = 0;
|
||||
inv_give_to_player("WHISTLE");
|
||||
inv_give_to_player("PHONE BILL");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 6;
|
||||
series_play_with_breaks(PLAY3, "170wi03", 0xa00, kCHANGE_WILBUR_ANIMATION, 3, 6, 100, 0, 0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
enable_player();
|
||||
_G(flags)[V079] = 0;
|
||||
inv_give_to_player("WHISTLE");
|
||||
inv_give_to_player("PHONE BILL");
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCALLED_EACH_LOOP:
|
||||
term_message("Calling daemon each loop..............");
|
||||
|
||||
if (_lookTownHall) {
|
||||
setupTownHall();
|
||||
} else {
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room170::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (player_said_any("GEAR", "LOOK AT")) {
|
||||
if (player_said("TOWN HALL")) {
|
||||
setupTownHall();
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
}
|
||||
} else {
|
||||
if (player_said("VERA'S DINER"))
|
||||
player_set_facing_at(-40, 375);
|
||||
|
||||
if (player_said("TOWN HALL"))
|
||||
player_set_facing_at(494, 400);
|
||||
}
|
||||
|
||||
if (player_said("YARD"))
|
||||
player_set_facing_hotspot();
|
||||
}
|
||||
|
||||
void Room170::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Handled
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("VERA'S DINER")) {
|
||||
disable_player_commands_and_fade_init(1014);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("FRONT DOOR")) {
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("MAILBOX")) {
|
||||
if (_G(flags)[V079]) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (_G(flags)[V080]) {
|
||||
_G(wilbur_should) = 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
_G(wilbur_should) = 3;
|
||||
wilbur_speech("170w004", kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
} else {
|
||||
wilbur_speech("170w008");
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room170::setupTownHall() {
|
||||
if (player_said_any("GEAR", "LOOK AT") && player_said("TOWN HALL"))
|
||||
_lookTownHall = true;
|
||||
|
||||
if (_lookTownHall) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).y > 375 && player_commands_allowed())
|
||||
disable_player_commands_and_fade_init(1004);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
52
engines/m4/burger/rooms/section1/room170.h
Normal file
52
engines/m4/burger/rooms/section1/room170.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM170_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM170_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room170 : public Room {
|
||||
private:
|
||||
bool _firstTime = false;
|
||||
bool _lookTownHall = false;
|
||||
|
||||
void setupTownHall();
|
||||
|
||||
public:
|
||||
Room170() : Room() {}
|
||||
~Room170() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
924
engines/m4/burger/rooms/section1/room171.cpp
Normal file
924
engines/m4/burger/rooms/section1/room171.cpp
Normal file
@@ -0,0 +1,924 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room171.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_POLLY_ANIMATION = 5
|
||||
};
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "AUNT POLLY", "171w001", "171w002", "171w002" },
|
||||
{ "FRONT DOOR", "171w003", "171w002", nullptr },
|
||||
{ "KITCHEN", nullptr, "171w002", nullptr },
|
||||
{ "STAIRS", "171w004", "171w002", nullptr },
|
||||
{ "FIREPLACE", nullptr, "171w002", "171w005" },
|
||||
{ "KINDLING ", "171w006", "171w007", "171w007" },
|
||||
{ "WINDOW", "171w008", "171w002", "171w009" },
|
||||
{ "TELEPHONE", "171w010", "171w011", "171w012" },
|
||||
{ "ARMCHAIR", "171w013", "171w014", "171w015" },
|
||||
{ "PIANO", "171w019", "171w020", "171w021" },
|
||||
{ "PICTURE", "171w022", "171w023", "171w024" },
|
||||
{ "PICTURE ", "171w025", "171w023", nullptr },
|
||||
{ "PAINTING", "171w026", "171w027", nullptr },
|
||||
{ "CLOCK", "171w028", "171w029", "171w030" },
|
||||
{ "PILLS", "171w031", "171w032", "171w033" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY1[] = {
|
||||
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, 6, "171_014a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 12, "171_014b", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 13, 18, "171_014a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 19, 22, "171_014b", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 23, 27, "171_014a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 28, 32, "171_014b", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 33, 39, "171_014a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 40, -1, "171_014b", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY2[] = {
|
||||
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 1, 6, "171_014a", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 7, 12, "171_014b", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 13, 17, "171_014a", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 18, 22, "171_014b", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 24, 29, "171_014a", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 30, 35, "171_014b", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 36, 40, "171_014a", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 41, -1, "171_014b", 2, 100, -1, 0, 0, &Flags::_flags[V086], 0 },
|
||||
{ 1, 6, "171_014a", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 7, 12, "171_014b", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 13, 17, "171_014a", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 18, 22, "171_014b", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 24, 29, "171_014a", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 30, 35, "171_014b", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 36, 40, "171_014a", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
{ 41, -1, "171_014b", 1, 100, -1, 0, 0, &Flags::_flags[V086], 1 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY3[] = {
|
||||
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 16, nullptr, 0, 0, 3, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY4[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY5[] = {
|
||||
{ 0, -1, "171_001", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY6[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY7[] = {
|
||||
{ 0, -1, nullptr, 2, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY8[] = {
|
||||
{ 0, 4, "171_011", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 19, nullptr, 0, 0, 3, 0, 0, nullptr, 0 },
|
||||
{ 20, 25, "171_012", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 26, 33, "171_010", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY9[] = {
|
||||
{ 34, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY10[] = {
|
||||
{ 7, 8, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 8, 8, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
|
||||
{ 7, 8, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY11[] = {
|
||||
{ 7, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 13, -1, "171_006", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY12[] = {
|
||||
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 4, nullptr, 0, 0, -1, 0, 10, nullptr, 0 },
|
||||
{ 0, 4, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY13[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 1, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY14[] = {
|
||||
{ 0, 17, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 18, -1, "171_004", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 11, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY15[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY16[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room171::PLAY17[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room171::init() {
|
||||
_flag1 = false;
|
||||
_val1 = 0;
|
||||
|
||||
if (_G(flags)[V092]) {
|
||||
hotspot_set_active("AUNT POLLY", false);
|
||||
} else {
|
||||
switch (_G(game).previous_room) {
|
||||
case 170:
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (_G(flags)[V083] && _G(flags)[V084] && _G(flags)[V085] && _G(flags)[V086]) {
|
||||
loadSeries1();
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else {
|
||||
while (!_val1) {
|
||||
switch (imath_ranged_rand(1, 4)) {
|
||||
case 1:
|
||||
if (!_G(flags)[V083]) {
|
||||
_val1 = 10019;
|
||||
loadSeries2();
|
||||
_pollyShould = 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (!_G(flags)[V084]) {
|
||||
_val1 = 10021;
|
||||
loadSeries3();
|
||||
digi_preload("171_002");
|
||||
digi_play_loop("171_002", 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (!_G(flags)[V085]) {
|
||||
_val1 = 10020;
|
||||
loadSeries4();
|
||||
|
||||
if (imath_rand_bool(2)) {
|
||||
digi_preload("171_013a");
|
||||
digi_play_loop("171_013a", 2, 255);
|
||||
} else {
|
||||
digi_preload("171_013b");
|
||||
digi_play_loop("171_013b", 2, 255);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (!_G(flags)[V086]) {
|
||||
_val1 = 10022;
|
||||
loadSeries5();
|
||||
_pollyShould = 20;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 175:
|
||||
if (!_G(flags)[V092]) {
|
||||
if (_G(flags)[V086]) {
|
||||
loadSeries1();
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else {
|
||||
_val1 = 10022;
|
||||
loadSeries5();
|
||||
kernel_trigger_dispatch_now(6);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
loadSeries1();
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_series3 = series_show("171pills", 0x700);
|
||||
|
||||
if (_val1 || _G(flags)[V092]) {
|
||||
_chair.show("171chair", "171chars", 0x900);
|
||||
}
|
||||
|
||||
hotspot_set_active("PIANO STOOL", false);
|
||||
hotspot_set_active("PIANO STOOL ", false);
|
||||
|
||||
if (_val1 == 10020 || _val1 == 10019) {
|
||||
hotspot_set_active("PIANO STOOL ", true);
|
||||
intr_add_no_walk_rect(378, 300, 518, 354, 377, 355);
|
||||
|
||||
if (_val1 == 10020) {
|
||||
series_show("171stool", 0x300);
|
||||
series_show("171stols", 0x301);
|
||||
}
|
||||
} else {
|
||||
series_show("171st02", 0x100);
|
||||
hotspot_set_active("PIANO STOOL", true);
|
||||
}
|
||||
|
||||
_lid = series_show("171plid", 0);
|
||||
|
||||
if (_val1 != 10022)
|
||||
series_show("171phone", 0x700);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 170:
|
||||
ws_demand_location(84, 275, 3);
|
||||
|
||||
if (_G(flags)[V092] || (_G(flags)[V083] && _G(flags)[V084] &&
|
||||
_G(flags)[V085] && _G(flags)[V086])) {
|
||||
ws_walk(134, 275, nullptr, -1);
|
||||
} else {
|
||||
ws_walk(134, 275, nullptr, 6);
|
||||
}
|
||||
break;
|
||||
|
||||
case 172:
|
||||
ws_demand_location(639, 289, 9);
|
||||
ws_walk(541, 295, nullptr, -1);
|
||||
break;
|
||||
|
||||
case 175:
|
||||
ws_demand_location(237, 232, 9);
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(324, 319, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room171::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
disable_player_commands_and_fade_init(1019);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player_commands_and_fade_init(1022);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
npc_say();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (_pollyShould == 28 || _pollyShould == 36 || _pollyShould == 34 || _pollyShould == 33 ||
|
||||
_pollyShould == 38 || _pollyShould == 30) {
|
||||
digi_stop(2);
|
||||
freeSeries();
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_POLLY_ANIMATION:
|
||||
// Aunt Polly
|
||||
switch (_pollyShould) {
|
||||
case 5:
|
||||
digi_play_loop("171_003", 2);
|
||||
_series.play("171ap01", 0x300, 0, -1, 6, -1);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
npc_say(conv_sound_to_play(), kRESUME_CONVERSATION, "171ap01n", 0x2ff, false);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
digi_stop(2);
|
||||
freeSeries();
|
||||
series_play_with_breaks(PLAY3, "171ap02", 0x300, kRESUME_CONVERSATION, 3);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_pollyShould = 9;
|
||||
npc_say(conv_sound_to_play(), 5, "171ap02", 0x300, true, 17, 22);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
freeSeries();
|
||||
_pollyShould = 10;
|
||||
series_play_with_breaks(PLAY4, "171ap03", 0x300, 5, 3);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_G(flags)[V083] = 1;
|
||||
_chair.terminate();
|
||||
|
||||
series_show("171stool", 0x300);
|
||||
series_show("171stols", 0x301);
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
npc_say(kRESUME_CONVERSATION);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
digi_stop(2);
|
||||
npc_say();
|
||||
series_play_with_breaks(PLAY5, "171ap04", 0x800, kRESUME_CONVERSATION, 3);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_pollyShould = 14;
|
||||
npc_say(kCHANGE_POLLY_ANIMATION, "171ap05", 0x800);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
_G(flags)[V084] = 1;
|
||||
_chair.terminate();
|
||||
_pollyShould = 26;
|
||||
series_play_with_breaks(PLAY6, "171ap06", 0x800, 5, 3);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
terminateMachineAndNull(_lid);
|
||||
_pollyShould = 16;
|
||||
series_play_with_breaks(PLAY7, "171ap07", 0, kCHANGE_POLLY_ANIMATION, 2);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
npc_say(kRESUME_CONVERSATION, "171ap08", 0, false);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
freeSeries();
|
||||
_pollyShould = 18;
|
||||
series_play_with_breaks(PLAY8, "171ap09", 0, kCHANGE_POLLY_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
_pollyShould = 19;
|
||||
series_play_with_breaks(PLAY9, "171ap09", 0x301, kCHANGE_POLLY_ANIMATION, 3);
|
||||
series_show("171plid", 0);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
_G(flags)[V085] = 1;
|
||||
_chair.terminate();
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
_series.show("171ap10", 0x700);
|
||||
break;
|
||||
|
||||
case 21:
|
||||
freeSeries();
|
||||
npc_say(kRESUME_CONVERSATION, "171ap10", 0x700, true, 0, 6);
|
||||
break;
|
||||
|
||||
case 22:
|
||||
npc_say(5);
|
||||
_pollyShould = 23;
|
||||
series_play_with_breaks(PLAY10, "171ap10", 0x700, kCHANGE_POLLY_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
_pollyShould = 24;
|
||||
_series.play("171ap10", 0x700, 0, -1, 6, -1, 100, 0, 0, 0, 6);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
freeSeries();
|
||||
_pollyShould = 25;
|
||||
series_play_with_breaks(PLAY11, "171ap10", 0x700, 5, 3);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
_G(flags)[V086] = 1;
|
||||
_chair.terminate();
|
||||
series_show("171phone", 0x700);
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 26:
|
||||
player_update_info();
|
||||
|
||||
if (_flag1 && (_G(player_info).x != 436 || _G(player_info).y != 288))
|
||||
ws_walk(436, 288, nullptr, kRESUME_CONVERSATION, 2);
|
||||
|
||||
digi_play_loop("171_009", 2, 50);
|
||||
_series[0] = series_play("171ap11", 0x8ff, 32, 4, 6, -1);
|
||||
_series[1] = series_play("171ap11", 0x900, 0, -1, 6, -1);
|
||||
break;
|
||||
|
||||
case 28:
|
||||
_pollyShould = 29;
|
||||
npc_say(_digi1, kCHANGE_POLLY_ANIMATION, "171ap13", 0x8fe);
|
||||
break;
|
||||
|
||||
case 29:
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 30:
|
||||
_pollyShould = 32;
|
||||
series_play_with_breaks(PLAY15, "171ap16", 0x8ff, kCHANGE_POLLY_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 31:
|
||||
_pollyShould = 32;
|
||||
series_play_with_breaks(PLAY16, "171ap17", 0x8ff, 5, 3);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
_chair.show("171chair", "171chars", 0x900);
|
||||
series_play_with_breaks(PLAY17, "171ap18", 0x400, 1, 3);
|
||||
break;
|
||||
|
||||
case 33:
|
||||
npc_say(kRESUME_CONVERSATION, "171ap13", 0x8fe);
|
||||
break;
|
||||
|
||||
case 34:
|
||||
_pollyShould = 35;
|
||||
npc_say(kCHANGE_POLLY_ANIMATION, "171ap13", 0x8fe);
|
||||
break;
|
||||
|
||||
case 35:
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
conv_resume_curr();
|
||||
break;
|
||||
|
||||
case 36:
|
||||
_pollyShould = 26;
|
||||
series_play_with_breaks(PLAY12, "171ap12", 0x8ff, kCHANGE_POLLY_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 37:
|
||||
series_play_with_breaks(PLAY13, "171ap14", 0x8ff, kCHANGE_POLLY_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 38:
|
||||
_pollyShould = 39;
|
||||
npc_say(kCHANGE_POLLY_ANIMATION, "171ap13", 0x8fe);
|
||||
break;
|
||||
|
||||
case 39:
|
||||
freeSeries();
|
||||
_chair.show("171chair", "171chars", 0x900);
|
||||
|
||||
if (_series3)
|
||||
terminateMachineAndNull(_series3);
|
||||
|
||||
_pollyShould = 40;
|
||||
series_play_with_breaks(PLAY14, "171ap15", 0x700, kCHANGE_POLLY_ANIMATION, 2, 8);
|
||||
break;
|
||||
|
||||
case 40:
|
||||
_chair.terminate();
|
||||
_series3 = series_show("171pills", 0x700);
|
||||
_pollyShould = 26;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
conv_resume_curr();
|
||||
break;
|
||||
|
||||
default:
|
||||
term_message("ERROR!!!! polly_should not set!");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
_G(flags)[V299] = 1;
|
||||
_flag1 = true;
|
||||
conv_load_and_prepare("conv40", 7);
|
||||
|
||||
switch (_val1) {
|
||||
case 10019:
|
||||
conv_export_value_curr(1, 0);
|
||||
break;
|
||||
case 10020:
|
||||
conv_export_value_curr(3, 0);
|
||||
break;
|
||||
case 10021:
|
||||
conv_export_value_curr(2, 0);
|
||||
break;
|
||||
case 10022:
|
||||
conv_export_value_curr(4, 0);
|
||||
break;
|
||||
default:
|
||||
conv_export_value_curr(0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
conv_export_value_curr(inv_player_has("WHISTLE") ? 1 : 0, 1);
|
||||
conv_export_pointer_curr(&_G(flags)[V087], 2);
|
||||
conv_export_pointer_curr(&_G(flags)[V088], 3);
|
||||
conv_play_curr();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_val1 = 0;
|
||||
_G(flags)[kDisableFootsteps] = 0;
|
||||
_G(flags)[V299] = 0;
|
||||
_flag1 = false;
|
||||
player_set_commands_allowed(true);
|
||||
_pollyShould = 26;
|
||||
|
||||
if (_series) {
|
||||
freeSeries();
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
series_play_with_breaks(PLAY1, "171wi01", 0xc01, 2, 3, 5);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player();
|
||||
_G(wilbur_should) = kRESUME_CONVERSATION;
|
||||
series_play_with_breaks(PLAY2, "171wi02", 0xc01, kCHANGE_WILBUR_ANIMATION, 3, 5, 100, 0, -3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (_G(flags)[V087]) {
|
||||
_digi1 = "171p903";
|
||||
} else {
|
||||
_digi1 = "1711p902";
|
||||
_G(flags)[V087] = 1;
|
||||
}
|
||||
|
||||
_pollyShould = 28;
|
||||
break;
|
||||
|
||||
case kRESUME_CONVERSATION:
|
||||
ws_unhide_walker();
|
||||
|
||||
if (_G(flags)[V092] || _G(flags)[V086])
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCALLED_EACH_LOOP:
|
||||
if (_doorFlag) {
|
||||
frontDoor();
|
||||
} else {
|
||||
_G(kernel).call_daemon_every_loop = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room171::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if ((_val1 == 10019 || _val1 == 10020) &&
|
||||
_G(player).walk_x > 378 && _G(player).walk_x <= 518 &&
|
||||
_G(player).walk_y >= 300 && _G(player).walk_y <= 354) {
|
||||
player_walk_to(_G(player).click_x, 355);
|
||||
}
|
||||
|
||||
if (!player_said("GEAR") && player_said("FRONT DOOR")) {
|
||||
player_set_facing_at(94, 281);
|
||||
|
||||
} else if (!player_said_any("GEAR", "LOOK AT") && player_said("KITCHEN")) {
|
||||
player_set_facing_at(601, 296);
|
||||
|
||||
} else if (player_said("GEAR", "FRONT DOOR")) {
|
||||
frontDoor();
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Room171::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Do nothing
|
||||
} else if (player_said("conv40")) {
|
||||
conv40();
|
||||
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("KITCHEN")) {
|
||||
if (_G(flags)[V091]) {
|
||||
disable_player_commands_and_fade_init(1019);
|
||||
} else {
|
||||
player_set_commands_allowed(false);
|
||||
_pollyShould = 30;
|
||||
}
|
||||
|
||||
} else if (player_said("GEAR", "STAIRS")) {
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
|
||||
} else if (player_said("WHISTLE", "AUNT POLLY")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 3;
|
||||
wilbur_speech("171w901", kCHANGE_WILBUR_ANIMATION);
|
||||
|
||||
} else if (player_said("TALK", "AUNT POLLY")) {
|
||||
kernel_trigger_dispatch_now(6);
|
||||
|
||||
} else if (player_said("AUNT POLLY") && player_said_any("PHONE BILL", "CARROT JUICE")) {
|
||||
player_set_commands_allowed(false);
|
||||
_digi1 = "171p901";
|
||||
_pollyShould = 28;
|
||||
|
||||
} else if (player_said("ROCKER")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
wilbur_speech(_G(flags)[V092] ? "171w017" : "171w016");
|
||||
|
||||
} else if (player_said("GEAR")) {
|
||||
wilbur_speech(_G(flags)[V092] ? "171w015" : "171w018");
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room171::loadSeries1() {
|
||||
series_load("171ap11");
|
||||
series_load("171ap12");
|
||||
series_load("171ap13");
|
||||
series_load("171ap11s");
|
||||
series_load("171ap12s");
|
||||
series_load("171ap13s");
|
||||
digi_preload("171_009");
|
||||
}
|
||||
|
||||
void Room171::loadSeries2() {
|
||||
series_load("171ap01");
|
||||
series_load("171ap02");
|
||||
series_load("171ap03");
|
||||
series_load("171ap01s");
|
||||
series_load("171ap02s");
|
||||
series_load("171ap03s");
|
||||
loadSeries1();
|
||||
}
|
||||
|
||||
void Room171::loadSeries3() {
|
||||
series_load("171ap04");
|
||||
series_load("171ap05");
|
||||
series_load("171ap06");
|
||||
series_load("171ap04s");
|
||||
series_load("171ap05s");
|
||||
series_load("171ap06s");
|
||||
loadSeries1();
|
||||
}
|
||||
|
||||
void Room171::loadSeries4() {
|
||||
series_load("171ap07");
|
||||
series_load("171ap08");
|
||||
series_load("171ap09");
|
||||
series_load("171ap09s");
|
||||
loadSeries1();
|
||||
}
|
||||
|
||||
void Room171::loadSeries5() {
|
||||
series_load("171ap10");
|
||||
series_load("171ap10s");
|
||||
loadSeries1();
|
||||
}
|
||||
|
||||
void Room171::freeSeries() {
|
||||
_series.terminate();
|
||||
}
|
||||
|
||||
void Room171::frontDoor() {
|
||||
if (player_said_any("GEAR", "LOOK AT") && player_said("FRONT DOOR"))
|
||||
_doorFlag = true;
|
||||
|
||||
if (_doorFlag) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).x < 94 && _G(player_info).y < 281 && player_commands_allowed())
|
||||
disable_player_commands_and_fade_init(1017);
|
||||
}
|
||||
}
|
||||
|
||||
void Room171::conv40() {
|
||||
const int who = conv_whos_talking();
|
||||
const int node = conv_current_node();
|
||||
const int entry = conv_current_entry();
|
||||
|
||||
if (!conv_sound_to_play())
|
||||
return;
|
||||
|
||||
if (who == 1) {
|
||||
wilbur_speech(conv_sound_to_play(), kRESUME_CONVERSATION);
|
||||
|
||||
switch (node) {
|
||||
case 6:
|
||||
if (entry <= 0 || (entry == 6 || entry == 7))
|
||||
_pollyShould = 36;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_pollyShould = 36;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (entry == 0)
|
||||
_pollyShould = 36;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (entry == 1 || entry == 2 || entry == 5)
|
||||
_pollyShould = 36;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
switch (node) {
|
||||
case 1:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 6;
|
||||
break;
|
||||
case 1:
|
||||
_pollyShould = 7;
|
||||
break;
|
||||
case 2:
|
||||
_pollyShould = 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 11;
|
||||
break;
|
||||
case 1:
|
||||
_pollyShould = 12;
|
||||
break;
|
||||
case 2:
|
||||
_pollyShould = 13;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 15;
|
||||
break;
|
||||
case 1:
|
||||
_pollyShould = 17;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 21;
|
||||
break;
|
||||
case 1:
|
||||
_pollyShould = 22;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_pollyShould = (entry == 6) ? 33 : 34;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 33;
|
||||
break;
|
||||
case 1:
|
||||
_pollyShould = 38;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_pollyShould = 34;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
_pollyShould = 34;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
84
engines/m4/burger/rooms/section1/room171.h
Normal file
84
engines/m4/burger/rooms/section1/room171.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM171_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM171_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room171 : public Room {
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
static const seriesPlayBreak PLAY11[];
|
||||
static const seriesPlayBreak PLAY12[];
|
||||
static const seriesPlayBreak PLAY13[];
|
||||
static const seriesPlayBreak PLAY14[];
|
||||
static const seriesPlayBreak PLAY15[];
|
||||
static const seriesPlayBreak PLAY16[];
|
||||
static const seriesPlayBreak PLAY17[];
|
||||
|
||||
private:
|
||||
Series _series;
|
||||
Series _chair;
|
||||
machine *_series3 = nullptr;
|
||||
machine *_lid = nullptr;
|
||||
const char *_digi1 = nullptr;
|
||||
bool _flag1 = false;
|
||||
bool _doorFlag = false;
|
||||
int _val1 = 0;
|
||||
int _pollyShould = 0;
|
||||
|
||||
void loadSeries1();
|
||||
void loadSeries2();
|
||||
void loadSeries3();
|
||||
void loadSeries4();
|
||||
void loadSeries5();
|
||||
void freeSeries();
|
||||
void frontDoor();
|
||||
void conv40();
|
||||
|
||||
public:
|
||||
Room171() : Room() {}
|
||||
~Room171() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
477
engines/m4/burger/rooms/section1/room172.cpp
Normal file
477
engines/m4/burger/rooms/section1/room172.cpp
Normal file
@@ -0,0 +1,477 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room172.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_POLLY_ANIMATION = 1
|
||||
};
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "AUNT POLLY", "172w001", "172w002", "172w002" },
|
||||
{ "PARLOUR", "172w002", nullptr, nullptr },
|
||||
{ "BASEMENT", nullptr, "172w002", nullptr },
|
||||
{ "MICROWAVE", "172w003", nullptr, nullptr },
|
||||
{ "REFRIGERATOR", "172w005", "172w002", nullptr },
|
||||
{ "OVEN", nullptr, "172w002", nullptr },
|
||||
{ "SINK", "172w008", "172w009", nullptr },
|
||||
{ "HUTCH", "172w011", "172w012", "172w002" },
|
||||
{ "BROOM", "172w013", "172w014", "172w015" },
|
||||
{ "WINDOW", "172w016", "172w002", "172w017" },
|
||||
{ "CALENDAR", "172w018", "172w019", "172w018" },
|
||||
{ "CUPBOARD ", "172w021", "172w002", nullptr },
|
||||
{ "CUPBOARD", "172w022", "172w002", nullptr },
|
||||
{ "POTS AND PANS", "172w023", "172w024", "172w024" },
|
||||
{ "COOKIES", "172w025", "172w026", "172w027" },
|
||||
{ "PRESERVES", "172w028", "172w029", "172w029" },
|
||||
{ "CARROT JUICE ", "172w030", nullptr, "172w031" },
|
||||
{ "JUICER", "172w032", nullptr, "172w033" },
|
||||
{ "VEGGIES", "172w034", "172w035", "172w035" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 9, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 10, -1, nullptr, 0, 0, 2, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 8, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 0, 27, "172_001", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 28, 30, "172_005", 3, 125, -1, 0, -1, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY4[] = {
|
||||
{ 44, 45, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 45, 45, nullptr, 0, 0, -1, 0, 3, nullptr, 0 },
|
||||
{ 45, 44, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY5[] = {
|
||||
{ 36, 43, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 36, 36, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY6[] = {
|
||||
{ 46, 48, "172_004", 3, 125, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY7[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
void Room172::init() {
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 171:
|
||||
if (!_G(flags)[V092] && !_G(flags)[V091]) {
|
||||
player_set_commands_allowed(false);
|
||||
series_load("172ap1t");
|
||||
series_load("172ap1ts");
|
||||
series_load("172ap02t");
|
||||
digi_preload("172p906");
|
||||
|
||||
_pollyShould = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
ws_demand_location(300, 325, 3);
|
||||
ws_walk(368, 359, nullptr, -1, 2);
|
||||
|
||||
} else {
|
||||
ws_demand_location(11, 296, 3);
|
||||
ws_walk(156, 297, nullptr, -1, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 173:
|
||||
ws_demand_location(171, 254, 3);
|
||||
ws_walk(250, 270, nullptr, -1, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(312, 292, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
hotspot_set_active("AUNT POLLY", false);
|
||||
|
||||
if (_G(flags)[V092]) {
|
||||
_pollyShould = 15;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
_walk1 = intr_add_no_walk_rect(357, 311, 639, 353, 356, 354);
|
||||
hotspot_set_active("AUNT POLLY", true);
|
||||
} else {
|
||||
_series1 = series_show(_G(flags)[V091] ? "172fud2" : "172fud", 0x700);
|
||||
series_show("172fuds", 0x701);
|
||||
}
|
||||
|
||||
if (inv_player_has("CARROT JUICE") || inv_player_has("BOTTLE") ||
|
||||
inv_player_has("SOAPY WATER")) {
|
||||
hotspot_set_active("CARROT JUICE ", false);
|
||||
} else {
|
||||
_jug.show("172jug", 0x700);
|
||||
}
|
||||
}
|
||||
|
||||
void Room172::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_POLLY_ANIMATION:
|
||||
switch (_pollyShould) {
|
||||
case 4:
|
||||
_pollyShould = 5;
|
||||
series_play_with_breaks(PLAY2, "172ap01", 0x600, kCHANGE_POLLY_ANIMATION, 3, 8);
|
||||
digi_play("172p906", 2, 255, kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_G(flags)[V092] = 1;
|
||||
hotspot_set_active("AUNT POLLY", true);
|
||||
_pollyShould = 7;
|
||||
_series5.play("172ap1t", 0x400, 4, -1, 6, -1);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
freeSeries5();
|
||||
_pollyShould = 8;
|
||||
npc_say("172p907", kCHANGE_POLLY_ANIMATION, "172ap1t", 0x400, true);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
digi_unload("172p906");
|
||||
freeSeries5();
|
||||
_series5.show("172ap1t", 0x400);
|
||||
_pollyShould = 6;
|
||||
wilbur_speech("172w902", kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_G(flags)[V091] = true;
|
||||
terminateMachineAndNull(_series1);
|
||||
terminateMachineAndNull(_series1s);
|
||||
_pollyShould = 9;
|
||||
series_play_with_breaks(PLAY3, "172ap02", 0x400, kCHANGE_POLLY_ANIMATION, 3, 8);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_series5.play("172ap02", 0x400, 0, -1, 8, -1, 100, 0, 0, 28, 30);
|
||||
kernel_trigger_dispatch_now(3);
|
||||
playDigi3();
|
||||
break;
|
||||
|
||||
case 10:
|
||||
freeSeries7();
|
||||
_pollyShould = 11;
|
||||
series_play_with_breaks(PLAY4, "172ap02", 0x400, kCHANGE_POLLY_ANIMATION, 3, 8);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
freeSeries7();
|
||||
_pollyShould = 14;
|
||||
npc_say(kCHANGE_POLLY_ANIMATION, "172ap02", 0x400, true, 31, 35);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
player_set_commands_allowed(false);
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
freeSeries7();
|
||||
_series5.terminate();
|
||||
_pollyShould = 15;
|
||||
npc_say(_convName, kCHANGE_POLLY_ANIMATION, "172ap02", 0x400, true, 31, 35);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
freeSeries7();
|
||||
series_play_with_breaks(PLAY5, "172ap02", 0x400, 10001, 3, 8);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
_series5.play("172ap02", 0x400, 0, -1, 8, -1, 100, 0, 0, 28, 30);
|
||||
playDigi3();
|
||||
conv_resume_curr();
|
||||
break;
|
||||
|
||||
case 15:
|
||||
_G(flags)[kDisableFootsteps] = 0;
|
||||
player_set_commands_allowed(true);
|
||||
_series5.play("172ap02", 0x400, 0, -1, 8, -1, 100, 0, 0, 28, 30);
|
||||
playDigi3();
|
||||
break;
|
||||
|
||||
case 16:
|
||||
freeSeries7();
|
||||
_pollyShould = 17;
|
||||
series_play_with_breaks(PLAY6, "172ap02", 0x400, kCHANGE_POLLY_ANIMATION, 3, 8);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
freeSeries5();
|
||||
hotspot_set_active("AUNT POLLY", false);
|
||||
_series1 = series_show("172fud2", 0x700);
|
||||
_series1s = series_show("172fuds", 0x701);
|
||||
intr_remove_no_walk_rect(_walk1);
|
||||
_pollyShould = 18;
|
||||
series_play_with_breaks(PLAY7, "172ap03", 0x600, kCHANGE_POLLY_ANIMATION, 3, 8);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
term_message("ERROR!!!! polly_should not set!");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_jug.terminate();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_G(flags)[kDisableFootsteps] = 1;
|
||||
_G(flags)[V299] = 1;
|
||||
conv_load_and_prepare("conv41", 4);
|
||||
conv_export_value_curr(_G(flags)[V088], 0);
|
||||
conv_export_value_curr(inv_player_has("WHISTLE") ? 1 : 0, 1);
|
||||
conv_export_pointer_curr(&_G(flags)[V093], 2);
|
||||
conv_play_curr();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
freeSeries5();
|
||||
|
||||
if (_G(flags)[V092]) {
|
||||
freeSeries7();
|
||||
_pollyShould = 15;
|
||||
} else {
|
||||
_G(flags)[V088] = 1;
|
||||
_pollyShould = 16;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
_G(flags)[kDisableFootsteps] = 0;
|
||||
_G(flags)[V299] = 0;
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
_convName = _G(flags)[V087] ? "172p903" : "172p902";
|
||||
_pollyShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 3;
|
||||
series_play_with_breaks(PLAY1, "172wi01", 0x700, kCHANGE_WILBUR_ANIMATION, 3, 8);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
enable_player();
|
||||
hotspot_set_active("CARROT JUICE ", false);
|
||||
inv_give_to_player("CARROT JUICE");
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room172::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(flags)[V092] && _G(player).walk_x >= 357 && _G(player).walk_x <= 639 &&
|
||||
_G(player).walk_y >= 311 && _G(player).walk_y <= 353)
|
||||
player_hotspot_walk_override(356, 332, 3);
|
||||
|
||||
if (!player_said_any("GEAR", "LOOK AT")) {
|
||||
if (player_said("PARLOUR"))
|
||||
player_set_facing_at(84, 300);
|
||||
|
||||
if (player_said("BASEMENT"))
|
||||
player_set_facing_at(171, 254);
|
||||
}
|
||||
}
|
||||
|
||||
void Room172::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("conv41")) {
|
||||
conv41();
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("PARLOUR")) {
|
||||
disable_player_commands_and_fade_init(1018);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("BASEMENT")) {
|
||||
disable_player_commands_and_fade_init(1020);
|
||||
} else if (player_said("TAKE", "CARROT JUICE ")) {
|
||||
if (_G(flags)[V092]) {
|
||||
_convName = "172p950";
|
||||
_pollyShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else {
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
} else if (player_said("WHISTLE", "AUNT POLLY")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 1;
|
||||
wilbur_speech("172w901", kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TALK", "AUNT POLLY")) {
|
||||
kernel_trigger_dispatch_now(3);
|
||||
} else if (player_said("AUNT POLLY") && player_said_any("PHONE BILL", "CARROT JUICE")) {
|
||||
_convName = imath_rand_bool(2) ? "172p901" : "172904";
|
||||
_pollyShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else if (player_said("MICROWAVE")) {
|
||||
parserAction("172w004");
|
||||
} else if (player_said("GEAR", "REFRIGERATOR")) {
|
||||
parserAction("172w005");
|
||||
} else if (player_said("GEAR", "OVEN")) {
|
||||
parserAction("172w007");
|
||||
} else if (player_said("SINK")) {
|
||||
parserAction("172w010");
|
||||
} else if (player_said("GEAR") && player_said_any("CUPBOARD", "CUPBOARD ")) {
|
||||
parserAction("172w036");
|
||||
} else if (player_said("TAKE", "JUICER")) {
|
||||
if (_G(flags)[V092]) {
|
||||
_convName = imath_rand_bool(2) ? "172p905a" : "172p905b";
|
||||
_pollyShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else {
|
||||
wilbur_speech("172w033");
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room172::parserAction(const char *name) {
|
||||
if (_G(flags)[V092]) {
|
||||
_convName = "172p950";
|
||||
_pollyShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
} else {
|
||||
wilbur_speech(name);
|
||||
}
|
||||
}
|
||||
|
||||
void Room172::freeSeries7() {
|
||||
digi_stop(2);
|
||||
terminateMachineAndNull(_series7);
|
||||
}
|
||||
|
||||
void Room172::playDigi3() {
|
||||
loadSeries7();
|
||||
digi_preload("172_003");
|
||||
digi_play_loop("172_003", 3, 125);
|
||||
}
|
||||
|
||||
void Room172::loadSeries7() {
|
||||
digi_preload("172p909");
|
||||
digi_play_loop("172p909", 2, 255);
|
||||
_series7 = series_play("172ap02t", 0x3ff, 4, -1, 4);
|
||||
}
|
||||
|
||||
void Room172::conv41() {
|
||||
const char *sound = conv_sound_to_play();
|
||||
const int who = conv_whos_talking();
|
||||
const int node = conv_current_node();
|
||||
const int entry = conv_current_entry();
|
||||
|
||||
if (sound) {
|
||||
if (who == 1) {
|
||||
wilbur_speech(sound, 10001);
|
||||
} else {
|
||||
freeSeries5();
|
||||
|
||||
switch (node) {
|
||||
case 0:
|
||||
_pollyShould = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (entry) {
|
||||
case 0:
|
||||
_pollyShould = 10;
|
||||
kernel_trigger_dispatch_now(kCHANGE_POLLY_ANIMATION);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
freeSeries7();
|
||||
_G(flags)[V092] = 0;
|
||||
_pollyShould = 14;
|
||||
npc_say(sound, kCHANGE_POLLY_ANIMATION, "172ap02", 0x400, true, 31, 35);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
freeSeries7();
|
||||
_pollyShould = 13;
|
||||
npc_say(sound, kCHANGE_POLLY_ANIMATION, "172ap02", 0x400, true, 31, 35);
|
||||
break;
|
||||
|
||||
default:
|
||||
freeSeries7();
|
||||
_pollyShould = 14;
|
||||
npc_say(sound, kCHANGE_POLLY_ANIMATION, "172ap02", 0x400, true, 31, 35);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
66
engines/m4/burger/rooms/section1/room172.h
Normal file
66
engines/m4/burger/rooms/section1/room172.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM172_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM172_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room172 : public Room {
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series1s = nullptr;
|
||||
Series _jug;
|
||||
//machine *_series4 = nullptr;
|
||||
Series _series5;
|
||||
machine *_series7 = nullptr;
|
||||
noWalkRect *_walk1 = nullptr;
|
||||
const char *_convName = nullptr;
|
||||
int _pollyShould = 0;
|
||||
|
||||
void loadSeries7();
|
||||
void freeSeries5() {
|
||||
_series5.terminate();
|
||||
}
|
||||
void freeSeries7();
|
||||
void playDigi3();
|
||||
void conv41();
|
||||
void parserAction(const char *name);
|
||||
|
||||
public:
|
||||
Room172() : Room() {}
|
||||
~Room172() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
131
engines/m4/burger/rooms/section1/room173.cpp
Normal file
131
engines/m4/burger/rooms/section1/room173.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room173.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "STAIRS", "173w002", "173w003", nullptr },
|
||||
{ "WRINGER", "173w009", "173w010", "173w008" },
|
||||
{ "BREAKER BOX", "504w017", nullptr, nullptr },
|
||||
{ "WASHING MACHINE", "173w007", nullptr, "173w008" },
|
||||
{ "SHORTS", "173w004", "173w005", "173w005" },
|
||||
{ "FAN BOY TOWEL", "173w004", "173w005", "173w005" },
|
||||
{ "SOCK", "173w004", "173w005", "173w005" },
|
||||
{ "T-SHIRT", "173w004", "173w005", "173w005" },
|
||||
{ "LAUNDRY", "173w004", "173w006", "173w006" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 5, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, -1, nullptr, 0, 0, 1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room173::init() {
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 172:
|
||||
ws_demand_location(136, 318, 5);
|
||||
_G(wilbur_should) = player_been_here(173) ? 1 : 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(332, 333, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room173::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
disable_player_commands_and_fade_init(1019);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY1, "173wi01", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 3;
|
||||
series_play_with_breaks(PLAY1, "173wi01", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
enable_player();
|
||||
wilbur_speech("173w001");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
disable_player();
|
||||
series_play_with_breaks(PLAY2, "173wi02", 0x200, -1, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room173::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("GEAR", "STAIRS")) {
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
45
engines/m4/burger/rooms/section1/room173.h
Normal file
45
engines/m4/burger/rooms/section1/room173.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM173_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM173_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room173 : public Room {
|
||||
public:
|
||||
Room173() : Room() {}
|
||||
~Room173() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
185
engines/m4/burger/rooms/section1/room174.cpp
Normal file
185
engines/m4/burger/rooms/section1/room174.cpp
Normal file
@@ -0,0 +1,185 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room174.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "HALLWAY", nullptr, "174w001", nullptr },
|
||||
{ "TOILET", "174w002", "174w001", nullptr },
|
||||
{ "TOILET LID", "174w002", "174w001", nullptr },
|
||||
{ "TOILET TANK", "174w002", "174w001", nullptr },
|
||||
{ "FLUSH CHAIN", "174w002", "174w001", nullptr },
|
||||
{ "TUB", "174w004", "174w001", "174w005" },
|
||||
{ "WINDOW", nullptr, "174w001", "174w006" },
|
||||
{ "SHOWERHEAD", "174w007", "174w008", nullptr },
|
||||
{ "CLOSET", "174w009", "174w010", "174w010" },
|
||||
{ "MIRROR", "174w011", nullptr, "174w011" },
|
||||
{ "LAXATIVE ", "174w012", nullptr, "174w014" },
|
||||
{ "MEDICATIONS", "174w015", "174w016", "174w017" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 7, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 0, nullptr, 0, 0, 1, 2, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 18, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 0, 3, "507_003", 2, 255, -1, 1, 5, nullptr, 0 },
|
||||
{ 4, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 6, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
{ 5, 5, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
{ 4, 4, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room174::init() {
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 175:
|
||||
ws_demand_location(639, 299, 9);
|
||||
ws_walk(472, 297, nullptr, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(252, 304, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
_series1 = series_show("174tlt01", 0x8ff);
|
||||
_series2 = series_show("174flush", 0xf00);
|
||||
|
||||
if (inv_player_has("LAXATIVE")) {
|
||||
hotspot_set_active("LAXATIVE ", false);
|
||||
} else {
|
||||
_laxative.show("174wi01", 0x400, 0, -1, -1, 19);
|
||||
}
|
||||
}
|
||||
|
||||
void Room174::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
switch (_action) {
|
||||
case 5:
|
||||
terminateMachineAndNull(_series1);
|
||||
_action = 6;
|
||||
series_play_with_breaks(PLAY3, "174tlt01", 0x8ff, 1, 2);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
player_set_commands_allowed(true);
|
||||
_series1 = series_show("174tlt01", 0x8ff);
|
||||
break;
|
||||
|
||||
default:
|
||||
term_message("ERROR!!!!! toilet_should not set!");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
terminateMachineAndNull(_series2);
|
||||
_action = 5;
|
||||
_G(wilbur_should) = 2;
|
||||
series_play_with_breaks(PLAY1, "174wi03", 0x8ff, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_unhide_walker();
|
||||
wilbur_speech("174w003");
|
||||
_series2 = series_show("174flush", 0xf00);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_laxative.terminate();
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 4;
|
||||
series_play_with_breaks(PLAY2, "174wi01", 0x400, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
enable_player();
|
||||
inv_give_to_player("LAXATIVE");
|
||||
hotspot_set_active("LAXATIVE ", false);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room174::pre_parser() {
|
||||
if (player_said("HALLWAY") && !player_said_any("GEAR", "LOOK AT"))
|
||||
player_set_facing_at(522, 287);
|
||||
}
|
||||
|
||||
void Room174::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("HALLWAY") && player_said_any("GEAR", "LOOK AT")) {
|
||||
disable_player_commands_and_fade_init(1022);
|
||||
} else if (player_said("GEAR") && player_said_any("TOILET", "FLUSH CHAIN")) {
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TAKE", "LAXATIVE ")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 3;
|
||||
wilbur_speech("174w013", kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TAKE", "MIRROR")) {
|
||||
wilbur_speech("174w001");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
52
engines/m4/burger/rooms/section1/room174.h
Normal file
52
engines/m4/burger/rooms/section1/room174.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM174_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM174_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room174 : public Room {
|
||||
private:
|
||||
machine *_series1 = nullptr;
|
||||
machine *_series2 = nullptr;
|
||||
Series _laxative;
|
||||
int _action = 0;
|
||||
|
||||
public:
|
||||
Room174() : Room() {}
|
||||
~Room174() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
160
engines/m4/burger/rooms/section1/room175.cpp
Normal file
160
engines/m4/burger/rooms/section1/room175.cpp
Normal file
@@ -0,0 +1,160 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room175.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/core/play_break.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "WILBUR'S ROOM", nullptr, "175w001", nullptr },
|
||||
{ "BATHROOM", nullptr, "175w001", nullptr },
|
||||
{ "AUNT POLLY'S ROOM", "175w002", "175w001", "175w003" },
|
||||
{ "STAIRS", "175w004", "175w001", nullptr },
|
||||
{ "WINDOW", nullptr, nullptr, "175w005" },
|
||||
{ "VASE", "175w006", "175w007", "175w008" },
|
||||
{ "PICTURE", "175w012", "175w010", "175w011" },
|
||||
{ "PICTURE ", "175w013", "175w010", "175w011" },
|
||||
{ "PICTURE ", "175w014", "175w010", "175w011" },
|
||||
{ "PICTURE ", "175w009", "176w010", "175w011" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 3, "175_002a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, -1, "175_002b", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY2[] = {
|
||||
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, -1, "175_002a", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY3[] = {
|
||||
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room175::init() {
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 171:
|
||||
ws_demand_location(331, 272, 3);
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 174:
|
||||
ws_demand_location(150, 307, 3);
|
||||
ws_walk(222, 307, nullptr, -1);
|
||||
break;
|
||||
|
||||
case 176:
|
||||
ws_demand_location(72, 348, 3);
|
||||
ws_walk(170, 349, nullptr, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(327, 340, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
digi_preload("175_001");
|
||||
digi_play_loop("175_001", 2, 125);
|
||||
series_play("175fan", 0xf00, 0, -1, 6, -1);
|
||||
}
|
||||
|
||||
void Room175::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY1, "175wi01", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
disable_player();
|
||||
series_play_with_breaks(PLAY2, "175wi02", 0xc00, -1, 3);
|
||||
disable_player_commands_and_fade_init(1018);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
disable_player();
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY3, "175wi03", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room175::pre_parser() {
|
||||
if (!player_said_any("GEAR", "LOOK AT")) {
|
||||
if (player_said("BATHROOM"))
|
||||
player_set_facing_at(194, 301);
|
||||
|
||||
if (player_said("WILBUR'S ROOM"))
|
||||
player_set_facing_at(126, 343);
|
||||
}
|
||||
}
|
||||
|
||||
void Room175::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("GEAR", "STAIRS")) {
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("BATHROOM")) {
|
||||
disable_player_commands_and_fade_init(1021);
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("WILBUR'S ROOM")) {
|
||||
disable_player_commands_and_fade_init(1023);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
46
engines/m4/burger/rooms/section1/room175.h
Normal file
46
engines/m4/burger/rooms/section1/room175.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM175_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM175_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room175 : public Room {
|
||||
public:
|
||||
Room175() : Room() {}
|
||||
~Room175() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
139
engines/m4/burger/rooms/section1/room176.cpp
Normal file
139
engines/m4/burger/rooms/section1/room176.cpp
Normal file
@@ -0,0 +1,139 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/room176.h"
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *SAID[][4] = {
|
||||
{ "HALLWAY", nullptr, "176w001", nullptr },
|
||||
{ "PUZ DISPENSER ", "176w002", nullptr, "176w003" },
|
||||
{ "ROBOT", "176w004", "176w005", "176w006" },
|
||||
{ "WINDOW", nullptr, "176w001", "176w010" },
|
||||
{ "BED", nullptr, nullptr, "176w016" },
|
||||
{ "COMIC BOOK", "176w007", "176w008", "176w008" },
|
||||
{ "COMIC BOOK ", nullptr, "176w008", "176w008" },
|
||||
{ "GERBIL CAGE", "176w009", "176w005", "176w005" },
|
||||
{ "TELEVISION", "176w011", "176w015", "176w015" },
|
||||
{ "WARDROBE", "176w017", nullptr, "176w001" },
|
||||
{ "DRESSER", "176w018", nullptr, "176w001" },
|
||||
{ "BOOKS", nullptr, "176w008", "176w008" },
|
||||
{ "MODEL ROCKET", "176w006", "176w005", "176w006" },
|
||||
{ "MODEL ROCKET ", "176w019", "176w005", "176w006" },
|
||||
{ "MODEL ROCKET ", "176w020", "176w005", "176w006" },
|
||||
{ "POSTER", "176w021", "176w005", nullptr },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 22, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room176::init() {
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 175:
|
||||
ws_demand_location(546, 239, 9);
|
||||
ws_walk(447, 251, nullptr, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(340, 279, 5);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Original code to initialize the presence of the Puz Dispenser.
|
||||
* Replaced by the code hereunder in order to fix an original duplication bug (after you give it to Odie) */
|
||||
// if (inv_player_has("PUZ DISPENSER") || inv_player_has("BROKEN PUZ DISPENSER")) {
|
||||
// hotspot_set_active("PUZ DISPENSER ", false);
|
||||
// } else {
|
||||
// _puzDispenser = series_show("176pez", 0x500);
|
||||
// }
|
||||
|
||||
if (inv_object_in_scene("BROKEN PUZ DISPENSER", 176))
|
||||
_puzDispenser = series_show("176pez", 0x500);
|
||||
else
|
||||
hotspot_set_active("PUZ DISPENSER ", false);
|
||||
}
|
||||
|
||||
void Room176::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
disable_player();
|
||||
terminateMachineAndNull(_puzDispenser);
|
||||
_G(wilbur_should) = 2;
|
||||
series_play_with_breaks(PLAY1, "176wi01", 0x500, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
enable_player();
|
||||
inv_give_to_player("BROKEN PUZ DISPENSER");
|
||||
hotspot_set_active("PUZ DISPENSER ", false);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room176::pre_parser() {
|
||||
if (player_said("HALLWAY") && !player_said_any("GEAR", "LOOK AT"))
|
||||
player_set_facing_at(487, 238);
|
||||
}
|
||||
|
||||
void Room176::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said_any("GEAR", "LOOK AT") && player_said("HALLWAY")) {
|
||||
disable_player_commands_and_fade_init(1022);
|
||||
} else if (player_said("TAKE", "PUZ DISPENSER ")) {
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
49
engines/m4/burger/rooms/section1/room176.h
Normal file
49
engines/m4/burger/rooms/section1/room176.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_ROOM176_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_ROOM176_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room176 : public Room {
|
||||
private:
|
||||
machine *_puzDispenser = nullptr;
|
||||
|
||||
public:
|
||||
Room176() : Room() {}
|
||||
~Room176() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
272
engines/m4/burger/rooms/section1/section1.cpp
Normal file
272
engines/m4/burger/rooms/section1/section1.cpp
Normal file
@@ -0,0 +1,272 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section1/section1.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/core/imath.h"
|
||||
#include "m4/m4.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
Section1::Section1() : Rooms::Section() {
|
||||
add(101, &_room101);
|
||||
add(102, &_room102);
|
||||
add(103, &_room103);
|
||||
add(104, &_room104);
|
||||
add(105, &_room105);
|
||||
add(106, &_room106);
|
||||
add(120, &_room120);
|
||||
add(133, &_room133_136);
|
||||
add(134, &_room134_135);
|
||||
add(135, &_room134_135);
|
||||
add(136, &_room133_136);
|
||||
add(137, &_room137);
|
||||
add(138, &_room138);
|
||||
add(139, &_room139_144);
|
||||
add(140, &_room140_141);
|
||||
add(141, &_room140_141);
|
||||
add(142, &_room142);
|
||||
add(143, &_room143);
|
||||
add(145, &_room145);
|
||||
add(144, &_room139_144);
|
||||
add(170, &_room170);
|
||||
add(171, &_room171);
|
||||
add(172, &_room172);
|
||||
add(173, &_room173);
|
||||
add(174, &_room174);
|
||||
add(175, &_room175);
|
||||
add(176, &_room176);
|
||||
}
|
||||
|
||||
void Section1::updateWalker(int x, int y, int dir, int trigger, bool mode) {
|
||||
Section1 *s = dynamic_cast<Section1 *>(g_engine->_activeSection);
|
||||
assert(s);
|
||||
s->updateWalker_(x, y, dir, trigger, mode);
|
||||
}
|
||||
|
||||
void Section1::updateWalker_(int x, int y, int dir, int trigger, bool mode) {
|
||||
_trigger = trigger;
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(_G(my_walker), x, y);
|
||||
ws_demand_facing(_G(my_walker), dir);
|
||||
ws_hide_walker(_G(my_walker));
|
||||
_G(roomVal3) = 0;
|
||||
|
||||
gr_backup_palette();
|
||||
pal_fade_set_start(_G(master_palette), 0);
|
||||
_series1 = series_load("110", -1, _G(master_palette));
|
||||
_play = series_play("110", 0, 0, -1, 600, -1, 100, 0, 0, 0, 0);
|
||||
|
||||
kernel_trigger_dispatch_now(mode ? 1032 : 1027);
|
||||
kernel_timing_trigger(1, 1026);
|
||||
}
|
||||
|
||||
void Section1::updateDisablePlayer() {
|
||||
player_update_info(_G(my_walker), &_G(player_info));
|
||||
player_set_commands_allowed(false);
|
||||
g_vars->getInterface()->freshen_sentence();
|
||||
walk(-1);
|
||||
|
||||
_G(flags)[V000] = _G(flags)[kRoadOpened] ? 1002 : 1003;
|
||||
}
|
||||
|
||||
void Section1::walk(int facing, int trigger) {
|
||||
if (_G(my_walker) && _G(player).walker_in_this_scene) {
|
||||
player_update_info(_G(my_walker), &_G(player_info));
|
||||
|
||||
if (facing == -1)
|
||||
ws_walk(_G(my_walker), _G(player_info).x, _G(player_info).y, nullptr, trigger, _G(player_info).facing);
|
||||
else
|
||||
ws_walk(_G(my_walker), _G(player_info).x, _G(player_info).y, nullptr, trigger, facing, _G(completeWalk));
|
||||
}
|
||||
}
|
||||
|
||||
void Section1::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case GOTO_TOWN_HALL:
|
||||
case 1002:
|
||||
case 1003:
|
||||
case 1004:
|
||||
case 1005:
|
||||
case 1006:
|
||||
case 1007:
|
||||
_G(game).setRoom(_G(kernel).trigger - 1000 + 100);
|
||||
break;
|
||||
case 1008:
|
||||
_G(game).setRoom(_G(flags)[V000] == 1002 ? 134 : 135);
|
||||
break;
|
||||
case 1009:
|
||||
_G(game).setRoom(_G(flags)[V000] == 1002 ? 133 : 136);
|
||||
break;
|
||||
case 1010:
|
||||
_G(game).setRoom(137);
|
||||
break;
|
||||
case 1011:
|
||||
_G(game).setRoom(138);
|
||||
break;
|
||||
case 1012:
|
||||
_G(game).setRoom(_G(flags)[V000] == 1002 ? 144 : 139);
|
||||
break;
|
||||
case 1013:
|
||||
_G(game).setRoom(_G(flags)[V000] == 1002 ? 141 : 140);
|
||||
break;
|
||||
case 1014:
|
||||
_G(game).setRoom(142);
|
||||
break;
|
||||
case 1015:
|
||||
_G(game).setRoom(143);
|
||||
break;
|
||||
case 1016:
|
||||
_G(game).setRoom(145);
|
||||
break;
|
||||
case 1017:
|
||||
_G(game).setRoom(170);
|
||||
break;
|
||||
case 1018:
|
||||
_G(game).setRoom(171);
|
||||
break;
|
||||
case 1019:
|
||||
_G(game).setRoom(172);
|
||||
break;
|
||||
case 1020:
|
||||
_G(game).setRoom(173);
|
||||
break;
|
||||
case 1021:
|
||||
_G(game).setRoom(174);
|
||||
break;
|
||||
case 1022:
|
||||
_G(game).setRoom(175);
|
||||
break;
|
||||
case 1023:
|
||||
_G(game).setRoom(176);
|
||||
break;
|
||||
case 1024:
|
||||
pal_fade_init(_G(master_palette), 0, 255, 100, 0, -1);
|
||||
break;
|
||||
case 1025:
|
||||
kernel_trigger_dispatch_now(_trigger);
|
||||
break;
|
||||
case 1026:
|
||||
pal_fade_init(_G(master_palette), 15, 255, 100, 0, -1);
|
||||
break;
|
||||
case 1027:
|
||||
_series2 = series_load("110bu01", -1, _G(master_palette));
|
||||
series_play("110bu01", 0, 0, 1028, 6, 0, 100, 0, 0, 0, 8);
|
||||
_state1 = 2;
|
||||
break;
|
||||
case 1028:
|
||||
kernel_trigger_dispatch_now(1029);
|
||||
digi_play((_G(game).room_id == 135) ? "100b002" : "100b001", 1, 255, 1030);
|
||||
break;
|
||||
case 1029:
|
||||
if (_state1 == 2) {
|
||||
const int frame = imath_ranged_rand(9, 12);
|
||||
series_play("110bu01", 0, 0, 1029, 5, 0, 100, 0, 0, frame, frame);
|
||||
} else {
|
||||
pal_fade_set_start(_G(master_palette), 0);
|
||||
terminateMachineAndNull(_play);
|
||||
kernel_timing_trigger(1, 1031);
|
||||
}
|
||||
break;
|
||||
case 1030:
|
||||
_state1 = 1;
|
||||
return;
|
||||
case 1031:
|
||||
series_unload(_series2);
|
||||
series_unload(_series1);
|
||||
kernel_trigger_dispatch_now(_trigger);
|
||||
break;
|
||||
case 1032:
|
||||
_series2 = series_load("110bu02", -1, _G(master_palette));
|
||||
_state1 = 2;
|
||||
kernel_trigger_dispatch_now(1033);
|
||||
digi_play("100b003", 1, 255, 1034);
|
||||
break;
|
||||
case 1033:
|
||||
if (_state1 == 2) {
|
||||
const int frame = imath_ranged_rand(0, 4);
|
||||
series_play("110bu02", 0, 0, 1033, 5, 0, 100, 0, 0, frame, frame);
|
||||
} else {
|
||||
series_play("110bu02", 0, 0, 1035, 5, 0, 100, 0, 0, 5, 16);
|
||||
}
|
||||
break;
|
||||
case 1034:
|
||||
_state1 = 1;
|
||||
break;
|
||||
case 1035:
|
||||
pal_fade_set_start(_G(master_palette), 0);
|
||||
terminateMachineAndNull(_play);
|
||||
kernel_timing_trigger(1, 1036);
|
||||
break;
|
||||
case 1036:
|
||||
series_unload(_series2);
|
||||
series_unload(_series1);
|
||||
kernel_trigger_dispatch_now(_trigger);
|
||||
break;
|
||||
|
||||
case kAdvanceTime:
|
||||
if (_G(flags)[V012] == 2) {
|
||||
term_message(" Harry watches tv at: %d", _G(flags)[V009]);
|
||||
|
||||
if (_G(flags).get_boonsville_time_and_display() == (int32)_G(flags)[V009]) {
|
||||
if (_G(game).room_id == 102) {
|
||||
term_message("make harry walk in");
|
||||
kernel_timing_trigger(1, 1037);
|
||||
} else {
|
||||
term_message("harry is back in chair");
|
||||
_G(flags)[V012] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
case kBurlEntersTown:
|
||||
_G(flags)[V000] = _G(flags)[kRoadOpened] ? 1002 : 1003;
|
||||
break;
|
||||
case kBurlGetsFed:
|
||||
if (!_G(flags)[kRoadOpened])
|
||||
_G(flags)[V063] = 1;
|
||||
break;
|
||||
case kBurlStopsEating:
|
||||
if (!_G(flags)[kRoadOpened])
|
||||
_G(flags)[V063] = 0;
|
||||
break;
|
||||
case kBurlLeavesTown:
|
||||
if (!_G(flags)[kRoadOpened])
|
||||
_G(flags)[V000] = 1004;
|
||||
break;
|
||||
case kBandEntersTown:
|
||||
_G(flags)[kTourBusAtDiner] = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
108
engines/m4/burger/rooms/section1/section1.h
Normal file
108
engines/m4/burger/rooms/section1/section1.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/* 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
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION1_H
|
||||
#define M4_BURGER_ROOMS_SECTION1_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
#include "m4/burger/rooms/section.h"
|
||||
#include "m4/burger/rooms/section1/room101.h"
|
||||
#include "m4/burger/rooms/section1/room102.h"
|
||||
#include "m4/burger/rooms/section1/room103.h"
|
||||
#include "m4/burger/rooms/section1/room104.h"
|
||||
#include "m4/burger/rooms/section1/room105.h"
|
||||
#include "m4/burger/rooms/section1/room106.h"
|
||||
#include "m4/burger/rooms/section1/room120.h"
|
||||
#include "m4/burger/rooms/section1/room133_136.h"
|
||||
#include "m4/burger/rooms/section1/room134_135.h"
|
||||
#include "m4/burger/rooms/section1/room137.h"
|
||||
#include "m4/burger/rooms/section1/room138.h"
|
||||
#include "m4/burger/rooms/section1/room139_144.h"
|
||||
#include "m4/burger/rooms/section1/room140_141.h"
|
||||
#include "m4/burger/rooms/section1/room142.h"
|
||||
#include "m4/burger/rooms/section1/room143.h"
|
||||
#include "m4/burger/rooms/section1/room145.h"
|
||||
#include "m4/burger/rooms/section1/room170.h"
|
||||
#include "m4/burger/rooms/section1/room171.h"
|
||||
#include "m4/burger/rooms/section1/room172.h"
|
||||
#include "m4/burger/rooms/section1/room173.h"
|
||||
#include "m4/burger/rooms/section1/room174.h"
|
||||
#include "m4/burger/rooms/section1/room175.h"
|
||||
#include "m4/burger/rooms/section1/room176.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum Goto1 {
|
||||
GOTO_TOWN_HALL = 1001,
|
||||
GOTO_OLD_BRIDGE = 1008
|
||||
};
|
||||
|
||||
class Section1 : public Rooms::Section {
|
||||
private:
|
||||
Room101 _room101;
|
||||
Room102 _room102;
|
||||
Room103 _room103;
|
||||
Room104 _room104;
|
||||
Room105 _room105;
|
||||
Room106 _room106;
|
||||
Room120 _room120;
|
||||
Room133_136 _room133_136;
|
||||
Room134_135 _room134_135;
|
||||
Room137 _room137;
|
||||
Room138 _room138;
|
||||
Room139_144 _room139_144;
|
||||
Room140_141 _room140_141;
|
||||
Room142 _room142;
|
||||
Room143 _room143;
|
||||
Room145 _room145;
|
||||
Room170 _room170;
|
||||
Room171 _room171;
|
||||
Room172 _room172;
|
||||
Room173 _room173;
|
||||
Room174 _room174;
|
||||
Room175 _room175;
|
||||
Room176 _room176;
|
||||
|
||||
int _trigger = 0;
|
||||
int _series1 = -1;
|
||||
int _series2 = -1;
|
||||
machine *_play = nullptr;
|
||||
int _state1 = 0;
|
||||
|
||||
void updateWalker_(int x, int y, int dir, int trigger, bool mode);
|
||||
public:
|
||||
Section1();
|
||||
virtual ~Section1() {}
|
||||
|
||||
void daemon() override;
|
||||
|
||||
static void updateWalker(int x, int y, int dir, int trigger, bool mode = false);
|
||||
static void updateDisablePlayer();
|
||||
static void walk(int facing = -1, int trigger = -1);
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user