diff options
author | Strangerke | 2011-12-11 18:12:56 +0100 |
---|---|---|
committer | Strangerke | 2011-12-11 18:12:56 +0100 |
commit | ae98c3dc18295eeee0a4b3f6b5b2fbed2e68b60f (patch) | |
tree | be3bc9bb0239863d4f06f5b7fef8429ae5a371c3 | |
parent | fcf2aa8e2f29b8b4c3718afb49243eac024787d9 (diff) | |
download | scummvm-rg350-ae98c3dc18295eeee0a4b3f6b5b2fbed2e68b60f.tar.gz scummvm-rg350-ae98c3dc18295eeee0a4b3f6b5b2fbed2e68b60f.tar.bz2 scummvm-rg350-ae98c3dc18295eeee0a4b3f6b5b2fbed2e68b60f.zip |
TSAGE: R2R - Implement scene 2455
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 181 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 30 |
3 files changed, 213 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 658937f0a5..cb85a9d10f 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -122,6 +122,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze: Another bedroom return new Scene2450(); case 2455: + // Mze: Inside crevasse + return new Scene2455(); case 2500: case 2525: case 2530: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 4d8f7aa9d8..aeee3cdedf 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -2218,5 +2218,186 @@ void Scene2450::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2455 - Maze: Inside crevasse + * + *--------------------------------------------------------------------------*/ + +bool Scene2455::Actor1::startAction(CursorType action, Event &event) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + + if (action == R2_29) { + if ((R2_INVENTORY.getObjectScene(49) == 2455) || (R2_INVENTORY.getObjectScene(50) == 2455)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2458; + scene->_actor2._lookLineNum = 9; + scene->_actor1.remove(); + scene->_actor3.postInit(); + scene->_actor3.setDetails(2455, 16, 1, -1, 2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2458, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, NULL); + return true; + } + } + + return SceneActor::startAction(action, event); +} + +bool Scene2455::Actor2::startAction(CursorType action, Event &event) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case R2_49: + if (R2_INVENTORY.getObjectScene(50) != 2455) { + R2_GLOBALS._player.disableControl(); + scene->_actor1.postInit(); + scene->_actor1.setup(2456, 3, 3); + scene->_actor1.setPosition(Common::Point(162, 165)); + scene->_actor1.setDetails(2455, 15, 1, -1, 2, NULL); + scene->_sceneMode = 11; + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + return true; + } + break; + case R2_50: + if (R2_INVENTORY.getObjectScene(49) != 2455) { + R2_GLOBALS._player.disableControl(); + scene->_actor1.postInit(); + scene->_actor1.setup(2456, 3, 3); + scene->_actor1.setPosition(Common::Point(162, 165)); + scene->_actor1.setDetails(2455, 15, 1, -1, 2, NULL); + scene->_sceneMode = 12; + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + return true; + } + break; + default: + break; + } + + return SceneActor::startAction(action, event); +} + +bool Scene2455::Actor3::startAction(CursorType action, Event &event) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2459; + scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_actor3, NULL); + return true; + } + + return SceneActor::startAction(action, event); +} + +void Scene2455::Exit1::changeScene() { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2461; + scene->setAction(&scene->_sequenceManager, scene, 2461, &R2_GLOBALS._player, NULL); +} + +void Scene2455::postInit(SceneObjectList *OwnerList) { + loadScene(2455); + SceneExt::postInit(); + + if (R2_GLOBALS._sceneManager._previousScene == -1) { + R2_INVENTORY.setObjectScene(29, 2); + R2_INVENTORY.setObjectScene(50, 2); + } + + R2_GLOBALS._sound1.play(200); + _exit1.setDetails(Rect(0, 0, 320, 15), EXITCURSOR_N, 2425); + + if (R2_INVENTORY.getObjectScene(29) == 2455) { + if ((R2_INVENTORY.getObjectScene(50) == 2455) || (R2_INVENTORY.getObjectScene(49) == 2455)) { + _actor1.postInit(); + _actor1.setup(2456, 3, 3); + _actor1.setPosition(Common::Point(162, 165)); + _actor1.setDetails(2455, 15, 1, -1, 1, NULL); + } + } else { + _actor3.postInit(); + _actor3.setup(2456, 3, 1); + _actor3.setPosition(Common::Point(176, 165)); + _actor3.setDetails(2455, 16, 1, -1, 1, NULL); + } + + _actor2.postInit(); + if (R2_INVENTORY.getObjectScene(29) == 2455) { + _actor2.setup(2456, 3, 2); + _actor2.setDetails(2455, 9, 1, -1, 1, NULL); + } else { + if ((R2_INVENTORY.getObjectScene(50) != 2455) && (R2_INVENTORY.getObjectScene(49) != 2455)) + _actor2.setup(2455, 1, 1); + else + _actor2.setup(2456, 1, 1); + _actor2.setDetails(2455, 3, 1, -1, 1, NULL); + } + _actor2.setPosition(Common::Point(162, 165)); + _actor2.fixPriority(20); + if (R2_INVENTORY.getObjectScene(29) != 2455) + _actor2.animate(ANIM_MODE_2, NULL); + + R2_GLOBALS._player.postInit(); + _item1.setDetails(Rect(0, 0, 320, 200), 2455, 0, 1, -1, 1, NULL); + R2_GLOBALS._player.disableControl(); + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2425) { + _sceneMode = 2460; + setAction(&_sequenceManager, this, 2460, &R2_GLOBALS._player, NULL); + } else { + R2_GLOBALS._player.setup(2455, 2, 9); + R2_GLOBALS._player.setPosition(Common::Point(118, 165)); + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + } + R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2455; +} + +void Scene2455::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene2455::signal() { + switch (_sceneMode) { + case 10: + // No break on purpose + case 2461: + g_globals->_sceneManager.changeScene(2425); + break; + case 11: + R2_INVENTORY.setObjectScene(49, 2455); + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + break; + case 12: + R2_INVENTORY.setObjectScene(50, 2455); + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + break; + case 2458: + R2_INVENTORY.setObjectScene(29, 2455); + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + break; + case 2459: + _actor3.remove(); + R2_INVENTORY.setObjectScene(31, 2); + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + break; + default: + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = false; + 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 aba5e2ab68..81e8f58ace 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -331,6 +331,36 @@ public: virtual void signal(); }; +class Scene2455 : 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 Actor3 : public SceneActor { + public: + bool startAction(CursorType action, Event &event); + }; + + class Exit1 : public SceneExit { + public: + virtual void changeScene(); + }; +public: + NamedHotspot _item1; + Actor1 _actor1; + Actor2 _actor2; + Actor3 _actor3; + Exit1 _exit1; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); +}; } // End of namespace Ringworld2 } // End of namespace TsAGE |