diff options
author | Strangerke | 2015-11-01 00:04:03 +0100 |
---|---|---|
committer | Strangerke | 2015-11-01 00:04:03 +0100 |
commit | 6c53d6b391ed5e39ba6ae3423a64cb3ba5a4b008 (patch) | |
tree | 64c55d9ed2dc44d70127f9a7a050a24e0519b8a9 /engines/mads | |
parent | 2243a976ce23513814d1240eade20dc2128666a1 (diff) | |
download | scummvm-rg350-6c53d6b391ed5e39ba6ae3423a64cb3ba5a4b008.tar.gz scummvm-rg350-6c53d6b391ed5e39ba6ae3423a64cb3ba5a4b008.tar.bz2 scummvm-rg350-6c53d6b391ed5e39ba6ae3423a64cb3ba5a4b008.zip |
MADS: Phantom: Implement scene 408
Diffstat (limited to 'engines/mads')
-rw-r--r-- | engines/mads/phantom/phantom_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/phantom/phantom_scenes.h | 2 | ||||
-rw-r--r-- | engines/mads/phantom/phantom_scenes4.cpp | 469 | ||||
-rw-r--r-- | engines/mads/phantom/phantom_scenes4.h | 21 |
4 files changed, 492 insertions, 2 deletions
diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp index e117a92015..13c5a417f8 100644 --- a/engines/mads/phantom/phantom_scenes.cpp +++ b/engines/mads/phantom/phantom_scenes.cpp @@ -130,7 +130,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 407: // catacomb room / lake return new Scene407(vm); case 408: // catacomb corridor - return new DummyScene(vm); // TODO + return new Scene408(vm); case 409: // catacomb room, door with switch panel return new DummyScene(vm); // TODO case 410: // skull switch panel diff --git a/engines/mads/phantom/phantom_scenes.h b/engines/mads/phantom/phantom_scenes.h index e38240727f..0987d6f910 100644 --- a/engines/mads/phantom/phantom_scenes.h +++ b/engines/mads/phantom/phantom_scenes.h @@ -46,6 +46,7 @@ enum Verb { VERB_CLOSE = 0xB, VERB_THROW = 0xC, VERB_WALK_TO = 0xD, + VERB_ATTACK = 0x14, VERB_CLIMB_DOWN = 0x21, VERB_CLIMB_INTO = 0x22, VERB_CLIMB_THROUGH = 0x23, @@ -80,7 +81,6 @@ enum Noun { NOUN_ACT_CURTAIN = 0x11, NOUN_AISLE = 0x12, NOUN_APRON = 0x13, - NOUN_ATTACK = 0x14, NOUN_BACKSTAGE = 0x15, NOUN_BEAR_PROP = 0x16, NOUN_BLUE_FRAME = 0x17, diff --git a/engines/mads/phantom/phantom_scenes4.cpp b/engines/mads/phantom/phantom_scenes4.cpp index ef3d1a0d32..2157e11502 100644 --- a/engines/mads/phantom/phantom_scenes4.cpp +++ b/engines/mads/phantom/phantom_scenes4.cpp @@ -2424,5 +2424,474 @@ void Scene407::preActions() { /*------------------------------------------------------------------------*/ +Scene408::Scene408(MADSEngine *vm) : Scene4xx(vm) { + _frameInRoomFl = false; + _takingFrameInRoomFl = false; + + _redFrameHotspotId = -1; + _greenFrameHotspotId = -1; + _blueFrameHotspotId = -1; + _yellowFrameHotspotId = -1; +} + +void Scene408::synchronize(Common::Serializer &s) { + Scene4xx::synchronize(s); + + s.syncAsByte(_frameInRoomFl); + s.syncAsByte(_takingFrameInRoomFl); + + s.syncAsSint16LE(_redFrameHotspotId); + s.syncAsSint16LE(_greenFrameHotspotId); + s.syncAsSint16LE(_blueFrameHotspotId); + s.syncAsSint16LE(_yellowFrameHotspotId); +} + +void Scene408::setup() { + setPlayerSpritesPrefix(); + setAAName(); + + if ((_globals[kCatacombsMisc] & MAZE_EVENT_WEB) && (!_globals[kCobwebIsCut])) + _scene->_initialVariant = 1; + + _scene->addActiveVocab(NOUN_RED_FRAME); + _scene->addActiveVocab(NOUN_YELLOW_FRAME); + _scene->addActiveVocab(NOUN_BLUE_FRAME); + _scene->addActiveVocab(NOUN_GREEN_FRAME); +} + +void Scene408::enter() { + _game.initCatacombs(); + _scene->_hotspots.activate(NOUN_COBWEB, false); + + _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0), false); + _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9", false); + _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0), false); + _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 1), false); + _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 2), false); + _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('f', 3), false); + _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 1), false); + _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 2), false); + + if (_game.exitCatacombs(0) == -1) { + _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100); + _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(147, 121)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(153, 121)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(154, 115)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(161, 101)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(162, 106)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(187, 107)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(185, 101)); + _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(192, 119)); + _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(147, 76)); + _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(159, 108)); + _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(185, 93)); + _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(199, 91)); + _scene->changeVariant(1); + } else + _scene->_hotspots.activate(NOUN_GATE, false); + + if (_scene->_priorSceneId != RETURNING_FROM_LOADING) { + switch (_globals[kCatacombsFrom]) { + case 0: + _game._player._playerPos = Common::Point(174, 100); + _game._player._facing = FACING_SOUTH; + _game._player.walk(Common::Point(174, 106), FACING_SOUTH); + break; + + case 2: + _game._player._playerPos = Common::Point(175, 145); + _game._player._facing = FACING_NORTH; + break; + + default: + break; + } + } + + if (_globals[kCatacombsMisc] & MAZE_EVENT_WEB) { + _globals._spriteIndexes[8] = _scene->_sprites.addSprites (formAnimName('x', -1), false); + if (!_globals[kCobwebIsCut]) { + _globals._spriteIndexes[6] = _scene->_sprites.addSprites (formAnimName('c', 1), false); + _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 10); + _scene->_hotspots.activate(NOUN_COBWEB, true); + } else { + _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 10); + + int idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 112, 199 + 6, 112 + 12)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST); + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(202, 81, 202 + 5, 81 + 31)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST); + + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(138, 74, 138 + 7, 74 + 33)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST); + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(143, 107, 143 + 6, 107 + 15)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST); + } + } + + if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) { + _globals._spriteIndexes[7] = _scene->_sprites.addSprites (formAnimName('c', 2), false); + _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100); + _scene->_hotspots.activate(NOUN_EXPOSED_BRICK, false); + } + + if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) { + _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 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[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14); + + Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0); + _greenFrameHotspotId = _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(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST); + } + + if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) { + _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 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[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 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); + } + + if ((_game._difficulty == DIFFICULTY_HARD) && (_globals[kCatacombsRoom] == 52)) + _scene->_sequences.setTimingTrigger(120, 60); + + sceneEntrySound(); +} + +void Scene408::step() { + if (_game._trigger == 60) + _vm->_dialogs->show(31); +} + +void Scene408::actions() { + 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) + _vm->_dialogs->show(29); + else { + switch (_game._trigger) { + case (0): + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5); + _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true); + _scene->_sequences.setTrigger(_globals._sequenceIndexes[1], 2, 5, 1); + _scene->_sequences.setTrigger(_globals._sequenceIndexes[1], 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[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14); + + Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->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[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14); + + Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0); + _greenFrameHotspotId = _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(_greenFrameHotspotId, 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[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 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[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 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[1]); + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } + _action._inProgress = false; + return; + } + + + if (_action.isAction(VERB_TAKE) + && (_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[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5); + _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true); + _scene->_sequences.setTrigger(_globals._sequenceIndexes[1], 2, 5, 1); + _scene->_sequences.setTrigger(_globals._sequenceIndexes[1], 0, 0, 2); + break; + + case 1: + if (_action.isObject(NOUN_RED_FRAME)) { + _scene->deleteSequence(_globals._sequenceIndexes[2]); + _scene->_dynamicHotspots.remove(_redFrameHotspotId); + _game._objects.addToInventory(OBJ_RED_FRAME); + } + + if (_action.isObject(NOUN_GREEN_FRAME)) { + _scene->deleteSequence(_globals._sequenceIndexes[3]); + _scene->_dynamicHotspots.remove(_greenFrameHotspotId); + _game._objects.addToInventory(OBJ_GREEN_FRAME); + } + + if (_action.isObject(NOUN_BLUE_FRAME)) { + _scene->deleteSequence(_globals._sequenceIndexes[4]); + _scene->_dynamicHotspots.remove(_blueFrameHotspotId); + _game._objects.addToInventory(OBJ_BLUE_FRAME); + } + + if (_action.isObject(NOUN_YELLOW_FRAME)) { + _scene->deleteSequence(_globals._sequenceIndexes[5]); + _scene->_dynamicHotspots.remove(_yellowFrameHotspotId); + _game._objects.addToInventory(OBJ_YELLOW_FRAME); + } + + _vm->_sound->command(26); + break; + + case 2: + _game.syncTimers(2, 0, 1, _globals._sequenceIndexes[1]); + _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_EXIT_TO, NOUN_MORE_CATACOMBS)) { + _game.moveCatacombs(2); + _action._inProgress = false; + return; + } + + if (_action._lookFlag) { + _vm->_dialogs->show(40810); + _action._inProgress = false; + return; + } + + if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) { + if (_action.isObject(NOUN_WALL)) { + _vm->_dialogs->show(40811); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_FLOOR)) { + _vm->_dialogs->show(40812); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_ARCHWAY)) { + _vm->_dialogs->show(40813); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_EXPOSED_BRICK)) { + _vm->_dialogs->show(40814); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_MORE_CATACOMBS)) { + _vm->_dialogs->show(40815); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_CEILING)) { + _vm->_dialogs->show(40816); + _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_GATE)) { + _vm->_dialogs->show(40817); + _action._inProgress = false; + return; + } + + if (_action.isObject(NOUN_COBWEB)) { + if (_globals[kCobwebIsCut]) + _vm->_dialogs->show(40820); + else + _vm->_dialogs->show(40819); + + _action._inProgress = false; + return; + } + } + + if ((_action.isAction(VERB_ATTACK, NOUN_COBWEB) && !_globals[kCobwebIsCut])) { + _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('W', 1), 70); + _game._player._visible = false; + _game._player._stepEnabled = false; + _globals[kCobwebIsCut] = true; + _scene->deleteSequence(_globals._sequenceIndexes[6]); + _action._inProgress = false; + return; + } + + if (_game._trigger == 70) { + _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 14); + _scene->changeVariant(0); + _scene->_hotspots.activate(NOUN_COBWEB, false); + _game._player._visible = true; + _game._player._stepEnabled = true; + + int idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 112, 199 + 6, 112 + 12)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST); + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(202, 81, 202 + 5, 81 + 31)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST); + + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(138, 74, 138 + 7, 74 + 33)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST); + idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(143, 107, 143 + 6, 107 + 15)); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST); + _action._inProgress = false; + return; + } + + if (_action.isAction(VERB_OPEN, NOUN_GATE)) { + _vm->_dialogs->show(40818); + _action._inProgress = false; + } +} + +void Scene408::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 a992cea574..b20585c02e 100644 --- a/engines/mads/phantom/phantom_scenes4.h +++ b/engines/mads/phantom/phantom_scenes4.h @@ -159,6 +159,27 @@ public: virtual void preActions(); virtual void actions(); }; + +class Scene408 : public Scene4xx { +private: + bool _frameInRoomFl; + bool _takingFrameInRoomFl; + + int _redFrameHotspotId; + int _greenFrameHotspotId; + int _blueFrameHotspotId; + int _yellowFrameHotspotId; + +public: + Scene408(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 |