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,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

File diff suppressed because it is too large Load Diff

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/>.
*
*/
#ifndef M4_BURGER_ROOMS_SECTION5_ROOM503_H
#define M4_BURGER_ROOMS_SECTION5_ROOM503_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room503 : public Section5Room {
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[];
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 int32 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
static int32 _state5;
static int32 _state6;
int16 _array1[5];
int16 _array2[5];
int _val2 = 0;
int _val4 = 0;
int _val5 = 0;
int _val6 = 0;
int _val7 = 0;
int _val8 = 0;
int _val9 = 0;
int _val10 = 0;
bool _flag1 = false;
bool _flag2 = false;
bool _flag3 = false;
bool _flag4 = false;
bool _flag5 = false;
noWalkRect *_walk1 = nullptr;
machine *_series1 = nullptr;
Series _series2;
machine *_series3 = nullptr;
machine *_series4 = nullptr;
machine *_series5 = nullptr;
void loadSeries1();
public:
Room503();
~Room503() 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,709 @@
/* 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/room504.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room504::SAID[][4] = {
{ "STAIRS", "504w002", "500w001", nullptr },
{ "BORK", "504w007", "500w002", "500w002" },
{ "BORK GUTS", "504w009", "504w010", "504w010" },
{ "DIRTY SOCK ", "504w011", nullptr, nullptr },
{ "WRINGER", "504w013", "504w015", "504w016" },
{ "BREAKER BOX", "504w017", nullptr, "504w019" },
{ "INSIDE BREAKER", "504w020", "504w021", nullptr },
{ "OUTSIDE BREAKER","504w024", "504w021", nullptr },
{ "WASHING MACHINE","504w026", nullptr, "504w027" },
{ "PAINT CAN", "504w028", "504w029", "504w030" },
{ "HOLE", nullptr, "500w001", "500w001" },
{ "LAUNDRY HAMPER", "504w030", "504w016", "504w016" },
{ "LAUNDRY HAMPER ","504w030", "504w016", "504w016" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room504::PLAY1[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY2[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY3[] = {
{ 0, 7, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 8, 8, "504_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 9, -1, nullptr, 0, 0, 8, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY4[] = {
{ 0, 8, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 9, 9, "504_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 10, -1, nullptr, 0, 0, 8, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY5[] = {
{ 0, 5, nullptr, 0, 0, -1, 1, 0, nullptr, 0 },
{ 6, -1, nullptr, 0, 0, 10016, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY6[] = {
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 5, 5, "504_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 6, -1, nullptr, 0, 0, 9, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY7[] = {
{ 0, 6, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 7, 7, "504_001", 1, 255, -1, 0, 0, nullptr, 0 },
{ 9, -1, nullptr, 0, 0, 9, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY8[] = {
{ 0, 6, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 7, -1, nullptr, 0, 0, 10, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY9[] = {
{ 0, 30, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 31, -1, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY10[] = {
{ 0, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 13, 13, "504w004", 1, 255, -1, 0, 0, &_state1, 1 },
{ 13, 13, "504w018a", 1, 255, -1, 0, 0, &_state1, 2 },
{ 13, 13, "504w018b", 1, 255, -1, 0, 0, &_state1, 3 },
{ 13, 13, "504w018c", 1, 255, -1, 0, 0, &_state1, 4 },
{ 13, 13, "504w018d", 1, 255, -1, 0, 0, &_state1, 5 },
{ 13, 13, "504w018e", 1, 255, -1, 0, 0, &_state1, 6 },
{ 14, 14, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
{ 15, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY11[] = {
{ 0, 3, nullptr, 0, 0, 6, 0, 0, nullptr, 0 },
{ 6, 15, "504b002a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 6, 15, "504b002b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 6, 15, "504b002c", 2, 255, -1, 0, 0, &_state2, 3 },
{ 16, 17, "504_005", 3, 125, -1, 0, 0, nullptr, 0 },
{ 18, 27, "504b003", 2, 255, -1, 0, 0, nullptr, 0 },
{ 28, 30, "504_006", 3, 125, -1, 0, 0, nullptr, 0 },
{ 31, 41, "504b013a", 2, 255, -1, 1, -1, nullptr, 0 },
{ 29, 33, "504b013c", 2, 255, -1, 1, -1, nullptr, 0 },
{ 42, 47, "504_004", 3, 125, -1, 0, 0, nullptr, 0 },
{ 49, 55, "504b005a", 2, 255, -1, 0, 0, &_state3, 1 },
{ 49, 55, "504b005b", 2, 255, -1, 0, 0, &_state3, 2 },
{ 56, 75, "504b006a", 2, 255, -1, 0, 0, &_state4, 1 },
{ 56, 75, "504b006b", 2, 255, -1, 0, 0, &_state4, 2 },
{ 76, 81, "500_014", 2, 255, -1, 0, 0, nullptr, 0 },
{ 82, 82, nullptr, 0, 0, 6, 0, 7, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY12[] = {
{ 0, -1, "504b001a", 2, 255, -1, 1, 0, &_state2, 1 },
{ 0, -1, "504b001b", 2, 255, -1, 1, 0, &_state2, 2 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY13[] = {
{ 0, 8, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 9, 9, "504_005", 1, 125, -1, 0, 0, nullptr, 0 },
{ 10, 19, "504b008a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 10, 19, "504b008b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 10, 19, "504b008c", 2, 255, -1, 0, 0, &_state2, 3 },
{ 20, 20, "504_007", 3, 255, -1, 0, 0, nullptr, 0 },
{ 21, 24, "504_006", 1, 125, -1, 0, 0, nullptr, 0 },
{ 25, 27, "504b012a", 2, 255, -1, 0, 0, &_state3, 1 },
{ 25, 27, "504b012b", 2, 255, -1, 0, 0, &_state3, 2 },
{ 28, 29, "504_002", 2, 255, -1, 0, 0, nullptr, 0 },
{ 30, -1, "504_004", 1, 125, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY14[] = {
{ 0, -1, "504b008a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 0, -1, "504b008b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 0, -1, "504b008c", 2, 255, -1, 0, 0, &_state2, 3 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY15[] = {
{ 0, -1, "504_005", 3, 125, -1, 0, 2, nullptr, 0 },
{ 0, -1, "504_006", 3, 125, -1, 0, 0, nullptr, 0 },
{ 0, -1, "504_004", 3, 125, -1, 0, 4, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room504::PLAY16[] = {
{ 0, -1, "500_008", 2, 255, -1, 0, 0, &_state5, 1 },
{ 0, -1, "500_009", 2, 255, -1, 0, 0, &_state5, 2 },
{ 0, -1, "500_010", 2, 255, -1, 0, 0, &_state5, 3 },
{ 0, -1, "500_011", 2, 255, -1, 0, 0, &_state5, 4 },
{ 0, -1, "500_012", 2, 255, -1, 0, 0, &_state5, 5 },
{ 0, -1, "500_013", 2, 255, -1, 0, 0, &_state5, 6 },
PLAY_BREAK_END
};
int32 Room504::_state1;
int32 Room504::_state2;
int32 Room504::_state3;
int32 Room504::_state4;
int32 Room504::_state5;
Room504::Room504() : Section5Room() {
_state1 = 0;
_state2 = 0;
_state3 = 0;
_state4 = 0;
_state5 = 0;
}
void Room504::init() {
Section5Room::init();
_initFlag = false;
if (_G(flags)[V210] == 5002) {
series_show("504bk10", 0x910);
series_show("504bk10s", 0x910);
hotspot_set_active("BORK", false);
hotspot_set_active("BORK GUTS", true);
} else {
_val1 = 25;
kernel_trigger_dispatch_now(5);
_G(kernel).call_daemon_every_loop = true;
hotspot_set_active("BORK GUTS", false);
hotspot_set_active("BORK", true);
}
if (!_G(flags)[V213]) {
_val2 = 31;
kernel_trigger_dispatch_now(7);
} else if (_G(flags)[V210] == 5002) {
_G(flags)[V213] = 2;
_val2 = 32;
kernel_trigger_dispatch_now(7);
}
_val3 = (_G(flags)[V211] == 5001) ? 35 : 34;
kernel_trigger_dispatch_now(8);
_val4 = (_G(flags)[V212] == 5001) ? 35 : 34;
kernel_trigger_dispatch_now(9);
if (inv_object_is_here("DIRTY SOCK") && _G(flags)[V210] != 5002) {
_sock = series_show("504SOCK", 0xf00);
} else {
hotspot_set_active("DIRTY SOCK ", false);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 501:
player_set_commands_allowed(true);
ws_demand_location(133, 320);
break;
case 503:
_G(wilbur_should) = 2;
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:
player_set_commands_allowed(true);
ws_demand_location(133, 320);
break;
}
_initFlag = true;
Section5Room::init();
}
void Room504::daemon() {
switch (_G(kernel).trigger) {
case 4:
ws_unhide_walker();
switch (_val5) {
case 13:
wilbur_speech("504w001");
break;
case 15:
wilbur_speech("504w005");
break;
case 16:
wilbur_speech("504w006", 5001);
break;
case 18:
wilbur_speech("504w023");
break;
case 19:
_val5 = 20;
wilbur_speech("504w031");
break;
case 20:
wilbur_speech("504w032");
break;
default:
break;
}
break;
case 5:
switch (_val1) {
case 21:
if (_flag1) {
_val1 = 26;
kernel_trigger_dispatch_now(5);
_G(wilbur_should) = 6;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_val1 = imath_ranged_rand(0, 100) >= 75 ? 25 : 22;
kernel_trigger_dispatch_now(5);
}
break;
case 22:
_G(flags)[V210] = 5000;
_state2 = imath_ranged_rand(1, 2);
_val1 = 21;
series_play_with_breaks(PLAY12, "504bk01", 0x850, 5, 2, 12, 100);
break;
case 23:
_state2 = imath_ranged_rand(1, 3);
_G(wilbur_should) = 12;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
_val1 = 21;
series_play_with_breaks(PLAY14, "504BK09", 0x850, 5, 2, 12);
break;
case 24:
_G(flags)[V206] = 5002;
_G(kernel).trigger_mode = KT_DAEMON;
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, 5015);
break;
case 25:
_G(flags)[V210] = 5001;
_state2 = imath_ranged_rand(1, 3);
_state3 = imath_ranged_rand(1, 2);
_state4 = imath_ranged_rand(1, 2);
_val1 = 21;
series_play_with_breaks(PLAY11, "504WBORK", 0x850, 5, 2, 12, 100);
break;
case 26:
_G(flags)[V210] = 5002;
_G(kernel).call_daemon_every_loop = false;
_series3 = series_show("504bk01", 0x850);
break;
case 27:
terminateMachineAndNull(_series3);
_state2 = imath_ranged_rand(1, 3);
_state3 = imath_ranged_rand(1, 2);
_val1 = 28;
series_play_with_breaks(PLAY13, "504BK08", 0x850, 5, 3);
break;
case 28:
_val2 = 32;
kernel_trigger_dispatch_now(7);
_series3 = series_show("504bk10", 0x910);
_series3s = series_show("504bk10s", 0x911);
hotspot_set_active("BORK GUTS", true);
hotspot_set_active("BORK", false);
_val5 = 16;
kernel_trigger_dispatch_now(4);
break;
default:
break;
}
break;
case 6: {
static const char *NAMES[5] = {
"504SPRK1", "504SPRK2", "504SPRK3", "504SPRK4", "504SPRK5" };
_sparkName = NAMES[imath_ranged_rand(0, 4)];
_state5 = imath_ranged_rand(1, 6);
series_play_with_breaks(PLAY16, _sparkName, 0x910, -1, 2, 6, 100);
break;
}
case 7:
switch (_val2) {
case 29:
switch (imath_ranged_rand(0, 6)) {
case 0:
case 1:
case 2:
_val2 = 32;
break;
case 3:
case 4:
_val2 = 31;
break;
default:
_val2 = 30;
break;
}
kernel_trigger_dispatch_now(7);
break;
case 30:
if (_G(flags)[V213] != 1) {
_G(flags)[V213] = 1;
kernel_trigger_dispatch_now(6);
}
_val2 = 29;
kernel_trigger_dispatch_now(7);
break;
case 31:
_G(flags)[V213] = 0;
_val2 = 32;
_val8 = imath_ranged_rand(0, 10);
series_play_with_breaks(PLAY15, "504WASH", 0x900, 7, 2, 6, 100);
break;
case 32:
_G(flags)[V213] = 2;
_val2 = 29;
_series4 = series_show("504wash", 0x900, 0, 7, 300);
break;
default:
break;
}
break;
case 8:
switch (_val3) {
case 34:
terminateMachineAndNull(_series2);
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 0);
break;
case 35:
_series2 = series_show("504IBOFF", 0x900);
pal_fade_init(_G(kernel).first_fade, 255, 1, 10, 0);
break;
default:
break;
}
break;
case 9:
switch (_val4) {
case 34:
terminateMachineAndNull(_series5);
break;
case 35:
_series5 = series_show("504OBOFF", 0x900);
break;
default:
break;
}
break;
case 10:
switch (_sockState) {
case 36:
terminateMachineAndNull(_sock);
hotspot_set_active("DIRTY SOCK ", false);
inv_give_to_player("DIRTY SOCK");
break;
case 37:
_sock = series_show("504SOCK", 0xf00);
hotspot_set_active("DIRTY SOCK ", true);
inv_move_object("DIRTY SOCK", NOWHERE);
break;
default:
break;
}
break;
case 5002:
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(true);
kernel_trigger_dispatch_now(4);
break;
case 2:
ws_demand_location(133, 320, 5);
player_set_commands_allowed(false);
ws_hide_walker();
if (player_been_here(504)) {
_G(wilbur_should) = 10001;
} else {
_val5 = 13;
_G(wilbur_should) = 1;
}
series_play_with_breaks(PLAY1, "504wi01", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 3:
_G(wilbur_should) = 10001;
player_set_commands_allowed(false);
ws_hide_walker();
series_play_with_breaks(PLAY2, "504wi02", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
pal_fade_init(_G(kernel).first_fade, 255, 0, 60, 5007);
break;
case 5:
_G(wilbur_should) = 10001;
_sockState = 36;
player_set_commands_allowed(false);
ws_hide_walker();
series_play_with_breaks(PLAY8, "504wi06", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 6:
ws_demand_facing(4);
ws_hide_walker();
_val1 = 27;
_G(wilbur_should) = 39;
series_play_with_breaks(PLAY9, "504Wi07", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
inv_move_object("DIRTY SOCK", NOWHERE);
break;
case 7:
_val5 = 18;
_G(wilbur_should) = 1;
player_set_commands_allowed(false);
ws_hide_walker();
_val3 = 34;
series_play_with_breaks(PLAY3, "504wi3b", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
_G(flags)[V211] = 5000;
break;
case 8:
_G(wilbur_should) = 9;
player_set_commands_allowed(false);
ws_hide_walker();
_val3 = 35;
series_play_with_breaks(PLAY4, "504Wi3A", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
_G(flags)[V211] = 5001;
break;
case 9:
digi_play("504w022", 1);
_G(wilbur_should) = 7;
series_play_with_breaks(PLAY5, "504wi10", 0x200, -1, 2, 12);
break;
case 10:
_G(wilbur_should) = 10001;
player_set_commands_allowed(false);
ws_hide_walker();
_val4 = 34;
series_play_with_breaks(PLAY6, "504Wi4B", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 11:
_G(wilbur_should) = 10001;
player_set_commands_allowed(false);
ws_hide_walker();
_val4 = 35;
series_play_with_breaks(PLAY7, "504Wi4A", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 12: {
_val5 = 15;
_G(wilbur_should) = 1;
_state1 = imath_ranged_rand(1, 6);
const int x = (double)(_state1 * _G(player_info).scale * 42) * 0.01 - _G(player_info).x;
ws_demand_location(x, _G(player_info).y);
ws_hide_walker();
series_play_with_breaks(PLAY10, "504Wi08", 0x200, kCHANGE_WILBUR_ANIMATION, 3, 6,
_G(player_info).scale, _G(player_info).x, _G(player_info).y);
break;
}
case 39:
ws_unhide_walker();
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case kCALLED_EACH_LOOP:
player_update_info();
if (_G(player_info).x > 300 && _G(player_info).y > 307) {
if (!_G(flags)[V214]) {
_G(flags)[V214] = 1;
if (_G(flags)[V210] != 5002) {
if (_val6 >= 3) {
_G(kernel).call_daemon_every_loop = false;
_val1 = 24;
kernel_trigger_dispatch_now(5);
} else {
++_val6;
_val1 = 23;
player_set_commands_allowed(false);
intr_cancel_sentence();
_G(player).command_ready = false;
player_update_info();
ws_demand_location(_G(player_info).x, _G(player_info).y, 3);
}
}
}
} else {
_G(flags)[V214] = 0;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room504::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("STAIRS") && !player_said_any("CLIMB", "GEAR"))
player_set_facing_hotspot();
}
void Room504::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("LOOK AT", "BORK")) {
switch (_G(flags)[V210]) {
case 5000:
wilbur_speech("504w003");
break;
case 5001:
wilbur_speech("504w008");
break;
default:
break;
}
} else if (player_said("RUBBER DUCKY", "BORK")) {
wilbur_speech("500w036");
} else if (player_said("SOAPY WATER", "BORK")) {
wilbur_speech("500w050");
} else if (player_said("GEAR", "DIRTY SOCK ")) {
wilbur_speech("500w012");
} else if (player_said("LOOK AT", "WRINGER") && _G(flags)[V210] == 5002) {
wilbur_speech("504w014");
} else if (player_said("LOOK AT", "OUTSIDE BREAKER") && _G(flags)[V212] == 5000) {
wilbur_speech("504w025");
} else if (player_said("GEAR", "WASHING MACHINE") && _G(flags)[V210] == 5002) {
wilbur_speech("504w016");
} else if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("CLIMB", "STAIRS") || player_said("GEAR", "STAIRS")) {
player_set_commands_allowed(false);
_G(kernel).trigger_mode = KT_DAEMON;
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("TAKE", "DIRTY SOCK ")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("DIRTY SOCK", "WRINGER")) {
player_set_commands_allowed(false);
_flag1 = true;
} else if (player_said("GEAR", "INSIDE BREAKER")) {
if (_G(flags)[V211] == 5000) {
_G(wilbur_should) = 8;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_G(wilbur_should) = 7;
_G(flags)[V211] = 5000;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
} else if (player_said("GEAR", "OUTSIDE BREAKER")) {
if (_G(flags)[V212] == 5000) {
_G(wilbur_should) = 11;
_G(flags)[V212] = 5001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_G(wilbur_should) = 10;
_G(flags)[V212] = 5000;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
} else if (player_said("LOOK AT", "HOLE")) {
_val5 = 19;
kernel_trigger_dispatch_now(4);
} else {
return;
}
_G(player).command_ready = false;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,86 @@
/* 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_ROOM504_H
#define M4_BURGER_ROOMS_SECTION5_ROOM504_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room504 : public Section5Room {
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[];
static const seriesPlayBreak PLAY12[];
static const seriesPlayBreak PLAY13[];
static const seriesPlayBreak PLAY14[];
static const seriesPlayBreak PLAY15[];
static const seriesPlayBreak PLAY16[];
static int32 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
static int32 _state5;
bool _flag1 = false;
int _val1 = 0;
int _val2 = 0;
int _val3 = 0;
int _val4 = 0;
int _val5 = 0;
int _val6 = 0;
int _sockState = 0;
int _val8 = 0;
machine *_sock = nullptr;
machine *_series2 = nullptr;
machine *_series3 = nullptr;
machine *_series3s = nullptr;
machine *_series4 = nullptr;
machine *_series5 = nullptr;
const char *_sparkName = nullptr;
public:
Room504();
~Room504() 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,344 @@
/* 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/room505.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room505::SAID[][4] = {
{ "WILBUR'S ROOM", nullptr, "500w001", nullptr },
{ "BATHROOM", nullptr, "500w001", nullptr },
{ "AUNT POLLY'S ROOM", nullptr, "500w001", nullptr },
{ "STAIRS", "505w001", "500w001", nullptr },
{ "STAIRWAY BORK", "505w003", "500w002", "500w002" },
{ "RAILING", "505w004", nullptr, "505w006" },
{ "WINDOW", "500w003", nullptr, "500w004" },
{ "CEILING FAN", "505w008", nullptr, nullptr },
{ "CHANDELIER", "505w009", nullptr, nullptr },
{ "VASE", "505w010", "505w011", "505w012" },
{ "PICTURE", "505w013", "500w005", "505w014" },
{ "PICTURE ", "505w015", "500w005", "505w014" },
{ "PICTURE ", "505w016", "500w005", "505w014" },
{ nullptr, nullptr, nullptr, nullptr }
};
const Section5Room::BorkPoint Room505::BORK[] = {
{ -1, -1 }, { 257, 255 }, { 266, 257 }, { 271, 250 }, { 292, 246 },
{ 317, 251 }, { 323, 256 }, { 338, 237 }, { 370, 227 }, { 348, 187 },
{ 332, 165 }, { 308, 161 }, { 282, 161 }, { 303, 175 }, { 325, 179 },
{ 374, 174 }, { 350, 172 }, { 327, 168 }, { 302, 167 }, { 282, 161 },
{ 303, 175 }, { 325, 179 }, { 374, 174 }, { 354, 175 }, { 330, 183 },
{ 317, 204 }, { 305, 217 }, { 284, 210 }, { 270, 227 }, { 255, 236 },
{ -1, -1 }, { -1, -1 }
};
const seriesPlayBreak Room505::PLAY1[] = {
{ 0, 3, "505_003a", 1, 100, -1, 0, 0, nullptr, 0 },
{ 4, -1, "505_003b", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room505::PLAY2[] = {
{ 0, 2, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 3, -1, "505_003a", 1, 100, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
Room505::Room505() : Section5Room() {
Common::strcpy_s(_bork, "BORK");
Common::strcpy_s(_lookAt, "LOOK AT");
_borkHotspot.vocab = _bork;
_borkHotspot.verb = _lookAt;
_borkHotspot.prep = _bork;
_borkHotspot.feet_x = 339;
_borkHotspot.feet_y = 305;
_borkHotspot.facing = 11;
_borkHotspot.cursor_number = kArrowCursor;
_borkThreshold = 1600;
}
void Room505::init() {
Section5Room::init();
pal_cycle_init(112, 127, 6);
player_set_commands_allowed(false);
_G(flags)[V246] = 0;
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 502:
ws_demand_location(333, 271, 3);
_G(wilbur_should) = 1;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 506:
ws_demand_location(52, 349, 3);
ws_walk(328, 323, nullptr, -1, -1);
player_set_commands_allowed(true);
break;
case 507:
ws_demand_location(84, 308, 3);
ws_walk(328, 323, nullptr, -1, -1);
player_set_commands_allowed(true);
break;
case 509:
ws_demand_location(497, 311, 9);
ws_walk(328, 323, nullptr, -1, -1);
player_set_commands_allowed(true);
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:
player_set_commands_allowed(true);
ws_demand_location(328, 323);
break;
}
if (_G(flags)[kStairsBorkState] == 5003) {
kernel_trigger_dispatch_now(7);
} else {
series_load("505bk01");
series_load("505bk01s");
_borkTable = BORK;
_borkState = 7;
_G(flags)[V186] = 1;
kernel_trigger_dispatch_now(4);
kernel_trigger_dispatch_now(2);
}
_initFlag = true;
Section5Room::init();
}
void Room505::daemon() {
switch (_G(kernel).trigger) {
case 1:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, _destTrigger);
break;
case 2:
if (_G(flags)[kStairsBorkState] == 5000) {
player_update_info();
if (_G(player_info).y > 280 && _G(player_info).y < 300) {
ws_walk(_G(player_info).x, _G(player_info).y, nullptr, -1, -1);
player_set_commands_allowed(false);
kernel_trigger_dispatch_now(6);
} else {
kernel_timing_trigger(15, 2);
}
}
break;
case 3:
player_update_info();
if (_G(player_info).y > 300) {
_borkState = _val3;
kernel_trigger_dispatch_now(4);
} else {
kernel_timing_trigger(15, 3);
}
break;
case 4:
switch (_borkState) {
case 4:
_G(flags)[V186] = 0;
_borkStairs.terminate();
_val3 = 5;
kernel_timing_trigger(imath_ranged_rand(240, 360), 3);
break;
case 5:
_G(flags)[V186] = 1;
_G(flags)[kStairsBorkState] = 5000;
_borkState = 6;
_borkStairs.play("505bk01", 0xbff, 0, 4, 6, 0, 100, 0, 0, 0, 2);
break;
case 6:
_val4 = 0;
kernel_trigger_dispatch_now(5);
kernel_trigger_dispatch_now(2);
_borkState = 7;
_borkStairs.play("505bk01", 0xbff, 0, 4, 6, 0, 100, 0, 0, 3, 9);
break;
case 7:
terminateMachineAndNull(_fan);
_borkState = 8;
_borkStairs[0] = series_play("505bk01", 0xbff, 0, 4, 6, 0, 100, 0, 0, 10, 24);
_borkStairs[1] = series_play("505bk01s", 0xc00, 0, 7, 6, 0, 100, 0, 0, 10, 24);
_val4 = 1;
kernel_trigger_dispatch_now(5);
break;
case 8:
_borkState = 9;
_borkStairs.play("505bk01", 0xbff, 0, 4, 6, 0, 100, 0, 0, 25, 24);
_val4 = 2;
kernel_trigger_dispatch_now(5);
break;
case 9:
_G(flags)[kStairsBorkState] = 5001;
_borkState = 4;
_borkStairs.play("505bk01", 0xbff, 0, 4, 6, 0, 100, 0, 0, 27, 31);
_val4 = 3;
kernel_trigger_dispatch_now(5);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
case 5:
switch (_val4) {
case 0:
digi_play((imath_ranged_rand(1, 2) == 1) ? "505b001a" : "505b001b", 2);
break;
case 1:
digi_play("505b002", 2);
break;
case 2:
digi_play("505b003", 2);
break;
case 3:
digi_play((imath_ranged_rand(1, 2) == 1) ? "505b004a" : "505b004b", 2);
break;
default:
break;
}
break;
case 6:
_G(flags)[V206] = 5005;
kernel_trigger_dispatch_now(5015);
break;
case 7:
_fan = series_play("505fan", 0xbff, 0, -1, 6, -1);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(false);
ws_demand_location(333, 271, 3);
ws_hide_walker();
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY1, "505wi01", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 2:
player_set_commands_allowed(false);
ws_hide_walker();
_destTrigger = 5006;
kernel_timing_trigger(30, 1);
series_play_with_breaks(PLAY2, "505wi02", 0xc00, -1, 3);
break;
case 3:
_G(wilbur_should) = 2;
wilbur_speech("500w054", kCHANGE_WILBUR_ANIMATION);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room505::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said_any("WILBUR'S ROOM", "BATHROOM", "AUNT POLLY'S ROOM") &&
!player_said_any("ENTER", "LOOK AT", "GEAR"))
player_set_facing_hotspot();
}
void Room505::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
const bool railingFlag = player_said("RAILING") && _G(flags)[kStairsBorkState] == 5003;
if (player_said("LOOK AT", "STAIRS") && _G(flags)[kStairsBorkState] == 5003) {
wilbur_speech("505w002");
} else if (railingFlag && player_said("LOOK AT")) {
wilbur_speech("505w005");
} else if (railingFlag && player_said("GEAR")) {
wilbur_speech("505w007");
} else if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("WILBUR'S ROOM") && player_said_any("GEAR", "ENTER", "LOOK AT")) {
_destTrigger = 5010;
kernel_trigger_dispatch_now(1);
} else if (player_said("LOOK AT", "BATHROOM") || player_said("GEAR", "BATHROOM")) {
_destTrigger = 5011;
kernel_trigger_dispatch_now(1);
} else if (player_said("LOOK AT", "AUNT POLLY'S ROOM") || player_said("GEAR", "AUNT POLLY'S ROOM")) {
_destTrigger = 5013;
kernel_trigger_dispatch_now(1);
} else if (player_said("GEAR", "STAIRS")) {
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("SOAPY WATER", "RAILING")) {
_G(flags)[V196] = 1;
player_set_commands_allowed(false);
_G(wilbur_should) = 3;
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,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_SECTION5_ROOM505_H
#define M4_BURGER_ROOMS_SECTION5_ROOM505_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room505 : public Section5Room {
private:
static const char *SAID[][4];
static const BorkPoint BORK[];
static const seriesPlayBreak PLAY1[];
static const seriesPlayBreak PLAY2[];
char _bork[8], _lookAt[8];
int _borkState = 0;
int _destTrigger = 0;
int _val3 = 0;
int _val4 = 0;
machine *_fan = nullptr;
public:
Room505();
~Room505() 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,514 @@
/* 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/room506.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room506::SERIES1[] = {
{ 0, "506_003", 2, 100, -1, 0, nullptr, 0 },
{ 13, "506_003", 2, 100, -1, 0, nullptr, 0 },
{ 20, "506_006", 1, 255, -1, 0, nullptr, 0 },
{ 45, "506_003", 2, 100, -1, 0, nullptr, 0 },
{ 67, "506_003", 2, 100, -1, 0, nullptr, 0 },
{ 77, "506_003", 2, 255, -1, 0, nullptr, 0 },
{ 91, "506_007", 2, 255, -1, 0, nullptr, 0 },
{ 100, "506b005a", 1, 255, -1, 0, &_state1, 1 },
{ 100, "506b005b", 1, 255, -1, 0, &_state1, 2 },
{ 100, "506b005c", 1, 255, -1, 0, &_state1, 3 },
{ 113, "506_007", 2, 255, -1, 0, nullptr, 0 },
{ 135, "506_007", 2, 255, -1, 0, nullptr, 0 },
{ 155, "506_001", 2, 255, -1, 0, nullptr, 0 },
{ 165, nullptr, 0, 0, 11, 0, nullptr, 0 },
STREAM_BREAK_END
};
const char *Room506::SAID[][4] = {
{ "HALLWAY", nullptr, "500w001", nullptr },
{ "WINDOW", "500w003", "500w001", nullptr },
{ "ROOF", "500w003", "500w001", nullptr },
{ "BORK", "506w004", "500w002", "500w002" },
{ "TELEVISION", "506w005", nullptr, "506w007" },
{ "FIRE", "506w009", "506w010", "506w011" },
{ "VIDEO GAME", "506w012", "506w013", "506w015" },
{ "BED", "506w017", nullptr, "506w018" },
{ "MATTRESS", "506w017", nullptr, "506w018" },
{ "READING LAMP", "506w019", "506w020", "506w021" },
{ "NIGHT TABLE", "506w022", "500w005", "500w005" },
{ "PILLOW", "506w023", "506w024", "506w025" },
{ "LAMP", "506w026", "506w020", "506w021" },
{ "BOOK", "506w027", "506w028", "506w028" },
{ "WARDROBE", "506w029", nullptr, nullptr },
{ "CLOTHES", "506w030", "506w031", "506w032" },
{ "DRESSER", "506w033", nullptr, nullptr },
{ "MODEL ROCKET ", "506w034", "500w005", "500w005" },
{ "MODEL ROCKET", "506w035", "506w036", "500w005" },
{ "MODEL ROCKET ", "506w037", "500w005", "500w005" },
{ "POSTER ", "506w038", "500w005", nullptr },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room506::PLAY1[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room506::PLAY2[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room506::PLAY3[] = {
{ 0, 25, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 26, 40, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
{ 41, 46, "500w067", 1, 255, -1, 4, -1, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room506::PLAY4[] = {
{ 9, 22, "506_003", 2, 50, -1, 0, 0, nullptr, 0 },
{ 23, 28, "506b003a", 2, 255, -1, 4, 2, &_state1, 1 },
{ 23, 28, "506b003b", 2, 255, -1, 4, 2, &_state1, 2 },
{ 29, 37, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room506::PLAY5[] = {
{ 38, 38, "506_003", 2, 120, -1, 0, 12, nullptr, 0 },
{ 39, 73, "506b004a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 39, 73, "506b004b", 2, 255, -1, 0, 0, &_state1, 2 },
PLAY_BREAK_END
};
const seriesPlayBreak Room506::PLAY6[] = {
{ 0, 12, "506b002a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 12, "506b002b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 13, 13, nullptr, 0, 0, 9, 0, 0, &_state2, 3 },
{ 13, 30, nullptr, 0, 0, 6, 0, 0, nullptr, 0 },
{ 31, -1, nullptr, 0, 0, 2, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
int32 Room506::_state1;
int32 Room506::_state2;
Room506::Room506() : Section5Room() {
_state1 = 0;
_state2 = 0;
}
void Room506::init() {
Section5Room::init();
pal_cycle_init(112, 127, 6);
for (_ctr = 0; _ctr < 5; ++_ctr)
_triggers[_ctr] = -1;
if (_G(flags)[kTVOnFire]) {
kernel_trigger_dispatch_now(12);
} else {
hotspot_set_active("FIRE", false);
}
if (_G(flags)[kTVOnFire] == 0) {
_val1 = 19;
kernel_trigger_dispatch_now(10);
}
if (_G(flags)[kTVOnFire]) {
series_show("506windo", 0xf00);
} else {
hotspot_set_active("ROOF", false);
}
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 505:
if (_G(flags)[V218] != 5003)
_G(flags)[V218] = 5000;
player_set_commands_allowed(true);
ws_demand_location(543, 252, 9);
if (player_been_here(506)) {
ws_walk(434, 254, nullptr, -1, 9);
} else {
ws_walk(434, 254, nullptr, 6, 9);
}
break;
case 508:
if (_G(flags)[V218] != 5003)
_G(flags)[V218] = 5000;
player_set_commands_allowed(false);
_G(wilbur_should) = 3;
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:
player_set_commands_allowed(true);
ws_demand_location(434, 254, 9);
break;
}
_state2 = 0;
if (_G(flags)[V218] == 5003) {
hotspot_set_active("BORK", false);
} else {
loadSeries();
_val2 = 12;
kernel_trigger_dispatch_now(7);
_walk1 = intr_add_no_walk_rect(308, 278, 430, 314, 303, 328);
}
_initFlag = true;
Section5Room::init();
}
void Room506::daemon() {
switch (_G(kernel).trigger) {
case 1:
ws_walk(434, 254, nullptr, 2, 9);
break;
case 2:
player_set_commands_allowed(true);
break;
case 3:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, _destTrigger);
break;
case 4:
for (_ctr = 0; _ctr < 5; ++_ctr) {
if (_triggers[_ctr] != -1) {
kernel_trigger_dispatch_now(_triggers[_ctr]);
_triggers[_ctr] = -1;
}
}
break;
case 5:
inv_put_thing_in("KINDLING", NOWHERE);
break;
case 6:
ws_unhide_walker();
switch (_val4) {
case 9:
wilbur_speech("506w001");
break;
case 10:
wilbur_speech("506w002");
break;
case 11:
wilbur_speech("506w003", 5001);
break;
default:
break;
}
break;
case 7:
switch (_val2) {
case 12:
kernel_trigger_dispatch_now(8);
_G(flags)[V218] = 5000;
_val2 = imath_ranged_rand(0, 2) == 0 ? 14 : 13;
_loopCount = imath_ranged_rand(2, 4);
series_play("506bk01", 0x3ff, 0, 7, 6, _loopCount, 100, 6, 10, 0, 8);
series_play("506bk01s", 0x400, 0, -1, 6, _loopCount, 100, 6, 10, 0, 8);
break;
case 13:
_G(flags)[V218] = 5001;
_val1 = 20;
kernel_trigger_dispatch_now(10);
_state1 = imath_ranged_rand(1, 2);
_val2 = 12;
series_play_with_breaks(PLAY4, "506bk01", 0x3ff, 7, 3, 6, 100, 6, 10);
break;
case 14:
_G(flags)[V218] = 5002;
_val1 = 22;
kernel_trigger_dispatch_now(10);
_state1 = imath_ranged_rand(1, 2);
_val2 = 12;
series_play_with_breaks(PLAY5, "506bk01", 0x3ff, 7, 3, 6, 100, 6, 10);
break;
case 15:
_state1 = imath_ranged_rand(1, 2);
_val4 = 10;
_val2 = 16;
series_play_with_breaks(PLAY6, "506bk02", 0x3ff, 7, 3, 6, 100, 6, 10);
break;
case 16:
_val2 = 12;
kernel_trigger_dispatch_now(7);
player_set_commands_allowed(true);
break;
case 17:
_G(wilbur_should) = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 18:
intr_remove_no_walk_rect(_walk1);
hotspot_set_active("BORK", false);
break;
default:
break;
}
break;
case 8:
digi_play(Common::String::format("506b001%c", 'a' + imath_ranged_rand(0, 5)).c_str(), 2);
break;
case 9:
_G(flags)[V206] = 5004;
kernel_trigger_dispatch_now(5015);
break;
case 10:
switch (_val1) {
case 19:
term_message("The game is Defender!");
_series1 = series_play("506game", 0x2fe, 2, -1, 10, -1, 100, 0, 0, 5, 21);
break;
case 20:
term_message("There is an explosion on the screen!");
terminateMachineAndNull(_series1);
_val1 = 19;
_series1 = series_play("506game", 0x2fe, 1, 10, 10, 3, 100, 0, 0, 2, 3);
break;
case 21:
term_message("There is a really big explosion on the screen!");
_series1 = series_play("506game", 0x2fe, 1, 10, 10, 3, 100, 0, 0, 2, 4);
break;
case 22:
terminateMachineAndNull(_series1);
_val1 = 21;
_series1 = series_play("506game", 0x2fe, 1, 10, 10, 1, 100, 0, 0, 0, 1);
break;
default:
break;
}
break;
case 11:
digi_play_loop("500_002", 3, 125);
break;
case 12:
_G(flags)[kTVOnFire] = 1;
terminateMachineAndNull(_series1);
hotspot_set_active("JOYSTICK", false);
hotspot_set_active("FIRE", true);
_series2 = series_play("506fire", 0x2fe, 4, -1, 6, -1);
break;
case 13:
series_show("506windo", 0xf00);
_G(flags)[kTVOnFire] = 1;
hotspot_set_active("ROOF", true);
break;
case 5002:
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(true);
kernel_trigger_dispatch_now(6);
break;
case 2:
player_set_commands_allowed(false);
ws_hide_walker();
_destTrigger = 5012;
kernel_timing_trigger(180, 3);
series_play_with_breaks(PLAY1, "506wi01", 0x800, -1, 3);
break;
case 3:
ws_demand_location(157, 313, 3);
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY2, "506wi02", 0x800, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 4:
player_set_commands_allowed(false);
_val2 = 17;
break;
case 5:
terminateMachineAndNull(_series1);
ws_hide_walker();
_G(flags)[V218] = 5003;
_G(flags)[V220] = 1;
_state1 = imath_ranged_rand(1, 3);
_G(wilbur_should) = 6;
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "506wi03", 6, 0x100, kCHANGE_WILBUR_ANIMATION);
break;
case 6:
digi_unload_stream_breaks(SERIES1);
_val2 = 18;
kernel_trigger_dispatch_now(7);
kernel_trigger_dispatch_now(12);
kernel_trigger_dispatch_now(13);
_val4 = 11;
kernel_trigger_dispatch_now(6);
break;
case 7:
player_set_commands_allowed(false);
ws_hide_walker();
_destTrigger = 5006;
_triggers[0] = 3;
_triggers[1] = kCHANGE_WILBUR_ANIMATION;
_G(wilbur_should) = 8;
series_play_with_breaks(PLAY3, "506wi05", 0x2fe, 4, 3);
break;
case 8:
series_show("506wi05", 0x2fe, 0, -1, -1, 46);
series_show("506wi05s", 0x2ff, 0, -1, -1, 46);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room506::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("AMPLIFIER", "TELEVISION") && _G(flags)[V218] != 5003) {
_G(wilbur_should) = 4;
player_hotspot_walk_override(456, 245, 8, kCHANGE_WILBUR_ANIMATION);
_G(player).command_ready = false;
} else if (player_said("FIRE", "KINDLING")) {
_G(wilbur_should) = 7;
player_hotspot_walk_override(409, 311, 4, kCHANGE_WILBUR_ANIMATION);
_G(player).command_ready = false;
} else if (player_said("HALLWAY") && !player_said_any("LEAVE", "LOOK AT", "GEAR")) {
player_set_facing_hotspot();
}
}
void Room506::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("GEAR") && player_said_any("WINDOW", "ROOF") && !_G(flags)[kTVOnFire]) {
wilbur_speech("500w004");
} else if (_G(flags)[kTVOnFire] && player_said("TELEVISION") && player_said("LOOK AT")) {
wilbur_speech("506w006");
} else if (_G(flags)[kTVOnFire] && player_said("TELEVISION") && player_said("GEAR")) {
wilbur_speech("506w008");
} else if (_G(flags)[kTVOnFire] && player_said("VIDEO GAME") &&
player_said_any("TAKE", "GEAR")) {
// No implementation
} else if (_G(walker).wilbur_said(SAID)) {
// No implementation
} 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);
_val2 = 15;
++_state2;
} else if (player_said_any("ROOF", "WINDOW") && player_said_any("ENTER", "GEAR") &&
_G(flags)[kTVOnFire]) {
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("HALLWAY") && player_said_any("LEAVE", "LOOK AT", "GEAR")) {
_destTrigger = 5009;
kernel_trigger_dispatch_now(3);
} else {
return;
}
_G(player).command_ready = false;
}
void Room506::loadSeries() {
series_load("506bk01");
series_load("506bk01s");
series_load("506bk02");
series_load("506bk02s");
series_load("506bk03");
series_load("506bk03s");
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,70 @@
/* 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_ROOM506_H
#define M4_BURGER_ROOMS_SECTION5_ROOM506_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room506 : public Section5Room {
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 int32 _state1;
static int32 _state2;
noWalkRect *_walk1 = nullptr;
machine *_series1 = nullptr;
machine *_series2 = nullptr;
int _triggers[5];
int _ctr = 0;
int _loopCount = 0;
int _val1 = 0;
int _val2 = 0;
int _destTrigger = 0;
int _val4 = 0;
void loadSeries();
public:
Room506();
~Room506() 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,779 @@
/* 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/room507.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room507::SAID[][4] = {
{ "HALLWAY", nullptr, "500w001", nullptr },
{ "BORK", "507w001", "500w002", "500w002" },
{ "RUBBER DUCKY ", "507w004", nullptr, "507w006" },
{ "RUBBER DUCKY ", "507w004", "507w005", "507w006" },
{ "TOILET", "507w007", "500w001", nullptr },
{ "FLUSH CHAIN", "507w007", "500w001", nullptr },
{ "TUB", "507w001", "500w001", "500w002" },
{ "WINDOW", "500w003", "500w001", "500w004" },
{ "TOILET SEAT", "507w012", "500w005", "500w005" },
{ "SHOWER CURTAIN", nullptr, "500w005", nullptr },
{ "SHOWERHEAD", "507w013", "507w014", nullptr },
{ "CLOSET", "507w015", "500w001", "500w001" },
{ "TOILET PAPER", "507w016", "500w005", "500w005" },
{ "TOWELS", "507w017", "507w018", "507w018" },
{ "DRAIN CLEANER", "507w019", "507w020", "507w020" },
{ "MIRROR", "507w021", nullptr, "507w022" },
{ "SINK", "507w023", nullptr, nullptr },
{ "BOARD", "507w024", "500w005", nullptr },
{ "LIVER SPOT CREAM", "507w025", "507w026", "507w026" },
{ "FACIAL HAIR BLEACH", "507w027", "507w028", "507w029" },
{ "WRINKLE CREAM", "507w030", "507w031", "507w031" },
{ "FACE CREAM", "507w032", "507w020", "507w033" },
{ "WIRES", "507w034", "507w035", "507w035" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room507::PLAY1[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY2[] = {
{ 0, 4, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 5, -1, nullptr, 0, 0, 11, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY3[] = {
{ 0, 5, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 4, 5, "500_004", 1, 255, -1, 0, 3, nullptr, 0 },
{ 0, 3, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY4[] = {
{ 11, 16, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 17, 19, "507_006", 1, 255, 11, 0, 0, nullptr, 0 },
{ 20, 23, nullptr, 0, 0, 10016, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY5[] = {
{ 0, 10, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY6[] = {
{ 0, 10, nullptr, 0, 0, -1, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY7[] = {
{ 0, 7, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 6, 0, nullptr, 0, 0, 9, 2, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY8[] = {
{ 0, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 13, 14, "507_004", 1, 255, -1, 0, 0, nullptr, 0 },
{ 15, 15, nullptr, 0, 0, -1, 0, 8, nullptr, 0 },
{ 16, 27, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 28, -1, nullptr, 0, 0, 11, 0, 0, nullptr, -1 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY9[] = {
{ 0, 6, "507b001a", 3, 255, -1, 0, 0, &_state1, 1 },
{ 0, 6, "507b001b", 3, 255, -1, 0, 0, &_state1, 2 },
{ 0, 6, "507b001c", 3, 255, -1, 0, 0, &_state1, 3 },
{ 0, 6, "507b001d", 3, 255, -1, 0, 0, &_state1, 4 },
{ 7, 11, "507_002a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 7, 11, "507_002b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 7, 11, "507_002c", 2, 255, -1, 0, 0, &_state2, 3 },
{ 7, 11, "507_002d", 2, 255, -1, 0, 0, &_state2, 4 },
{ 7, 11, "507_002e", 2, 255, -1, 0, 0, &_state2, 5 },
{ 7, 11, "507_002f", 2, 255, -1, 0, 0, &_state2, 6 },
{ 12, 21, "507_002a", 2, 255, -1, 0, 0, &_state3, 1 },
{ 12, 21, "507_002b", 2, 255, -1, 0, 0, &_state3, 2 },
{ 12, 21, "507_002c", 2, 255, -1, 0, 0, &_state3, 3 },
{ 12, 21, "507_002d", 2, 255, -1, 0, 0, &_state3, 4 },
{ 12, 21, "507_002e", 2, 255, -1, 0, 0, &_state3, 5 },
{ 12, 21, "507_002f", 2, 255, -1, 0, 0, &_state3, 6 },
{ 22, -1, "507_002a", 2, 255, -1, 0, 0, &_state4, 1 },
{ 22, -1, "507_002b", 2, 255, -1, 0, 0, &_state4, 2 },
{ 22, -1, "507_002c", 2, 255, -1, 0, 0, &_state4, 3 },
{ 22, -1, "507_002d", 2, 255, -1, 0, 0, &_state4, 4 },
{ 22, -1, "507_002e", 2, 255, -1, 0, 0, &_state4, 5 },
{ 22, -1, "507_002f", 2, 255, -1, 0, 0, &_state4, 6 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY10[] = {
{ 0, -1, "507_001", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY11[] = {
{ 0, 1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 2, 9, "507b003a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 2, 9, "507b003b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 2, 9, "507b003c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 10, 15, "507b004a", 2, 255, -1, 4, 2, &_state2, 1 },
{ 10, 15, "507b004b", 2, 255, -1, 4, 2, &_state2, 2 },
{ 10, 15, "507b004c", 2, 255, -1, 4, 2, &_state2, 3 },
{ 16, 20, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 21, 21, nullptr, 0, 0, -1, 0, 8, nullptr, 0 },
{ 22, -1, "507b005", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY12[] = {
{ 0, 11, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 12, 15, "507b006a", 2, 255, -1, 4, 2, &_state1, 1 },
{ 12, 15, "507b006b", 2, 255, -1, 4, 2, &_state1, 2 },
{ 16, 16, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 17, 18, "500_004", 2, 255, -1, 0, 3, nullptr, 0 },
{ 19, 28, "507b007a", 2, 255, -1, 4, 2, &_state2, 1 },
{ 19, 28, "507b007b", 2, 255, -1, 4, 2, &_state2, 2 },
{ 29, 32, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 33, -1, "507b008a", 2, 255, -1, 0, 0, &_state3, 1 },
{ 33, -1, "507b008b", 2, 255, -1, 0, 0, &_state3, 2 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY13[] = {
{ 0, 3, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 4, 8, "507b003a", 2, 255, -1, 4, 0, &_state1, 1 },
{ 4, 8, "507b003b", 2, 255, -1, 4, 0, &_state1, 2 },
{ 4, 8, "507b003c", 2, 255, -1, 4, 0, &_state1, 3 },
{ 20, 37, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 38, 46, "507b010a", 2, 255, -1, 1, 0, &_state2, 1 },
{ 38, 46, "507b010b", 2, 255, -1, 1, 0, &_state2, 2 },
{ 47, 59, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 60, 78, "500_014", 2, 255, -1, 0, 0, nullptr, 0 },
{ 79, -1, "507_007", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY14[] = {
{ 0, 7, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 8, 13, "507b011", 2, 255, -1, 4, 0, nullptr, 0 },
{ 14, 29, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 30, -1, "507_005", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY15[] = {
{ 0, -1, "507b013", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY16[] = {
{ 0, 6, "507b002a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 6, "507b002b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 0, 6, "507b002c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 7, 7, nullptr, 0, 0, 8, 0, 0, &_state5, 3 },
{ 7, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY17[] = {
{ 0, 3, "507_003", 1, 255, -1, 1, 5, nullptr, 0 },
{ 4, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room507::PLAY18[] = {
{ 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
};
int32 Room507::_state1;
int32 Room507::_state2;
int32 Room507::_state3;
int32 Room507::_state4;
int32 Room507::_state5;
Room507::Room507() : Section5Room() {
_state1 = 0;
_state2 = 0;
_state3 = 0;
_state4 = 0;
_state5 = 0;
}
void Room507::init() {
Section5Room::init();
pal_cycle_init(112, 127, 6);
for (_ctr = 0; _ctr < 5; ++_ctr)
_triggers[_ctr] = -1;
player_set_commands_allowed(false);
_G(flags)[V246] = 0;
_flag1 = _flag2 = false;
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
player_set_commands_allowed(true);
break;
case 505:
ws_demand_location(610, 280, 1);
player_set_commands_allowed(true);
if (player_been_here(507)) {
ws_walk(343, 323, nullptr, -1);
} else {
// There's a bork in my tub
_val1 = 12;
ws_walk(343, 323, nullptr, 3);
}
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:
player_set_commands_allowed(true);
ws_demand_location(343, 323);
break;
}
_state5 = 0;
hotspot_set_active("BORK", false);
if (_G(flags)[V223] != 2) {
loadSeries();
if (_G(flags)[V223] == 1) {
hotspot_set_active_xy("BORK", 123, 218, true);
_val2 = 22;
} else {
hotspot_set_active_xy("BORK", 320, 220, true);
_val2 = 15;
kernel_trigger_dispatch_now(5);
}
kernel_trigger_dispatch_now(6);
}
switch (inv_where_is("RUBBER DUCKY")) {
case 500:
hotspot_set_active("RUBBER DUCKY ", false);
hotspot_set_active("RUBBER DUCKY ", true);
break;
case 507:
_series1 = series_show("507duck", 0xa00);
hotspot_set_active("RUBBER DUCKY ", true);
hotspot_set_active("RUBBER DUCKY ", false);
break;
default:
hotspot_set_active("RUBBER DUCKY ", false);
hotspot_set_active("RUBBER DUCKY ", false);
break;
}
if (_G(flags)[V223] != 1) {
_val3 = inv_where_is("RUBBER DUCKY") == 500 ? 27 : 26;
kernel_trigger_dispatch_now(9);
}
kernel_trigger_dispatch_now(10);
series_show("507tub", 0xf00);
if (_G(flags)[V228])
series_show("507windo", 0xf00);
_initFlag = true;
Section5Room::init();
}
void Room507::daemon() {
switch (_G(kernel).trigger) {
case 1:
for (_ctr = 0; _ctr < 5; ++_ctr) {
if (_triggers[_ctr] != -1) {
kernel_trigger_dispatch_now(_triggers[_ctr]);
term_message("Multiple Trigger Dispatch: %d", _triggers[_ctr]);
_triggers[_ctr] = -1;
}
}
break;
case 2:
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, _val4);
break;
case 3:
ws_unhide_walker();
switch (_val1) {
case 12:
wilbur_speech("507w001");
break;
case 13:
player_set_commands_allowed(false);
_val1 = 14;
kernel_timing_trigger(120, 3);
break;
case 14:
player_set_commands_allowed(false);
wilbur_speech("507w002", 5001);
break;
default:
break;
}
break;
case 4:
player_set_commands_allowed(false);
_val2 = 25;
break;
case 5:
if (!_G(flags)[V223]) {
player_update_info();
if (_G(player_info).x > 270 && _G(player_info).x < 350 &&
_G(player_info).y < 280 && !_flag1) {
_flag1 = true;
player_set_commands_allowed(false);
intr_cancel_sentence();
_val2 = 23;
ws_walk(250, 275, nullptr, -1, 2);
}
}
if (_G(flags)[V223] != 1 && _G(flags)[V223] != 2)
kernel_timing_trigger(15, 5);
break;
case 6:
switch (_val2) {
case 15:
_val2 = imath_ranged_rand(1, 2) == 1 ? 16 : 17;
kernel_trigger_dispatch_now(6);
break;
case 16:
_G(flags)[V223] = 0;
_state1 = imath_ranged_rand(1, 4);
_state2 = imath_ranged_rand(1, 6);
_state3 = imath_ranged_rand(1, 6);
_state4 = imath_ranged_rand(1, 6);
_val2 = 15;
series_play_with_breaks(PLAY9, "507bk01", 0xb00, 6, 2);
break;
case 17:
_G(flags)[V223] = 0;
_val2 = 15;
series_play_with_breaks(PLAY10, "507bk04", 0xb00, 6, 2);
break;
case 18:
_state1 = imath_ranged_rand(1, 3);
_state2 = imath_ranged_rand(1, 3);
_val2 = 15;
series_play_with_breaks(PLAY11, "507bk02", 0xb00, 6, 2);
break;
case 19:
_val2 = 24;
_triggers[0] = 6;
_itemNum = 1;
_triggers[1] = 11;
_state1 = imath_ranged_rand(1, 2);
_state2 = imath_ranged_rand(1, 2);
_state3 = imath_ranged_rand(1, 2);
series_play_with_breaks(PLAY12, "507bk03", 0xb00, 1, 2);
break;
case 20:
_state1 = imath_ranged_rand(1, 3);
_state2 = imath_ranged_rand(1, 2);
_val2 = 24;
series_play_with_breaks(PLAY13, "507bk05", 0x8fe, 6, 3);
break;
case 21:
_G(flags)[V223] = 1;
hotspot_set_active("BORK", false);
hotspot_set_active_xy("BORK", 123, 218, true);
_val2 = 22;
series_play_with_breaks(PLAY14, "507bk06", 0x8fe, 6, 3);
break;
case 22:
player_set_commands_allowed(true);
kernel_trigger_dispatch_now(7);
_series3 = series_play("507bk07", 0x8fe, 4, -1, 6, -1);
break;
case 23:
player_set_commands_allowed(true);
++_state5;
_state1 = imath_ranged_rand(1, 3);
_val2 = 24;
series_play_with_breaks(PLAY16, "507bk08", 0xb00, 6, 2);
break;
case 24:
_flag1 = false;
player_set_commands_allowed(true);
_val2 = 15;
kernel_trigger_dispatch_now(6);
break;
case 25:
_G(wilbur_should) = _val5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
_val2 = _val6;
kernel_trigger_dispatch_now(6);
break;
default:
break;
}
break;
case 7:
if (_G(flags)[V223] != 2) {
digi_play(Common::String::format("507b012%c", 'a' + imath_ranged_rand(0, 4)).c_str(),
2, 255, 7);
}
break;
case 8:
_G(flags)[V206] = 5001;
kernel_trigger_dispatch_now(5015);
break;
case 9:
switch (_val3) {
case 26:
if (_G(flags)[V223] == 2 && !Section5::checkFlags())
player_set_commands_allowed(true);
terminateMachineAndNull(_series4);
_series4 = series_show("507tlt01", 0x8ff);
break;
case 27:
terminateMachineAndNull(_series4);
hotspot_set_active("RUBBER DUCKY ", false);
hotspot_set_active("RUBBER DUCKY ", true);
_series4 = series_play("507wi04", 0x8ff, 16, -1, 6, 0, 100, 0, 0, 24, 24);
break;
case 28:
terminateMachineAndNull(_series4);
_val3 = 31;
series_play_with_breaks(PLAY17, "507tlt01", 0x8ff, 9, 2);
break;
case 29:
digi_play("507_003", 1, 255, -1, 507);
terminateMachineAndNull(_series4);
hotspot_set_active("RUBBER DUCKY ", false);
hotspot_set_active("RUBBER DUCKY ", false);
inv_move_object("RUBBER DUCKY", NOWHERE);
_val3 = 31;
series_play("507tlt02", 0x8ff, 0, 9);
break;
case 30:
digi_play("507_003", 1, 255, -1, 507);
hotspot_set_active("BORK", false);
_G(flags)[V223] = 2;
player_set_commands_allowed(false);
_val1 = 13;
_triggers[0] = 3;
_val3 = 31;
_triggers[1] = 11;
_triggers[2] = 10;
terminateMachineAndNull(_series3);
series_play_with_breaks(PLAY15, "507bk09", 0x8ff, 1, 2);
break;
case 31:
_val3 = 26;
series_play_with_breaks(PLAY18, "507tlt01", 0x8ff, 9, 2);
break;
default:
break;
}
break;
case 10:
_series2 = series_show("507flush", 0xf00);
break;
case 11:
switch (_itemNum) {
case 0:
inv_give_to_player("RUBBER DUCKY");
terminateMachineAndNull(_series1);
hotspot_set_active("RUBBER DUCKY ", false);
hotspot_set_active("RUBBER DUCKY ", false);
break;
case 1:
inv_move_object("RUBBER DUCKY", 507);
hotspot_set_active("RUBBER DUCKY ", true);
hotspot_set_active("RUBBER DUCKY ", false);
_series1 = series_show("507duck", 0xa00);
break;
case 2:
inv_move_object("RUBBER DUCKY", 500);
_val3 = 27;
kernel_trigger_dispatch_now(9);
break;
case 3:
inv_give_to_player("SOAPY WATER");
inv_move_object("BOTTLE", NOWHERE);
break;
default:
break;
}
break;
case 5002:
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(true);
kernel_trigger_dispatch_now(3);
break;
case 2:
player_set_commands_allowed(false);
ws_hide_walker();
_itemNum = 0;
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY2, "507wi01", 0xa00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 3:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 4;
_val2 = 18;
series_play_with_breaks(PLAY5, "507wi04", 0x8ff, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 4:
ws_hide_walker();
player_update_info();
_G(wilbur_should) = _flag2 ? 8 : 5;
series_play_with_breaks(PLAY3, "507wi02", 0xa00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 5:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY6, "507wi04", 0x8ff, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 6:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 7;
series_play_with_breaks(PLAY1, "507wi03", 0xaff, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 7:
ws_unhide_walker();
break;
case 8:
_G(flags)[V224] = 1;
_itemNum = 2;
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY4, "507wi04", 0x8ff, 11, 3);
break;
case 9:
terminateMachineAndNull(_series2);
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 7;
if (_G(flags)[V223] == 1) {
_val3 = 30;
} else if (inv_where_is("RUBBER DUCKY") == 500) {
_val3 = 29;
} else {
_val3 = 28;
}
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
_triggers[1] = 10;
series_play_with_breaks(PLAY7, "507wi05", 0x8ff, 1, 3);
break;
case 11:
player_set_commands_allowed(false);
ws_hide_walker();
_itemNum = 3;
_G(wilbur_should) = 10001;
series_play_with_breaks(PLAY8, "507wi06", 0xd00, kCHANGE_WILBUR_ANIMATION, 3);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room507::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("HALLWAY") && !player_said_any("GEAR", "LOOK AT", "ENTER"))
player_set_facing_hotspot();
}
void Room507::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
const bool tubFlag = player_said("TUB") && _G(flags)[V223] != 0;
if (player_said("LOOK AT", "BORK") && _G(flags)[V223] == 1) {
wilbur_speech("507w003");
} else if (player_said("RUBBER DUCKY") && player_said("TUB")) {
wilbur_speech(_G(flags)[V223] ? "500w040" : "500w039");
} else if (player_said("RUBBER DUCKY") && player_said("SINK")) {
wilbur_speech("500w041");
} else if (player_said("SOAPY WATER", "SINK")) {
wilbur_speech("500w057");
} else if (player_said("LOOK AT") && player_said_any("TOILET", "FLUSH CHAIN") &&
_G(flags)[V223] == 1) {
wilbur_speech("507w008");
} else if (tubFlag && player_said("LOOK AT")) {
wilbur_speech("507w009");
} else if (tubFlag && player_said("GEAR")) {
wilbur_speech("507w010");
} else if (player_said("GEAR", "WINDOW") && _G(flags)[V228]) {
wilbur_speech("507w011");
} else if (player_said("GEAR") && (player_said("SHOWER CURTAIN") || player_said("SHOWERHEAD")) &&
_G(flags)[V223] == 2) {
// No implementation
} else if (_G(walker).wilbur_said(SAID)) {
// No implementation
} else if (player_said("LOOK AT", "HALLWAY") || player_said("GEAR", "HALLWAY")) {
_val4 = 5009;
kernel_trigger_dispatch_now(2);
} else if (_G(flags)[V223] != 1 && player_said("RUBBER DUCKY", "BORK")) {
player_set_commands_allowed(false);
_val5 = 6;
_val6 = 19;
kernel_trigger_dispatch_now(4);
} else if (_G(flags)[V223] != 1 && 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);
_val2 = 23;
} else if (player_said("TAKE", "RUBBER DUCKY ")) {
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("RUBBER DUCKY") && player_said_any("GEAR", "WILBUR")) {
_G(wilbur_should) = 3;
ws_walk(197, 274, nullptr, kCHANGE_WILBUR_ANIMATION, 9);
} else if (player_said("RUBBER DUCKY", "TOILET")) {
_flag2 = true;
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("GEAR") && player_said_any("TOILET", "FLUSH CHAIN")) {
if (_G(flags)[V223] == 1 || _G(flags)[V223] == 2) {
_G(wilbur_should) = 9;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (inv_where_is("RUBBER DUCKY") == 500) {
_val5 = 9;
_val6 = 21;
kernel_trigger_dispatch_now(4);
} else {
_val5 = 9;
_val6 = 20;
kernel_trigger_dispatch_now(4);
}
} else if (player_said("BOTTLE") && player_said_any("SOAPY WATER ", "TUB ")) {
if (_G(flags)[V223] == 1 || _G(flags)[V223] == 2) {
_G(wilbur_should) = 11;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
wilbur_speech("507w038");
}
} else {
return;
}
_G(player).command_ready = false;
}
void Room507::loadSeries() {
digi_preload("507b012a");
digi_preload("507b012b");
digi_preload("507b012c");
digi_preload("507b012d");
digi_preload("507b012e");
if (_G(flags)[V223] != 1) {
series_load("507bk01");
series_load("507bk03");
series_load("507bk04");
series_load("507bk08");
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

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_SECTION5_ROOM507_H
#define M4_BURGER_ROOMS_SECTION5_ROOM507_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room507 : public Section5Room {
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[];
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 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
static int32 _state5;
machine *_series1 = nullptr;
machine *_series2 = nullptr;
machine *_series3 = nullptr;
machine *_series4 = nullptr;
int _ctr = 0;
int _triggers[5];
bool _flag1 = false;
bool _flag2 = false;
int _val1 = 0;
int _val2 = 0;
int _val3 = 0;
int _val4 = 0;
int _val5 = 0;
int _val6 = 0;
int _itemNum = 0;
void loadSeries();
public:
Room507();
~Room507() 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,773 @@
/* 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/room508.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
enum {
kWILBUR_SPEECH = 1,
kCHANGE_BORK_ANIMATION = 2
};
enum {
kSPEECH_DESTROYING_ROOF = 10,
kSPEECH_WONT_LET_ME = 11,
kSPEECH_BORK_DESTROYED = 12
};
const char *Room508::SAID[][4] = {
{ "WILBUR'S ROOM", nullptr, "500w001", nullptr },
{ "BORK", "508w003", "500w002", "500w002" },
{ "CHRISTMAS LIGHTS ", "508w004", nullptr, "508w007" },
{ "CHRISTMAS LIGHTS ","508w005", "508w006", "508w007" },
{ "HOLE", "508w008", "500w001", "508w009" },
{ "BATHROOM", "508w010", nullptr, "508w011" },
{ "CHIMNEY", "508w012", "500w001", "508w014" },
{ "CHIMNEY POTS", "508w012", "500w001", "508w014" },
{ "ROOF", "508w015", "500w001", "508w016" },
{ "FORCE FIELD", "508w017", "500w001", "500w001" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room508::PLAY1[] = {
{ 0, 4, "508_001", 1, 255, -1, 1, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY2[] = {
{ 0, 4, "508_001", 1, 255, -1, 1024, 0, nullptr, 0 },
{ 5, -1, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY3[] = {
{ 0, 23, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 24, 28, "508_002", 1, 255, -1, 0, 0, nullptr, 0 },
{ 29, -1, nullptr, 1, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY4[] = {
{ 0, 23, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 24, 27, "508_002", 1, 255, -1, 0, 0, nullptr, 0 },
{ 28, -1, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY5[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY6[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY7[] = {
{ 0, -1, "508b001a", 2, 255, -1, 1025, 0, &_state1, 1 },
{ 0, -1, "508b001b", 2, 255, -1, 1025, 0, &_state1, 2 },
{ 0, -1, "508b001c", 2, 255, -1, 1025, 0, &_state1, 3 },
{ 0, -1, "508b001d", 2, 255, -1, 1025, 0, &_state1, 4 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY8[] = {
{ 0, 5, "508b003", 2, 255, -1, 0, 0, nullptr, 0 },
{ 6, 16, "500_005", 2, 255, -1, 0, 0, nullptr, 0 },
{ 17, -1, "508b001a", 2, 255, -1, 1024, 0, &_state1, 1 },
{ 17, -1, "508b001b", 2, 255, -1, 1024, 0, &_state1, 2 },
{ 17, -1, "508b001c", 2, 255, -1, 1024, 0, &_state1, 3 },
{ 17, -1, "508b001d", 2, 255, -1, 1024, 0, &_state1, 4 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY9[] = {
{ 0, 5, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 6, 12, "500_006", 2, 255, -1, 0, 0, nullptr, 0 },
{ 13, 18, "508b005a", 2, 255, -1, 4, 6, &_state1, 1 },
{ 13, 18, "508b005b", 2, 255, -1, 4, 6, &_state1, 2 },
{ 19, -1, "508b001a", 2, 255, -1, 1024, 0, &_state2, 1 },
{ 19, -1, "508b001b", 2, 255, -1, 1024, 0, &_state2, 2 },
{ 19, -1, "508b001c", 2, 255, -1, 1024, 0, &_state2, 3 },
{ 19, -1, "508b001d", 2, 255, -1, 1024, 0, &_state2, 4 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY10[] = {
{ 0, 20, "508b002a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 0, 20, "508b002b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 0, 20, "508b002c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 21, -1, nullptr, 0, 0, 1, 0, 0, &_state3, 1 },
{ 21, -1, nullptr, 0, 0, 1, 0, 0, &_state3, 2 },
{ 21, -1, nullptr, 0, 0, 2, 0, 0, &_state3, 3 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY11[] = {
{ 0, 10, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 11, 17, "508b006a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 11, 17, "508b006b", 2, 255, -1, 0, 0, &_state1, 2 },
{ 11, 17, "508b006c", 2, 255, -1, 0, 0, &_state1, 3 },
{ 11, 17, "508b006d", 2, 255, -1, 0, 0, &_state1, 4 },
{ 18, 18, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 19, 28, "508b007a", 2, 255, -1, 0, 0, &_state2, 1 },
{ 19, 28, "508b007b", 2, 255, -1, 0, 0, &_state2, 2 },
{ 19, 28, "508b007c", 2, 255, -1, 0, 0, &_state2, 3 },
{ 29, 42, "508b008a", 2, 255, -1, 0, 0, &_state4, 1 },
{ 29, 42, "508b008b", 2, 255, -1, 0, 0, &_state4, 2 },
{ 29, 42, "508b008c", 2, 255, -1, 0, 0, &_state4, 3 },
{ 43, -1, "508b009", 2, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room508::PLAY12[] = {
{ 0, 12, "500_003", 2, 255, -1, 0, 0, nullptr, 0 },
{ 13, -1, "508b010a", 2, 255, -1, 0, 0, &_state1, 1 },
{ 13, -1, "508b010b", 2, 255, -1, 0, 0, &_state1, 2 },
PLAY_BREAK_END
};
int32 Room508::_state1;
int32 Room508::_state2;
int32 Room508::_state3;
int32 Room508::_state4;
Room508::Room508() : Section5Room() {
_state1 = 0;
_state2 = 0;
_state3 = 0;
_state4 = 0;
}
void Room508::preload() {
Section5Room::preload();
_G(player).walker_in_this_scene = false;
}
void Room508::init() {
Section5Room::init();
player_set_commands_allowed(true);
_flag1 = true;
pal_cycle_init(112, 127, 6);
_val1 = 3;
_flag1 = false;
_state3 = 0;
_val2 = 0;
if (_G(flags)[kFireplaceHasFire] == 1) {
_series1 = series_play("508SMOKE", 0x500, 0, -1, 6, -1);
hotspot_set_active("BORK", false);
if (!_G(flags)[V227]) {
_borkState = 18;
kernel_trigger_dispatch_now(kCHANGE_BORK_ANIMATION);
}
} else {
loadSeries();
setup();
kernel_trigger_dispatch_now(kCHANGE_BORK_ANIMATION);
}
if (inv_player_has("CHRISTMAS LIGHTS") || inv_player_has("CHRISTMAS LIGHTS ")) {
_val4 = 24;
kernel_trigger_dispatch_now(5);
} else if (_G(flags)[V229] == 1) {
_val4 = 21;
kernel_trigger_dispatch_now(5);
} else {
_val4 = 22;
kernel_trigger_dispatch_now(5);
}
if (_G(flags)[V228] == 1) {
_val5 = 20;
kernel_trigger_dispatch_now(6);
}
switch (_G(game).previous_room) {
case 506:
player_set_commands_allowed(true);
_G(wilbur_should) = 1;
if (!player_been_here(508) && !_G(flags)[kFireplaceHasFire]) {
_flag2 = true;
_speechNum = kSPEECH_DESTROYING_ROOF;
}
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
default:
_flag1 = false;
_val1 = 3;
if (inv_player_has("CHRISTMAS LIGHTS")) {
_G(wilbur_should) = 5;
} else if (inv_player_has("CHRISTMAS LIGHTS ")) {
_G(wilbur_should) = 6;
} else {
_G(wilbur_should) = 4;
}
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
}
_initFlag = true;
Section5Room::init();
}
void Room508::daemon() {
switch (_G(kernel).trigger) {
case kWILBUR_SPEECH:
switch (_speechNum) {
case kSPEECH_DESTROYING_ROOF:
wilbur_speech("508w001");
break;
case kSPEECH_WONT_LET_ME:
wilbur_speech("508w001z");
break;
case kSPEECH_BORK_DESTROYED:
wilbur_speech("508w002");
break;
default:
break;
}
break;
case kCHANGE_BORK_ANIMATION:
switch (_borkState) {
case 14:
setup();
_state1 = imath_ranged_rand(1, 4);
series_play_with_breaks(PLAY7, "508BK01", 0x200, kCHANGE_BORK_ANIMATION, 3);
if (_G(flags)[V228] == 0 && _G(flags)[V223] == 0 && _val2 > 3) {
kernel_trigger_dispatch_now(3);
} else {
++_val2;
}
break;
case 15:
setup();
_state1 = imath_ranged_rand(1, 4);
series_play_with_breaks(PLAY8, "508BK02", 0x200, kCHANGE_BORK_ANIMATION, 3);
break;
case 16:
setup();
_state1 = imath_ranged_rand(1, 2);
_state2 = imath_ranged_rand(1, 4);
series_play_with_breaks(PLAY9, "508BK03", 0x200, kCHANGE_BORK_ANIMATION, 3);
break;
case 17:
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
++_state3;
_speechNum = 11;
setup();
if (_state3 == 3)
_borkState = 19;
_state1 = imath_ranged_rand(1, 3);
series_play_with_breaks(PLAY10, "508BK04", 0x200, kCHANGE_BORK_ANIMATION, 3, 6);
break;
case 18:
_speechNum = kSPEECH_BORK_DESTROYED;
_G(flags)[V227] = 1;
hotspot_set_active("BORK", false);
_state1 = imath_ranged_rand(1, 4);
_state2 = imath_ranged_rand(1, 3);
_state4 = imath_ranged_rand(1, 3);
series_play_with_breaks(PLAY11, "508BK05", 0x200, 1, 3, 6);
break;
case 19:
_G(flags)[V206] = 5003;
_G(kernel).trigger_mode = KT_DAEMON;
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, 5015);
break;
default:
break;
}
break;
case 3:
_G(flags)[V228] = 1;
_state1 = imath_ranged_rand(1, 2);
_val5 = 20;
series_play_with_breaks(PLAY12, "508BK06", 0x200, 6, 3);
break;
case 5:
switch (_val4) {
case 21:
hotspot_set_active("CHRISTMAS LIGHTS ", false);
hotspot_set_active("CHRISTMAS LIGHTS ", true);
_G(flags)[V229] = 1;
_series3 = series_show(_G(flags)[V212] == 5000 ? "508LGT03" : "508LGT01", 0x300);
break;
case 22:
hotspot_set_active("CHRISTMAS LIGHTS ", true);
hotspot_set_active("CHRISTMAS LIGHTS ", false);
_G(flags)[V229] = 0;
_series3 = series_show(_G(flags)[V212] == 5000 ? "508LGT04" : "508LGT02", 0x400);
break;
case 23:
_G(flags)[V229] = 0;
terminateMachineAndNull(_series3);
hotspot_set_active("CHRISTMAS LIGHTS ", false);
hotspot_set_active("CHRISTMAS LIGHTS ", false);
break;
default:
break;
}
break;
case 6:
switch (_val5) {
case 20:
_series2 = series_show("508WINDO", 0x200);
break;
default:
break;
}
break;
case 7:
_G(kernel).trigger_mode = KT_DAEMON;
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, 5010);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
_val1 = 3;
player_set_commands_allowed(false);
_flag1 = false;
_G(wilbur_should) = 4;
series_play_with_breaks(PLAY6, "508Wi01", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 2:
player_set_commands_allowed(false);
_flag1 = false;
terminateMachineAndNull(_series4);
_val1 = 1;
_G(wilbur_should) = 4;
series_play_with_breaks(PLAY1, "508Wi06", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
break;
case 3:
player_set_commands_allowed(false);
_flag1 = false;
_val4 = 23;
terminateMachineAndNull(_series4);
_val1 = 1;
if (_G(flags)[V212] == 5000) {
_G(wilbur_should) = 6;
series_play_with_breaks(PLAY2, "508Wi06", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
} else {
_G(wilbur_should) = 5;
series_play_with_breaks(PLAY2, "508Wi03", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
}
break;
case 4:
if (_flag2) {
_flag2 = false;
kernel_trigger_dispatch_now(kWILBUR_SPEECH);
}
_G(wilbur_should) = 4;
if (!_flag1) {
player_set_commands_allowed(true);
_flag1 = true;
}
if (_flag3) {
_G(wilbur_should) = 9;
_flag3 = false;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
if (_val1 == 1) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_show("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 0);
break;
case 1:
_val1 = 2;
_series4 = series_play("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
default:
break;
}
} else if (_val1 == 2) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508Wi09", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 1:
_val1 = 2;
_series4 = series_show("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
default:
break;
}
} else if (_val1 == 3) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508Wi09", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
case 1:
_val1 = 2;
_series4 = series_play("508Wi09", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
case 2:
_val1 = 3;
_series4 = series_show("508Wi09", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 3);
break;
default:
break;
}
}
break;
case 5:
if (!_flag1) {
player_set_commands_allowed(true);
_flag1 = true;
}
inv_give_to_player("CHRISTMAS LIGHTS");
if (_val1 == 1) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_show("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 0);
break;
case 1:
_val1 = 2;
_series4 = series_play("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
default:
break;
}
} else if (_val1 == 2) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508wi10", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 1:
_val1 = 2;
_series4 = series_show("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
default:
break;
}
} else if (_val1 == 3) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508wi10", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
case 1:
_val1 = 2;
_series4 = series_play("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
case 2:
_val1 = 3;
_series4 = series_show("508wi10", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 3);
break;
default:
break;
}
}
break;
case 6:
if (!_flag1) {
player_set_commands_allowed(true);
_flag1 = true;
}
inv_give_to_player("CHRISTMAS LIGHTS ");
if (_val1 == 1) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_show("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 0);
break;
case 1:
_val1 = 2;
_series4 = series_play("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
default:
break;
}
} else if (_val1 == 2) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508wi11", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 2);
break;
case 1:
_val1 = 2;
_series4 = series_show("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 2);
break;
case 2:
_val1 = 3;
_series4 = series_play("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
default:
break;
}
} else if (_val1 == 3) {
switch (imath_ranged_rand(0, 2)) {
case 0:
_val1 = 1;
_series4 = series_play("508wi11", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 0, 3);
break;
case 1:
_val1 = 2;
_series4 = series_play("508wi11", 0x200, 2, kCHANGE_WILBUR_ANIMATION, 20, 0, 100, 0, 0, 2, 3);
break;
case 2:
_val1 = 3;
_series4 = series_show("508wi11", 0x200, 0, kCHANGE_WILBUR_ANIMATION, 40, 3);
break;
default:
break;
}
}
break;
case 7:
_G(wilbur_should) = 4;
_val4 = 22;
player_set_commands_allowed(false);
_flag1 = false;
terminateMachineAndNull(_series4);
_val1 = 1;
if (_G(flags)[V212] == 5000) {
series_play_with_breaks(PLAY3, "508Wi07", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
inv_move_object("CHRISTMAS LIGHTS ", 508);
} else {
series_play_with_breaks(PLAY3, "508Wi04", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
inv_move_object("CHRISTMAS LIGHTS", 508);
}
break;
case 8:
_G(wilbur_should) = 4;
_val4 = 21;
player_set_commands_allowed(false);
_flag1 = false;
terminateMachineAndNull(_series4);
_val1 = 1;
if (_G(flags)[V212] == 5000) {
series_play_with_breaks(PLAY4, "508Wi08", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
inv_move_object("CHRISTMAS LIGHTS ", 508);
} else {
series_play_with_breaks(PLAY4, "508Wi05", 0x300, kCHANGE_WILBUR_ANIMATION, 2);
inv_move_object("CHRISTMAS LIGHTS", 508);
}
break;
case 9:
player_set_commands_allowed(false);
_flag1 = false;
_val1 = 1;
_flag3 = false;
if (inv_player_has("CHRISTMAS LIGHTS") || player_said("CHRISTMAS LIGHTS ")) {
_G(wilbur_should) = 8;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
_G(kernel).continue_handling_trigger = true;
} else {
terminateMachineAndNull(_series4);
_G(wilbur_should) = 10002;
series_play_with_breaks(PLAY5, "508Wi02", 0x300, 7, 2);
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room508::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("LOOK AT") && player_said_any("CHIMNEY", "CHIMNEY POTS") &&
_G(flags)[kFireplaceHasFire]) {
wilbur_speech("508w013");
} else if (player_said("RUBBER DUCKY", "BORK")) {
wilbur_speech("500w042");
} else if (player_said("BORK", "KINDLING")) {
wilbur_speech("500w069");
} else if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("TAKE", "CHRISTMAS LIGHTS ")) {
player_set_commands_allowed(false);
if (_G(flags)[V227]) {
_flag1 = false;
_G(wilbur_should) = 3;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
_borkState = 17;
}
} else if (player_said("HOLE") && player_said_any("CHRISTMAS LIGHTS ", "CHRISTMAS LIGHTS")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 7;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("ROOF") && player_said_any("CHRISTMAS LIGHTS ", "CHRISTMAS LIGHTS")) {
player_set_commands_allowed(false);
_G(wilbur_should) = 8;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else if (player_said("WILBUR'S ROOM") && player_said_any("LEAVE", "LOOK AT", "GEAR")) {
player_set_commands_allowed(false);
_flag3 = true;
_G(wilbur_should) = 9;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
return;
}
_G(player).command_ready = false;
}
void Room508::loadSeries() {
static const char *NAMES[8] = {
"508bk01", "508bk01s", "508bk02", "508bk02s", "508bk03",
"508bk03s", "508bk04", "508bk04s"
};
for (int i = 0; i < 8; ++i)
series_load(NAMES[i]);
if (!_G(flags)[V228]) {
series_load("508bk06");
series_load("508bk06s");
}
}
void Room508::setup() {
switch (imath_ranged_rand(0, 3)) {
case 0:
case 1:
_borkState = 14;
break;
case 2:
_borkState = 15;
break;
case 3:
_borkState = 16;
break;
default:
break;
}
}
} // 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_SECTION5_ROOM508_H
#define M4_BURGER_ROOMS_SECTION5_ROOM508_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room508 : public Section5Room {
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[];
static const seriesPlayBreak PLAY12[];
static int32 _state1;
static int32 _state2;
static int32 _state3;
static int32 _state4;
machine *_series1 = nullptr;
machine *_series2 = nullptr;
machine *_series3 = nullptr;
machine *_series4 = nullptr;
int _val1 = 0;
int _val2 = 0;
int _borkState = 0;
int _val4 = 0;
int _val5 = 0;
int _speechNum = 0;
bool _flag1 = false;
bool _flag2 = false;
bool _flag3 = false;
void loadSeries();
void setup();
public:
Room508();
~Room508() 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,498 @@
/* 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/room509.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Room509::SAID[][4] = {
{ "HALLWAY", nullptr, "500w001", nullptr },
{ "CHRISTMAS LIGHTS ", "509w002", nullptr, nullptr },
{ "PHONE CORD", "509w005", "509w006", "509w007" },
{ "HOLE", "509w008", "500w001", "509w009" },
{ "ROOF BORK", nullptr, nullptr, nullptr },
{ "BED", "509w010", nullptr, "509w011" },
{ "MATTRESS", "509w010", nullptr, "509w011" },
{ "PILLOW", "509w012", "509w013", "509w013" },
{ "LAMP", "509w014", "509w015", "509w014" },
{ "WINDOW", "500w003", nullptr, "500w004" },
{ "CHAIR", "509w016", nullptr, "509w017" },
{ "TELEPHONE", "509w018", "509w019", "509w020" },
{ "BOOK", "509w021", "509w022", "509w023" },
{ "PICTURE", "509w024", "500w005", nullptr },
{ "PICTURE ", "509w025", "500w005", "509w026" },
{ "PICTURE ", "509w027", "500w005", "509w026" },
{ nullptr, nullptr, nullptr, nullptr }
};
const seriesPlayBreak Room509::PLAY1[] = {
{ 0, 14, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 18, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY2[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY3[] = {
{ 0, 15, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 16, -1, nullptr, 0, 0, 3, 0, 0, nullptr, 0 },
{ 16, -1, "500w086", 1, 255, -1, 4, -1, &_state1, 1 },
{ 16, -1, nullptr, 0, 0, -1, 4, 2, &_state1, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY4[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 0, 15, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 16, -1, "509_003", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY5[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY6[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY7[] = {
{ 0, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
{ 0, -1, "509_002", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
const seriesPlayBreak Room509::PLAY8[] = {
{ 0, 4, "508b003", 2, 255, -1, 0, 0, nullptr, 0 },
{ 5, -1, "500_005", 2, 255, -1, 0, 0, &_state2, 1 },
{ 5, -1, "500_006", 2, 255, -1, 0, 0, &_state2, 2 },
PLAY_BREAK_END
};
static const RGB8 PALETTE[1] = { { 0x6E, 0x46, 0x1E } };
int32 Room509::_state1;
int32 Room509::_state2;
Room509::Room509() : Section5Room() {
_state1 = 0;
_state2 = 0;
}
void Room509::init() {
Section5Room::init();
pal_cycle_init(109, 124, 6);
switch (_G(game).previous_room) {
case KERNEL_RESTORING_GAME:
if (inv_player_has("CHRISTMAS LIGHTS") || inv_player_has("CHRISTMAS LIGHTS ")) {
disable_player();
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
}
break;
case 505:
ws_demand_location(4, 286, 3);
ws_unhide_walker();
if (player_been_here(509)) {
ws_walk(272, 325, nullptr, -1);
} else {
ws_walk(272, 325, nullptr, 1);
}
break;
default:
ws_demand_location(272, 325);
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
}
_state1 = 0;
if (_G(flags)[V227]) {
_val1 = 17;
} else {
digi_preload("508b001a");
digi_preload("508b001b");
digi_preload("508b001c");
digi_preload("508b001d");
_val1 = 15;
}
kernel_trigger_dispatch_now(2);
if (_G(flags)[V229] == 0 && !inv_player_has("CHRISTMAS LIGHTS") &&
!inv_player_has("CHRISTMAS LIGHTS ")) {
hotspot_set_active("CHRISTMAS LIGHTS ", true);
series_load("509wi05");
series_load("509wi06");
series_load("509wi07");
series_load("509wi08");
_lights = series_show((_G(flags)[V212] == 5000) ? "509lgt02" : "509lgt01", 0xc00);
} else {
hotspot_set_active("CHRISTMAS LIGHTS ", false);
}
_wire = series_show("509wire", 0x900);
_initFlag = true;
Section5Room::init();
}
void Room509::daemon() {
switch (_G(kernel).trigger) {
case 1:
wilbur_speech("509w001");
break;
case 2:
switch (_val1) {
case 15:
_state2 = imath_ranged_rand(1, 2);
_val1 = 16;
series_play_with_breaks(PLAY8, "509bk01", 0xf00, 2, 2, 6);
break;
case 16:
_val1 = 15;
series_show("509bk01", 0xf00, 0, 2, imath_ranged_rand(120, 240));
digi_play_loop(Common::String::format("508b001%c",
'a' + imath_ranged_rand(0, 3)).c_str(), 2, 255);
break;
case 17:
series_show("509bk01", 0xF00);
break;
default:
break;
}
break;
case 3:
if (!_G(flags)[V197] && !_flag1) {
_state1 = 1;
digi_play("509_001", 2);
_flag1 = true;
} else if (!_flag1) {
digi_play("509_003", 2, 255, -1, 509);
_flag1 = true;
}
_G(flags)[V197] = 1;
DAC_tint_range(PALETTE, _val4, 32, 255, true);
_val3 = imath_ranged_rand(0, 1);
if (_val3)
_val4 += 7;
else
_val4 -= 7;
_val4 = CLIP(_val4, 0, 70);
kernel_timing_trigger(6, (_val5 == 1) ? 3 : 4);
break;
case 4:
_flag1 = false;
_val4 -= 7;
if (_val4 < 0) {
_val4 = _val5 = 0;
}
DAC_tint_range(PALETTE, _val4, 32, 255, true);
if (_val5 == 2)
kernel_timing_trigger(6, 4);
break;
case 5002:
_G(wilbur_should) = 10001;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 1:
player_set_commands_allowed(false);
ws_hide_walker();
_G(wilbur_should) = 2;
terminateMachineAndNull(_lights);
series_play_with_breaks(PLAY1, (_G(flags)[V212] == 5000) ? "509wi03" : "509wi01",
0xc00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 2:
hotspot_set_active("CHRISTMAS LIGHTS ", false);
if (_G(flags)[V212] == 5000) {
_general.show("509wi03", 0xc00, 0, -1, -1, 31);
inv_give_to_player("CHRISTMAS LIGHTS ");
} else {
_general.show("509wi01", 0xc00, 0, -1, -1, 31);
inv_give_to_player("CHRISTMAS LIGHTS");
}
player_set_commands_allowed(true);
break;
case 3:
hotspot_set_active("CHRISTMAS LIGHTS ", true);
player_set_commands_allowed(false);
inv_move_object("CHRISTMAS LIGHTS", NOWHERE);
inv_move_object("CHRISTMAS LIGHTS ", NOWHERE);
_G(wilbur_should) = 14;
series_play_with_breaks(PLAY2, (_G(flags)[V212] == 5000) ? "509wi04" : "509wi02",
0xc00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 4:
_general.terminate();
_G(wilbur_should) = 5;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 5:
player_set_commands_allowed(false);
terminateMachineAndNull(_wire);
if (_G(flags)[V212] == 5000) {
if (_G(flags)[V234]) {
_G(wilbur_should) = 6;
_val5 = 1;
series_play_with_breaks(PLAY3, "509wi05", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
} else {
_G(wilbur_should) = 7;
series_play_with_breaks(PLAY4, "509wi05", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
}
} else {
_G(wilbur_should) = 8;
series_play_with_breaks(PLAY5, "509wi07", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
}
break;
case 6:
_val5 = 2;
hotspot_set_active("CHRISTMAS LIGHTS ", true);
_G(wilbur_should) = 8;
series_play_with_breaks(PLAY6, "509wi08", 0xc00, kCHANGE_WILBUR_ANIMATION, 3);
break;
case 7:
_G(wilbur_should) = 5004;
series_play_with_breaks(PLAY7, "509wi06", 0xc00, 5016, 3);
break;
case 8:
if (_state1) {
_G(wilbur_should) = 10;
} else if (_G(flags)[V212] == 5001) {
_G(wilbur_should) = 11;
} else {
_G(wilbur_should) = 10001;
}
inv_move_object("CHRISTMAS LIGHTS", NOWHERE);
inv_move_object("CHRISTMAS LIGHTS ", NOWHERE);
hotspot_set_active("CHRISTMAS LIGHTS ", true);
_wire = series_show("509wire", 0x900);
_lights = series_show((_G(flags)[V212] == 5000) ? "509lgt02" : "509lgt01", 0xc00);
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 9:
_G(wilbur_should) = 6;
break;
case 10:
_state1 = 0;
ws_unhide_walker();
wilbur_speech("500w087", 5001);
break;
case 11:
ws_unhide_walker();
player_set_commands_allowed(true);
wilbur_speech("500w088");
break;
case 12:
player_set_commands_allowed(false);
_G(wilbur_should) = 13;
switch (_val2) {
case 0:
digi_play("500w079", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 1:
digi_play("500w080", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 2:
digi_play("500w089", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 3:
digi_play("500w090", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 4:
digi_play("500w091", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 5:
_G(wilbur_should) = 4;
digi_play("500w084", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
case 6:
_G(wilbur_should) = 4;
digi_play("500w085", 1, 255, kCHANGE_WILBUR_ANIMATION);
break;
default:
break;
}
if (_G(flags)[V212] == 5000) {
_general.play("509wi03", 0xc00, 4, -1, 0, -1, 100, 0, 0, 16, 18);
} else {
_general.play("509wi01", 0xc00, 4, -1, 0, -1, 100, 0, 0, 16, 18);
}
break;
case 13:
_general.terminate();
_G(wilbur_should) = 2;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
break;
case 14:
_G(kernel).trigger_mode = KT_PARSE;
if (_G(flags)[V212] == 5000) {
_lights = series_show("509lgt02", 0xc00);
} else {
_lights = series_show("509lgt01", 0xc00);
}
ws_unhide_walker();
player_set_commands_allowed(true);
_G(wilbur_should) = 10002;
_G(player).command_ready = true;
_G(player).need_to_walk = true;
_G(player).ready_to_walk = true;
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room509::pre_parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (!inv_player_has("CHRISTMAS LIGHTS") && !inv_player_has("CHRISTMAS LIGHTS ")) {
if (player_said("HALLWAY") && !player_said_any("LEAVE", "LOOK AT", "GEAR"))
player_set_facing_hotspot();
} else {
_G(wilbur_should) = 12;
if (player_said("CHRISTMAS LIGHTS ", "PHONE CORD")) {
_val2 = _G(flags)[V234] ? 6 : 5;
} else if (player_said("CHRISTMAS LIGHTS", "PHONE CORD")) {
_G(wilbur_should) = 5;
} else if (player_said("LOOK AT") && player_said_any("CHRISTMAS LIGHTS", "CHRISTMAS LIGHTS ")) {
_val2 = player_said("CHRISTMAS LIGHTS") ? 1 : 0;
} else if (player_said("HOLE") && player_said_any("CHRISTMAS LIGHTS", "CHRISTMAS LIGHTS ")) {
_val2 = 2;
} else if (player_said("CHRISTMAS LIGHTS") || player_said("CHRISTMAS LIGHTS ")) {
_val2 = 4;
intr_cancel_sentence();
_G(player).need_to_walk = false;
} else {
_G(wilbur_should) = 3;
}
_G(player).ready_to_walk = false;
_general.terminate();
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
_G(player).command_ready = false;
}
}
void Room509::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("LOOK AT", "CHRISTMAS LIGHTS ") && _G(flags)[V212] == 5001) {
wilbur_speech("509w003");
} else if (player_said("GEAR", "CHRISTMAS LIGHTS ")) {
wilbur_speech("509w004");
} else if (player_said_any("CHRISTMAS LIGHTS", "CHRISTMAS LIGHTS ") && player_said("HOLE")) {
_val2 = 2;
kernel_trigger_dispatch_now(12);
} else if (player_said("LOOK AT", "HOLE") && _G(flags)[V227] != 0) {
wilbur_speech("500w003");
} else if (player_said("TAKE", "TELEPHONE") && _G(flags)[V197]) {
wilbur_speech("500w005");
} else if (_G(walker).wilbur_said(SAID)) {
// Already handled
} else if (player_said("HALLWAY") && player_said_any("LEAVE", "LOOK AT", "GEAR")) {
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 5009);
} else if (player_said("TAKE", "CHRISTMAS LIGHTS ")) {
_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,67 @@
/* 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_ROOM509_H
#define M4_BURGER_ROOMS_SECTION5_ROOM509_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room509 : public Section5Room {
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 int32 _state1;
static int32 _state2;
machine *_lights = nullptr;
machine *_wire = nullptr;
int _val1 = 0;
int _val2 = 0;
int _val3 = 0;
int _val4 = 0;
int _val5 = 0;
bool _flag1 = false;
public:
Room509();
~Room509() 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,298 @@
/* 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/room510.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
#define BUTTON_COUNT 7
const Room510::ButtonDef Room510::_BUTTONS[7] = {
{ 250, 159, 406, 189, 0, 1, 2, 3, 1, 4 },
{ 250, 190, 406, 216, 4, 5, 6, 7, 1, 5 },
{ 250, 217, 406, 244, 8, 9, 10, 11, 1, 6 },
{ 250, 245, 406, 265, 12, 13, 14, 15, 1, 7 },
{ 250, 266, 406, 291, 16, 17, 18, 19, 1, 8 },
{ 250, 292, 406, 316, 20, 21, 22, 23, 1, 9 },
{ 250, 317, 406, 343, 24, 25, 26, 27, 1, 10 }
};
Room510::Room510() : Section5Room() {
Common::copy(_BUTTONS, _BUTTONS + BUTTON_COUNT, _buttons);
}
void Room510::preload() {
_G(player).walker_in_this_scene = false;
}
void Room510::init() {
series_load("510butts");
_G(kernel).suppress_fadeup = true;
pal_fade_set_start(0);
pal_fade_init(_G(kernel).first_fade, 255, 100, 60, 2);
for (int i = 0; i < 7; ++i) {
_buttons[i]._state = 1;
setupButton(i);
}
_val2 = -1;
_val3 = -1;
_val4 = -1;
if (!player_been_here(510)) {
wilbur_speech("510w001");
} else if (!_G(flags)[V237]) {
wilbur_speech("510w002");
_G(flags)[V237] = 1;
}
}
void Room510::daemon() {
switch (_G(kernel).trigger) {
case 1:
_G(game).setRoom(_G(game).previous_room);
break;
case 2:
case 3:
_val4 = -1;
player_set_commands_allowed(true);
for (int i = 0; i < BUTTON_COUNT; ++i) {
if (_buttons[i]._state != GUI::NOTHING)
setButtonState(i, GUI::IN_CONTROL);
}
break;
case 4:
buttonAction(1, 0, 4);
break;
case 5:
buttonAction(2, 5, 9);
break;
case 6:
buttonAction(3, 10, 15);
break;
case 7:
buttonAction(4, 16, 19);
break;
case 8:
buttonAction(5, 20, 24);
break;
case 9:
buttonAction(6, 25, 29);
break;
case 10:
buttonAction(7, 30, 34);
break;
case kCALLED_EACH_LOOP:
if (player_commands_allowed())
updateButtons();
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Room510::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if (player_said("LOOK AT")) {
bool doneFlag = true;
if (player_said("RED BUTTON")) {
if (!player_been_here(503)) {
wilbur_speech("510w003");
} else if (_G(flags)[kBORK_STATE] != 16) {
wilbur_speech("510w004");
} else {
wilbur_speech("510w005");
}
} else if (player_said("ORANGE BUTTON")) {
if (!player_been_here(507)) {
wilbur_speech("510w006");
} else if (_G(flags)[V223] != 2) {
wilbur_speech("510w007");
} else {
wilbur_speech("510w008");
}
} else if (player_said("YELLOW BUTTON")) {
if (!player_been_here(504)) {
wilbur_speech("510w009");
} else if (_G(flags)[V210] != 5002) {
wilbur_speech("510w010");
} else {
wilbur_speech("510w011");
}
} else if (player_said("GREEN BUTTON")) {
if (!player_been_here(508)) {
wilbur_speech("510w012");
} else if (_G(flags)[V227] == 0) {
wilbur_speech("510w013");
} else {
wilbur_speech("510w014");
}
} else if (player_said("BLUE BUTTON")) {
if (!player_been_here(506)) {
wilbur_speech("510w015");
} else if (_G(flags)[V218] != 5003) {
wilbur_speech("510w016");
} else {
wilbur_speech("510w017");
}
} else if (player_said("PURPLE BUTTON")) {
wilbur_speech(_G(flags)[kStairsBorkState] != 5003 ? "510w018" : "510w019");
} else if (player_said("PINK BUTTON")) {
wilbur_speech("510w020");
} else {
doneFlag = false;
}
if (doneFlag) {
goto done;
}
}
if (player_said("TAKE")) {
wilbur_speech("500w001");
} else if (player_said("EXIT")) {
kernel_trigger_dispatch_now(1);
} else if (player_said("GEAR")) {
if (player_said("RED BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(0, GUI::SELECTED);
kernel_trigger_dispatch_now(4);
} else if (player_said("ORANGE BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(1, GUI::SELECTED);
kernel_trigger_dispatch_now(5);
} else if (player_said("YELLOW BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(2, GUI::SELECTED);
kernel_trigger_dispatch_now(6);
} else if (player_said("GREEN BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(3, GUI::SELECTED);
kernel_trigger_dispatch_now(7);
} else if (player_said("BLUE BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(4, GUI::SELECTED);
kernel_trigger_dispatch_now(8);
} else if (player_said("PURPLE BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(5, GUI::SELECTED);
kernel_trigger_dispatch_now(9);
} else if (player_said("PINK BUTTON")) {
_G(kernel).call_daemon_every_loop = false;
setButtonState(6, GUI::SELECTED);
kernel_trigger_dispatch_now(10);
} else {
return;
}
} else {
return;
}
done:
_G(player).command_ready = false;
}
void Room510::setupButton(int index) {
Button &btn = _buttons[index];
switch (btn._state) {
case 0:
btn._series = series_show("510butts", 0, 0, -1, -1, btn._index0);
break;
case 1:
btn._series = series_show("510butts", 0, 0, -1, -1, btn._index1);
break;
case 2:
btn._series = series_show("510butts", 0, 0, -1, -1, btn._index2);
break;
case 3:
btn._series = series_show("510butts", 0, 0, -1, -1, btn._index3);
break;
default:
break;
}
}
void Room510::setButtonState(int index, GUI::ControlStatus state) {
if (index >= 0) {
Button &btn = _buttons[index];
if (btn._state != GUI::NOTHING && btn._state != state) {
terminateMachineAndNull(btn._series);
btn._state = state;
setupButton(index);
}
}
}
void Room510::buttonAction(int index, int firstFrame, int lastFrame) {
const int max = (index == 4) ? 1 : 2;
digi_play(Common::String::format("510b00%d%c", index, 'a' + imath_ranged_rand(0, max)).c_str(), 2);
series_play("510waves", 0, 0, 2, 6, 2, 100, 0, 0, firstFrame, lastFrame);
}
void Room510::updateButtons() {
_val3 = getHighlightedButton();
if (_val2 != -1) {
setButtonState(_val2, (_val2 == _val3) ? GUI::SELECTED : GUI::IN_CONTROL);
} else if (_val3 == -1) {
setButtonState(_val4, GUI::IN_CONTROL);
} else if (_val3 != _val4) {
setButtonState(_val4, GUI::IN_CONTROL);
setButtonState(_val3, GUI::OVER_CONTROL);
}
}
int Room510::getHighlightedButton() const {
for (int i = 0; i < BUTTON_COUNT; ++i) {
const Button &btn = _buttons[i];
if (_G(MouseState).CursorColumn >= btn._x1 &&
_G(MouseState).CursorColumn <= btn._x2 &&
_G(MouseState).CursorRow >= btn._y1 &&
_G(MouseState).CursorRow <= btn._y2)
return i;
}
return -1;
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,80 @@
/* 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_ROOM510_H
#define M4_BURGER_ROOMS_SECTION5_ROOM510_H
#include "m4/burger/rooms/section5/section5_room.h"
#include "m4/burger/gui/inventory.h"
namespace M4 {
namespace Burger {
namespace Rooms {
#define BUTTON_COUNT 7
class Room510 : public Section5Room {
private:
struct ButtonDef {
int _x1;
int _y1;
int _x2;
int _y2;
int _index0;
int _index1;
int _index2;
int _index3;
int _state;
int _val10;
};
struct Button : public ButtonDef {
machine *_series = nullptr;
Button() : ButtonDef() {}
Button(const ButtonDef &src) : ButtonDef(src) {}
};
static const ButtonDef _BUTTONS[BUTTON_COUNT];
Button _buttons[BUTTON_COUNT];
//machine *_buttonSeries[BUTTON_COUNT];
int _val2 = 0;
int _val3 = 0;
int _val4 = 0;
void setupButton(int index);
void setButtonState(int index, GUI::ControlStatus state);
void buttonAction(int index, int firstFrame, int lastFrame);
void updateButtons();
int getHighlightedButton() const;
public:
Room510();
~Room510() 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,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/section5/room511.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room511::SERIES1[] = {
{ 0, "511b001a", 2, 255, -1, 0, &_state1, 1 },
{ 0, "511b001b", 2, 255, -1, 0, &_state1, 2 },
{ 0, "511b001c", 2, 255, -1, 0, &_state1, 3 },
{ 0, "511b001d", 2, 255, -1, 0, &_state1, 4 },
{ 0, "511b001e", 2, 255, -1, 0, &_state1, 5 },
{ 0, "511b001f", 2, 255, -1, 0, &_state1, 6 },
{ 0, "511b001g", 2, 255, -1, 0, &_state1, 7 },
{ 0, "511b001h", 2, 255, -1, 0, &_state1, 8 },
{ 0, "511b001e", 2, 255, -1, 0, &_state1, 9 },
{ 0, "511b001j", 2, 255, -1, 0, &_state1, 10 },
STREAM_BREAK_END
};
int32 Room511::_state1;
Room511::Room511() : Section5Room() {
_state1 = 0;
}
void Room511::preload() {
_G(player).walker_in_this_scene = false;
}
void Room511::init() {
_G(flags)[V194] = 1;
kernel_trigger_dispatch_now(1);
}
void Room511::daemon() {
if (_G(kernel).trigger == 1) {
_state1 = imath_ranged_rand(1, 10);
_val1 = imath_ranged_rand(1, 5);
switch (_G(flags)[V206]) {
case 5000:
series_stream_with_breaks(SERIES1, "511bk03", 8, 1, 5016);
break;
case 5001:
series_stream_with_breaks(SERIES1, "511bk07", 8, 1, 5016);
break;
case 5002:
series_stream_with_breaks(SERIES1, "511bk04", 8, 1, 5016);
break;
case 5003:
series_stream_with_breaks(SERIES1, "511bk08", 8, 1, 5016);
break;
case 5004:
series_stream_with_breaks(SERIES1, "511bk06", 8, 1, 5016);
break;
case 5005:
series_stream_with_breaks(SERIES1, "511bk05", 8, 1, 5016);
break;
default:
series_stream_with_breaks(SERIES1, "511bk02", 8, 1, 5016);
break;
}
} else {
_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_SECTION5_ROOM511_H
#define M4_BURGER_ROOMS_SECTION5_ROOM511_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room511 : public Section5Room {
private:
static const seriesStreamBreak SERIES1[];
static int32 _state1;
int _val1 = 0;
public:
Room511();
~Room511() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

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/ },.
*
*/
#include "m4/burger/rooms/section5/room512.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room512::SERIES1[] = {
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
{ 1, "512f003a", 1, 255, -1, 0, &_state1, 11 },
{ 1, "512f003b", 1, 255, -1, 0, &_state1, 12 },
{ 1, "512f001a", 1, 255, -1, 0, &_state1, 21 },
{ 1, "512f001b", 1, 255, -1, 0, &_state1, 22 },
{ 1, "512f001c", 1, 255, -1, 0, &_state1, 23 },
{ 1, "512f002a", 1, 255, -1, 0, &_state1, 31 },
{ 33, "608_001", 2, 200, -1, 0, nullptr, 0 },
{ 48, "608_002", 2, 200, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
int32 Room512::_state1;
Room512::Room512() : Section5Room() {
_state1 = 0;
}
void Room512::preload() {
_G(player).walker_in_this_scene = false;
}
void Room512::init() {
pal_cycle_init(101, 110, 6);
kernel_trigger_dispatch_now(1);
}
void Room512::daemon() {
switch (_G(kernel).trigger) {
case 1:
switch (_G(wilbur_should)) {
case kCHANGE_WILBUR_ANIMATION:
_state1 = imath_ranged_rand(11, 12);
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "512burnt", 6, 1, 2);
break;
case 5004:
_state1 = 31;
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "512burnt", 6, 1, 2);
break;
default:
_state1 = imath_ranged_rand(21, 23);
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "512burnt", 6, 1, 2);
break;
}
break;
case 2:
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
release_trigger_on_digi_state(k10027, 1);
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_SECTION5_ROOM512_H
#define M4_BURGER_ROOMS_SECTION5_ROOM512_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room512 : public Section5Room {
private:
static const seriesStreamBreak SERIES1[];
static int32 _state1;
public:
Room512();
~Room512() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

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/ },.
*
*/
#include "m4/burger/rooms/section5/room513.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const seriesStreamBreak Room513::SERIES1[] = {
{ 0, "513_001", 3, 40, -1, (uint)-1, nullptr, 0 },
{ 0, "513w001", 1, 255, -1, 0, nullptr, 0 },
{ 33, "513w002", 1, 255, -1, 0, nullptr, 0 },
{ 44, "513z001", 1, 255, -1, 0, nullptr, 0 },
{ 51, "513w003", 1, 255, -1, 0, nullptr, 0 },
{ 67, "513z002", 1, 255, -1, 0, nullptr, 0 },
{ 117, "513z003", 1, 255, -1, 0, nullptr, 0 },
{ 196, "513w005", 1, 255, -1, 0, nullptr, 0 },
{ 209, "513z004", 1, 255, -1, 0, nullptr, 0 },
{ 244, "513w006", 1, 255, -1, 0, nullptr, 0 },
{ 292, "513z005", 1, 255, -1, 0, nullptr, 0 },
{ 310, "513z006", 1, 255, -1, 0, nullptr, 0 },
STREAM_BREAK_END
};
void Room513::preload() {
_G(player).walker_in_this_scene = false;
}
void Room513::init() {
_G(flags)[kFourthTestPassed] = 1;
kernel_trigger_dispatch_now(1);
}
void Room513::daemon() {
switch (_G(kernel).trigger) {
case 1:
digi_preload_stream_breaks(SERIES1);
series_stream_with_breaks(SERIES1, "513OUTRO", 6, 1, k10027);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
} // 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_SECTION5_ROOM513_H
#define M4_BURGER_ROOMS_SECTION5_ROOM513_H
#include "m4/burger/rooms/section5/section5_room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Room513 : public Section5Room {
private:
static const seriesStreamBreak SERIES1[];
public:
Room513() : Section5Room() {}
~Room513() override {}
void preload() override;
void init() override;
void daemon() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,585 @@
/* 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/section5.h"
#include "m4/burger/gui/gui_gizmo.h"
#include "m4/burger/vars.h"
#include "m4/burger/burger.h"
#include "m4/gui/gui_sys.h"
namespace M4 {
namespace Burger {
namespace Rooms {
const char *Section5::PARSER[] = {
"GIZMO",
"LOOK AT",
"500w006",
"TAKE",
nullptr,
"BORK",
"500w007",
"BORK ",
"500w007",
"BORK ",
"500w007",
"MICROWAVE",
"500w008",
"OVEN",
"500w008",
"OUTLET",
"500w009",
"TOASTER",
"500w010",
"WASHING MACHINE",
"500w011",
"TELEVISION",
"500w012",
"VIDEO GAME",
"500w012",
"TOILET",
"500w011",
"TUB",
"500w011",
"CHRISTMAS LIGHTS ",
"500w012",
"CHRISTMAS LIGHTS ",
"500w012",
"TELEPHONE",
"500w012",
"AMPLIFIER",
nullptr,
nullptr,
"500w013",
PARSER_ITEM_END,
"ROLLING PIN",
"LOOK AT",
"500w014",
"TAKE",
nullptr,
"BORK",
"500w015",
"BORK ",
"500w015",
"BORK ",
"500w015",
"RUBBER DUCKY",
"500w032",
"RUBBER DUCKY ",
"500w032",
"RUBBER DUCKY ",
"500w032",
"FIREPLACE",
"500w016",
"PRUNES",
"500w018",
"WILBUR",
"500w019",
nullptr,
"500w020",
PARSER_ITEM_END,
"DIRTY SOCK",
"LOOK AT",
"500w021",
"TAKE",
nullptr,
"BORK",
"500w022",
"BORK ",
"500w022",
"BORK ",
"500w022",
"FIREPLACE",
"500w023",
"MICROWAVE",
"500w023",
"FRIDGE",
"500w024",
"OVEN",
"500w024",
"SINK",
"500w025",
"WASHING MACHINE",
"500w025",
"LAUNDRY HAMPER",
"500w023",
"WARDROBE",
"500w023",
"TOILET",
"500w023",
"TUB",
"500w025",
"SINK",
"500w025",
"SOAPY WATER",
"500w052",
"SOAPY WATER ",
"500w052",
"HOLE",
"500w026",
"WILBUR",
"500w027",
nullptr,
"500w028",
PARSER_ITEM_END,
"RUBBER DUCKY",
"LOOK AT",
"500w029",
"TAKE",
nullptr,
"GEAR",
nullptr,
"ROLLING PIN ",
"500w032",
"MICROWAVE",
"500w032",
"FRIDGE",
"500w033",
"OVEN",
"500w032",
"OUTLET",
"500w035",
"WRINGER",
"500w032",
"WASHING MACHINE",
"500w037",
"FIRE",
"500w030",
nullptr,
"500w043",
PARSER_ITEM_END,
"SOAPY WATER",
"LOOK AT",
"500w044",
"TAKE",
nullptr,
"BORK",
"500w045",
"BORK ",
"500w045",
"BORK ",
"500w045",
"STAIRS",
"500w046",
"KINDLING ",
"500w048",
"FIREPLACE",
"500w048",
"DIRTY SOCK ",
"500w052",
"WASHING MACHINE",
"500w053",
"TELEVISION",
"500w055",
"VIDEO GAME",
"500w056",
"FIRE",
"500w055",
"TOILET",
"500w057",
"TUB",
"500w058",
"WILBUR",
"500w059",
nullptr,
"500w060",
PARSER_ITEM_END,
"KINDLING",
"LOOK AT",
"500w061",
"TAKE",
nullptr,
"KINDLING ",
"500w064",
"BREAKER BOX",
"500w066",
"TOILET",
"500w068",
"TUB",
"500w068",
"CHIMNEY",
"500w070",
"CHIMNEY POTS",
"500w070",
"WILBUR",
"500w071",
nullptr,
"500w072",
PARSER_ITEM_END,
"RUBBER GLOVES",
"LOOK AT",
"500w073",
"TAKE",
nullptr,
"BORK",
"500w074",
"BORK ",
"500w074",
"BORK ",
"500w074",
"WRINGER",
"500w075",
"WASHING MACHINE",
"500w076",
nullptr,
"500w078",
PARSER_ITEM_END,
"CHRISTMAS LIGHTS",
"LOOK AT",
"500w080",
"TAKE",
nullptr,
"GEAR",
"500w019",
"WILBUR'S ROOM",
"500w081",
"BATHROOM",
"500w082",
"CHIMNEY",
"500w083",
"CHIMNEY POTS",
"500w083",
"WILBUR",
"500w090",
nullptr,
"500w091",
PARSER_ITEM_END,
"CHRISTMAS LIGHTS ",
"LOOK AT",
"500w079",
"TAKE",
nullptr,
"WILBUR'S ROOM",
"500w081",
"BATHROOM",
"500w082",
"CHIMNEY",
"500w083",
"CHIMNEY POTS",
"500w083",
"WILBUR",
"500w090",
nullptr,
"500w091",
PARSER_ITEM_END,
"BOTTLE",
"TAKE",
nullptr,
"SINK",
"503w047",
"WASHING MACHINE",
"504w033",
"TOILET",
"507w037",
nullptr,
nullptr,
PARSER_ITEM_END,
"AMPLIFIER",
"TAKE",
nullptr,
"PIANO",
"502w056",
"OUTLET",
"503w048",
"VIDEO GAME",
"506w039",
"PHONE CORD",
"509w028",
"GIZMO",
"999w028",
nullptr,
nullptr,
PARSER_ITEM_END,
nullptr
};
const seriesPlayBreak Section5::PLAY1[] = {
{ 0, 25, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
{ 26, 42, "500_030", 1, 255, -1, 0, 0, nullptr, 0 },
{ 43, -1, "500_030", 1, 255, -1, 0, 0, nullptr, 0 },
PLAY_BREAK_END
};
machine *Section5::_bork;
const char *Section5::_digiName;
const char *Section5::_bgDigiName;
Section5::Section5() : Rooms::Section() {
_bork = nullptr;
_digiName = nullptr;
add(501, &_room501);
add(502, &_room502);
add(503, &_room503);
add(504, &_room504);
add(505, &_room505);
add(506, &_room506);
add(507, &_room507);
add(508, &_room508);
add(509, &_room509);
add(510, &_room510);
add(511, &_room511);
add(512, &_room512);
add(513, &_room513);
}
void Section5::init() {
if (_G(executing) != WHOLE_GAME) {
inv_give_to_player("AMPLIFIER");
inv_give_to_player("BOTTLE");
}
}
void Section5::daemon() {
switch (_G(kernel).trigger) {
case 5001:
flagsTrigger();
break;
case 5002:
break;
case 5003: {
term_message("SET AMBIENCE trigger hit");
Section5Room *room = dynamic_cast<Section5Room *>(g_engine->_activeRoom);
assert(room);
room->init();
break;
}
case 5004:
term_message("Bork ambient noises trigger hit");
if (!digi_play_state(1) && _bgDigiName) {
digi_unload(_bgDigiName);
_bgDigiName = nullptr;
}
if (!digi_play_state(1) && !digi_play_state(2)) {
// The original did a random of 1 to 9, but the switch had 1 to 13.
// The extra cases are valid with unused sounds, so we re-enabled them
switch (imath_ranged_rand(1, 13)) {
case 1:
_bgDigiName = "500_015";
break;
case 2:
_bgDigiName = "500_016";
break;
case 3:
_bgDigiName = "500_017";
break;
case 4:
_bgDigiName = "500_018";
break;
case 5:
_bgDigiName = "500_019";
break;
case 6:
_bgDigiName = "500_020";
break;
case 7:
_bgDigiName = "500_021";
break;
case 8:
_bgDigiName = "500_022";
break;
case 9:
_bgDigiName = "500_023";
break;
case 10:
_bgDigiName = "500_024";
break;
case 11:
_bgDigiName = "500_025";
break;
case 12:
_bgDigiName = "500_026";
break;
case 13:
_bgDigiName = "500_027";
break;
default:
break;
}
digi_preload(_bgDigiName);
digi_play(_bgDigiName, 1, 125, -1);
}
kernel_timing_trigger(imath_ranged_rand(240, 360), 5004);
break;
case 5006:
_G(game).setRoom(502);
break;
case 5007:
_G(game).setRoom(503);
break;
case 5008:
_G(game).setRoom(504);
break;
case 5009:
_G(game).setRoom(505);
break;
case 5010:
_G(game).setRoom(506);
break;
case 5011:
_G(game).setRoom(507);
break;
case 5012:
_G(game).setRoom(508);
break;
case 5013:
_G(game).setRoom(509);
break;
case 5014:
player_update_info();
_G(flags)[V187] = _G(player_info).x;
_G(flags)[V188] = _G(player_info).y;
_G(flags)[V189] = _G(player_info).facing;
_G(game).setRoom(510);
break;
case 5015:
_G(game).setRoom(511);
break;
case 5016:
_G(game).setRoom(512);
break;
case 5017:
_G(game).setRoom(513);
break;
case 5018:
disable_player_commands_and_fade_init(5017);
break;
case kCHANGE_WILBUR_ANIMATION:
switch (_G(wilbur_should)) {
case 5001:
_G(flags)[V234] = 1;
ws_hide_walker();
_G(wilbur_should) = 5002;
player_update_info();
series_play_with_breaks(PLAY1, "503wi07", _G(player_info).depth,
kCHANGE_WILBUR_ANIMATION, 3, 6, _G(player_info).scale,
_G(player_info).x, _G(player_info).y);
break;
case 5002:
inv_move_object("RUBBER GLOVES", NOWHERE);
ws_unhide_walker();
player_set_commands_allowed(true);
wilbur_speech("500w077");
break;
case 5003:
player_set_commands_allowed(false);
ws_unhide_walker();
wilbur_speech("500w092", 5018);
break;
case 10015:
_G(game).setRoom(512);
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
break;
default:
_G(kernel).continue_handling_trigger = true;
break;
}
}
void Section5::parser() {
_G(kernel).trigger_mode = KT_DAEMON;
if ((player_said("GEAR", "RUBBER GLOVES") || player_said("RUBBER GLOVES", "WILBUR")) &&
_G(flags)[V234] == 0 && _G(game).previous_room != 508) {
player_set_commands_allowed(false);
_G(wilbur_should) = 5001;
ws_turn_to_face(4, kCHANGE_WILBUR_ANIMATION);
} else if (player_said("GIZMO") && player_said_any("WILBUR", "GEAR", "TAKE")) {
takeGizmo(_G(master_palette));
} else if (_G(walker).wilbur_parser(PARSER)) {
// Already handled
} else {
return;
}
_G(player).command_ready = false;
}
void Section5::takeGizmo(RGB8 *pal) {
if (player_commands_allowed() && INTERFACE_VISIBLE &&
!_G(pal_fade_in_progress) && !_GIZMO(initialized)) {
GUI::gizmo_anim(pal);
player_set_commands_allowed(false);
if (_G(flags)[V238] == 0) {
GUI::gizmo_digi_play("510w001", 255, _GIZMO(roomFlags)[0]);
++_G(flags)[V238];
} else if (_G(flags)[V238] == 1) {
GUI::gizmo_digi_play("510w002", 255, _GIZMO(roomFlags)[1]);
++_G(flags)[V238];
}
player_set_commands_allowed(true);
}
}
bool Section5::checkFlags() {
return _G(flags)[V197] && _G(flags)[kStairsBorkState] == 5003 &&
_G(flags)[V210] == 5002 && _G(flags)[V218] == 5003 &&
_G(flags)[V223] == 2 && _G(flags)[V227] != 0;
}
void Section5::flagsTrigger() {
player_set_commands_allowed(false);
if (checkFlags()) {
_G(wilbur_should) = 5003;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
kernel_trigger_dispatch_now(5002);
}
}
} // namespace Rooms
} // namespace Burger
} // namespace M4

View File

@@ -0,0 +1,87 @@
/* 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_H
#define M4_BURGER_ROOMS_SECTION5_H
#include "m4/burger/rooms/room.h"
#include "m4/burger/rooms/section.h"
#include "m4/burger/rooms/section5/room501.h"
#include "m4/burger/rooms/section5/room502.h"
#include "m4/burger/rooms/section5/room503.h"
#include "m4/burger/rooms/section5/room504.h"
#include "m4/burger/rooms/section5/room505.h"
#include "m4/burger/rooms/section5/room505.h"
#include "m4/burger/rooms/section5/room506.h"
#include "m4/burger/rooms/section5/room507.h"
#include "m4/burger/rooms/section5/room508.h"
#include "m4/burger/rooms/section5/room509.h"
#include "m4/burger/rooms/section5/room510.h"
#include "m4/burger/rooms/section5/room511.h"
#include "m4/burger/rooms/section5/room512.h"
#include "m4/burger/rooms/section5/room513.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section5 : public Rooms::Section {
private:
Room501 _room501;
Room502 _room502;
Room503 _room503;
Room504 _room504;
Room505 _room505;
Room506 _room506;
Room507 _room507;
Room508 _room508;
Room509 _room509;
Room510 _room510;
Room511 _room511;
Room512 _room512;
Room513 _room513;
void takeGizmo(RGB8 *pal);
public:
static const char *PARSER[];
static const seriesPlayBreak PLAY1[];
static machine *_bork;
static const char *_digiName;
static const char *_bgDigiName;
static bool checkFlags();
static void flagsTrigger();
public:
Section5();
virtual ~Section5() {}
void init() override;
void daemon() override;
void parser() override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif

View File

@@ -0,0 +1,103 @@
/* 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/section5_room.h"
#include "m4/burger/rooms/section5/section5.h"
#include "m4/burger/vars.h"
#include "m4/wscript/wst_regs.h"
namespace M4 {
namespace Burger {
namespace Rooms {
void Section5Room::preload() {
Rooms::Room::preload();
_G(flags)[V186] = 0;
_initFlag = false;
Section5::_digiName = nullptr;
Section5::_bgDigiName = nullptr;
}
void Section5Room::init() {
if (_initFlag) {
_initFlag = false;
kernel_timing_trigger(120, 5004);
}
if (Section5::_digiName != nullptr) {
digi_stop(3);
digi_unload(Section5::_digiName);
}
Section5::_digiName = nullptr;
int vol = 125;
switch (_G(game).room_id) {
case 502:
if (_G(flags)[kFireplaceHasFire])
Section5::_digiName = "500_002";
break;
case 505:
Section5::_digiName = "505_002";
break;
case 506:
if (_G(flags)[V218] == 5003) {
Section5::_digiName = "500_002";
} else {
Section5::_digiName = "506_005";
vol = 50;
}
break;
case 508:
Section5::_digiName = "500_029";
break;
default:
break;
}
if (Section5::_digiName) {
digi_preload(Section5::_digiName);
digi_play_loop(Section5::_digiName, 3, vol);
}
}
HotSpotRec *Section5Room::custom_hotspot_which(int32 x, int32 y) {
HotSpotRec *hotspot = Rooms::Room::custom_hotspot_which(x, y);
if (hotspot != nullptr || _G(flags)[V186] == 0 || !_borkStairs ||
(_G(game).room_id != 502 && _G(game).room_id != 505))
return hotspot;
assert(_borkTable);
const int index = _borkStairs.regs()[IDX_CELS_INDEX];
const int x1 = _borkTable[index]._x;
const int y1 = _borkTable[index]._y;
const int total = (x - x1) * (x - x1) + (y - y1) * (y - y1);
return (total < _borkThreshold) ? &_borkHotspot : nullptr;
}
} // 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_SECTION5_ROOM_H
#define M4_BURGER_ROOMS_SECTION5_ROOM_H
#include "m4/burger/rooms/room.h"
namespace M4 {
namespace Burger {
namespace Rooms {
class Section5Room : public Rooms::Room {
protected:
struct BorkPoint {
int16 _x;
int16 _y;
};
const BorkPoint *_borkTable = nullptr;
Series _borkStairs;
HotSpotRec _borkHotspot;
int _borkThreshold = 0;
bool _initFlag = false;
public:
Section5Room() : Rooms::Room() {
_borkHotspot.clear();
}
~Section5Room() override {}
void preload() override;
void init() override;
/**
* Used to tell if x,y is over the walker hotspot
*/
HotSpotRec *custom_hotspot_which(int32 x, int32 y) override;
};
} // namespace Rooms
} // namespace Burger
} // namespace M4
#endif