Initial commit
This commit is contained in:
495
engines/m4/burger/rooms/section3/mine.cpp
Normal file
495
engines/m4/burger/rooms/section3/mine.cpp
Normal file
@@ -0,0 +1,495 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/mine.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
#define MINE_END 39
|
||||
|
||||
const char *Mine::SAID[][4] = {
|
||||
{ "TUNNEL", "311w007", "311w007z", nullptr },
|
||||
{ "DEBRIS", nullptr, "311w010", "311w011" },
|
||||
{ "GROUND", "311w012", "311w007z", "311w007z" },
|
||||
{ "WALL", "311w012", "311w007z", "311w007z" },
|
||||
{ "CEILING", "311w012", "311w007z", "311w007z" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const int16 Mine::MINE_SCENE_NUMBERS[] = {
|
||||
305, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319
|
||||
};
|
||||
|
||||
const MineRoom Mine::MINE_INFO[] = {
|
||||
// Links Doors
|
||||
// --------------------- -------------------------- Correct
|
||||
// Room# Scene ID Back Front Left Right Back Front Left Right Link Check
|
||||
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ------- -----
|
||||
{ 0, SCENE_305, { 6, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0}, // mine entrance
|
||||
{ 1, SCENE_313, { -1, -1, 2, 6 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
|
||||
{ 2, SCENE_316, { -1, 11, 13, 1 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
|
||||
{ 3, SCENE_318, { 9, 14, 5, 4 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
{ 4, SCENE_315, { 5, -1, 3, 10 }, { FRONT, NONE, RIGHT, LEFT }, LEFT, 0},
|
||||
{ 5, SCENE_317, { 18, 4, 9, 3 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{ 6, SCENE_318, { 11, 0, 1, 7 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{ 7, SCENE_317, { 13, 14, 6, 18 }, { FRONT, RIGHT, RIGHT, LEFT }, FRONT, 0},
|
||||
{ 8, SCENE_313, { -1, -1, 10, 9 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
|
||||
{ 9, SCENE_318, { 10, 3, 8, 5 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ---- ---}--
|
||||
{10, SCENE_316, { -1, 9, 4, 8 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
|
||||
{11, SCENE_317, { 2, 6, 11, 11 }, { FRONT, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
{12, SCENE_319, { -1, -1, -1, 13 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
|
||||
{13, SCENE_316, { -1, 7, 12, 2 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
{14, SCENE_315, { 3, -1, 26, 7 }, { FRONT, NONE, BACK, FRONT}, LEFT, 0},
|
||||
{15, SCENE_317, { 17, 16, 17, 20 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{16, SCENE_311, { 15, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0},
|
||||
{17, SCENE_318, { 22, 15, 20, 15 }, { FRONT, BACK, RIGHT, LEFT }, LEFT, 0},
|
||||
{18, SCENE_316, { -1, 5, 7, 19 }, { NONE, BACK, RIGHT, LEFT }, LEFT, 0},
|
||||
{19, SCENE_312, { -1, -1, 18, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
|
||||
// ----- ---------- ---- ----- ---- ----- ----- ----- ------ ----- ---- ---}--
|
||||
{20, SCENE_315, { 26, -1, 15, 17 }, { FRONT, NONE, RIGHT, LEFT }, BACK, 0},
|
||||
{21, SCENE_319, { -1, -1, -1, 22 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
|
||||
{22, SCENE_316, { -1, 17, 21, 23 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
{23, SCENE_312, { -1, -1, 22, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
|
||||
{24, SCENE_318, { 35, 29, 33, 25 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{25, SCENE_314, { -1, -1, 24, 26 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
|
||||
{26, SCENE_317, { 14, 20, 25, 38 }, { LEFT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{27, SCENE_318, { 38, 38, 37, 28 }, { FRONT, BACK, RIGHT, LEFT }, BACK, 0},
|
||||
{28, SCENE_312, { -1, -1, 27, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
|
||||
{29, SCENE_317, { 24, 30, 35, 31 }, { FRONT, BACK, RIGHT, LEFT }, BACK, 0},
|
||||
// ----- ---------- ---- ----- ---- ----- ----- ----- ------ ----- ---- -----
|
||||
{30, SCENE_311, { 29, -1, -1, -1 }, { FRONT, NONE, NONE, NONE }, BACK, 0},
|
||||
{31, SCENE_312, { -1, -1, 29, -1 }, { NONE, NONE, RIGHT, NONE }, LEFT, 0},
|
||||
{32, SCENE_319, { -1, -1, -1, 33 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
|
||||
{33, SCENE_314, { -1, -1, 32, 24 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
|
||||
{34, SCENE_319, { -1, -1, -1, 35 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
|
||||
{35, SCENE_316, { -1, 24, 34, 29 }, { NONE, BACK, RIGHT, LEFT }, FRONT, 0},
|
||||
{36, SCENE_319, { -1, -1, -1, 37 }, { NONE, NONE, NONE, LEFT }, RIGHT, 0},
|
||||
{37, SCENE_314, { -1, -1, 36, 27 }, { NONE, NONE, RIGHT, LEFT }, RIGHT, 0},
|
||||
{38, SCENE_318, { 27, 27, 26, 39 }, { FRONT, BACK, RIGHT, LEFT }, RIGHT, 0},
|
||||
{39, SCENE_310, { -1, -1, 38, -1 }, { NONE, NONE, RIGHT, NONE }, NONE, 0}, // treasure
|
||||
// ----- ---------- ---- ----- ---- ----- ----- ----- ----- ----- ------- -----
|
||||
{40, NO_SCENE, { -1, -1, -1, -1 }, { NONE, NONE, NONE, NONE }, NONE, 0}
|
||||
};
|
||||
|
||||
const EntranceInfo Mine::ENTRANCE_INFO[MAX_SCENE_TYPES][4] = {
|
||||
//
|
||||
// ( offscreen_x, offscreen_y, enter_facing, home_x, home_y, home_facing ) x 4 possible entrances
|
||||
//
|
||||
// Back Front Left Right
|
||||
//----------------------- ------------------------- ------------------------- -------------------------
|
||||
{{285, 240, 5, 320, 290, 5}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}}, // 305
|
||||
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 55, 245, 3, 225, 275, 3}, { 0, 0, 0, 0, 0, 0}}, // 310
|
||||
{{315, 225, 7, 310, 275, 7}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}}, // 311
|
||||
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 90, 240, 3, 220, 270, 4}, { 0, 0, 0, 0, 0, 0}}, // 312
|
||||
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 65, 230, 3, 215, 270, 4}, {550, 240, 8, 400, 270, 8}}, // 313
|
||||
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 65, 240, 3, 190, 270, 4}, {570, 250, 8, 440, 280, 8}}, // 314
|
||||
{{320, 210, 7, 315, 270, 7}, { 0, 0, 0, 0, 0, 0}, { 60, 230, 3, 190, 270, 4}, {560, 250, 9, 400, 270, 8}}, // 315
|
||||
{{ 0, 0, 0, 0, 0, 0}, {400, 373,11, 335, 300, 7}, { 60, 220, 3, 200, 270, 4}, {570, 240, 8, 400, 270, 7}}, // 316
|
||||
{{320, 215, 7, 315, 270, 7}, {230, 373, 1, 330, 300, 7}, { 60, 220, 3, 200, 270, 4}, {570, 240, 8, 400, 270, 7}}, // 317
|
||||
{{320, 215, 5, 315, 270, 7}, {350, 373,11, 330, 300, 7}, { 60, 240, 3, 190, 270, 4}, {560, 235, 9, 420, 270, 8}}, // 318
|
||||
{{ 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0}, {530, 240, 9, 420, 270, 7}} // 319
|
||||
};
|
||||
|
||||
|
||||
const Rectangle Mine::FADE_DOWN_INFO[MAX_SCENE_TYPES][4] = {
|
||||
//
|
||||
// ( x1, y1, x2, y2) for four directions
|
||||
//
|
||||
// Back Front Left Right
|
||||
//------------------- ------------------- ------------------- -------------------
|
||||
{{255, 0, 315, 250}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}}, // 305
|
||||
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 170, 270}, { 0, 0, 0, 0}}, // 310
|
||||
{{270, 0, 365, 255}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}}, // 311
|
||||
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 175, 268}, { 0, 0, 0, 0}}, // 312
|
||||
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 172, 256}, {470, 0, 639, 265}}, // 313
|
||||
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 172, 265}, {470, 0, 639, 280}}, // 314
|
||||
{{280, 0, 365, 245}, { 0, 0, 0, 0}, { 0, 0, 165, 257}, {470, 0, 639, 271}}, // 315
|
||||
{{ 0, 0, 0, 0}, {325, 350, 500, 374}, { 0, 0, 178, 265}, {470, 0, 639, 265}}, // 316
|
||||
{{275, 0, 365, 255}, {136, 344, 360, 374}, { 0, 0, 165, 268}, {470, 0, 639, 270}}, // 317
|
||||
{{275, 0, 365, 252}, {185, 344, 500, 374}, { 0, 0, 165, 265}, {470, 0, 639, 270}}, // 318
|
||||
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, {470, 0, 639, 270}} // 319
|
||||
};
|
||||
|
||||
int16 Mine::_entranceDoor;
|
||||
|
||||
void MineRoom::clear() {
|
||||
roomNumber = 0;
|
||||
scene_id = 0;
|
||||
Common::fill(link, link + 4, 0);
|
||||
Common::fill(door, door + 4, 0);
|
||||
correctLink = 0;
|
||||
check = 0;
|
||||
}
|
||||
|
||||
Mine::Mine() : Section3Room() {
|
||||
_mineRoomInfo.clear();
|
||||
}
|
||||
|
||||
void Mine::preload() {
|
||||
Section3Room::preload();
|
||||
_mineCtr = 0;
|
||||
_G(player).walker_type = 0;
|
||||
_G(player).shadow_type = 0;
|
||||
}
|
||||
|
||||
void Mine::init() {
|
||||
setupDigi();
|
||||
|
||||
if (_G(flags)[kTrufflesInMine]) {
|
||||
for (int i = 0; i < 6; ++i)
|
||||
digi_preload(Common::String::format("300t001%c", 'a' + i));
|
||||
}
|
||||
|
||||
_fade_down_rect_active = false;
|
||||
set_palette_brightness(30);
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
_mineCtr = 0;
|
||||
|
||||
const int32 &mineRoomIndex = _G(flags)[kMineRoomIndex];
|
||||
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get this mine room info
|
||||
_presentSceneID = _mineRoomInfo.scene_id; // Set the scene ID
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(-50, 200);
|
||||
kernel_trigger_dispatch_now(301);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Mine::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 301:
|
||||
case 302: {
|
||||
const EntranceInfo &ei = ENTRANCE_INFO[_presentSceneID][_entranceDoor];
|
||||
|
||||
if (_G(kernel).trigger == 301)
|
||||
ws_demand_location(ei.offscreen_x, ei.offscreen_y, ei.enter_facing);
|
||||
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(ei.home_x, ei.home_y, nullptr, 303, ei.home_facing);
|
||||
term_message("Mine entry %d at (%d,%d) to (%d,%d, %d)",
|
||||
_presentSceneID,
|
||||
ei.offscreen_x, ei.offscreen_y,
|
||||
ei.home_x, ei.home_y, ei.home_facing);
|
||||
break;
|
||||
}
|
||||
|
||||
case 303:
|
||||
player_set_commands_allowed(true);
|
||||
|
||||
if (_G(game).room_id == 310) {
|
||||
if (_G(flags)[V141]) {
|
||||
_G(wilbur_should) = 10002;
|
||||
} else {
|
||||
_G(flags)[V141] = 1;
|
||||
_G(wilbur_should) = 408;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (_G(game).room_id != 305) {
|
||||
if (!_G(flags)[kEnteredMine]) {
|
||||
_G(flags)[kEnteredMine] = 1;
|
||||
_G(wilbur_should) = _G(flags)[kTrufflesInMine] ? 402 : 401;
|
||||
} else if (!imath_rand_bool(3)) {
|
||||
_G(wilbur_should) = 10002;
|
||||
} else if (!_G(flags)[kTrufflesInMine]) {
|
||||
_G(wilbur_should) = 404;
|
||||
} else {
|
||||
_G(wilbur_should) = inv_player_has("WHISTLE") ? 406 : 405;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 304:
|
||||
digi_play("300_007", 2);
|
||||
break;
|
||||
|
||||
case 305:
|
||||
_volume = 160 - getTreasureDistance() * 25;
|
||||
_random1 = imath_ranged_rand(0, 5);
|
||||
digi_play(Common::String::format("300t001%c", 'a' + _random1).c_str(), 3, _volume);
|
||||
break;
|
||||
|
||||
case 10008:
|
||||
switch (_G(game).room_id) {
|
||||
case 305:
|
||||
case 310:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (_G(flags)[kTrufflesInMine] && !_G(flags)[kTrufflesRanAway])
|
||||
kernel_timing_trigger(15, 305);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 401:
|
||||
wilbur_speech("311w001");
|
||||
break;
|
||||
|
||||
case 402:
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 403;
|
||||
wilbur_speech("311w002", kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 403:
|
||||
player_set_commands_allowed(true);
|
||||
wilbur_speech("311w003");
|
||||
break;
|
||||
|
||||
case 404:
|
||||
player_set_commands_allowed(true);
|
||||
_random2 = imath_ranged_rand(0, 5);
|
||||
wilbur_speech(Common::String::format("311w004%c", 'a' + _random2).c_str());
|
||||
break;
|
||||
|
||||
case 405:
|
||||
term_message("Wilbur enters the mine with no whistle!");
|
||||
player_set_commands_allowed(true);
|
||||
_random2 = imath_ranged_rand(0, 3);
|
||||
digi_play(Common::String::format("311w005%c", 'a' + _random2).c_str(), 3, _volume);
|
||||
break;
|
||||
|
||||
case 406:
|
||||
_random2 = imath_ranged_rand(0, 2);
|
||||
wilbur_speech(Common::String::format("311w006%c", 'a' + _random2).c_str());
|
||||
break;
|
||||
|
||||
case 407:
|
||||
if (_G(flags)[V136]) {
|
||||
_random2 = imath_ranged_rand(0, 6);
|
||||
wilbur_speech(Common::String::format("311w009%c", 'a' + _random2).c_str());
|
||||
} else {
|
||||
wilbur_speech("311w008");
|
||||
}
|
||||
break;
|
||||
|
||||
case 408:
|
||||
wilbur_speech("310w001");
|
||||
break;
|
||||
|
||||
case kWILBUR_SPEECH_STARTED:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
term_message("Mine whistle daemon thing");
|
||||
|
||||
switch (_G(game).room_id) {
|
||||
case 305:
|
||||
if (_G(flags)[kTrufflesInMine]) {
|
||||
_G(flags)[V002] = 1;
|
||||
wilbur_speech("300w060");
|
||||
}
|
||||
break;
|
||||
|
||||
case 310:
|
||||
if (_G(flags)[kTrufflesInMine] && !_G(flags)[kTrufflesRanAway]) {
|
||||
_G(flags)[kTrufflesRanAway] = 1;
|
||||
} else {
|
||||
wilbur_speech("300w069");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!_G(flags)[kTrufflesInMine] && _G(flags)[kTrufflesRanAway]) {
|
||||
// Truffles is too far away
|
||||
wilbur_speech("300w061");
|
||||
} else if (!_G(flags)[V148]) {
|
||||
_G(flags)[V148] = 1;
|
||||
_treasureDistance = getTreasureDistance();
|
||||
|
||||
switch (_treasureDistance) {
|
||||
case 1:
|
||||
wilbur_speech("300w062");
|
||||
break;
|
||||
case 2:
|
||||
wilbur_speech("300w063");
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
wilbur_speech("300w064");
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
wilbur_speech("300w065");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_previousDistance = _treasureDistance;
|
||||
} else {
|
||||
_treasureDistance = getTreasureDistance();
|
||||
|
||||
if (_treasureDistance < _previousDistance) {
|
||||
wilbur_speech("300w068");
|
||||
} else if (_treasureDistance == _previousDistance) {
|
||||
wilbur_speech("300w067");
|
||||
} else {
|
||||
wilbur_speech("300w066");
|
||||
}
|
||||
|
||||
_previousDistance = _treasureDistance;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case kCALLED_EACH_LOOP:
|
||||
if (_fade_down_rect_active) {
|
||||
player_update_info();
|
||||
|
||||
if (_G(player_info).x >= _fade_down_rect.x1 &&
|
||||
_G(player_info).x <= _fade_down_rect.x2 &&
|
||||
_G(player_info).y >= _fade_down_rect.y1 &&
|
||||
_G(player_info).y <= _fade_down_rect.y2) {
|
||||
if (player_commands_allowed()) {
|
||||
pal_fade_set_start(100);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 40, -1);
|
||||
}
|
||||
|
||||
player_set_commands_allowed(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Mine::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
_fade_down_rect_active = false;
|
||||
|
||||
if (player_said("tunnel") && player_said_any("walk through", "GEAR")) {
|
||||
if (_G(player).click_y > 300)
|
||||
set_fade_down_rect(FRONT);
|
||||
else if (_G(player).click_x < 200)
|
||||
set_fade_down_rect(LEFT);
|
||||
else if (_G(player).click_x < 400)
|
||||
set_fade_down_rect(BACK);
|
||||
else
|
||||
set_fade_down_rect(RIGHT);
|
||||
|
||||
// Turn on the fade down area
|
||||
_fade_down_rect_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Mine::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (player_said("LOOK AT") && player_said_any("WALL", "CEILING", "GROUND")) {
|
||||
term_message("Room #: %d", _G(flags)[kMineRoomIndex]);
|
||||
term_message("Distance from pig: %d", getTreasureDistance());
|
||||
|
||||
_mineCtr = (_mineCtr + 1) % 5;
|
||||
|
||||
if (_mineCtr == 0) {
|
||||
wilbur_speech("311w012");
|
||||
_G(player).command_ready = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("tunnel") && player_said_any("walk through", "GEAR")) {
|
||||
pal_fade_set_start(0);
|
||||
|
||||
if (_G(player).click_y > 300)
|
||||
mine_travel_link(FRONT);
|
||||
else if (_G(player).click_x < 200)
|
||||
mine_travel_link(LEFT);
|
||||
else if (_G(player).click_x > 400)
|
||||
mine_travel_link(RIGHT);
|
||||
else
|
||||
mine_travel_link(BACK);
|
||||
} else if (player_said("LOOK AT", "DEBRIS") && _G(game).room_id != 305) {
|
||||
_G(wilbur_should) = 407;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
int Mine::getTreasureDistance() const {
|
||||
int distance = 0;
|
||||
|
||||
for (int index = _G(flags)[kMineRoomIndex]; index != MINE_END; ++distance) {
|
||||
const MineRoom &me = MINE_INFO[index];
|
||||
index = me.link[me.correctLink];
|
||||
}
|
||||
|
||||
return distance;
|
||||
}
|
||||
|
||||
void Mine::mine_travel_link(int16 takeLink) {
|
||||
int32 &mineRoomIndex = _G(flags)[kMineRoomIndex];
|
||||
|
||||
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get this mine room info
|
||||
_entranceDoor = _mineRoomInfo.door[takeLink]; // Get which door to enter from in new room
|
||||
mineRoomIndex = _mineRoomInfo.link[takeLink]; // Get which link to take
|
||||
assert(mineRoomIndex != -1);
|
||||
|
||||
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get new mine room info from new index
|
||||
_presentSceneID = _mineRoomInfo.scene_id; // Set the scene ID
|
||||
_G(game).setRoom(MINE_SCENE_NUMBERS[_presentSceneID]); // Go to the corresponding scene number
|
||||
_G(kernel).force_restart = true; // Makes the scene start over even if new_room = present room
|
||||
}
|
||||
|
||||
void Mine::set_fade_down_rect(MineDoors exit_door) {
|
||||
_fade_down_rect.x1 = FADE_DOWN_INFO[_presentSceneID][exit_door].x1;
|
||||
_fade_down_rect.y1 = FADE_DOWN_INFO[_presentSceneID][exit_door].y1;
|
||||
_fade_down_rect.x2 = FADE_DOWN_INFO[_presentSceneID][exit_door].x2;
|
||||
_fade_down_rect.y2 = FADE_DOWN_INFO[_presentSceneID][exit_door].y2;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
134
engines/m4/burger/rooms/section3/mine.h
Normal file
134
engines/m4/burger/rooms/section3/mine.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_MINE_ROOM_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_MINE_ROOM_H
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum MineDoors {
|
||||
BACK, FRONT, LEFT, RIGHT, MAX_DOORS, NONE
|
||||
};
|
||||
|
||||
enum MineScenes {
|
||||
SCENE_305, // treasure
|
||||
SCENE_310, // mine entrance
|
||||
SCENE_311, // one door (a)
|
||||
SCENE_312, // one door (b)
|
||||
SCENE_313, // two doors (a)
|
||||
SCENE_314, // two doors (b)
|
||||
SCENE_315, // three doors (a)
|
||||
SCENE_316, // three doors (b)
|
||||
SCENE_317, // four doors (a)
|
||||
SCENE_318, // four doors (b)
|
||||
SCENE_319, // one door (c)
|
||||
MAX_SCENE_TYPES,
|
||||
TREASURE_SCENE = SCENE_310,
|
||||
ENTRANCE_SCENE = SCENE_305,
|
||||
NO_SCENE = MAX_SCENE_TYPES
|
||||
};
|
||||
|
||||
|
||||
struct MineRoom {
|
||||
int16 roomNumber; // The mine room number
|
||||
int16 scene_id; // The scene id (indexes for mine_scene_numbers)
|
||||
int16 link[4]; // Links to other mine rooms
|
||||
int16 door[4]; // Specify doors to use
|
||||
int16 correctLink; // The correct link to take to get to the treasure
|
||||
int16 check; // Used to check the maze sanity
|
||||
|
||||
void clear();
|
||||
};
|
||||
|
||||
struct EntranceInfo {
|
||||
int16 offscreen_x;
|
||||
int16 offscreen_y;
|
||||
int16 enter_facing;
|
||||
int16 home_x;
|
||||
int16 home_y;
|
||||
int16 home_facing;
|
||||
};
|
||||
|
||||
struct Rectangle {
|
||||
int16 x1;
|
||||
int16 y1;
|
||||
int16 x2;
|
||||
int16 y2;
|
||||
};
|
||||
|
||||
class Mine : public Section3Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const int16 MINE_SCENE_NUMBERS[];
|
||||
static const MineRoom MINE_INFO[];
|
||||
|
||||
/**
|
||||
* Coords for starting fade down for exits
|
||||
*/
|
||||
static const Rectangle FADE_DOWN_INFO[MAX_SCENE_TYPES][4];
|
||||
|
||||
/**
|
||||
* Room coords for entrance walk-ins
|
||||
*/
|
||||
static const EntranceInfo ENTRANCE_INFO[MAX_SCENE_TYPES][4];
|
||||
|
||||
int _mineCtr = 0;
|
||||
int16 _presentSceneID = 0;
|
||||
static int16 _entranceDoor; // Shared between cellar and mine room classes
|
||||
MineRoom _mineRoomInfo;
|
||||
bool _fade_down_rect_active = false; // True if a fade down should occur when walker in the fade_down_rect
|
||||
Rectangle _fade_down_rect = {0, 0, 0, 0}; // If the walker is in his rectum and its active, turn off the lights
|
||||
int _volume = 0;
|
||||
int _random1 = 0;
|
||||
int _random2 = 0;
|
||||
int _treasureDistance = 0;
|
||||
int _previousDistance = 0;
|
||||
|
||||
int getTreasureDistance() const;
|
||||
|
||||
protected:
|
||||
const char *getDigi() override {
|
||||
return "300_004";
|
||||
}
|
||||
|
||||
void mine_travel_link(int16 takeLink);
|
||||
void set_fade_down_rect(MineDoors exit_door);
|
||||
|
||||
public:
|
||||
Mine();
|
||||
virtual ~Mine() {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
263
engines/m4/burger/rooms/section3/room301.cpp
Normal file
263
engines/m4/burger/rooms/section3/room301.cpp
Normal file
@@ -0,0 +1,263 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room301.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const seriesStreamBreak Room301::SERIES1[] = {
|
||||
{ 0, nullptr, 0, 0, 16, 0, nullptr, 0 },
|
||||
{ 1, "301_010", 3, 60, -1, (uint)-1, nullptr, 0 },
|
||||
{ 9, "301W001", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 39, "301F001", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 42, "301_007", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 63, "301_003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 65, "301_019", 2, 275, -1, 0, nullptr, 0 },
|
||||
{ 75, nullptr, 1, 0, -1, 0, nullptr, 0 },
|
||||
{ 77, "301F001A", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 110, "301Z001", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 129, nullptr, 0, 0, 15, 0, nullptr, 0 },
|
||||
{ 132, nullptr, 0, 0, 20, 0, nullptr, 0 },
|
||||
{ 133, nullptr, 3, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room301::SERIES2[] = {
|
||||
{ 0, nullptr, 0, 0, 17, 0, nullptr, 0 },
|
||||
{ 1, "301_010", 3, 60, -1, (uint)-1, nullptr, 0 },
|
||||
{ 12, "301Z002x", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 17, "301_002", 2, 125, -1, 0, nullptr, 0 },
|
||||
{ 31, "301Z002y", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 105, "301Z002z", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 136, "301W003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 161, "301Z003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 301, "301F003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 335, "301Z005x", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 372, "301Z005y", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 385, "301Z005z", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 434, "301_017", 2, 150, -1, 0, nullptr, 0 },
|
||||
{ 438, "301Z006", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 456, "301Z011y", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 488, "301Z011z", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 526, "301_021", 2, 200, -1, 0, nullptr, 0 },
|
||||
{ 542, "301Z007", 1, 150, -1, 0, nullptr, 0 },
|
||||
{ 549, "301w999", 2, 150, -1, 0, nullptr, 0 },
|
||||
{ 564, "301Z008", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 591, "301W004", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 620, "301Z009y", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 631, "301Z009z", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 688, "301Z010x", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 700, "301Z010y", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 747, "301Z010z", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 792, "301_009", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 795, "301_003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 803, "301_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 812, "301_011", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 821, "301_005", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 826, "301_018", 2, 175, -1, 0, nullptr, 0 },
|
||||
{ 835, nullptr, 1, 0, -1, 0, nullptr, 0 },
|
||||
{ 836, nullptr, 0, 0, 15, 0, nullptr, 0 },
|
||||
{ 837, nullptr, 0, 0, 20, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room301::SERIES3[] = {
|
||||
{ 0, "301_004", 3, 100, -1, (uint)-1, nullptr, 0 },
|
||||
{ 0, "301_010", 2, 30, -1, (uint)-1, nullptr, 0 },
|
||||
{ 0, nullptr, 0, 0, 18, 0, nullptr, 0 },
|
||||
{ 1, "301Z101", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 30, "301W101", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 49, "301Z102", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 96, "301W102", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 127, nullptr, 0, 0, 15, 0, nullptr, 0 },
|
||||
{ 130, nullptr, 3, 0, -1, 0, nullptr, 0 },
|
||||
{ 131, nullptr, 0, 0, 20, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room301::SERIES4[] = {
|
||||
{ 0, "301_010", 2, 30, -1, (uint)-1, nullptr, 0 },
|
||||
{ 0, nullptr, 0, 0, 18, 0, nullptr, 0 },
|
||||
{ 1, "301_004", 3, 255, -1, (uint)-1, nullptr, 0 },
|
||||
{ 37, nullptr, 0, 0, 15, 0, nullptr, 0 },
|
||||
{ 38, nullptr, 0, 0, 20, 0, nullptr, 0 },
|
||||
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
void Room301::preload() {
|
||||
_G(player).walker_in_this_scene = false;
|
||||
}
|
||||
|
||||
void Room301::init() {
|
||||
setupDigi();
|
||||
_G(flags).reset3();
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
digi_preload_stream_breaks(SERIES3);
|
||||
digi_preload_stream_breaks(SERIES4);
|
||||
|
||||
if (_G(executing) != WHOLE_GAME) {
|
||||
inv_give_to_player("JUG");
|
||||
inv_give_to_player("CARROT JUICE");
|
||||
inv_give_to_player("WHISTLE");
|
||||
}
|
||||
|
||||
_G(kernel).suppress_fadeup = true;
|
||||
kernel_trigger_dispatch_now(1);
|
||||
}
|
||||
|
||||
void Room301::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
pal_fade_set_start(0);
|
||||
series_stream_with_breaks(SERIES1, "301lab01", 6, 1, 2);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
pal_fade_set_start(0);
|
||||
pal_cycle_stop();
|
||||
kernel_timing_trigger(6, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
compact_mem_and_report();
|
||||
kernel_timing_trigger(6, 4);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
pal_fade_set_start(0);
|
||||
series_stream_with_breaks(SERIES3, "301orb01", 6, 1, 5);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
pal_fade_set_start(0);
|
||||
pal_cycle_stop();
|
||||
kernel_timing_trigger(6, 6);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
compact_mem_and_report();
|
||||
kernel_timing_trigger(6, 7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
pal_fade_set_start(0);
|
||||
series_stream_with_breaks(SERIES2, "301lab02", 6, 1, 9);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
pal_fade_set_start(0);
|
||||
pal_cycle_stop();
|
||||
kernel_timing_trigger(6, 9);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
compact_mem_and_report();
|
||||
kernel_timing_trigger(6, 10);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
pal_fade_set_start(0);
|
||||
digi_unload_stream_breaks(SERIES3);
|
||||
series_stream_with_breaks(SERIES4, "301orb02", 6, 1, 11);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
pal_fade_set_start(0);
|
||||
pal_cycle_stop();
|
||||
kernel_timing_trigger(6, 12);
|
||||
digi_unload_stream_breaks(SERIES2);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
compact_mem_and_report();
|
||||
kernel_timing_trigger(6, 3001);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
gr_pal_set_range(120, 8);
|
||||
pal_cycle_init(118, 127, 6, -1, -1);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
break;
|
||||
|
||||
case 15:
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, -1);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
pal_fade_set_start(0);
|
||||
digi_unload_stream_breaks(SERIES3);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 13);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
pal_fade_set_start(0);
|
||||
pal_mirror_colours(120, 122);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 14);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
pal_fade_set_start(0);
|
||||
pal_mirror_colours(32, 39);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 100, 30, 19);
|
||||
break;
|
||||
|
||||
case 19:
|
||||
gr_pal_set_range(32, 16);
|
||||
pal_cycle_init(32, 47, 6, -1);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
pal_cycle_stop();
|
||||
break;
|
||||
|
||||
case 3001:
|
||||
_G(kernel).suppress_fadeup = false;
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
digi_unload_stream_breaks(SERIES3);
|
||||
digi_unload_stream_breaks(SERIES4);
|
||||
digi_preload("301_016");
|
||||
digi_play("301_016", 1, 255);
|
||||
adv_kill_digi_between_rooms(false);
|
||||
_G(game).setRoom(302);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
51
engines/m4/burger/rooms/section3/room301.h
Normal file
51
engines/m4/burger/rooms/section3/room301.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM301_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM301_H
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room301 : public Section3Room {
|
||||
private:
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesStreamBreak SERIES2[];
|
||||
static const seriesStreamBreak SERIES3[];
|
||||
static const seriesStreamBreak SERIES4[];
|
||||
|
||||
public:
|
||||
Room301() : Section3Room() {}
|
||||
~Room301() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
614
engines/m4/burger/rooms/section3/room302.cpp
Normal file
614
engines/m4/burger/rooms/section3/room302.cpp
Normal file
@@ -0,0 +1,614 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room302.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const char *Room302::SAID[][4] = {
|
||||
{ "DOOR", nullptr, "300w001", nullptr },
|
||||
{ "STORM CELLAR", nullptr, "300w002", nullptr },
|
||||
{ "BACK YARD", "302w002", "302w002", nullptr },
|
||||
{ "BURGER MORSEL ", nullptr, nullptr, "302w010" },
|
||||
{ "TRUFFLES", nullptr, "302w013", "302w014" },
|
||||
{ "TROUGH", "302w015", "300w003", "302w016" },
|
||||
{ "SIGN", "302w017", "300w004", "300w005" },
|
||||
{ "CABIN", "302w018", "300w002", "300w002" },
|
||||
{ "WINDOW", "302w021", "300w002", "302w022" },
|
||||
{ "ROCKING CHAIR", "302w019", "302w020", "302w020" },
|
||||
{ "CRASHED ROCKET", "302w023", "300w003", "302w024" },
|
||||
{ "DOCK", "302w025", "300w002", "302w026" },
|
||||
{ "FORCE FIELD", "302w027", "300w002", "300w002" },
|
||||
{ "ROCK", "302w028", "300w002", "300w002" },
|
||||
{ "TREES", "302w029", "300w002", "300w002" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room302::SERIES1[] = {
|
||||
{ 0, "302p004", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 19, "302_008", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room302::SERIES2[] = {
|
||||
{ 7, "302_002", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 9, "302w001a", 2, 255, -1, 0, &_state1, 0 },
|
||||
{ 9, "302w001b", 2, 255, -1, 0, &_state1, 1 },
|
||||
{ 9, "302w001c", 2, 255, -1, 0, &_state1, 2 },
|
||||
{ 34, "302_005", 2, 125, -1, 0, nullptr, 0 },
|
||||
{ 48, "302_006", 2, 125, -1, 1024, nullptr, 0 },
|
||||
{ 138, "302_007", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 138, "302_003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 152, "302_007", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 152, "302_003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 165, nullptr, 2, 0, 4, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room302::SERIES3[] = {
|
||||
{ 7, "302_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 9, "302w001a", 1, 255, -1, 0, &_state1, 0 },
|
||||
{ 9, "302w001b", 1, 255, -1, 0, &_state1, 1 },
|
||||
{ 9, "302w001c", 1, 255, -1, 0, &_state1, 2 },
|
||||
{ 24, "302p001", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 35, "302_005", 2, 125, -1, 0, nullptr, 0 },
|
||||
{ 48, "302_006", 2, 125, -1, 1024, nullptr, 0 },
|
||||
{ 52, "302p003", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 71, "302_008", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY1[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY2[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY3[] = {
|
||||
{ 0, -1, "304_001", 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY4[] = {
|
||||
{ 0, 1, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 2, -1, "302w002", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY5[] = {
|
||||
{ 0, 22, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 23, -1, "302_001", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY6[] = {
|
||||
{ 0, 7, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 8, -1, nullptr, 1, 0, 5, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY7[] = {
|
||||
{ 0, 29, "302t004", 2, 155, -1, 2048, 0, nullptr, 0 },
|
||||
{ 26, 29, "302t005", 2, 155, -1, 0, 12, &Flags::_flags[V110], 0 },
|
||||
{ 26, 29, "302t005", 2, 155, -1, 0, 3, &Flags::_flags[V110], 1 },
|
||||
{ 30, 61, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY8[] = {
|
||||
{ 62, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY9[] = {
|
||||
{ 0, 28, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 29, -1, nullptr, 1, 0, 6, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY10[] = {
|
||||
{ 0, 4, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY11[] = {
|
||||
{ 5, 13, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY12[] = {
|
||||
{ 6, 16, "302t002", 2, 155, -1, 0, 0, nullptr, 0 },
|
||||
{ 11, 17, nullptr, 2, 0, -1, 3, 2, nullptr, 0 },
|
||||
{ 12, 6, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room302::PLAY13[] = {
|
||||
{ 0, 4, "302t003", 2, 155, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 5, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, 5, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 3, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 3, 4, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 5, 0, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
int32 Room302::_state1;
|
||||
|
||||
|
||||
Room302::Room302() : Section3Room() {
|
||||
_state1 = 0;
|
||||
}
|
||||
|
||||
void Room302::init() {
|
||||
setupDigi();
|
||||
|
||||
if (!_G(flags)[kTrufflesInMine]) {
|
||||
static const char *NAMES[12] = {
|
||||
"302t001a", "302t001b", "302t001c", "302t001d", "302t001e",
|
||||
"302t001f", "302t001g", "302t001h", "302t002", "302t003",
|
||||
"302t004", "302t005"
|
||||
};
|
||||
for (int i = 0; i < 12; ++i)
|
||||
digi_preload(NAMES[i], 302);
|
||||
}
|
||||
|
||||
player_set_commands_allowed(false);
|
||||
pal_cycle_init(112, 127, 6, -1, -1);
|
||||
|
||||
if (_G(flags)[kTrufflesInMine]) {
|
||||
hotspot_set_active("TRUFFLES", false);
|
||||
} else if (_G(flags)[kPerkinsLostIsland]) {
|
||||
series_load("302tr01");
|
||||
series_load("302tr01s");
|
||||
series_load("302tr02");
|
||||
series_load("302tr02s");
|
||||
series_load("302tr03");
|
||||
series_load("302tr03s");
|
||||
_val1 = 24;
|
||||
kernel_trigger_dispatch_now(9);
|
||||
} else {
|
||||
_val1 = 21;
|
||||
kernel_trigger_dispatch_now(9);
|
||||
}
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 303:
|
||||
_G(wilbur_should) = _G(flags)[V125] ? 6 : 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 304:
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 305:
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
ws_demand_location(341, 287, 9);
|
||||
ws_hide_walker();
|
||||
_state1 = imath_ranged_rand(0, 2);
|
||||
|
||||
if (_G(flags)[kPerkinsLostIsland]) {
|
||||
_G(flags)[V113] = 1;
|
||||
_volume = 125;
|
||||
_val4 = 29;
|
||||
} else {
|
||||
_val4 = 30;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(10);
|
||||
_G(flags)[V107] = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (_G(flags)[V107]) {
|
||||
hotspot_set_active("BURGER MORSEL ", false);
|
||||
} else {
|
||||
_series1 = series_show("302BURG", 0x200);
|
||||
hotspot_set_active("BURGER MORSEL ", true);
|
||||
}
|
||||
}
|
||||
|
||||
void Room302::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
wilbur_speech("302w009z");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_unhide_walker();
|
||||
ws_walk(500, 250, nullptr, 3, 8, true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_volume -= 20;
|
||||
if (_volume > 0) {
|
||||
term_message("fading propellor, current volume = %d", _volume);
|
||||
digi_change_volume(2, _volume);
|
||||
kernel_timing_trigger(10, 4);
|
||||
} else {
|
||||
digi_stop(2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
terminateMachineAndNull(_series1);
|
||||
inv_give_to_player("BURGER MORSEL");
|
||||
hotspot_set_active("BURGER MORSEL ", false);
|
||||
_G(flags)[V107] = 1;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
inv_put_thing_in("BURGER MORSEL", NOWHERE);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
if (!digi_play_state(2)) {
|
||||
_val7 = imath_ranged_rand(0, 6);
|
||||
digi_play(Common::String::format("302t001%c", 'a' + _val7).c_str(), 2, 55, -1, 302);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
if (_val2 == 19) {
|
||||
digi_unload_stream_breaks(SERIES3);
|
||||
_series2.terminate();
|
||||
pal_fade_set_start(0);
|
||||
_series3 = series_stream_with_breaks(SERIES1, "302pe02", 6, 1, 3007);
|
||||
pal_fade_init(0, 255, 100, 15, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
switch (_val1) {
|
||||
case 20:
|
||||
series_show("302tr02", 0x900, 0, 9, 30, 13);
|
||||
series_show("302tr02s", 0x901, 0, -1, 30, 13);
|
||||
_val1 = 22;
|
||||
break;
|
||||
|
||||
case 21:
|
||||
_series2.show("302tr02", 0x900);
|
||||
_val1 = 22;
|
||||
break;
|
||||
|
||||
case 22:
|
||||
_val6 = imath_ranged_rand(0, 1);
|
||||
_val1 = _val6 ? 24 : 23;
|
||||
kernel_trigger_dispatch_now(9);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
kernel_trigger_dispatch_now(7);
|
||||
_val1 = 20;
|
||||
series_play_with_breaks(PLAY10, "302tr02", 0x900, 9, 3);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
kernel_trigger_dispatch_now(7);
|
||||
_val1 = 20;
|
||||
series_play_with_breaks(PLAY11, "302tr02", 0x900, 9, 3);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
_val1 = 20;
|
||||
series_play_with_breaks(PLAY12, "302tr03", 0x900, 9, 3);
|
||||
break;
|
||||
|
||||
case 26:
|
||||
_val1 = 20;
|
||||
series_play_with_breaks(PLAY13, "302tr03", 0x900, 9, 3);
|
||||
break;
|
||||
|
||||
case 27:
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 11;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
_val1 = 28;
|
||||
series_play_with_breaks(PLAY7, "302tr01", 0x700, 9, 3);
|
||||
break;
|
||||
|
||||
case 28:
|
||||
hotspot_set_active("truffles", false);
|
||||
_G(flags)[kTrufflesInMine] = 1;
|
||||
_G(wilbur_should) = 8;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
series_play_with_breaks(PLAY8, "302tr01", 0x900, -1, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
switch (_val4) {
|
||||
case 29:
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
_G(wilbur_should) = 9;
|
||||
series_stream_with_breaks(SERIES2, "302pr01", 6, 1, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 30:
|
||||
digi_preload_stream_breaks(SERIES3);
|
||||
_val2 = 19;
|
||||
series_stream_with_breaks(SERIES3, "302pr02", 6, 1, 8);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10008:
|
||||
_val1 = 26;
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
series_play_with_breaks(PLAY1, "302wi03", 0x500, 3004, 3);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 120, 3004);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_demand_location(427, 228, 4);
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
series_play_with_breaks(PLAY2, "302wi04", 0x500, 2, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
series_play_with_breaks(PLAY3, "302wi01", 0x500, 3003, 3);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 120, 3003);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_first_walk(233, 222, 7, 180, 270, 7, true);
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
_G(wilbur_should) = 10002;
|
||||
player_first_walk(483, 210, 5, 490, 245, 7, true);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
_G(wilbur_should) = 10002;
|
||||
player_first_walk(184, 189, 8, 78, 225, 8, true);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_val1 = 27;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = _G(flags)[V110] ? 10001 : 18;
|
||||
ws_turn_to_face(3, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
digi_unload_stream_breaks(SERIES2);
|
||||
_G(wilbur_should) = 12;
|
||||
hotspot_set_active("BURGER MORSEL ", true);
|
||||
series_play_with_breaks(PLAY4, "302wi10", 0x200, kCHANGE_WILBUR_ANIMATION, 2);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY6, "302wi06", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
_G(wilbur_should) = 17;
|
||||
series_play_with_breaks(PLAY9, "302wi07", 0x200, kCHANGE_WILBUR_ANIMATION, 3, 4);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
_series1 = series_show("302BURG", 0x200);
|
||||
_G(flags)[V107] = 0;
|
||||
_G(wilbur_should) = 15;
|
||||
series_play_with_breaks(PLAY5, "302wi09", 0x200, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_G(wilbur_should) = 14;
|
||||
kernel_timing_trigger(30, kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
player_set_commands_allowed(true);
|
||||
wilbur_speech("302w009z");
|
||||
break;
|
||||
|
||||
case 15:
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
|
||||
if (_G(flags)[V108]) {
|
||||
_val5 = imath_ranged_rand(0, 9);
|
||||
wilbur_speech(Common::String::format("302w004%c", 'a' + _val5).c_str(), kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
wilbur_speech("302w003", kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
_G(wilbur_should) = 7;
|
||||
player_set_commands_allowed(false);
|
||||
wilbur_speech(_G(flags)[V110] ? "300w010" : "300w007", kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
ws_unhide_walker();
|
||||
if (!_G(flags)[V110])
|
||||
wilbur_speech("300w008");
|
||||
break;
|
||||
|
||||
case 18:
|
||||
_G(flags)[V110] = 1;
|
||||
_G(wilbur_should) = 10001;
|
||||
wilbur_speech("300w009");
|
||||
break;
|
||||
|
||||
case 10013:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
_G(wilbur_should) = 10002;
|
||||
|
||||
if (_G(flags)[kTrufflesInMine]) {
|
||||
_G(flags)[V002] = 1;
|
||||
wilbur_speech("300w059");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room302::pre_parser() {
|
||||
if (player_said_any("BACKYARD", "BACKYARD ") && !player_said_any("LOOK AT", "GEAR", "ENTER"))
|
||||
player_set_facing_hotspot();
|
||||
}
|
||||
|
||||
void Room302::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("LOOK AT", "BURGER MORSEL ")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 13;
|
||||
wilbur_speech("302w009y", kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("LOOK AT", "DOOR")) {
|
||||
wilbur_speech(player_been_here(304) ? "302w006" : "302w005");
|
||||
} else if (player_said("DISTILLED CARROT JUICE", "CRASHED ROCKET")) {
|
||||
wilbur_speech("300w032");
|
||||
} else if (player_said("CARROT JUICE", "CRASHED ROCKET")) {
|
||||
wilbur_speech("300w045");
|
||||
} else if (player_said("MATCHES", "CRASHED ROCKET")) {
|
||||
wilbur_speech("300w018");
|
||||
} else if (player_said("TAKE", "BURGER MORSEL ")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 10;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("ENTER", "DOOR") || player_said("GEAR", "DOOR")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("MATCHES", "PROBE")) {
|
||||
wilbur_speech("300w023");
|
||||
} else if (player_said("BOTTLE", "TROUGH")) {
|
||||
wilbur_speech("300w073");
|
||||
} else if (player_said("LOOK AT", "STORM CELLAR")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 1;
|
||||
wilbur_speech("302w007", kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said_any("GEAR", "ENTER") && player_said("STORM CELLAR")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 1;
|
||||
|
||||
if (_G(flags)[V133]) {
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
term_message("Wilbur: Here we go...!");
|
||||
wilbur_speech("302w008", kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
} else if (player_said("CARROT JUICE", "TROUGH")) {
|
||||
wilbur_speech("300w044");
|
||||
} else if (player_said("BACKYARD") && player_said_any("LOOK AT", "GEAR", "ENTER")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3002);
|
||||
_G(flags)[V125] = 0;
|
||||
} else if (player_said("BACKYARD ") && player_said_any("LOOK AT", "GEAR", "ENTER")) {
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3002);
|
||||
_G(flags)[V125] = 1;
|
||||
} else if (player_said("TRUFFLES")) {
|
||||
if (player_said("BURGER MORSEL")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 16;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("LOOK AT")) {
|
||||
wilbur_speech(_G(flags)[V109] ? "302w012" : "302w011");
|
||||
} else if (player_said("MATCHES")) {
|
||||
wilbur_speech("300w016");
|
||||
} else if (player_said("DISTILLED CARROT JUICE")) {
|
||||
wilbur_speech("300w031");
|
||||
} else if (player_said("CARROT JUICE")) {
|
||||
wilbur_speech("300w044");
|
||||
} else if (player_said("BOTTLE")) {
|
||||
wilbur_speech("300w072");
|
||||
} else {
|
||||
_val1 = 25;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
81
engines/m4/burger/rooms/section3/room302.h
Normal file
81
engines/m4/burger/rooms/section3/room302.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM302_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM302_H
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room302 : public Section3Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesStreamBreak SERIES2[];
|
||||
static const seriesStreamBreak SERIES3[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
static const seriesPlayBreak PLAY11[];
|
||||
static const seriesPlayBreak PLAY12[];
|
||||
static const seriesPlayBreak PLAY13[];
|
||||
static int32 _state1;
|
||||
machine *_series1 = nullptr;
|
||||
Series _series2;
|
||||
machine *_series3 = nullptr;
|
||||
int _val1 = 0;
|
||||
int _val2 = 0;
|
||||
int _volume = 0;
|
||||
int _val4 = 0;
|
||||
int _val5 = 0;
|
||||
int _val6 = 0;
|
||||
int _val7 = 0;
|
||||
|
||||
protected:
|
||||
const char *getDigi() override {
|
||||
return "300_005";
|
||||
}
|
||||
|
||||
public:
|
||||
Room302();
|
||||
~Room302() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
769
engines/m4/burger/rooms/section3/room303.cpp
Normal file
769
engines/m4/burger/rooms/section3/room303.cpp
Normal file
@@ -0,0 +1,769 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room303.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/platform/timer.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const char *Room303::SAID[][4] = {
|
||||
{ "JUG ", "303w022", nullptr, "303w022z" },
|
||||
{ "JUG ", "303w022", nullptr, "303w022z" },
|
||||
{ "FUEL TANK", "303w003", "303w004", nullptr },
|
||||
{ "BURNER", nullptr, "303w010", nullptr },
|
||||
{ "BOILER", "303w014", "303w015", nullptr },
|
||||
{ "STOOL", "303w019", "300w004", "303w020" },
|
||||
{ "DISTILLED CARROT JUICE ", "303w021", nullptr, nullptr },
|
||||
{ "DISTILLED CARROT JUICE ", "303w021", nullptr, nullptr },
|
||||
{ "CONDENSER", "303w023", "303w024", "303w025" },
|
||||
{ "KEG", nullptr, "303w024", "303w025" },
|
||||
{ "CABIN", "303w028", "300w002", "300w002" },
|
||||
{ "WINDOW", "303w029", "300w002", "303w030" },
|
||||
{ "WOOD", "303w031", "303w032", "303w033" },
|
||||
{ "ROCK", "303w034", "300w002", "300w002" },
|
||||
{ "TREES", "303w035", "300w002", "300w002" },
|
||||
{ "FORCE FIELD", "303w036", "300w002", "300w002" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room303::SERIES1[] = {
|
||||
{ 0, "303_001", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY1[] = {
|
||||
{ 0, 7, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 8, -1, nullptr, 1, 0, 9, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY2[] = {
|
||||
{ 0, 5, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 6, 7, "300w048", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 10, -1, "303_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY3[] = {
|
||||
{ 9, 14, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
|
||||
{ 0, 8, nullptr, 1, 0, 9, 2050, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY4[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY5[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY6[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY7[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY8[] = {
|
||||
{ 0, 31, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 32, -1, "303_003", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY9[] = {
|
||||
{ 0, 28, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 29, 36, "300_003", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 37, -1, nullptr, 0, 0, 5, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room303::PLAY10[] = {
|
||||
{ 0, 6, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 7, 6, "303_007", 1, 100, -1, 0, 0, nullptr, 0 },
|
||||
{ 6, 6, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
|
||||
{ 6, 7, nullptr, 0, 0, -1, 1, 1, nullptr, 0 },
|
||||
{ 8, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
Room303::Room303() : Section3Room() {
|
||||
Common::fill(_triggers, _triggers + 5, -1);
|
||||
}
|
||||
|
||||
const char *Room303::getDigi() {
|
||||
if (_G(flags)[V118] == 3002) {
|
||||
_digiVolume = 125;
|
||||
return "303_005";
|
||||
} else if (_G(flags)[V117]) {
|
||||
return "303_006";
|
||||
} else {
|
||||
return "300_005";
|
||||
}
|
||||
}
|
||||
|
||||
void Room303::init() {
|
||||
setupDigi();
|
||||
pal_cycle_init(112, 127, 0, -1, -1);
|
||||
|
||||
_val1 = _val2 = 0;
|
||||
_series1 = nullptr;
|
||||
series_load("303ft");
|
||||
series_load("303burnr");
|
||||
series_load("303stil");
|
||||
series_load("303stilb");
|
||||
Common::fill(_triggers, _triggers + 5, -1);
|
||||
|
||||
if (_G(flags)[V117]) {
|
||||
_series2 = series_load("303ft_on");
|
||||
_series3 = series_play("303ft_on", 0xd00, 0, -1, 0, -1);
|
||||
_val3 = 2;
|
||||
} else {
|
||||
_series2 = series_load("303ft");
|
||||
_series3 = series_show("303ft", 0xd00);
|
||||
_val3 = 4;
|
||||
}
|
||||
|
||||
if (_G(flags)[V118] == 3002) {
|
||||
_series4 = series_load("303burn");
|
||||
_series5 = series_play("303burn", 0xd14, 0, -1, 0, -1);
|
||||
_val4 = 7;
|
||||
} else {
|
||||
_series4 = series_load("303burnr");
|
||||
_series5 = series_show("303burnr", 0xd14);
|
||||
_val4 = 9;
|
||||
}
|
||||
|
||||
_series6 = series_load("303stil");
|
||||
_series7 = series_show("303stil", 0xd10);
|
||||
series_show("303stilb", 0xd15);
|
||||
|
||||
_val5 = 0;
|
||||
kernel_trigger_dispatch_now(11);
|
||||
|
||||
switch (_G(flags)[V121]) {
|
||||
case 3001:
|
||||
_val6 = _G(flags)[V122] ? 32 : 30;
|
||||
kernel_trigger_dispatch_now(10);
|
||||
break;
|
||||
|
||||
case 3002:
|
||||
_val6 = _G(flags)[V122] ? 33 : 31;
|
||||
kernel_trigger_dispatch_now(10);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
if (_G(flags)[V117])
|
||||
_timer = timer_read_60();
|
||||
break;
|
||||
|
||||
case 302:
|
||||
if (_G(flags)[V125]) {
|
||||
ws_demand_location(51, 276, 3);
|
||||
kernel_trigger_dispatch_now(3);
|
||||
} else {
|
||||
ws_demand_location(245, 373, 1);
|
||||
kernel_trigger_dispatch_now(2);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
player_set_commands_allowed(true);
|
||||
if (_G(flags)[V117])
|
||||
_timer = timer_read_60();
|
||||
|
||||
ws_demand_location(290, 325, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room303::daemon() {
|
||||
doDaemon(_G(kernel).trigger);
|
||||
}
|
||||
|
||||
void Room303::doDaemon(int trigger) {
|
||||
switch (trigger) {
|
||||
case 1:
|
||||
for (_ctr = 0; _ctr < 5; ++_ctr) {
|
||||
if (_triggers[_ctr] != -1) {
|
||||
kernel_trigger_dispatch_now(_triggers[_ctr]);
|
||||
_triggers[_ctr] = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (_G(flags)[V115] > 1) {
|
||||
player_set_commands_allowed(true);
|
||||
ws_walk(290, 325, nullptr, 4, 1);
|
||||
} else {
|
||||
_G(wilbur_should) = 18;
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(290, 325, nullptr, kCHANGE_WILBUR_ANIMATION, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (_G(flags)[V115] > 1) {
|
||||
player_set_commands_allowed(true);
|
||||
ws_walk(261, 276, nullptr, 4, 3);
|
||||
} else {
|
||||
_G(wilbur_should) = 18;
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(261, 276, nullptr, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
setupDigi();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
switch (_val7) {
|
||||
case 25:
|
||||
if (_G(flags)[V119] && _G(flags)[V118] == 3002) {
|
||||
terminateMachineAndNull(_series7);
|
||||
series_unload(_series6);
|
||||
|
||||
_G(flags)[V120] = 1;
|
||||
_val7 = 26;
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "303dist", 6, 0xc10, 6);
|
||||
player_set_commands_allowed(false);
|
||||
intr_cancel_sentence();
|
||||
ws_walk(330, 350, nullptr, -1, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 26:
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
player_set_commands_allowed(true);
|
||||
|
||||
_G(flags)[V119] = 0;
|
||||
_series6 = series_load("303stil");
|
||||
_series7 = series_show("303stil", 0xd10);
|
||||
|
||||
if (_G(flags)[V121] == 3002) {
|
||||
_val8 = 27;
|
||||
_G(flags)[V122] = 1;
|
||||
terminateMachineAndNull(_series8);
|
||||
_val6 = 33;
|
||||
kernel_trigger_dispatch_now(10);
|
||||
} else {
|
||||
_val8 = 28;
|
||||
}
|
||||
|
||||
kernel_trigger_dispatch_now(9);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
switch (_val3) {
|
||||
case 1:
|
||||
freeSeries1();
|
||||
series_play_with_breaks(PLAY6, "303wi07", 0xd00, 7, 3);
|
||||
|
||||
_val3 = 2;
|
||||
_G(flags)[V117] = 1;
|
||||
setupDigi();
|
||||
ws_hide_walker();
|
||||
|
||||
_G(wilbur_should) = 19;
|
||||
_timer = timer_read_60();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_series2 = series_load("303ft_on");
|
||||
_series3 = series_play("303ft_on", 0xd00, 0, -1, 0, -1);
|
||||
|
||||
if (_G(wilbur_should) == 19)
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
freeSeries1();
|
||||
series_play_with_breaks(PLAY7, "303wi08", 0xd00, 7, 3);
|
||||
_val3 = 4;
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 20;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_series2 = series_load("303ft");
|
||||
_series3 = series_show("303ft", 0xd00);
|
||||
_G(flags)[V117] = 0;
|
||||
setupDigi();
|
||||
|
||||
if (_G(flags)[V118] == 3002) {
|
||||
_val4 = 8;
|
||||
doDaemon(8);
|
||||
}
|
||||
if (_G(wilbur_should) == 20)
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
switch (_val4) {
|
||||
case 5:
|
||||
freeSeries2();
|
||||
player_update_info();
|
||||
|
||||
if (timer_read_60() - _timer > 900) {
|
||||
_G(flags)[V118] = 3003;
|
||||
series_play_with_breaks(PLAY8, "303wi10", 0xd01, 3007, 1);
|
||||
} else {
|
||||
_G(flags)[V118] = 3002;
|
||||
series_play_with_breaks(PLAY9, "303wi02", 0xd01, 8, 3);
|
||||
}
|
||||
|
||||
_val4 = 7;
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
freeSeries2();
|
||||
series_play_with_breaks(PLAY9, "303wi09", 0xd01, 8, 3);
|
||||
_val4 = 9;
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
setupDigi();
|
||||
_series4 = series_load("303burn");
|
||||
_series5 = series_play("303burn", 0xd14, 0, -1, 0, -1);
|
||||
|
||||
if (_G(wilbur_should) == 10001) {
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
player_set_commands_allowed(true);
|
||||
}
|
||||
|
||||
_val7 = 25;
|
||||
kernel_timing_trigger(180, 6);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
freeSeries2();
|
||||
_series4 = series_load("303burnr");
|
||||
_series5 = series_show("303burnr", 0xd14);
|
||||
_G(flags)[V118] = 3001;
|
||||
setupDigi();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_series4 = series_load("303burnr");
|
||||
_series5 = series_show("303burnr", 0xd14);
|
||||
_G(flags)[V118] = 3001;
|
||||
|
||||
if (_G(wilbur_should) == 10001) {
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
player_set_commands_allowed(true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
switch (_val8) {
|
||||
case 27:
|
||||
if (_val5 < 15) {
|
||||
++_val5;
|
||||
_val8 = 27;
|
||||
terminateMachineAndNull(_series9);
|
||||
_series9 = series_play("303cj01", 0xd15, 0, 9, 8);
|
||||
}
|
||||
break;
|
||||
case 28:
|
||||
if (_val5 < 15) {
|
||||
++_val5;
|
||||
_val8 = 28;
|
||||
terminateMachineAndNull(_series9);
|
||||
_series9 = series_play("303cj02", 0xd15, 0, 9, 6);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
switch (_val6) {
|
||||
case 30:
|
||||
inv_move_object("JUG", 303);
|
||||
inv_move_object("DISTILLED CARROT JUICE", 303);
|
||||
|
||||
_G(flags)[V121] = 3001;
|
||||
_series8 = series_show("303juga", 0xbff);
|
||||
hotspot_set_active("JUG ", true);
|
||||
break;
|
||||
|
||||
case 31:
|
||||
inv_move_object("JUG", 303);
|
||||
inv_move_object("DISTILLED CARROT JUICE", 303);
|
||||
|
||||
_G(flags)[V121] = 3002;
|
||||
_series8 = series_show("303JUG", 0xd14);
|
||||
hotspot_set_active("JUG ", true);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
inv_move_object("JUG", 303);
|
||||
inv_move_object("DISTILLED CARROT JUICE", 303);
|
||||
_G(flags)[V122] = 1;
|
||||
_G(flags)[V121] = 3001;
|
||||
|
||||
_series8 = series_show("303juga", 0xbff);
|
||||
hotspot_set_active("DISTILLED CARROT JUICE ", true);
|
||||
break;
|
||||
|
||||
case 33:
|
||||
inv_move_object("JUG", 303);
|
||||
inv_move_object("DISTILLED CARROT JUICE", 303);
|
||||
_G(flags)[V122] = 1;
|
||||
_G(flags)[V121] = 3002;
|
||||
|
||||
_series8 = series_show("303JUG", 0xd14);
|
||||
hotspot_set_active("DISTILLED CARROT JUICE ", true);
|
||||
hotspot_set_active("JUG ", true);
|
||||
break;
|
||||
|
||||
case 34:
|
||||
_G(flags)[V121] = 3003;
|
||||
inv_give_to_player(_G(flags)[V122] ? "DISTILLED CARROT JUICE" : "JUG");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
terminateMachineAndNull(_series8);
|
||||
hotspot_set_active("DISTILLED CARROT JUICE ", false);
|
||||
hotspot_set_active("DISTILLED CARROT JUICE ", false);
|
||||
hotspot_set_active("JUG ", false);
|
||||
hotspot_set_active("JUG ", false);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 11:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
|
||||
|
||||
if (_val5 > 0 && _val5 < 15) {
|
||||
_val8 = 27;
|
||||
_G(flags)[V122] = 1;
|
||||
} else {
|
||||
_val8 = 29;
|
||||
}
|
||||
|
||||
_val6 = _G(flags)[V122] ? 33 : 31;
|
||||
_triggers[1] = 10;
|
||||
series_play_with_breaks(PLAY1, "303wi4b", 0x100, 1, 3);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
|
||||
kernel_trigger_dispatch_now(11);
|
||||
|
||||
_val6 = 34;
|
||||
_triggers[1] = 10;
|
||||
_val8 = (_val5 > 0 && _val5 < 15) ? 28 : 29;
|
||||
series_play_with_breaks(PLAY3, "303wi4b", 0x100, 1, 3);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
ws_hide_walker();
|
||||
player_set_commands_allowed(false);
|
||||
kernel_trigger_dispatch_now(11);
|
||||
_G(wilbur_should) = 10001;
|
||||
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
|
||||
_triggers[1] = 10;
|
||||
_val6 = 34;
|
||||
series_play_with_breaks(PLAY4, "303wi4a", 0x100, 1, 3);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
|
||||
_G(wilbur_should) = 10001;
|
||||
_triggers[0] = kCHANGE_WILBUR_ANIMATION;
|
||||
_val6 = _G(flags)[V122] ? 32 : 30;
|
||||
_triggers[1] = 10;
|
||||
series_play_with_breaks(PLAY5, "303wi4a", 0x100, 1, 3);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 23;
|
||||
series_play_with_breaks(PLAY10, "303wi15", 0x100, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 17;
|
||||
series_play_with_breaks(PLAY2, "303wi03", 0x100, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
_G(flags)[V119] = 1;
|
||||
_G(flags)[V126] = 1;
|
||||
inv_put_thing_in("CARROT JUICE", NOWHERE);
|
||||
inv_give_to_player("BOTTLE");
|
||||
_val7 = 25;
|
||||
kernel_trigger_dispatch_now(6);
|
||||
enable_player();
|
||||
break;
|
||||
|
||||
case 18:
|
||||
_G(wilbur_should) = 10001;
|
||||
wilbur_speech(_G(flags)[V115] ? "303w002" : "303w001");
|
||||
_G(flags)[V115]++;
|
||||
break;
|
||||
|
||||
case 19:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
|
||||
if (_G(flags)[V116]) {
|
||||
wilbur_speech("303w006");
|
||||
} else {
|
||||
wilbur_speech("303w005");
|
||||
_G(flags)[V116] = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 20:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech("303w007");
|
||||
break;
|
||||
|
||||
case 21:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech(_G(flags)[V118] == 3001 ? "303w008" : "303w009");
|
||||
break;
|
||||
|
||||
case 22:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech(_G(flags)[V118] == 3001 ? "303w011" : "303w012");
|
||||
break;
|
||||
|
||||
case 23:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech("303w016");
|
||||
break;
|
||||
|
||||
case 24:
|
||||
player_set_commands_allowed(true);
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
wilbur_speech("303w017");
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room303::pre_parser() {
|
||||
if (player_said("GEAR", "BOILER") && !_G(flags)[V119]) {
|
||||
_G(wilbur_should) = 15;
|
||||
player_hotspot_walk_override(409, 312, 3, kCHANGE_WILBUR_ANIMATION);
|
||||
_G(player).command_ready = false;
|
||||
} else {
|
||||
if (player_said("FRONT YARD") && !player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER"))
|
||||
player_set_facing_hotspot();
|
||||
|
||||
if (player_said("FRONT YARD ") && !player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER"))
|
||||
player_set_facing_hotspot();
|
||||
}
|
||||
}
|
||||
|
||||
void Room303::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("FRONT YARD") && player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER")) {
|
||||
frontYard();
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3001);
|
||||
_G(flags)[V125] = 0;
|
||||
} else if (player_said("FRONT YARD ") && player_said_any("LOOK AT", "WALK TO", "GEAR", "ENTER")) {
|
||||
frontYard();
|
||||
player_set_commands_allowed(false);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 6, 3001);
|
||||
_G(flags)[V125] = 1;
|
||||
} else if (player_said("DISTILLED CARROT JUICE", "BURNER")) {
|
||||
wilbur_speech("300w033");
|
||||
} else if (player_said("DISTILLED CARROT JUICE", "BOILER")) {
|
||||
wilbur_speech("300w034");
|
||||
} else if (player_said("JUG", "BOILER")) {
|
||||
wilbur_speech("300w027");
|
||||
} else if (player_said("JUG", "STOOL") || player_said("DISTILLED CARROT JUICE", "STOOL")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 11;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("JUG", "JUG ", "JUG ") && player_said("CARROT JUICE")) {
|
||||
wilbur_speech("300w046");
|
||||
} else if (player_said("JUG", "STUMP") || player_said("DISTILLED CARROT JUICE", "STUMP")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 14;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("BOTTLE", "BOILER")) {
|
||||
wilbur_speech("300w074");
|
||||
} else if (player_said("BOTTLE", "STOOL")) {
|
||||
wilbur_speech("300w075");
|
||||
} else if (player_said("CARROT JUICE", "BURNER")) {
|
||||
wilbur_speech("300w047");
|
||||
} else if (player_said("CARROT JUICE", "STOOL")) {
|
||||
wilbur_speech("300w049");
|
||||
} else if (player_said("MATCHES", "STUMP") || player_said("MATCHES", "WOOD")) {
|
||||
wilbur_speech("300w019");
|
||||
} else if (player_said("GEAR", "FUEL TANK")) {
|
||||
player_set_commands_allowed(false);
|
||||
_val3 = _G(flags)[V117] ? 3 : 1;
|
||||
kernel_trigger_dispatch_now(7);
|
||||
} else if (player_said("LOOK AT", "BURNER")) {
|
||||
_G(wilbur_should) = 21;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("GEAR", "BURNER")) {
|
||||
_G(wilbur_should) = 22;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("MATCHES", "BURNER")) {
|
||||
if (_G(flags)[V118] == 3001) {
|
||||
player_set_commands_allowed(false);
|
||||
_val4 = _G(flags)[V117] ? 5 : 6;
|
||||
kernel_trigger_dispatch_now(8);
|
||||
}
|
||||
} else if (player_said("GEAR", "BOILER")) {
|
||||
if (_G(flags)[V119])
|
||||
_G(wilbur_should) = 24;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("BOILER", "CARROT JUICE")) {
|
||||
_G(wilbur_should) = 16;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TAKE", "JUG ") || player_said("TAKE", "DISTILLED CARROT JUICE ")) {
|
||||
_G(wilbur_should) = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TAKE", "JUG ") || player_said("TAKE", "DISTILLED CARROT JUICE ")) {
|
||||
_G(wilbur_should) = 13;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("LOOK AT", "KEG")) {
|
||||
wilbur_speech(_G(flags)[V120] ? "303w027" : "303w026");
|
||||
} else if (player_said("BURNER")) {
|
||||
wilbur_speech("303w013");
|
||||
} else if (player_said("BOILER")) {
|
||||
wilbur_speech("303w018");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room303::frontYard() {
|
||||
term_message("------- %ld %ld %ld", _G(flags)[V119], _G(flags)[V118], _G(flags)[V121]);
|
||||
|
||||
if (_G(flags)[V119] && _G(flags)[V118] == 3002 && _G(flags)[V121] == 3002) {
|
||||
term_message("jug filled with distilled juice!!");
|
||||
_G(flags)[V122] = 1;
|
||||
_G(flags)[V120] = 1;
|
||||
_G(flags)[V119] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Room303::freeSeries1() {
|
||||
if (_series3)
|
||||
terminateMachineAndNull(_series3);
|
||||
if (_series2)
|
||||
series_unload(_series2);
|
||||
}
|
||||
|
||||
void Room303::freeSeries2() {
|
||||
if (_series5)
|
||||
terminateMachineAndNull(_series5);
|
||||
if (_series4)
|
||||
series_unload(_series4);
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
88
engines/m4/burger/rooms/section3/room303.h
Normal file
88
engines/m4/burger/rooms/section3/room303.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM303_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM303_H
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room303 : public Section3Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static const seriesPlayBreak PLAY7[];
|
||||
static const seriesPlayBreak PLAY8[];
|
||||
static const seriesPlayBreak PLAY9[];
|
||||
static const seriesPlayBreak PLAY10[];
|
||||
machine *_series1 = nullptr;
|
||||
int _series2 = -1;
|
||||
machine *_series3 = nullptr;
|
||||
int _series4 = -1;
|
||||
machine *_series5 = nullptr;
|
||||
int _series6 = -1;
|
||||
machine *_series7 = nullptr;
|
||||
machine *_series8 = nullptr;
|
||||
machine *_series9 = nullptr;
|
||||
int _triggers[5];
|
||||
int _ctr = 0;
|
||||
int _timer = 0;
|
||||
int _val1 = 0;
|
||||
int _val2 = 0;
|
||||
int _val3 = 0;
|
||||
int _val4 = 0;
|
||||
int _val5 = 0;
|
||||
int _val6 = 0;
|
||||
int _val7 = 0;
|
||||
int _val8 = 0;
|
||||
|
||||
void frontYard();
|
||||
void doDaemon(int trigger);
|
||||
void freeSeries1();
|
||||
void freeSeries2();
|
||||
|
||||
protected:
|
||||
const char *getDigi() override;
|
||||
|
||||
public:
|
||||
Room303();
|
||||
~Room303() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
259
engines/m4/burger/rooms/section3/room304.cpp
Normal file
259
engines/m4/burger/rooms/section3/room304.cpp
Normal file
@@ -0,0 +1,259 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room304.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
|
||||
const char *Room304::SAID[][4] = {
|
||||
{ "DOOR", "304w002", "300w002", nullptr },
|
||||
{ "BED", "304w007", "300w003", "304w008" },
|
||||
{ "PICTURE", "304w009", "304w010", "300w005" },
|
||||
{ "MATCHES ", "304w003", nullptr, "304w004" },
|
||||
{ "MAP", nullptr, "304w013", "304w014" },
|
||||
{ "CRATE", "304w015", "300w004", "300w004" },
|
||||
{ "STOVE", "304w016", "304w017", "304w018" },
|
||||
{ "KETTLE", "304w019", "304w018", "304w018" },
|
||||
{ "MUG", "304w019", nullptr, nullptr },
|
||||
{ "RECIPE BOOK", nullptr, "304w021", "304w022" },
|
||||
{ "WASHTUB", "304w023", "304w024", "304w024" },
|
||||
{ "POT", "304w025", "304w018", "304w018" },
|
||||
{ "FRYING PAN", "304w026", "304w027", "304w018" },
|
||||
{ "WINDOW", "304w028", "300w002", "304w029" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room304::PLAY1[] = {
|
||||
{ 0, 3, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 4, 16, "304_001", 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
{ 17, -1, "304_002", 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room304::PLAY2[] = {
|
||||
{ 0, 3, nullptr, 1, 0, -1, 2050, 0, nullptr, 0 },
|
||||
{ 0, 0, "304w020", 1, 255, -1, 0, 10, nullptr, 0 },
|
||||
{ 0, 6, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 7, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
{ 8, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 13, -1, "304_004", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 7, nullptr, 0, 0, -1, 0, 3, nullptr, 0 },
|
||||
{ 8, 12, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 13, -1, "304_004", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 7, 7, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
{ 7, 3, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room304::PLAY3[] = {
|
||||
{ 0, 3, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 4, 5, nullptr, 0, 0, 6, 0, 0, nullptr, 0 },
|
||||
{ 6, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room304::PLAY4[] = {
|
||||
{ 0, 24, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 25, 36, "300_003", 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
{ 37, -1, nullptr, 0, 0, 3, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room304::PLAY5[] = {
|
||||
{ 17, 17, nullptr, 0, 0, -1, 0, 5, nullptr, 0 },
|
||||
{ 17, 21, "304_002", 2, 255, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const char *Room304::getDigi() {
|
||||
return _G(flags)[V130] ? "304_003" : "300_005";
|
||||
}
|
||||
|
||||
void Room304::init() {
|
||||
setupDigi();
|
||||
set_palette_brightness(70);
|
||||
|
||||
if (inv_player_has("MATCHES")) {
|
||||
hotspot_set_active("MATCHES ", false);
|
||||
} else {
|
||||
_matches = series_show("304match", 0xa00);
|
||||
hotspot_set_active("MATCHES ", true);
|
||||
}
|
||||
|
||||
if (_G(flags)[V130]) {
|
||||
_fire = series_play("304firel", 0xa00, 4, -1, 6, -1);
|
||||
} else {
|
||||
_fire = series_show("304firel", 0xa00);
|
||||
}
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 302:
|
||||
ws_demand_location(150, 306, 3);
|
||||
kernel_trigger_dispatch_now(4);
|
||||
break;
|
||||
|
||||
default:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(300, 306, 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room304::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
term_message("Walking into scene....!");
|
||||
|
||||
if (_G(flags)[V129]) {
|
||||
ws_walk(300, 306, nullptr, 2, 4);
|
||||
} else {
|
||||
_G(flags)[V129] = 1;
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 5;
|
||||
ws_walk(300, 306, nullptr, kCHANGE_WILBUR_ANIMATION, 4);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
setupDigi();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(false);
|
||||
series_play_with_breaks(PLAY5, "304wi01", 0x600, -1, 2, 6);
|
||||
kernel_trigger_dispatch_now(1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_fire = series_play("304fire1", 0xa00, 0, -1, 6, -1);
|
||||
_G(wilbur_should) = 10001;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
inv_give_to_player("MATCHES");
|
||||
hotspot_set_active("MATCHES ", false);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10002;
|
||||
series_play_with_breaks(PLAY1, "304wi01", 0x600, 3001, 3, 8);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_fire);
|
||||
series_play_with_breaks(PLAY4, "304wi05", 0xa00, 5, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_matches);
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY3, "304wb01", 0xa00, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
series_play_with_breaks(PLAY2, "304wi03", 0x101, kCHANGE_WILBUR_ANIMATION, 2);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_G(wilbur_should) = 10001;
|
||||
_G(flags)[V129] = 1;
|
||||
wilbur_speech("304w001");
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room304::pre_parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
}
|
||||
|
||||
void Room304::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("OPEN", "DOOR") || player_said("GEAR", "DOOR")) {
|
||||
_G(wilbur_should) = 1;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("LOOK AT", "MAP")) {
|
||||
wilbur_speech(_G(flags)[V135] ? "304w012" : "304w011");
|
||||
} else if (player_said("DISTILLED CARROT JUICE") &&
|
||||
player_said_any("STOVE", "KETTLE", "FRYING PAN", "POT")) {
|
||||
wilbur_speech("300w035");
|
||||
} else if (player_said("CARROT JUICE") &&
|
||||
player_said_any("STOVE", "KETTLE", "FRYING PAN", "POT")) {
|
||||
wilbur_speech("300w051");
|
||||
} else if (player_said("CARROT JUICE", "WASHTUB")) {
|
||||
wilbur_speech("300w052");
|
||||
} else if (player_said("DISTILLED CARROT JUICE", "WASHTUB")) {
|
||||
wilbur_speech("300w035z");
|
||||
} else if (player_said("MATCHES", "STOVE") && !_G(flags)[V130]) {
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("TAKE", "MATCHES ")) {
|
||||
_G(wilbur_should) = 3;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("READ", "RECIPE BOOK") || player_said("LOOK AT", "RECIPE BOOK")) {
|
||||
_G(wilbur_should) = 4;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
59
engines/m4/burger/rooms/section3/room304.h
Normal file
59
engines/m4/burger/rooms/section3/room304.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM304_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM304_H
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room304 : public Section3Room {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
machine *_matches = nullptr;
|
||||
machine *_fire = nullptr;
|
||||
|
||||
protected:
|
||||
const char *getDigi() override;
|
||||
|
||||
public:
|
||||
Room304() : Section3Room() {}
|
||||
~Room304() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
271
engines/m4/burger/rooms/section3/room305.cpp
Normal file
271
engines/m4/burger/rooms/section3/room305.cpp
Normal file
@@ -0,0 +1,271 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room305.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const char *Room305::SAID[][4] = {
|
||||
{ "STAIRS", "305w002", "300w002", nullptr },
|
||||
{ "DARKNESS", "305w004", "300w002", "300w002" },
|
||||
{ "MINE", "305w003", "300w002", "300w002" },
|
||||
{ "GENERATOR", nullptr, "305w008", nullptr },
|
||||
{ "PICK AXE", "305w015", "305w016", "305w017" },
|
||||
{ "BOX", "305w018", "300w003", "300w005" },
|
||||
{ "DEBRIS", nullptr, "305w021", "300w005" },
|
||||
{ "GROUND", "305w022", "300w002", "300w002" },
|
||||
{ "WALL", "305w022", "300w002", "300w002" },
|
||||
{ "CEILING", "305w022", "300w002", "300w002" },
|
||||
{ "FORCE FIELD", "302w027", "300w002", "300w002" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room305::SERIES1[] = {
|
||||
{ 6, "305_003", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 11, "305w009", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 12, "305_005", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 20, "305w010", 1, 255, -1, 0, &Flags::_flags[V135], 0 },
|
||||
{ 30, "305_006", 2, 255, -1, (uint)-1, nullptr, 0 },
|
||||
{ 72, "305_001", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 72, nullptr, 2, 0, -1, 2048, nullptr, 0 },
|
||||
{ 79, "305_004", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 94, "305_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ -1, nullptr, 0, 0, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room305::PLAY1[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room305::PLAY2[] = {
|
||||
{ 0, -1, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room305::init() {
|
||||
setupDigi();
|
||||
set_palette_brightness(60);
|
||||
pal_cycle_init(96, 111, 6, -1, -1);
|
||||
_G(flags)[kMineRoomIndex] = 0;
|
||||
|
||||
if (_G(flags)[V134] && !_G(flags)[V135] && !_G(flags)[kEnteredMine]) {
|
||||
hotspot_set_active("DARKNESS", true);
|
||||
hotspot_set_active("MINE", false);
|
||||
} else {
|
||||
hotspot_set_active("DARKNESS", false);
|
||||
hotspot_set_active("MINE", true);
|
||||
}
|
||||
|
||||
_series1 = series_show(_G(flags)[V134] ? "305genx" : "305gen", 0x200);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 302:
|
||||
_G(wilbur_should) = 101;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 319:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(-50, 200);
|
||||
kernel_trigger_dispatch_now(301);
|
||||
break;
|
||||
|
||||
default:
|
||||
player_set_commands_allowed(true);
|
||||
ws_demand_location(320, 290, 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room305::daemon() {
|
||||
Mine::daemon();
|
||||
if (!_G(kernel).continue_handling_trigger)
|
||||
return;
|
||||
_G(kernel).continue_handling_trigger = false;
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case 100:
|
||||
_series1 = series_show("305genx", 0x200);
|
||||
_G(flags)[V134] = 1;
|
||||
_G(wilbur_should) = 105;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 3001:
|
||||
_G(game).setRoom(302);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 101:
|
||||
ws_demand_location(372, 267, 9);
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
|
||||
if (_G(flags)[V133]) {
|
||||
_G(wilbur_should) = 10001;
|
||||
} else {
|
||||
_G(flags)[V133] = 1;
|
||||
_G(wilbur_should) = 104;
|
||||
}
|
||||
|
||||
series_play_with_breaks(PLAY1, "305wi01", 0x700, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 102:
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(375, 280, 2);
|
||||
ws_hide_walker();
|
||||
series_play_with_breaks(PLAY2, "305wi02", 0x700, -1, 3);
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 60, 3001);
|
||||
break;
|
||||
|
||||
case 103:
|
||||
hotspot_set_active("DARKNESS", false);
|
||||
hotspot_set_active("MINE", true);
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
terminateMachineAndNull(_series1);
|
||||
series_stream_with_breaks(SERIES1, "305wi04", 6, 0x200, 100);
|
||||
break;
|
||||
|
||||
case 104:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
wilbur_speech("305w001");
|
||||
break;
|
||||
|
||||
case 105:
|
||||
ws_unhide_walker();
|
||||
|
||||
if (_G(flags)[V135]) {
|
||||
_G(wilbur_should) = 106;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
_G(flags)[V135] = 1;
|
||||
_G(wilbur_should) = 106;
|
||||
wilbur_speech("305w011", kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 106:
|
||||
_G(wilbur_should) = 10001;
|
||||
wilbur_speech(_G(flags)[kEnteredMine] ? "305w013" : "305w012", kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 107:
|
||||
_G(wilbur_should) = 10001;
|
||||
wilbur_speech("305w012", kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
mine_travel_link(BACK);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room305::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
// Handle any generic mine stuff
|
||||
Mine::parser();
|
||||
if (!_G(player).command_ready)
|
||||
// Already handled
|
||||
return;
|
||||
|
||||
// Check for standard actions
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Handled
|
||||
} else if (player_said("climb", "stairs") || player_said("GEAR", "STAIRS")) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 102;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("ENTER", "MINE") || player_said("ENTER", "DARKNESS")) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (!_G(flags)[kDrunkCarrotJuice]) {
|
||||
player_set_commands_allowed(true);
|
||||
wilbur_speech("305w004");
|
||||
} else {
|
||||
_G(wilbur_should) = 108;
|
||||
|
||||
if (_G(flags)[kEnteredMine]) {
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
wilbur_speech("305w005", kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
}
|
||||
} else if (player_said("DISTILLED CARROT JUICE", "GENERATOR")) {
|
||||
wilbur_speech(_G(flags)[V134] ? "300w037" : "300w036");
|
||||
} else if (player_said("CARROT JUICE", "GENERATOR")) {
|
||||
wilbur_speech(_G(flags)[V134] ? "300w054" : "300w053");
|
||||
} else if (player_said_any("CARROT JUICE", "DISTILLED CARROT JUICE") &&
|
||||
player_said("BARREL")) {
|
||||
wilbur_speech("300w038");
|
||||
} else if (player_said("LOOK AT", "GENERATOR")) {
|
||||
wilbur_speech(_G(flags)[V134] ? "300w007" : "300w006");
|
||||
} else if (player_said("MATCHES", "GENERATOR")) {
|
||||
wilbur_speech(_G(flags)[V134] ? "300w022" : "300w021");
|
||||
} else if (player_said("LOOK AT", "DEBRIS")) {
|
||||
if (!_G(flags)[V136]) {
|
||||
_G(flags)[V136] = 1;
|
||||
wilbur_speech("305w019");
|
||||
} else {
|
||||
wilbur_speech(Common::String::format("305w020%c",
|
||||
'a' + imath_ranged_rand(0, 6)).c_str());
|
||||
}
|
||||
} else if (player_said("GEAR", "GENERATOR")) {
|
||||
if (_G(flags)[V134]) {
|
||||
wilbur_speech("305w014");
|
||||
} else {
|
||||
_G(wilbur_should) = 103;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
}
|
||||
} else if (!player_said("LOOK AT WALL")) {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
57
engines/m4/burger/rooms/section3/room305.h
Normal file
57
engines/m4/burger/rooms/section3/room305.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM305_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM305_H
|
||||
|
||||
#include "m4/burger/rooms/section3/mine.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room305 : public Mine {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
machine *_series1 = nullptr;
|
||||
|
||||
protected:
|
||||
const char *getDigi() override {
|
||||
return "305_007";
|
||||
}
|
||||
|
||||
public:
|
||||
Room305() : Mine() {}
|
||||
~Room305() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
91
engines/m4/burger/rooms/section3/room306.cpp
Normal file
91
engines/m4/burger/rooms/section3/room306.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room306.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const seriesStreamBreak Room306::SERIES1[] = {
|
||||
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
|
||||
{ 2, "306f003a", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room306::SERIES2[] = {
|
||||
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
|
||||
{ 2, "306f001a", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesStreamBreak Room306::SERIES3[] = {
|
||||
{ 0, "608_003", 3, 100, -1, 0, nullptr, 0 },
|
||||
{ 1, "306f002a", 1, 255, -1, 0, nullptr, 0 },
|
||||
{ 33, "608_001", 2, 255, -1, 0, nullptr, 0 },
|
||||
{ 48, "608_002", 2, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room306::preload() {
|
||||
_G(player).walker_in_this_scene = false;
|
||||
}
|
||||
|
||||
void Room306::init() {
|
||||
pal_cycle_init(101, 110, 6);
|
||||
kernel_trigger_dispatch_now(3007);
|
||||
}
|
||||
|
||||
void Room306::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 0, -1);
|
||||
release_trigger_on_digi_state(k10027, 1);
|
||||
break;
|
||||
|
||||
case 3007:
|
||||
if (!_G(flags)[kPerkinsLostIsland]) {
|
||||
digi_preload_stream_breaks(SERIES2);
|
||||
series_stream_with_breaks(SERIES2, "306burnt", 6, 1, 1);
|
||||
} else if (_G(flags)[V118] == 3003) {
|
||||
digi_preload_stream_breaks(SERIES3);
|
||||
series_stream_with_breaks(SERIES3, "306burnt", 6, 1, 1);
|
||||
} else {
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "306fail", 6, 1, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
50
engines/m4/burger/rooms/section3/room306.h
Normal file
50
engines/m4/burger/rooms/section3/room306.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM306_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM306_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room306 : public Room {
|
||||
private:
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesStreamBreak SERIES2[];
|
||||
static const seriesStreamBreak SERIES3[];
|
||||
|
||||
public:
|
||||
Room306() : Room() {}
|
||||
~Room306() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
101
engines/m4/burger/rooms/section3/room307.cpp
Normal file
101
engines/m4/burger/rooms/section3/room307.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room307.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
const seriesStreamBreak Room307::SERIES1[] = {
|
||||
{ 0, "307z001", 1, 255, -1, 0, nullptr, 0 },
|
||||
STREAM_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room307::PLAY1[] = {
|
||||
{ 0, 5, "307z002w", 1, 255, -1, 2052, -1, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
|
||||
{ 0, 5, "307z002x", 1, 255, -1, 2052, -1, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 0, 0, -1, 0, 2, nullptr, 0 },
|
||||
{ 0, 5, "307z002y", 1, 255, -1, 2052, -1, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 5, "307z002z", 1, 255, -1, 2052, -1, nullptr, 0 },
|
||||
{ 6, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
void Room307::init() {
|
||||
_G(flags)[kThirdTestPassed] = 1;
|
||||
ws_demand_location(418, 309, 9);
|
||||
ws_hide_walker();
|
||||
digi_preload("307_001");
|
||||
digi_play_loop("307_001", 3, 125, -1, 307);
|
||||
kernel_trigger_dispatch_now(1);
|
||||
}
|
||||
|
||||
void Room307::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
digi_preload_stream_breaks(SERIES1);
|
||||
series_stream_with_breaks(SERIES1, "307brig", 6, 1, 2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
digi_unload_stream_breaks(SERIES1);
|
||||
_series1.show("307zg01", 0x400);
|
||||
ws_unhide_walker();
|
||||
kernel_trigger_dispatch_now(3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
wilbur_speech("307w001y", 4);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
wilbur_speech("307w001z", 7);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
digi_preload("608_002");
|
||||
series_play("307door", 9, 16, -1, 7);
|
||||
digi_play("608_002", 2, 200, 6);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
wilbur_speech("307w002", k10027);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_series1.terminate();
|
||||
series_play_with_breaks(PLAY1, "307zg01", 0x400, 5, 3, 5, 100, 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
49
engines/m4/burger/rooms/section3/room307.h
Normal file
49
engines/m4/burger/rooms/section3/room307.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM307_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM307_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room307 : public Room {
|
||||
private:
|
||||
static const seriesStreamBreak SERIES1[];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
Series _series1;
|
||||
|
||||
public:
|
||||
Room307() : Room() {}
|
||||
~Room307() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
341
engines/m4/burger/rooms/section3/room310.cpp
Normal file
341
engines/m4/burger/rooms/section3/room310.cpp
Normal file
@@ -0,0 +1,341 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/ },.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/room310.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
enum {
|
||||
kCHANGE_PROBE_ANIMATION = 1,
|
||||
kCHANGE_TRUFFLES_ANIMATION = 3
|
||||
};
|
||||
|
||||
const char *Room310::SAID[][4] = {
|
||||
{ "TUNNEL", "310w002", "310w003", nullptr },
|
||||
{ "PROBE", "310w004", nullptr, nullptr },
|
||||
{ "TRUFFLES", nullptr, "310w011", "310w012" },
|
||||
{ "GROUND", "310w017", "310w003", "310w003" },
|
||||
{ "WALL", "310w017", "310w003", "310w003" },
|
||||
{ "CEILING", "310w017", "310w003", "310w003" },
|
||||
{ nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY1[] = {
|
||||
{ 1, 2, "300t004a", 2, 165, -1, 0, 0, &_state1, 1 },
|
||||
{ 1, 2, "300t004b", 2, 165, -1, 0, 0, &_state1, 2 },
|
||||
{ 1, 2, "300t004c", 2, 165, -1, 0, 0, &_state1, 3 },
|
||||
{ 1, 2, "300t004d", 2, 165, -1, 0, 0, &_state1, 4 },
|
||||
{ 3, 4, nullptr, 2, 0, 1, 0, 0, nullptr, 0 },
|
||||
{ 5, -1, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY2[] = {
|
||||
{ 0, 9, "300t003a", 2, 165, -1, 0, 0, &_state1, 1 },
|
||||
{ 0, 9, "300t003b", 2, 165, -1, 0, 0, &_state1, 2 },
|
||||
{ 0, 9, "300t003c", 2, 165, -1, 0, 0, &_state1, 3 },
|
||||
{ 0, 9, "300t003d", 2, 165, -1, 0, 0, &_state1, 4 },
|
||||
{ 10, 16, nullptr, 2, 0, 10016, 1, 0, nullptr, 0 },
|
||||
{ 10, 16, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 17, 21, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 0, 0, nullptr, 2, 0, -1, 2048, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY3[] = {
|
||||
{ 15, 29, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY4[] = {
|
||||
{ 6, -1, nullptr, 1, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY5[] = {
|
||||
{ 30, 36, nullptr, 2, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 37, 51, "300_002", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
const seriesPlayBreak Room310::PLAY6[] = {
|
||||
{ 52, 56, "300_001", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
int32 Room310::_state1;
|
||||
|
||||
|
||||
Room310::Room310() : Mine() {
|
||||
_state1 = 0;
|
||||
}
|
||||
|
||||
void Room310::init() {
|
||||
Mine::init();
|
||||
setupDigi();
|
||||
set_palette_brightness(48, 127, 30);
|
||||
digi_preload("601_007");
|
||||
|
||||
_probeShould = 7;
|
||||
kernel_trigger_dispatch_now(kCHANGE_PROBE_ANIMATION);
|
||||
|
||||
if (!_G(flags)[kTrufflesRanAway] && _G(flags)[kTrufflesInMine]) {
|
||||
_walk1 = intr_add_no_walk_rect(360, 265, 515, 293, 359, 294);
|
||||
_trufflesShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
|
||||
} else {
|
||||
hotspot_set_active("TRUFFLES", false);
|
||||
}
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 319:
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(flags)[kMineRoomIndex] = 39;
|
||||
ws_demand_location(300, 306, 4);
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room310::daemon() {
|
||||
Mine::daemon();
|
||||
if (!_G(kernel).continue_handling_trigger)
|
||||
return;
|
||||
_G(kernel).continue_handling_trigger = false;
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case kCHANGE_PROBE_ANIMATION:
|
||||
switch (_probeShould) {
|
||||
case 7:
|
||||
_series2 = series_play("310prob", 0xb00, 0, -1, 6, -1, 100, 0, 0, 0, 17);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_probeShould = 7;
|
||||
terminateMachineAndNull(_series2);
|
||||
series_play_with_breaks(PLAY3, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_probeShould = 10;
|
||||
terminateMachineAndNull(_series2);
|
||||
series_play_with_breaks(PLAY5, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
_probeShould = 11;
|
||||
series_play_with_breaks(PLAY6, "310prob", 0xb00, kCHANGE_PROBE_ANIMATION, 2, 3);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
series_show("310prob", 0xb00, 0, -1, -1, 60);
|
||||
_G(wilbur_should) = 2;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_series1.terminate();
|
||||
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
|
||||
break;
|
||||
|
||||
case kCHANGE_TRUFFLES_ANIMATION:
|
||||
switch (_trufflesShould) {
|
||||
case 12:
|
||||
_series1.show("310tr01", 0xb00, 0, -1, -1, 18);
|
||||
_trufflesShould = (imath_ranged_rand(1, 4) == 1) ? 13 : 12;
|
||||
kernel_timing_trigger(30, 2);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_trufflesShould = 12;
|
||||
_probeShould = 8;
|
||||
series_play_with_breaks(PLAY1, "310tr01", 0xb00, 3, 3);
|
||||
_state1 = imath_ranged_rand(1, 4);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
term_message("Truffles goes to snarl at Wilbur!");
|
||||
_G(flags)[V145] = 1;
|
||||
_G(wilbur_should) = 4;
|
||||
_trufflesShould = 15;
|
||||
series_play_with_breaks(PLAY2, "310tr02", 0xb00, 3, 3);
|
||||
_state1 = imath_ranged_rand(1, 4);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
player_set_commands_allowed(true);
|
||||
|
||||
if (!_G(flags)[V142]) {
|
||||
_G(flags)[V142] = 1;
|
||||
wilbur_speech("310w006");
|
||||
} else {
|
||||
wilbur_speech("310w007");
|
||||
}
|
||||
|
||||
_trufflesShould = 12;
|
||||
kernel_trigger_dispatch_now(kCHANGE_TRUFFLES_ANIMATION);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
digi_play("300t002", 2, 155, -1, 300);
|
||||
hotspot_set_active("TRUFFLES", false);
|
||||
hotspot_set_active("GROUND ", false);
|
||||
intr_remove_no_walk_rect(_walk1);
|
||||
series_play("310tr03", 0xb00);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10008:
|
||||
_trufflesShould = 16;
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 1:
|
||||
ws_hide_walker();
|
||||
_general.play("310wi01", 0xb00, 16, -1, 6, 0, 100, 0, 0, 0, 5);
|
||||
_probeShould = 9;
|
||||
kernel_trigger_dispatch_now(kCHANGE_PROBE_ANIMATION);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_general.terminate();
|
||||
_G(wilbur_should) = 3;
|
||||
series_play_with_breaks(PLAY4, "310wi01", 0xb00, kCHANGE_WILBUR_ANIMATION, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ws_unhide_walker();
|
||||
pal_fade_init(_G(kernel).first_fade, 255, 0, 30, 3006);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_state1 = imath_ranged_rand(0, 2);
|
||||
|
||||
switch (_state1) {
|
||||
case 0:
|
||||
wilbur_speech("310w005a");
|
||||
term_message("Wilbur: Whoa, easy Truffles!");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
wilbur_speech("310w005b");
|
||||
term_message("Wilbur: Down, piggy!");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
wilbur_speech("310w005c");
|
||||
term_message("Wilbur: Aaaaaaaaaa!");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
wilbur_speech(_G(flags)[V145] ? "310w010" : "310w009");
|
||||
break;
|
||||
|
||||
case 6:
|
||||
player_set_commands_allowed(false);
|
||||
_G(wilbur_should) = 1;
|
||||
wilbur_speech("310w008", kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room310::pre_parser() {
|
||||
Mine::pre_parser();
|
||||
|
||||
if (player_said("GEAR", "PROBE") && (!_G(flags)[kTrufflesInMine] || _G(flags)[kTrufflesRanAway] == 1)) {
|
||||
_G(wilbur_should) = 6;
|
||||
player_hotspot_walk_override(293, 288, 3, kCHANGE_WILBUR_ANIMATION);
|
||||
_G(player).command_ready = false;
|
||||
} else if (!_G(flags)[kTrufflesRanAway]) {
|
||||
HotSpotRec *hotspot = hotspot_which(_G(player).click_x, _G(player).click_y);
|
||||
assert(hotspot);
|
||||
|
||||
if (hotspot->feet_x > 360 && hotspot->feet_x < 515 &&
|
||||
hotspot->feet_y > 265 && hotspot->feet_y < 293) {
|
||||
player_hotspot_walk_override(hotspot->feet_x, 294, 11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room310::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
Mine::parser();
|
||||
if (!_G(player).command_ready)
|
||||
return;
|
||||
|
||||
if (_G(walker).wilbur_said(SAID)) {
|
||||
// Already handled
|
||||
} else if (player_said("GEAR", "PROBE") || player_said("TAKE", "PROBE")) {
|
||||
term_message("truffles in mine %d truffles ran away %d",
|
||||
_G(flags)[kTrufflesInMine], _G(flags)[kTrufflesRanAway]);
|
||||
|
||||
if (_G(flags)[kTrufflesInMine] == 1 && !_G(flags)[kTrufflesRanAway]) {
|
||||
term_message("Wilbur pissed off truffles!");
|
||||
player_set_commands_allowed(false);
|
||||
_trufflesShould = 14;
|
||||
}
|
||||
} else if (player_said("LOOK AT", "TRUFFLES")) {
|
||||
_G(wilbur_should) = 5;
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
66
engines/m4/burger/rooms/section3/room310.h
Normal file
66
engines/m4/burger/rooms/section3/room310.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM310_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM310_H
|
||||
|
||||
#include "m4/burger/rooms/section3/mine.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Room310 : public Mine {
|
||||
private:
|
||||
static const char *SAID[][4];
|
||||
static const seriesPlayBreak PLAY1[];
|
||||
static const seriesPlayBreak PLAY2[];
|
||||
static const seriesPlayBreak PLAY3[];
|
||||
static const seriesPlayBreak PLAY4[];
|
||||
static const seriesPlayBreak PLAY5[];
|
||||
static const seriesPlayBreak PLAY6[];
|
||||
static int32 _state1;
|
||||
Series _series1;
|
||||
machine *_series2 = nullptr;
|
||||
noWalkRect *_walk1 = nullptr;
|
||||
int _probeShould = 0;
|
||||
int _trufflesShould = 0;
|
||||
|
||||
protected:
|
||||
const char *getDigi() override {
|
||||
return "310_001";
|
||||
}
|
||||
|
||||
public:
|
||||
Room310();
|
||||
~Room310() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
226
engines/m4/burger/rooms/section3/section3.cpp
Normal file
226
engines/m4/burger/rooms/section3/section3.cpp
Normal file
@@ -0,0 +1,226 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/section3.h"
|
||||
#include "m4/burger/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
static const seriesPlayBreak PLAY1[] = {
|
||||
{ 0, 15, nullptr, 1, 0, -1, 2048, 0, nullptr, 0 },
|
||||
{ 16, 46, "300w039", 1, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 47, 60, "300_006", 2, 255, -1, 0, 0, nullptr, 0 },
|
||||
{ 60, 60, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
{ 60, -1, nullptr, 0, 0, -1, 0, 0, nullptr, 0 },
|
||||
PLAY_BREAK_END
|
||||
};
|
||||
|
||||
|
||||
Section3::Section3() : Rooms::Section() {
|
||||
add(301, &_room301);
|
||||
add(302, &_room302);
|
||||
add(303, &_room303);
|
||||
add(304, &_room304);
|
||||
add(305, &_room305);
|
||||
add(306, &_room306);
|
||||
add(307, &_room307);
|
||||
add(310, &_room310);
|
||||
add(311, &_mine);
|
||||
add(312, &_mine);
|
||||
add(313, &_mine);
|
||||
add(314, &_mine);
|
||||
add(315, &_mine);
|
||||
add(316, &_mine);
|
||||
add(317, &_mine);
|
||||
add(318, &_mine);
|
||||
add(319, &_mine);
|
||||
}
|
||||
|
||||
void Section3::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 3001:
|
||||
_G(game).setRoom(302);
|
||||
break;
|
||||
|
||||
case 3002:
|
||||
_G(game).setRoom(303);
|
||||
break;
|
||||
|
||||
case 3003:
|
||||
_G(game).setRoom(304);
|
||||
break;
|
||||
|
||||
case 3004:
|
||||
_G(game).setRoom(305);
|
||||
break;
|
||||
|
||||
case 3005:
|
||||
digi_unload("303_003");
|
||||
_G(game).setRoom(306);
|
||||
break;
|
||||
|
||||
case 3006:
|
||||
_G(game).setRoom(307);
|
||||
break;
|
||||
|
||||
case 3007:
|
||||
player_set_commands_allowed(false);
|
||||
gr_pal_clear(_G(master_palette));
|
||||
release_trigger_on_digi_state(3005, 1, 0);
|
||||
break;
|
||||
|
||||
case 3008:
|
||||
_random1 = imath_ranged_rand(0, 5);
|
||||
digi_play(Common::String::format("300t001%c", 'a' + _random1).c_str(), 2, 55, -1, 300);
|
||||
break;
|
||||
|
||||
case 10008:
|
||||
if (!_G(flags)[kTrufflesInMine])
|
||||
kernel_timing_trigger(15, 3008);
|
||||
break;
|
||||
|
||||
case kCHANGE_WILBUR_ANIMATION:
|
||||
switch (_G(wilbur_should)) {
|
||||
case 3001:
|
||||
player_update_info();
|
||||
_G(flags)[kDrunkCarrotJuice] = 1;
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_G(wilbur_should) = 3002;
|
||||
series_play_with_breaks(PLAY1, "300wdcj", _G(player_info).depth,
|
||||
kCHANGE_WILBUR_ANIMATION, 3, 6, _G(player_info).scale,
|
||||
_G(player_info).x, _G(player_info).y);
|
||||
break;
|
||||
|
||||
case 3002:
|
||||
inv_move_object("DISTILLED CARROT JUICE", NOWHERE);
|
||||
inv_give_to_player("JUG");
|
||||
ws_unhide_walker();
|
||||
_G(wilbur_should) = 10001;
|
||||
|
||||
wilbur_speech(_G(flags)[V101] ? "300w041" : "300w040");
|
||||
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
|
||||
break;
|
||||
|
||||
case 10013:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
_G(wilbur_should) = 10002;
|
||||
|
||||
if (_G(flags)[kTrufflesInMine]) {
|
||||
_G(flags)[V002] = 1;
|
||||
wilbur_speech("300w060");
|
||||
}
|
||||
break;
|
||||
|
||||
case 10015:
|
||||
_G(game).setRoom(306);
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Section3::parser() {
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
|
||||
if (player_said("DISTILLED CARROT JUICE")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
wilbur_speech("300w030");
|
||||
} else if (player_said("TRUFFLES") || player_said("TROUGH")) {
|
||||
wilbur_speech("300w031");
|
||||
} else if (player_said_any("GEAR", "WILBUR")) {
|
||||
_G(wilbur_should) = 3001;
|
||||
ws_turn_to_face(3, kCHANGE_WILBUR_ANIMATION);
|
||||
} else if (player_said("BOTTLE")) {
|
||||
wilbur_speech("300w076");
|
||||
} else if (player_said("TAKE") && inv_player_has("DISTILLED CARROT JUICE")) {
|
||||
wilbur_speech("999w021");
|
||||
} else {
|
||||
wilbur_speech("300w042");
|
||||
}
|
||||
} else if (player_said("BURGER MORSEL")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
wilbur_speech("300w006");
|
||||
} else if (player_said("TROUGH")) {
|
||||
wilbur_speech("300w004");
|
||||
} else if (player_said("WILBUR")) {
|
||||
wilbur_speech("300w013");
|
||||
} else if (player_said("TRUFFLES") && _G(game).room_id == 310) {
|
||||
wilbur_speech("300w012");
|
||||
} else if (player_said("STOVE") || player_said("FRYING PAN") || player_said("POT")) {
|
||||
wilbur_speech("300w011");
|
||||
} else if (player_said("TAKE") && inv_player_has("BURGER MORSEL")) {
|
||||
wilbur_speech("999w021");
|
||||
} else {
|
||||
wilbur_speech("300w014");
|
||||
}
|
||||
} else if (player_said("MATCHES")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
wilbur_speech("300w015");
|
||||
} else if (player_said("TRUFFLES")) {
|
||||
wilbur_speech("300w016");
|
||||
} else if (player_said("CABIN")) {
|
||||
wilbur_speech("300w017");
|
||||
} else if (player_said("WILBUR")) {
|
||||
wilbur_speech("300w024");
|
||||
} else if (player_said("TAKE") && inv_player_has("MATCHES")) {
|
||||
wilbur_speech("999w021");
|
||||
} else {
|
||||
wilbur_speech("300w025");
|
||||
}
|
||||
} else if (player_said("JUG")) {
|
||||
if (player_said("LOOK AT")) {
|
||||
wilbur_speech("303w022");
|
||||
} else if (player_said("BOILER") || player_said("WILBUR") || player_said("GEAR")) {
|
||||
wilbur_speech("300w027");
|
||||
} else if (player_said("CARROT JUICE")) {
|
||||
wilbur_speech("300w050");
|
||||
} else if (player_said("TAKE") && inv_player_has("JUG")) {
|
||||
wilbur_speech("999w021");
|
||||
} else {
|
||||
wilbur_speech("300w029");
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Section3::mine_check_maze() {
|
||||
// This was used in the original to do sanity checks that the
|
||||
// mine maze data was all valid
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
71
engines/m4/burger/rooms/section3/section3.h
Normal file
71
engines/m4/burger/rooms/section3/section3.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
#include "m4/burger/rooms/section.h"
|
||||
#include "m4/burger/rooms/section3/room301.h"
|
||||
#include "m4/burger/rooms/section3/room302.h"
|
||||
#include "m4/burger/rooms/section3/room303.h"
|
||||
#include "m4/burger/rooms/section3/room304.h"
|
||||
#include "m4/burger/rooms/section3/room305.h"
|
||||
#include "m4/burger/rooms/section3/room306.h"
|
||||
#include "m4/burger/rooms/section3/room307.h"
|
||||
#include "m4/burger/rooms/section3/room310.h"
|
||||
#include "m4/burger/rooms/section3/mine.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Section3 : public Rooms::Section {
|
||||
private:
|
||||
Room301 _room301;
|
||||
Room302 _room302;
|
||||
Room303 _room303;
|
||||
Room304 _room304;
|
||||
Room305 _room305;
|
||||
Room306 _room306;
|
||||
Room307 _room307;
|
||||
Room310 _room310;
|
||||
Mine _mine;
|
||||
int _random1 = 0;
|
||||
|
||||
void mine_check_maze();
|
||||
|
||||
public:
|
||||
Section3();
|
||||
virtual ~Section3() {}
|
||||
|
||||
void init() override {
|
||||
mine_check_maze();
|
||||
}
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
72
engines/m4/burger/rooms/section3/section3_room.cpp
Normal file
72
engines/m4/burger/rooms/section3/section3_room.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/burger/rooms/section3/section3_room.h"
|
||||
#include "m4/burger/vars.h"
|
||||
#include "m4/core/errors.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
void Section3Room::preload() {
|
||||
Rooms::Room::preload();
|
||||
_digiName = nullptr;
|
||||
}
|
||||
|
||||
void Section3Room::setupDigi() {
|
||||
if (_digiName) {
|
||||
digi_stop(3);
|
||||
digi_unload(_digiName);
|
||||
}
|
||||
|
||||
_digiVolume = 75;
|
||||
_digiName = getDigi();
|
||||
|
||||
if (_digiName) {
|
||||
digi_preload(_digiName);
|
||||
digi_play_loop(_digiName, 3, _digiVolume);
|
||||
}
|
||||
}
|
||||
|
||||
void Section3Room::set_palette_brightness(int start, int finish, int percent) {
|
||||
if (finish < start || finish > 255 || start < 0)
|
||||
error_show(FL, 'Burg', "set_palette_brightness index error");
|
||||
|
||||
RGB8 *pal = &_G(master_palette)[start];
|
||||
for (int index = start; index < finish; ++index, ++pal) {
|
||||
const int r = (double)pal->r * (double)percent / (double)100;
|
||||
const int g = (double)pal->g * (double)percent / (double)100;
|
||||
const int b = (double)pal->b * (double)percent / (double)100;
|
||||
|
||||
pal->r = CLIP(r, 0, 255);
|
||||
pal->g = CLIP(g, 0, 255);
|
||||
pal->b = CLIP(b, 0, 255);
|
||||
}
|
||||
}
|
||||
|
||||
void Section3Room::set_palette_brightness(int percent) {
|
||||
set_palette_brightness(32, 95, percent);
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
57
engines/m4/burger/rooms/section3/section3_room.h
Normal file
57
engines/m4/burger/rooms/section3/section3_room.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_BURGER_ROOMS_SECTION3_ROOM_H
|
||||
#define M4_BURGER_ROOMS_SECTION3_ROOM_H
|
||||
|
||||
#include "m4/burger/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Burger {
|
||||
namespace Rooms {
|
||||
|
||||
class Section3Room : public Rooms::Room {
|
||||
private:
|
||||
const char *_digiName = nullptr;
|
||||
|
||||
protected:
|
||||
int _digiVolume = 0;
|
||||
|
||||
virtual const char *getDigi() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void set_palette_brightness(int start, int finish, int percent);
|
||||
void set_palette_brightness(int percent);
|
||||
|
||||
public:
|
||||
Section3Room() : Rooms::Room() {}
|
||||
virtual ~Section3Room() {}
|
||||
|
||||
void preload() override;
|
||||
void setupDigi();
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Burger
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user