diff options
author | Strangerke | 2011-12-17 02:03:36 +0100 |
---|---|---|
committer | Strangerke | 2011-12-17 02:03:36 +0100 |
commit | 114e857d78536d5a19d2b37855d67522d5b00e6e (patch) | |
tree | a883380abfb8389dfcf67a78056e638531e07a78 /engines/tsage/ringworld2 | |
parent | f9d4886e50dc87535c34ec7c12c1e53fed3a3910 (diff) | |
download | scummvm-rg350-114e857d78536d5a19d2b37855d67522d5b00e6e.tar.gz scummvm-rg350-114e857d78536d5a19d2b37855d67522d5b00e6e.tar.bz2 scummvm-rg350-114e857d78536d5a19d2b37855d67522d5b00e6e.zip |
TSAGE: R2R - Implement scene 2800
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 383 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.h | 41 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 124 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 24 |
5 files changed, 574 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 201b44eeef..3854a37384 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -162,6 +162,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Forest Maze return new Scene2750(); case 2800: + // Exiting Forest + return new Scene2800(); case 2900: error("Missing scene %d from group 2", sceneNumber); /* Scene group #3 */ diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 107d7bad04..a61ff6ac9a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -4162,5 +4162,388 @@ void Scene2750::process(Event &event) { Scene::process(event); } +/*-------------------------------------------------------------------------- + * Scene 2800 - Exiting forest + * + *--------------------------------------------------------------------------*/ +Scene2800::Scene2800(): SceneExt() { + _field412 = 0; +} + +void Scene2800::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field412); +} + +bool Scene2800::Item2::startAction(CursorType action, Event &event) { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + + if ((action == CURSOR_USE) && (R2_GLOBALS.getFlag(47))) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 2805; + scene->setAction(&scene->_sequenceManager, scene, 2805, &R2_GLOBALS._player, NULL); + return true; + } else + return SceneHotspot::startAction(action, event); +} + +bool Scene2800::Actor1::startAction(CursorType action, Event &event) { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_TALK) { + R2_GLOBALS._player.disableControl(); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS.setFlag(47); + scene->_field412 = 1205; + scene->_sceneMode = 2803; + scene->_stripManager.start(scene->_field412, scene); + return true; + } else if (action == R2_7) { + R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(); + R2_GLOBALS.setFlag(47); + scene->_sceneMode = 10; + scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor1, NULL); + return true; + } else + return SceneActor::startAction(action, event); +} + +void Scene2800::Action1::signal() { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + + if (R2_GLOBALS._player._position.x <= 320) { + setDelay(120); + Common::Point pt(330, 25); + NpcMover *mover = new NpcMover(); + scene->_object1.addMover(mover, &pt, NULL); + } else { + setDelay(1800 + R2_GLOBALS._randomSource.getRandomNumber(600)); + scene->_object1.setPosition(Common::Point(-10, 45)); + } +} + +void Scene2800::Action2::signal() { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(240); + R2_GLOBALS._sound1.changeSound(240); + R2_GLOBALS._sound2.stop(); + break; + case 1: + scene->_object2.postInit(); + scene->_object2.setVisage(2800); + scene->_object2.setStrip(1); + scene->_object2._numFrames = 8; + scene->_object2._moveRate = 8; + scene->_object2.changeZoom(100); + scene->_object2.setPosition(Common::Point(1, 1)); + scene->_object2.show(); + scene->_object2.animate(ANIM_MODE_5, this); + break; + case 2: + R2_GLOBALS._sound2.play(130); + scene->_object2.setVisage(2800); + scene->_object2.setStrip(7); + + scene->_object3.postInit(); + scene->_object3.setVisage(2800); + scene->_object3.setStrip(3); + scene->_object3._numFrames = 8; + scene->_object3._moveRate = 8; + scene->_object3.changeZoom(100); + scene->_object3.setPosition(Common::Point(300, 104)); + scene->_object3.show(); + scene->_object3.animate(ANIM_MODE_5, this); + break; + case 3: + R2_GLOBALS._sound1.play(241); + scene->_object4.postInit(); + scene->_object4.setVisage(2800); + scene->_object4.setStrip(2); + scene->_object4._numFrames = 4; + scene->_object4._moveRate = 4; + scene->_object4.changeZoom(100); + scene->_object4.setPosition(Common::Point(300, 104)); + scene->_object4.fixPriority(105); + scene->_object4.show(); + scene->_object4.animate(ANIM_MODE_5, this); + break; + case 4: + setDelay(18); + scene->_object4.setStrip(4); + scene->_actor1.setVisage(2800); + scene->_actor1.setStrip(5); + scene->_actor1.setFrame(1); + scene->_actor1._numFrames = 5; + scene->_actor1._moveRate = 5; + scene->_actor1.setPosition(Common::Point(300, 104)); + scene->_actor1.fixPriority(110); + scene->_actor1.changeZoom(100); + scene->_actor1.show(); + break; + case 5: + scene->_actor1.animate(ANIM_MODE_5, this); + break; + case 6: { + scene->_actor1.changeZoom(-1); + scene->_actor1.setVisage(3107); + scene->_actor1.animate(ANIM_MODE_1, NULL); + scene->_actor1.setStrip(3); + scene->_actor1.setPosition(Common::Point(297, 140)); + scene->_actor1._numFrames = 10; + scene->_actor1._moveRate = 10; + scene->_actor1._moveDiff = Common::Point(3, 2); + + Common::Point pt(297, 160); + NpcMover *mover = new NpcMover(); + scene->_actor1.addMover(mover, &pt, this); + break; + } + case 7: { + scene->_actor1.changeZoom(75); + scene->_actor1.updateAngle(R2_GLOBALS._player._position); + + Common::Point pt(105, 82); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 8: { + R2_GLOBALS._player._numFrames = 8; + R2_GLOBALS._player._moveRate = 8; + R2_GLOBALS._player.animate(ANIM_MODE_2, NULL); + R2_GLOBALS._player.setObjectWrapper(NULL); + R2_GLOBALS._player.setStrip(2); + R2_GLOBALS._player.changeZoom(-1); + + Common::Point pt(79, 100); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 9: { + R2_GLOBALS._player._numFrames = 10; + R2_GLOBALS._player._moveRate = 10; + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + + Common::Point pt(100, 64); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 10: { + R2_GLOBALS._player.fixPriority(124); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + + Common::Point pt(160, 124); + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 11: { + R2_GLOBALS._player.fixPriority(-1); + + Common::Point pt(160, 160); + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 12: { + Common::Point pt(270, 160); + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 13: + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + scene->_field412 = 1207; + scene->_stripManager.start(scene->_field412, this); + break; + case 14: { + R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.fixPriority(110); + + Common::Point pt(288, 140); + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + break; + } + case 15: + setDelay(18); + scene->_actor1.updateAngle(R2_GLOBALS._player._position); + R2_GLOBALS._player.setVisage(2800); + R2_GLOBALS._player.setStrip(6); + R2_GLOBALS._player.setFrame(1); + R2_GLOBALS._player.changeZoom(100); + R2_GLOBALS._player.setPosition(Common::Point(300, 104)); + R2_GLOBALS._player._numFrames = 5; + R2_GLOBALS._player._moveRate = 5; + break; + case 16: + R2_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 17: + setDelay(6); + scene->_object4.setStrip(2); + scene->_object4.setFrame(11); + R2_GLOBALS._player.hide(); + // No break on purpose + case 18: + R2_GLOBALS._sound1.play(241); + scene->_object4.animate(ANIM_MODE_6, this); + break; + case 19: + scene->_object4.remove(); + scene->_object3.animate(ANIM_MODE_6, this); + break; + case 20: + setDelay(6); + scene->_object3.remove(); + scene->_object2.setStrip(1); + scene->_object2.setFrame(19); + break; + case 21: + setDelay(150); + R2_GLOBALS._sound1.play(269); + R2_GLOBALS._sound2.stop(); + break; + case 22: + scene->_sceneMode = 12; + scene->_object2.animate(ANIM_MODE_6, scene); + break; + default: + break; + } +} + +void Scene2800::postInit(SceneObjectList *OwnerList) { + loadScene(2800); + setZoomPercents(100, 50, 124, 75); + R2_GLOBALS._sound1.stop(); + R2_GLOBALS._sound2.stop(); + SceneExt::postInit(); + + _object1.postInit(); + _object1.setup(2750, 4, 1); + _object1.setPosition(Common::Point(-10, 25)); + _object1.animate(ANIM_MODE_1, NULL); + _object1.setStrip2(4); + _object1._moveRate = 20; + _object1.setAction(&_action1); + + _actor3.postInit(); + _actor3.setup(2802, 1, 1); + _actor3.setPosition(Common::Point(116, 80)); + _actor3.fixPriority(111); + _actor3.animate(ANIM_MODE_2, NULL); + _actor3._numFrames = 6; + + if (!R2_GLOBALS.getFlag(47)) { + _actor1.postInit(); + _actor1.setVisage(3105); + _actor1.setStrip(3); + _actor1.setFrame(1); + _actor1.setZoom(50); + _actor1._moveDiff = Common::Point(2, 1); + _actor1.setPosition(Common::Point(122, 82)); + _actor1.animate(ANIM_MODE_NONE, NULL); + _actor1.setDetails(2800, -1, -1, -1, 1, NULL); + } + + _item1.setDetails(Rect(0, 0, 320, 200), 2800, -1, -1, -1, 1, NULL); + + _stripManager.setColors(60, 255); + _stripManager.setFontNumber(3); + _stripManager.addSpeaker(&_quinnSpeaker); + _stripManager.addSpeaker(&_nejSpeaker); + _stripManager.addSpeaker(&_guardSpeaker); + + if (R2_INVENTORY.getObjectScene(36) == 0) { + R2_GLOBALS._sound1.fadeSound(237); + if (R2_GLOBALS.getFlag(47)) { + _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + } else { + _actor2.postInit(); + _actor2.setup(2752, 5, 1); + _actor2.animate(ANIM_MODE_NONE, NULL); + _actor2.changeZoom(100); + _actor2._moveDiff = Common::Point(2, 1); + _actor2.setPosition(Common::Point(101, 148)); + } + } + + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.setVisage(19); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.changeZoom(100); + R2_GLOBALS._player._moveDiff = Common::Point(2, 2); + R2_GLOBALS._player.disableControl(); + + if (R2_INVENTORY.getObjectScene(36) == 0) { + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2800, &R2_GLOBALS._player, NULL); + } else if (R2_GLOBALS.getFlag(47)) { + R2_GLOBALS._player.setVisage(3110); + R2_GLOBALS._player.changeZoom(-1); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + R2_GLOBALS._player.setPosition(Common::Point(160, 124)); + R2_GLOBALS._player.enableControl(); + } else { + _sceneMode = 2801; + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + } +} + +void Scene2800::signal() { + switch (_sceneMode) { + case 10: + R2_GLOBALS._sound1.play(238); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _field412 = 1206; + _sceneMode = 2804; + _stripManager.start(_field412, this); + break; + case 11: + _actor2.remove(); + _object1.setAction(NULL); + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + break; + case 12: + R2_GLOBALS._sound1.fadeOut2(NULL); + R2_GLOBALS._sound2.fadeOut2(NULL); + g_globals->_sceneManager.changeScene(1000); + break; + case 2800: + g_globals->_sceneManager.changeScene(2750); + break; + case 2801: + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player._canWalk = false; + break; + case 2803: + R2_GLOBALS._player.disableControl(); + _sceneMode = 10; + setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + break; + case 2804: + R2_GLOBALS._player.disableControl(); + _sceneMode = 11; + setAction(&_sequenceManager, this, 2804, &R2_GLOBALS._player, &_actor2, NULL); + break; + case 2805: + _object1.remove(); + setAction(&_action2); + break; + default: + 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 9b2a8685fc..2097465a48 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -624,6 +624,47 @@ public: virtual void process(Event &event); }; +class Scene2800 : public SceneExt { + class Item2 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + class Actor1 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + + class Action1: public Action { + public: + void signal(); + }; + class Action2: public Action { + public: + void signal(); + }; +public: + SpeakerQuinn2800 _quinnSpeaker; + SpeakerNej2800 _nejSpeaker; + SpeakerGuard2800 _guardSpeaker; + NamedHotspot _item1; + Item2 _item2; + Actor1 _actor1; + SceneActor _actor2; + SceneActor _actor3; + SceneObject _object1; + Action1 _action1; + Action2 _action2; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SequenceManager _sequenceManager; + int _field412; + + Scene2800(); + virtual void synchronize(Serializer &s); + virtual void postInit(SceneObjectList *OwnerList = NULL); + 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 7a3871f9ac..35de45d8e6 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -915,5 +915,129 @@ void SpeakerNej2750::proc15() { _object1.animate(ANIM_MODE_5, this); } } + +SpeakerQuinn2800::SpeakerQuinn2800() { + _speakerName = "QUINN"; + _color1 = 60; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} + +void SpeakerQuinn2800::proc15() { + int v = _fieldF6; + + if (!_object2) { + _object2 = &R2_GLOBALS._player; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + switch (_object2->_visage) { + case 16: + _object1.setZoom(75); + _object1.setup(4023, 5, 1); + break; + case 19: + _object1.setup(4023, 1, 1); + break; + case 3110: + _object1.setZoom(75); + if (_object2->_strip == 1) + _object1.setup(4061 , 1, 1); + else + _object1.setup(4061 , 3, 1); + break; + default: + break; + } + _object1.animate(ANIM_MODE_5, this); + } +} + +SpeakerNej2800::SpeakerNej2800() { + _speakerName = "NEJ"; + _color1 = 171; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} + +void SpeakerNej2800::proc15() { + int v = _fieldF6; + Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; + + if (!_object2) { + _object2 = &scene->_actor2; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(4023, 3, 1); + if (_object2->_visage == 2801) + _object1.setPosition(Common::Point(R2_GLOBALS._player._position.x - 12, R2_GLOBALS._player._position.y)); + _object1.animate(ANIM_MODE_5, this); + } +} + +SpeakerGuard2800::SpeakerGuard2800() { + _speakerName = "GUARD"; + _color1 = 5; + _color2 = 0; + _fieldF6 = 0; + _textWidth = 300; + _hideObjects = false; + _object2 = NULL; + _displayMode = 1; + _numFrames = 0; +} + +void SpeakerGuard2800::proc15() { + int v = _fieldF6; + Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; + + if (!_object2) { + _object2 = &scene->_actor1; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setZoom(75); + _object1.setup(4060, 3, 1); + _object1.animate(ANIM_MODE_5, this); + } +} } // 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 115ad580ce..31eda2431c 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -237,6 +237,30 @@ public: virtual Common::String getClassName() { return "SpeakerNej2750"; } virtual void proc15(); }; + +class SpeakerQuinn2800 : public VisualSpeaker { +public: + SpeakerQuinn2800(); + + virtual Common::String getClassName() { return "SpeakerQuinn2800"; } + virtual void proc15(); +}; + +class SpeakerNej2800 : public VisualSpeaker { +public: + SpeakerNej2800(); + + virtual Common::String getClassName() { return "SpeakerNej2800"; } + virtual void proc15(); +}; + +class SpeakerGuard2800 : public VisualSpeaker { +public: + SpeakerGuard2800(); + + virtual Common::String getClassName() { return "SpeakerGuard2800"; } + virtual void proc15(); +}; } // End of namespace Ringworld2 } // End of namespace TsAGE |