diff options
author | Strangerke | 2011-12-14 00:58:10 +0100 |
---|---|---|
committer | Strangerke | 2011-12-14 00:58:10 +0100 |
commit | a97a359ea3825f6fdef40a57e3c3b6e96b4afda3 (patch) | |
tree | f6a33d3d0cb095004eb946020f569b64d610360f /engines | |
parent | d4124e116ac8a9aaf52dcfe727cd600e27555154 (diff) | |
download | scummvm-rg350-a97a359ea3825f6fdef40a57e3c3b6e96b4afda3.tar.gz scummvm-rg350-a97a359ea3825f6fdef40a57e3c3b6e96b4afda3.tar.bz2 scummvm-rg350-a97a359ea3825f6fdef40a57e3c3b6e96b4afda3.zip |
TSAGE: R2R - Implement scene 2535
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 183 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 34 |
3 files changed, 219 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index f86bab3a87..e2e0c71a03 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -134,6 +134,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze: Well return new Scene2530(); case 2535: + // Maze: Tannery + return new Scene2535(); case 2600: case 2700: case 2750: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index cbb6dbc42e..4b4f9b8375 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -2800,5 +2800,188 @@ void Scene2530::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2535 - Maze: Tannery + * + *--------------------------------------------------------------------------*/ + +bool Scene2535::Actor3::startAction(CursorType action, Event &event) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_USE) + return SceneActor::startAction(action, event); + + if (R2_GLOBALS._player._characterIndex == 1) { + R2_GLOBALS._player.disableControl(); + if (R2_INVENTORY.getObjectScene(20) == 2535) { + scene->_sceneMode = 2536; + scene->setAction(&scene->_sequenceManager, scene, 2536, &R2_GLOBALS._player, &scene->_actor3, NULL); + } else { + scene->_sceneMode = 2537; + scene->setAction(&scene->_sequenceManager, scene, 2537, &R2_GLOBALS._player, &scene->_actor3, NULL); + } + } else { + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + + return true; +} + +bool Scene2535::Actor4::startAction(CursorType action, Event &event) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_USE) + return SceneActor::startAction(action, event); + + if (R2_GLOBALS._player._characterIndex == 2) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2535; + scene->setAction(&scene->_sequenceManager, scene, 2535, &R2_GLOBALS._player, &scene->_actor4, NULL); + } else { + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + + return true; +} + +void Scene2535::Exit1::changeScene() { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + _enabled = false; + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 11; + Common::Point pt(210, 200); + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene2535::postInit(SceneObjectList *OwnerList) { + loadScene(2535); + SceneExt::postInit(); + if (R2_GLOBALS._sceneManager._previousScene == -1) { + R2_GLOBALS.setFlag(73); + R2_INVENTORY.setObjectScene(20, 2535); + } + _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_S, 2000); + _exit1.setDest(Common::Point(210, 160)); + + if (R2_INVENTORY.getObjectScene(32) == 2535) { + _actor4.postInit(); + _actor4.setup(2435, 1, 4); + _actor4.setPosition(Common::Point(47, 74)); + _actor4.fixPriority(74); + _actor4.setDetails(2535, 21, -1, -1, 1, NULL); + } + + if (R2_INVENTORY.getObjectScene(20) == 2535) { + _actor3.postInit(); + _actor3.setup(2535, 3, 1); + _actor3.setPosition(Common::Point(203, 131)); + _actor3.setDetails(3, 20, -1, -1, 1, NULL); + R2_GLOBALS._walkRegions.enableRegion(6); + } + + if ((R2_INVENTORY.getObjectScene(20) == 0) && (R2_GLOBALS.getFlag(73))) { + _actor3.postInit(); + _actor3.setup(2536, 1, 2); + _actor3.setPosition(Common::Point(164, 133)); + _actor3.setDetails(3, 20, -1, -1, 1, NULL); + } + + if (R2_GLOBALS.getFlag(73)) { + _actor2.postInit(); + _actor2.setup(2536, 1, 1); + _actor2.setPosition(Common::Point(160, 130)); + _actor2.fixPriority(122); + _actor2.setDetails(2535, 37, -1, -1, 1, NULL); + } + + 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); + } + 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(9001, 0, 5, 3, 1, NULL); + } + _actor1.setPosition(Common::Point(245, 115)); + R2_GLOBALS._walkRegions.enableRegion(2); + } + + _item2.setDetails(Rect(96, 3, 215, 33), 2535, 3, 6, 5, 1, NULL); + _item3.setDetails(Rect(4, 43, 40, 101), 2535, 6, 7, 8, 1, NULL); + _item4.setDetails(Rect(55, 13, 140, 89), 2535, 6, 7, 8, 1, NULL); + _item5.setDetails(Rect(144, 23, 216, 76), 2535, 6, 7, 8, 1, NULL); + _item6.setDetails(Rect(227, 8, 307, 99), 2535, 6, 7, 8, 1, NULL); + _item7.setDetails(Rect(116, 111, 201, 132), 2535, 18, 19, 20, 1, NULL); + _item1.setDetails(Rect(0, 0, 320, 200), 2535, 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] = 2535; + Common::Point pt(210, 150); + PlayerMover *mover = new PlayerMover(); + 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 Scene2535::signal() { + switch (_sceneMode) { + case 11: + g_globals->_sceneManager.changeScene(2000); + break; + case 2535: + R2_INVENTORY.setObjectScene(32, 2); + _actor4.remove(); + R2_GLOBALS._player.enableControl(); + break; + case 2536: + R2_INVENTORY.setObjectScene(20, 0); + R2_GLOBALS._walkRegions.disableRegion(6); + if (!R2_GLOBALS.getFlag(73)) { + _actor3.remove(); + R2_GLOBALS._player.enableControl(); + } else { + _sceneMode = 20; + _actor3.show(); + _actor3.setup(2536, 1, 2); + _actor3.setDetails(3, 20, -1, -1, 3, NULL); + _actor3.setPosition(Common::Point(164, 150)); + _actor3.fixPriority(130); + _actor3._moveDiff.y = 1; + Common::Point pt(164, 133); + PlayerMover *mover = new PlayerMover(); + _actor3.addMover(mover, &pt, this); + } + break; + case 2537: + _actor3.remove(); + R2_INVENTORY.setObjectScene(20, 1); + R2_GLOBALS._player.enableControl(); + break; + case 20: + // 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 bef1fc9ea8..e655d1e8a8 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -444,6 +444,40 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); }; + +class Scene2535 : public SceneExt { + class Actor3 : public SceneActor { + public: + bool startAction(CursorType action, Event &event); + }; + class Actor4 : 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; + SceneActor _actor1; + SceneActor _actor2; + Actor3 _actor3; + Actor4 _actor4; + Exit1 _exit1; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); +}; + } // End of namespace Ringworld2 } // End of namespace TsAGE |