diff options
author | Strangerke | 2011-12-07 22:42:40 +0100 |
---|---|---|
committer | Strangerke | 2011-12-07 22:42:40 +0100 |
commit | a6ab1738243712bbc1db8a10f834542cd9d94c37 (patch) | |
tree | bf733948ff5bdaa2ec98a13fbe24a2992addf3c3 /engines/tsage/ringworld2 | |
parent | aae7192d09a94f8865255ccb5aa0341f7d8bbdec (diff) | |
download | scummvm-rg350-a6ab1738243712bbc1db8a10f834542cd9d94c37.tar.gz scummvm-rg350-a6ab1738243712bbc1db8a10f834542cd9d94c37.tar.bz2 scummvm-rg350-a6ab1738243712bbc1db8a10f834542cd9d94c37.zip |
TSAGE: R2R - Implement scene 2425
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 5 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 217 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 49 |
3 files changed, 267 insertions, 4 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index b33bb65b80..19b4bb6513 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -98,11 +98,14 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze return new Scene2000(); case 2350: - // Balloon Launch Platform + // Maze: Balloon Launch Platform return new Scene2350(); case 2400: + // Maze: Large empty room return new Scene2400(); case 2425: + // Maze: + return new Scene2425(); case 2430: case 2435: case 2440: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index be96b1e010..46c6261413 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1222,7 +1222,7 @@ void Scene2350::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 2400 - + * Scene 2400 - Maze: Large empty room * *--------------------------------------------------------------------------*/ void Scene2400::Exit1::changeScene() { @@ -1283,5 +1283,220 @@ void Scene2400::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2425 - Maze: + * + *--------------------------------------------------------------------------*/ + +bool Scene2425::Item1::startAction(CursorType action, Event &event) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + + if ((action == R2_37) && (!R2_GLOBALS.getFlag(84))) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2426; + scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_actor1, NULL); + R2_GLOBALS.setFlag(84); + return true; + } else if (action == R2_37) { + R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); + R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); + return startAction(R2_STEPPING_DISKS, event); + } else + return startAction(action, event); +} + +bool Scene2425::Item2::startAction(CursorType action, Event &event) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + + if ((action == R2_37) && (R2_GLOBALS.getFlag(84))) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2427; + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + R2_GLOBALS.clearFlag(84); + return true; + } else if (action == R2_37) { + R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); + R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); + return startAction(R2_STEPPING_DISKS, event); + } else + return startAction(action, event); +} + +bool Scene2425::Item3::startAction(CursorType action, Event &event) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + + if (action != R2_37) + return startAction(action, event); + else { + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS.getFlag(84)) { + scene->_sceneMode = 20; + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + R2_GLOBALS.clearFlag(84); + } else { + scene->_sceneMode = 2425; + scene->setAction(&scene->_sequenceManager, scene, 2425, &R2_GLOBALS._player, &scene->_actor1, NULL); + } + return true; + } +} + +bool Scene2425::Item4::startAction(CursorType action, Event &event) { + if (action != R2_37) + return startAction(action, event); + else { + R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); + R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); + return startAction(R2_STEPPING_DISKS, event); + } +} + +bool Scene2425::Actor1::startAction(CursorType action, Event &event) { + if (action == R2_STEPPING_DISKS) { + if (R2_GLOBALS._player._characterIndex == 2) { + R2_GLOBALS._events.setCursor(R2_37); + return true; + } else { + return startAction(action, event); + } + } else if (R2_GLOBALS._events.getCursor() == R2_37) + return false; + else + return startAction(action, event); +} + +bool Scene2425::Actor2::startAction(CursorType action, Event &event) { + if (action != R2_37) + return startAction(action, event); + else { + R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); + R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); + return startAction(R2_STEPPING_DISKS, event); + } +} + +void Scene2425::Exit1::changeScene() { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._events.setCursor(R2_NEGATOR_GUN); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 11; + + Common::Point pt(340, 200); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + + +void Scene2425::postInit(SceneObjectList *OwnerList) { + loadScene(2425); + SceneExt::postInit(); + if (R2_GLOBALS._sceneManager._previousScene == -1) { + R2_GLOBALS._player._characterIndex = 2; + R2_GLOBALS._sceneManager._previousScene = 2000; + } + + R2_GLOBALS._sound1.play(200); + _exit1.setDetails(Rect(270, 136, 319, 168), EXITCURSOR_SE, 2000); + R2_GLOBALS._player.postInit(); + 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); + } + + if (R2_GLOBALS._player._characterScene[1] == R2_GLOBALS._player._characterScene[2]) { + _actor2.postInit(); + if (R2_GLOBALS._player._characterIndex == 1) { + _actor2.setup(20, 5, 1); + _actor2.setDetails(9002, 0, 4, 3, 1, NULL); + } else { + _actor2.setup(2008, 5, 1); + _actor2.setDetails(9001, 0, 5, 3, 1, NULL); + } + _actor2.setPosition(Common::Point(250, 185)); + } + + _actor1.postInit(); + if (R2_GLOBALS._sceneManager._previousScene == 2455) + _actor1.setup(2426, 1, 1); + else + _actor1.setup(2426, 1, 2); + + _actor1.setPosition(Common::Point(290, 9)); + _actor1.fixPriority(20); + _actor1.setDetails(2455, 12, -1, -1, 1, NULL); + _item1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); + _item2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); + +// CHECKME: SceneActor using a SceneItem function?? +// _actor3.setDetails(11, 2425, 3, -1, 6); + _actor3._sceneRegionId = 11; + _actor3._resNum = 2425; + _actor3._lookLineNum = 3; + _actor3._talkLineNum = -1; + _actor3._useLineNum = 6; + g_globals->_sceneItems.addItems(&_actor3, this); + + _item3.setDetails(12, 2425, 7, -1, 9); + _item4.setDetails(Rect(0, 0, 320, 200), 2425, 0, -1, -1, 1, NULL); + + R2_GLOBALS._player.disableControl(); + switch (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex]) { + case 2000: { + _sceneMode = 10; + R2_GLOBALS._player.setPosition(Common::Point(340, 200)); + + Common::Point pt(280, 150); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 2425: + _sceneMode = 10; + R2_GLOBALS._player.setPosition(Common::Point(280, 150)); + _action->signal(); + break; + case 2455: + _sceneMode = 2428; + setAction(&_sequenceManager, this, 2428, &R2_GLOBALS._player, &_actor1, NULL); + break; + default: + R2_GLOBALS._player.setPosition(Common::Point(280, 150)); + R2_GLOBALS._player.setStrip(8); + R2_GLOBALS._player.enableControl(); + break; + } + R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2425; +} + +void Scene2425::remove() { + R2_GLOBALS._sound1.fadeOut(NULL); + SceneExt::remove(); +} + +void Scene2425::signal() { + switch (_sceneMode) { + case 11: + g_globals->_sceneManager.changeScene(2000); + break; + case 20: + _sceneMode = 2425; + setAction(&_sequenceManager, this, 2425, &R2_GLOBALS._player, &_actor1, NULL); + break; + case 2425: + g_globals->_sceneManager.changeScene(2455); + break; + 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 15cd40a5d1..f9d4c9f2ce 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -136,9 +136,54 @@ public: SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); -// virtual void remove(); virtual void signal(); -// virtual void process(Event &event); +}; + +class Scene2425 : public SceneExt { + class Item1 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Item2 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Item3 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Item4 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + 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: + Item1 _item1; + Item2 _item2; + Item3 _item3; + Item4 _item4; + Actor1 _actor1; + Actor2 _actor2; + Actor2 _actor3; + Exit1 _exit1; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); }; } // End of namespace Ringworld2 |