diff options
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 140 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 31 |
3 files changed, 173 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index dca3dcead5..8f85bbdea3 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -128,6 +128,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze: Large Cave return new Scene2500(); case 2525: + // Maze: Furnace room + return new Scene2525(); case 2530: case 2535: case 2600: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 18fd6e6bde..d15763fb29 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -2503,5 +2503,145 @@ void Scene2500::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2525 - Furnace room + * + *--------------------------------------------------------------------------*/ +bool Scene2525::Item5::startAction(CursorType action, Event &event) { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + + if ((action == R2_20) && (!R2_GLOBALS.getFlag(74))) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2526; + scene->setAction(&scene->_sequenceManager, scene, 2526, &R2_GLOBALS._player, NULL); + return true; + } + + return SceneItem::startAction(action, event); +} + +bool Scene2525::Actor3::startAction(CursorType action, Event &event) { + Scene2525 *scene = (Scene2525 *)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 = 2525; + scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_actor3, NULL); + } else { + SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + return true; +} + +void Scene2525::Exit1::changeScene() { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 11; + + Common::Point pt(R2_GLOBALS._player._position.x, 200); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene2525::postInit(SceneObjectList *OwnerList) { + loadScene(2525); + SceneExt::postInit(); + R2_GLOBALS._sound1.play(200); + R2_GLOBALS._sound2.play(207); + + _exit1.setDetails(Rect(86, 155, 228, 168), EXITCURSOR_S, 2000); + + if (R2_INVENTORY.getObjectScene(29) == 2525) { + _actor3.postInit(); + _actor3.setup(2435, 1, 2); + _actor3.setPosition(Common::Point(78, 155)); + _actor3.fixPriority(155); + _actor3.setDetails(2525, 27, -1, -1, 1, NULL); + } + + _actor2.postInit(); + _actor2.setup(2525, 1, 1); + _actor2.setPosition(Common::Point(183, 114)); + _actor2.setDetails(2525, 15, -1, -1, 1, NULL); + _actor2.animate(ANIM_MODE_2, NULL); + _actor2._numFrames = 3; + + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + if (R2_GLOBALS._player._characterIndex == 1) { + R2_GLOBALS._player.setup(2008, 3, 1); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + } else { + R2_GLOBALS._player.setup(20, 3, 1); + R2_GLOBALS._player._moveDiff = Common::Point(5, 3); + } + + 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(209, 162)); + + R2_GLOBALS._walkRegions.enableRegion(4); + } + + _item5.setDetails(Rect(125, 73, 140, 86), 2525, 6, -1, -1, 1, NULL); + _item3.setDetails(Rect(137, 11, 163, 72), 2525, 12, -1, -1, 1, NULL); + _item4.setDetails(Rect(204, 20, 234, 78), 2525, 12, -1, -1, 1, NULL); + _item2.setDetails(Rect(102, 62, 230, 134), 2525, 0, -1, -1, 1, NULL); + _item1.setDetails(Rect(0, 0, 320, 200), 2525, 24, -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] = 2525; + R2_GLOBALS._player.setPosition(Common::Point(160, 200)); + Common::Point pt(160, 150); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } else { + R2_GLOBALS._player.setPosition(Common::Point(160, 150)); + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.enableControl(); + } +} + +void Scene2525::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + R2_GLOBALS._sound2.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene2525::signal() { + switch (_sceneMode) { + case 11: + g_globals->_sceneManager.changeScene(2000); + break; + case 2525: + _actor3.remove(); + R2_INVENTORY.setObjectScene(29, 2); + R2_GLOBALS._player.enableControl(); + break; + case 2526: + R2_GLOBALS.setFlag(74); + R2_GLOBALS._player.enableControl(); + 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 82898a45dd..b906921842 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -383,6 +383,37 @@ public: virtual void signal(); }; +class Scene2525 : public SceneExt { + class Item5 : public NamedHotspot { + public: + virtual 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; + NamedHotspot _item2; + NamedHotspot _item3; + NamedHotspot _item4; + Item5 _item5; + SceneActor _actor1; + SceneActor _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 |