diff options
author | Strangerke | 2012-01-17 22:20:19 +0100 |
---|---|---|
committer | Strangerke | 2012-01-17 22:20:19 +0100 |
commit | 29a063cb12e5400079bbe14a2610c093c35d7e5e (patch) | |
tree | 5b2b840d59be5512d209e3f43dae53f6dec66a7d | |
parent | ce95e1aaadf290097acfc947aa1c4a24903a883b (diff) | |
download | scummvm-rg350-29a063cb12e5400079bbe14a2610c093c35d7e5e.tar.gz scummvm-rg350-29a063cb12e5400079bbe14a2610c093c35d7e5e.tar.bz2 scummvm-rg350-29a063cb12e5400079bbe14a2610c093c35d7e5e.zip |
TSAGE: R2R - Implement scene 1625
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 270 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.h | 29 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 51 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 27 | ||||
-rw-r--r-- | engines/tsage/staticres.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/staticres.h | 2 |
7 files changed, 378 insertions, 5 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 5bd8aa8315..82f52ab558 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -124,6 +124,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Inside wreck return new Scene1580(); case 1625: + // Miranda being questioned + return new Scene1625(); case 1700: case 1750: case 1800: diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 414ae6b644..6f748362df 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -4562,7 +4562,6 @@ void Scene1580::synchronize(Serializer &s) { s.syncAsSint16LE(_field412); } - bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; @@ -4905,5 +4904,274 @@ void Scene1580::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 1625 - Miranda being questioned + * + *--------------------------------------------------------------------------*/ +Scene1625::Scene1625() { + _field412 = 0; +} + +void Scene1625::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field412); +} + +bool Scene1625::Actor7::startAction(CursorType action, Event &event) { + if (action != CURSOR_USE) + return SceneActor::startAction(action, event); + + Scene1625 *scene = (Scene1625 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); + + scene->_sceneMode = 1631; + scene->_actor3.postInit(); + scene->setAction(&scene->_sequenceManager, scene, 1631, &scene->_actor3, &scene->_actor7, NULL); + return true; +} + +void Scene1625::postInit(SceneObjectList *OwnerList) { + loadScene(1625); + R2_GLOBALS._player._characterIndex = R2_MIRANDA; + SceneExt::postInit(); + + _stripManager.addSpeaker(&_mirandaSpeaker); + _stripManager.addSpeaker(&_tealSpeaker); + _stripManager.addSpeaker(&_soldierSpeaker); + + R2_GLOBALS._player.postInit(); + + _actor7.postInit(); + _actor7.setup(1626, 2, 1); + _actor7.setPosition(Common::Point(206, 133)); + _actor7.setDetails(1625, 0, -1, -1, 1, (SceneItem *) NULL); + + _actor5.postInit(); + _actor5.setup(1625, 8, 1); + _actor5.setPosition(Common::Point(190, 131)); + _actor5.setDetails(1625, 6, -1, 2, 1, (SceneItem *) NULL); + + if (R2_GLOBALS._player._oldCharacterScene[3] == 1625) { + if (!R2_GLOBALS.getFlag(83)) { + _actor4.postInit(); + _actor4.setup(1626, 4, 1); + _actor4.setPosition(Common::Point(96, 166)); + _actor4.setDetails(1625, -1, -1, -1, 1, (SceneItem *) NULL); + } + R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player._canWalk = false; + } else { + _actor1.postInit(); + _actor1.fixPriority(10); + + _actor6.postInit(); + + R2_GLOBALS._player.disableControl(); + _sceneMode = 1625; + setAction(&_sequenceManager, this, 1625, &_actor1, &_actor6, NULL); + } + + R2_GLOBALS._sound1.play(245); + _item1.setDetails(Rect(0, 0, 320, 200), 1625, 12, -1, -1, 1, NULL); + R2_GLOBALS._player._oldCharacterScene[3] = 1625; + R2_GLOBALS._player._characterScene[3] = 1625; +} + +void Scene1625::remove() { + R2_GLOBALS._sound1.fadeOut2(NULL); + SceneExt::remove(); +} + +void Scene1625::signal() { + switch (_sceneMode) { + case 10: + R2_GLOBALS._player.disableControl(); + _actor4.postInit(); + _actor4.setDetails(1625, -1, -1, -1, 2, (SceneItem *) NULL); + _sceneMode = 1626; + setAction(&_sequenceManager, this, 1626, &_actor2, &_actor4, NULL); + break; + case 12: + // TODO: check if OK_BTN_STRING is required + MessageDialog::show(DONE_MSG, OK_BTN_STRING); + break; + case 14: + _actor2.postInit(); + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(831, this); + break; + case 99: + R2_GLOBALS._player.disableControl(); + switch (_stripManager._field2E8) { + case 0: + _sceneMode = 1627; + setAction(&_sequenceManager, this, 1627, &_actor3, &_actor4, NULL); + break; + case 1: + _sceneMode = 1629; + setAction(&_sequenceManager, this, 1629, &_actor2, &_actor5, NULL); + break; + case 3: + R2_GLOBALS._player._oldCharacterScene[3] = 3150; + R2_GLOBALS._player._characterScene[3] = 3150; + R2_GLOBALS._player._characterIndex = R2_QUINN; + R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._player._characterScene[1]); + break; + case 4: + _sceneMode = 1628; + _actor2.remove(); + setAction(&_sequenceManager, this, 1628, &_actor3, &_actor4, NULL); + break; + case 5: + _actor4.postInit(); + _actor4.setDetails(1625, -1, -1, -1, 2, (SceneItem *) NULL); + _sceneMode = 1632; + setAction(&_sequenceManager, this, 1632, &_actor4, NULL); + break; + case 6: + _sceneMode = 1633; + setAction(&_sequenceManager, this, 1633, &_actor4, NULL); + break; + case 7: + _sceneMode = 1635; + setAction(&_sequenceManager, this, 1635, &_actor3, &_actor5, NULL); + break; + case 8: + _actor4.postInit(); + _actor4.setDetails(1625, -1, -1, -1, 2, (SceneItem *) NULL); + _sceneMode = 1634; + setAction(&_sequenceManager, this, 1634, &_actor3, &_actor5, NULL); + break; + case 2: + // No break on purpose + default: + _sceneMode = 1630; + _actor2.postInit(); + setAction(&_sequenceManager, this, 1630, &_actor1, &_actor6, NULL); + break; + } + _field412 = _stripManager._field2E8; + _stripManager._field2E8 = 0; + break; + case 1625: + _actor2.postInit(); + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + _sceneMode = 10; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(800, this); + break; + case 1626: + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + _actor2.show(); + + _actor3.postInit(); + _actor3.setup(1627, 3, 1); + _actor3.setPosition(Common::Point(196, 65)); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(832, this); + break; + case 1627: + _actor3.setup(1627, 3, 1); + _actor3.setPosition(Common::Point(196, 65)); + _actor3.show(); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(833, this); + break; + case 1628: + R2_GLOBALS.setFlag(83); + _actor2.postInit(); + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + + _actor3.setup(1627, 3, 1); + _actor3.setPosition(Common::Point(196, 65)); + _actor3.show(); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(834, this); + break; + case 1629: + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + _actor2.show(); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(805, this); + break; + case 1630: + R2_GLOBALS._player.enableControl(CURSOR_USE); + R2_GLOBALS._player._canWalk = true; + break; + case 1631: + _actor3.setup(1627, 3, 1); + _actor3.setPosition(Common::Point(196, 65)); + _actor3.show(); + + _actor7.remove(); + + _actor1.postInit(); + _actor1.fixPriority(10); + + _actor6.postInit(); + warning("_actor6._actorName = \"arm\";"); + + R2_INVENTORY.setObjectScene(40, 3); + _sceneMode = 14; + + setAction(&_sequenceManager, this, 1625, &_actor1, &_actor6, NULL); + break; + case 1632: + _actor2.setup(1627, 1, 1); + _actor2.setPosition(Common::Point(68, 68)); + _actor2.show(); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(835, this); + break; + case 1633: + _actor4.remove(); + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(818, this); + break; + case 1634: + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(836, this); + break; + case 1635: + _actor3.setup(1627, 3, 1); + _actor3.setPosition(Common::Point(196, 65)); + _actor3.show(); + + _sceneMode = 99; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(818, this); + break; + default: + break; + } +} + +void Scene1625::process(Event &event) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) + event.handled = true; + else + Scene::process(event); +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 4a862e91f1..e4ba84cdd9 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -492,6 +492,35 @@ public: virtual void signal(); }; +class Scene1625 : public SceneExt { + class Actor7 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; +public: + int _field412; + SpeakerMiranda1625 _mirandaSpeaker; + SpeakerTeal1625 _tealSpeaker; + SpeakerSoldier1625 _soldierSpeaker; + NamedHotspot _item1; + SceneActor _actor1; + SceneActor _actor2; + SceneActor _actor3; + SceneActor _actor4; + SceneActor _actor5; + SceneActor _actor6; + Actor7 _actor7; + SequenceManager _sequenceManager; + + Scene1625(); + void synchronize(Serializer &s); + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void process(Event &event); +}; + } // 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 b5fd99b0b4..d86429493a 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -486,6 +486,29 @@ void SpeakerMiranda300::proc15() { } } +void SpeakerMiranda1625::proc15() { + int v = _fieldF6; + + if (!_object2) { + Scene1625 *scene = (Scene1625 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_actor3; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(Common::Point(196, 65)); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(1627, 3, 1); + _object1.animate(ANIM_MODE_5, this); + } +} + void SpeakerMiranda3255::proc15() { int v = _fieldF6; @@ -2347,9 +2370,9 @@ void SpeakerSocko3200::proc15() { // Classes related to SOLDIER //---------------------------------------------------------------------------- -SpeakerSoldier300::SpeakerSoldier300(): VisualSpeaker() { +SpeakerSoldier::SpeakerSoldier(int colour) { _speakerName = "SOLDIER"; - _color1 = 60; + _color1 = colour; _color2 = 0; _fieldF6 = 0; _textWidth = 300; @@ -2427,6 +2450,30 @@ void SpeakerTeal300::proc15() { } } +void SpeakerTeal1625::proc15() { + int v = _fieldF6; + + if (!_object2) { + Scene1625 *scene = (Scene1625 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_actor2; + _object2->hide(); + + _object1.postInit(); + _object1.setPosition(Common::Point(68, 68)); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + if (v == 0) { + _object1.animate(ANIM_MODE_2, NULL); + } else { + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(1627, 1, 1); + _object1.animate(ANIM_MODE_5, this); + } +} + void SpeakerTeal3240::proc15() { int v = _fieldF6; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 13c770a4a3..e795981164 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -146,6 +146,12 @@ public: virtual void proc15(); }; +class SpeakerMiranda1625 : public SpeakerMiranda { +public: + virtual Common::String getClassName() { return "SpeakerMiranda1625"; } + virtual void proc15(); +}; + class SpeakerMiranda3255 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3255"; } @@ -477,14 +483,25 @@ public: // Classes related to Soldier -class SpeakerSoldier300 : public VisualSpeaker { +class SpeakerSoldier : public VisualSpeaker { public: - SpeakerSoldier300(); + SpeakerSoldier(int colour); + virtual Common::String getClassName() { return "SpeakerSoldier"; } +}; +class SpeakerSoldier300 : public SpeakerSoldier { +public: + SpeakerSoldier300() : SpeakerSoldier(60) {}; virtual Common::String getClassName() { return "SpeakerSoldier300"; } virtual void proc15(); }; +class SpeakerSoldier1625 : public SpeakerSoldier { +public: + SpeakerSoldier1625() : SpeakerSoldier(5) {}; + virtual Common::String getClassName() { return "SpeakerSoldier1625"; } +}; + // Classes related to Teal class SpeakerTeal : public VisualSpeaker { @@ -505,6 +522,12 @@ public: virtual void proc15(); }; +class SpeakerTeal1625 : public SpeakerTeal { +public: + virtual Common::String getClassName() { return "SpeakerTeal1625"; } + virtual void proc15(); +}; + class SpeakerTeal3240 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal3240"; } diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 543dbe86a9..3aec851b74 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -237,6 +237,8 @@ char const *const F7 = "F7"; char const *const F8 = "F8"; char const *const F10 = "F10"; +char const *const DONE_MSG = "Done"; + const byte k562CC[] = { 20, 7, 41, 6, 3, 6, 42, 11, diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 2a5d5c76ba..4a92f48cf8 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -190,6 +190,8 @@ extern char const *const F7; extern char const *const F8; extern char const *const F10; +extern char const *const DONE_MSG; + // Scene 1550 arrays of constants extern const byte k562CC[]; extern const byte k5A4D6[]; |