diff options
-rw-r--r-- | engines/tsage/globals.cpp | 3 | ||||
-rw-r--r-- | engines/tsage/globals.h | 1 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 422 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.h | 54 |
5 files changed, 481 insertions, 1 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 1d0e37d071..da40485617 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -386,6 +386,7 @@ void Ringworld2Globals::reset() { _v565AE = 0; for (int i = 0; i < 14; i++) _v56605[i] = 0; + _v56AA0 = 0; _v57C2C = 0; _v58CE2 = 0; Common::fill(&_v565F1[0], &_v565F1[MAX_CHARACTERS], 0); @@ -426,7 +427,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_v565F1[i]); s.syncAsByte(_v565AE); - + s.syncAsByte(_v56AA0); for (i = 0; i < 14; ++i) s.syncAsByte(_v56605[i]); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 9048899953..7e40276fcf 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -252,6 +252,7 @@ public: int _v5657C; byte _v565AE; byte _v56605[14]; + byte _v56AA0; int _v57C2C; int _v58CE2; int _speechSubtitles; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index e5a3919c05..0248a3c32d 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -178,6 +178,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Ghouls dormitory return new Scene3125(); case 3150: + // Jail + return new Scene3150(); case 3175: case 3200: case 3210: diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 488fda5d59..2c2530f833 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -371,5 +371,427 @@ void Scene3125::dispatch() { Scene::dispatch(); } +/*-------------------------------------------------------------------------- + * Scene 3150 - Jail + * + *--------------------------------------------------------------------------*/ +bool Scene3150::Item5::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if (R2_INVENTORY.getObjectScene(47) != 3150) + return SceneHotspot::startAction(action, event); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3154; + scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_actor3, NULL); + return true; + case R2_40: + if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_GLOBALS.getFlag(75))) { + R2_GLOBALS._player.disableControl(); + scene->_actor3.postInit(); + scene->_actor3._effect = 3; + scene->_actor3._shade = 5; + scene->_sceneMode = 3155; + scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_actor3, NULL); + } else { + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + return true; + default: + return SceneHotspot::startAction(action, event); + break; + } +} + +bool Scene3150::Item6::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case R2_41: + R2_GLOBALS._player.disableControl(); + scene->_actor4.postInit(); + scene->_actor4._effect = 6; + scene->_actor4._shade = 3; + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3158; + scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_actor4, NULL); + return true; + case R2_42: + if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_INVENTORY.getObjectScene(40) == 3150) && (R2_GLOBALS.getFlag(75))) { + scene->_actor5.postInit(); + scene->_actor5._effect = 6; + scene->_actor5._shade = 3; + scene->_actor5.setDetails(3150, 30, -1, -1, 2, NULL); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3159; + scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_actor5, NULL); + } else { + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + default: + return SceneHotspot::startAction(action, event); + break; + } +} + +bool Scene3150::Actor4::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if (R2_GLOBALS.getFlag(75)) + return SceneActor::startAction(action, event); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3151; + scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_actor4, NULL); + return true; + case R2_42: + return false; + default: + return SceneActor::startAction(action, event); + break; + } +} + +bool Scene3150::Actor5::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(77))) + return SceneActor::startAction(action ,event); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3157; + scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_actor5, NULL); + return true; +} + +bool Scene3150::Actor6::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + if (R2_GLOBALS.getFlag(75)) { + if (R2_GLOBALS.getFlag(77)) { + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS.getFlag(76)) { + scene->_sceneMode = 3152; + scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); + } else { + scene->_sceneMode = 3153; + scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_actor4, NULL); + } + } else { + SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + } + } else { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3152; + scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); + } + return true; + } else { + return SceneActor::startAction(action, event); + } +} + +bool Scene3150::Actor7::startAction(CursorType action, Event &event) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + if ((action == R2_43) && (!R2_GLOBALS.getFlag(80))) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 3160; + scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_actor7, NULL); + return true; + } + + return SceneActor::startAction(action, event); +} + +void Scene3150::Exit1::changeScene() { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + g_globals->_events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 11; + + Common::Point pt(-20, 180); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene3150::Exit2::changeScene() { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + g_globals->_events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 12; + + scene->setAction(&scene->_sequenceManager, scene, 3163, &R2_GLOBALS._player, NULL); +} + +void Scene3150::postInit(SceneObjectList *OwnerList) { + loadScene(3150); + if (R2_GLOBALS._sceneManager._previousScene == -1) { + R2_INVENTORY.setObjectScene(35, 2000); + R2_GLOBALS._player._oldCharacterScene[1] = 3100; + R2_GLOBALS._player._oldCharacterScene[3] = 0; + R2_GLOBALS._player._characterIndex = R2_MIRANDA; + } + SceneExt::postInit(); + + if (R2_GLOBALS.getFlag(78)) { + _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _exit1.setDest(Common::Point(70, 125)); + } + + if (R2_GLOBALS.getFlag(80)) { + _exit2.setDetails(Rect(249, 36, 279, 60), EXITCURSOR_NE, 3150); + _exit2.setDest(Common::Point(241, 106)); + } + + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.disableControl(); + + _actor2.postInit(); + _actor2.setPosition(Common::Point(64, 139)); + if (R2_GLOBALS.getFlag(78)) { + _actor2.setup(3151, 1, 5); + _actor2.fixPriority(125); + } else { + _actor2.setup(3151, 1, 1); + _actor2.setDetails(3150, 8, -1, 9, 1, NULL); + } + + if (R2_GLOBALS.getFlag(78)) { + _actor1.postInit(); + _actor1.setup(3154, 1, 16); + _actor1.setPosition(Common::Point(104, 129)); + _actor1._effect = 6; + _actor1._shade = 3; + _actor1.setDetails(3150, 24, -1, -1, -1, NULL); + } + + _actor7.postInit(); + _actor7.setup(3154, 5, 1); + if (R2_GLOBALS.getFlag(80)) + _actor7.setPosition(Common::Point(264, 108)); + else + _actor7.setPosition(Common::Point(264, 58)); + _actor7.fixPriority(50); + _actor7.setDetails(3150, 17, -1, 19, 1, NULL); + + if (R2_INVENTORY.getObjectScene(41) == 3150) { + _actor4.postInit(); + if (R2_GLOBALS.getFlag(75)) { + if (R2_GLOBALS.getFlag(76)) { + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.enableRegion(6); + _actor4.setup(3152, 4, 10); + _actor4.setDetails(3150, 14, -1, -1, 1, NULL); + } else { + _actor4.setup(3152, 7, 4); + _actor4.setDetails(3150, 13, -1, -1, 1, NULL); + } + _actor4.fixPriority(110); + _actor4.setPosition(Common::Point(83, 88)); + _actor4._effect = 6; + _actor4._shade = 3; + } else { + _actor4.setup(3152, 7, 3); + _actor4.setPosition(Common::Point(143, 70)); + _actor4.setDetails(3150, 15, -1, -1, 1, NULL); + } + } + + if (R2_INVENTORY.getObjectScene(47) == 3150) { + _actor3.postInit(); + _actor3.setup(3152, 7, 1); + _actor3.setPosition(Common::Point(73, 83)); + } + + if (R2_INVENTORY.getObjectScene(40) == 3150) { + _actor3.postInit(); + _actor3.setup(3152, 7, 3); + _actor3.setPosition(Common::Point(70, 55)); + _actor3.fixPriority(111); + _actor3._effect = 6; + _actor3._shade = 5; + } + + if (R2_INVENTORY.getObjectScene(42) == 3150) { + _actor5.postInit(); + if (R2_GLOBALS.getFlag(77)) { + _actor5.setup(3152, 7, 8); + _actor5.setPosition(Common::Point(82, 92)); + _actor5.fixPriority(111); + _actor5._effect = 6; + _actor5._shade = 3; + } else { + _actor5.setup(3152, 7, 7); + _actor5.setPosition(Common::Point(155, 79)); + } + _actor5.setDetails(3150, 30, -1, -1, 2, NULL); + } + + _actor6.postInit(); + _actor6.setup(3152, 7, 6); + _actor6.setPosition(Common::Point(98, 73)); + _actor6.setDetails(3150, 43, -1, -1, 1, NULL); + + _item2.setDetails(12, 3150, 10, -1, 12); + _item3.setDetails(Rect(186, 17, 210, 36), 3150, 6, -1, -1, 1, NULL); + _item4.setDetails(Rect(61, 21, 92, 41), 3150, 7, -1, -1, 1, NULL); + _item5.setDetails(Rect(63, 48, 78, 58), 3150, 6, -1, -1, 1, NULL); + _item6.setDetails(Rect(63, 81, 100, 95), 3150, 3, 4, -1, 1, NULL); + _item1.setDetails(Rect(0, 0, 200, 320), 3150, 0, 1, 2, 1, NULL); + + switch (R2_GLOBALS._player._oldCharacterScene[3]) { + case 0: + _sceneMode = 3150; + _actor1.postInit(); + _actor1._effect = 6; + _actor1._shade = 5; + setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_actor1, &_actor2, NULL); + break; + case 1200: + _sceneMode = 3162; + setAction(&_sequenceManager, this, 3162, &R2_GLOBALS._player, NULL); + break; + case 3275: { + _sceneMode = 10; + R2_GLOBALS._player.setup(30, 3, 1); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setPosition(Common::Point(-20, 180)); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + + Common::Point pt(80, 125); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + default: + if ((R2_GLOBALS._v56AA0 == 1) && (R2_INVENTORY.getObjectScene(35) == 2000) && (R2_GLOBALS._player._oldCharacterScene[1] == 3100)) { + ++R2_GLOBALS._v56AA0; + _sceneMode = 3156; + _actor1.postInit(); + _actor1._effect = 6; + _actor1._shade = 3; + + _actor2.postInit(); + _actor5.postInit(); + _actor5._effect = 6; + _actor5._shade = 3; + + setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor5, NULL); + } else { + if (R2_GLOBALS._v56AA0 != 2) + ++R2_GLOBALS._v56AA0; + + R2_GLOBALS._player.setup(30, 3, 1); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setPosition(Common::Point(155, 120)); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + R2_GLOBALS._player.enableControl(); + } + } + + R2_GLOBALS._player._oldCharacterScene[3] = 3150; +} + +void Scene3150::signal() { + switch (_sceneMode) { + case 11: + R2_GLOBALS._sceneManager.changeScene(3275); + break; + case 12: + R2_GLOBALS._sceneManager.changeScene(1200); + break; + case 3151: + _actor1.remove(); + R2_INVENTORY.setObjectScene(41, 3); + R2_GLOBALS._player.enableControl(); + break; + case 3153: + R2_GLOBALS.setFlag(76); + _actor4.setDetails(3150, 14, -1, -1, 3, NULL); + _actor1.postInit(); + _actor1.setDetails(3150, 24, -1, -1, 2, NULL); + _sceneMode = 3161; + setAction(&_sequenceManager, this, 3161, &_actor1, &_actor2, NULL); + break; + case 3154: + _actor3.remove(); + R2_INVENTORY.setObjectScene(47, 3); + R2_GLOBALS._player.enableControl(); + break; + case 3155: + R2_INVENTORY.setObjectScene(40, 3150); + R2_GLOBALS._player.enableControl(); + break; + case 3156: + _actor5.setDetails(3150, 30, -1, -1, 2, NULL); + R2_INVENTORY.setObjectScene(42, 3150); + R2_GLOBALS._player.enableControl(); + break; + case 3157: + _actor5.remove(); + R2_INVENTORY.setObjectScene(42, 3); + R2_GLOBALS._player.enableControl(); + break; + case 3158: + R2_GLOBALS.setFlag(75); + R2_INVENTORY.setObjectScene(41, 3150); + _actor4.fixPriority(110); + _actor4.setDetails(3150, 13, -1, -1, 2, NULL); + R2_GLOBALS._player.enableControl(); + break; + case 3159: + R2_GLOBALS.setFlag(77); + R2_INVENTORY.setObjectScene(42, 3150); + R2_GLOBALS._player.enableControl(); + break; + case 3160: + R2_INVENTORY.setObjectScene(52, 3150); + R2_GLOBALS.setFlag(80); + R2_GLOBALS._sceneManager.changeScene(1200); + break; + case 3161: + R2_GLOBALS._sceneItems.remove(&_actor2); + _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _exit1.setDest(Common::Point(70, 125)); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS.setFlag(78); + R2_GLOBALS._player.enableControl(); + break; + default: + R2_GLOBALS._player.enableControl(); + break; + } +} + +void Scene3150::dispatch() { + if (_actor5._position.x == 155) { + _actor5._effect = 0; + _actor5._shade = 0; + } + + if (_actor1._visage == 3154) { + _actor1._effect = 0; + _actor1._shade = 0; + } + + Scene::dispatch(); +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index b135ddc0a3..cdbf4359b0 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -105,6 +105,60 @@ public: virtual void dispatch(); virtual void synchronize(Serializer &s); }; + +class Scene3150 : public SceneExt { + class Item5 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Item6 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Actor4 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor5 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor6 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor7 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + + class Exit1 : public SceneExit { + public: + virtual void changeScene(); + }; + class Exit2 : public SceneExit { + public: + virtual void changeScene(); + }; +public: + + NamedHotspot _item1; + NamedHotspot _item2; + NamedHotspot _item3; + NamedHotspot _item4; + Item5 _item5; + Item6 _item6; + SceneActor _actor1; + SceneActor _actor2; + SceneActor _actor3; + Actor4 _actor4; + Actor5 _actor5; + Actor6 _actor6; + Actor7 _actor7; + Exit1 _exit1; + Exit2 _exit2; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; } // End of namespace Ringworld2 } // End of namespace TsAGE |