diff options
Diffstat (limited to 'engines/tsage/ringworld2/ringworld2_scenes2.cpp')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index a8decd365d..0e824f6742 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1795,5 +1795,118 @@ void Scene2435::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2440 - Maze: Another bedroom + * + *--------------------------------------------------------------------------*/ + +bool Scene2440::Actor1::startAction(CursorType action, Event &event) { + return SceneActor::startAction(action, event); +} + +bool Scene2440::Actor2::startAction(CursorType action, Event &event) { + Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; + + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 2)){ + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2440; + scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_actor2, NULL); + return true; + } + + return SceneActor::startAction(action, event); +} + +void Scene2440::Exit1::changeScene() { + Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 11; + Common::Point pt(210, 200); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene2440::postInit(SceneObjectList *OwnerList) { + loadScene(2440); + SceneExt::postInit(); + R2_GLOBALS._sound1.play(200); + // Fix exit cursor, the original was using NW + _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_SE, 2000); + _exit1.setDest(Common::Point(210, 160)); + if (R2_INVENTORY.getObjectScene(49) == 2440) { + _actor2.postInit(); + _actor2.setup(2435, 1, 1); + _actor2.setPosition(Common::Point(94, 80)); + _actor2.fixPriority(106); + _actor2.setDetails(2430, 48, -1, -1, 1, NULL); + } + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + + if (R2_GLOBALS._player._characterIndex == 1) { + R2_GLOBALS._player.setVisage(2008); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + } else { + R2_GLOBALS._player.setVisage(20); + R2_GLOBALS._player._moveDiff = Common::Point(5, 3); + } + R2_GLOBALS._player.setPosition(Common::Point(210, 200)); + if (R2_GLOBALS._player._characterScene[1] == R2_GLOBALS._player._characterScene[2]) { + _actor1.postInit(); + if (R2_GLOBALS._player._characterIndex == 1) { + _actor1.setup(20, 5, 1); + _actor1.setDetails(9002, 0, 4, 3, 1, NULL); + } else { + _actor1.setup(2008, 5, 1); + _actor1.setDetails(9002, 0, 5, 3, 1, NULL); + } + _actor1.setPosition(Common::Point(38, 119)); + } + + _item2.setDetails(Rect(125, 25, 142, 73), 2430, 15, -1, 14, 1, NULL); + _item3.setDetails(Rect(124, 78, 237, 120), 2430, 36, -1, 38, 1, NULL); + _item4.setDetails(Rect(250, 3, 265, 133), 2430, 30, 31, 32, 1, NULL); + _item5.setDetails(Rect(91, 117, 203, 140), 2430, 9, -1, 11, 1, NULL); + _item6.setDetails(Rect(48, 78, 103, 112), 2430, 6, -1, -1, 1, NULL); + _item7.setDetails(Rect(48, 31, 73, 52), 2430, 33, -1, 18, 1, NULL); + _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); + + R2_GLOBALS._player.disableControl(); + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { + R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2440; + Common::Point pt(210, 150); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } else { + R2_GLOBALS._player.setPosition(Common::Point(210, 150)); + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.enableControl(); + } +} + +void Scene2440::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene2440::signal() { + switch (_sceneMode) { + case 11: + g_globals->_sceneManager.changeScene(2000); + break; + case 2440: + _actor2.remove(); + R2_INVENTORY.setObjectScene(49, 2); + // No break on purpose + default: + R2_GLOBALS._player.enableControl(); + break; + } +} + } // End of namespace Ringworld2 } // End of namespace TsAGE |