aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-10-30 11:05:07 +0100
committerStrangerke2015-10-30 11:05:07 +0100
commit7c4f6bae20f2848980130ea3db7f84478f78bf63 (patch)
treeacdbdb84b6ef6798c87bbf4fde452832ab7ef3ad /engines
parentbd1f03ee6ca8c2ad6756fd83834cbbe596e13d82 (diff)
downloadscummvm-rg350-7c4f6bae20f2848980130ea3db7f84478f78bf63.tar.gz
scummvm-rg350-7c4f6bae20f2848980130ea3db7f84478f78bf63.tar.bz2
scummvm-rg350-7c4f6bae20f2848980130ea3db7f84478f78bf63.zip
MADS: Phantom: Implement scene 401
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/assets.h1
-rw-r--r--engines/mads/phantom/game_phantom.cpp5
-rw-r--r--engines/mads/phantom/game_phantom.h18
-rw-r--r--engines/mads/phantom/globals_phantom.h15
-rw-r--r--engines/mads/phantom/phantom_scenes.cpp3
-rw-r--r--engines/mads/phantom/phantom_scenes4.cpp496
-rw-r--r--engines/mads/phantom/phantom_scenes4.h22
7 files changed, 556 insertions, 4 deletions
diff --git a/engines/mads/assets.h b/engines/mads/assets.h
index aa7e188fba..0aae534498 100644
--- a/engines/mads/assets.h
+++ b/engines/mads/assets.h
@@ -99,6 +99,7 @@ public:
int getCount() { return _frameCount; }
int getFrameRate() const { return _frameRate; }
int getPixelSpeed() const { return _pixelSpeed; }
+ Common::Point getFramePos(int index) { assert (index < _frameCount); return Common::Point(_frames[index]._bounds.left, _frames[index]._bounds.top); }
int getFrameWidth(int index) { assert (index < _frameCount); return _frames[index]._bounds.width(); }
int getFrameHeight(int index) { assert (index < _frameCount); return _frames[index]._bounds.height(); }
int getMaxFrameWidth() const { return _maxWidth; }
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp
index 2462ee34b4..47e09daab5 100644
--- a/engines/mads/phantom/game_phantom.cpp
+++ b/engines/mads/phantom/game_phantom.cpp
@@ -105,7 +105,7 @@ void GamePhantom::initializeGlobals() {
_globals[kChristineToldEnvelope] = false;
_globals[kLeaveAngelMusicOn] = false;
_globals[kDoorIn409IsOpen] = false;
- _globals[kUnknown] = false;
+ _globals[kPriestPistonPuke] = false;
_globals[kCobwebIsCut] = false;
_globals[kChristineIsInBoat] = false;
_globals[kRightDoorIsOpen504] = false;
@@ -198,6 +198,9 @@ void GamePhantom::enterCatacombs(int val) {
warning("TODO: enterCatacombs");
}
+void GamePhantom::initCatacombs() {
+ warning("TODO: initCatacombs");
+}
} // End of namespace Phantom
} // End of namespace MADS
diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h
index 3e223cdf31..d6de29b496 100644
--- a/engines/mads/phantom/game_phantom.h
+++ b/engines/mads/phantom/game_phantom.h
@@ -68,6 +68,21 @@ enum InventoryObject {
OBJ_OAR = 24
};
+enum MazeEvent {
+ MAZE_EVENT_PUDDLE = 0x0001,
+ MAZE_EVENT_RAT_NEST = 0x0002,
+ MAZE_EVENT_SKULL = 0x0004,
+ MAZE_EVENT_POT = 0x0008,
+ MAZE_EVENT_BRICK = 0x0010,
+ MAZE_EVENT_HOLE = 0x0020,
+ MAZE_EVENT_WEB = 0x0040,
+ MAZE_EVENT_PLANK = 0x0080,
+ MAZE_EVENT_DRAIN = 0x0100,
+ MAZE_EVENT_STONE = 0x0200,
+ MAZE_EVENT_BLOCK = 0x0400,
+ MAZE_EVENT_FALLEN_BLOCK = 0x0800
+};
+
class GamePhantom : public Game {
friend class Game;
protected:
@@ -97,6 +112,9 @@ public:
virtual void synchronize(Common::Serializer &s, bool phase1);
void enterCatacombs(int val);
+ void initCatacombs();
+ void moveCatacombs(int dir) { warning("TODO: moveCataCombs"); };
+ int exitCatacombs(int dir) { warning("TODO: exitCatacombs"); return -1; };
};
diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h
index cf35b40eb9..f120df3c47 100644
--- a/engines/mads/phantom/globals_phantom.h
+++ b/engines/mads/phantom/globals_phantom.h
@@ -99,9 +99,20 @@ enum GlobalId {
// Section #4 Variables
kCatacombsRoom = 80,
- // TODO
+ kCatacombsMisc = 81,
+ kCatacombsFlag = 82,
+ kCatacombsFrom = 83,
+ kCatacombs309 = 84,
+ kCatacombs409a = 85,
+ kCatacombs409b = 86,
+ kCatacombs501 = 87,
+ kCatacombs309From = 88,
+ kCatacombs409aFrom = 89,
+ kCatacombs409bFrom = 90,
+ kCatacombs501From = 91,
+ kCatacombsNextRoom = 92,
kDoorIn409IsOpen = 93,
- kUnknown = 94, // TODO
+ kPriestPistonPuke = 94,
kCobwebIsCut = 95,
// Section #5 Variables
diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp
index 3b1c02f889..dc60a3db52 100644
--- a/engines/mads/phantom/phantom_scenes.cpp
+++ b/engines/mads/phantom/phantom_scenes.cpp
@@ -31,6 +31,7 @@
#include "mads/phantom/phantom_scenes1.h"
#include "mads/phantom/phantom_scenes2.h"
#include "mads/phantom/phantom_scenes3.h"
+#include "mads/phantom/phantom_scenes4.h"
namespace MADS {
@@ -119,7 +120,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
// Scene group #4 (labyrinth)
case 401: // labyrinth room, 3 exits
- return new DummyScene(vm); // TODO
+ return new Scene401(vm);
case 403: // labyrinth room (big), 4 exits + 1 bricked door, left
return new DummyScene(vm); // TODO
case 404: // labyrinth room, 3 exits
diff --git a/engines/mads/phantom/phantom_scenes4.cpp b/engines/mads/phantom/phantom_scenes4.cpp
index e88631e426..08f4495522 100644
--- a/engines/mads/phantom/phantom_scenes4.cpp
+++ b/engines/mads/phantom/phantom_scenes4.cpp
@@ -57,5 +57,501 @@ void Scene4xx::setPlayerSpritesPrefix() {
/*------------------------------------------------------------------------*/
+Scene401::Scene401(MADSEngine *vm) : Scene4xx(vm) {
+ _anim0ActvFl = false;
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHostpotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene401::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHostpotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene401::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PUDDLE)
+ _scene->_initialVariant = 1;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene401::enter() {
+ _game.initCatacombs();
+ _anim0ActvFl = false;
+
+ _scene->_hotspots.activate(NOUN_PUDDLE, false);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, false);
+ _scene->_hotspots.activate(NOUN_SKULL, false);
+ _scene->_hotspots.activate(NOUN_POT, false);
+
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RRD_9", false);
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('f', 0), false);
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('f', 1), false);
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('f', 2), false);
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 3), false);
+
+ if (_game.exitCatacombs(0) == -1) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 1), false);
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ }
+
+ if (_game.exitCatacombs(3) == -1) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0), false);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_WEST, false);
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 2), false);
+ _scene->drawToBackground(_globals._spriteIndexes[2], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_EAST, false);
+ }
+
+ if (_game.exitCatacombs(2) == -1)
+ _scene->_hotspots.activate(NOUN_MORE_CATACOMBS, false);
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_RAT_NEST) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites (formAnimName('c', 4), false);
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_SKULL) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites (formAnimName('c', 5), false);
+ _scene->drawToBackground(_globals._spriteIndexes[5], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_SKULL, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_POT) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites (formAnimName('c', 6), false);
+ _scene->drawToBackground(_globals._spriteIndexes[6], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_POT, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites (formAnimName('c', 7), false);
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PUDDLE) {
+ _scene->_hotspots.activate(NOUN_PUDDLE, true);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 0);
+ _anim0ActvFl = true;
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(128, 78);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(128, 91), FACING_SOUTH);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(311, 115);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(271, 123), FACING_WEST);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(142, 146);
+ _game._player._facing = FACING_NORTH;
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(4, 113);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(48, 113), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId , Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene401::step() {
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 20)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 0);
+ }
+}
+
+void Scene401::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.setTrigger(_globals._sequenceIndexes[8], 2, 5, 1);
+ _scene->_sequences.setTrigger(_globals._sequenceIndexes[8], 0, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId , Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(2, 0, 1, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME)) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.setTrigger(_globals._sequenceIndexes[8], 2, 5, 1);
+ _scene->_sequences.setTrigger(_globals._sequenceIndexes[8], 0, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _scene->_dynamicHotspots.remove(_greenFrameHostpotId );
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(2, 0, 1, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ _game.moveCatacombs(2);
+ if ((_game._difficulty == DIFFICULTY_HARD) && (_globals[kCatacombsRoom] == 31))
+ _globals[kPriestPistonPuke] = true;
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ if ((_game._difficulty == DIFFICULTY_EASY) && (_globals[kCatacombsRoom] == 24))
+ _globals[kPriestPistonPuke] = true;
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40110);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40115);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCKED_ARCHWAY)) {
+ _vm->_dialogs->show(40116);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PUDDLE)) {
+ _vm->_dialogs->show(40117);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL)) {
+ _vm->_dialogs->show(40120);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+
+ if (_action.isObject(NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40122);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40119);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SKULL)) {
+ _vm->_dialogs->show(40121);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40123);
+ _action._inProgress = false;
+ }
+}
+
+void Scene401::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME)
+ || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
} // End of namespace Phantom
} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes4.h b/engines/mads/phantom/phantom_scenes4.h
index 1d9d9274cd..9f64241cae 100644
--- a/engines/mads/phantom/phantom_scenes4.h
+++ b/engines/mads/phantom/phantom_scenes4.h
@@ -53,6 +53,28 @@ public:
Scene4xx(MADSEngine *vm) : PhantomScene(vm) { _game._player._scalingVelocity = true; }
};
+class Scene401 : public Scene4xx {
+private:
+ bool _anim0ActvFl;
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHostpotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene401(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
} // End of namespace Phantom
} // End of namespace MADS