Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
/* 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/room.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
HotSpotRec Room::_wilburHotspot;
char Room::_wilburName[16];
char Room::_wilburVerb = 0;
void Room::setWilburHotspot() {
Common::strcpy_s(_wilburName, "Wilbur");
_wilburHotspot.clear();
_wilburHotspot.vocab = _wilburName;
_wilburHotspot.verb = &_wilburVerb;
_wilburHotspot.feet_x = 0x7fff;
_wilburHotspot.feet_y = 0x7fff;
_wilburHotspot.cursor_number = kArrowCursor;
}
HotSpotRec *Room::custom_hotspot_which(int32 x, int32 y) {
if (!_G(player).walker_in_this_scene || !_G(player).walker_visible)
return nullptr;
player_update_info();
int y2 = _G(player_info).y - (_G(player_info).scale * 75 / 100);
int y1 = _G(player_info).y - (_G(player_info).scale * 150 / 100);
int xSize = _G(player_info).scale * 22 / 100;
if (y > y2 || y <= y1 || imath_abs(x - _G(player_info).x) >= xSize)
return nullptr;
return &_wilburHotspot;
}
void Room::npc_say(const char *digiName, int trigger, const char *seriesName,
int layer, bool shadow, int firstFrame, int lastFrame, int digiSlot, int digiVol) {
term_message("npc_say: %s npc_series: %s npc_trigger: %d",
digiName, seriesName, trigger);
_G(npcTrigger) = trigger;
if (seriesName) {
_G(npcSpeech1) = series_play(seriesName, layer, 4, -1, 6, -1, 100, 0, 0, firstFrame, lastFrame);
if (shadow) {
char temp[20];
Common::strcpy_s(temp, 20, seriesName);
Common::strcat_s(temp, 20, "s");
_G(npcSpeech2) = series_play(temp, layer + 1, 4, -1, 6, -1, 100, 0, 0, firstFrame, lastFrame);
}
}
kernel_trigger_dispatch_now(kNPC_SPEECH_STARTED);
KernelTriggerType oldMode = _G(kernel).trigger_mode;
_G(kernel).trigger_mode = KT_DAEMON;
digi_play(digiName, digiSlot, digiVol, kNPC_SPEECH_FINISHED);
_G(kernel).trigger_mode = oldMode;
}
void Room::npc_say(int trigger, const char *seriesName, int layer, bool shadow,
int firstFrame, int lastFrame, int digiSlot, int digiVol) {
npc_say(conv_sound_to_play(), trigger, seriesName, layer, shadow,
firstFrame, lastFrame, digiSlot, digiVol);
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,74 @@
/* 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_ROOM_H
#define M4_BURGER_ROOMS_ROOM_H
#include "m4/core/rooms.h"
#include "m4/burger/core/play_break.h"
#include "m4/burger/core/stream_break.h"
#include "m4/burger/core/conv.h"
#include "m4/adv_r/conv_io.h"
#include "m4/core/imath.h"
#include "m4/graphics/gr_series.h"
#include "m4/adv_r/adv_hotspot.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room : public M4::Room {
private:
static char _wilburName[16];
static char _wilburVerb;
protected:
static HotSpotRec _wilburHotspot;
Series _roomSeries1;
Series _general;
public:
static void setWilburHotspot();
public:
Room() : M4::Room() {}
~Room() override {}
/**
* Used to tell if x,y is over the walker hotspot
*/
HotSpotRec *custom_hotspot_which(int32 x, int32 y) override;
void compact_mem_and_report() {}
void npc_say(const char *digiName, int trigger = -1, const char *seriesName = nullptr,
int layer = 0, bool shadow = true, int firstFrame = 0, int lastFrame = -1,
int digiSlot = 1, int digiVol = 255);
void npc_say(int trigger = -1, const char *seriesName = nullptr,
int layer = 0, bool shadow = true, int firstFrame = 0, int lastFrame = -1,
int digiSlot = 1, int digiVol = 255);
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,148 @@
/* 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/section.h"
#include "m4/gui/gui_vmng.h"
#include "m4/burger/vars.h"
#include "m4/m4.h"
namespace M4 {
namespace Burger {
namespace Rooms {
void Section::global_room_init() {
int roomId = _G(game).room_id;
if (roomId <= 800)
_GINT().show();
else
_GINT().hide();
// Disable commands for certain rooms
if (roomId == 201 || roomId == 301 || roomId == 306 || roomId == 307 ||
roomId == 401 || roomId == 501 || roomId == 511 || roomId == 512 ||
roomId == 513 || roomId == 601 || roomId == 605 || roomId == 606 ||
roomId == 608 || roomId == 609 || roomId == 610 || roomId == 801 ||
roomId == 902) {
player_set_commands_allowed(false);
}
if (roomId >= 950 || roomId == 902)
mouse_hide();
else
mouse_show();
// Do stuff that needs to be done each time a scene is started
init_series_players();
// Preload digi sounds
if (_G(player).walker_in_this_scene) {
switch (roomId) {
case 102:
case 103:
case 105:
case 134:
case 135:
case 143:
case 174:
case 175:
case 176:
case 304:
case 505:
case 506:
case 507:
case 509:
case 602:
case 603:
case 604:
case 612: {
static const char *NAMES[] = {
"fs_wood1", "fs_wood2", "fs_wood3", "fs_wood4", "fs_wood5", nullptr
};
_G(digi).loadFootstepSounds(NAMES);
break;
}
case 106:
case 139:
case 144:
case 145:
case 302:
case 303:
case 305: {
static const char *NAMES[] = {
"fs_dirt1", "fs_dirt2", "fs_dirt3", "fs_dirt4", "fs_dirt5", nullptr
};
_G(digi).loadFootstepSounds(NAMES);
break;
}
case 310:
case 311:
case 312:
case 313:
case 314:
case 315:
case 316:
case 317:
case 318:
case 319: {
static const char *NAMES[] = {
"fs_mine1", "fs_mine2", "fs_mine3", "fs_mine4", "fs_mine5", nullptr
};
_G(digi).loadFootstepSounds(NAMES);
break;
}
default: {
static const char *NAMES[] = {
"fs_hard1", "fs_hard2", "fs_hard3", "fs_hard4", "fs_hard5", nullptr
};
_G(digi).loadFootstepSounds(NAMES);
break;
}
}
}
if (_G(executing) == WHOLE_GAME) {
kernel_timing_trigger(900, kAdvanceHour, nullptr);
kernel_timing_trigger(300, kAdvanceTime, nullptr);
}
}
void Section::init_series_players() {
_G(seriesPlayers).clear();
}
void Section::tick() {
int oldTrigger = _G(kernel).trigger;
_G(kernel).trigger = kCALLED_EACH_LOOP;
g_engine->game_daemon_code();
_G(kernel).trigger = oldTrigger;
}
void Section::daemon() {
_G(kernel).continue_handling_trigger = true;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,48 @@
/* 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_SECTION_H
#define M4_BURGER_ROOMS_SECTION_H
#include "m4/core/rooms.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section : public M4::Section {
private:
void init_series_players();
public:
Section() : M4::Section() {}
~Section() override {}
void global_room_init() override;
void tick() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

View 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

View 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

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

View 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

View 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

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -0,0 +1,117 @@
/* 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/section2/room204.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesPlayBreak Room204::PLAY1[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room204::PLAY2[] = {
{ 2, 8, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 9, 14, "204_001", 2, 63, -1, 0, 0, nullptr, 0 },
{ 14, 9, "204_001", 2, 63, -1, 1, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room204::PLAY3[] = {
{ 15, 18, "204w001", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room204::PLAY4[] = {
{ 18, -1, nullptr, 0, 0, -1, 16, 0, nullptr, 0 },
PLAY_BREAK_END
};
void Room204::preload() {
_G(player).walker_in_this_scene = false;
}
void Room204::init() {
digi_preload("200_001");
digi_play_loop("200_001", 3, 85, -1, 200);
series_load("204as01");
series_load("204as01s");
digi_preload("204_001");
digi_preload("204w001");
kernel_trigger_dispatch_now(1);
}
void Room204::daemon() {
switch (_G(kernel).trigger) {
case 1:
Series::series_show("204as01", 0x100, 0, 2, 120, 0);
break;
case 2:
series_play_with_breaks(PLAY1, "204as01", 0x100, 3, 1);
break;
case 3:
Series::series_show("204as01", 0x100, 0, 4, 60, 2);
break;
case 4:
series_play_with_breaks(PLAY2, "204as01", 0x100, 5, 1, 6);
break;
case 5:
Series::series_show("204as01", 0x100, 0, 6, 60, 14);
break;
case 6:
series_play_with_breaks(PLAY3, "204as01", 0x100, 7, 1, 6);
break;
case 7:
Series::series_show("204as01", 0x100, 0, 8, 15, 18);
break;
case 8:
series_play_with_breaks(PLAY4, "204as01", 0x100, 9, 1, 6);
break;
case 9:
kernel_timing_trigger(60, 10);
break;
case 10:
disable_player_commands_and_fade_init(2002);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,51 @@
/* 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_SECTION2_ROOM204_H
#define M4_BURGER_ROOMS_SECTION2_ROOM204_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room204 : public Room {
private:
static const seriesPlayBreak PLAY1[];
static const seriesPlayBreak PLAY2[];
static const seriesPlayBreak PLAY3[];
static const seriesPlayBreak PLAY4[];
public:
Room204() : Room() {}
~Room204() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View 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/section2/room207.h"
#include "m4/burger/burger.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum {
kCHANGE_ASTRAL_ANIMATION = 1
};
const seriesPlayBreak Room207::PLAY1[] = {
{ 0, 22, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY2[] = {
{ 22, 17, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 18, 25, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 31, 33, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 34, 31, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY3[] = {
{ 0, 13, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 25, 29, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY4[] = {
{ 29, 25, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 13, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY5[] = {
{ 35, 37, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 37, 35, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY6[] = {
{ 0, 17, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY7[] = {
{ 29, 22, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY8[] = {
{ 5, 23, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY9[] = {
{ 23, 5, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY10[] = {
{ 31, 24, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY11[] = {
{ 24, 31, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room207::PLAY12[] = {
{ 18, 22, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesStreamBreak Room207::SERIES1[] = {
{ 0, nullptr, 0, 0, -1, 0, nullptr, 0 },
{ 18, "207w001", 1, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room207::SERIES2[] = {
{ 0, nullptr, 0, 0, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room207::preload() {
_G(player).walker_in_this_scene = false;
}
void Room207::init() {
player_set_commands_allowed(false);
digi_preload("207_001");
digi_play_loop("207_001", 3, 60);
_G(kernel).trigger_mode = KT_DAEMON;
series_load("207WI01");
series_load("207AS01");
series_load("207AS01S");
series_load("207AS03");
series_load("207AS03S");
series_load("207AS04");
series_load("207AS04S");
_conv1 = _G(flags).getConvName();
if (!_conv1)
_conv1 = "conv51";
interface_hide();
if (!strcmp(_conv1, "conv53")) {
_G(kernel).suppress_fadeup = true;
kernel_trigger_dispatch_now(3);
} else {
kernel_trigger_dispatch_now(2);
}
}
void Room207::daemon() {
switch (_G(kernel).trigger) {
case kCHANGE_ASTRAL_ANIMATION:
switch (_astralMode) {
case 15:
switch (_astralShould) {
case 1:
_astralShould = 7;
_series1.play("207as03", 0x200, 4, -1, 6, -1, 100, 0, 0, 31, 34);
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_ASTRAL_ANIMATION);
break;
case 7:
_series1.terminate();
_astralShould = 10;
conv_resume_curr();
kernel_trigger_dispatch_now(kCHANGE_ASTRAL_ANIMATION);
break;
case 8:
_astralMode = 16;
_astralShould = 8;
series_play_with_breaks(PLAY4, "207as03", 0x200, 5, kCHANGE_ASTRAL_ANIMATION);
break;
case 10:
_astralShould = getAstralShould();
Series::series_show("207as03", 0x200, 0, kCHANGE_ASTRAL_ANIMATION, 30, 30);
break;
case 11:
_astralShould = 10;
series_play_with_breaks(PLAY5, "207as03", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 12:
_astralMode = 17;
_astralShould = 12;
series_play_with_breaks(PLAY10, "207as04", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 13:
_astralMode = 0;
series_play_with_breaks(PLAY7, "207as03", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
default:
break;
}
break;
case 16:
switch (_astralShould) {
case 1:
_astralShould = 7;
_series1.play("207as01", 0x200, 4, -1, 6, -1, 100, 0, 0, 26, 30);
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_ASTRAL_ANIMATION);
break;
case 7:
_series1.terminate();
_astralShould = 8;
conv_resume_curr();
kernel_trigger_dispatch_now(kCHANGE_ASTRAL_ANIMATION);
break;
case 8:
_astralShould = getAstralShould();
_series1.show("207as01", 0x200, 0, kCHANGE_ASTRAL_ANIMATION, 30, 23);
break;
case 9:
_astralShould = 8;
series_play_with_breaks(PLAY2, "207as01", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 10:
_astralMode = 15;
_astralShould = 10;
series_play_with_breaks(PLAY3, "207as03", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 12:
_astralMode = 17;
_astralShould = 12;
series_play_with_breaks(PLAY8, "207as04", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 13:
_astralMode = 0;
series_play_with_breaks(PLAY6, "207as03", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
default:
break;
}
break;
case 17:
switch (_astralShould) {
case 1:
_astralShould = 7;
_series1.play("207as04", 0x200, 4, -1, 6, -1, 100, 0, 0, 0, 4);
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_ASTRAL_ANIMATION);
break;
case 7:
_series1.terminate();
_astralShould = 12;
conv_resume_curr();
kernel_trigger_dispatch_now(kCHANGE_ASTRAL_ANIMATION);
break;
case 8:
_astralMode = 16;
_astralShould = 8;
series_play_with_breaks(PLAY9, "207as04", 0x200, 5, 1);
break;
case 10:
_astralMode = 15;
_astralShould = 10;
series_play_with_breaks(PLAY11, "207as04", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 12:
_astralShould = getAstralShould();
Series::series_show("207as04", 0x200, 0, kCHANGE_ASTRAL_ANIMATION, 30, 0);
break;
case 13:
_astralMode = 15;
series_play_with_breaks(PLAY11, "207as03", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
default:
break;
}
break;
default:
switch (_astralShould) {
case 5:
_astralMode = 16;
_astralShould = 8;
series_play_with_breaks(PLAY1, "207as01", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 13:
digi_play(conv_sound_to_play(), 1, 255, 6);
_series1.play("207as03", 0x200, 1, -1, 6, -1, 100, 0, 0, 18, 22);
break;
default:
break;
}
break;
}
break;
case 2:
conv_load_and_prepare(_conv1, 7);
conv_play_curr();
_G(wilbur_should) = 4;
_astralMode = 0;
_astralShould = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
kernel_trigger_dispatch_now(kCHANGE_ASTRAL_ANIMATION);
break;
case 3:
gr_backup_palette();
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "207a", 6, 0x100, 4);
pal_fade_init(_G(kernel).first_fade, 255, 100, 0, -1);
break;
case 4:
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
series_stream_with_breaks(SERIES2, "207b", 6, 0xf00, -1);
gr_restore_palette();
release_trigger_on_digi_state(2, 1);
break;
case 5:
series_play_with_breaks(PLAY12, "207as01", 0x200, kCHANGE_ASTRAL_ANIMATION, 1);
break;
case 6:
_series1.terminate();
Series::series_show("207as03", 0x200, 0, -1, -1, 22);
conv_resume_curr();
break;
case 7:
player_set_commands_allowed(false);
disable_player_commands_and_fade_init(8);
break;
case 8:
static_cast<Burger::BurgerEngine *>(g_engine)->handleTestDone();
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
if (!strcmp(conv_sound_to_play(), "53p0101")) {
_G(wilbur_should) = 3;
conv_resume_curr();
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_G(wilbur_should) = 2;
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_WILBUR_ANIMATION);
_general1 = series_play("207wi01", 0x400, 4, -1, 6, -1);
}
break;
case 2:
terminateMachineAndNull(_general1);
_G(wilbur_should) = 3;
conv_resume_curr();
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 3:
_G(wilbur_should) = getWilburShould();
series_show("207wi01", 0x400, 0, kCHANGE_WILBUR_ANIMATION, 30, 0);
break;
case 4:
_G(wilbur_should) = getWilburShould();
series_play("207wi01", 0x400, 1, kCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 0, 2);
break;
default:
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room207::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said(_conv1)) {
handleConv();
_G(player).command_ready = false;
}
}
void Room207::handleConv() {
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) {
_G(wilbur_should) = 1;
if (player_said("conv56") && node == 4)
_astralShould = 8;
if (node == 0 && entry == 1)
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, -1);
} else if (player_said("conv51") && node == 8) {
_astralShould = 13;
} else {
_astralShould = 1;
}
}
}
int Room207::getAstralShould() const {
const int rand = imath_ranged_rand(1, 24);
switch (_astralMode) {
case 15:
switch (rand) {
case 1:
return 8;
case 2:
return 11;
case 3:
return 12;
default:
return 10;
}
break;
case 16:
switch (rand) {
case 1:
return 10;
case 2:
case 3:
return 9;
case 4:
return 12;
default:
return 8;
}
break;
case 17:
switch (rand) {
case 1:
return 8;
case 2:
return 10;
default:
return 12;
}
break;
default:
return _astralShould;
}
}
int Room207::getWilburShould() const {
const int rand = imath_ranged_rand(1, 8);
return (rand == 1) ? 4 : 3;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,71 @@
/* 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_SECTION2_ROOM207_H
#define M4_BURGER_ROOMS_SECTION2_ROOM207_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room207 : public Room {
private:
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 seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
const char *_conv1 = nullptr;
Series _series1;
machine *_general1 = nullptr;
int _astralShould = 0;
int _astralMode = 0;
void handleConv();
int getAstralShould() const;
int getWilburShould() const;
public:
Room207() : Room() {}
~Room207() override {}
void preload() override;
void init() override;
void daemon() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,53 @@
/* 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/section2/section2.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
Section2::Section2() : Rooms::Section() {
add(204, &_room204);
add(207, &_room207);
}
void Section2::daemon() {
switch (_G(kernel).trigger) {
case 2001:
_G(game).setRoom(204);
break;
case 2002:
_G(game).setRoom(207);
break;
default:
break;
}
_G(kernel).continue_handling_trigger = true;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,50 @@
/* 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_SECTION2_H
#define M4_BURGER_ROOMS_SECTION2_H
#include "m4/burger/rooms/room.h"
#include "m4/burger/rooms/section.h"
#include "m4/burger/rooms/section2/room204.h"
#include "m4/burger/rooms/section2/room207.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section2 : public Rooms::Section {
private:
Room204 _room204;
Room207 _room207;
public:
Section2();
virtual ~Section2() {}
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,495 @@
/* 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/section3/mine.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
#define MINE_END 39
const char *Mine::SAID[][4] = {
{ "TUNNEL", "311w007", "311w007z", nullptr },
{ "DEBRIS", nullptr, "311w010", "311w011" },
{ "GROUND", "311w012", "311w007z", "311w007z" },
{ "WALL", "311w012", "311w007z", "311w007z" },
{ "CEILING", "311w012", "311w007z", "311w007z" },
{ nullptr, nullptr, nullptr, nullptr }
};
const int16 Mine::MINE_SCENE_NUMBERS[] = {
305, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319
};
const MineRoom Mine::MINE_INFO[] = {
// Links Doors
// --------------------- -------------------------- Correct
// Room# Scene ID Back Front Left Right Back Front Left Right Link Check
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ------- -----
{ 0, SCENE_305, { 6, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0}, // mine entrance
{ 1, SCENE_313, { -1, -1, 2, 6 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
{ 2, SCENE_316, { -1, 11, 13, 1 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
{ 3, SCENE_318, { 9, 14, 5, 4 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
{ 4, SCENE_315, { 5, -1, 3, 10 }, { FRONT, NONE, RIGHT, LEFT }, LEFT, 0},
{ 5, SCENE_317, { 18, 4, 9, 3 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
{ 6, SCENE_318, { 11, 0, 1, 7 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
{ 7, SCENE_317, { 13, 14, 6, 18 }, { FRONT, RIGHT, RIGHT, LEFT }, FRONT, 0},
{ 8, SCENE_313, { -1, -1, 10, 9 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
{ 9, SCENE_318, { 10, 3, 8, 5 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ---- ---}--
{10, SCENE_316, { -1, 9, 4, 8 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
{11, SCENE_317, { 2, 6, 11, 11 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
{12, SCENE_319, { -1, -1, -1, 13 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
{13, SCENE_316, { -1, 7, 12, 2 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
{14, SCENE_315, { 3, -1, 26, 7 }, { FRONT, NONE, BACK, FRONT}, LEFT, 0},
{15, SCENE_317, { 17, 16, 17, 20 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
{16, SCENE_311, { 15, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0},
{17, SCENE_318, { 22, 15, 20, 15 }, { FRONT, BACK, RIGHT, LEFT }, LEFT, 0},
{18, SCENE_316, { -1, 5, 7, 19 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
{19, SCENE_312, { -1, -1, 18, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
// ----- ---------- ---- ----- ---- ----- ----- ----- ------ ----- ---- ---}--
{20, SCENE_315, { 26, -1, 15, 17 }, { FRONT, NONE, RIGHT, LEFT }, BACK, 0},
{21, SCENE_319, { -1, -1, -1, 22 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
{22, SCENE_316, { -1, 17, 21, 23 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
{23, SCENE_312, { -1, -1, 22, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
{24, SCENE_318, { 35, 29, 33, 25 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
{25, SCENE_314, { -1, -1, 24, 26 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
{26, SCENE_317, { 14, 20, 25, 38 }, { LEFT, BACK, RIGHT, LEFT }, RIGHT, 0},
{27, SCENE_318, { 38, 38, 37, 28 }, { FRONT, BACK, RIGHT, LEFT }, BACK, 0},
{28, SCENE_312, { -1, -1, 27, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
{29, SCENE_317, { 24, 30, 35, 31 }, { FRONT, BACK, RIGHT, LEFT }, BACK, 0},
// ----- ---------- ---- ----- ---- ----- ----- ----- ------ ----- ---- -----
{30, SCENE_311, { 29, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0},
{31, SCENE_312, { -1, -1, 29, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
{32, SCENE_319, { -1, -1, -1, 33 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
{33, SCENE_314, { -1, -1, 32, 24 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
{34, SCENE_319, { -1, -1, -1, 35 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
{35, SCENE_316, { -1, 24, 34, 29 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
{36, SCENE_319, { -1, -1, -1, 37 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
{37, SCENE_314, { -1, -1, 36, 27 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
{38, SCENE_318, { 27, 27, 26, 39 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
{39, SCENE_310, { -1, -1, 38, -1 }, { NONE, NONE, RIGHT, NONE }, NONE, 0}, // treasure
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ------- -----
{40, NO_SCENE, { -1, -1, -1, -1 }, { NONE, NONE, NONE, NONE }, NONE, 0}
};
const EntranceInfo Mine::ENTRANCE_INFO[MAX_SCENE_TYPES][4] = {
//
// ( offscreen_x, offscreen_y, enter_facing, home_x, home_y, home_facing ) x 4 possible entrances
//
// Back Front Left Right
//----------------------- ------------------------- ------------------------- -------------------------
{{285, 240, 5, 320, 290, 5}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}}, // 305
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 55, 245, 3, 225, 275, 3}, { 0, 0, 0, 0, 0, 0}}, // 310
{{315, 225, 7, 310, 275, 7}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}}, // 311
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 90, 240, 3, 220, 270, 4}, { 0, 0, 0, 0, 0, 0}}, // 312
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 65, 230, 3, 215, 270, 4}, {550, 240, 8, 400, 270, 8}}, // 313
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 65, 240, 3, 190, 270, 4}, {570, 250, 8, 440, 280, 8}}, // 314
{{320, 210, 7, 315, 270, 7}, { 0, 0, 0, 0, 0, 0}, { 60, 230, 3, 190, 270, 4}, {560, 250, 9, 400, 270, 8}}, // 315
{{ 0, 0, 0, 0, 0, 0}, {400, 373,11, 335, 300, 7}, { 60, 220, 3, 200, 270, 4}, {570, 240, 8, 400, 270, 7}}, // 316
{{320, 215, 7, 315, 270, 7}, {230, 373, 1, 330, 300, 7}, { 60, 220, 3, 200, 270, 4}, {570, 240, 8, 400, 270, 7}}, // 317
{{320, 215, 5, 315, 270, 7}, {350, 373,11, 330, 300, 7}, { 60, 240, 3, 190, 270, 4}, {560, 235, 9, 420, 270, 8}}, // 318
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, {530, 240, 9, 420, 270, 7}} // 319
};
const Rectangle Mine::FADE_DOWN_INFO[MAX_SCENE_TYPES][4] = {
//
// ( x1, y1, x2, y2) for four directions
//
// Back Front Left Right
//------------------- ------------------- ------------------- -------------------
{{255, 0, 315, 250}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}}, // 305
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 170, 270}, { 0, 0, 0, 0}}, // 310
{{270, 0, 365, 255}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}}, // 311
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 175, 268}, { 0, 0, 0, 0}}, // 312
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 172, 256}, {470, 0, 639, 265}}, // 313
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 172, 265}, {470, 0, 639, 280}}, // 314
{{280, 0, 365, 245}, { 0, 0, 0, 0}, { 0, 0, 165, 257}, {470, 0, 639, 271}}, // 315
{{ 0, 0, 0, 0}, {325, 350, 500, 374}, { 0, 0, 178, 265}, {470, 0, 639, 265}}, // 316
{{275, 0, 365, 255}, {136, 344, 360, 374}, { 0, 0, 165, 268}, {470, 0, 639, 270}}, // 317
{{275, 0, 365, 252}, {185, 344, 500, 374}, { 0, 0, 165, 265}, {470, 0, 639, 270}}, // 318
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {470, 0, 639, 270}} // 319
};
int16 Mine::_entranceDoor;
void MineRoom::clear() {
roomNumber = 0;
scene_id = 0;
Common::fill(link, link + 4, 0);
Common::fill(door, door + 4, 0);
correctLink = 0;
check = 0;
}
Mine::Mine() : Section3Room() {
_mineRoomInfo.clear();
}
void Mine::preload() {
Section3Room::preload();
_mineCtr = 0;
_G(player).walker_type = 0;
_G(player).shadow_type = 0;
}
void Mine::init() {
setupDigi();
if (_G(flags)[kTrufflesInMine]) {
for (int i = 0; i < 6; ++i)
digi_preload(Common::String::format("300t001%c", 'a' + i));
}
_fade_down_rect_active = false;
set_palette_brightness(30);
_G(kernel).call_daemon_every_loop = true;
_mineCtr = 0;
const int32 &mineRoomIndex = _G(flags)[kMineRoomIndex];
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get this mine room info
_presentSceneID = _mineRoomInfo.scene_id; // Set the scene ID
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
default:
player_set_commands_allowed(false);
ws_demand_location(-50, 200);
kernel_trigger_dispatch_now(301);
break;
}
}
void Mine::daemon() {
switch (_G(kernel).trigger) {
case 301:
case 302: {
const EntranceInfo &ei = ENTRANCE_INFO[_presentSceneID][_entranceDoor];
if (_G(kernel).trigger == 301)
ws_demand_location(ei.offscreen_x, ei.offscreen_y, ei.enter_facing);
player_set_commands_allowed(false);
ws_walk(ei.home_x, ei.home_y, nullptr, 303, ei.home_facing);
term_message("Mine entry %d at (%d,%d) to (%d,%d, %d)",
_presentSceneID,
ei.offscreen_x, ei.offscreen_y,
ei.home_x, ei.home_y, ei.home_facing);
break;
}
case 303:
player_set_commands_allowed(true);
if (_G(game).room_id == 310) {
if (_G(flags)[V141]) {
_G(wilbur_should) = 10002;
} else {
_G(flags)[V141] = 1;
_G(wilbur_should) = 408;
}
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (_G(game).room_id != 305) {
if (!_G(flags)[kEnteredMine]) {
_G(flags)[kEnteredMine] = 1;
_G(wilbur_should) = _G(flags)[kTrufflesInMine] ? 402 : 401;
} else if (!imath_rand_bool(3)) {
_G(wilbur_should) = 10002;
} else if (!_G(flags)[kTrufflesInMine]) {
_G(wilbur_should) = 404;
} else {
_G(wilbur_should) = inv_player_has("WHISTLE") ? 406 : 405;
}
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
break;
case 304:
digi_play("300_007", 2);
break;
case 305:
_volume = 160 - getTreasureDistance() * 25;
_random1 = imath_ranged_rand(0, 5);
digi_play(Common::String::format("300t001%c", 'a' + _random1).c_str(), 3, _volume);
break;
case 10008:
switch (_G(game).room_id) {
case 305:
case 310:
_G(kernel).continue_handling_trigger = true;
break;
default:
if (_G(flags)[kTrufflesInMine] && !_G(flags)[kTrufflesRanAway])
kernel_timing_trigger(15, 305);
break;
}
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 401:
wilbur_speech("311w001");
break;
case 402:
player_set_commands_allowed(false);
_G(wilbur_should) = 403;
wilbur_speech("311w002", kCHANGE_WILBUR_ANIMATION);
break;
case 403:
player_set_commands_allowed(true);
wilbur_speech("311w003");
break;
case 404:
player_set_commands_allowed(true);
_random2 = imath_ranged_rand(0, 5);
wilbur_speech(Common::String::format("311w004%c", 'a' + _random2).c_str());
break;
case 405:
term_message("Wilbur enters the mine with no whistle!");
player_set_commands_allowed(true);
_random2 = imath_ranged_rand(0, 3);
digi_play(Common::String::format("311w005%c", 'a' + _random2).c_str(), 3, _volume);
break;
case 406:
_random2 = imath_ranged_rand(0, 2);
wilbur_speech(Common::String::format("311w006%c", 'a' + _random2).c_str());
break;
case 407:
if (_G(flags)[V136]) {
_random2 = imath_ranged_rand(0, 6);
wilbur_speech(Common::String::format("311w009%c", 'a' + _random2).c_str());
} else {
wilbur_speech("311w008");
}
break;
case 408:
wilbur_speech("310w001");
break;
case kWILBUR_SPEECH_STARTED:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
term_message("Mine whistle daemon thing");
switch (_G(game).room_id) {
case 305:
if (_G(flags)[kTrufflesInMine]) {
_G(flags)[V002] = 1;
wilbur_speech("300w060");
}
break;
case 310:
if (_G(flags)[kTrufflesInMine] && !_G(flags)[kTrufflesRanAway]) {
_G(flags)[kTrufflesRanAway] = 1;
} else {
wilbur_speech("300w069");
}
break;
default:
if (!_G(flags)[kTrufflesInMine] && _G(flags)[kTrufflesRanAway]) {
// Truffles is too far away
wilbur_speech("300w061");
} else if (!_G(flags)[V148]) {
_G(flags)[V148] = 1;
_treasureDistance = getTreasureDistance();
switch (_treasureDistance) {
case 1:
wilbur_speech("300w062");
break;
case 2:
wilbur_speech("300w063");
break;
case 3:
case 4:
wilbur_speech("300w064");
break;
case 5:
case 6:
wilbur_speech("300w065");
break;
default:
break;
}
_previousDistance = _treasureDistance;
} else {
_treasureDistance = getTreasureDistance();
if (_treasureDistance < _previousDistance) {
wilbur_speech("300w068");
} else if (_treasureDistance == _previousDistance) {
wilbur_speech("300w067");
} else {
wilbur_speech("300w066");
}
_previousDistance = _treasureDistance;
}
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case kCALLED_EACH_LOOP:
if (_fade_down_rect_active) {
player_update_info();
if (_G(player_info).x >= _fade_down_rect.x1 &&
_G(player_info).x <= _fade_down_rect.x2 &&
_G(player_info).y >= _fade_down_rect.y1 &&
_G(player_info).y <= _fade_down_rect.y2) {
if (player_commands_allowed()) {
pal_fade_set_start(100);
pal_fade_init(_G(kernel).first_fade, 255, 0, 40, -1);
}
player_set_commands_allowed(false);
}
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Mine::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
_fade_down_rect_active = false;
if (player_said("tunnel") && player_said_any("walk through", "GEAR")) {
if (_G(player).click_y > 300)
set_fade_down_rect(FRONT);
else if (_G(player).click_x < 200)
set_fade_down_rect(LEFT);
else if (_G(player).click_x < 400)
set_fade_down_rect(BACK);
else
set_fade_down_rect(RIGHT);
// Turn on the fade down area
_fade_down_rect_active = true;
}
}
void Mine::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("LOOK AT") && player_said_any("WALL", "CEILING", "GROUND")) {
term_message("Room #: %d", _G(flags)[kMineRoomIndex]);
term_message("Distance from pig: %d", getTreasureDistance());
_mineCtr = (_mineCtr + 1) % 5;
if (_mineCtr == 0) {
wilbur_speech("311w012");
_G(player).command_ready = false;
return;
}
}
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("tunnel") && player_said_any("walk through", "GEAR")) {
pal_fade_set_start(0);
if (_G(player).click_y > 300)
mine_travel_link(FRONT);
else if (_G(player).click_x < 200)
mine_travel_link(LEFT);
else if (_G(player).click_x > 400)
mine_travel_link(RIGHT);
else
mine_travel_link(BACK);
} else if (player_said("LOOK AT", "DEBRIS") && _G(game).room_id != 305) {
_G(wilbur_should) = 407;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
return;
}
_G(player).command_ready = false;
}
int Mine::getTreasureDistance() const {
int distance = 0;
for (int index = _G(flags)[kMineRoomIndex]; index != MINE_END; ++distance) {
const MineRoom &me = MINE_INFO[index];
index = me.link[me.correctLink];
}
return distance;
}
void Mine::mine_travel_link(int16 takeLink) {
int32 &mineRoomIndex = _G(flags)[kMineRoomIndex];
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get this mine room info
_entranceDoor = _mineRoomInfo.door[takeLink]; // Get which door to enter from in new room
mineRoomIndex = _mineRoomInfo.link[takeLink]; // Get which link to take
assert(mineRoomIndex != -1);
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get new mine room info from new index
_presentSceneID = _mineRoomInfo.scene_id; // Set the scene ID
_G(game).setRoom(MINE_SCENE_NUMBERS[_presentSceneID]); // Go to the corresponding scene number
_G(kernel).force_restart = true; // Makes the scene start over even if new_room = present room
}
void Mine::set_fade_down_rect(MineDoors exit_door) {
_fade_down_rect.x1 = FADE_DOWN_INFO[_presentSceneID][exit_door].x1;
_fade_down_rect.y1 = FADE_DOWN_INFO[_presentSceneID][exit_door].y1;
_fade_down_rect.x2 = FADE_DOWN_INFO[_presentSceneID][exit_door].x2;
_fade_down_rect.y2 = FADE_DOWN_INFO[_presentSceneID][exit_door].y2;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,134 @@
/* 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_SECTION3_MINE_ROOM_H
#define M4_BURGER_ROOMS_SECTION3_MINE_ROOM_H
#include "m4/burger/rooms/section3/section3_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum MineDoors {
BACK, FRONT, LEFT, RIGHT, MAX_DOORS, NONE
};
enum MineScenes {
SCENE_305, // treasure
SCENE_310, // mine entrance
SCENE_311, // one door (a)
SCENE_312, // one door (b)
SCENE_313, // two doors (a)
SCENE_314, // two doors (b)
SCENE_315, // three doors (a)
SCENE_316, // three doors (b)
SCENE_317, // four doors (a)
SCENE_318, // four doors (b)
SCENE_319, // one door (c)
MAX_SCENE_TYPES,
TREASURE_SCENE = SCENE_310,
ENTRANCE_SCENE = SCENE_305,
NO_SCENE = MAX_SCENE_TYPES
};
struct MineRoom {
int16 roomNumber; // The mine room number
int16 scene_id; // The scene id (indexes for mine_scene_numbers)
int16 link[4]; // Links to other mine rooms
int16 door[4]; // Specify doors to use
int16 correctLink; // The correct link to take to get to the treasure
int16 check; // Used to check the maze sanity
void clear();
};
struct EntranceInfo {
int16 offscreen_x;
int16 offscreen_y;
int16 enter_facing;
int16 home_x;
int16 home_y;
int16 home_facing;
};
struct Rectangle {
int16 x1;
int16 y1;
int16 x2;
int16 y2;
};
class Mine : public Section3Room {
private:
static const char *SAID[][4];
static const int16 MINE_SCENE_NUMBERS[];
static const MineRoom MINE_INFO[];
/**
* Coords for starting fade down for exits
*/
static const Rectangle FADE_DOWN_INFO[MAX_SCENE_TYPES][4];
/**
* Room coords for entrance walk-ins
*/
static const EntranceInfo ENTRANCE_INFO[MAX_SCENE_TYPES][4];
int _mineCtr = 0;
int16 _presentSceneID = 0;
static int16 _entranceDoor; // Shared between cellar and mine room classes
MineRoom _mineRoomInfo;
bool _fade_down_rect_active = false; // True if a fade down should occur when walker in the fade_down_rect
Rectangle _fade_down_rect = {0, 0, 0, 0}; // If the walker is in his rectum and its active, turn off the lights
int _volume = 0;
int _random1 = 0;
int _random2 = 0;
int _treasureDistance = 0;
int _previousDistance = 0;
int getTreasureDistance() const;
protected:
const char *getDigi() override {
return "300_004";
}
void mine_travel_link(int16 takeLink);
void set_fade_down_rect(MineDoors exit_door);
public:
Mine();
virtual ~Mine() {}
void preload() override;
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,263 @@
/* 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/section3/room301.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room301::SERIES1[] = {
{ 0, nullptr, 0, 0, 16, 0, nullptr, 0 },
{ 1, "301_010", 3, 60, -1, (uint)-1, nullptr, 0 },
{ 9, "301W001", 1, 255, -1, 0, nullptr, 0 },
{ 39, "301F001", 1, 255, -1, 0, nullptr, 0 },
{ 42, "301_007", 2, 255, -1, 0, nullptr, 0 },
{ 63, "301_003", 1, 255, -1, 0, nullptr, 0 },
{ 65, "301_019", 2, 275, -1, 0, nullptr, 0 },
{ 75, nullptr, 1, 0, -1, 0, nullptr, 0 },
{ 77, "301F001A", 1, 255, -1, 0, nullptr, 0 },
{ 110, "301Z001", 1, 255, -1, 0, nullptr, 0 },
{ 129, nullptr, 0, 0, 15, 0, nullptr, 0 },
{ 132, nullptr, 0, 0, 20, 0, nullptr, 0 },
{ 133, nullptr, 3, 0, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room301::SERIES2[] = {
{ 0, nullptr, 0, 0, 17, 0, nullptr, 0 },
{ 1, "301_010", 3, 60, -1, (uint)-1, nullptr, 0 },
{ 12, "301Z002x", 1, 255, -1, 0, nullptr, 0 },
{ 17, "301_002", 2, 125, -1, 0, nullptr, 0 },
{ 31, "301Z002y", 1, 255, -1, 0, nullptr, 0 },
{ 105, "301Z002z", 1, 255, -1, 0, nullptr, 0 },
{ 136, "301W003", 1, 255, -1, 0, nullptr, 0 },
{ 161, "301Z003", 1, 255, -1, 0, nullptr, 0 },
{ 301, "301F003", 1, 255, -1, 0, nullptr, 0 },
{ 335, "301Z005x", 1, 255, -1, 0, nullptr, 0 },
{ 372, "301Z005y", 1, 255, -1, 0, nullptr, 0 },
{ 385, "301Z005z", 1, 255, -1, 0, nullptr, 0 },
{ 434, "301_017", 2, 150, -1, 0, nullptr, 0 },
{ 438, "301Z006", 1, 255, -1, 0, nullptr, 0 },
{ 456, "301Z011y", 1, 255, -1, 0, nullptr, 0 },
{ 488, "301Z011z", 1, 255, -1, 0, nullptr, 0 },
{ 526, "301_021", 2, 200, -1, 0, nullptr, 0 },
{ 542, "301Z007", 1, 150, -1, 0, nullptr, 0 },
{ 549, "301w999", 2, 150, -1, 0, nullptr, 0 },
{ 564, "301Z008", 1, 255, -1, 0, nullptr, 0 },
{ 591, "301W004", 1, 255, -1, 0, nullptr, 0 },
{ 620, "301Z009y", 1, 255, -1, 0, nullptr, 0 },
{ 631, "301Z009z", 1, 255, -1, 0, nullptr, 0 },
{ 688, "301Z010x", 1, 255, -1, 0, nullptr, 0 },
{ 700, "301Z010y", 1, 255, -1, 0, nullptr, 0 },
{ 747, "301Z010z", 1, 255, -1, 0, nullptr, 0 },
{ 792, "301_009", 2, 255, -1, 0, nullptr, 0 },
{ 795, "301_003", 1, 255, -1, 0, nullptr, 0 },
{ 803, "301_002", 2, 255, -1, 0, nullptr, 0 },
{ 812, "301_011", 2, 255, -1, 0, nullptr, 0 },
{ 821, "301_005", 1, 255, -1, 0, nullptr, 0 },
{ 826, "301_018", 2, 175, -1, 0, nullptr, 0 },
{ 835, nullptr, 1, 0, -1, 0, nullptr, 0 },
{ 836, nullptr, 0, 0, 15, 0, nullptr, 0 },
{ 837, nullptr, 0, 0, 20, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room301::SERIES3[] = {
{ 0, "301_004", 3, 100, -1, (uint)-1, nullptr, 0 },
{ 0, "301_010", 2, 30, -1, (uint)-1, nullptr, 0 },
{ 0, nullptr, 0, 0, 18, 0, nullptr, 0 },
{ 1, "301Z101", 1, 255, -1, 0, nullptr, 0 },
{ 30, "301W101", 1, 255, -1, 0, nullptr, 0 },
{ 49, "301Z102", 1, 255, -1, 0, nullptr, 0 },
{ 96, "301W102", 1, 255, -1, 0, nullptr, 0 },
{ 127, nullptr, 0, 0, 15, 0, nullptr, 0 },
{ 130, nullptr, 3, 0, -1, 0, nullptr, 0 },
{ 131, nullptr, 0, 0, 20, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room301::SERIES4[] = {
{ 0, "301_010", 2, 30, -1, (uint)-1, nullptr, 0 },
{ 0, nullptr, 0, 0, 18, 0, nullptr, 0 },
{ 1, "301_004", 3, 255, -1, (uint)-1, nullptr, 0 },
{ 37, nullptr, 0, 0, 15, 0, nullptr, 0 },
{ 38, nullptr, 0, 0, 20, 0, nullptr, 0 },
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room301::preload() {
_G(player).walker_in_this_scene = false;
}
void Room301::init() {
setupDigi();
_G(flags).reset3();
digi_preload_stream_breaks(SERIES1);
digi_preload_stream_breaks(SERIES2);
digi_preload_stream_breaks(SERIES3);
digi_preload_stream_breaks(SERIES4);
if (_G(executing) != WHOLE_GAME) {
inv_give_to_player("JUG");
inv_give_to_player("CARROT JUICE");
inv_give_to_player("WHISTLE");
}
_G(kernel).suppress_fadeup = true;
kernel_trigger_dispatch_now(1);
}
void Room301::daemon() {
switch (_G(kernel).trigger) {
case 1:
pal_fade_set_start(0);
series_stream_with_breaks(SERIES1, "301lab01", 6, 1, 2);
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
break;
case 2:
pal_fade_set_start(0);
pal_cycle_stop();
kernel_timing_trigger(6, 3);
break;
case 3:
compact_mem_and_report();
kernel_timing_trigger(6, 4);
break;
case 4:
pal_fade_set_start(0);
series_stream_with_breaks(SERIES3, "301orb01", 6, 1, 5);
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
break;
case 5:
pal_fade_set_start(0);
pal_cycle_stop();
kernel_timing_trigger(6, 6);
break;
case 6:
compact_mem_and_report();
kernel_timing_trigger(6, 7);
break;
case 7:
digi_unload_stream_breaks(SERIES1);
pal_fade_set_start(0);
series_stream_with_breaks(SERIES2, "301lab02", 6, 1, 9);
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
break;
case 8:
pal_fade_set_start(0);
pal_cycle_stop();
kernel_timing_trigger(6, 9);
break;
case 9:
compact_mem_and_report();
kernel_timing_trigger(6, 10);
break;
case 10:
pal_fade_set_start(0);
digi_unload_stream_breaks(SERIES3);
series_stream_with_breaks(SERIES4, "301orb02", 6, 1, 11);
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
break;
case 11:
pal_fade_set_start(0);
pal_cycle_stop();
kernel_timing_trigger(6, 12);
digi_unload_stream_breaks(SERIES2);
break;
case 12:
compact_mem_and_report();
kernel_timing_trigger(6, 3001);
break;
case 13:
gr_pal_set_range(120, 8);
pal_cycle_init(118, 127, 6, -1, -1);
break;
case 14:
break;
case 15:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, -1);
break;
case 16:
pal_fade_set_start(0);
digi_unload_stream_breaks(SERIES3);
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 13);
break;
case 17:
pal_fade_set_start(0);
pal_mirror_colours(120, 122);
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 14);
break;
case 18:
pal_fade_set_start(0);
pal_mirror_colours(32, 39);
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 19);
break;
case 19:
gr_pal_set_range(32, 16);
pal_cycle_init(32, 47, 6, -1);
break;
case 20:
pal_cycle_stop();
break;
case 3001:
_G(kernel).suppress_fadeup = false;
digi_unload_stream_breaks(SERIES1);
digi_unload_stream_breaks(SERIES1);
digi_unload_stream_breaks(SERIES3);
digi_unload_stream_breaks(SERIES4);
digi_preload("301_016");
digi_play("301_016", 1, 255);
adv_kill_digi_between_rooms(false);
_G(game).setRoom(302);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,51 @@
/* 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_SECTION3_ROOM301_H
#define M4_BURGER_ROOMS_SECTION3_ROOM301_H
#include "m4/burger/rooms/section3/section3_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room301 : public Section3Room {
private:
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
static const seriesStreamBreak SERIES3[];
static const seriesStreamBreak SERIES4[];
public:
Room301() : Section3Room() {}
~Room301() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,614 @@
/* 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/section3/room302.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room302::SAID[][4] = {
{ "DOOR", nullptr, "300w001", nullptr },
{ "STORM CELLAR", nullptr, "300w002", nullptr },
{ "BACK YARD", "302w002", "302w002", nullptr },
{ "BURGER MORSEL ", nullptr, nullptr, "302w010" },
{ "TRUFFLES", nullptr, "302w013", "302w014" },
{ "TROUGH", "302w015", "300w003", "302w016" },
{ "SIGN", "302w017", "300w004", "300w005" },
{ "CABIN", "302w018", "300w002", "300w002" },
{ "WINDOW", "302w021", "300w002", "302w022" },
{ "ROCKING CHAIR", "302w019", "302w020", "302w020" },
{ "CRASHED ROCKET", "302w023", "300w003", "302w024" },
{ "DOCK", "302w025", "300w002", "302w026" },
{ "FORCE FIELD", "302w027", "300w002", "300w002" },
{ "ROCK", "302w028", "300w002", "300w002" },
{ "TREES", "302w029", "300w002", "300w002" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesStreamBreak Room302::SERIES1[] = {
{ 0, "302p004", 1, 255, -1, 0, nullptr, 0 },
{ 19, "302_008", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room302::SERIES2[] = {
{ 7, "302_002", 1, 255, -1, 0, nullptr, 0 },
{ 9, "302w001a", 2, 255, -1, 0, &_state1, 0 },
{ 9, "302w001b", 2, 255, -1, 0, &_state1, 1 },
{ 9, "302w001c", 2, 255, -1, 0, &_state1, 2 },
{ 34, "302_005", 2, 125, -1, 0, nullptr, 0 },
{ 48, "302_006", 2, 125, -1, 1024, nullptr, 0 },
{ 138, "302_007", 1, 255, -1, 0, nullptr, 0 },
{ 138, "302_003", 1, 255, -1, 0, nullptr, 0 },
{ 152, "302_007", 1, 255, -1, 0, nullptr, 0 },
{ 152, "302_003", 1, 255, -1, 0, nullptr, 0 },
{ 165, nullptr, 2, 0, 4, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room302::SERIES3[] = {
{ 7, "302_002", 2, 255, -1, 0, nullptr, 0 },
{ 9, "302w001a", 1, 255, -1, 0, &_state1, 0 },
{ 9, "302w001b", 1, 255, -1, 0, &_state1, 1 },
{ 9, "302w001c", 1, 255, -1, 0, &_state1, 2 },
{ 24, "302p001", 2, 255, -1, 0, nullptr, 0 },
{ 35, "302_005", 2, 125, -1, 0, nullptr, 0 },
{ 48, "302_006", 2, 125, -1, 1024, nullptr, 0 },
{ 52, "302p003", 1, 255, -1, 0, nullptr, 0 },
{ 71, "302_008", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesPlayBreak Room302::PLAY1[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY2[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY3[] = {
{ 0, -1, "304_001", 2, 255, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY4[] = {
{ 0, 1, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
{ 2, -1, "302w002", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY5[] = {
{ 0, 22, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
{ 23, -1, "302_001", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY6[] = {
{ 0, 7, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 8, -1, nullptr, 1, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY7[] = {
{ 0, 29, "302t004", 2, 155, -1, 2048, 0, nullptr, 0 },
{ 26, 29, "302t005", 2, 155, -1, 0, 12, &Flags::_flags[V110], 0 },
{ 26, 29, "302t005", 2, 155, -1, 0, 3, &Flags::_flags[V110], 1 },
{ 30, 61, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY8[] = {
{ 62, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY9[] = {
{ 0, 28, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
{ 29, -1, nullptr, 1, 0, 6, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY10[] = {
{ 0, 4, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY11[] = {
{ 5, 13, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY12[] = {
{ 6, 16, "302t002", 2, 155, -1, 0, 0, nullptr, 0 },
{ 11, 17, nullptr, 2, 0, -1, 3, 2, nullptr, 0 },
{ 12, 6, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room302::PLAY13[] = {
{ 0, 4, "302t003", 2, 155, -1, 0, 0, nullptr, 0 },
{ 5, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 4, 5, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 4, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 3, 5, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 5, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 3, 4, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 5, 0, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
int32 Room302::_state1;
Room302::Room302() : Section3Room() {
_state1 = 0;
}
void Room302::init() {
setupDigi();
if (!_G(flags)[kTrufflesInMine]) {
static const char *NAMES[12] = {
"302t001a", "302t001b", "302t001c", "302t001d", "302t001e",
"302t001f", "302t001g", "302t001h", "302t002", "302t003",
"302t004", "302t005"
};
for (int i = 0; i < 12; ++i)
digi_preload(NAMES[i], 302);
}
player_set_commands_allowed(false);
pal_cycle_init(112, 127, 6, -1, -1);
if (_G(flags)[kTrufflesInMine]) {
hotspot_set_active("TRUFFLES", false);
} else if (_G(flags)[kPerkinsLostIsland]) {
series_load("302tr01");
series_load("302tr01s");
series_load("302tr02");
series_load("302tr02s");
series_load("302tr03");
series_load("302tr03s");
_val1 = 24;
kernel_trigger_dispatch_now(9);
} else {
_val1 = 21;
kernel_trigger_dispatch_now(9);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 303:
_G(wilbur_should) = _G(flags)[V125] ? 6 : 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 304:
_G(wilbur_should) = 4;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 305:
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
default:
ws_demand_location(341, 287, 9);
ws_hide_walker();
_state1 = imath_ranged_rand(0, 2);
if (_G(flags)[kPerkinsLostIsland]) {
_G(flags)[V113] = 1;
_volume = 125;
_val4 = 29;
} else {
_val4 = 30;
}
kernel_trigger_dispatch_now(10);
_G(flags)[V107] = 1;
break;
}
if (_G(flags)[V107]) {
hotspot_set_active("BURGER MORSEL ", false);
} else {
_series1 = series_show("302BURG", 0x200);
hotspot_set_active("BURGER MORSEL ", true);
}
}
void Room302::daemon() {
switch (_G(kernel).trigger) {
case 1:
wilbur_speech("302w009z");
break;
case 2:
ws_unhide_walker();
ws_walk(500, 250, nullptr, 3, 8, true);
break;
case 3:
player_set_commands_allowed(true);
break;
case 4:
_volume -= 20;
if (_volume > 0) {
term_message("fading propellor, current volume = %d", _volume);
digi_change_volume(2, _volume);
kernel_timing_trigger(10, 4);
} else {
digi_stop(2);
}
break;
case 5:
terminateMachineAndNull(_series1);
inv_give_to_player("BURGER MORSEL");
hotspot_set_active("BURGER MORSEL ", false);
_G(flags)[V107] = 1;
break;
case 6:
inv_put_thing_in("BURGER MORSEL", NOWHERE);
break;
case 7:
if (!digi_play_state(2)) {
_val7 = imath_ranged_rand(0, 6);
digi_play(Common::String::format("302t001%c", 'a' + _val7).c_str(), 2, 55, -1, 302);
}
break;
case 8:
if (_val2 == 19) {
digi_unload_stream_breaks(SERIES3);
_series2.terminate();
pal_fade_set_start(0);
_series3 = series_stream_with_breaks(SERIES1, "302pe02", 6, 1, 3007);
pal_fade_init(0, 255, 100, 15, -1);
}
break;
case 9:
switch (_val1) {
case 20:
series_show("302tr02", 0x900, 0, 9, 30, 13);
series_show("302tr02s", 0x901, 0, -1, 30, 13);
_val1 = 22;
break;
case 21:
_series2.show("302tr02", 0x900);
_val1 = 22;
break;
case 22:
_val6 = imath_ranged_rand(0, 1);
_val1 = _val6 ? 24 : 23;
kernel_trigger_dispatch_now(9);
break;
case 23:
kernel_trigger_dispatch_now(7);
_val1 = 20;
series_play_with_breaks(PLAY10, "302tr02", 0x900, 9, 3);
break;
case 24:
kernel_trigger_dispatch_now(7);
_val1 = 20;
series_play_with_breaks(PLAY11, "302tr02", 0x900, 9, 3);
break;
case 25:
_val1 = 20;
series_play_with_breaks(PLAY12, "302tr03", 0x900, 9, 3);
break;
case 26:
_val1 = 20;
series_play_with_breaks(PLAY13, "302tr03", 0x900, 9, 3);
break;
case 27:
ws_hide_walker();
_G(wilbur_should) = 11;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
_val1 = 28;
series_play_with_breaks(PLAY7, "302tr01", 0x700, 9, 3);
break;
case 28:
hotspot_set_active("truffles", false);
_G(flags)[kTrufflesInMine] = 1;
_G(wilbur_should) = 8;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
series_play_with_breaks(PLAY8, "302tr01", 0x900, -1, 3);
break;
default:
break;
}
break;
case 10:
switch (_val4) {
case 29:
digi_preload_stream_breaks(SERIES2);
_G(wilbur_should) = 9;
series_stream_with_breaks(SERIES2, "302pr01", 6, 1, kCHANGE_WILBUR_ANIMATION);
break;
case 30:
digi_preload_stream_breaks(SERIES3);
_val2 = 19;
series_stream_with_breaks(SERIES3, "302pr02", 6, 1, 8);
break;
default:
break;
}
break;
case 10008:
_val1 = 26;
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
ws_hide_walker();
player_set_commands_allowed(false);
series_play_with_breaks(PLAY1, "302wi03", 0x500, 3004, 3);
pal_fade_init(_G(kernel).first_fade, 255, 0, 120, 3004);
break;
case 2:
ws_demand_location(427, 228, 4);
ws_hide_walker();
player_set_commands_allowed(false);
series_play_with_breaks(PLAY2, "302wi04", 0x500, 2, 3);
break;
case 3:
ws_hide_walker();
player_set_commands_allowed(false);
series_play_with_breaks(PLAY3, "302wi01", 0x500, 3003, 3);
pal_fade_init(_G(kernel).first_fade, 255, 0, 120, 3003);
break;
case 4:
player_first_walk(233, 222, 7, 180, 270, 7, true);
ws_unhide_walker();
player_set_commands_allowed(true);
break;
case 5:
ws_unhide_walker();
player_set_commands_allowed(true);
_G(wilbur_should) = 10002;
player_first_walk(483, 210, 5, 490, 245, 7, true);
break;
case 6:
ws_unhide_walker();
player_set_commands_allowed(true);
_G(wilbur_should) = 10002;
player_first_walk(184, 189, 8, 78, 225, 8, true);
break;
case 7:
_val1 = 27;
break;
case 8:
ws_unhide_walker();
_G(wilbur_should) = _G(flags)[V110] ? 10001 : 18;
ws_turn_to_face(3, kCHANGE_WILBUR_ANIMATION);
break;
case 9:
digi_unload_stream_breaks(SERIES2);
_G(wilbur_should) = 12;
hotspot_set_active("BURGER MORSEL ", true);
series_play_with_breaks(PLAY4, "302wi10", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 10:
ws_hide_walker();
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY6, "302wi06", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 11:
_G(wilbur_should) = 17;
series_play_with_breaks(PLAY9, "302wi07", 0x200, kCHANGE_WILBUR_ANIMATION, 3, 4);
break;
case 12:
_series1 = series_show("302BURG", 0x200);
_G(flags)[V107] = 0;
_G(wilbur_should) = 15;
series_play_with_breaks(PLAY5, "302wi09", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 13:
_G(wilbur_should) = 14;
kernel_timing_trigger(30, kCHANGE_WILBUR_ANIMATION);
break;
case 14:
player_set_commands_allowed(true);
wilbur_speech("302w009z");
break;
case 15:
ws_unhide_walker();
_G(wilbur_should) = 10001;
if (_G(flags)[V108]) {
_val5 = imath_ranged_rand(0, 9);
wilbur_speech(Common::String::format("302w004%c", 'a' + _val5).c_str(), kCHANGE_WILBUR_ANIMATION);
} else {
wilbur_speech("302w003", kCHANGE_WILBUR_ANIMATION);
}
break;
case 16:
_G(wilbur_should) = 7;
player_set_commands_allowed(false);
wilbur_speech(_G(flags)[V110] ? "300w010" : "300w007", kCHANGE_WILBUR_ANIMATION);
break;
case 17:
ws_unhide_walker();
if (!_G(flags)[V110])
wilbur_speech("300w008");
break;
case 18:
_G(flags)[V110] = 1;
_G(wilbur_should) = 10001;
wilbur_speech("300w009");
break;
case 10013:
ws_unhide_walker();
player_set_commands_allowed(true);
_G(wilbur_should) = 10002;
if (_G(flags)[kTrufflesInMine]) {
_G(flags)[V002] = 1;
wilbur_speech("300w059");
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room302::pre_parser() {
if (player_said_any("BACKYARD", "BACKYARD ") && !player_said_any("LOOK AT", "GEAR", "ENTER"))
player_set_facing_hotspot();
}
void Room302::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("LOOK AT", "BURGER MORSEL ")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 13;
wilbur_speech("302w009y", kCHANGE_WILBUR_ANIMATION);
} else if (player_said("LOOK AT", "DOOR")) {
wilbur_speech(player_been_here(304) ? "302w006" : "302w005");
} else if (player_said("DISTILLED CARROT JUICE", "CRASHED ROCKET")) {
wilbur_speech("300w032");
} else if (player_said("CARROT JUICE", "CRASHED ROCKET")) {
wilbur_speech("300w045");
} else if (player_said("MATCHES", "CRASHED ROCKET")) {
wilbur_speech("300w018");
} else if (player_said("TAKE", "BURGER MORSEL ")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 10;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("ENTER", "DOOR") || player_said("GEAR", "DOOR")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("MATCHES", "PROBE")) {
wilbur_speech("300w023");
} else if (player_said("BOTTLE", "TROUGH")) {
wilbur_speech("300w073");
} else if (player_said("LOOK AT", "STORM CELLAR")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 1;
wilbur_speech("302w007", kCHANGE_WILBUR_ANIMATION);
} else if (player_said_any("GEAR", "ENTER") && player_said("STORM CELLAR")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 1;
if (_G(flags)[V133]) {
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
term_message("Wilbur: Here we go...!");
wilbur_speech("302w008", kCHANGE_WILBUR_ANIMATION);
}
} else if (player_said("CARROT JUICE", "TROUGH")) {
wilbur_speech("300w044");
} else if (player_said("BACKYARD") && player_said_any("LOOK AT", "GEAR", "ENTER")) {
player_set_commands_allowed(false);
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3002);
_G(flags)[V125] = 0;
} else if (player_said("BACKYARD ") && player_said_any("LOOK AT", "GEAR", "ENTER")) {
player_set_commands_allowed(false);
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3002);
_G(flags)[V125] = 1;
} else if (player_said("TRUFFLES")) {
if (player_said("BURGER MORSEL")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 16;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("LOOK AT")) {
wilbur_speech(_G(flags)[V109] ? "302w012" : "302w011");
} else if (player_said("MATCHES")) {
wilbur_speech("300w016");
} else if (player_said("DISTILLED CARROT JUICE")) {
wilbur_speech("300w031");
} else if (player_said("CARROT JUICE")) {
wilbur_speech("300w044");
} else if (player_said("BOTTLE")) {
wilbur_speech("300w072");
} else {
_val1 = 25;
return;
}
} else {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,81 @@
/* 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_SECTION3_ROOM302_H
#define M4_BURGER_ROOMS_SECTION3_ROOM302_H
#include "m4/burger/rooms/section3/section3_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room302 : public Section3Room {
private:
static const char *SAID[][4];
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
static const seriesStreamBreak SERIES3[];
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 int32 _state1;
machine *_series1 = nullptr;
Series _series2;
machine *_series3 = nullptr;
int _val1 = 0;
int _val2 = 0;
int _volume = 0;
int _val4 = 0;
int _val5 = 0;
int _val6 = 0;
int _val7 = 0;
protected:
const char *getDigi() override {
return "300_005";
}
public:
Room302();
~Room302() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,769 @@
/* 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/section3/room303.h"
#include "m4/burger/vars.h"
#include "m4/platform/timer.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room303::SAID[][4] = {
{ "JUG ", "303w022", nullptr, "303w022z" },
{ "JUG ", "303w022", nullptr, "303w022z" },
{ "FUEL TANK", "303w003", "303w004", nullptr },
{ "BURNER", nullptr, "303w010", nullptr },
{ "BOILER", "303w014", "303w015", nullptr },
{ "STOOL", "303w019", "300w004", "303w020" },
{ "DISTILLED CARROT JUICE ", "303w021", nullptr, nullptr },
{ "DISTILLED CARROT JUICE ", "303w021", nullptr, nullptr },
{ "CONDENSER", "303w023", "303w024", "303w025" },
{ "KEG", nullptr, "303w024", "303w025" },
{ "CABIN", "303w028", "300w002", "300w002" },
{ "WINDOW", "303w029", "300w002", "303w030" },
{ "WOOD", "303w031", "303w032", "303w033" },
{ "ROCK", "303w034", "300w002", "300w002" },
{ "TREES", "303w035", "300w002", "300w002" },
{ "FORCE FIELD", "303w036", "300w002", "300w002" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesStreamBreak Room303::SERIES1[] = {
{ 0, "303_001", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesPlayBreak Room303::PLAY1[] = {
{ 0, 7, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 8, -1, nullptr, 1, 0, 9, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY2[] = {
{ 0, 5, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 6, 7, "300w048", 1, 255, -1, 0, 0, nullptr, 0 },
{ 10, -1, "303_002", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY3[] = {
{ 9, 14, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
{ 0, 8, nullptr, 1, 0, 9, 2050, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY4[] = {
{ 0, -1, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY5[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY6[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY7[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY8[] = {
{ 0, 31, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 32, -1, "303_003", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY9[] = {
{ 0, 28, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 29, 36, "300_003", 2, 255, -1, 0, 0, nullptr, 0 },
{ 37, -1, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room303::PLAY10[] = {
{ 0, 6, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 7, 6, "303_007", 1, 100, -1, 0, 0, nullptr, 0 },
{ 6, 6, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
{ 6, 7, nullptr, 0, 0, -1, 1, 1, nullptr, 0 },
{ 8, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
Room303::Room303() : Section3Room() {
Common::fill(_triggers, _triggers + 5, -1);
}
const char *Room303::getDigi() {
if (_G(flags)[V118] == 3002) {
_digiVolume = 125;
return "303_005";
} else if (_G(flags)[V117]) {
return "303_006";
} else {
return "300_005";
}
}
void Room303::init() {
setupDigi();
pal_cycle_init(112, 127, 0, -1, -1);
_val1 = _val2 = 0;
_series1 = nullptr;
series_load("303ft");
series_load("303burnr");
series_load("303stil");
series_load("303stilb");
Common::fill(_triggers, _triggers + 5, -1);
if (_G(flags)[V117]) {
_series2 = series_load("303ft_on");
_series3 = series_play("303ft_on", 0xd00, 0, -1, 0, -1);
_val3 = 2;
} else {
_series2 = series_load("303ft");
_series3 = series_show("303ft", 0xd00);
_val3 = 4;
}
if (_G(flags)[V118] == 3002) {
_series4 = series_load("303burn");
_series5 = series_play("303burn", 0xd14, 0, -1, 0, -1);
_val4 = 7;
} else {
_series4 = series_load("303burnr");
_series5 = series_show("303burnr", 0xd14);
_val4 = 9;
}
_series6 = series_load("303stil");
_series7 = series_show("303stil", 0xd10);
series_show("303stilb", 0xd15);
_val5 = 0;
kernel_trigger_dispatch_now(11);
switch (_G(flags)[V121]) {
case 3001:
_val6 = _G(flags)[V122] ? 32 : 30;
kernel_trigger_dispatch_now(10);
break;
case 3002:
_val6 = _G(flags)[V122] ? 33 : 31;
kernel_trigger_dispatch_now(10);
break;
default:
break;
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
if (_G(flags)[V117])
_timer = timer_read_60();
break;
case 302:
if (_G(flags)[V125]) {
ws_demand_location(51, 276, 3);
kernel_trigger_dispatch_now(3);
} else {
ws_demand_location(245, 373, 1);
kernel_trigger_dispatch_now(2);
}
break;
default:
player_set_commands_allowed(true);
if (_G(flags)[V117])
_timer = timer_read_60();
ws_demand_location(290, 325, 1);
break;
}
}
void Room303::daemon() {
doDaemon(_G(kernel).trigger);
}
void Room303::doDaemon(int trigger) {
switch (trigger) {
case 1:
for (_ctr = 0; _ctr < 5; ++_ctr) {
if (_triggers[_ctr] != -1) {
kernel_trigger_dispatch_now(_triggers[_ctr]);
_triggers[_ctr] = -1;
}
}
break;
case 2:
if (_G(flags)[V115] > 1) {
player_set_commands_allowed(true);
ws_walk(290, 325, nullptr, 4, 1);
} else {
_G(wilbur_should) = 18;
player_set_commands_allowed(false);
ws_walk(290, 325, nullptr, kCHANGE_WILBUR_ANIMATION, 1);
}
break;
case 3:
if (_G(flags)[V115] > 1) {
player_set_commands_allowed(true);
ws_walk(261, 276, nullptr, 4, 3);
} else {
_G(wilbur_should) = 18;
player_set_commands_allowed(false);
ws_walk(261, 276, nullptr, kCHANGE_WILBUR_ANIMATION, 3);
}
break;
case 4:
player_set_commands_allowed(true);
break;
case 5:
setupDigi();
break;
case 6:
switch (_val7) {
case 25:
if (_G(flags)[V119] && _G(flags)[V118] == 3002) {
terminateMachineAndNull(_series7);
series_unload(_series6);
_G(flags)[V120] = 1;
_val7 = 26;
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "303dist", 6, 0xc10, 6);
player_set_commands_allowed(false);
intr_cancel_sentence();
ws_walk(330, 350, nullptr, -1, 2);
}
break;
case 26:
digi_unload_stream_breaks(SERIES1);
player_set_commands_allowed(true);
_G(flags)[V119] = 0;
_series6 = series_load("303stil");
_series7 = series_show("303stil", 0xd10);
if (_G(flags)[V121] == 3002) {
_val8 = 27;
_G(flags)[V122] = 1;
terminateMachineAndNull(_series8);
_val6 = 33;
kernel_trigger_dispatch_now(10);
} else {
_val8 = 28;
}
kernel_trigger_dispatch_now(9);
break;
default:
break;
}
break;
case 7:
switch (_val3) {
case 1:
freeSeries1();
series_play_with_breaks(PLAY6, "303wi07", 0xd00, 7, 3);
_val3 = 2;
_G(flags)[V117] = 1;
setupDigi();
ws_hide_walker();
_G(wilbur_should) = 19;
_timer = timer_read_60();
break;
case 2:
_series2 = series_load("303ft_on");
_series3 = series_play("303ft_on", 0xd00, 0, -1, 0, -1);
if (_G(wilbur_should) == 19)
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 3:
freeSeries1();
series_play_with_breaks(PLAY7, "303wi08", 0xd00, 7, 3);
_val3 = 4;
ws_hide_walker();
_G(wilbur_should) = 20;
break;
case 4:
_series2 = series_load("303ft");
_series3 = series_show("303ft", 0xd00);
_G(flags)[V117] = 0;
setupDigi();
if (_G(flags)[V118] == 3002) {
_val4 = 8;
doDaemon(8);
}
if (_G(wilbur_should) == 20)
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
default:
break;
}
break;
case 8:
switch (_val4) {
case 5:
freeSeries2();
player_update_info();
if (timer_read_60() - _timer > 900) {
_G(flags)[V118] = 3003;
series_play_with_breaks(PLAY8, "303wi10", 0xd01, 3007, 1);
} else {
_G(flags)[V118] = 3002;
series_play_with_breaks(PLAY9, "303wi02", 0xd01, 8, 3);
}
_val4 = 7;
ws_hide_walker();
_G(wilbur_should) = 10001;
break;
case 6:
freeSeries2();
series_play_with_breaks(PLAY9, "303wi09", 0xd01, 8, 3);
_val4 = 9;
ws_hide_walker();
_G(wilbur_should) = 10001;
break;
case 7:
setupDigi();
_series4 = series_load("303burn");
_series5 = series_play("303burn", 0xd14, 0, -1, 0, -1);
if (_G(wilbur_should) == 10001) {
ws_unhide_walker();
_G(wilbur_should) = 10002;
player_set_commands_allowed(true);
}
_val7 = 25;
kernel_timing_trigger(180, 6);
break;
case 8:
freeSeries2();
_series4 = series_load("303burnr");
_series5 = series_show("303burnr", 0xd14);
_G(flags)[V118] = 3001;
setupDigi();
break;
case 9:
_series4 = series_load("303burnr");
_series5 = series_show("303burnr", 0xd14);
_G(flags)[V118] = 3001;
if (_G(wilbur_should) == 10001) {
ws_unhide_walker();
_G(wilbur_should) = 10002;
player_set_commands_allowed(true);
}
break;
default:
break;
}
break;
case 9:
switch (_val8) {
case 27:
if (_val5 < 15) {
++_val5;
_val8 = 27;
terminateMachineAndNull(_series9);
_series9 = series_play("303cj01", 0xd15, 0, 9, 8);
}
break;
case 28:
if (_val5 < 15) {
++_val5;
_val8 = 28;
terminateMachineAndNull(_series9);
_series9 = series_play("303cj02", 0xd15, 0, 9, 6);
}
break;
default:
break;
}
break;
case 10:
switch (_val6) {
case 30:
inv_move_object("JUG", 303);
inv_move_object("DISTILLED CARROT JUICE", 303);
_G(flags)[V121] = 3001;
_series8 = series_show("303juga", 0xbff);
hotspot_set_active("JUG ", true);
break;
case 31:
inv_move_object("JUG", 303);
inv_move_object("DISTILLED CARROT JUICE", 303);
_G(flags)[V121] = 3002;
_series8 = series_show("303JUG", 0xd14);
hotspot_set_active("JUG ", true);
break;
case 32:
inv_move_object("JUG", 303);
inv_move_object("DISTILLED CARROT JUICE", 303);
_G(flags)[V122] = 1;
_G(flags)[V121] = 3001;
_series8 = series_show("303juga", 0xbff);
hotspot_set_active("DISTILLED CARROT JUICE ", true);
break;
case 33:
inv_move_object("JUG", 303);
inv_move_object("DISTILLED CARROT JUICE", 303);
_G(flags)[V122] = 1;
_G(flags)[V121] = 3002;
_series8 = series_show("303JUG", 0xd14);
hotspot_set_active("DISTILLED CARROT JUICE ", true);
hotspot_set_active("JUG ", true);
break;
case 34:
_G(flags)[V121] = 3003;
inv_give_to_player(_G(flags)[V122] ? "DISTILLED CARROT JUICE" : "JUG");
break;
default:
break;
}
break;
case 11:
terminateMachineAndNull(_series8);
hotspot_set_active("DISTILLED CARROT JUICE ", false);
hotspot_set_active("DISTILLED CARROT JUICE ", false);
hotspot_set_active("JUG ", false);
hotspot_set_active("JUG ", false);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 11:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
if (_val5 > 0 && _val5 < 15) {
_val8 = 27;
_G(flags)[V122] = 1;
} else {
_val8 = 29;
}
_val6 = _G(flags)[V122] ? 33 : 31;
_triggers[1] = 10;
series_play_with_breaks(PLAY1, "303wi4b", 0x100, 1, 3);
break;
case 12:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
kernel_trigger_dispatch_now(11);
_val6 = 34;
_triggers[1] = 10;
_val8 = (_val5 > 0 && _val5 < 15) ? 28 : 29;
series_play_with_breaks(PLAY3, "303wi4b", 0x100, 1, 3);
break;
case 13:
ws_hide_walker();
player_set_commands_allowed(false);
kernel_trigger_dispatch_now(11);
_G(wilbur_should) = 10001;
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
_triggers[1] = 10;
_val6 = 34;
series_play_with_breaks(PLAY4, "303wi4a", 0x100, 1, 3);
break;
case 14:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
_val6 = _G(flags)[V122] ? 32 : 30;
_triggers[1] = 10;
series_play_with_breaks(PLAY5, "303wi4a", 0x100, 1, 3);
break;
case 15:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 23;
series_play_with_breaks(PLAY10, "303wi15", 0x100, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 16:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 17;
series_play_with_breaks(PLAY2, "303wi03", 0x100, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 17:
_G(flags)[V119] = 1;
_G(flags)[V126] = 1;
inv_put_thing_in("CARROT JUICE", NOWHERE);
inv_give_to_player("BOTTLE");
_val7 = 25;
kernel_trigger_dispatch_now(6);
enable_player();
break;
case 18:
_G(wilbur_should) = 10001;
wilbur_speech(_G(flags)[V115] ? "303w002" : "303w001");
_G(flags)[V115]++;
break;
case 19:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
if (_G(flags)[V116]) {
wilbur_speech("303w006");
} else {
wilbur_speech("303w005");
_G(flags)[V116] = 1;
}
break;
case 20:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
wilbur_speech("303w007");
break;
case 21:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
wilbur_speech(_G(flags)[V118] == 3001 ? "303w008" : "303w009");
break;
case 22:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
wilbur_speech(_G(flags)[V118] == 3001 ? "303w011" : "303w012");
break;
case 23:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
wilbur_speech("303w016");
break;
case 24:
player_set_commands_allowed(true);
ws_unhide_walker();
_G(wilbur_should) = 10002;
wilbur_speech("303w017");
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room303::pre_parser() {
if (player_said("GEAR", "BOILER") && !_G(flags)[V119]) {
_G(wilbur_should) = 15;
player_hotspot_walk_override(409, 312, 3, kCHANGE_WILBUR_ANIMATION);
_G(player).command_ready = false;
} else {
if (player_said("FRONT YARD") && !player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER"))
player_set_facing_hotspot();
if (player_said("FRONT YARD ") && !player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER"))
player_set_facing_hotspot();
}
}
void Room303::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("FRONT YARD") && player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER")) {
frontYard();
player_set_commands_allowed(false);
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3001);
_G(flags)[V125] = 0;
} else if (player_said("FRONT YARD ") && player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER")) {
frontYard();
player_set_commands_allowed(false);
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3001);
_G(flags)[V125] = 1;
} else if (player_said("DISTILLED CARROT JUICE", "BURNER")) {
wilbur_speech("300w033");
} else if (player_said("DISTILLED CARROT JUICE", "BOILER")) {
wilbur_speech("300w034");
} else if (player_said("JUG", "BOILER")) {
wilbur_speech("300w027");
} else if (player_said("JUG", "STOOL") || player_said("DISTILLED CARROT JUICE", "STOOL")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 11;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("JUG", "JUG ", "JUG ") && player_said("CARROT JUICE")) {
wilbur_speech("300w046");
} else if (player_said("JUG", "STUMP") || player_said("DISTILLED CARROT JUICE", "STUMP")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 14;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("BOTTLE", "BOILER")) {
wilbur_speech("300w074");
} else if (player_said("BOTTLE", "STOOL")) {
wilbur_speech("300w075");
} else if (player_said("CARROT JUICE", "BURNER")) {
wilbur_speech("300w047");
} else if (player_said("CARROT JUICE", "STOOL")) {
wilbur_speech("300w049");
} else if (player_said("MATCHES", "STUMP") || player_said("MATCHES", "WOOD")) {
wilbur_speech("300w019");
} else if (player_said("GEAR", "FUEL TANK")) {
player_set_commands_allowed(false);
_val3 = _G(flags)[V117] ? 3 : 1;
kernel_trigger_dispatch_now(7);
} else if (player_said("LOOK AT", "BURNER")) {
_G(wilbur_should) = 21;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("GEAR", "BURNER")) {
_G(wilbur_should) = 22;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("MATCHES", "BURNER")) {
if (_G(flags)[V118] == 3001) {
player_set_commands_allowed(false);
_val4 = _G(flags)[V117] ? 5 : 6;
kernel_trigger_dispatch_now(8);
}
} else if (player_said("GEAR", "BOILER")) {
if (_G(flags)[V119])
_G(wilbur_should) = 24;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("BOILER", "CARROT JUICE")) {
_G(wilbur_should) = 16;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("TAKE", "JUG ") || player_said("TAKE", "DISTILLED CARROT JUICE ")) {
_G(wilbur_should) = 12;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("TAKE", "JUG ") || player_said("TAKE", "DISTILLED CARROT JUICE ")) {
_G(wilbur_should) = 13;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("LOOK AT", "KEG")) {
wilbur_speech(_G(flags)[V120] ? "303w027" : "303w026");
} else if (player_said("BURNER")) {
wilbur_speech("303w013");
} else if (player_said("BOILER")) {
wilbur_speech("303w018");
} else {
return;
}
_G(player).command_ready = false;
}
void Room303::frontYard() {
term_message("------- %ld %ld %ld", _G(flags)[V119], _G(flags)[V118], _G(flags)[V121]);
if (_G(flags)[V119] && _G(flags)[V118] == 3002 && _G(flags)[V121] == 3002) {
term_message("jug filled with distilled juice!!");
_G(flags)[V122] = 1;
_G(flags)[V120] = 1;
_G(flags)[V119] = 0;
}
}
void Room303::freeSeries1() {
if (_series3)
terminateMachineAndNull(_series3);
if (_series2)
series_unload(_series2);
}
void Room303::freeSeries2() {
if (_series5)
terminateMachineAndNull(_series5);
if (_series4)
series_unload(_series4);
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,88 @@
/* 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_SECTION3_ROOM303_H
#define M4_BURGER_ROOMS_SECTION3_ROOM303_H
#include "m4/burger/rooms/section3/section3_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room303 : public Section3Room {
private:
static const char *SAID[][4];
static const seriesStreamBreak SERIES1[];
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[];
machine *_series1 = nullptr;
int _series2 = -1;
machine *_series3 = nullptr;
int _series4 = -1;
machine *_series5 = nullptr;
int _series6 = -1;
machine *_series7 = nullptr;
machine *_series8 = nullptr;
machine *_series9 = nullptr;
int _triggers[5];
int _ctr = 0;
int _timer = 0;
int _val1 = 0;
int _val2 = 0;
int _val3 = 0;
int _val4 = 0;
int _val5 = 0;
int _val6 = 0;
int _val7 = 0;
int _val8 = 0;
void frontYard();
void doDaemon(int trigger);
void freeSeries1();
void freeSeries2();
protected:
const char *getDigi() override;
public:
Room303();
~Room303() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,259 @@
/* 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/section3/room304.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room304::SAID[][4] = {
{ "DOOR", "304w002", "300w002", nullptr },
{ "BED", "304w007", "300w003", "304w008" },
{ "PICTURE", "304w009", "304w010", "300w005" },
{ "MATCHES ", "304w003", nullptr, "304w004" },
{ "MAP", nullptr, "304w013", "304w014" },
{ "CRATE", "304w015", "300w004", "300w004" },
{ "STOVE", "304w016", "304w017", "304w018" },
{ "KETTLE", "304w019", "304w018", "304w018" },
{ "MUG", "304w019", nullptr, nullptr },
{ "RECIPE BOOK", nullptr, "304w021", "304w022" },
{ "WASHTUB", "304w023", "304w024", "304w024" },
{ "POT", "304w025", "304w018", "304w018" },
{ "FRYING PAN", "304w026", "304w027", "304w018" },
{ "WINDOW", "304w028", "300w002", "304w029" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room304::PLAY1[] = {
{ 0, 3, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 4, 16, "304_001", 2, 255, -1, 2048, 0, nullptr, 0 },
{ 17, -1, "304_002", 2, 255, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room304::PLAY2[] = {
{ 0, 3, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
{ 0, 0, "304w020", 1, 255, -1, 0, 10, nullptr, 0 },
{ 0, 6, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 7, 7, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
{ 8, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 13, -1, "304_004", 2, 255, -1, 0, 0, nullptr, 0 },
{ 7, 7, nullptr, 0, 0, -1, 0, 3, nullptr, 0 },
{ 8, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 13, -1, "304_004", 2, 255, -1, 0, 0, nullptr, 0 },
{ 7, 7, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
{ 7, 3, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room304::PLAY3[] = {
{ 0, 3, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
{ 4, 5, nullptr, 0, 0, 6, 0, 0, nullptr, 0 },
{ 6, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room304::PLAY4[] = {
{ 0, 24, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 25, 36, "300_003", 2, 255, -1, 2048, 0, nullptr, 0 },
{ 37, -1, nullptr, 0, 0, 3, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room304::PLAY5[] = {
{ 17, 17, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
{ 17, 21, "304_002", 2, 255, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const char *Room304::getDigi() {
return _G(flags)[V130] ? "304_003" : "300_005";
}
void Room304::init() {
setupDigi();
set_palette_brightness(70);
if (inv_player_has("MATCHES")) {
hotspot_set_active("MATCHES ", false);
} else {
_matches = series_show("304match", 0xa00);
hotspot_set_active("MATCHES ", true);
}
if (_G(flags)[V130]) {
_fire = series_play("304firel", 0xa00, 4, -1, 6, -1);
} else {
_fire = series_show("304firel", 0xa00);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 302:
ws_demand_location(150, 306, 3);
kernel_trigger_dispatch_now(4);
break;
default:
player_set_commands_allowed(true);
ws_demand_location(300, 306, 4);
break;
}
}
void Room304::daemon() {
switch (_G(kernel).trigger) {
case 1:
term_message("Walking into scene....!");
if (_G(flags)[V129]) {
ws_walk(300, 306, nullptr, 2, 4);
} else {
_G(flags)[V129] = 1;
player_set_commands_allowed(false);
_G(wilbur_should) = 5;
ws_walk(300, 306, nullptr, kCHANGE_WILBUR_ANIMATION, 4);
}
break;
case 2:
player_set_commands_allowed(true);
break;
case 3:
setupDigi();
break;
case 4:
player_set_commands_allowed(false);
series_play_with_breaks(PLAY5, "304wi01", 0x600, -1, 2, 6);
kernel_trigger_dispatch_now(1);
break;
case 5:
_fire = series_play("304fire1", 0xa00, 0, -1, 6, -1);
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 6:
inv_give_to_player("MATCHES");
hotspot_set_active("MATCHES ", false);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10002;
series_play_with_breaks(PLAY1, "304wi01", 0x600, 3001, 3, 8);
break;
case 2:
player_set_commands_allowed(false);
ws_hide_walker();
terminateMachineAndNull(_fire);
series_play_with_breaks(PLAY4, "304wi05", 0xa00, 5, 3);
break;
case 3:
player_set_commands_allowed(false);
ws_hide_walker();
terminateMachineAndNull(_matches);
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY3, "304wb01", 0xa00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 4:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY2, "304wi03", 0x101, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 5:
_G(wilbur_should) = 10001;
_G(flags)[V129] = 1;
wilbur_speech("304w001");
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room304::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
}
void Room304::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("OPEN", "DOOR") || player_said("GEAR", "DOOR")) {
_G(wilbur_should) = 1;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("LOOK AT", "MAP")) {
wilbur_speech(_G(flags)[V135] ? "304w012" : "304w011");
} else if (player_said("DISTILLED CARROT JUICE") &&
player_said_any("STOVE", "KETTLE", "FRYING PAN", "POT")) {
wilbur_speech("300w035");
} else if (player_said("CARROT JUICE") &&
player_said_any("STOVE", "KETTLE", "FRYING PAN", "POT")) {
wilbur_speech("300w051");
} else if (player_said("CARROT JUICE", "WASHTUB")) {
wilbur_speech("300w052");
} else if (player_said("DISTILLED CARROT JUICE", "WASHTUB")) {
wilbur_speech("300w035z");
} else if (player_said("MATCHES", "STOVE") && !_G(flags)[V130]) {
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("TAKE", "MATCHES ")) {
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("READ", "RECIPE BOOK") || player_said("LOOK AT", "RECIPE BOOK")) {
_G(wilbur_should) = 4;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,59 @@
/* 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_SECTION3_ROOM304_H
#define M4_BURGER_ROOMS_SECTION3_ROOM304_H
#include "m4/burger/rooms/section3/section3_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room304 : public Section3Room {
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[];
machine *_matches = nullptr;
machine *_fire = nullptr;
protected:
const char *getDigi() override;
public:
Room304() : Section3Room() {}
~Room304() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,271 @@
/* 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/section3/room305.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room305::SAID[][4] = {
{ "STAIRS", "305w002", "300w002", nullptr },
{ "DARKNESS", "305w004", "300w002", "300w002" },
{ "MINE", "305w003", "300w002", "300w002" },
{ "GENERATOR", nullptr, "305w008", nullptr },
{ "PICK AXE", "305w015", "305w016", "305w017" },
{ "BOX", "305w018", "300w003", "300w005" },
{ "DEBRIS", nullptr, "305w021", "300w005" },
{ "GROUND", "305w022", "300w002", "300w002" },
{ "WALL", "305w022", "300w002", "300w002" },
{ "CEILING", "305w022", "300w002", "300w002" },
{ "FORCE FIELD", "302w027", "300w002", "300w002" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesStreamBreak Room305::SERIES1[] = {
{ 6, "305_003", 2, 255, -1, 0, nullptr, 0 },
{ 11, "305w009", 1, 255, -1, 0, nullptr, 0 },
{ 12, "305_005", 2, 255, -1, 0, nullptr, 0 },
{ 20, "305w010", 1, 255, -1, 0, &Flags::_flags[V135], 0 },
{ 30, "305_006", 2, 255, -1, (uint)-1, nullptr, 0 },
{ 72, "305_001", 1, 255, -1, 0, nullptr, 0 },
{ 72, nullptr, 2, 0, -1, 2048, nullptr, 0 },
{ 79, "305_004", 2, 255, -1, 0, nullptr, 0 },
{ 94, "305_002", 2, 255, -1, 0, nullptr, 0 },
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesPlayBreak Room305::PLAY1[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room305::PLAY2[] = {
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
void Room305::init() {
setupDigi();
set_palette_brightness(60);
pal_cycle_init(96, 111, 6, -1, -1);
_G(flags)[kMineRoomIndex] = 0;
if (_G(flags)[V134] && !_G(flags)[V135] && !_G(flags)[kEnteredMine]) {
hotspot_set_active("DARKNESS", true);
hotspot_set_active("MINE", false);
} else {
hotspot_set_active("DARKNESS", false);
hotspot_set_active("MINE", true);
}
_series1 = series_show(_G(flags)[V134] ? "305genx" : "305gen", 0x200);
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 302:
_G(wilbur_should) = 101;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 319:
player_set_commands_allowed(true);
ws_demand_location(-50, 200);
kernel_trigger_dispatch_now(301);
break;
default:
player_set_commands_allowed(true);
ws_demand_location(320, 290, 7);
break;
}
}
void Room305::daemon() {
Mine::daemon();
if (!_G(kernel).continue_handling_trigger)
return;
_G(kernel).continue_handling_trigger = false;
switch (_G(kernel).trigger) {
case 100:
_series1 = series_show("305genx", 0x200);
_G(flags)[V134] = 1;
_G(wilbur_should) = 105;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 3001:
_G(game).setRoom(302);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 101:
ws_demand_location(372, 267, 9);
player_set_commands_allowed(false);
ws_hide_walker();
if (_G(flags)[V133]) {
_G(wilbur_should) = 10001;
} else {
_G(flags)[V133] = 1;
_G(wilbur_should) = 104;
}
series_play_with_breaks(PLAY1, "305wi01", 0x700, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 102:
player_set_commands_allowed(false);
ws_demand_location(375, 280, 2);
ws_hide_walker();
series_play_with_breaks(PLAY2, "305wi02", 0x700, -1, 3);
pal_fade_init(_G(kernel).first_fade, 255, 0, 60, 3001);
break;
case 103:
hotspot_set_active("DARKNESS", false);
hotspot_set_active("MINE", true);
player_set_commands_allowed(false);
ws_hide_walker();
terminateMachineAndNull(_series1);
series_stream_with_breaks(SERIES1, "305wi04", 6, 0x200, 100);
break;
case 104:
ws_unhide_walker();
player_set_commands_allowed(true);
wilbur_speech("305w001");
break;
case 105:
ws_unhide_walker();
if (_G(flags)[V135]) {
_G(wilbur_should) = 106;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_G(flags)[V135] = 1;
_G(wilbur_should) = 106;
wilbur_speech("305w011", kCHANGE_WILBUR_ANIMATION);
}
break;
case 106:
_G(wilbur_should) = 10001;
wilbur_speech(_G(flags)[kEnteredMine] ? "305w013" : "305w012", kCHANGE_WILBUR_ANIMATION);
break;
case 107:
_G(wilbur_should) = 10001;
wilbur_speech("305w012", kCHANGE_WILBUR_ANIMATION);
break;
case 108:
mine_travel_link(BACK);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room305::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
// Handle any generic mine stuff
Mine::parser();
if (!_G(player).command_ready)
// Already handled
return;
// Check for standard actions
if (_G(walker).wilbur_said(SAID)) {
// Handled
} else if (player_said("climb", "stairs") || player_said("GEAR", "STAIRS")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 102;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("ENTER", "MINE") || player_said("ENTER", "DARKNESS")) {
player_set_commands_allowed(false);
if (!_G(flags)[kDrunkCarrotJuice]) {
player_set_commands_allowed(true);
wilbur_speech("305w004");
} else {
_G(wilbur_should) = 108;
if (_G(flags)[kEnteredMine]) {
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
wilbur_speech("305w005", kCHANGE_WILBUR_ANIMATION);
}
}
} else if (player_said("DISTILLED CARROT JUICE", "GENERATOR")) {
wilbur_speech(_G(flags)[V134] ? "300w037" : "300w036");
} else if (player_said("CARROT JUICE", "GENERATOR")) {
wilbur_speech(_G(flags)[V134] ? "300w054" : "300w053");
} else if (player_said_any("CARROT JUICE", "DISTILLED CARROT JUICE") &&
player_said("BARREL")) {
wilbur_speech("300w038");
} else if (player_said("LOOK AT", "GENERATOR")) {
wilbur_speech(_G(flags)[V134] ? "300w007" : "300w006");
} else if (player_said("MATCHES", "GENERATOR")) {
wilbur_speech(_G(flags)[V134] ? "300w022" : "300w021");
} else if (player_said("LOOK AT", "DEBRIS")) {
if (!_G(flags)[V136]) {
_G(flags)[V136] = 1;
wilbur_speech("305w019");
} else {
wilbur_speech(Common::String::format("305w020%c",
'a' + imath_ranged_rand(0, 6)).c_str());
}
} else if (player_said("GEAR", "GENERATOR")) {
if (_G(flags)[V134]) {
wilbur_speech("305w014");
} else {
_G(wilbur_should) = 103;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
} else if (!player_said("LOOK AT WALL")) {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION3_ROOM305_H
#define M4_BURGER_ROOMS_SECTION3_ROOM305_H
#include "m4/burger/rooms/section3/mine.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room305 : public Mine {
private:
static const char *SAID[][4];
static const seriesStreamBreak SERIES1[];
static const seriesPlayBreak PLAY1[];
static const seriesPlayBreak PLAY2[];
machine *_series1 = nullptr;
protected:
const char *getDigi() override {
return "305_007";
}
public:
Room305() : Mine() {}
~Room305() override {}
void init() override;
void daemon() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View 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/ },.
*
*/
#include "m4/burger/rooms/section3/room306.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room306::SERIES1[] = {
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
{ 2, "306f003a", 1, 255, -1, 0, nullptr, 0 },
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room306::SERIES2[] = {
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
{ 2, "306f001a", 1, 255, -1, 0, nullptr, 0 },
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room306::SERIES3[] = {
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
{ 1, "306f002a", 1, 255, -1, 0, nullptr, 0 },
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room306::preload() {
_G(player).walker_in_this_scene = false;
}
void Room306::init() {
pal_cycle_init(101, 110, 6);
kernel_trigger_dispatch_now(3007);
}
void Room306::daemon() {
switch (_G(kernel).trigger) {
case 1:
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
release_trigger_on_digi_state(k10027, 1);
break;
case 3007:
if (!_G(flags)[kPerkinsLostIsland]) {
digi_preload_stream_breaks(SERIES2);
series_stream_with_breaks(SERIES2, "306burnt", 6, 1, 1);
} else if (_G(flags)[V118] == 3003) {
digi_preload_stream_breaks(SERIES3);
series_stream_with_breaks(SERIES3, "306burnt", 6, 1, 1);
} else {
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "306fail", 6, 1, 1);
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,50 @@
/* 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_SECTION3_ROOM306_H
#define M4_BURGER_ROOMS_SECTION3_ROOM306_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room306 : public Room {
private:
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
static const seriesStreamBreak SERIES3[];
public:
Room306() : Room() {}
~Room306() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,101 @@
/* 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/section3/room307.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room307::SERIES1[] = {
{ 0, "307z001", 1, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesPlayBreak Room307::PLAY1[] = {
{ 0, 5, "307z002w", 1, 255, -1, 2052, -1, nullptr, 0 },
{ 0, 0, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
{ 0, 5, "307z002x", 1, 255, -1, 2052, -1, nullptr, 0 },
{ 0, 0, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
{ 0, 5, "307z002y", 1, 255, -1, 2052, -1, nullptr, 0 },
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 0, 5, "307z002z", 1, 255, -1, 2052, -1, nullptr, 0 },
{ 6, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
void Room307::init() {
_G(flags)[kThirdTestPassed] = 1;
ws_demand_location(418, 309, 9);
ws_hide_walker();
digi_preload("307_001");
digi_play_loop("307_001", 3, 125, -1, 307);
kernel_trigger_dispatch_now(1);
}
void Room307::daemon() {
switch (_G(kernel).trigger) {
case 1:
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "307brig", 6, 1, 2);
break;
case 2:
digi_unload_stream_breaks(SERIES1);
_series1.show("307zg01", 0x400);
ws_unhide_walker();
kernel_trigger_dispatch_now(3);
break;
case 3:
wilbur_speech("307w001y", 4);
break;
case 4:
wilbur_speech("307w001z", 7);
break;
case 5:
digi_preload("608_002");
series_play("307door", 9, 16, -1, 7);
digi_play("608_002", 2, 200, 6);
break;
case 6:
wilbur_speech("307w002", k10027);
break;
case 7:
_series1.terminate();
series_play_with_breaks(PLAY1, "307zg01", 0x400, 5, 3, 5, 100, 0, 0);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION3_ROOM307_H
#define M4_BURGER_ROOMS_SECTION3_ROOM307_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room307 : public Room {
private:
static const seriesStreamBreak SERIES1[];
static const seriesPlayBreak PLAY1[];
Series _series1;
public:
Room307() : Room() {}
~Room307() override {}
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,341 @@
/* 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/section3/room310.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum {
kCHANGE_PROBE_ANIMATION = 1,
kCHANGE_TRUFFLES_ANIMATION = 3
};
const char *Room310::SAID[][4] = {
{ "TUNNEL", "310w002", "310w003", nullptr },
{ "PROBE", "310w004", nullptr, nullptr },
{ "TRUFFLES", nullptr, "310w011", "310w012" },
{ "GROUND", "310w017", "310w003", "310w003" },
{ "WALL", "310w017", "310w003", "310w003" },
{ "CEILING", "310w017", "310w003", "310w003" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room310::PLAY1[] = {
{ 1, 2, "300t004a", 2, 165, -1, 0, 0, &_state1, 1 },
{ 1, 2, "300t004b", 2, 165, -1, 0, 0, &_state1, 2 },
{ 1, 2, "300t004c", 2, 165, -1, 0, 0, &_state1, 3 },
{ 1, 2, "300t004d", 2, 165, -1, 0, 0, &_state1, 4 },
{ 3, 4, nullptr, 2, 0, 1, 0, 0, nullptr, 0 },
{ 5, -1, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room310::PLAY2[] = {
{ 0, 9, "300t003a", 2, 165, -1, 0, 0, &_state1, 1 },
{ 0, 9, "300t003b", 2, 165, -1, 0, 0, &_state1, 2 },
{ 0, 9, "300t003c", 2, 165, -1, 0, 0, &_state1, 3 },
{ 0, 9, "300t003d", 2, 165, -1, 0, 0, &_state1, 4 },
{ 10, 16, nullptr, 2, 0, 10016, 1, 0, nullptr, 0 },
{ 10, 16, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 17, 21, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 0, 0, nullptr, 2, 0, -1, 2048, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room310::PLAY3[] = {
{ 15, 29, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room310::PLAY4[] = {
{ 6, -1, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room310::PLAY5[] = {
{ 30, 36, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
{ 37, 51, "300_002", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room310::PLAY6[] = {
{ 52, 56, "300_001", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
int32 Room310::_state1;
Room310::Room310() : Mine() {
_state1 = 0;
}
void Room310::init() {
Mine::init();
setupDigi();
set_palette_brightness(48, 127, 30);
digi_preload("601_007");
_probeShould = 7;
kernel_trigger_dispatch_now(kCHANGE_PROBE_ANIMATION);
if (!_G(flags)[kTrufflesRanAway] && _G(flags)[kTrufflesInMine]) {
_walk1 = intr_add_no_walk_rect(360, 265, 515, 293, 359, 294);
_trufflesShould = 12;
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
} else {
hotspot_set_active("TRUFFLES", false);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 319:
break;
default:
_G(flags)[kMineRoomIndex] = 39;
ws_demand_location(300, 306, 4);
player_set_commands_allowed(true);
break;
}
}
void Room310::daemon() {
Mine::daemon();
if (!_G(kernel).continue_handling_trigger)
return;
_G(kernel).continue_handling_trigger = false;
switch (_G(kernel).trigger) {
case kCHANGE_PROBE_ANIMATION:
switch (_probeShould) {
case 7:
_series2 = series_play("310prob", 0xb00, 0, -1, 6, -1, 100, 0, 0, 0, 17);
break;
case 8:
_probeShould = 7;
terminateMachineAndNull(_series2);
series_play_with_breaks(PLAY3, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2);
break;
case 9:
_probeShould = 10;
terminateMachineAndNull(_series2);
series_play_with_breaks(PLAY5, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2);
break;
case 10:
_probeShould = 11;
series_play_with_breaks(PLAY6, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2, 3);
break;
case 11:
series_show("310prob", 0xb00, 0, -1, -1, 60);
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
default:
break;
}
break;
case 2:
_series1.terminate();
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
break;
case kCHANGE_TRUFFLES_ANIMATION:
switch (_trufflesShould) {
case 12:
_series1.show("310tr01", 0xb00, 0, -1, -1, 18);
_trufflesShould = (imath_ranged_rand(1, 4) == 1) ? 13 : 12;
kernel_timing_trigger(30, 2);
break;
case 13:
_trufflesShould = 12;
_probeShould = 8;
series_play_with_breaks(PLAY1, "310tr01", 0xb00, 3, 3);
_state1 = imath_ranged_rand(1, 4);
break;
case 14:
term_message("Truffles goes to snarl at Wilbur!");
_G(flags)[V145] = 1;
_G(wilbur_should) = 4;
_trufflesShould = 15;
series_play_with_breaks(PLAY2, "310tr02", 0xb00, 3, 3);
_state1 = imath_ranged_rand(1, 4);
break;
case 15:
player_set_commands_allowed(true);
if (!_G(flags)[V142]) {
_G(flags)[V142] = 1;
wilbur_speech("310w006");
} else {
wilbur_speech("310w007");
}
_trufflesShould = 12;
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
break;
case 16:
digi_play("300t002", 2, 155, -1, 300);
hotspot_set_active("TRUFFLES", false);
hotspot_set_active("GROUND ", false);
intr_remove_no_walk_rect(_walk1);
series_play("310tr03", 0xb00);
break;
default:
break;
}
break;
case 10008:
_trufflesShould = 16;
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
ws_hide_walker();
_general.play("310wi01", 0xb00, 16, -1, 6, 0, 100, 0, 0, 0, 5);
_probeShould = 9;
kernel_trigger_dispatch_now(kCHANGE_PROBE_ANIMATION);
break;
case 2:
_general.terminate();
_G(wilbur_should) = 3;
series_play_with_breaks(PLAY4, "310wi01", 0xb00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 3:
ws_unhide_walker();
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 3006);
break;
case 4:
_state1 = imath_ranged_rand(0, 2);
switch (_state1) {
case 0:
wilbur_speech("310w005a");
term_message("Wilbur: Whoa, easy Truffles!");
break;
case 1:
wilbur_speech("310w005b");
term_message("Wilbur: Down, piggy!");
break;
case 2:
wilbur_speech("310w005c");
term_message("Wilbur: Aaaaaaaaaa!");
break;
default:
break;
}
break;
case 5:
wilbur_speech(_G(flags)[V145] ? "310w010" : "310w009");
break;
case 6:
player_set_commands_allowed(false);
_G(wilbur_should) = 1;
wilbur_speech("310w008", kCHANGE_WILBUR_ANIMATION);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room310::pre_parser() {
Mine::pre_parser();
if (player_said("GEAR", "PROBE") && (!_G(flags)[kTrufflesInMine] || _G(flags)[kTrufflesRanAway] == 1)) {
_G(wilbur_should) = 6;
player_hotspot_walk_override(293, 288, 3, kCHANGE_WILBUR_ANIMATION);
_G(player).command_ready = false;
} else if (!_G(flags)[kTrufflesRanAway]) {
HotSpotRec *hotspot = hotspot_which(_G(player).click_x, _G(player).click_y);
assert(hotspot);
if (hotspot->feet_x > 360 && hotspot->feet_x < 515 &&
hotspot->feet_y > 265 && hotspot->feet_y < 293) {
player_hotspot_walk_override(hotspot->feet_x, 294, 11);
}
}
}
void Room310::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
Mine::parser();
if (!_G(player).command_ready)
return;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("GEAR", "PROBE") || player_said("TAKE", "PROBE")) {
term_message("truffles in mine %d truffles ran away %d",
_G(flags)[kTrufflesInMine], _G(flags)[kTrufflesRanAway]);
if (_G(flags)[kTrufflesInMine] == 1 && !_G(flags)[kTrufflesRanAway]) {
term_message("Wilbur pissed off truffles!");
player_set_commands_allowed(false);
_trufflesShould = 14;
}
} else if (player_said("LOOK AT", "TRUFFLES")) {
_G(wilbur_should) = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION3_ROOM310_H
#define M4_BURGER_ROOMS_SECTION3_ROOM310_H
#include "m4/burger/rooms/section3/mine.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room310 : public Mine {
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 int32 _state1;
Series _series1;
machine *_series2 = nullptr;
noWalkRect *_walk1 = nullptr;
int _probeShould = 0;
int _trufflesShould = 0;
protected:
const char *getDigi() override {
return "310_001";
}
public:
Room310();
~Room310() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,226 @@
/* 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/section3/section3.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
static const seriesPlayBreak PLAY1[] = {
{ 0, 15, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 16, 46, "300w039", 1, 255, -1, 0, 0, nullptr, 0 },
{ 47, 60, "300_006", 2, 255, -1, 0, 0, nullptr, 0 },
{ 60, 60, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 60, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
Section3::Section3() : Rooms::Section() {
add(301, &_room301);
add(302, &_room302);
add(303, &_room303);
add(304, &_room304);
add(305, &_room305);
add(306, &_room306);
add(307, &_room307);
add(310, &_room310);
add(311, &_mine);
add(312, &_mine);
add(313, &_mine);
add(314, &_mine);
add(315, &_mine);
add(316, &_mine);
add(317, &_mine);
add(318, &_mine);
add(319, &_mine);
}
void Section3::daemon() {
switch (_G(kernel).trigger) {
case 3001:
_G(game).setRoom(302);
break;
case 3002:
_G(game).setRoom(303);
break;
case 3003:
_G(game).setRoom(304);
break;
case 3004:
_G(game).setRoom(305);
break;
case 3005:
digi_unload("303_003");
_G(game).setRoom(306);
break;
case 3006:
_G(game).setRoom(307);
break;
case 3007:
player_set_commands_allowed(false);
gr_pal_clear(_G(master_palette));
release_trigger_on_digi_state(3005, 1, 0);
break;
case 3008:
_random1 = imath_ranged_rand(0, 5);
digi_play(Common::String::format("300t001%c", 'a' + _random1).c_str(), 2, 55, -1, 300);
break;
case 10008:
if (!_G(flags)[kTrufflesInMine])
kernel_timing_trigger(15, 3008);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 3001:
player_update_info();
_G(flags)[kDrunkCarrotJuice] = 1;
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 3002;
series_play_with_breaks(PLAY1, "300wdcj", _G(player_info).depth,
kCHANGE_WILBUR_ANIMATION, 3, 6, _G(player_info).scale,
_G(player_info).x, _G(player_info).y);
break;
case 3002:
inv_move_object("DISTILLED CARROT JUICE", NOWHERE);
inv_give_to_player("JUG");
ws_unhide_walker();
_G(wilbur_should) = 10001;
wilbur_speech(_G(flags)[V101] ? "300w041" : "300w040");
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 10013:
ws_unhide_walker();
player_set_commands_allowed(true);
_G(wilbur_should) = 10002;
if (_G(flags)[kTrufflesInMine]) {
_G(flags)[V002] = 1;
wilbur_speech("300w060");
}
break;
case 10015:
_G(game).setRoom(306);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Section3::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("DISTILLED CARROT JUICE")) {
if (player_said("LOOK AT")) {
wilbur_speech("300w030");
} else if (player_said("TRUFFLES") || player_said("TROUGH")) {
wilbur_speech("300w031");
} else if (player_said_any("GEAR", "WILBUR")) {
_G(wilbur_should) = 3001;
ws_turn_to_face(3, kCHANGE_WILBUR_ANIMATION);
} else if (player_said("BOTTLE")) {
wilbur_speech("300w076");
} else if (player_said("TAKE") && inv_player_has("DISTILLED CARROT JUICE")) {
wilbur_speech("999w021");
} else {
wilbur_speech("300w042");
}
} else if (player_said("BURGER MORSEL")) {
if (player_said("LOOK AT")) {
wilbur_speech("300w006");
} else if (player_said("TROUGH")) {
wilbur_speech("300w004");
} else if (player_said("WILBUR")) {
wilbur_speech("300w013");
} else if (player_said("TRUFFLES") && _G(game).room_id == 310) {
wilbur_speech("300w012");
} else if (player_said("STOVE") || player_said("FRYING PAN") || player_said("POT")) {
wilbur_speech("300w011");
} else if (player_said("TAKE") && inv_player_has("BURGER MORSEL")) {
wilbur_speech("999w021");
} else {
wilbur_speech("300w014");
}
} else if (player_said("MATCHES")) {
if (player_said("LOOK AT")) {
wilbur_speech("300w015");
} else if (player_said("TRUFFLES")) {
wilbur_speech("300w016");
} else if (player_said("CABIN")) {
wilbur_speech("300w017");
} else if (player_said("WILBUR")) {
wilbur_speech("300w024");
} else if (player_said("TAKE") && inv_player_has("MATCHES")) {
wilbur_speech("999w021");
} else {
wilbur_speech("300w025");
}
} else if (player_said("JUG")) {
if (player_said("LOOK AT")) {
wilbur_speech("303w022");
} else if (player_said("BOILER") || player_said("WILBUR") || player_said("GEAR")) {
wilbur_speech("300w027");
} else if (player_said("CARROT JUICE")) {
wilbur_speech("300w050");
} else if (player_said("TAKE") && inv_player_has("JUG")) {
wilbur_speech("999w021");
} else {
wilbur_speech("300w029");
}
} else {
return;
}
_G(player).command_ready = false;
}
void Section3::mine_check_maze() {
// This was used in the original to do sanity checks that the
// mine maze data was all valid
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,71 @@
/* 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_SECTION3_H
#define M4_BURGER_ROOMS_SECTION3_H
#include "m4/burger/rooms/room.h"
#include "m4/burger/rooms/section.h"
#include "m4/burger/rooms/section3/room301.h"
#include "m4/burger/rooms/section3/room302.h"
#include "m4/burger/rooms/section3/room303.h"
#include "m4/burger/rooms/section3/room304.h"
#include "m4/burger/rooms/section3/room305.h"
#include "m4/burger/rooms/section3/room306.h"
#include "m4/burger/rooms/section3/room307.h"
#include "m4/burger/rooms/section3/room310.h"
#include "m4/burger/rooms/section3/mine.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section3 : public Rooms::Section {
private:
Room301 _room301;
Room302 _room302;
Room303 _room303;
Room304 _room304;
Room305 _room305;
Room306 _room306;
Room307 _room307;
Room310 _room310;
Mine _mine;
int _random1 = 0;
void mine_check_maze();
public:
Section3();
virtual ~Section3() {}
void init() override {
mine_check_maze();
}
void daemon() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,72 @@
/* 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/section3/section3_room.h"
#include "m4/burger/vars.h"
#include "m4/core/errors.h"
namespace M4 {
namespace Burger {
namespace Rooms {
void Section3Room::preload() {
Rooms::Room::preload();
_digiName = nullptr;
}
void Section3Room::setupDigi() {
if (_digiName) {
digi_stop(3);
digi_unload(_digiName);
}
_digiVolume = 75;
_digiName = getDigi();
if (_digiName) {
digi_preload(_digiName);
digi_play_loop(_digiName, 3, _digiVolume);
}
}
void Section3Room::set_palette_brightness(int start, int finish, int percent) {
if (finish < start || finish > 255 || start < 0)
error_show(FL, 'Burg', "set_palette_brightness index error");
RGB8 *pal = &_G(master_palette)[start];
for (int index = start; index < finish; ++index, ++pal) {
const int r = (double)pal->r * (double)percent / (double)100;
const int g = (double)pal->g * (double)percent / (double)100;
const int b = (double)pal->b * (double)percent / (double)100;
pal->r = CLIP(r, 0, 255);
pal->g = CLIP(g, 0, 255);
pal->b = CLIP(b, 0, 255);
}
}
void Section3Room::set_palette_brightness(int percent) {
set_palette_brightness(32, 95, percent);
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION3_ROOM_H
#define M4_BURGER_ROOMS_SECTION3_ROOM_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section3Room : public Rooms::Room {
private:
const char *_digiName = nullptr;
protected:
int _digiVolume = 0;
virtual const char *getDigi() {
return nullptr;
}
void set_palette_brightness(int start, int finish, int percent);
void set_palette_brightness(int percent);
public:
Section3Room() : Rooms::Room() {}
virtual ~Section3Room() {}
void preload() override;
void setupDigi();
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,135 @@
/* 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/section4/room401.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room401::SERIES1[] = {
{ 7, "401v001", 1, 255, -1, 0, nullptr, 0 },
{ 36, "401A_002", 2, 200, -1, 0, nullptr, 0 },
{ 89, nullptr, 0, 0, 9, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room401::SERIES2[] = {
{ 0, "401B_003", 2, 200, -1, 0, nullptr, 0 },
{ 41, "401Z001", 1, 255, -1, 0, nullptr, 0 },
{ 69, "401Z002", 1, 255, -1, 0, nullptr, 0 },
{ 99, "401V002", 1, 255, -1, 0, nullptr, 0 },
{ 162, "401Z003", 1, 255, -1, 0, nullptr, 0 },
{ 228, "401V003", 1, 255, -1, 0, nullptr, 0 },
{ 319, "401Z004", 1, 255, -1, 0, nullptr, 0 },
{ 386, "401V004", 1, 255, -1, 0, nullptr, 0 },
{ 417, "401V005", 1, 255, -1, 0, nullptr, 0 },
{ 461, "401Z005", 1, 255, -1, 0, nullptr, 0 },
{ 567, "401V006", 1, 255, -1, 0, nullptr, 0 },
{ 582, "401Z006", 1, 255, -1, 0, nullptr, 0 },
{ 661, "401V007", 1, 255, -1, 0, nullptr, 0 },
{ 758, nullptr, 0, 0, 9, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room401::SERIES3[] = {
{ 0, "401C_001", 3, 150, -1, (uint)-1, nullptr, 0 },
{ 19, "401z007", 1, 255, -1, 0, nullptr, 0 },
{ 45, "401f001", 1, 255, -1, 0, nullptr, 0 },
{ 63, "401z008", 1, 255, -1, 0, nullptr, 0 },
{ 100, nullptr, 0, 0, 8, 0, nullptr, 0 },
{ 102, "401f002", 1, 255, -1, 0, nullptr, 0 },
{ 104, nullptr, 0, 0, 9, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room401::preload() {
_G(player).walker_in_this_scene = false;
}
void Room401::init() {
_G(flags).reset5();
player_set_commands_allowed(false);
digi_preload("401_001");
digi_preload_stream_breaks(SERIES1);
digi_preload_stream_breaks(SERIES2);
digi_preload_stream_breaks(SERIES3);
digi_play_loop("401_001", 3, 75, -1, 401);
kernel_trigger_dispatch_now(1);
}
void Room401::daemon() {
switch (_G(kernel).trigger) {
case 1:
series_stream_with_breaks(SERIES1, "401_01a", 6, 1, 2);
pal_fade_init(0, 255, 100, 30, -1);
break;
case 2:
pal_fade_set_start(0);
kernel_timing_trigger(6, 3);
break;
case 3:
compact_mem_and_report();
kernel_timing_trigger(6, 4);
break;
case 4:
series_stream_with_breaks(SERIES2, "401_01b", 6, 1, 5);
pal_fade_init(0, 255, 100, 30, -1);
break;
case 5:
pal_fade_set_start(0);
kernel_timing_trigger(6, 6);
break;
case 6:
compact_mem_and_report();
kernel_timing_trigger(6, 7);
break;
case 7:
digi_unload_stream_breaks(SERIES1);
digi_unload_stream_breaks(SERIES2);
_series1 = series_stream_with_breaks(SERIES3, "401_02", 6, 1, 4002);
pal_fade_init(0, 255, 100, 30, -1);
break;
case 8:
series_set_frame_rate(_series1, 20);
break;
case 9:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, -1);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,51 @@
/* 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_SECTION4_ROOM401_H
#define M4_BURGER_ROOMS_SECTION4_ROOM401_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room401 : public Room {
private:
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
static const seriesStreamBreak SERIES3[];
machine *_series1 = nullptr;
public:
Room401() : Room() {}
~Room401() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
/* 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_SECTION4_ROOM402_H
#define M4_BURGER_ROOMS_SECTION4_ROOM402_H
#include "m4/burger/rooms/section4/section4_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room402 : public Section4Room {
private:
static const char *SAID[][4];
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
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[];
const char *_digiName = nullptr;
KernelTriggerType _newMode = KT_DAEMON;
bool _stolieSet = false;
Series _stolie;
bool _series2Set = false;
Series _series2;
Series _series3;
int _dr01 = -1, _dr01s = -1;
int _dr02 = -1, _dr02s = -1;
int _dr03 = -1, _dr03s = -1;
int _dr08 = -1, _dr08s = -1;
int _pe01 = -1, _pe01s = -1;
int _pe02 = -1, _pe02s = -1;
int _pe03 = -1, _pe03s = -1;
int _pe04 = -1, _pe04s = -1;
int _wi01 = -1, _wi01s = -1;
int _wi02 = -1, _wi02s = -1;
int _digiTrigger = 0;
int _stolieShould = 0;
int _elmoShould = 0;
int _val4 = 0;
int _elmoMode = 0;
int _stolieMode = 0;
void conv84();
void playDigiName();
void playRandom1();
void playRandom2();
void freeStolie();
void freeSeries2();
void loadDr1();
void freeDr1();
void loadDr2();
void freeDr2();
void loadDr8();
void freeDr8();
void loadPe1();
void freePe1();
void loadPe2();
void freePe2();
void loadPe3();
void freePe3();
void loadPe4();
void freePe4();
public:
Room402() : Section4Room() {}
~Room402() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,159 @@
/* 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/section4/room404.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room404::SAID[][4] = {
{ "QUARTER ", "404w001", nullptr, "404w002" },
{ "IMPOUND YARD", nullptr, "400w001", nullptr },
{ "TOILET", "404w003", "400w001", "404w004" },
{ "SINK", "404w005", "400w001", "404w006" },
{ "COT", "404w007", nullptr, "404w008" },
{ "MARKS", "404w103", nullptr, nullptr },
{ "NEWSPAPER", "404w009", "404w010", "404w011" },
{ "BARS", "404w012", "400w001", "400w001" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room404::PLAY1[] = {
{ 1, 9, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 10, 17, nullptr, 0, 0, 10016, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
void Room404::init() {
digi_preload("400_001");
digi_play_loop("400_001", 3, 125);
pal_cycle_init(112, 127, 6);
if (_G(flags)[V162]) {
hotspot_set_active("QUARTER ", false);
} else {
hotspot_set_active("QUARTER ", true);
_quarter.show("404wi01", 0xf00);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
break;
case 406:
ws_demand_location(320, 350, 1);
break;
default:
_G(flags)[V171] = 4001;
_G(flags)[V172] = 10026;
_G(flags)[V176] = 1;
_G(flags)[V175] = 1;
_G(flags)[V174] = 4004;
ws_demand_location(320, 271, 5);
break;
}
}
void Room404::daemon() {
switch (_G(kernel).trigger) {
case 1:
player_update_info();
if (_G(player_info).y > 350) {
disable_player_commands_and_fade_init(-1);
} else {
kernel_timing_trigger(6, 1);
}
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
_G(wilbur_should) = 2;
disable_player();
series_play_with_breaks(PLAY1, "404wi01", 0x200, kCHANGE_WILBUR_ANIMATION, 1);
break;
case 2:
_G(wilbur_should) = 10001;
_quarter.terminate();
_G(flags)[V162] = 1;
hotspot_set_active("QUARTER ", false);
inv_give_to_player("QUARTER");
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room404::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("IMPOUND YARD")) {
if (!player_said_any("EXIT", "LOOK AT", "GEAR")) {
player_hotspot_walk_override(320, 346, 5);
} else {
player_set_commands_allowed(false);
kernel_trigger_dispatch_now(1);
}
}
}
void Room404::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("IMPOUND YARD")) {
if (player_said_any("EXIT", "LOOK AT", "GEAR")) {
kernel_trigger_dispatch_now(4005);
} else {
wilbur_speech("400w001");
}
} else if (player_said("TAKE", "QUARTER ")) {
_G(wilbur_should) = 1;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("TOILET")) {
wilbur_speech("404w004");
} else if (player_said("BARS")) {
wilbur_speech("404w013");
} else {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,54 @@
/* 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_SECTION4_ROOM404_H
#define M4_BURGER_ROOMS_SECTION4_ROOM404_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
/**
* Error: room not found
*/
class Room404 : public Room {
private:
static const char *SAID[][4];
static const seriesPlayBreak PLAY1[];
Series _quarter;
public:
Room404() : Room() {}
~Room404() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,89 @@
/* 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_SECTION4_ROOM405_H
#define M4_BURGER_ROOMS_SECTION4_ROOM405_H
#include "m4/burger/rooms/section4/section4_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room405 : public Section4Room {
private:
static const char *SAID[][4];
static const seriesStreamBreak SERIES1[];
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[];
machine *_series1 = nullptr;
machine *_records = nullptr;
machine *_box = nullptr;
machine *_lid = nullptr;
machine *_eu02 = nullptr;
Series _vp03;
Series _cat;
const char *_digiName = nullptr;
int32 _vpoof = -1;
KernelTriggerType _newMode = (KernelTriggerType)0;
int _volume = 0;
int _vipeShould = 0;
int _vipeMode = 0;
int _veraShould = 0;
int _veraMode = 0;
int _muffinsState = 0;
int _newTrigger = 0;
void conv86();
void conv89();
void conv90();
void conv91();
void conv92();
void startConv89();
void startConv90();
void startConv91();
void talkToVipe();
void talkToVera();
void playDigi();
void playDigi2() {
playDigi();
}
public:
Room405() : Section4Room() {}
~Room405() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,134 @@
/* 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_SECTION4_ROOM406_H
#define M4_BURGER_ROOMS_SECTION4_ROOM406_H
#include "m4/burger/rooms/section4/section4_room.h"
#include "m4/burger/walker.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room406 : public Section4Room {
private:
static const char *SAID[][4];
static const WilburMatch MATCH[];
static const seriesStreamBreak SERIES1[];
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 const seriesPlayBreak PLAY24[];
static const seriesPlayBreak PLAY25[];
static const seriesPlayBreak PLAY26[];
static const seriesPlayBreak PLAY27[];
static const seriesPlayBreak PLAY28[];
static const seriesPlayBreak PLAY29[];
static const seriesPlayBreak PLAY30[];
static const seriesPlayBreak PLAY31[];
static const seriesPlayBreak PLAY32[];
static const seriesPlayBreak PLAY33[];
static const seriesPlayBreak PLAY34[];
static const seriesPlayBreak PLAY35[];
static const seriesPlayBreak PLAY36[];
static int32 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
Series _coll;
Series _gate;
Series _mg03;
int32 _gateS1 = 0, _gateS2 = 0;
int32 _tire = 0;
const char *_seriesName = nullptr;
machine *_tt = nullptr;
machine *_tts = nullptr;
machine *_fish = nullptr;
machine *_wi03 = nullptr;
machine *_coll406 = nullptr;
int32 _fishS = 0;
Common::String _randomDigi;
noWalkRect *_walk1 = nullptr;
noWalkRect *_walk2 = nullptr;
noWalkRect *_walk3 = nullptr;
noWalkRect *_walk4 = nullptr;
HotSpotRec *_hotspot = nullptr;
bool _flag1 = false;
bool _flag2 = false;
bool _flag3 = false;
int _ticks = 0;
int _dogShould = 0;
int _val2 = 0;
//int _val3 = 0;
int _val4 = 0;
int _mayorShould = 0;
int _val6 = 0;
int _val7 = 0;
void loadSeries();
void setHotspots1();
void setHotspots2();
void setHotspots3();
void setHotspots4();
void setupFish();
void setupTt();
void setNoWalk();
void parseJail();
void playRandom(int trigger);
int tabooAreaY(int x) const;
void triggerPreparser();
public:
Room406();
~Room406() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,719 @@
/* 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/section4/room407.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum {
kWILBUR_SPEECH = 4,
kCHANGE_DRUMZ_ANIMATION = 7,
kCHANGE_ROXY_ANIMATION = 8,
kCHANGE_VIPE_ANIMATION = 9
};
const char *Room407::SAID[][4] = {
{ "TOUR BUS", "407w001", "407w002", "407w003" },
{ "ROXY", nullptr, "400w001", "400w001" },
{ "DRUMZ", "407w007", "400w001", "400w001" },
{ "INSTRUMENTS", "407w009", "407w010", "407w010" },
{ "FORCE FIELD", "400w005", nullptr, "400w001" },
{ "FORCE FIELD ", "400w005", nullptr, "400w001" }
};
const WilburMatch Room407::MATCH[] = {
{ "TALK", "DRUMZ", 11, nullptr, 0, nullptr, 0 },
{ "AMPLIFIER", "DRUMZ", 4, nullptr, 0, &_speechNum, 4 },
{ nullptr, "DRUMZ", 4, nullptr, 0, &_speechNum, 7 },
{ "LOOK AT", "ROXY", 10016, nullptr, 0, &Vars::_wilbur_should, 1 },
{ "TALK", "ROXY", 10016, nullptr, 0, &Vars::_wilbur_should, 2 },
{ "AMPLIFIER", "ROXY", 4, nullptr, 0, &_speechNum, 4 },
{ "DOG COLLAR", "ROXY", 4, nullptr, 0, &_speechNum, 5 },
{ nullptr, "ROXY", 4, nullptr, 0, &_speechNum, 6 },
{ "AMPLIFIER", "INSTRUMENTS", 4, nullptr, 0, &_speechNum, 8 },
{ nullptr, "INSTRUMENTS", 4, nullptr, 0, &_speechNum, 9 },
{ nullptr, "TOUR BUS", 4, nullptr, 0, &_speechNum, 3 },
{ nullptr, nullptr, -1, nullptr, 0, nullptr, 0 }
};
const seriesPlayBreak Room407::PLAY1[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY2[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY3[] = {
{ 0, 1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 2, -1, nullptr, 0, 0, -1, 0, 4, nullptr, 0 },
{ 0, 1, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY4[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY5[] = {
{ 0, -1, "145_004", 2, 255, -1, 1, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY6[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY7[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY8[] = {
{ 0, -1, "407r901", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY9[] = {
{ 0, -1, "407r903", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY10[] = {
{ 0, -1, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY11[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, -1, "407r904x", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY12[] = {
{ 0, 6, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY13[] = {
{ 7, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY14[] = {
{ 0, -1, "407r904y", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY15[] = {
{ 0, 3, "407v901", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY16[] = {
{ 5, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY17[] = {
{ 1, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room407::PLAY18[] = {
{ 0, 1, "999_003", 1, 255, -1, 0, 0, nullptr, 0 },
{ 2, 9, nullptr, 0, 0, 7, 0, 0, nullptr, 0 },
{ 10, 11, "999_003", 1, 255, -1, 0, 0, nullptr, 0 },
{ 12, -1, nullptr, 0, 0, 9, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
int32 Room407::_speechNum;
Room407::Room407() : Section4Room() {
_speechNum = 0;
}
void Room407::init() {
digi_preload("400_001");
digi_play_loop("400_001", 3, 125, -1);
pal_cycle_init(112, 127, 6);
if (!_G(flags)[V181] && _G(flags)[V171] == 4003) {
_G(flags)[kDisableFootsteps] = 1;
player_set_commands_allowed(false);
}
_flag1 = false;
if (_G(flags)[V181]) {
hotspot_set_active("DRUMZ", false);
hotspot_set_active("VIPE", false);
hotspot_set_active("ROXY", false);
} else {
loadSeries();
_walk1 = intr_add_no_walk_rect(140, 295, 240, 325, 139, 326);
_drumzShould = 10;
kernel_trigger_dispatch_now(kCHANGE_DRUMZ_ANIMATION);
_roxyShould = 22;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
if (_G(flags)[V171] == 4003)
_vp02.show("407vp02", 0x300);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
break;
case 402:
ws_demand_location(43, 302);
poofArrive();
break;
case 405:
ws_demand_location(578, 296);
poofArrive();
break;
default:
ws_demand_location(520, 330, 9);
break;
}
}
void Room407::daemon() {
switch (_G(kernel).trigger) {
case 1:
poof(2);
break;
case 2:
disable_player_commands_and_fade_init(_val1);
break;
case 3:
_G(walker).wilbur_poof();
if (!_G(flags)[V181] && _G(flags)[V171] == 4003) {
ws_unhide_walker();
} else {
enable_player();
}
break;
case kWILBUR_SPEECH:
switch (_speechNum) {
case 3:
wilbur_speech("400w001");
break;
case 4:
wilbur_speech("407w004");
break;
case 5:
wilbur_speech("407w005");
break;
case 6:
wilbur_speech("407w006");
break;
case 7:
wilbur_speech("407w008");
break;
case 8:
wilbur_speech("407w011");
break;
case 9:
wilbur_speech("407w012");
break;
default:
break;
}
break;
case 5:
_drumzShould = 17;
if (_roxyState) {
kernel_timing_trigger(120, 7);
} else {
const int rnd = imath_ranged_rand(1, 25);
if (rnd >= 16)
_digiName = "407r902a";
else
_digiName = Common::String::format("407r902%c", 'a' + rnd);
_flag1 = true;
digi_preload(_digiName);
digi_play(_digiName.c_str(), 2, 180, 6);
}
break;
case 6:
digi_unload(_digiName);
kernel_trigger_dispatch_now(7);
break;
case kCHANGE_DRUMZ_ANIMATION:
switch (_drumzShould) {
case 10:
if (!digi_play_state(2))
digi_play_loop("407_001", 2);
_drumzShould = getDrumzShould();
series_play_with_breaks(PLAY1, "407dz01", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 11:
_drumzShould = 14;
series_play_with_breaks(PLAY2, "407dz02", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 12:
_drumzShould = 14;
series_play_with_breaks(PLAY3, "407dz03", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 13:
digi_stop(2);
_drumzShould = 14;
series_play_with_breaks(PLAY4, "407dz04", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 14:
_drumzShould = getDrumzShould();
kernel_trigger_dispatch_now(kCHANGE_DRUMZ_ANIMATION);
kernel_trigger_dispatch_now(10001);
break;
case 15:
digi_stop(2);
_drumzShould = getDrumzShould();
series_play_with_breaks(PLAY5, "407dz05", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 16:
digi_stop(2);
_dzS1 = series_load("407dz06");
_dzS2 = series_load("407dz06s");
_dz.play("407dz06", 0xa01, 18, -1, 6, 0, 100, 0, 0, 2, 7);
kernel_trigger_dispatch_now(5);
break;
case 17:
_flag1 = false;
freeDz();
_drumzShould = getDrumzShould();
series_play_with_breaks(PLAY6, "407dz06", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 18:
_flag1 = false;
freeDz();
_drumzShould = 19;
series_play_with_breaks(PLAY6, "407dz06", 0xa01, kCHANGE_DRUMZ_ANIMATION, 3);
break;
case 19:
if (!digi_play_state(2))
digi_play_loop("407_001", 2);
conv88();
kernel_trigger_dispatch_now(kCHANGE_DRUMZ_ANIMATION);
break;
case 20:
digi_stop(2);
_dz.play("407dz02", 0xa01, 16, -1, 6, 0, 100, 0, 0, 0, 2);
break;
case 21:
_dz.terminate();
hotspot_set_active("DRUMZ", false);
intr_remove_no_walk_rect(_walk1);
break;
default:
break;
}
break;
case kCHANGE_ROXY_ANIMATION:
switch (_roxyShould) {
case 22:
_roxyState = 0;
_rx = series_show("407rx02", 0x901);
break;
case 23:
terminateMachineAndNull(_rx);
switch (_roxyState) {
case 1:
_roxyShould = 26;
break;
case 2:
_roxyShould = 24;
break;
case 3:
_roxyShould = 27;
break;
default:
break;
}
series_play_with_breaks(PLAY7, "407rx02", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 24:
_rx = series_show("407rx02", 0x901, 0, -1, -1, 4);
kernel_trigger_dispatch_now(10);
break;
case 25:
terminateMachineAndNull(_rx);
_rx = series_show("407rx02", 0x901, 0, -1, -1, 4);
conv_resume_curr();
break;
case 26:
terminateMachineAndNull(_rx);
_roxyShould = 30;
series_play_with_breaks(PLAY9, "407rx04", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 27:
_roxyShould = 28;
series_play_with_breaks(PLAY8, "407rx04", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 28:
_roxyShould = 29;
series_play_with_breaks(PLAY10, "407rx02", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 29:
_roxyShould = 22;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
player_set_commands_allowed(true);
break;
case 30:
_roxyShould = 31;
series_play_with_breaks(PLAY11, "407rx06", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 31:
_vipeShould = 36;
kernel_trigger_dispatch_now(kCHANGE_VIPE_ANIMATION);
_roxyShould = 32;
series_play_with_breaks(PLAY12, "407rx08", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 32:
_roxyShould = 33;
series_play_with_breaks(PLAY13, "407rx08", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 33:
_roxyShould = 34;
series_play_with_breaks(PLAY14, "407rx09", 0x901, kCHANGE_ROXY_ANIMATION, 2);
break;
case 34:
kernel_trigger_dispatch_now(14);
terminateMachineAndNull(_rx);
_rx = series_show("407rx09", 0x901);
break;
default:
break;
}
break;
case kCHANGE_VIPE_ANIMATION:
switch (_vipeShould) {
case 35:
_vp02.show("407vp02", 0x300);
_roxyState = 1;
_roxyShould = 23;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
break;
case 36:
_vp02.terminate();
_vipeShould = 37;
series_play_with_breaks(PLAY16, "407vp02", 0x300, kCHANGE_VIPE_ANIMATION, 3);
break;
case 37:
_vipeShould = 39;
series_play_with_breaks(PLAY17, "407vp03", 0x300, kCHANGE_VIPE_ANIMATION, 3);
break;
case 38:
_vp02.terminate();
_drumzShould = 20;
_vipeShould = 35;
series_play_with_breaks(PLAY15, "407vp02", 0x300, kCHANGE_VIPE_ANIMATION, 3);
player_set_facing_at(412, 336);
break;
case 39:
_vp02.show("407vp05", 0x300);
break;
case 40:
terminateMachineAndNull(_rx);
_vp02.terminate();
hotspot_set_active("ROXY", false);
break;
default:
break;
}
break;
case 10:
_G(flags)[kDisableFootsteps] = 1;
_G(flags)[V299] = 1;
conv_load_and_prepare("conv87", 12);
conv_export_pointer_curr(&_G(flags)[V180], 0);
conv_play_curr();
break;
case 11:
_G(flags)[kDisableFootsteps] = 1;
_G(flags)[V299] = 1;
player_set_commands_allowed(false);
conv_load_and_prepare("conv88", 13);
conv_play_curr();
break;
case 12:
_G(flags)[kDisableFootsteps] = 0;
_G(flags)[V299] = 0;
_G(flags)[V180] = 1;
terminateMachineAndNull(_rx);
_roxyShould = 28;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
break;
case 13:
_G(flags)[kDisableFootsteps] = 0;
_G(flags)[V299] = 0;
player_set_commands_allowed(true);
break;
case 14:
_G(flags)[kDisableFootsteps] = 0;
_drumzShould = 21;
_vipeShould = 40;
series_play_with_breaks(PLAY18, "407poof", 0x2ff, 4008, 2);
_G(flags)[V181] = 1;
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(false);
if (_flag1) {
digi_stop(2);
_drumzShould = 17;
kernel_trigger_dispatch_now(kCHANGE_DRUMZ_ANIMATION);
}
_roxyState = 3;
_roxyShould = 20;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
break;
case 2:
player_set_commands_allowed(false);
if (_flag1) {
digi_stop(2);
_drumzShould = 17;
kernel_trigger_dispatch_now(kCHANGE_DRUMZ_ANIMATION);
}
_roxyState = 2;
_roxyShould = 23;
kernel_trigger_dispatch_now(kCHANGE_ROXY_ANIMATION);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case kSET_COMMANDS_ALLOWED:
if (!_G(flags)[V181] && _G(flags)[V171] == 4003) {
_vipeShould = 38;
kernel_timing_trigger(60, kCHANGE_VIPE_ANIMATION);
} else {
player_set_commands_allowed(true);
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room407::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (!_G(flags)[kDrumzFled] && _G(player).walk_x >= 140 && _G(player).walk_x <= 240 &&
_G(player).walk_y >= 295 && _G(player).walk_y <= 325)
player_walk_to(139, 326);
if (player_said("FORCE FIELD")) {
player_set_facing_hotspot();
} else if (player_said("GEAR", "DISC")) {
_val1 = 4007;
player_hotspot_walk_override(43, 302, -1, 1);
_G(player).command_ready = false;
} else if (player_said("GEAR", "DISC ")) {
_val1 = 4007;
player_hotspot_walk_override(578, 296, -1, 1);
_G(player).command_ready = false;
}
}
void Room407::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("conv87")) {
conv87();
} else if (player_said("conv88")) {
conv88();
} else if (!_G(walker).wilbur_match(MATCH)) {
return;
}
_G(player).command_ready = false;
}
void Room407::loadSeries() {
static const char *NAMES[16] = {
"407dz01", "407dz01s", "407dz02", "407dz02s", "407dz05",
"407dz05s", "407dz06", "407dz06s", "407rx04",
"407vp03", "407vp03s", "407vp05", "407vp05s", "407rx06",
"407rx08", "407rx09"
};
for (int i = 0; i < (_G(flags)[V171] == 4003 ? 16 : 9); ++i)
series_load(NAMES[i]);
digi_preload("407_001");
digi_preload("145_004");
}
void Room407::conv87() {
const char *sound = conv_sound_to_play();
const int who = conv_whos_talking();
if (sound) {
if (who == 1)
wilbur_speech(sound, 10001);
else
playConvSound();
}
}
void Room407::conv88() {
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 if (_flag1) {
_drumzShould = 18;
} else if (node == 1) {
switch (entry) {
case 0:
case 2:
case 4:
_drumzShould = 13;
break;
case 1:
_drumzShould = 12;
break;
case 3:
case 5:
_drumzShould = 11;
break;
case 6:
_drumzShould = 10;
conv_resume_curr();
break;
default:
break;
}
}
}
}
int Room407::getDrumzShould() const {
switch (imath_ranged_rand(1, 10)) {
case 1:
return 15;
case 2:
return 16;
default:
return 10;
}
}
void Room407::freeDz() {
_dz.terminate();
series_unload(_dzS1);
series_unload(_dzS2);
}
void Room407::playConvSound() {
terminateMachineAndNull(_rx);
_roxyShould = 25;
digi_play(conv_sound_to_play(), 1, 255, kCHANGE_ROXY_ANIMATION);
_rx = series_play("407rx04", 0x901, 4, -1, 6, -1);
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION4_ROOM407_H
#define M4_BURGER_ROOMS_SECTION4_ROOM407_H
#include "m4/burger/rooms/section4/section4_room.h"
#include "m4/burger/walker.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room407 : public Section4Room {
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 int32 _speechNum;
Series _vp02;
Series _dz;
int _dzS1 = 0, _dzS2 = 0;
machine *_rx = nullptr;
noWalkRect *_walk1 = nullptr;
Common::String _digiName;
bool _flag1 = false;
int _val1 = 0;
int _drumzShould = 0;
int _roxyShould = 0;
int _roxyState = 0;
int _vipeShould = 0;
//int _digiTrigger = 0;
void loadSeries();
void conv87();
void conv88();
int getDrumzShould() const;
void freeDz();
void playConvSound();
public:
Room407();
~Room407() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,261 @@
/* 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/section4/section4.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Section4::PARSER[] = {
"DEED",
"TAKE",
nullptr,
"WILBUR",
"400w001",
nullptr,
nullptr,
PARSER_ITEM_END,
"JAWZ O' LIFE",
"TAKE",
nullptr,
"BARRED WINDOW",
"404w102",
"BARRED WINDOW ",
"404w102",
"WILBUR",
"400w001",
nullptr,
nullptr,
PARSER_ITEM_END,
"FISH",
"LOOK AT",
"400w100",
"TAKE",
nullptr,
"MUFFIN",
"405w101",
"WILBUR",
"400w101",
nullptr,
"400w102",
PARSER_ITEM_END,
"DOG COLLAR",
"LOOK AT",
"400w103",
"TAKE",
nullptr,
"PEGLEG ",
"406w101",
"WILBUR",
"400w104",
nullptr,
"400W105",
PARSER_ITEM_END,
"HOOK",
"LOOK AT",
"400w106",
"TAKE",
nullptr,
"WILBUR",
"400w001",
nullptr,
"400w107",
PARSER_ITEM_END,
"RECORDS",
"LOOK AT",
"400w108",
"TAKE",
nullptr,
"WILBUR",
"400w001",
nullptr,
"400w109",
PARSER_ITEM_END,
"QUARTER",
"LOOK AT",
"400w110",
"TAKE",
nullptr,
"WILBUR",
"400w001",
nullptr,
"400w111",
PARSER_ITEM_END,
"DISC",
"LOOK AT",
"400w002",
"TAKE",
"400w003",
nullptr,
"400w004",
PARSER_ITEM_END,
"DISC ",
"LOOK AT",
"400w002",
"TAKE",
"400w003",
nullptr,
"400w004",
PARSER_ITEM_END,
nullptr
};
const Section4::TeleportEntry Section4::TELEPORTS[] = {
{ 402, 407, 406 },
{ 405, 407, 406 },
{ 406, 402, 405 },
{ 407, 402, 405 },
{ 0, 0, 0 }
};
Section4::Section4() : Rooms::Section() {
add(401, &_room401);
add(402, &_room402);
add(404, &_room404);
add(405, &_room405);
add(406, &_room406);
add(407, &_room407);
}
void Section4::init() {
if (_G(executing) != WHOLE_GAME) {
inv_give_to_player("JAWZ O' LIFE");
inv_give_to_player("DEED");
}
}
void Section4::daemon() {
switch (_G(kernel).trigger) {
case 4001:
_G(game).setRoom(401);
break;
case 4002:
_G(game).setRoom(402);
break;
case 4003:
_G(game).setRoom(404);
break;
case 4004:
_G(game).setRoom(405);
break;
case 4005:
_G(game).setRoom(406);
break;
case 4006:
_G(game).setRoom(407);
break;
case 4007:
term_message("Teleporting...");
term_message(teleport() ? "...scuccessful" : "ERROR while teleporting!");
break;
case 4008:
player_set_commands_allowed(!checkOrderWindow());
break;
case kCHANGE_WILBUR_ANIMATION:
if (_G(wilbur_should) == 10015) {
kernel_trigger_dispatch_now(10027);
} else {
_G(kernel).continue_handling_trigger = true;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Section4::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (_G(walker).wilbur_parser(PARSER))
_G(player).command_ready = false;
}
void Section4::poof(int trigger) {
player_set_commands_allowed(false);
digi_preload("999_003");
player_update_info();
if (_G(my_walker) && _G(player).walker_in_this_scene && _G(player).walker_visible) {
ws_hide_walker();
series_play("999poof", _G(player_info).depth, 0, trigger, 6, 0,
_G(player_info).scale, _G(player_info).x, _G(player_info).y);
} else {
kernel_timing_trigger(120, trigger);
}
digi_play("999_003", 2);
if (!_G(flags)[V154] || imath_rand_bool(8)) {
digi_preload("402w005z");
digi_play("402w005z", 1);
_G(flags)[V154] = 1;
}
}
bool Section4::checkOrderWindow() {
if (_G(flags)[V168] && _G(flags)[V181] && _G(flags)[V176] && _G(flags)[V159]) {
player_set_commands_allowed(false);
_G(flags)[kFifthTestPassed] = 1;
disable_player_commands_and_fade_init(k10027);
return true;
}
return false;
}
bool Section4::teleport() {
const TeleportEntry *te;
for (te = TELEPORTS; te->_room && te->_room != _G(game).room_id; ++te) {
}
if (te->_room) {
if (player_said("DISC")) {
_G(game).setRoom(te->_newRoom1);
term_message("...%d...", te->_newRoom1);
return true;
}
if (player_said("DISC ")) {
_G(game).setRoom(te->_newRoom2);
term_message("...%d...", te->_newRoom2);
return true;
}
}
return false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,75 @@
/* 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_SECTION4_H
#define M4_BURGER_ROOMS_SECTION4_H
#include "m4/burger/rooms/room.h"
#include "m4/burger/rooms/section.h"
#include "m4/burger/rooms/section4/room401.h"
#include "m4/burger/rooms/section4/room402.h"
#include "m4/burger/rooms/section4/room404.h"
#include "m4/burger/rooms/section4/room405.h"
#include "m4/burger/rooms/section4/room406.h"
#include "m4/burger/rooms/section4/room407.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section4 : public Rooms::Section {
struct TeleportEntry {
int _room;
int _newRoom1;
int _newRoom2;
};
private:
static const char *PARSER[];
static const TeleportEntry TELEPORTS[];
private:
Room401 _room401;
Room402 _room402;
Room404 _room404;
Room405 _room405;
Room406 _room406;
Room407 _room407;
bool teleport();
public:
static void poof(int trigger);
static bool checkOrderWindow();
public:
Section4();
virtual ~Section4() {}
void init() override;
void daemon() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,48 @@
/* 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/section4/section4_room.h"
#include "m4/burger/rooms/section4/section4.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
void Section4Room::poofArrive(int ticks) {
player_set_commands_allowed(false);
player_update_info();
_G(player_dest_x) = _G(player_info).x;
_G(player_dest_y) = _G(player_info).y;
ws_demand_location(-100, _G(player_dest_y));
ws_unhide_walker();
kernel_timing_trigger(ticks, kPOOF);
}
void Section4Room::poof(int trigger) {
Section4::poof(trigger);
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION4_ROOM_H
#define M4_BURGER_ROOMS_SECTION4_ROOM_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section4Room : public Room {
protected:
void poofArrive(int ticks = 120);
void poof(int trigger);
public:
Section4Room() : Room() {}
~Section4Room() override {}
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,93 @@
/* 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/section5/room501.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
static const seriesStreamBreak SERIES1[] = {
{ 0, "501_013", 3, 60, -1, (uint32)-1, nullptr, 0 },
{ 5, "501_010", 2, 255, -1, 0, nullptr, 0 },
{ 15, "501_011", 2, 255, -1, 0, nullptr, 0 },
{ 38, "501z001", 1, 255, -1, 0, nullptr, 0 },
{ 61, "501z002", 1, 255, -1, 0, nullptr, 0 },
{ 109, "501_001", 2, 255, -1, 0, nullptr, 0 },
{ 127, "501_002", 2, 255, -1, 0, nullptr, 0 },
{ 135, "501_003", 2, 255, -1, 0, nullptr, 0 },
{ 142, "501_004", 2, 255, -1, 0, nullptr, 0 },
{ 153, "501_005", 2, 255, -1, 0, nullptr, 0 },
{ 175, "501z003", 1, 255, -1, 0, nullptr, 0 },
{ 195, "501w001", 1, 255, -1, 0, nullptr, 0 },
{ 229, "501z004", 1, 255, -1, 0, nullptr, 0 },
{ 278, "501_006", 2, 255, -1, 0, nullptr, 0 },
{ 286, "501_007", 2, 255, -1, 0, nullptr, 0 },
{ 305, "501_008", 2, 255, -1, 0, nullptr, 0 },
{ 336, "501p001", 1, 255, -1, 0, nullptr, 0 },
{ 340, "501z005", 2, 255, -1, 0, nullptr, 0 },
{ 387, "501_014", 2, 125, -1, 0, nullptr, 0 },
{ 391, "501p002", 1, 255, -1, 0, nullptr, 0 },
{ 409, "501z006", 1, 255, -1, 0, nullptr, 0 },
{ 424, "501p003", 1, 255, -1, 0, nullptr, 0 },
{ 452, "501_009", 2, 255, -1, 0, nullptr, 0 },
{ 465, "501p004", 1, 255, -1, 0, nullptr, 0 },
{ 506, "501w002", 1, 255, -1, 0, nullptr, 0 },
{ 530, "501p005", 1, 255, -1, 0, nullptr, 0 },
{ 541, "501p006", 1, 255, -1, 0, nullptr, 0 },
{ 584, "501z007", 1, 255, -1, 0, nullptr, 0 },
{ 656, "501p007", 1, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room501::preload() {
_G(player).walker_in_this_scene = false;
}
void Room501::init() {
g_vars->_flags.reset4();
kernel_trigger_dispatch_now(1);
}
void Room501::daemon() {
switch (_G(kernel).trigger) {
case 1:
digi_preload_stream_breaks(SERIES1);
pal_mirror_colours(118, 122);
pal_cycle_init(118, 127, 6, -1, -1);
series_stream_with_breaks(SERIES1, "501intro", 6, 0x100, 5006);
break;
case 5006:
_G(game).setRoom(502);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View 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_SECTION5_ROOM501_H
#define M4_BURGER_ROOMS_SECTION5_ROOM501_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room501 : public Section5Room {
public:
Room501() : Section5Room() {}
~Room501() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,973 @@
/* 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/section5/room502.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum {
kCHANGE_PURPLE_BORK_ANIMATION = 10
};
enum {
kBORK_ON_FAN = 5000,
kBORK_SLIDING_DOWN = 5001,
kBORK_CLIMBING_STAIRS = 5002
};
const Section5Room::BorkPoint Room502::BORK_TABLE[] = {
{ 386, 44 }, { 368, 62 }, { 343, 80 }, { 314, 109 }, { 298, 123 },
{ 279, 143 }, { 255, 166 }, { 255, 166 }, { 252, 166 }, { 249, 168 },
{ 252, 168 }, { 256, 168 }, { 254, 168 }, { 250, 167 }, { 248, 164 },
{ 254, 160 }, { 252, 158 }, { 252, 158 }, { 252, 158 }, { 252, 158 },
{ 252, 158 }, { 256, 160 }, { 256, 160 }, { 252, 160 }, { 232, 163 },
{ 232, 169 }, { 218, 169 }, { 206, 172 }, { 201, 184 }, { 198, 212 },
{ 194, 231 }, { 194, 231 }, { 194, 217 }, { 200, 201 }, { 228, 183 },
{ 244, 181 }, { 258, 176 }, { 276, 173 }, { 295, 141 }, { 309, 136 },
{ 328, 113 }, { 346, 103 }, { 353, 80 }, { 354, 58 }, { 364, 53 }
};
static const char *SAID[][4] = {
{ "FRONT DOOR", "502w003", "500w001", "502w057" },
{ "KITCHEN", nullptr, "500w001", nullptr },
{ "STAIRS", "502w007", "500w001", nullptr },
{ "BORK", "502w009", "500w002", "500w002" },
{ "BORK ", "502w011", "500w002", "500w002" },
{ "CHARRED OUTLINE", "502w012", "502w013", "500w001" },
{ "RAILING", "502w014", nullptr, "502w016" },
{ "KINDLING ", "502w018", nullptr, "502w021" },
{ "FIREPLACE", "502w023", "500w001", "502w022" },
{ "WINDOW", "500w003", "500w001", "500w004" },
{ "CHANDELIER", "502w027", "502w028", "502w028" },
{ "WIRES", "502w029", "502w030", "502w030" },
{ "WIRES ", "502w031", "502w030", "502w030" },
{ "PHONE JACK", "502w032", nullptr, "502w032" },
{ "ARMCHAIR", "502w034", nullptr, "502w035" },
{ "ROCKER", "502w036", nullptr, "502w035" },
{ "LAMP", "502w038", "502w039", "502w039" },
{ "PIANO", "502w040", "502w041", "502w042" },
{ "SHEET MUSIC", "502w043", "502w044", "502w045" },
{ "BOOKS", "502w046", "502w047", "502w047" },
{ "BOOK", "502w048", "502w049", "502w047" },
{ "PICTURE", "502w050", "500w005", "502w051" },
{ "PICTURE ", "502w052", "500w005", "502w051" },
{ "PAINTING", "502w053", "502w054", "502w051" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesStreamBreak Room502::SERIES1[] = {
{ 14, "502Z001", 1, 255, -1, 0, nullptr, 0 },
{ 71, "502Z002", 1, 255, -1, 0, nullptr, 0 },
{ 92, "502Z003", 1, 255, -1, 0, nullptr, 0 },
{ 124, "502Z004", 1, 255, -1, 0, nullptr, 0 },
{ 155, "502f001", 1, 255, -1, 0, nullptr, 0 },
{ 162, "502f002", 1, 255, -1, 0, nullptr, 0 },
{ 201, nullptr, 0, 0, 20, 0, nullptr, 0 },
{ 210, "502i001", 1, 255, -1, 0, nullptr, 0 },
{ 243, "502i002", 1, 255, -1, 0, nullptr, 0 },
{ 258, "502Z005", 1, 255, -1, 0, nullptr, 0 },
{ 289, "502i003", 1, 255, -1, 0, nullptr, 0 },
{ 310, "502Z006", 1, 255, -1, 0, nullptr, 0 },
{ 334, "502Z007", 1, 255, -1, 0, nullptr, 0 },
{ 407, "502_005", 2, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesStreamBreak Room502::SERIES2[] = {
{ 44, "502_005", 2, 255, -1, 0, nullptr, 0 },
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
const seriesPlayBreak Room502::PLAY1[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, 6, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 7, 12, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 13, 18, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 19, 22, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 23, 27, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 28, 32, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 33, 39, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 40, -1, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY2[] = {
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 1, 6, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 7, 12, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 13, 17, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 18, 22, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 24, 29, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 30, 35, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 36, 40, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 41, -1, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY3[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, 6, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 7, 12, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 13, 16, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY4[] = {
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 1, 6, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 7, 12, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 13, 17, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 18, 22, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 24, 27, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY5[] = {
{ 48, 42, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY6[] = {
{ 0, 14, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 15, 15, "502_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 16, -1, nullptr, 0, 0, 17, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY7[] = {
{ 5, 14, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 15, 15, "502_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 16, -1, nullptr, 0, 0, 17, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY8[] = {
{ 28, 29, 0, 0, 0, -1, 0, 0, nullptr, 0 },
{ 30, 35, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
{ 36, 40, "502_008a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 41, -1, "502_008b", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY9[] = {
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 5, -1, "502_003", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY10[] = {
{ 0, 21, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 22, -1, nullptr, 0, 0, 19, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY11[] = {
{ 0, 15, "502b005a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 15, "502b005b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 0, 15, "502b005c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 0, 15, "502b005d", 2, 255, -1, 0, 0, &_state1, 4 },
{ 0, 15, "502b005e", 2, 255, -1, 0, 0, &_state1, 5 },
{ 0, 15, "502b005f", 2, 255, -1, 0, 0, &_state1, 6 },
{ 0, 15, "502b005g", 2, 255, -1, 0, 0, &_state1, 7 },
{ 0, 15, "502b005h", 2, 255, -1, 0, 0, &_state1, 8 },
{ 0, 15, "502b005i", 2, 255, -1, 0, 0, &_state1, 9 },
{ 16, -1, "502b005a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 16, -1, "502b005b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 16, -1, "502b005c", 2, 255, -1, 0, 0, &_state2, 3 },
{ 16, -1, "502b005d", 2, 255, -1, 0, 0, &_state2, 4 },
{ 16, -1, "502b005e", 2, 255, -1, 0, 0, &_state2, 5 },
{ 16, -1, "502b005f", 2, 255, -1, 0, 0, &_state2, 6 },
{ 16, -1, "502b005g", 2, 255, -1, 0, 0, &_state2, 7 },
{ 16, -1, "502b005h", 2, 255, -1, 0, 0, &_state2, 8 },
{ 16, -1, "502b005i", 2, 255, -1, 0, 0, &_state2, 9 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY12[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, 4, "502_002", 2, 255, -1, 0, 3, nullptr, 0 },
{ 5, 9, "502b008a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 5, 9, "502b008b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 5, 9, "502b008c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 5, 9, "502b008d", 2, 255, -1, 0, 0, &_state1, 4 },
{ 5, 9, "502b008e", 2, 255, -1, 0, 0, &_state1, 5 },
{ 9, 9, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY13[] = {
{ 0, 9, "502b007a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 9, "502b007b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 3, 0, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY14[] = {
{ 0, 13, "502b006a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 13, "502b006b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 0, 13, "502b006c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 14, 14, nullptr, 0, 0, 16, 0, 0, &_state4, 3 },
{ 14, 17, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 18, -1, nullptr, 0, 0, 7, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY15[] = {
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, 3, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 1, 1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY16[] = {
{ 0, 10, "502_007", 1, 255, -1, 0, 0, nullptr, 0 },
{ 11, 11, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 12, -1, "500_003", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room502::PLAY17[] = {
{ 1, -1, "500_008", 2, 255, -1, 4, 0, &_state3, 1 },
{ 1, -1, "500_009", 2, 255, -1, 4, 0, &_state3, 2 },
{ 1, -1, "500_010", 2, 255, -1, 4, 0, &_state3, 3 },
{ 1, -1, "500_011", 2, 255, -1, 4, 0, &_state3, 4 },
{ 1, -1, "500_012", 2, 255, -1, 4, 0, &_state3, 5 },
{ 1, -1, "500_013", 2, 255, -1, 4, 0, &_state3, 6 },
PLAY_BREAK_END
};
int32 Room502::_state1;
int32 Room502::_state2;
int32 Room502::_state3;
int32 Room502::_state4;
Room502::Room502() : Section5Room() {
_state1 = 0;
_state2 = 0;
_state3 = 0;
_state4 = 0;
}
void Room502::init() {
_G(flags)[V194] = 0;
Section5Room::init();
pal_cycle_init(124, 127, 12);
loadSeries1();
player_set_commands_allowed(false);
_G(flags)[V246] = 0;
bool skip = false;
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 503:
ws_demand_location(620, 311, 9);
ws_walk(304, 308, nullptr, -1, -1);
player_set_commands_allowed(true);
kernel_trigger_dispatch_now(24);
break;
case 505:
ws_demand_location(237, 235, 9);
ws_hide_walker();
_G(wilbur_should) = _G(flags)[V196] ? 6 : 4;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 506:
ws_demand_location(402, 272, 1);
_G(wilbur_should) = 12;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 510:
ws_demand_location(_G(flags)[V187], _G(flags)[V188], _G(flags)[V189]);
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
default:
ws_demand_location(304, 308, 9);
ws_hide_walker();
kernel_trigger_dispatch_now(5);
skip = true;
break;
}
if (!skip) {
setup1();
setup2();
setup3();
}
series_show("502logs", 0xc00);
if (_G(flags)[kFireplaceHasFire])
kernel_trigger_dispatch_now(19);
_flag1 = true;
Section5Room::init();
}
void Room502::daemon() {
switch (_G(kernel).trigger) {
case 1:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, _destTrigger);
break;
case 5:
loadSeries3();
loadSeries2();
_series1.show("502bk01", 0x400);
_series2 = series_show("502spark", 0xc00);
if (_G(flags)[V185]) {
kernel_trigger_dispatch_now(20);
digi_preload_stream_breaks(SERIES2);
series_stream_with_breaks(SERIES2, "502end", 6, 0x100, 6);
} else {
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "502intro", 6, 0x100, 6);
}
break;
case 6:
_series1.terminate();
terminateMachineAndNull(_series2);
setup1();
setup2();
setup3();
if (_G(flags)[V185]) {
digi_unload_stream_breaks(SERIES2);
_G(wilbur_should) = 10001;
} else {
digi_unload_stream_breaks(SERIES1);
ws_unhide_walker();
_val2 = 13;
_G(wilbur_should) = 1;
}
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 7:
ws_unhide_walker();
switch (_val2) {
case 13:
player_set_commands_allowed(true);
wilbur_speech("502w001");
break;
case 14:
player_set_commands_allowed(true);
wilbur_speech("502w002");
break;
case 15:
player_set_commands_allowed(true);
wilbur_speech("502w005");
break;
case 16:
player_set_commands_allowed(true);
wilbur_speech("502w006");
break;
case 17:
player_set_commands_allowed(true);
_G(wilbur_should) = 10001;
wilbur_speech("502w010", kCHANGE_WILBUR_ANIMATION);
break;
case 18:
player_set_commands_allowed(true);
wilbur_speech("502w025z");
break;
case 19:
_val4 = 34;
wilbur_speech("500w047", 13);
break;
default:
break;
}
break;
case 8:
if (_G(flags)[kStairsBorkState] == kBORK_SLIDING_DOWN) {
player_update_info();
if (_G(player_info).x < 242 && _G(player_info).y < 265) {
ws_walk(_G(player_info).x, _G(player_info).y, nullptr, -1);
player_set_commands_allowed(false);
kernel_trigger_dispatch_now(15);
} else {
kernel_timing_trigger(15, 8);
}
}
break;
case 9:
if (!_flag1 && !digi_play_state(1)) {
_flag1 = true;
_series1.terminate();
kernel_trigger_dispatch_now(kCHANGE_PURPLE_BORK_ANIMATION);
} else {
kernel_timing_trigger(15, 9);
}
break;
case kCHANGE_PURPLE_BORK_ANIMATION:
switch (_purpleBorkShould) {
case 20:
_flag1 = false;
_purpleBorkShould = 21;
kernel_trigger_dispatch_now(kCHANGE_PURPLE_BORK_ANIMATION);
break;
case 21:
_purpleBorkShould = imath_ranged_rand(22, 24);
kernel_timing_trigger(imath_ranged_rand(240, 360), 9);
_series1.show("502bk01", 0x400);
break;
case 22:
_state1 = imath_ranged_rand(1, 9);
_state2 = imath_ranged_rand(1, 9);
_purpleBorkShould = 20;
series_play_with_breaks(PLAY11, "502bk01", 0x400, kCHANGE_PURPLE_BORK_ANIMATION, 3);
break;
case 23:
_state1 = imath_ranged_rand(1, 5);
_purpleBorkShould = 20;
series_play_with_breaks(PLAY12, "502bk02", 0x400, kCHANGE_PURPLE_BORK_ANIMATION, 3);
break;
case 24:
_purpleBorkShould = 20;
series_play_with_breaks(PLAY15, "502bk01", 0x400, kCHANGE_PURPLE_BORK_ANIMATION, 3);
break;
case 25:
_series1.terminate();
_state1 = imath_ranged_rand(1, 2);
_purpleBorkShould = 20;
series_play_with_breaks(PLAY13, "502bk03", 0x400, kCHANGE_PURPLE_BORK_ANIMATION, 3);
break;
case 26:
_val2 = 17;
_state1 = imath_ranged_rand(1, 3);
_purpleBorkShould = 20;
series_play_with_breaks(PLAY14, "502bk04", 0x400, kCHANGE_PURPLE_BORK_ANIMATION, 3);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case 11:
if (_G(flags)[kStairsBorkState] != 5003) {
player_update_info();
if ((_G(player_info).x > 242 || _G(player_info).y > 265) &&
!_flag1 && !digi_play_state(1)) {
_flag1 = true;
loadSeries3();
_val4 = _val7;
kernel_trigger_dispatch_now(13);
} else {
kernel_timing_trigger(15, 11);
}
}
break;
case 13:
switch (_val4) {
case 20:
digi_stop(2);
digi_unload("502_006");
_flag1 = false;
_val4 = 27;
kernel_trigger_dispatch_now(13);
break;
case 27:
_G(flags)[kStairsBorkState] = kBORK_ON_FAN;
_G(flags)[V186] = 0;
_borkStairs.terminate();
_val7 = imath_rand_bool(3) ? 29 : 28;
kernel_timing_trigger(imath_ranged_rand(240, 360), 11);
break;
case 28:
_val8 = 0;
kernel_trigger_dispatch_now(14);
_G(flags)[kStairsBorkState] = kBORK_SLIDING_DOWN;
_G(flags)[V186] = 1;
kernel_trigger_dispatch_now(8);
_val4 = 32;
_borkStairs.play("502bkst", 0xc00, 16, 13, 6, 0, 100, 0, 0, 0, 8);
break;
case 29:
_val8 = 0;
kernel_trigger_dispatch_now(14);
_G(flags)[kStairsBorkState] = kBORK_SLIDING_DOWN;
_G(flags)[V186] = 1;
kernel_trigger_dispatch_now(8);
_val4 = 30;
_borkStairs.play("502bkst", 0xc00, 0, 13, 6, 0, 100, 0, 0, 0, 8);
break;
case 30:
kernel_trigger_dispatch_now(22);
_val4 = 31;
_borkStairs.play("502bkst", 0xc00, 0, 13, 6, 0, 100, 0, 0, 9, 18);
break;
case 31:
_val8 = 1;
kernel_trigger_dispatch_now(14);
_val4 = 32;
_borkStairs.play("502bkst", 0xc00, 0, 13, 6, 2, 100, 0, 0, 19, 22);
break;
case 32:
digi_stop(2);
digi_unload("502_007");
_borkStairs.terminate();
_val4 = 33;
_borkStairs.play("502bkst", 0xc00, 0, 13, 6, 0, 100, 0, 0, 23, 32);
break;
case 33:
_G(flags)[kStairsBorkState] = kBORK_CLIMBING_STAIRS;
_val4 = 20;
_borkStairs.play("502bkst", 0xc00, 0, 13, 6, 0, 100, 0, 0, 33, 44);
digi_preload("502_006");
digi_play("502_006", 2);
break;
case 34:
if (_flag1) {
kernel_timing_trigger(30, 13);
} else {
_flag1 = true;
_val8 = 2;
kernel_trigger_dispatch_now(14);
_val4 = 35;
series_play_with_breaks(PLAY16, "502bk09", 0xc00, 13, 3);
}
break;
case 35:
Section5::flagsTrigger();
_flag1 = false;
kernel_trigger_dispatch_now(18);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case 14:
switch (_val8) {
case 0:
digi_play((imath_ranged_rand(1, 2) == 1) ? "502b001a" : "502b001b", 2);
break;
case 1:
digi_play((imath_ranged_rand(1, 2) == 1) ? "502b003a" : "502b003b", 2);
break;
case 2:
digi_play("502b004", 2);
break;
default:
break;
}
break;
case 15:
_G(flags)[V206] = 5005;
kernel_trigger_dispatch_now(5015);
break;
case 16:
_G(flags)[V206] = 5006;
kernel_trigger_dispatch_now(5015);
break;
case 17:
switch (_val5) {
case 36:
series_show("502soap2", 0xaff);
break;
case 37:
_val5 = 38;
series_play("502soap1", 0xaff, 0, 17);
break;
case 38:
_val5 = 36;
series_play("502soap", 0xaff, 0, 17, 6, 4);
break;
default:
break;
}
break;
case 18:
series_show("502windo", 0xf00);
break;
case 19:
_G(flags)[kFireplaceHasFire] = 1;
digi_play_loop("500_002", 3, 125);
series_play("502fire", 0xc00, 4, -1, 6, -1);
break;
case 20:
inv_give_to_player("GIZMO");
break;
case 21:
if ((_G(flags)[kStairsBorkState] == 5000 || _G(flags)[kStairsBorkState] == 5003) &&
!_flag1 && !digi_play_state(1)) {
_flag1 = true;
kernel_trigger_dispatch_now(22);
}
kernel_timing_trigger(imath_ranged_rand(240, 360), 21);
break;
case 22:
terminateMachineAndNull(_series2);
_state3 = imath_ranged_rand(1, 6);
series_play_with_breaks(PLAY17, "502spark", 0xc00, 23, 2);
break;
case 23:
if (_G(flags)[kStairsBorkState] == 5000 || _G(flags)[kStairsBorkState] == 5003)
_flag1 = false;
_series2 = series_show("502spark", 0xc00);
break;
case 24:
series_play("502smoke", 0x500);
break;
case 5002:
enable_player();
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
kernel_trigger_dispatch_now(7);
break;
case 2:
_G(flags)[V195] = 1;
break;
case 3:
ws_demand_location(237, 235);
player_set_commands_allowed(false);
ws_hide_walker();
_destTrigger = 5009;
series_play_with_breaks(PLAY1, "502wi02", 0xc01, 1, 3, 5);
break;
case 4:
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY2, "502wi03", 0xc01, kCHANGE_WILBUR_ANIMATION, 3, 5);
break;
case 5:
player_set_commands_allowed(false);
series_load("502wi02");
series_load("502wi03");
series_load("502wi05");
series_load("502bk09");
ws_demand_location(237, 235, 9);
ws_hide_walker();
_G(wilbur_should) = 8;
series_play_with_breaks(PLAY3, "502wi02", 0xc01, kCHANGE_WILBUR_ANIMATION, 3, 5);
break;
case 6:
_G(wilbur_should) = 7;
series_play_with_breaks(PLAY4, "502wi03", 0xc01, kCHANGE_WILBUR_ANIMATION, 3, 5);
break;
case 7:
_G(wilbur_should) = 8;
series_play_with_breaks(PLAY5, "502wi05", 0xc01, kCHANGE_WILBUR_ANIMATION, 2, 5);
break;
case 8:
_val5 = 37;
_G(wilbur_should) = 9;
if (_G(flags)[V196]) {
series_play_with_breaks(PLAY7, "502wi05", 0xc01, kCHANGE_WILBUR_ANIMATION, 2);
} else {
series_play_with_breaks(PLAY6, "502wi05", 0xc01, kCHANGE_WILBUR_ANIMATION, 2);
}
_G(flags)[V196] = 0;
break;
case 9:
if (_G(flags)[kStairsBorkState] == 5003) {
_G(wilbur_should) = 10001;
} else {
_G(flags)[kStairsBorkState] = 5003;
_val2 = 19;
_G(wilbur_should) = 1;
}
inv_move_object("SOAPY WATER", NOWHERE);
inv_give_to_player("BOTTLE");
series_play_with_breaks(PLAY8, "502wi03", 0xc01, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 10:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 11;
series_play_with_breaks(PLAY9, "502wi06", 0x801, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 11:
inv_give_to_player("KINDLING");
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 12:
player_set_commands_allowed(false);
ws_hide_walker();
_val2 = 18;
_G(wilbur_should) = 1;
series_play_with_breaks(PLAY10, "502wi07", 0xbff, kCHANGE_WILBUR_ANIMATION, 3);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room502::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("KITCHEN") && !player_said_any("LOOK AT", "GEAR"))
player_set_facing_hotspot();
}
void Room502::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
const bool railing = player_said("RAILING") && _G(flags)[kStairsBorkState] == 5003;
const bool takeKindling = player_said("KINDLING ") && player_said("TAKE");
const bool gearKindling = player_said("KINDLING ") && player_said("GEAR");
const bool fireplace = player_said("FIREPLACE") && _G(flags)[kFireplaceHasFire] != 0;
if (player_said("LOOK AT", "FRONT DOOR") && _G(flags)[V195]) {
wilbur_speech("502w004");
} else if (player_said("LOOK AT STAIRS") && _G(flags)[kStairsBorkState] == 5003) {
wilbur_speech("502w008");
} else if (railing && player_said("LOOK AT")) {
wilbur_speech("502w015");
} else if (railing && player_said("GEAR")) {
wilbur_speech("502w017");
} else if (takeKindling && inv_player_has("kindling")) {
wilbur_speech("502w019");
} else if (takeKindling && _G(flags)[kFireplaceHasFire]) {
wilbur_speech("502w020");
} else if (gearKindling && inv_player_has("KINDLING")) {
wilbur_speech("502w022");
} else if (gearKindling && _G(flags)[kFireplaceHasFire]) {
wilbur_speech("502w020");
} else if (player_said("KINDLING") && player_said("FIREPLACE")) {
wilbur_speech(_G(flags)[kFireplaceHasFire] ? "500w063" : "500w062");
} else if (player_said("KINDLING") && player_said("WIRES")) {
wilbur_speech("500w065");
} else if (fireplace && player_said("LOOK AT")) {
wilbur_speech("502w024");
} else if (fireplace && player_said("GEAR")) {
wilbur_speech("502w025");
} else if (fireplace && player_said("RUBBER DUCK")) {
wilbur_speech("502w030");
} else if (player_said("GEAR", "WINDOW") && _G(flags)[kStairsBorkState] == 5003) {
wilbur_speech("502w026");
} else if ((player_said("LOOK AT") || player_said("GEAR")) &&
player_said("PHONE JACK") && _G(flags)[V197] != 0) {
wilbur_speech("502w033");
} else if (player_said("LOOK AT", "ROCKER") && _G(flags)[V197] != 0) {
wilbur_speech("502w037");
} else if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("GEAR", "FRONT DOOR")) {
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("KITCHEN") && player_said_any("LOOK AT", "GEAR")) {
_destTrigger = 5007;
kernel_trigger_dispatch_now(1);
} else if (player_said("GEAR", "STAIRS")) {
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("BORK ") && player_said("LOOK AT") &&
!player_said_any("GIZMO", "ROLLING PIN", "DIRTY SOCK", "SOAPY WATER", "RUBBER GLOVES") &&
!player_said("LAXATIVE")) {
player_set_commands_allowed(false);
_purpleBorkShould = 26;
++_state4;
} else if (player_said("TAKE", "KINDLING ")) {
if (!_G(flags)[kFireplaceHasFire] && !inv_player_has("KINDLING")) {
_G(wilbur_should) = 10;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
} else if (player_said("SOAPY WATER", "RAILING")) {
_G(wilbur_should) = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("BURNING KINDLING", "FIREPLACE")) {
_G(wilbur_should) = 12;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
inv_move_object("BURNING KINDLING", NOWHERE);
} else {
return;
}
_G(player).command_ready = false;
}
void Room502::loadSeries1() {
static const char *NAMES[6] = {
"500_008", "500_009", "500_010", "500_011", "500_012", "500_013"
};
for (int i = 0; i < 6; ++i)
digi_preload(NAMES[i]);
series_load("502spark");
}
void Room502::loadSeries2() {
static const char *NAMES[15] = {
"502bk01", "502bk01s", "502bk02", "502bk02s", "502bk03",
"502bk03s", "502bk04", "502bk04s", "502bk05", "502bk06",
"502bk06s", "502bk07", "502bk07s", "502bk08", "502bk08s"
};
for (int i = 0; i < 15; ++i)
series_load(NAMES[i]);
}
void Room502::loadSeries3() {
series_load("502bk09");
series_load("502bk09s");
series_load("502bkst");
series_load("502bksts");
digi_preload("502b001a");
digi_preload("502b001b");
digi_preload("502b003a");
digi_preload("502b003b");
digi_preload("502b004");
}
void Room502::setup1() {
if (_G(flags)[V197]) {
series_show("502bk05", 0xd00);
series_show("502phone", 0x800);
hotspot_set_active("BORK ", false);
hotspot_set_active("CHARRED OUTLINE", true);
} else {
loadSeries2();
hotspot_set_active("BORK ", true);
hotspot_set_active("CHARRED OUTLINE", false);
_walk1 = intr_add_no_walk_rect(370, 281, 500, 310, 328, 318);
if (_G(game).previous_room == 503) {
series_show("502bk01", 0x400);
_series1.show("502bk01", 0x400);
_flag1 = true;
_purpleBorkShould = 25;
kernel_timing_trigger(120, 10);
} else {
_purpleBorkShould = 20;
kernel_trigger_dispatch_now(kCHANGE_PURPLE_BORK_ANIMATION);
}
}
}
void Room502::setup2() {
if (_G(flags)[kStairsBorkState] == 5003) {
_val5 = 36;
kernel_trigger_dispatch_now(17);
kernel_trigger_dispatch_now(18);
} else {
loadSeries3();
_borkTable = BORK_TABLE;
_val4 = _G(game).previous_room == 505 ? 33 : 27;
kernel_trigger_dispatch_now(13);
}
}
void Room502::setup3() {
if (_G(flags)[V211] == 5000) {
_series2 = series_show("502spark", 0xc00);
kernel_trigger_dispatch_now(21);
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,92 @@
/* 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_SECTION5_ROOM502_H
#define M4_BURGER_ROOMS_SECTION5_ROOM502_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room502 : public Section5Room {
private:
static const seriesStreamBreak SERIES1[];
static const seriesStreamBreak SERIES2[];
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 int32 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
private:
static const BorkPoint BORK_TABLE[];
noWalkRect *_walk1 = nullptr;
Series _series1;
machine *_series2 = nullptr;
bool _flag1 = false;
int _val2 = 0;
int _purpleBorkShould = 0;
int _val4 = 0;
int _val5 = 0;
int _destTrigger = 0;
int _val7 = 0;
int _val8 = 0;
void loadSeries1();
void loadSeries2();
void loadSeries3();
void setup1();
void setup2();
void setup3();
public:
Room502();
~Room502() override {}
void init() override;
void daemon() override;
void pre_parser() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

Some files were not shown because too many files have changed in this diff Show More