diff options
author | Strangerke | 2011-12-10 10:23:15 +0100 |
---|---|---|
committer | Strangerke | 2011-12-10 10:23:15 +0100 |
commit | c68d6ed585799300d4103acf275cb2e2ecf8e73c (patch) | |
tree | 03769b4e4370a8f606a4564c39da1f5618d170a5 /engines | |
parent | ca51f1681b01cb2746b56ed143807b82a93ac708 (diff) | |
download | scummvm-rg350-c68d6ed585799300d4103acf275cb2e2ecf8e73c.tar.gz scummvm-rg350-c68d6ed585799300d4103acf275cb2e2ecf8e73c.tar.bz2 scummvm-rg350-c68d6ed585799300d4103acf275cb2e2ecf8e73c.zip |
TSAGE: R2R - Implement scene 2440
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 113 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 31 |
3 files changed, 146 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 86e81786ea..9b7272e6dc 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -113,6 +113,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze: Throne room return new Scene2435(); case 2440: + // Maze: Another bedroom + return new Scene2440(); case 2445: case 2450: case 2455: 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 diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index d3db8e1eb3..1fef5a8c78 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -259,6 +259,37 @@ public: virtual void signal(); }; +class Scene2440 : public SceneExt { + class Actor1 : public SceneActor { + public: + bool startAction(CursorType action, Event &event); + }; + class Actor2 : public SceneActor { + public: + bool startAction(CursorType action, Event &event); + }; + + class Exit1 : public SceneExit { + public: + virtual void changeScene(); + }; +public: + NamedHotspot _item1; + NamedHotspot _item2; + NamedHotspot _item3; + NamedHotspot _item4; + NamedHotspot _item5; + NamedHotspot _item6; + NamedHotspot _item7; + Actor1 _actor1; + Actor2 _actor2; + Exit1 _exit1; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); +}; } // End of namespace Ringworld2 } // End of namespace TsAGE |