diff options
author | Strangerke | 2011-12-30 17:47:04 +0100 |
---|---|---|
committer | Strangerke | 2011-12-30 17:47:04 +0100 |
commit | 3234c3c1f3747f6eff5c55858c1fe02cf06a56f4 (patch) | |
tree | df103327a40b312c865e5cce140a7e3f7001c542 /engines | |
parent | 211eb00e8725e36b8c802a9b7b9b9812e9c3053e (diff) | |
download | scummvm-rg350-3234c3c1f3747f6eff5c55858c1fe02cf06a56f4.tar.gz scummvm-rg350-3234c3c1f3747f6eff5c55858c1fe02cf06a56f4.tar.bz2 scummvm-rg350-3234c3c1f3747f6eff5c55858c1fe02cf06a56f4.zip |
TSAGE: R2R - Implement scene 3395, fix some glitches in scene 3385
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 230 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.h | 42 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 198 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 26 |
5 files changed, 493 insertions, 5 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4952cf1831..537b34b4bb 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -221,7 +221,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 3385: return new Scene3385(); case 3395: - error("Missing scene %d from group 3", sceneNumber); + return new Scene3395(); case 3400: return new Scene3400(); case 3500: diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index db1b9b6c21..61fc6a7796 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2270,11 +2270,12 @@ void Scene3385::Exit1::changeScene() { } void Scene3385::Action1::signal() { + int v = _actionIndex; ++_actionIndex; - - if (_actionIndex == 0) + + if (v == 0) setDelay(1); - else if (_actionIndex == 1) + else if (v == 1) R2_GLOBALS._sound2.play(314); } @@ -2341,7 +2342,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { _actor2._moveDiff = Common::Point(3, 2); _actor2.changeZoom(-1); _actor2._effect = 1; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == 3) _actor2.setup(10, _field11B2, 1); else _actor2.setup(30, _field11B2, 1); @@ -2408,6 +2409,227 @@ void Scene3385::signal() { R2_GLOBALS._player.setStrip(3); else R2_GLOBALS._player.setStrip(4); + R2_GLOBALS._player.enableControl(CURSOR_TALK); + break; + default: + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + } +} + +/*-------------------------------------------------------------------------- + * Scene 3395 - + * + *--------------------------------------------------------------------------*/ +Scene3395::Scene3395() { + _field142E = 0; +} + +void Scene3395::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field142E); +} + +bool Scene3395::Actor1::startAction(CursorType action, Event &event) { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_TALK) + return SceneActor::startAction(action, event); + + scene->_sceneMode = 9999; + if (R2_GLOBALS._player._characterIndex == 2) + scene->_stripManager.start(3302, scene); + else + scene->_stripManager.start(3304, scene); + + return true; +} + +bool Scene3395::Actor2::startAction(CursorType action, Event &event) { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_TALK) + return SceneActor::startAction(action, event); + + scene->_sceneMode = 9999; + if (R2_GLOBALS._player._characterIndex == 3) + scene->_stripManager.start(3302, scene); + else + scene->_stripManager.start(3301, scene); + + return true; +} + +bool Scene3395::Actor3::startAction(CursorType action, Event &event) { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_TALK) + return SceneActor::startAction(action, event); + + scene->_sceneMode = 9999; + scene->_stripManager.start(3303, scene); + + return true; +} + +bool Scene3395::Actor4::startAction(CursorType action, Event &event) { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + if (action != CURSOR_USE) + return SceneActor::startAction(action, event); + + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._sound2.play(314); + + scene->_sceneMode = 3396; + scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + + return true; +} + +void Scene3395::Action1::signal() { + int v = _actionIndex; + ++_actionIndex; + + if (v == 0) + setDelay(2); + else if (v == 1) + R2_GLOBALS._sound2.play(314); +} + +void Scene3395::postInit(SceneObjectList *OwnerList) { + loadScene(3395); + SceneExt::postInit(); + + R2_GLOBALS._sound1.play(313); + + _stripManager.setColors(60, 255); + _stripManager.setFontNumber(3); + _stripManager.addSpeaker(&_quinnSpeaker); + _stripManager.addSpeaker(&_seekerSpeaker); + _stripManager.addSpeaker(&_mirandaSpeaker); + _stripManager.addSpeaker(&_webbsterSpeaker); + + R2_GLOBALS._player._characterScene[1] = 3395; + R2_GLOBALS._player._characterScene[2] = 3395; + R2_GLOBALS._player._characterScene[3] = 3395; + + if (R2_GLOBALS._sceneManager._previousScene == 3385) + _field142E = 3; + else + _field142E = 4; + + setZoomPercents(51, 40, 200, 137); + R2_GLOBALS._player.postInit(); + + if (R2_GLOBALS._player._characterIndex == 2) + R2_GLOBALS._player._moveDiff = Common::Point(5, 3); + else + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + + R2_GLOBALS._player.changeZoom(-1); + + if (R2_GLOBALS._player._characterIndex == 2) + R2_GLOBALS._player.setup(20, _field142E, 1); + else if (R2_GLOBALS._player._characterIndex == 3) + R2_GLOBALS._player.setup(30, _field142E, 1); + else + R2_GLOBALS._player.setup(10, _field142E, 1); + + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.disableControl(); + + _actor1.postInit(); + if (R2_GLOBALS._player._characterIndex == 2) { + _actor1._moveRate = 10; + _actor1._moveDiff = Common::Point(3, 2); + } else { + _actor1._moveRate = 7; + _actor1._moveDiff = Common::Point(5, 3); + } + _actor1.changeZoom(-1); + _actor1._effect = 1; + if (R2_GLOBALS._player._characterIndex == 2) + _actor1.setup(10, _field142E, 1); + else + _actor1.setup(20, _field142E, 1); + _actor1.animate(ANIM_MODE_1, NULL); + _actor1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _actor2.postInit(); + _actor2._moveDiff = Common::Point(3, 2); + _actor2.changeZoom(-1); + _actor2._effect = 1; + if (R2_GLOBALS._player._characterIndex == 3) + _actor2.setup(10, _field142E, 1); + else + _actor2.setup(30, _field142E, 1); + _actor2.animate(ANIM_MODE_1, NULL); + _actor2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _actor3.postInit(); + _actor3._moveDiff = Common::Point(3, 2); + _actor3.changeZoom(-1); + _actor3._effect = 1; + _actor3.setup(40, _field142E, 1); + _actor3.animate(ANIM_MODE_1, NULL); + _actor3.setDetails(3385, 18, -1, -1, 1, (SceneItem *) NULL); + + _actor4.postInit(); + _actor4.setPosition(Common::Point(159, 50)); + _actor4.fixPriority(40); + _actor4.setDetails(3395, 6, 7, -1, 1, (SceneItem *) NULL); + + if (R2_GLOBALS._sceneManager._previousScene == 3385) { + R2_GLOBALS._player.setPosition(Common::Point(158, 53)); + _actor1.setPosition(Common::Point(164, 51)); + _actor1.fixPriority(48); + _actor2.setPosition(Common::Point(150, 51)); + _actor2.fixPriority(47); + _actor3.setPosition(Common::Point(158, 51)); + _actor3.fixPriority(46); + _sceneMode = 3394; + _actor4.setup(3395, 1, 7); + _actor4.animate(ANIM_MODE_6, this); + setAction(&_action1, &_actor4); + } else { + R2_GLOBALS._player.setPosition(Common::Point(158, 200)); + _actor1.setPosition(Common::Point(191, 255)); + _actor2.setPosition(Common::Point(124, 240)); + _actor3.setPosition(Common::Point(155, 242)); + _actor4.setup(3395, 1, 1); + + R2_GLOBALS._walkRegions.enableRegion(1); + + _sceneMode = 3395; + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + } + + for (int i = 0; i <= 12; i++) { + _itemArray[i].setDetails(i, 3995, 0, -1, -1); + } + + _item1.setDetails(Rect(0, 0, 320, 200), 3395, 3, -1, -1, 1, NULL); +} + +void Scene3395::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene3395::signal() { + switch (_sceneMode) { + case 3396: + R2_GLOBALS._sceneManager.changeScene(3385); + break; + case 9999: + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._player.setStrip(3); + else + R2_GLOBALS._player.setStrip(4); + R2_GLOBALS._player.enableControl(CURSOR_TALK); break; default: R2_GLOBALS._player.enableControl(CURSOR_ARROW); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 812ab800cc..4b336b2dde 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -504,6 +504,48 @@ public: virtual void synchronize(Serializer &s); }; +class Scene3395 : public SceneExt { + class Actor1 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor2 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor3 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + class Actor4 : public SceneActor { + virtual bool startAction(CursorType action, Event &event); + }; + + class Action1: public Action { + public: + virtual void signal(); + }; + +public: + SpeakerQuinn3395 _quinnSpeaker; + SpeakerSeeker3395 _seekerSpeaker; + SpeakerMiranda3395 _mirandaSpeaker; + SpeakerWebbster3395 _webbsterSpeaker; + NamedHotspot _item1; + NamedHotspot _itemArray[13]; + Actor1 _actor1; + Actor2 _actor2; + Actor3 _actor3; + Actor4 _actor4; + Action1 _action1; + SequenceManager _sequenceManager; + + int _field142E; + + Scene3395(); + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void synchronize(Serializer &s); +}; + class Scene3400 : public SceneExt { public: SpeakerQuinn3400 _quinnSpeaker; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 7f5cdc1328..ab5868a409 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -547,6 +547,56 @@ void SpeakerMiranda3385::proc15() { } } +void SpeakerMiranda3395::proc15() { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + int v = _fieldF6; + + if (!_object2) { + if (R2_GLOBALS._player._characterIndex == 3) + _object2 = &R2_GLOBALS._player; + else + _object2 = &scene->_actor2; + + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 7; + _object1._effect = 1; + _object1.changeZoom(-1); + + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._player.setStrip(4); + else + R2_GLOBALS._player.setStrip(3); + + R2_GLOBALS._player.disableControl(CURSOR_TALK); + + if (R2_GLOBALS._player._mover) + R2_GLOBALS._player.addMover(NULL); + + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(4051, 5, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerMiranda3400::proc15() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; @@ -1173,6 +1223,61 @@ void SpeakerQuinn3385::proc15() { } } +void SpeakerQuinn3395::proc15() { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + int v = _fieldF6; + + if (!_object2) { + if (R2_GLOBALS._player._characterIndex == 1) + _object2 = &R2_GLOBALS._player; + else if (R2_GLOBALS._player._characterIndex == 2) + _object2 = &scene->_actor1; + else + _object2 = &scene->_actor2; + + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 7; + _object1._effect = 1; + _object1.changeZoom(-1); + + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._player.setStrip(4); + else + R2_GLOBALS._player.setStrip(3); + + if (R2_GLOBALS._player._mover) + R2_GLOBALS._player.addMover(NULL); + + R2_GLOBALS._player.disableControl(CURSOR_TALK); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + if (R2_GLOBALS._player._characterIndex == 2) + _object1.setup(4010, 3, 1); + else + _object1.setup(4010, 5, 1); + + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerQuinn3400::proc15() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; @@ -1647,6 +1752,55 @@ void SpeakerSeeker3385::proc15() { } } +void SpeakerSeeker3395::proc15() { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + int v = _fieldF6; + + if (!_object2) { + if (R2_GLOBALS._player._characterIndex == 2) + _object2 = &R2_GLOBALS._player; + else + _object2 = &scene->_actor1; + + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 7; + _object1._effect = 1; + _object1.changeZoom(-1); + + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._player.setStrip(4); + else + R2_GLOBALS._player.setStrip(3); + + if (R2_GLOBALS._player._mover) + R2_GLOBALS._player.addMover(NULL); + + R2_GLOBALS._player.disableControl(CURSOR_TALK); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(4031, 3, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerSeeker3400::proc15() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; @@ -2160,6 +2314,50 @@ void SpeakerWebbster3385::proc15() { } } +void SpeakerWebbster3395::proc15() { + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + + int v = _fieldF6; + + if (!_object2) { + _object2 = &scene->_actor3; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 7; + _object1._effect = 1; + _object1.changeZoom(-1); + + if (R2_GLOBALS._sceneManager._previousScene == 3385) + R2_GLOBALS._player.setStrip(4); + else + R2_GLOBALS._player.setStrip(3); + + if (R2_GLOBALS._player._mover) + R2_GLOBALS._player.addMover(NULL); + + R2_GLOBALS._player.disableControl(CURSOR_TALK); + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(4110, 5, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerWebbster3400::proc15() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 3020b19431..3a58917c44 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -154,6 +154,12 @@ public: virtual void proc15(); }; +class SpeakerMiranda3395 : public SpeakerMiranda { +public: + virtual Common::String getClassName() { return "SpeakerMiranda3395"; } + virtual void proc15(); +}; + class SpeakerMiranda3400 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3400"; } @@ -279,6 +285,12 @@ public: virtual void proc15(); }; +class SpeakerQuinn3395 : public SpeakerQuinn { +public: + virtual Common::String getClassName() { return "SpeakerQuinn3395"; } + virtual void proc15(); +}; + class SpeakerQuinn3400 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3400"; } @@ -375,6 +387,12 @@ public: virtual void proc15(); }; +class SpeakerSeeker3395 : public SpeakerSeeker { +public: + virtual Common::String getClassName() { return "SpeakerSeeker3395"; } + virtual void proc15(); +}; + class SpeakerSeeker3400 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3400"; } @@ -491,6 +509,14 @@ public: virtual void proc15(); }; +class SpeakerWebbster3395 : public SpeakerWebbster { +public: + SpeakerWebbster3395() : SpeakerWebbster(60) {}; + + virtual Common::String getClassName() { return "SpeakerWebbster3395"; } + virtual void proc15(); +}; + class SpeakerWebbster3400 : public SpeakerWebbster { public: SpeakerWebbster3400() : SpeakerWebbster(27) {}; |