Initial commit
This commit is contained in:
1400
engines/m4/riddle/rooms/section5/room501.cpp
Normal file
1400
engines/m4/riddle/rooms/section5/room501.cpp
Normal file
File diff suppressed because it is too large
Load Diff
110
engines/m4/riddle/rooms/section5/room501.h
Normal file
110
engines/m4/riddle/rooms/section5/room501.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* 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_RIDDLE_ROOMS_SECTION5_ROOM501_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM501_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room501 : public Room {
|
||||
private:
|
||||
machine *_ripley = nullptr;
|
||||
machine *_shadow = nullptr;
|
||||
machine *_agent = nullptr;
|
||||
machine *_clock = nullptr;
|
||||
machine *_paper = nullptr;
|
||||
machine *_deltaPuffinMachine = nullptr;
|
||||
int _agentTalkLoop = 0;
|
||||
int _agentStridesForward = 0;
|
||||
int _puffinExchange = 0;
|
||||
const char *_digiName = nullptr;
|
||||
int _convEntry = 0;
|
||||
bool _flag = false;
|
||||
int _ripTalkLoop = 0;
|
||||
int _ripSeries1 = 0;
|
||||
int _ripParcelExchange = 0;
|
||||
int _ripMoneyExchange = 0;
|
||||
int _ripSignsPaper = 0;
|
||||
int _agentShould = 0;
|
||||
int _val2 = 0;
|
||||
int _ripleyShould = 0;
|
||||
int _val4 = 0;
|
||||
int _val5 = 0;
|
||||
int _trigger1 = 0;
|
||||
int _trigger4 = 0;
|
||||
int _val8 = 0;
|
||||
int _ripleyMode = 0;
|
||||
int _xyzzy1 = 0;
|
||||
int _trigger2 = 0;
|
||||
int _xyzzy3 = 0;
|
||||
int _trigger3 = 0;
|
||||
int _xyzzy5 = 0;
|
||||
int _xyzzy6 = 0;
|
||||
int _xyzzy7 = 0;
|
||||
int _agentMode = 0;
|
||||
int _xyzzy9 = 0;
|
||||
int _xyzzy10 = 0;
|
||||
int _itemsCount = 0;
|
||||
int _items[12];
|
||||
int32 _hasItems = 0;
|
||||
int32 _hasLetter = 0;
|
||||
int32 _hasCrystalSkull = 0;
|
||||
int32 _hasStickAndShellMap = 0;
|
||||
int32 _hasWheeledToy = 0;
|
||||
int32 _hasRebusAmulet = 0;
|
||||
int32 _hasShrunkenHead = 0;
|
||||
int32 _hasSilverButterfly = 0;
|
||||
int32 _hasPostageStamp = 0;
|
||||
int32 _hasGermanBanknote = 0;
|
||||
int32 _hasWhaleBoneHorn = 0;
|
||||
int32 _hasChisel = 0;
|
||||
int32 _hasIncenseBurner = 0;
|
||||
int32 _hasRomanovEmerald = 0;
|
||||
const char *_queuedDigi[4];
|
||||
int _ripSketching = 0;
|
||||
|
||||
void conv501a();
|
||||
|
||||
/**
|
||||
* Sets up the items array with any key items the player
|
||||
* has in their inventory
|
||||
* @return True if the player has at least one item
|
||||
*/
|
||||
bool updateItems();
|
||||
|
||||
public:
|
||||
Room501();
|
||||
~Room501() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
3662
engines/m4/riddle/rooms/section5/room504.cpp
Normal file
3662
engines/m4/riddle/rooms/section5/room504.cpp
Normal file
File diff suppressed because it is too large
Load Diff
130
engines/m4/riddle/rooms/section5/room504.h
Normal file
130
engines/m4/riddle/rooms/section5/room504.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* 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_RIDDLE_ROOMS_SECTION5_ROOM504_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM504_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room504 : public Room {
|
||||
private:
|
||||
machine *_ripley = nullptr;
|
||||
machine *_waterfall = nullptr;
|
||||
int _upSteps = 0;
|
||||
int _downSteps = 0;
|
||||
int _volume = 0;
|
||||
int _volume2 = 0;
|
||||
int _menendezShould = 0;
|
||||
int _ripleyShould = 0;
|
||||
int _ripleyMode = 0;
|
||||
int _ripSketching = 0;
|
||||
int _ripLowReach = 0;
|
||||
int _ripMedReach = 0;
|
||||
int _ripWipe = 0;
|
||||
int _ripStepUpLeft = 0;
|
||||
int _ripThrowFromLeft = 0;
|
||||
int _ripHiReach2Handed = 0;
|
||||
int _ripLeansBack = 0;
|
||||
int _ripStepUpRight = 0;
|
||||
int _ripThrowFromRight = 0;
|
||||
int _ripKneels = 0;
|
||||
int _ripShrunkenHead = 0;
|
||||
int _ripGivesMoneyEmerald = 0;
|
||||
int _ripGetsUp = 0;
|
||||
int _ripYells = 0;
|
||||
int _mzDigs = 0;
|
||||
int _mzStandsTalks = 0;
|
||||
int _mzTakesEmerald = 0;
|
||||
int _mzMenancesClimbs = 0;
|
||||
int _mzTakesMoney = 0;
|
||||
int _mzGivesHead = 0;
|
||||
int _vineTie = 0;
|
||||
int _vineUnrolling = 0;
|
||||
int _rightVineTie = 0;
|
||||
int _leftVineTie = 0;
|
||||
int _ropeLSlurpsUp = 0;
|
||||
int _ropeRSlurpsUp = 0;
|
||||
|
||||
machine *_vines1 = nullptr;
|
||||
machine *_vines2 = nullptr;
|
||||
machine *_vines3 = nullptr;
|
||||
machine *_vines4 = nullptr;
|
||||
machine *_rope = nullptr;
|
||||
machine *_ladder = nullptr;
|
||||
machine *_toy = nullptr;
|
||||
machine *_shovel = nullptr;
|
||||
machine *_driftwood = nullptr;
|
||||
machine *_pole = nullptr;
|
||||
machine *_mzMachine = nullptr;
|
||||
machine *_menendez = nullptr;
|
||||
machine *_vineMachine1 = nullptr;
|
||||
machine *_vineMachine2 = nullptr;
|
||||
machine *_ripStep = nullptr;
|
||||
machine *_vine = nullptr;
|
||||
bool _isOnRight = false;
|
||||
bool _flag2 = false;
|
||||
bool _flag3 = false;
|
||||
bool _flag4 = false;
|
||||
|
||||
int _trigger1 = 0;
|
||||
int _trigger2 = 0;
|
||||
int _trigger3 = 0;
|
||||
int _trigger4 = 0;
|
||||
int _vineThrowType = 0;
|
||||
int _menendezMode = 0;
|
||||
int32 _hasInti = 0;
|
||||
|
||||
void setVines();
|
||||
void freeVines();
|
||||
void setVinesRope();
|
||||
void setMiscItems();
|
||||
void disableVinesRope();
|
||||
void deleteHotspot(const char *hotspotName);
|
||||
void addRope();
|
||||
void addGreenVine();
|
||||
void addBrownVine();
|
||||
void addHotspot(int x1, int y1, int x2, int y2,
|
||||
const char *verb, const char *vocab);
|
||||
void addShovel();
|
||||
bool checkVinesDistance();
|
||||
bool parser1();
|
||||
void conv504a();
|
||||
bool lookVines();
|
||||
|
||||
public:
|
||||
Room504() : Room() {}
|
||||
~Room504() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
462
engines/m4/riddle/rooms/section5/room506.cpp
Normal file
462
engines/m4/riddle/rooms/section5/room506.cpp
Normal file
@@ -0,0 +1,462 @@
|
||||
/* 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/riddle/rooms/section5/room506.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/riddle/vars.h"
|
||||
#include "m4/gui/gui_vmng_screen.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
#define PALETTE_BLOCK 39
|
||||
|
||||
Room506::Room506() : Room() {
|
||||
}
|
||||
|
||||
void Room506::preload() {
|
||||
_G(player).walker_type = 1;
|
||||
_G(player).shadow_type = 1;
|
||||
}
|
||||
|
||||
void Room506::init() {
|
||||
_darkPaletteSet = _lightPaletteSet = _towerFlag = false;
|
||||
|
||||
if (_G(game).previous_room != KERNEL_RESTORING_GAME)
|
||||
_flag1 = true;
|
||||
|
||||
for (int i = 21; i < 59; ++i)
|
||||
_palette[i] = _G(master_palette)[i];
|
||||
|
||||
_G(kernel).call_daemon_every_loop = true;
|
||||
hotspot_set_active("OBSERVATORY DOOR", !_G(flags)[V156]);
|
||||
digi_preload("506_s01");
|
||||
digi_play_loop("506_s01", 3, 100);
|
||||
|
||||
if (_G(flags)[V157] == 1)
|
||||
_dome = series_play("506dome2", 0x100, 16, -1, 5);
|
||||
|
||||
if (inv_object_in_scene("CRYSTAL SKULL", 510)) {
|
||||
_skullSparkle = series_play("506 skull sparkle", 0x100, 16, -1, 5, 0, 100, 0, 0, 0, 0);
|
||||
kernel_timing_trigger(imath_ranged_rand(600, 3600), 505);
|
||||
}
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
break;
|
||||
|
||||
case 504:
|
||||
_flag1 = false;
|
||||
MoveScreenDelta(-640, 0);
|
||||
player_set_commands_allowed(false);
|
||||
series_play("506 RIP UP STEPS", 0x700, 0, 503, 5);
|
||||
ws_demand_location(_G(my_walker), 1054, 346, 12);
|
||||
ws_hide_walker();
|
||||
break;
|
||||
|
||||
case 507:
|
||||
digi_unload("507_s02");
|
||||
ws_demand_location(_G(my_walker), 346, 214, 4);
|
||||
ws_walk(_G(my_walker), 420, 234, nullptr, 502, 4);
|
||||
player_set_commands_allowed(false);
|
||||
break;
|
||||
|
||||
case 508:
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (_G(flags)[V158]) {
|
||||
ws_demand_location(_G(my_walker), 100, 100);
|
||||
ws_hide_walker();
|
||||
digi_preload("506_s02");
|
||||
digi_unload("508_s01");
|
||||
_domeRotation = series_stream("506 DOME ROTATION", 20, 0x100, -1);
|
||||
series_stream_break_on_frame(_domeRotation, 45, 500);
|
||||
digi_play("506_S02", 1);
|
||||
} else {
|
||||
ws_demand_location(_G(my_walker), 346, 214, 4);
|
||||
ws_walk(_G(my_walker), 420, 234, nullptr, 502, 4);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
MoveScreenDelta(-432, 0);
|
||||
ws_demand_location(_G(my_walker), 754, 242, 8);
|
||||
ws_walk(_G(my_walker), 697, 247, nullptr, 502, 8);
|
||||
player_set_commands_allowed(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_flag1)
|
||||
restorePalette();
|
||||
else
|
||||
setDarkPalette();
|
||||
}
|
||||
|
||||
void Room506::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 500:
|
||||
disable_player_commands_and_fade_init(501);
|
||||
break;
|
||||
|
||||
case 501:
|
||||
adv_kill_digi_between_rooms(false);
|
||||
digi_play_loop("506_s01", 3, 100);
|
||||
_G(game).setRoom(508);
|
||||
break;
|
||||
|
||||
case 502:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 503:
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 505:
|
||||
terminateMachineAndNull(_skullSparkle);
|
||||
_skullSparkle = series_play("506 skull sparkle", 0x100, 16, 506, 5);
|
||||
break;
|
||||
|
||||
case 506:
|
||||
terminateMachineAndNull(_skullSparkle);
|
||||
_skullSparkle = series_play("506 skull sparkle", 0x100, 16, -1, 5);
|
||||
kernel_timing_trigger(imath_ranged_rand(600, 3600), 505);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room506::pre_parser() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1000:
|
||||
if (_G(i_just_hyperwalked))
|
||||
_G(please_hyperwalk) = true;
|
||||
|
||||
if (_towerFlag) {
|
||||
ws_walk(_G(my_walker), _destX, _destY, nullptr, 1002, _destFacing);
|
||||
Common::strcpy_s(_G(player).verb, "IN TOWER");
|
||||
} else {
|
||||
ws_walk(_G(my_walker), _destX, _destY, nullptr, -1, _destFacing);
|
||||
}
|
||||
|
||||
restorePalette();
|
||||
break;
|
||||
|
||||
case 1001:
|
||||
if (_G(i_just_hyperwalked))
|
||||
_G(please_hyperwalk) = true;
|
||||
|
||||
if (_towerFlag) {
|
||||
ws_walk(_G(my_walker), _destX, _destY, nullptr, 1002, _destFacing);
|
||||
Common::strcpy_s(_G(player).verb, "IN TOWER");
|
||||
} else {
|
||||
ws_walk(_G(my_walker), _destX, _destY, nullptr, -1, _destFacing);
|
||||
}
|
||||
|
||||
setDarkPalette();
|
||||
break;
|
||||
|
||||
case 1002:
|
||||
player_set_commands_allowed(false);
|
||||
disable_player_commands_and_fade_init(1004);
|
||||
break;
|
||||
|
||||
case 1004:
|
||||
_G(game).setRoom(509);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (_G(player).need_to_walk || _G(player).ready_to_walk || _G(player).waiting_for_walk) {
|
||||
_towerFlag = !scumm_strnicmp(_G(player).verb, "IN TOWER", 8);
|
||||
|
||||
if (_G(player).walk_x < 900 && _darkPaletteSet && !player_said(" ") && !player_said(" ")) {
|
||||
saveWalk();
|
||||
ws_walk(_G(my_walker), 717, 144, nullptr, 1000, 1);
|
||||
}
|
||||
|
||||
if (_G(player).walk_x > 900 && _lightPaletteSet && !player_said(" ") && !player_said(" ")) {
|
||||
saveWalk();
|
||||
ws_walk(_G(my_walker), 995, 308, nullptr, 1001, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room506::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
const bool takeFlag = player_said("take");
|
||||
const bool useFlag = player_said("gear");
|
||||
|
||||
if (takeFlag && player_said("CLUMP OF VINES")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
if (_G(flags)[V152] != 6 && _G(flags)[V153] != 6) {
|
||||
digi_play("504R47", 1, 255, -1, 504);
|
||||
} else {
|
||||
player_set_commands_allowed(false);
|
||||
_ripLowReach = series_load("RIP TREK LOW REACHER POS5");
|
||||
setGlobals1(_ripLowReach, 1, 26, 26, 26, 0, 26, 1, 1, 1);
|
||||
sendWSMessage_110000(2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
kernel_examine_inventory_object(_G(flags)[V152] == 6 ? "PING GREEN VINE" :
|
||||
"PING BROWN VINE", 5, 1, 396, 180, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (_G(flags)[V152] == 6) {
|
||||
inv_give_to_player("GREEN VINE");
|
||||
_G(flags)[V152] = 3;
|
||||
} else {
|
||||
inv_give_to_player("BROWN VINE");
|
||||
_G(flags)[V153] = 3;
|
||||
}
|
||||
|
||||
sendWSMessage_120000(4);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
sendWSMessage_150000(5);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
series_unload(_ripLowReach);
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said("CLUMP OF VINES")) {
|
||||
digi_play("506R19", 1);
|
||||
} else if (lookFlag && player_said("NICHE")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
digi_play(inv_object_in_scene("CRYSTAL SKULL", 510) ? "506R04" : "com127", 1, 255, 3);
|
||||
_ripley = series_play("RIPLEY LOOKS TO NICH", 0x700, 16, -1, 7);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
terminateMachineAndNull(_ripley);
|
||||
_ripley = series_play("RIPLEY LOOKS TO NICH", 0x700, 2, 5, 7);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
terminateMachineAndNull(_ripley);
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said("SKELETON")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
digi_play("506R03", 1, 255, 3);
|
||||
_ripley = series_play("RIPLEY LOOKS TO NICH", 0x700, 16, -1, 7);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
terminateMachineAndNull(_ripley);
|
||||
_ripley = series_play("RIPLEY LOOKS TO NICH", 0x700, 2, 5, 7);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
terminateMachineAndNull(_ripley);
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said("TERRACE")) {
|
||||
digi_play("506R05", 1);
|
||||
} else if (lookFlag && player_said("OBSERVATORY")) {
|
||||
digi_play("506R06", 1);
|
||||
} else if (player_said("OBSERVATORY DOOR") && (!lookFlag && !takeFlag && !useFlag)) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
player_set_commands_allowed(false);
|
||||
disable_player_commands_and_fade_init(2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
adv_kill_digi_between_rooms(false);
|
||||
digi_preload("506_s01");
|
||||
digi_play_loop("506_s01", 3, 100);
|
||||
_G(game).setRoom(507);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said("OBSERVATORY DOME")) {
|
||||
digi_play("506R07", 1);
|
||||
} else if (lookFlag && player_said("SPIDER STATUE")) {
|
||||
digi_play("506R08", 1);
|
||||
} else if (lookFlag && player_said("TOWER")) {
|
||||
digi_play("506R02", 1);
|
||||
} else if (lookFlag && player_said_any(" ", " ")) {
|
||||
digi_play(_G(player).been_here_before ? "506r01" : "506r01a", 1);
|
||||
} else if (player_said("STAIRS FROM LANDING")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
series_play("506 RIP DOWN STEPS", 0x700, 0, -1, 5);
|
||||
kernel_timing_trigger(60, 3);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
disable_player_commands_and_fade_init(5);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_G(game).setRoom(504);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (player_said("IN TOWER")) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
disable_player_commands_and_fade_init(2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_G(game).setRoom(509);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (player_said("IN OBSERVATORY")) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
disable_player_commands_and_fade_init(2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_G(game).setRoom(508);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (player_said(" ")) {
|
||||
restorePalette();
|
||||
ws_walk(_G(my_walker), 662, 143, nullptr, -1, 8);
|
||||
|
||||
if (_towerFlag)
|
||||
Common::strcpy_s(_G(player).verb, "IN TOWER");
|
||||
}
|
||||
|
||||
if (player_said(" ")) {
|
||||
setDarkPalette();
|
||||
ws_walk(_G(my_walker), 1039, 328, nullptr, -1, 4);
|
||||
|
||||
if (_towerFlag)
|
||||
Common::strcpy_s(_G(player).verb, "IN TOWER");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room506::restorePalette() {
|
||||
if (!_lightPaletteSet) {
|
||||
_lightPaletteSet = true;
|
||||
_darkPaletteSet = false;
|
||||
hotspot_set_active(" ", false);
|
||||
hotspot_set_active(" ", true);
|
||||
|
||||
for (int i = 21; i < 59; ++i) {
|
||||
_G(master_palette)[i].r = _palette[i].r;
|
||||
_G(master_palette)[i].g = _palette[i].g;
|
||||
_G(master_palette)[i].b = _palette[i].b;
|
||||
}
|
||||
|
||||
gr_pal_set_range(21, PALETTE_BLOCK);
|
||||
_flag1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Room506::setDarkPalette() {
|
||||
if (!_darkPaletteSet) {
|
||||
_darkPaletteSet = true;
|
||||
_lightPaletteSet = false;
|
||||
hotspot_set_active(" ", true);
|
||||
hotspot_set_active(" ", false);
|
||||
|
||||
for (int i = 21; i < 59; ++i) {
|
||||
const int palR = MAX(_G(master_palette)[i].r - 100, 0);
|
||||
const int palG = MAX(_G(master_palette)[i].g - 100, 0);
|
||||
const int palB = MAX(_G(master_palette)[i].b - 100, 0);
|
||||
|
||||
_G(master_palette)[i].r = palR;
|
||||
_G(master_palette)[i].g = palG;
|
||||
_G(master_palette)[i].b = palB;
|
||||
}
|
||||
|
||||
gr_pal_set_range(21, PALETTE_BLOCK);
|
||||
_flag1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Room506::saveWalk() {
|
||||
_G(player).need_to_walk = false;
|
||||
_G(player).ready_to_walk = false;
|
||||
_G(player).waiting_for_walk = false;
|
||||
_destX = _G(player).walk_x;
|
||||
_destY = _G(player).walk_y;
|
||||
_destFacing = _G(player).walk_facing;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
65
engines/m4/riddle/rooms/section5/room506.h
Normal file
65
engines/m4/riddle/rooms/section5/room506.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_RIDDLE_ROOMS_SECTION5_ROOM506_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM506_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room506 : public Room {
|
||||
private:
|
||||
RGB8 _palette[59] = {};
|
||||
bool _flag1 = false;
|
||||
bool _darkPaletteSet = false;
|
||||
bool _lightPaletteSet = false;
|
||||
bool _towerFlag = false;
|
||||
int _destX = 0, _destY = 0;
|
||||
int _destFacing = 0;
|
||||
machine *_ripley = nullptr;
|
||||
machine *_dome = nullptr;
|
||||
machine *_skullSparkle = nullptr;
|
||||
machine *_domeRotation = nullptr;
|
||||
int _ripLowReach = 0;
|
||||
|
||||
void restorePalette();
|
||||
void setDarkPalette();
|
||||
void saveWalk();
|
||||
|
||||
public:
|
||||
Room506();
|
||||
~Room506() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
217
engines/m4/riddle/rooms/section5/room507.cpp
Normal file
217
engines/m4/riddle/rooms/section5/room507.cpp
Normal file
@@ -0,0 +1,217 @@
|
||||
/* 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/riddle/rooms/section5/room507.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/riddle/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
static const char *BLOCK_NAMES[8] = {
|
||||
nullptr, "507 BLOCK ONE", "507 BLOCK TWO", "507 BLOCK THREE",
|
||||
"507 BLOCK FOUR", "507 BLOCK FIVE", "507 BLOCK SIX",
|
||||
"507 BLOCK SEVEN"
|
||||
};
|
||||
static const char *BLOCK_DIGI[8] = {
|
||||
nullptr, "507_s03", "507_s03a", "507_s03b", "507_s03c",
|
||||
"507_s03d", "507_s03e", "507_s03f"
|
||||
};
|
||||
int BLOCK_CORRECT[8] = {
|
||||
-1, 12, 4, 12, 8, 0, 8, 4
|
||||
};
|
||||
|
||||
Room507::Room507() : Room() {
|
||||
}
|
||||
|
||||
void Room507::preload() {
|
||||
_G(player).walker_in_this_scene = false;
|
||||
LoadWSAssets("OTHER SCRIPT");
|
||||
}
|
||||
|
||||
void Room507::init() {
|
||||
digi_preload("507_s02");
|
||||
digi_preload("507_s03");
|
||||
digi_preload("507_s03a");
|
||||
digi_preload("507_s03b");
|
||||
digi_preload("507_s03c");
|
||||
digi_preload("507_s03d");
|
||||
digi_preload("507_s03e");
|
||||
digi_preload("507_s03f");
|
||||
digi_preload("507_s04");
|
||||
|
||||
for (int i = 1; i <= 7; ++i) {
|
||||
_blockFlag[i] = false;
|
||||
_blockSeries[i] = series_load(BLOCK_NAMES[i]);
|
||||
_block[i] = series_show(BLOCK_NAMES[i], 0x400, 16, -1, -1,
|
||||
_G(flags)[(Flag)(V172 + i)]);
|
||||
}
|
||||
|
||||
_doorSeries = series_load("507DOOR2");
|
||||
_door = series_show("507DOOR2", 0x400, 16);
|
||||
digi_play_loop("507_s02", 3, 170);
|
||||
|
||||
if (_G(game).previous_room == 506)
|
||||
digi_unload("506_s01");
|
||||
|
||||
if (!player_been_here(507)) {
|
||||
kernel_timing_trigger(1, 8);
|
||||
player_set_commands_allowed(false);
|
||||
}
|
||||
}
|
||||
|
||||
void Room507::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
for (int i = 1; i <= 7; ++i) {
|
||||
if (_G(flags)[(Flag)(V172 + i)] != BLOCK_CORRECT[i]) {
|
||||
player_set_commands_allowed(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
kernel_timing_trigger(10, 4);
|
||||
_G(flags)[V156] = 1;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
digi_stop(1);
|
||||
terminateMachineAndNull(_door);
|
||||
_door = series_stream("507 DOOR LOWERS", 8, 0x400, -1);
|
||||
series_stream_break_on_frame(_door, 19, 6);
|
||||
digi_play("507_S04", 2);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
disable_player_commands_and_fade_init(7);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
for (int i = 1; i <= 7; ++i)
|
||||
digi_unload(BLOCK_DIGI[i]);
|
||||
digi_stop(1);
|
||||
digi_play_loop("507_s02", 3, 170);
|
||||
adv_kill_digi_between_rooms(false);
|
||||
_G(game).setRoom(508);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
digi_play("507R01", 1, 255, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room507::pre_parser() {
|
||||
_G(player).resetWalk();
|
||||
}
|
||||
|
||||
void Room507::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
const bool useFlag = player_said("gear");
|
||||
|
||||
if (lookFlag && player_said("DOOR")) {
|
||||
digi_play("507r03", 1);
|
||||
} else if (lookFlag && player_said_any("STONE GLYPH ", "STONE GLYPH ",
|
||||
"STONE GLYPH ", "STONE GLYPH ", "STONE GLYPH ",
|
||||
"STONE GLYPH ", "STONE GLYPH ")) {
|
||||
if (_G(flags)[V172])
|
||||
digi_play("508R04", 1, 255, -1, 508);
|
||||
else
|
||||
digi_play("507R04", 1);
|
||||
} else if (lookFlag && player_said("SPIDER")) {
|
||||
digi_play("507R05", 1);
|
||||
} else if (lookFlag && player_said(" ")) {
|
||||
digi_play("507R02", 1);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(1);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(2);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(3);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(4);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(5);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(6);
|
||||
} else if (useFlag && player_said("STONE GLYPH ")) {
|
||||
useStoneGlyph(7);
|
||||
} else if (player_said("SHOVEL", "DOOR") && inv_player_has("SHOVEL")) {
|
||||
digi_play("507R07", 1);
|
||||
} else if (player_said("WOODEN LADDER", "DOOR") && inv_player_has("WOODEN LADDER")) {
|
||||
digi_play("507R07", 1);
|
||||
} else if (player_said("exit")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
disable_player_commands_and_fade_init(2);
|
||||
break;
|
||||
case 2:
|
||||
adv_kill_digi_between_rooms(false);
|
||||
digi_preload("507_s02");
|
||||
digi_play_loop("507_s02", 3, 100);
|
||||
_G(game).setRoom(506);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
void Room507::useStoneGlyph(int blockNum) {
|
||||
player_set_commands_allowed(false);
|
||||
|
||||
if (!_blockFlag[blockNum]) {
|
||||
terminateMachineAndNull(_block[blockNum]);
|
||||
_block[blockNum] = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, 0,
|
||||
triggerMachineByHashCallback, BLOCK_NAMES[blockNum]);
|
||||
_blockFlag[blockNum] = true;
|
||||
_G(flags)[V172] = 1;
|
||||
}
|
||||
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
sendWSMessage_190000(_block[blockNum], 15);
|
||||
sendWSMessage_10000(1, _block[blockNum], _blockSeries[blockNum],
|
||||
_G(flags)[(Flag)(V172 + blockNum)] + 1, _G(flags)[(Flag)(V172 + blockNum)] + 4, 3,
|
||||
_blockSeries[blockNum], _G(flags)[(Flag)(V172 + blockNum)] + 5,
|
||||
_G(flags)[(Flag)(V172 + blockNum)] + 5, 0);
|
||||
digi_play(BLOCK_DIGI[blockNum], 2);
|
||||
|
||||
_G(flags)[(Flag)(V172 + blockNum)] += 4;
|
||||
if (_G(flags)[(Flag)(V172 + blockNum)] >= 16)
|
||||
_G(flags)[(Flag)(V172 + blockNum)] = 0;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
55
engines/m4/riddle/rooms/section5/room507.h
Normal file
55
engines/m4/riddle/rooms/section5/room507.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* 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_RIDDLE_ROOMS_SECTION5_ROOM507_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM507_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room507 : public Room {
|
||||
private:
|
||||
int _blockSeries[8] = { 0 };
|
||||
machine *_block[8] = { nullptr };
|
||||
bool _blockFlag[8] = { false };
|
||||
int _doorSeries = 0;
|
||||
machine *_door = nullptr;
|
||||
|
||||
void useStoneGlyph(int blockNum);
|
||||
public:
|
||||
Room507();
|
||||
~Room507() override {}
|
||||
|
||||
void preload() override;
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
648
engines/m4/riddle/rooms/section5/room508.cpp
Normal file
648
engines/m4/riddle/rooms/section5/room508.cpp
Normal file
@@ -0,0 +1,648 @@
|
||||
/* 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/riddle/rooms/section5/room508.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/riddle/vars.h"
|
||||
#include "m4/adv_r/adv_file.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
void Room508::init() {
|
||||
hotspot_set_active("CRYSTAL SKULL ", false);
|
||||
hotspot_set_active("SHOVEL", false);
|
||||
hotspot_set_active("SHOVEL ", false);
|
||||
|
||||
if (inv_object_is_here("SHOVEL"))
|
||||
kernel_load_variant("508lock1");
|
||||
|
||||
if (_G(flags)[V158] == 1) {
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_ripReturnsToStander = series_load("RIP RETURNS TO STANDER");
|
||||
_chainBreaking = series_load("508 CHAIN BREAKING");
|
||||
_lightAppearing = series_load("LIGHT APPEARING ON FLOOR");
|
||||
|
||||
digi_preload("508_s02");
|
||||
digi_preload("508_s04");
|
||||
digi_preload("508_s08");
|
||||
|
||||
series_stream("RIP STOPS DOME TURNING", 7, 0x100, 525);
|
||||
digi_play("508_S02", 1);
|
||||
digi_play("508_S04", 2);
|
||||
|
||||
} else if (_G(game).previous_room != KERNEL_RESTORING_GAME) {
|
||||
ws_demand_location(_G(my_walker), 246, 265, 5);
|
||||
ws_walk(_G(my_walker), 256, 283, nullptr, 562, 5);
|
||||
}
|
||||
|
||||
if (_G(flags)[V157] == 1) {
|
||||
hotspot_set_active("CHAIN ", false);
|
||||
_chainSprite = series_place_sprite("508 CHAIN AFTER BREAK", 0, 0, 0, 100, 0xf00);
|
||||
_domeAfterTurn = series_place_sprite("DOME SPRITE AFTER ITS TURNED", 0, 0, 0, 100, 0xf00);
|
||||
|
||||
if (inv_object_is_here("CRYSTAL SKULL")) {
|
||||
hotspot_set_active("CRYSTAL SKULL ", true);
|
||||
_skull = series_place_sprite("SKULL SPRITE AFTER DOME TURN", 0, 0, 0, 100, 0x450);
|
||||
}
|
||||
|
||||
if (inv_object_is_here("SHOVEL")) {
|
||||
hotspot_set_active("SHOVEL ", true);
|
||||
_shovel = series_place_sprite("SHOVEL AFTER DOMES TURNED", 0, 0, 0, 100, 0x300);
|
||||
}
|
||||
}
|
||||
|
||||
if (_G(flags)[V157] == 0 && _G(flags)[V158] == 0) {
|
||||
_chainSprite = series_place_sprite("508 CHAIN BEFORE DOME TURNS", 0, 0, 0, 100, 0xf00);
|
||||
|
||||
if (inv_object_is_here("CRYSTAL SKULL")) {
|
||||
hotspot_set_active("CRYSTAL SKULL ", true);
|
||||
_skull = series_place_sprite("SKULL SPRITE BEFORE DOME TURN", 0, 0, 0, 100, 0x450);
|
||||
}
|
||||
|
||||
if (inv_object_is_here("SHOVEL")) {
|
||||
hotspot_set_active("SHOVEL", true);
|
||||
_shovel = series_place_sprite("SHOVEL SPRITE", 0, 0, 0, 100, 0x300);
|
||||
}
|
||||
}
|
||||
|
||||
digi_preload("508_s01");
|
||||
digi_play_loop("508_s01", 3, 120);
|
||||
|
||||
if (_G(flags)[V158] == 1) {
|
||||
digi_unload("506_s01");
|
||||
digi_unload("506_s02");
|
||||
}
|
||||
|
||||
if (_G(game).previous_room == 507)
|
||||
digi_unload("507_s02");
|
||||
}
|
||||
|
||||
void Room508::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 503:
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(_G(my_walker), 423, 356, nullptr, 504, 1);
|
||||
break;
|
||||
|
||||
case 504:
|
||||
_ripPutsShovel = series_load("RIP PUTS SHOVEL IN CAPSTAN");
|
||||
digi_preload("508_S03");
|
||||
player_update_info();
|
||||
ws_hide_walker();
|
||||
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100,
|
||||
_G(player_info).depth, false, triggerMachineByHashCallback, "Rp1");
|
||||
sendWSMessage_10000(1, _ripley, _ripPutsShovel, 1, 22, 505,
|
||||
_ripPutsShovel, 22, 22, 0);
|
||||
inv_move_object("SHOVEL", 508);
|
||||
break;
|
||||
|
||||
case 505:
|
||||
digi_play("508_S03", 2);
|
||||
sendWSMessage_10000(1, _ripley, _ripPutsShovel, 23, 34, 506,
|
||||
_ripPutsShovel, 34, 34, 0);
|
||||
break;
|
||||
|
||||
case 506:
|
||||
ws_unhide_walker();
|
||||
_shovel = series_place_sprite("SHOVEL SPRITE", 0, 0, 0, 100, 0x300);
|
||||
hotspot_set_active("SHOVEL", true);
|
||||
terminateMachineAndNull(_ripley);
|
||||
kernel_timing_trigger(1, 507);
|
||||
break;
|
||||
|
||||
case 507:
|
||||
series_unload(_ripPutsShovel);
|
||||
digi_unload("508_S03");
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 508:
|
||||
player_set_commands_allowed(false);
|
||||
_ripPutsShovel = series_load("RIP PUTS SHOVEL IN CAPSTAN");
|
||||
digi_preload("508_S03");
|
||||
player_update_info();
|
||||
ws_hide_walker();
|
||||
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100,
|
||||
_G(player_info).depth, false, triggerMachineByHashCallback, "Rp2");
|
||||
sendWSMessage_10000(1, _ripley, _ripPutsShovel, 34, 25, 509,
|
||||
_ripPutsShovel, 25, 25, 0);
|
||||
hotspot_set_active("SHOVEL", false);
|
||||
inv_give_to_player("SHOVEL");
|
||||
terminateMachineAndNull(_shovel);
|
||||
break;
|
||||
|
||||
case 509:
|
||||
digi_play("508_S03", 2);
|
||||
sendWSMessage_10000(1, _ripley, _ripPutsShovel, 24, 1, 510,
|
||||
_ripPutsShovel, 1, 1, 0);
|
||||
break;
|
||||
|
||||
case 510:
|
||||
ws_unhide_walker();
|
||||
terminateMachineAndNull(_ripley);
|
||||
series_unload(_ripPutsShovel);
|
||||
digi_unload("508_S03");
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 511:
|
||||
player_set_commands_allowed(false);
|
||||
_ripTryTurnDome = series_load("508 RIP TRYS TURNING DOME");
|
||||
player_update_info();
|
||||
ws_hide_walker();
|
||||
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100,
|
||||
_G(player_info).depth, false, triggerMachineByHashCallback, "Rp3");
|
||||
terminateMachineAndNull(_shovel);
|
||||
sendWSMessage_10000(1, _ripley, _ripTryTurnDome, 1, 29, 512,
|
||||
_ripTryTurnDome, 29, 29, 0);
|
||||
break;
|
||||
|
||||
case 512:
|
||||
sendWSMessage_10000(1, _ripley, _ripTryTurnDome, 29, 1, 513,
|
||||
_ripTryTurnDome, 1, 1, 0);
|
||||
break;
|
||||
|
||||
case 513:
|
||||
_shovel = series_place_sprite("SHOVEL SPRITE", 0, 0, 0, 100, 0x300);
|
||||
ws_unhide_walker();
|
||||
terminateMachineAndNull(_ripley);
|
||||
series_unload(_ripTryTurnDome);
|
||||
|
||||
if (_val1)
|
||||
kernel_timing_trigger(1, 514);
|
||||
else
|
||||
digi_play("508r11", 1, 255, 514);
|
||||
break;
|
||||
|
||||
case 514:
|
||||
if (_val1) {
|
||||
digi_play("508R16", 1);
|
||||
_val1 = 0;
|
||||
}
|
||||
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 515:
|
||||
player_set_commands_allowed(false);
|
||||
interface_hide();
|
||||
digi_preload("508_s02");
|
||||
digi_preload("508_s04");
|
||||
_ripTryTurnDome = series_load("508 RIP TRYS TURNING DOME");
|
||||
player_update_info();
|
||||
ws_hide_walker();
|
||||
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100,
|
||||
_G(player_info).depth, false, triggerMachineByHashCallback, "Rp4");
|
||||
sendWSMessage_10000(1, _ripley, _ripTryTurnDome, 1, 29, 516,
|
||||
_ripTryTurnDome, 29, 29, 0);
|
||||
break;
|
||||
|
||||
case 516:
|
||||
_ripStartTurnDome = series_stream("RIP STARTS TURNING DOME", 7, 0x100, -1);
|
||||
series_stream_break_on_frame(_ripStartTurnDome, 19, 518);
|
||||
kernel_timing_trigger(90, 517);
|
||||
terminateMachineAndNull(_shovel);
|
||||
terminateMachineAndNull(_skull);
|
||||
terminateMachineAndNull(_ripley);
|
||||
break;
|
||||
|
||||
case 517:
|
||||
digi_play_loop("508_S02", 1);
|
||||
digi_play_loop("508_S04", 2);
|
||||
break;
|
||||
|
||||
case 518:
|
||||
terminateMachineAndNull(_shovel);
|
||||
terminateMachineAndNull(_skull);
|
||||
terminateMachineAndNull(_ripley);
|
||||
series_set_frame_rate(_ripStartTurnDome, 9999);
|
||||
kernel_timing_trigger(1, 519);
|
||||
break;
|
||||
|
||||
case 519:
|
||||
pal_fade_init(21, 255, 0, 30, 520);
|
||||
break;
|
||||
|
||||
case 520:
|
||||
_G(flags)[V158] = 1;
|
||||
digi_play_loop("508_s01", 3, 120);
|
||||
adv_kill_digi_between_rooms(false);
|
||||
digi_play_loop("508_S02", 1);
|
||||
digi_play_loop("508_S04", 2);
|
||||
_G(game).setRoom(506);
|
||||
break;
|
||||
|
||||
case 525:
|
||||
digi_stop(1);
|
||||
digi_stop(2);
|
||||
digi_unload("508_s02");
|
||||
digi_unload("508_s04");
|
||||
|
||||
_domeAfterTurn = series_place_sprite("DOME SPRITE AFTER ITS TURNED", 0, 0, 0, 100, 0xf00);
|
||||
_skull = series_place_sprite("SKULL SPRITE AFTER DOME TURN", 0, 0, 0, 100, 0x450);
|
||||
_shovel = series_place_sprite("SHOVEL AFTER DOMES TURNED", 0, 0, 0, 100, 0x300);
|
||||
_statue = series_place_sprite("STATU SPRITE AFTER DOME TURN", 0, 0, 0, 100, 0x450);
|
||||
|
||||
_light = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0xf00, false,
|
||||
triggerMachineByHashCallback, "Receding Light");
|
||||
sendWSMessage_10000(1, _light, _lightAppearing, 12, 12, -1,
|
||||
_lightAppearing, 12, 12, 0);
|
||||
|
||||
player_update_info();
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100,
|
||||
_G(player_info).depth, false, triggerMachineByHashCallback, "Rp");
|
||||
sendWSMessage_10000(1, _ripley, _ripReturnsToStander, 1, 10, -1,
|
||||
_ripReturnsToStander, 10, 10, 0);
|
||||
|
||||
_chain = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0xf00, false,
|
||||
triggerMachineByHashCallback, "Chain Breaking Machine");
|
||||
sendWSMessage_10000(1, _chain, _chainBreaking, 1, 58, 675,
|
||||
_chainBreaking, 58, 58, 0);
|
||||
sendWSMessage_190000(_chain, 3);
|
||||
|
||||
digi_play("508_s08", 1, 255, 555);
|
||||
break;
|
||||
|
||||
case 530:
|
||||
series_unload(_ripReturnsToStander);
|
||||
_G(flags)[V158] = 0;
|
||||
_G(flags)[V157] = 0;
|
||||
break;
|
||||
|
||||
case 539:
|
||||
_x = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0xf00, false,
|
||||
triggerMachineByHashCallback, "x");
|
||||
sendWSMessage_10000(1, _x, _flick, 1, 2, -1, _flick, 1, 2, 0);
|
||||
sendWSMessage_190000(_x, 1);
|
||||
sendWSMessage_1a0000(_x, 1);
|
||||
series_set_frame_rate(_spect, 5);
|
||||
ws_OverrideCrunchTime(_spect);
|
||||
break;
|
||||
|
||||
case 541:
|
||||
sendWSMessage_190000(_light, 17);
|
||||
sendWSMessage_10000(1, _light, _lightAppearing, 12, 8, 542,
|
||||
_lightAppearing, 8, 8, 0);
|
||||
break;
|
||||
|
||||
case 542:
|
||||
sendWSMessage_10000(1, _light, _lightAppearing, 8, 1, 543,
|
||||
_lightAppearing, 1, 1, 0);
|
||||
sendWSMessage_10000(1, _x, _flick, 1, 6, 679, _flick, 6, 6, 0);
|
||||
break;
|
||||
|
||||
case 543:
|
||||
terminateMachineAndNull(_light);
|
||||
series_unload(_lightAppearing);
|
||||
sendWSMessage_120000(544);
|
||||
break;
|
||||
|
||||
case 544:
|
||||
sendWSMessage_10000(1, _x, _flick, 1, 6, 679, _flick, 6, 6, 0);
|
||||
sendWSMessage_130000(545);
|
||||
break;
|
||||
|
||||
case 545:
|
||||
sendWSMessage_150000(546);
|
||||
break;
|
||||
|
||||
case 546:
|
||||
_G(flags)[V161] = 1;
|
||||
series_unload(_ripSketching);
|
||||
kernel_timing_trigger(5, 552);
|
||||
break;
|
||||
|
||||
case 548:
|
||||
digi_play("508R12", 1, 255, 539);
|
||||
break;
|
||||
|
||||
case 552:
|
||||
digi_play("508R14", 1, 255, 553);
|
||||
break;
|
||||
|
||||
case 553:
|
||||
_G(flags)[V157] = 1;
|
||||
_G(flags)[V287] = 1;
|
||||
_val2 -= 5;
|
||||
|
||||
if (_val2 > 0) {
|
||||
digi_change_panning(2, _val2);
|
||||
kernel_timing_trigger(2, 553);
|
||||
} else {
|
||||
digi_stop(2);
|
||||
interface_show();
|
||||
player_set_commands_allowed(true);
|
||||
}
|
||||
break;
|
||||
|
||||
case 555:
|
||||
digi_unload("508_s08");
|
||||
digi_preload("508_s07");
|
||||
_val2 = 255;
|
||||
|
||||
digi_play("508_S07", 2);
|
||||
_lightAppearing = series_load("LIGHT APPEARING ON FLOOR");
|
||||
_flick = series_load("508flick");
|
||||
_spect = series_stream("508spect", 6, 0, 668);
|
||||
series_stream_break_on_frame(_spect, 16, 666);
|
||||
kernel_timing_trigger(30, 673);
|
||||
break;
|
||||
|
||||
case 562:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 666:
|
||||
series_set_frame_rate(_spect, 3000);
|
||||
hotspot_set_active("CRYSTAL SKULL ", true);
|
||||
hotspot_set_active("SHOVEL ", true);
|
||||
hotspot_set_active("SHOVEL", false);
|
||||
kernel_timing_trigger(5, 530);
|
||||
break;
|
||||
|
||||
case 668:
|
||||
kernel_timing_trigger(1, 671);
|
||||
break;
|
||||
|
||||
case 671:
|
||||
_ripSketching = series_load("RIP SKETCHING IN NOTEBOOK POS 2");
|
||||
setGlobals1(_ripSketching, 1, 24, 24, 24, 0, 24, 39, 39, 39, 0, 39, 1, 1, 1);
|
||||
sendWSMessage_110000(681);
|
||||
break;
|
||||
|
||||
case 673:
|
||||
terminateMachineAndNull(_ripley);
|
||||
ws_unhide_walker();
|
||||
ws_demand_location(_G(my_walker), 437, 349, 1);
|
||||
ws_walk(_G(my_walker), 436, 359, nullptr, 548, 10);
|
||||
break;
|
||||
|
||||
case 675:
|
||||
hotspot_set_active("CHAIN ", false);
|
||||
terminateMachineAndNull(_chain);
|
||||
series_unload(_chainBreaking);
|
||||
_chainSprite = series_place_sprite("508 CHAIN AFTER BREAK", 0, 0, 0, 100, 0xf00);
|
||||
break;
|
||||
|
||||
case 679:
|
||||
terminateMachineAndNull(_x);
|
||||
series_unload(_flick);
|
||||
break;
|
||||
|
||||
case 681:
|
||||
sendWSMessage_120000(682);
|
||||
break;
|
||||
|
||||
case 682:
|
||||
sendWSMessage_110000(684);
|
||||
break;
|
||||
|
||||
case 684:
|
||||
sendWSMessage_120000(686);
|
||||
kernel_timing_trigger(180, 541);
|
||||
break;
|
||||
|
||||
case 686:
|
||||
sendWSMessage_130000(545);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room508::pre_parser() {
|
||||
if (player_said("SHOVEL") && player_said("HOLE IN CAPSTAN") &&
|
||||
!_G(flags)[V157] && !inv_object_is_here("SHOVEL"))
|
||||
_G(player).resetWalk();
|
||||
}
|
||||
|
||||
void Room508::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
const bool takeFlag = player_said("take");
|
||||
const bool useFlag = player_said("gear");
|
||||
|
||||
if (lookFlag && player_said(" ")) {
|
||||
if (_G(flags)[V162] == 1) {
|
||||
digi_play("508R01", 1);
|
||||
} else {
|
||||
digi_play("508R01A", 1);
|
||||
_G(flags)[V162] = 1;
|
||||
}
|
||||
} else if (lookFlag && player_said("DOMED CEILING")) {
|
||||
digi_play("508R02", 1);
|
||||
} else if (lookFlag && player_said("SLIT IN DOMED CEILING")) {
|
||||
digi_play("508R03", 1);
|
||||
} else if (lookFlag && player_said("SYMBOL ON WALL")) {
|
||||
digi_play("508R04", 1);
|
||||
} else if (lookFlag && player_said("SKELETON")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(_G(my_walker), 317, 360, nullptr, 2, 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (inv_player_has("CRYSTAL SKULL")) {
|
||||
digi_play("508R05A", 1);
|
||||
} else if (inv_object_is_here("CRYSTAL SKULL")) {
|
||||
digi_play("508R05B", 1);
|
||||
} else {
|
||||
digi_play("508R05", 1);
|
||||
}
|
||||
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said_any("CHAIN", "CHAIN ")) {
|
||||
digi_play(_G(flags)[V157] ? "508R15" : "508R06", 1);
|
||||
} else if (lookFlag && player_said("FLOOR")) {
|
||||
digi_play("508R07", 1);
|
||||
} else if (lookFlag && player_said("CAPSTAN")) {
|
||||
digi_play("508R08", 1);
|
||||
} else if (lookFlag && player_said("HOLE IN CAPSTAN")) {
|
||||
digi_play("508R09", 1);
|
||||
} else if (lookFlag && player_said("ORNAMENTATION ON WALL")) {
|
||||
digi_play("508R10", 1);
|
||||
} else if (player_said("Walk Through")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(_G(my_walker), 237, 255, nullptr, -1, 11);
|
||||
pal_fade_init(21, 255, 0, 30, 2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_G(game).setRoom(506);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (player_said("SHOVEL") && player_said("HOLE IN CAPSTAN")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
ws_walk(_G(my_walker), 423, 356, nullptr, 2, 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (!_G(flags)[V157] && !inv_object_is_here("SHOVEL")) {
|
||||
player_set_commands_allowed(false);
|
||||
kernel_load_variant("508lock1");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 503);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (takeFlag && player_said("SHOVEL") &&
|
||||
inv_object_is_here("SHOVEL") && _G(kernel).trigger == -1) {
|
||||
if (_G(flags)[V157] == 0 && inv_object_is_here("SHOVEL")) {
|
||||
player_set_commands_allowed(false);
|
||||
kernel_load_variant("508lock0");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 508);
|
||||
}
|
||||
|
||||
if (_G(flags)[V157] == 1) {
|
||||
player_set_commands_allowed(false);
|
||||
_val1 = 1;
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 511);
|
||||
}
|
||||
} else if (lookFlag && player_said_any("crystal skull", "crystal skull ") &&
|
||||
inv_object_is_here("CRYSTAL SKULL")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
ws_walk(_G(my_walker), 317, 360, nullptr, 2, 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
digi_play("510r11", 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (lookFlag && player_said_any("shovel", "shovel ") &&
|
||||
inv_object_is_here("SHOVEL")) {
|
||||
digi_play("com106", 1);
|
||||
} else if (takeFlag && player_said("SHOVEL ") && _G(kernel).trigger == -1) {
|
||||
if (_G(flags)[V157] == 1) {
|
||||
player_set_commands_allowed(false);
|
||||
_val1 = 1;
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 511);
|
||||
}
|
||||
} else if (useFlag && player_said("SHOVEL") && inv_object_is_here("SHOVEL")) {
|
||||
if (!_G(flags)[V157] && inv_object_is_here("SHOVEL") &&
|
||||
!inv_object_is_here("CRYSTAL SKULL") && _G(kernel).trigger == -1) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 511);
|
||||
}
|
||||
|
||||
if (!_G(flags)[V157] && inv_object_is_here("SHOVEL") &&
|
||||
inv_object_is_here("CRYSTAL SKULL") && _G(kernel).trigger == -1) {
|
||||
player_set_commands_allowed(false);
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
kernel_timing_trigger(1, 515);
|
||||
}
|
||||
} else if (player_said("CRYSTAL SKULL", "SKELETON")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
ws_walk(_G(my_walker), 333, 290, nullptr, 2, 3);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
player_set_commands_allowed(false);
|
||||
hotspot_set_active("CRYSTAL SKULL ", true);
|
||||
digi_play("508_s05", 1);
|
||||
|
||||
_skull = series_place_sprite("SKULL SPRITE AFTER DOME TURN", 0, 0, 0, 100, 0x450);
|
||||
inv_move_object("CRYSTAL SKULL", 508);
|
||||
ws_walk(_G(my_walker), 317, 360, nullptr, 3, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (takeFlag && player_said("CRYSTAL SKULL ")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
case 666:
|
||||
if (inv_object_is_here("CRYSTAL SKULL")) {
|
||||
ws_walk(_G(my_walker), 333, 290, nullptr, 2, 3);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
player_set_commands_allowed(false);
|
||||
hotspot_set_active("CRYSTAL SKULL ", false);
|
||||
kernel_examine_inventory_object("PING CRYSTAL SKULL", 5, 1, 250, 170, 3, "508_s05", 7);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
inv_give_to_player("CRYSTAL SKULL");
|
||||
ws_walk(_G(my_walker), 317, 360, nullptr, 4, 1);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
terminateMachineAndNull(_skull);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
67
engines/m4/riddle/rooms/section5/room508.h
Normal file
67
engines/m4/riddle/rooms/section5/room508.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef M4_RIDDLE_ROOMS_SECTION5_ROOM508_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM508_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room508 : public Room {
|
||||
private:
|
||||
int _val1 = 0;
|
||||
int _val2 = 0;
|
||||
int _ripReturnsToStander = 0;
|
||||
int _chainBreaking = 0;
|
||||
int _lightAppearing = 0;
|
||||
int _ripPutsShovel = 0;
|
||||
int _ripTryTurnDome = 0;
|
||||
int _ripSketching = 0;
|
||||
int _flick = 0;
|
||||
machine *_ripley = nullptr;
|
||||
machine *_ripStartTurnDome = nullptr;
|
||||
machine *_chainSprite = nullptr;
|
||||
machine *_domeAfterTurn = nullptr;
|
||||
machine *_skull = nullptr;
|
||||
machine *_shovel = nullptr;
|
||||
machine *_statue = nullptr;
|
||||
machine *_light = nullptr;
|
||||
machine *_chain = nullptr;
|
||||
machine *_x = nullptr;
|
||||
machine *_spect = nullptr;
|
||||
public:
|
||||
Room508() : Room() {}
|
||||
~Room508() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
244
engines/m4/riddle/rooms/section5/room509.cpp
Normal file
244
engines/m4/riddle/rooms/section5/room509.cpp
Normal file
@@ -0,0 +1,244 @@
|
||||
/* 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/riddle/rooms/section5/room509.h"
|
||||
#include "m4/graphics/gr_series.h"
|
||||
#include "m4/riddle/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
void Room509::init() {
|
||||
_roomNum = -1;
|
||||
_ripDigsWall = series_load("RIP DIGS AT WALL");
|
||||
_ripFrom506 = series_load("RIP CLIMBS STEPS FROM 506");
|
||||
_ripFrom510 = series_load("RIP DOWN FROM 510");
|
||||
_ripClimbStairs1 = series_load("RIP CLIMBS STAIRS 1");
|
||||
_ripClimbStairs3 = series_load("RIP CLIMBS STAIRS 3");
|
||||
_ripMedHighReacher = series_load("RIP MED HIGH REACHER POS2");
|
||||
digi_play_loop("509_s01", 3, 140);
|
||||
|
||||
switch (_G(game).previous_room) {
|
||||
case KERNEL_RESTORING_GAME:
|
||||
_flag1 = false;
|
||||
break;
|
||||
|
||||
case 510:
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(_G(my_walker), 289, 261, 6);
|
||||
kernel_timing_trigger(1, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
player_set_commands_allowed(false);
|
||||
ws_demand_location(_G(my_walker), 342, 320, 2);
|
||||
kernel_timing_trigger(1, 2);
|
||||
_flag1 = !player_been_here(509);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room509::daemon() {
|
||||
switch (_G(kernel).trigger) {
|
||||
case 1:
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ws_hide_walker();
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, false,
|
||||
triggerMachineByHashCallback, "Rip climbs steps from 506");
|
||||
sendWSMessage_10000(1, _ripley, _ripFrom506, 1, 39, 6,
|
||||
_ripFrom506, 40, 40, 0);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ws_hide_walker();
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, false,
|
||||
triggerMachineByHashCallback, "Rip climbs steps from 506");
|
||||
sendWSMessage_10000(1, _ripley, _ripFrom510, 1, 15, 7,
|
||||
_ripFrom510, 16, 16, 0);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
digi_play("509_s02", 1);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
terminateMachineAndNull(_ripley);
|
||||
ws_unhide_walker();
|
||||
|
||||
if (_flag1)
|
||||
digi_play("509R01", 1, 255, 1);
|
||||
else
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
terminateMachineAndNull(_ripley);
|
||||
ws_unhide_walker();
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
sendWSMessage_10000(1, _ripley, _ripDigsWall, 34, 2, 7,
|
||||
_ripDigsWall, 1, 1, 0);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
adv_kill_digi_between_rooms(false);
|
||||
digi_play_loop("509_s01", 3, 170);
|
||||
|
||||
switch (_roomNum) {
|
||||
case 506:
|
||||
case 510:
|
||||
_G(game).setRoom(_roomNum);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Room509::pre_parser() {
|
||||
if (player_said("gear", "hutch"))
|
||||
_G(player).resetWalk();
|
||||
}
|
||||
|
||||
void Room509::parser() {
|
||||
const bool lookFlag = player_said_any("look", "look at");
|
||||
const bool takeFlag = player_said("take");
|
||||
const bool useFlag = player_said("gear");
|
||||
|
||||
if (lookFlag && player_said("wall")) {
|
||||
digi_play("509R03", 1);
|
||||
} else if (lookFlag && player_said("hutch")) {
|
||||
digi_play(inv_player_has("CRYSTAL SKULL") ? "509R04A" : "509R04", 1);
|
||||
} else if (lookFlag && player_said("stairs up")) {
|
||||
digi_play("509R05", 1);
|
||||
} else if (lookFlag && player_said("stairs down")) {
|
||||
digi_play("509R06", 1);
|
||||
} else if (lookFlag && player_said(" ")) {
|
||||
digi_play("509R02", 1);
|
||||
} else if (lookFlag && player_said(" ")) {
|
||||
digi_play(_G(player).been_here_before ? "506r01" : "506r01a", 1, 255, -1, 506);
|
||||
} else if (useFlag && player_said("hutch")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_walk(_G(my_walker), 313, 271, nullptr, 1, 2);
|
||||
break;
|
||||
case 1:
|
||||
setGlobals1(_ripMedHighReacher, 1, 9, 9, 9, 0, 9, 10, 10, 10, 0,
|
||||
10, 9, 9, 9, 0, 9, 1, 1, 1);
|
||||
sendWSMessage_110000(2);
|
||||
break;
|
||||
case 2:
|
||||
sendWSMessage_120000(3);
|
||||
break;
|
||||
case 3:
|
||||
sendWSMessage_130000(4);
|
||||
break;
|
||||
case 4:
|
||||
sendWSMessage_120000(5);
|
||||
break;
|
||||
case 5:
|
||||
sendWSMessage_130000(6);
|
||||
break;
|
||||
case 6:
|
||||
sendWSMessage_180000(7);
|
||||
digi_play("509R07", 1, 255, 5);
|
||||
break;
|
||||
case 7:
|
||||
sendWSMessage_150000(-1);
|
||||
player_set_commands_allowed(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (player_said("SHOVEL", "hutch")) {
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
digi_preload("509_s02");
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, false,
|
||||
triggerMachineByHashCallback, "RIP DIGS AT WALL");
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
sendWSMessage_10000(1, _ripley, _ripDigsWall, 1, 33, 8,
|
||||
_ripDigsWall, 34, 34, 0);
|
||||
kernel_timing_trigger(120, 5);
|
||||
} else if (!lookFlag && !takeFlag && !useFlag &&
|
||||
!player_said("SHOVEL", "hutch") && player_said("hutch")) {
|
||||
digi_play("509R08", 1);
|
||||
} else if (player_said("walk to", "stairs up")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_roomNum = 510;
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, false,
|
||||
triggerMachineByHashCallback, "RIP CLIMBS UP TO 510");
|
||||
sendWSMessage_10000(1, _ripley, _ripClimbStairs3, 1, 8, 1,
|
||||
_ripClimbStairs3, 9, 16, 0);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
disable_player_commands_and_fade_init(9);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (player_said("walk to", "stairs down")) {
|
||||
switch (_G(kernel).trigger) {
|
||||
case -1:
|
||||
player_set_commands_allowed(false);
|
||||
ws_hide_walker();
|
||||
_roomNum = 506;
|
||||
_ripley = TriggerMachineByHash(1, 1, 0, 0, 0, 0, 0, 0, 100, 0x400, false,
|
||||
triggerMachineByHashCallback, "RIP CLIMBS DOWN TO 506");
|
||||
sendWSMessage_10000(1, _ripley, _ripClimbStairs1, 1, 14, 1,
|
||||
_ripClimbStairs1, 15, 28, 0);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_G(kernel).trigger_mode = KT_DAEMON;
|
||||
disable_player_commands_and_fade_init(9);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
_G(player).command_ready = false;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
57
engines/m4/riddle/rooms/section5/room509.h
Normal file
57
engines/m4/riddle/rooms/section5/room509.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_RIDDLE_ROOMS_SECTION5_ROOM509_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM509_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room509 : public Room {
|
||||
private:
|
||||
int _ripDigsWall = 0;
|
||||
int _ripFrom506 = 0;
|
||||
int _ripFrom510 = 0;
|
||||
int _ripClimbStairs1 = 0;
|
||||
int _ripClimbStairs3 = 0;
|
||||
int _ripMedHighReacher = 0;
|
||||
int _roomNum = 0;
|
||||
bool _flag1 = false;
|
||||
machine *_ripley = nullptr;
|
||||
|
||||
public:
|
||||
Room509() : Room() {}
|
||||
~Room509() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
1305
engines/m4/riddle/rooms/section5/room510.cpp
Normal file
1305
engines/m4/riddle/rooms/section5/room510.cpp
Normal file
File diff suppressed because it is too large
Load Diff
71
engines/m4/riddle/rooms/section5/room510.h
Normal file
71
engines/m4/riddle/rooms/section5/room510.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_RIDDLE_ROOMS_SECTION5_ROOM510_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_ROOM510_H
|
||||
|
||||
#include "m4/riddle/rooms/room.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Room510 : public Room {
|
||||
private:
|
||||
int _val1 = 0;
|
||||
int _ripLooksDown = 0;
|
||||
int _ripLowReach = 0;
|
||||
int _ripLowReach2 = 0;
|
||||
int _ripLowReach3 = 0;
|
||||
int _ripLowReach4 = 0;
|
||||
int _dangling = 0;
|
||||
machine *_statue = nullptr;
|
||||
machine *_rope = nullptr;
|
||||
machine *_ladder = nullptr;
|
||||
machine *_skull = nullptr;
|
||||
machine *_ripDangles = nullptr;
|
||||
int _stepsSeries = 0;
|
||||
machine *_steps = nullptr;
|
||||
int _ripStartsDownWall = 0;
|
||||
machine *_pu03 = nullptr;
|
||||
bool _flag1 = false;
|
||||
|
||||
bool useAltarPost();
|
||||
bool takeVinesRope();
|
||||
void useVines();
|
||||
void woodenLadder();
|
||||
void altar();
|
||||
|
||||
public:
|
||||
Room510() : Room() {}
|
||||
~Room510() override {}
|
||||
|
||||
void init() override;
|
||||
void daemon() override;
|
||||
void pre_parser() override;
|
||||
void parser() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
45
engines/m4/riddle/rooms/section5/section5.cpp
Normal file
45
engines/m4/riddle/rooms/section5/section5.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "m4/riddle/rooms/section5/section5.h"
|
||||
#include "m4/riddle/vars.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
Section5::Section5() : Rooms::Section() {
|
||||
add(501, &_room501);
|
||||
add(504, &_room504);
|
||||
add(506, &_room506);
|
||||
add(507, &_room507);
|
||||
add(508, &_room508);
|
||||
add(509, &_room509);
|
||||
add(510, &_room510);
|
||||
}
|
||||
|
||||
void Section5::daemon() {
|
||||
_G(kernel).continue_handling_trigger = true;
|
||||
}
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
59
engines/m4/riddle/rooms/section5/section5.h
Normal file
59
engines/m4/riddle/rooms/section5/section5.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_RIDDLE_ROOMS_SECTION5_H
|
||||
#define M4_RIDDLE_ROOMS_SECTION5_H
|
||||
|
||||
#include "m4/riddle/rooms/section.h"
|
||||
#include "m4/riddle/rooms/section5/room501.h"
|
||||
#include "m4/riddle/rooms/section5/room504.h"
|
||||
#include "m4/riddle/rooms/section5/room506.h"
|
||||
#include "m4/riddle/rooms/section5/room507.h"
|
||||
#include "m4/riddle/rooms/section5/room508.h"
|
||||
#include "m4/riddle/rooms/section5/room509.h"
|
||||
#include "m4/riddle/rooms/section5/room510.h"
|
||||
|
||||
namespace M4 {
|
||||
namespace Riddle {
|
||||
namespace Rooms {
|
||||
|
||||
class Section5 : public Section {
|
||||
private:
|
||||
Room501 _room501;
|
||||
Room504 _room504;
|
||||
Room506 _room506;
|
||||
Room507 _room507;
|
||||
Room508 _room508;
|
||||
Room509 _room509;
|
||||
Room510 _room510;
|
||||
|
||||
public:
|
||||
Section5();
|
||||
virtual ~Section5() {}
|
||||
|
||||
void daemon() override;
|
||||
};
|
||||
|
||||
} // namespace Rooms
|
||||
} // namespace Riddle
|
||||
} // namespace M4
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user