diff options
author | Strangerke | 2011-12-11 00:36:04 +0100 |
---|---|---|
committer | Strangerke | 2011-12-11 00:36:04 +0100 |
commit | 5ac244313f16be73ab33cab68ee7b6d7b742b9e0 (patch) | |
tree | bff9e5eda31957e55ca53a24ea5819ea846203a4 /engines | |
parent | 15d053a8056cb3b9da20e76e67412e4ef5dd0ae2 (diff) | |
download | scummvm-rg350-5ac244313f16be73ab33cab68ee7b6d7b742b9e0.tar.gz scummvm-rg350-5ac244313f16be73ab33cab68ee7b6d7b742b9e0.tar.bz2 scummvm-rg350-5ac244313f16be73ab33cab68ee7b6d7b742b9e0.zip |
TSAGE: R2R - Implement scene 2450
Diffstat (limited to 'engines')
-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_scenes2.cpp | 293 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 33 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 90 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 23 |
7 files changed, 445 insertions, 0 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 0b59fd4e36..7f6f71ceae 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -377,6 +377,7 @@ void Ringworld2Globals::reset() { // Reset fields _v5657C = 0; _v565F5 = 0; + _v565AE = 0; for (int i = 0; i < 14; i++) _v56605[i] = 0; _v57C2C = 0; @@ -417,6 +418,8 @@ void Ringworld2Globals::synchronize(Serializer &s) { for (i = 0; i < MAX_CHARACTERS; ++i) s.syncAsSint16LE(_v565F1[i]); + + s.syncAsByte(_v565AE); for (i = 0; i < 14; ++i) s.syncAsByte(_v56605[i]); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index e3c6f5cbc7..43e4af5cf9 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -247,6 +247,7 @@ public: int _insetUp; int _v565F5; int _v5657C; + byte _v565AE; byte _v56605[14]; int _v57C2C; int _v58CE2; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index ba624b9db3..658937f0a5 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -119,6 +119,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Maze: return new Scene2445(); case 2450: + // Maze: Another bedroom + return new Scene2450(); case 2455: case 2500: case 2525: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index fdfc5fcbdc..c83d605d45 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1925,5 +1925,298 @@ void Scene2445::postInit(SceneObjectList *OwnerList) { void Scene2445::signal() { R2_GLOBALS._player.enableControl(); } + +/*-------------------------------------------------------------------------- + * Scene 2450 - Maze: Another bedroom + * + *--------------------------------------------------------------------------*/ + +bool Scene2450::Actor2::startAction(CursorType action, Event &event) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 1)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2452; + scene->setAction(&scene->_sequenceManager, scene, 2452, &R2_GLOBALS._player, &scene->_actor2, NULL); + return true; + } + return SceneActor::startAction(action, event); +} + +bool Scene2450::Actor3::startAction(CursorType action, Event &event) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_TALK) { + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS._v565AE < 3) { + ++R2_GLOBALS._v565AE; + scene->_sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + if (R2_GLOBALS._player._characterIndex == 1) + scene->_stripManager.start(699 + (R2_GLOBALS._v565AE * 2), scene); + else + scene->_stripManager.start(700 + (R2_GLOBALS._v565AE * 2), scene); + } + return true;} else { + return SceneActor::startAction(action, event); + } +} + +void Scene2450::Exit1::changeScene() { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + + if ((R2_GLOBALS._player._characterIndex == 2) || (R2_GLOBALS.getFlag(61))) { + _enabled = false; + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 10; + Common::Point pt(-10, 180); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); + } else { + _moving = false; + SceneItem::display(2450, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + Common::Point pt(60, 140); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, NULL); + } +} + +void Scene2450::postInit(SceneObjectList *OwnerList) { + loadScene(2450); + SceneExt::postInit(); + R2_GLOBALS._sound1.play(200); + if (R2_GLOBALS._sceneManager._previousScene == -1) { + R2_GLOBALS._sceneManager._previousScene = 1900; + R2_GLOBALS._player._oldCharacterScene[1] = 1900; + R2_GLOBALS._player._oldCharacterScene[2] = 1900; + } + _stripManager.addSpeaker(&_quinnSpeaker); + _stripManager.addSpeaker(&_seekerSpeaker); + _stripManager.addSpeaker(&_caretakerSpeaker); + + if (R2_GLOBALS.getFlag(72)) { + _exit1.setDetails(Rect(0, 143, 47, 168), EXITCURSOR_SW, 2000); + _exit1.setDest(Common::Point(10, 160)); + } + + if (!R2_GLOBALS.getFlag(61)) { + _actor2.postInit(); + _actor2.setVisage(2009); + _actor2.setPosition(Common::Point(190, 119)); + _actor2.fixPriority(50); + _actor2.setDetails(2450, 0, -1, -1, 1, NULL); + } + + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.disableControl(); + switch (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex]) { + case 1900: + R2_GLOBALS._v565AE = 0; + R2_GLOBALS._player._characterScene[1] = 2450; + R2_GLOBALS._player._characterScene[2] = 2450; + R2_GLOBALS._player._oldCharacterScene[1] = 2450; + R2_GLOBALS._player._oldCharacterScene[2] = 2450; + R2_GLOBALS._player.setup(2450, 1, 1); + R2_GLOBALS._player.setPosition(Common::Point(126, 101)); + setAction(&_sequenceManager, this, 2450, &R2_GLOBALS._player, NULL); + break; + case 2000: + _sceneMode = 2451; + if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterScene[2] == 2450) { + _actor1.postInit(); + _actor1.setup(20, 6, 1); + _actor1.setPosition(Common::Point(240, 120)); + _actor1.setDetails(9002, 0, 4, 3, 1, NULL); + } + setAction(&_sequenceManager, this, 2451, &R2_GLOBALS._player, NULL); + } else { + R2_GLOBALS._player._oldCharacterScene[2] = 2450; + R2_GLOBALS._player._characterScene[2] = 2450; + if (R2_GLOBALS._player._characterScene[1] == 2450) { + _actor1.postInit(); + if (R2_GLOBALS.getFlag(61)) + _actor1.setup(2008, 6, 1); + else + _actor1.setup(10, 6, 1); + _actor1.setDetails(9001, 0, 5, 3, 1, NULL); + _actor1.setPosition(Common::Point(106, 111)); + } + setAction(&_sequenceManager, this, 2456, &R2_GLOBALS._player, NULL); + } + break; + case 2450: + if (R2_GLOBALS._player._characterIndex == 1) { + R2_GLOBALS._player.postInit(); + if (R2_GLOBALS.getFlag(61)) { + R2_GLOBALS._player.setup(2008, 6, 1); + } else { + R2_GLOBALS._player.setup(10, 6, 1); + } + R2_GLOBALS._player.setPosition(Common::Point(106, 111)); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + if (R2_GLOBALS.getFlag(72)) { + if (R2_GLOBALS._player._characterScene[2] == 2450) { + _actor1.postInit(); + _actor1.setup(20, 6, 1); + _actor1.setPosition(Common::Point(240, 120)); + _actor1.setDetails(9002, 0, 4, 3, 1, NULL); + } + } else { + _actor1.postInit(); + _actor1.setup(20, 8, 1); + _actor1.setPosition(Common::Point(93, 158)); + _actor1.setDetails(9002, 0, 4, 3, 1, NULL); + + _actor3.postInit(); + _actor3.setup(2001, 7, 1); + _actor3.setPosition(Common::Point(34, 153)); + _actor3.setDetails(2001, 40, -1, -1, 1, NULL); + + _exit1._enabled = false; + } + } else { + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.setup(20, 8, 1); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setPosition(Common::Point(93, 158)); + if (R2_GLOBALS.getFlag(72)) { + if (R2_GLOBALS._player._characterScene[1] == 2450) { + _actor1.postInit(); + if (R2_GLOBALS.getFlag(61)) { + _actor1.setup(2008, 6, 1); + } else { + _actor1.setup(10, 6, 1); + } + _actor1.setPosition(Common::Point(106, 111)); + _actor1.setDetails(9001, 0, 5, 3, 1, NULL); + } + } else { + _actor1.postInit(); + if (R2_GLOBALS.getFlag(61)) { + _actor1.setup(2008, 6, 1); + } else { + _actor1.setup(10, 6, 1); + } + _actor1.setPosition(Common::Point(106, 111)); + _actor1.setDetails(9001, 0, 5, 3, 1, NULL); + + _actor3.postInit(); + _actor3.setup(2001, 7, 1); + _actor3.setPosition(Common::Point(34, 153)); + _actor3.setDetails(2001, 40, -1, -1, 1, NULL); + + _exit1._enabled = false; + } + } + R2_GLOBALS._player.enableControl(); + if (!R2_GLOBALS.getFlag(72)) { + R2_GLOBALS._player._canWalk = false; + } + break; + default: + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS.getFlag(61)) { + R2_GLOBALS._player.setup(2008, 3, 1); + } else { + R2_GLOBALS._player.setup(10, 3, 1); + } + 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(100, 130)); + R2_GLOBALS._player.enableControl(); + break; + } + _item2.setDetails(Rect(174, 4, 199, 123), 2430, 30, 31, 32, 1, NULL); + _item3.setDetails(Rect(67, 73, 207, 121), 2430, 36, -1, 38, 1, NULL); + _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL); +} + +void Scene2450::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene2450::signal() { + switch (_sceneMode) { + case 10: + g_globals->_sceneManager.changeScene(2000); + break; + case 20: + if (R2_GLOBALS._v565AE == 3) { + R2_GLOBALS._player.disableControl(); + R2_GLOBALS._v565AE = 4; + _sceneMode = 2454; + setAction(&_sequenceManager, this, 2454, &_actor3, NULL); + } else { + R2_GLOBALS._player.enableControl(CURSOR_TALK); + if (R2_GLOBALS._v565AE < 4) + R2_GLOBALS._player._canWalk = false; + } + break; + case 30: + R2_GLOBALS._player.disableControl(); + _sceneMode = 2455; + setAction(&_sequenceManager, this, 2455, &_actor1, NULL); + break; + case 31: + R2_GLOBALS.setFlag(61); + g_globals->_sceneManager.changeScene(2435); + break; + case 2451: + R2_GLOBALS._player.enableControl(); + break; + case 2452: + R2_GLOBALS.setFlag(61); + _actor2.remove(); + R2_GLOBALS._player.enableControl(); + if (!R2_GLOBALS.getFlag(72)) { + R2_GLOBALS._player.setStrip(6); + R2_GLOBALS._player._canWalk = false; + } + break; + case 2453: + _sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(700, this); + break; + case 2454: + _exit1._enabled = true; + R2_GLOBALS.setFlag(72); + _actor3.remove(); + if (R2_GLOBALS.getFlag(61)) { + g_globals->_sceneManager.changeScene(2435); + } else { + _sceneMode = 31; + if (R2_GLOBALS._player._characterIndex == 1) { + setAction(&_sequenceManager, this, 2452, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager, this, 2452, &_actor1, &_actor2, NULL); + } + } + break; + case 2455: + R2_GLOBALS._player._oldCharacterScene[2] = 2450; + R2_GLOBALS._player._characterScene[2] = 2000; + R2_GLOBALS._v56605[2] = 3; + _actor1.remove(); + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + default: + _actor1.postInit(); + _actor1.setDetails(9002, 0, 4, 3, 2, NULL); + _actor3.postInit(); + _actor3.setDetails(2001, 40, -1, -1, 2, NULL); + _sceneMode = 2453; + setAction(&_sequenceManager, this, 2453, &_actor3, &_actor1, NULL); + 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 fa7a641114..aba5e2ab68 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -298,6 +298,39 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); }; + +class Scene2450 : public SceneExt { + 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: + SpeakerQuinn2450 _quinnSpeaker; + SpeakerSeeker2450 _seekerSpeaker; + SpeakerCaretaker2450 _caretakerSpeaker; + NamedHotspot _item1; + NamedHotspot _item2; + NamedHotspot _item3; + SceneActor _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 diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 4fabc3643b..29a564e672 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -592,6 +592,96 @@ void SpeakerPharisha2435::proc15() { } } +/*--------------------------------------------------------------------------*/ + +SpeakerQuinn2450::SpeakerQuinn2450() { + _speakerName = "QUINN"; + _color1 = 60; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} +void SpeakerQuinn2450::proc15() { + int v = _fieldF6; + + if (!_object2) { + if (R2_GLOBALS._player._characterIndex == 1) { + _object2 = &R2_GLOBALS._player; + } else { + Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_actor1; + } + + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + if (R2_GLOBALS.getFlag(61)) + _object1.setup(2020, 3, 1); + else + _object1.setup(2020, 1, 1); + _object1.animate(ANIM_MODE_5, this); + } +} + +SpeakerSeeker2450::SpeakerSeeker2450() { + _speakerName = "SEEKER"; + _color1 = 35; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} + +void SpeakerSeeker2450::proc15() { + int v = _fieldF6; + + if (!_object2) { + if (R2_GLOBALS._player._characterIndex == 2) { + _object2 = &R2_GLOBALS._player; + } else { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_actor1; + } + + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(4099, 3, 1); + _object1.animate(ANIM_MODE_5, this); + } +} + +SpeakerCaretaker2450::SpeakerCaretaker2450() { + _speakerName = "CARETAKER"; + _color1 = 43; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index e788fb7f9c..1a7f9510be 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -152,6 +152,29 @@ public: virtual Common::String getClassName() { return "SpeakerPharisha2435"; } virtual void proc15(); }; + +class SpeakerQuinn2450 : public VisualSpeaker { +public: + SpeakerQuinn2450(); + + virtual Common::String getClassName() { return "SpeakerQuinn2450"; } + virtual void proc15(); +}; + +class SpeakerSeeker2450 : public VisualSpeaker { +public: + SpeakerSeeker2450(); + + virtual Common::String getClassName() { return "SpeakerSeeker2450"; } + virtual void proc15(); +}; + +class SpeakerCaretaker2450 : public VisualSpeaker { +public: + SpeakerCaretaker2450(); + + virtual Common::String getClassName() { return "SpeakerCaretaker2450"; } +}; } // End of namespace Ringworld2 } // End of namespace TsAGE |