diff options
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/core.cpp | 42 | ||||
-rw-r--r-- | engines/tsage/core.h | 44 | ||||
-rw-r--r-- | engines/tsage/detection_tables.h | 15 | ||||
-rw-r--r-- | engines/tsage/module.mk | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld_logic.cpp | 172 | ||||
-rw-r--r-- | engines/tsage/ringworld_logic.h | 75 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.cpp | 894 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.h | 248 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes8.cpp | 2509 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes8.h | 475 |
10 files changed, 4467 insertions, 9 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index d3bbe582bd..06df34ee20 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1566,6 +1566,39 @@ void SceneHotspot::doAction(int action) { /*--------------------------------------------------------------------------*/ +void SceneHotspot_3::doAction(int action) { + switch (action) { + case CURSOR_WALK: + // Nothing + break; + case CURSOR_LOOK: + if (_field28 == -1) + SceneHotspot::doAction(action); + else + SceneItem::display(_field26, _field28, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (_field2A == -1) + SceneHotspot::doAction(action); + else + SceneItem::display(_field26, _field2A, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void SceneHotspot_3::quickInit(const int ys, const int xe, const int ye, const int xs, const int val26, const int val28, const int val2A) { + setBounds(ys, xe, ye, xs); + _field26 = val26; + _field28 = val28; + _field2A = val2A; + _globals->_sceneItems.addItems(this, NULL); +} + +/*--------------------------------------------------------------------------*/ + void SceneObjectWrapper::setSceneObject(SceneObject *so) { _sceneObject = so; so->_strip = 1; @@ -2206,6 +2239,15 @@ void SceneObject::updateScreen() { } } +void SceneObject::quickInit(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority) { + postInit(); + setVisage(visage); + setStrip(stripFrameNum); + setFrame(frameNum); + setPosition(Common::Point(posX, posY), 0); + setPriority2(priority); +} + /*--------------------------------------------------------------------------*/ void SceneObjectList::draw() { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index b798a25b74..d55eacb911 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -413,6 +413,7 @@ public: bool contains(const Common::Point &pt); void setBounds(const Rect &newBounds) { _bounds = newBounds; } + void setBounds(const int ys, const int xe, const int ye, const int xs) { _bounds = Rect(MIN(xs, xe), MIN(ys, ye), MAX(xs, xe), MAX(ys, ye)); } static void display(int resNum, int lineNum, ...); static void display2(int resNum, int lineNum) { display(resNum, lineNum, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); @@ -438,6 +439,24 @@ public: virtual void doAction(int action); }; +class SceneHotspot_2: public SceneHotspot { +public: + int _field26, _field28; + SceneHotspot_2(): SceneHotspot() {} + + virtual Common::String getClassName() { return "SceneHotspot_2"; } +}; + +class SceneHotspot_3: public SceneHotspot_2 { +public: + int _field2A; + SceneHotspot_3(): SceneHotspot_2() {} + + void quickInit(const int ys, const int xe, const int ye, const int xs, const int val26, const int val28, const int val2A); + virtual void doAction(int action); + virtual Common::String getClassName() { return "SceneHotspot_3"; } +}; + enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MODE_3 = 3, ANIM_MODE_4 = 4, ANIM_MODE_5 = 5, ANIM_MODE_6 = 6, ANIM_MODE_7 = 7, ANIM_MODE_8 = 8}; @@ -558,6 +577,7 @@ public: virtual void draw(); virtual void proc19() {} virtual void updateScreen(); + void quickInit(int visage, int stripFrameNum, int frameNum, int posX, int posY, int priority); }; class SceneObjectExt: public SceneObject { @@ -571,6 +591,30 @@ public: virtual Common::String getClassName() { return "SceneObjectExt"; } }; +class SceneObject3: public SceneObjectExt { +public: + int _field88, _field8A; + + virtual void synchronise(Serialiser &s) { + SceneObject::synchronise(s); + s.syncAsSint16LE(_field88); + s.syncAsSint16LE(_field8A); + } + virtual Common::String getClassName() { return "SceneObject3"; } +}; + +class SceneObject4: public SceneObject { +public: + int _field88, _field8A; + + virtual void synchronise(Serialiser &s) { + SceneObject::synchronise(s); + s.syncAsSint16LE(_field88); + s.syncAsSint16LE(_field8A); + } + virtual Common::String getClassName() { return "SceneObject4"; } +}; + class SceneText: public SceneObject { public: int _fontNumber; diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index eac11c3e07..429d6aecdb 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -41,7 +41,20 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_CD }, - + // Ringworld First Wave English CD version + { + { + "ring", + "CD", + AD_ENTRY1s("ring.rlb", "0a25b4ee58d44a54425c0b47e5096bbc", 37847618), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_Ringworld, + GF_CD + }, // Ringworld English Floppy version { { diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk index a3a756ae9b..a15b342319 100644 --- a/engines/tsage/module.mk +++ b/engines/tsage/module.mk @@ -17,6 +17,8 @@ MODULE_OBJS := \ ringworld_scenes4.o \ ringworld_scenes5.o \ ringworld_scenes6.o \ + ringworld_scenes8.o \ + ringworld_scenes10.o \ saveload.o \ scenes.o \ sound.o \ diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index a9a3463f12..8a174a4822 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -33,6 +33,8 @@ #include "tsage/ringworld_scenes4.h" #include "tsage/ringworld_scenes5.h" #include "tsage/ringworld_scenes6.h" +#include "tsage/ringworld_scenes8.h" +#include "tsage/ringworld_scenes10.h" namespace tSage { @@ -137,8 +139,27 @@ Scene *SceneFactory::createScene(int sceneNumber) { case 5200: return new Scene5200(); /* Scene group 8 */ + // Scene 7000: Landing + case 7000: return new Scene7000(); + // Scene 7100: swimming under water + case 7100: return new Scene7100(); + // Scene 7200: Entering the underwater cave + case 7200: return new Scene7200(); + // Scene 7300: Discussion with Lord Poria + case 7300: return new Scene7300(); + case 7600: return new Scene7600(); + case 7700: return new Scene7700(); /* Scene group 10 */ + case 9100: return new Scene9100(); + case 9150: return new Scene9150(); + case 9200: return new Scene9200(); + case 9300: return new Scene9300(); + case 9350: return new Scene9350(); + case 9360: return new Scene9360(); + case 9700: return new Scene9700(); + case 9750: return new Scene9750(); + case 9999: return new Scene9999(); default: error("Unknown scene number - %d", sceneNumber); @@ -314,6 +335,55 @@ void SpeakerGText::removeText() { /*--------------------------------------------------------------------------*/ + +SpeakerPOR::SpeakerPOR() { + _speakerName = "POR"; + _newSceneNumber = 7221; + _textPos = Common::Point(10, 30); + _colour1 = 41; +} + +void SpeakerPOR::SpeakerAction1::signal(){ + switch (_actionIndex++) { + case 0: + setDelay(_globals->_randomSource.getRandomNumber(60) + 60); + break; + case 1: + static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_5, this, NULL); + break; + case 2: + setDelay(_globals->_randomSource.getRandomNumber(10)); + _actionIndex = 0; + break; + default: + break; + } +} + +void SpeakerPOR::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(7223); + _object1.setStrip2(2); + _object1.setPosition(Common::Point(191, 166), 0); + _object1.animate(ANIM_MODE_7, 0, 0); + + _object2.postInit(&_objectList); + _object2.setVisage(7223); + _object2.setPosition(Common::Point(159, 86), 0); + _object2.setAction(&_speakerAction, 0); + + _object3.postInit(&_objectList); + _object3.setVisage(7223); + _object3.setStrip(3); + _object3.setPosition(Common::Point(119, 107), 0); + _object3.setPriority2(199); + _object3.setAction(&_action2); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + SpeakerOText::SpeakerOText(): SpeakerGText() { _speakerName = "OTEXT"; _textWidth = 240; @@ -345,6 +415,16 @@ SpeakerSText::SpeakerSText(): ScreenSpeaker() { /*--------------------------------------------------------------------------*/ +SpeakerPOText::SpeakerPOText(): ScreenSpeaker() { + _speakerName = "POTEXT"; + _textWidth = 240; + _textMode = ALIGN_CENTRE; + _colour1 = 41; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + SpeakerMText::SpeakerMText() { _speakerName = "MTEXT"; _colour1 = 11; @@ -365,6 +445,25 @@ SpeakerCText::SpeakerCText() { /*--------------------------------------------------------------------------*/ +SpeakerEText::SpeakerEText() { + _speakerName = "ETEXT"; + _textPos = Common::Point(20, 20); + _colour1 = 22; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + +SpeakerGR::SpeakerGR() { + _speakerName = "GR"; + _newSceneNumber = 9220; + _textWidth = 136; + _textPos = Common::Point(168, 36); + _colour1 = 14; +} + +/*--------------------------------------------------------------------------*/ + SpeakerHText::SpeakerHText() { _speakerName = "HTEXT"; _textPos = Common::Point(160, 40); @@ -374,6 +473,16 @@ SpeakerHText::SpeakerHText() { /*--------------------------------------------------------------------------*/ +SpeakerSKText::SpeakerSKText(): ScreenSpeaker() { + _speakerName = "SKTEXT"; + _textWidth = 240; + _textMode = ALIGN_CENTRE; + _colour1 = 5; + _hideObjects = false; +} + +/*--------------------------------------------------------------------------*/ + SpeakerPText::SpeakerPText() { _speakerName = "PTEXT"; _textWidth = 240; @@ -423,6 +532,37 @@ SpeakerBatText::SpeakerBatText() { /*--------------------------------------------------------------------------*/ +SpeakerSKL::SpeakerSKL(): AnimatedSpeaker() { + _speakerName = "SKL"; + _newSceneNumber = 7011; + _textPos = Common::Point(10, 30); + _colour1 = 10; +} + +void SpeakerSKL::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(7013); + _object1.setStrip2(2); + _object1._frame = 1; + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1.setPosition(Common::Point(203, 120)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + _object2.postInit(&_objectList); + _object2.setVisage(7013); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(197, 80)); + _object2.setAction(&_speakerAction, NULL); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + SpeakerQL::SpeakerQL(): AnimatedSpeaker() { _speakerName = "QL"; _newSceneNumber = 2610; @@ -560,6 +700,38 @@ void SpeakerQR::setText(const Common::String &msg) { /*--------------------------------------------------------------------------*/ +SpeakerQU::SpeakerQU() { + _speakerName = "QU"; + _newSceneNumber = 7020; + _textPos = Common::Point(160, 30); + _colour1 = 35; + _textMode = ALIGN_CENTRE; +} + +void SpeakerQU::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(7021); + _object1.setStrip2(2); + _object1.setPriority2(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(116, 120), 0); + _object1.animate(ANIM_MODE_7, 0, 0); + + _object2.postInit(&_objectList); + _object2.setVisage(7021); + _object2.setStrip2(1); + _object2.setPriority2(255); + _object2.changeZoom(100); + _object2._frame = 1; + _object2.setPosition(Common::Point(111, 84), 0); + _object2.setAction(&_speakerAction, 0); + + Speaker::setText(msg); +} + +/*--------------------------------------------------------------------------*/ + SpeakerCR::SpeakerCR() { _speakerName = "CR"; _newSceneNumber = 9010; diff --git a/engines/tsage/ringworld_logic.h b/engines/tsage/ringworld_logic.h index 31d8f5e1a3..047c6220d5 100644 --- a/engines/tsage/ringworld_logic.h +++ b/engines/tsage/ringworld_logic.h @@ -116,6 +116,21 @@ public: virtual void removeText(); }; +class SpeakerPOR: public AnimatedSpeaker { + class SpeakerAction1: public SpeakerAction { + public: + virtual void signal(); + }; + +public: + SceneObject _object3; + SpeakerAction1 _action2; +public: + SpeakerPOR(); + virtual Common::String getClassName() { return "SpeakerPOR"; } + virtual void setText(const Common::String &msg); +}; + class SpeakerOText: public SpeakerGText { public: SpeakerOText(); @@ -123,6 +138,13 @@ public: virtual Common::String getClassName() { return "SpeakerOText"; } }; +class SpeakerPOText: public ScreenSpeaker { +public: + SpeakerPOText(); + + virtual Common::String getClassName() { return "SpeakerPOText"; } +}; + class SpeakerSText: public ScreenSpeaker { public: SpeakerSText(); @@ -151,6 +173,20 @@ public: virtual Common::String getClassName() { return "SpeakerCText"; } }; +class SpeakerEText: public ScreenSpeaker { +public: + SpeakerEText(); + + virtual Common::String getClassName() { return "SpeakerEText"; } +}; + +class SpeakerGR: public AnimatedSpeaker { +public: + SpeakerGR(); + + virtual Common::String getClassName() { return "SpeakerGR"; } +}; + class SpeakerHText: public ScreenSpeaker { public: SpeakerHText(); @@ -172,6 +208,13 @@ public: virtual Common::String getClassName() { return "SpeakerCHFText"; } }; +class SpeakerSKText: public ScreenSpeaker { +public: + SpeakerSKText(); + + virtual Common::String getClassName() { return "SpeakerSKText"; } +}; + class SpeakerCDRText: public ScreenSpeaker { public: SpeakerCDRText(); @@ -193,6 +236,30 @@ public: virtual Common::String getClassName() { return "SpeakerFLText"; } }; +class SpeakerQR: public AnimatedSpeaker { +public: + SpeakerQR(); + + virtual Common::String getClassName() { return "SpeakerQR"; } + virtual void setText(const Common::String &msg); +}; + +class SpeakerQU: public AnimatedSpeaker { +public: + SpeakerQU(); + + virtual Common::String getClassName() { return "SpeakerQU"; } + virtual void setText(const Common::String &msg); +}; + +class SpeakerSKL: public AnimatedSpeaker { +public: + SpeakerSKL(); + + virtual Common::String getClassName() { return "SpeakerQL"; } + virtual void setText(const Common::String &msg); +}; + class SpeakerQL: public AnimatedSpeaker { public: SpeakerQL(); @@ -219,14 +286,6 @@ public: virtual void setText(const Common::String &msg); }; -class SpeakerQR: public AnimatedSpeaker { -public: - SpeakerQR(); - - virtual Common::String getClassName() { return "SpeakerQR"; } - virtual void setText(const Common::String &msg); -}; - class SpeakerCR: public AnimatedSpeaker { public: SpeakerCR(); diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp new file mode 100644 index 0000000000..bebf199a2d --- /dev/null +++ b/engines/tsage/ringworld_scenes10.cpp @@ -0,0 +1,894 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.cpp $ + * $Id: scene_logic.cpp 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#include "graphics/cursorman.h" +#include "tsage/ringworld_scenes10.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" + +namespace tSage { + +Scene2::Scene2() { + Scene::Scene(); + _sceneState = 0; +} + +void Object9350::postInit(SceneObjectList *OwnerList) { + warning("Object9350::postInit - Weird cast to be verified"); + _globals->_sceneManager.postInit((SceneObjectList*) &_globals->_sceneManager._sceneChangeListeners); +} + +void Object9350::draw() { + warning("Scene9350::Object1::draw - TODO"); +} + +/*-------------------------------------------------------------------------- + * Scene 9100 + * + *--------------------------------------------------------------------------*/ +void Scene9100::SceneHotspot1::doAction(int action) { + Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + + if (action == CURSOR_TALK) { + if (_globals->getFlag(23)) { + _globals->_player.disableControl(); + scene->_sceneMode = 9104; + } else { + _globals->setFlag(23); + _globals->_player.disableControl(); + scene->_sceneMode = 9105; + } + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, 0); + } else { + SceneHotspot_3::doAction(action); + } +} + +void Scene9100::dispatch() { + Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + + if (!_action) { + if (_globals->_player._position.x < 25) { + warning("There"); + if (!_globals->getFlag(11)) { + scene->_sceneMode = 9106; + } else { + scene->_sceneMode = 9108; + _globals->setFlag(11); + } + } else { + scene->_sceneMode = 9106; + } + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, 0); + } else { + Scene::dispatch(); + } +} + +void Scene9100::signal() { + Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + + switch (scene->_sceneMode) { + case 9102: + case 9106: + case 9108: + _globals->_sceneManager.changeScene(9150); + break; + case 9105: + _sceneHotspot1.remove(); + // No break on purpose + case 9103: + case 9104: + case 9107: + case 9109: + default: + _globals->_player.enableControl(); + break; + } +} + +void Scene9100::postInit(SceneObjectList *OwnerList) { + Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; + + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + _object1.postInit(); + _object1.setVisage(9100); + _object1._strip = 1; + _object1._numFrames = 6; + _object1.setPosition(Common::Point(297, 132), 0); + _object1.animate(ANIM_MODE_2, 0); + _object1.setPriority2(10); + + _globals->_player.postInit(); + + _object2.postInit(); + _object2.flag100(); + + _object3.postInit(); + _object3.flag100(); + + _object4.postInit(); + _object4.flag100(); + + _object5.postInit(); + _object5.flag100(); + + if (!_globals->getFlag(23)) { + _object6.postInit(); + _object6.setVisage(9111); + _object6.setStrip(6); + _object6.setFrame(1); + _object6.setPosition(Common::Point(138, 166), 0); + _sceneHotspot3.quickInit(145, 125, 166, 156, 9100, 40, 43); + } + _sceneHotspot1.quickInit(140, 176, 185, 215, 9100, 36, 37); + _sceneHotspot2.quickInit(161, 138, 182, 175, 9100, 38, 39); + _sceneHotspot4.quickInit(37, 196, 47, 320, 9100, 44, -1); + _sceneHotspot5.quickInit(69, 36, 121, 272, 9100, 45, 46); + _sceneHotspot6.quickInit(127, 0, 200, 52, 9100, 47, 48); + + _globals->_soundHandler.startSound(251, 0, 127); + if (_globals->_sceneManager._previousScene == 9150) { + if (_globals->getFlag(20)) { + _globals->_player.disableControl(); + if (_globals->getFlag(11)) + _sceneMode = 9107; + else + _sceneMode = 9109; + setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object5, 0); + } else { + _sceneMode = 9103; + _globals->_player.disableControl(); + setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0); + _globals->setFlag(20); + } + } else { + _sceneMode = 9102; + _globals->_player.disableControl(); + setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0); + } +} + +/*-------------------------------------------------------------------------- + * Scene 9150 + * + *--------------------------------------------------------------------------*/ +void Scene9150::Object3::signal() { + switch (_field8A++) { + case 0: + _field88 = 10 + _globals->_randomSource.getRandomNumber(90); + break; + default: + animate(ANIM_MODE_5, this); + _field88 = 0; + break; + } +} + +void Scene9150::Object3::dispatch() { + SceneObject::dispatch(); + if ((_field88 != 0) && (--_field88 == 0)) + signal(); +} + +void Scene9150::signal() { + switch (_sceneMode) { + case 9151: + case 9157: + _globals->_sceneManager.changeScene(9100); + break; + case 9153: + _globals->_sceneManager.changeScene(9300); + break; + case 9152: + case 9155: + case 9156: + _globals->_player.enableControl(); + break; + case 9154: + default: + break; + } +} + +void Scene9150::dispatch() { + + if ((_sceneState != 0) && (_sceneBounds.left == 0)) { + _object3._field88 = 0; + _sceneState = 0; + _sceneHotspot3.setAction(&_sequenceManager2, 0, 9154, &_object3, 0); + _sceneHotspot10.remove(); + } + + if (_action) { + _action->dispatch(); + } else { + if (_globals->_player._position.x >= 160) { + if (_globals->_player._position.x > 630) { + _globals->_player.disableControl(); + _sceneMode = 9157; + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + } + } else { + _globals->_player.disableControl(); + if (_globals->getFlag(11)) { + _globals->_soundHandler.startSound(286, 0, 127); + _sceneMode = 9153; + } else { + _sceneMode = 9156; + } + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + } + } +} + +void Scene9150::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + _globals->_player.postInit(); + + _object3.postInit(); + _sceneState = 1; + _object3.setVisage(9151); + _object3._strip = 1; + _object3._frame = 1; + _object3.setPosition(Common::Point(312, 95), 0); + _object3.signal(); + + _sceneHotspot1.quickInit(0, 0, 200, 94, 9150, 46, -1); + _sceneHotspot2.quickInit(51, 90, 118, 230, 9150, 47, -1); + _sceneHotspot3.quickInit(182, 104, 200, 320, 9150, 48, 49); + _sceneHotspot4.quickInit(103, 292, 152, 314, 9150, 50, 51); + _sceneHotspot5.quickInit(115, 350, 160, 374, 9150, 52, 53); + _sceneHotspot6.quickInit(0, 471, 200, 531, 9150, 54, 55); + _sceneHotspot7.quickInit(170, 320, 185, 640, 9150, 56, -1); + _sceneHotspot9.quickInit(157, 107, 186, 320, 9150, 56, -1); + _sceneHotspot8.quickInit(133, 584, 142, 640, 9150, 57, -1); + _sceneHotspot10.quickInit(83, 304, 103, 323, 9150, 58, 59); + + _globals->_soundHandler.startSound(285, 0, 127); + _globals->_player.disableControl(); + + if (_globals->getFlag(20)) { + // Walking alone + _globals->_scrollFollower = &_globals->_player; + if (_globals->getFlag(11)) + // Hero wearing peasan suit + _sceneMode = 9155; + else + // Hero wearing Purple suit + _sceneMode = 9152; + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + } else { + // Walking with the tiger + _sceneMode = 9151; + _object2.postInit(); + _object2.flag100(); + _object1.postInit(); + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, &_object1, &_object2, 0); + } +} + +/*-------------------------------------------------------------------------- + * Scene 9200 + * + *--------------------------------------------------------------------------*/ +void Scene9200::SceneHotspot1::doAction(int action) { + Scene9200 *scene = (Scene9200 *)_globals->_sceneManager._scene; + + if (action == OBJECT_TUNIC) { + _globals->_player.disableControl(); + if (_globals->getFlag(93)) { + scene->_sceneState = 9214; + setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + } else { + _globals->setFlag(93); + scene->_sceneState = 9213; + setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0); + } + } else if (action <= 100) { + _globals->_player.disableControl(); + scene->_sceneState = 9214; + setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + } else { + SceneHotspot_3::doAction(action); + } +} + +void Scene9200::signal() { + switch (_sceneState++) { + case 9207: + _globals->_sceneManager.changeScene(9700); + break; + case 9208: + case 9211: + case 9212: + _globals->_sceneManager.changeScene(9500); + break; + case 9209: + _globals->_sceneManager.changeScene(9360); + break; + case 9210: + _hotspot1.remove(); + // No break on purpose + case 9201: + case 9202: + case 9203: + case 9204: + case 9205: + case 9206: + default: + _globals->_player.enableControl(); + break; + } +} + +void Scene9200::process(Event &event) { + Scene::process(event); +} + +void Scene9200::dispatch() { +// Rect rect9200 = Rect(320, 175, 250, 154); + Rect rect9200 = Rect(250, 154, 320, 175); + + if (_action) { + _action->dispatch(); + } else { + if ( (_globals->_player._position.x <= 0) || ((_globals->_player._position.x < 100) && (_globals->_player._position.y > 199))) { + _globals->_player.disableControl(); + _sceneState = 9209; + setAction(&_sequenceManager, this, 9209, &_globals->_player, &_object2, &_object3, 0); + } else { + if (rect9200.contains(_globals->_player._position)) { + if (_globals->getFlag(93)) { + if (_globals->getFlag(86)) { + _sceneState = 9215; + setAction(&_sequenceManager, this, 9215, &_globals->_player, &_object2, &_object3, 0); + } else { + _sceneState = 9208; + setAction(&_sequenceManager, this, 9208, &_globals->_player, &_object2, &_object3, 0); + } + } else { + _globals->_player.disableControl(); + _sceneState = 9204; + setAction(&_sequenceManager, this, 9204, &_globals->_player, &_object2, &_object3, 0); + } + } else { + if (_globals->_player._position.y < 140) { + _globals->_player.disableControl(); + _sceneState = 9207; + setAction(&_sequenceManager, this, 9207, &_globals->_player, &_object2, &_object3, 0); + } + } + } + } +} + +void Scene9200::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(130, 50, 200, 150); + + _globals->_player.postInit(); + _object3.postInit(); + _object3.flag100(); + _object1.postInit(); + // Water animation + _object1.setVisage(9200); + _object1._strip = 3; + _object1.animate(ANIM_MODE_2, 0); + _object1.setPosition(Common::Point(132, 114), 0); + _object1.setPriority2(140); + _soundHandler.startSound(297, 0, 127); + _stripManager.addSpeaker(&_speakerQText); + _stripManager.addSpeaker(&_speakerGR); + _stripManager.addSpeaker(&_speakerGText); + + if (!_globals->getFlag(86)) { + _object2.postInit(); + _hotspot1.quickInit(96, 194, 160, 234, 9200, 29, 31); + } + _hotspot2.quickInit(164, 0, 200, 282, 9200, 0, 1); + _hotspot3.quickInit(140, 39, 165, 153, 9200, 2, 3); + _hotspot4.quickInit(92, 122, 139, 152, 9200, 4, 5); + _hotspot5.quickInit(33, 20, 142, 115, 9200, 6, 7); + _hotspot6.quickInit(104, 235, 153, 265, 9200, 8, 9); + _hotspot7.quickInit(107, 262, 153, 286, 9200, 10, 11); + _hotspot8.quickInit(69, 276, 164, 320, 9200, 12, 13); + + _globals->_events.setCursor(CURSOR_WALK); + _globals->_player.disableControl(); + + switch (_globals->_sceneManager._previousScene) { + case 9500: + if (_globals->getFlag(85)) { + if (_globals->_inventory._helmet._sceneNumber == 1) { + _globals->setFlag(86); + _sceneState = 9210; + setAction(&_sequenceManager, this, 9210, &_globals->_player, &_object2, &_object3, 0); + } else { + _sceneState = 9212; + setAction(&_sequenceManager, this, 9212, &_globals->_player, &_object2, &_object3, 0); + } + } else { + if (_globals->_inventory._helmet._sceneNumber == 1) { + _sceneState = 9211; + setAction(&_sequenceManager, this, 9211, &_globals->_player, &_object2, &_object3, 0); + } else { + _sceneState = 9202; + setAction(&_sequenceManager, this, 9202, &_globals->_player, &_object2, &_object3, 0); + } + } + break; + case 9700: + if (_globals->getFlag(86)) { + _sceneState = 9206; + setAction(&_sequenceManager, this, 9206, &_globals->_player, &_object2, &_object3, 0); + } else { + _sceneState = 9203; + setAction(&_sequenceManager, this, 9203, &_globals->_player, &_object2, &_object3, 0); + } + break; + case 9360: + default: + if (_globals->getFlag(86)) { + _sceneState = 9205; + setAction(&_sequenceManager, this, 9205, &_globals->_player, &_object2, &_object3, 0); + } else { + _sceneState = 9201; + setAction(&_sequenceManager, this, 9201, &_globals->_player, &_object2, &_object3, 0); + } + break; + } +} + +/*-------------------------------------------------------------------------- + * Scene 9300 + * + *--------------------------------------------------------------------------*/ +void Scene9300::signal() { + switch (_sceneMode++) { + case 9301: + _globals->setFlag(84); + // No break on purpose + case 9303: + _globals->_soundHandler.startSound(295, 0, 127); + _globals->_sceneManager.changeScene(9350); + break; + case 9302: + _globals->_player.enableControl(); + break; + default: + break; + } +} + +void Scene9300::dispatch() { + if (_action) { + _action->dispatch(); + } else if (_globals->_player._position.y < 145) { + _globals->_player.disableControl(); + _sceneMode = 9303; + setAction(&_sequenceManager, this, 9303, &_globals->_player, &_object1, &_object2, 0); + } +} + +void Scene9300::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(130, 75, 230, 150); + + _sceneMode = 0; + _globals->_player.postInit(); + _globals->_player.changeZoom(-1); + _object1.postInit(); + _object2.postInit(); + _globals->_soundHandler.startSound(289, 0, 127); + + _hotspot1.quickInit(35, 142, 76, 212, 9300, 0, 1); + _hotspot2.quickInit(28, 90, 81, 143, 9300, 2, 3); + _hotspot3.quickInit(78, 142, 146, 216, 9300, 4, 5); + _hotspot4.quickInit(3, 43, 91, 74, 9300, 6, 7); + _hotspot5.quickInit(82, 19, 157, 65, 9300, 8, 9); + _hotspot6.quickInit(5, 218, 84, 274, 9300, 10, 11); + _hotspot7.quickInit(86, 233, 168, 293, 9300, 12, 13); + _hotspot8.quickInit(157, 0, 200, 230, 9300, 14, 15); + _hotspot9.quickInit(169, 227, 200, 320, 9300, 16, 17); + _hotspot10.quickInit(145, 97, 166, 225, 9300, 18, 19); + _hotspot11.quickInit(81, 75, 145, 145, 9300, 20, 21); + _hotspot12.quickInit(0, 0, 94, 35, 9300, 22, 23); + _hotspot13.quickInit(12, 268, 149, 320, 9300, 24, 25); + + if (_globals->_sceneManager._previousScene == 9350) { + _globals->_player.disableControl(); + _sceneMode = 9302; + setAction(&_sequenceManager, this, 9302, &_globals->_player, &_object1, &_object2, 0); + } else { + _globals->_player.disableControl(); + _sceneMode = 9301; + setAction(&_sequenceManager, this, 9301, &_globals->_player, &_object1, &_object2, 0); + } +} + +/*-------------------------------------------------------------------------- + * Scene 9350 + * + *--------------------------------------------------------------------------*/ + +void Scene9350::signal() { + switch (_sceneState ++) { + case 0: + case 9352: + case 9353: + case 9354: + _globals->_player.enableControl(); + break; + case 9355: + _globals->_sceneManager.changeScene(9300); + break; + case 9356: + _globals->_sceneManager.changeScene(9360); + break; + case 9357: + case 9359: + _globals->_sceneManager.changeScene(9400); + break; + default: + break; + } +} + +void Scene9350::dispatch() { + if (_action == 0) { + if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { + _globals->_player.disableControl(); + _sceneState = 9356; + setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, 0); + } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { + _globals->_player.disableControl(); + _sceneState = 9357; + setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, 0); + } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { + _globals->_player.disableControl(); + _sceneState = 9355; + setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, 0); + } + } else { + Scene::dispatch(); + } +} + +void Scene9350::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(95, 80, 200, 100); + _globals->_player.postInit(); + + _object1.quickInit(9350, 1, 3, 139, 97, 0); + _sceneHotspot1.quickInit(42, 0, 97, 60, 9350, 0, -1); + _sceneHotspot2.quickInit(37, 205, 82, 256, 9350, 0, -1); + _sceneHotspot3.quickInit(29, 93, 92, 174, 9350, 1, -1); + _sceneHotspot4.quickInit(0, 308, 109, 320, 9350, 2, -1); + _sceneHotspot5.quickInit(0, 0, 200, 320, 9350, 3, -1); + + _globals->_events.setCursor(CURSOR_WALK); + _globals->_player.disableControl(); + + if (_globals->_sceneManager._previousScene == 9360) { + _globals->_player.disableControl(); + _sceneState = 9352; + setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, 0); + } else if (_globals->_sceneManager._previousScene == 9400) { + _globals->_player.disableControl(); + _sceneState = 9353; + setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, 0); + } else { + if (!_globals->getFlag(84)) { + _globals->clearFlag(84); + _object2.postInit(); + _globals->_player.disableControl(); + _sceneState = 9359; + setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, 0); + } else { + _globals->_player.disableControl(); + _sceneState = 9354; + setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, 0); + } + } +} + +/*-------------------------------------------------------------------------- + * Scene 9360 + * + *--------------------------------------------------------------------------*/ + +void Scene9360::signal() { + switch (_sceneState ++) { + case 0: + case 9362: + case 9363: + case 9364: + _globals->_player.enableControl(); + break; + case 9365: + _globals->_sceneManager.changeScene(9350); + break; + case 9366: + _globals->_sceneManager.changeScene(9200); + break; + case 9367: + _globals->_sceneManager.changeScene(9450); + break; + default: + break; + } +} + +void Scene9360::dispatch() { + if (_action == 0) { + if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { + _globals->_player.disableControl(); + _sceneState = 9366; + setAction(&_sequenceManager, this, 9366, &_globals->_player, 0); + } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { + _globals->_player.disableControl(); + _sceneState = 9367; + setAction(&_sequenceManager, this, 9367, &_globals->_player, 0); + } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { + _globals->_player.disableControl(); + _sceneState = 9365; + setAction(&_sequenceManager, this, 9365, &_globals->_player, 0); + } + } else { + Scene::dispatch(); + } +} + +void Scene9360::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(95, 80, 200, 100); + _globals->_player.postInit(); + + _hotspot1.quickInit(37, 92, 93, 173, 9360, 0, 1); + _hotspot2.quickInit(42, 0, 100, 63, 9360, 2, -1); + _hotspot3.quickInit(36, 205, 82, 260, 9360, 3, -1); + _hotspot4.quickInit(103, 2, 200, 320, 9360, 4, -1); + _hotspot5.quickInit(0, 0, 37, 320, 9360, 4, -1); + _hotspot6.quickInit(35, 61, 103, 92, 9360, 4, -1); + _hotspot7.quickInit(33, 174, 93, 207, 9360, 4, -1); + _hotspot8.quickInit(28, 257, 149, 320, 9360, 4, -1); + _globals->_events.setCursor(CURSOR_WALK); + _globals->_player.disableControl(); + if (_globals->_sceneManager._previousScene == 9350) { + _globals->_player.disableControl(); + _sceneState = 9364; + setAction(&_sequenceManager, this, 9364, &_globals->_player, 0); + } else if (_globals->_sceneManager._previousScene == 9450) { + _globals->_player.disableControl(); + _sceneState = 9363; + setAction(&_sequenceManager, this, 9363, &_globals->_player, 0); + } else { + _globals->_player.disableControl(); + _sceneState = 9362; + setAction(&_sequenceManager, this, 9362, &_globals->_player, 0); + } + _object1.quickInit(9351, 1, 1, 131, 90, 0); +} + +/*-------------------------------------------------------------------------- + * Scene 9700 + * + *--------------------------------------------------------------------------*/ +void Scene9700::signal() { + switch (_sceneMode ++) { + case 9703: + _globals->setFlag(88); + // No break on purpose + case 9701: + case 9702: + _gfxButton1.setText(EXIT_MSG); + _gfxButton1._bounds.centre(50, 190); + _gfxButton1.draw(); + _gfxButton1._bounds.expandPanes(); + _globals->_player.enableControl(); + _globals->_player._canWalk = 0; + _globals->_events.setCursor(CURSOR_USE); + + break; + case 9704: + _globals->_soundHandler.startSound(323, 0, 127); + _globals->_sceneManager.changeScene(9750); + break; + } +} + +void Scene9700::process(Event &event) { + if ((event.eventType == EVENT_BUTTON_DOWN) && (event.kbd.keycode == 0)) { + if (_gfxButton1.process(event)) { + _globals->_sceneManager.changeScene(9200); + } else if (_globals->_events._currentCursor == OBJECT_SCANNER) { + event.handled = true; + if (_globals->_inventory._helmet._sceneNumber == 1) { + _globals->_player.disableControl(); + _sceneMode = 9704; + setAction(&_sequenceManager, this, 9704, &_globals->_player, &_object1, 0); + } else { + _globals->_player.disableControl(); + _sceneMode = 9703; + setAction(&_sequenceManager, this, 9703, &_globals->_player, &_object1, 0); + } + } + } +} + +void Scene9700::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + + _sceneHotspot1.quickInit(84, 218, 151, 278, 9700, 14, -1); + _sceneHotspot2.quickInit(89, 11, 151, 121, 9700, 14, -1); + _sceneHotspot3.quickInit(69, 119, 138, 218, 9700, 15, 16); + _sceneHotspot4.quickInit(34, 13, 88, 116, 9700, 17, -1); + _sceneHotspot5.quickInit(52, 119, 68, 204, 9700, 17, -1); + _sceneHotspot6.quickInit(0, 22, 56, 275, 9700, 18, -1); + + _object1.postInit(); + _object1.flag100(); + _globals->_player.postInit(); + if (_globals->getFlag(97)) { + _globals->_player.disableControl(); + _sceneMode = 9701; + setAction(&_sequenceManager, this, 9701, &_globals->_player, &_object1, 0); + _globals->setFlag(97); + } else { + _globals->_player.disableControl(); + _sceneMode = 9702; + setAction(&_sequenceManager, this, 9702, &_globals->_player, &_object1, 0); + } +} + +/*-------------------------------------------------------------------------- + * Scene 9750 + * + *--------------------------------------------------------------------------*/ +void Scene9750::signal() { + switch (_sceneMode ++) { + case 9751: + _globals->_soundHandler.proc1(this); + break; + case 9752: + _globals->_sceneManager.changeScene(2100); + default: + break; + } +} + +void Scene9750::dispatch() { + Scene::dispatch(); +} + +void Scene9750::postInit(SceneObjectList *OwnerList) { + loadScene(9750); + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + + _globals->_player.postInit(); + _object1.postInit(); + _object1.flag100(); + _object2.postInit(); + _object2.flag100(); + _globals->_player.disableControl(); + _sceneMode = 9751; + setAction(&_sequenceManager, this, 9751, &_globals->_player, &_object1, &_object2, 0); +} + +/*-------------------------------------------------------------------------- + * Scene 9999 + * + *--------------------------------------------------------------------------*/ + +void Scene9999::Action1::signal() { + switch (_actionIndex++) { + case 0: + setDelay(600); + break; + case 1: + _globals->_sceneManager.changeScene(3500); + break; + default: + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene9999::Action2::signal() { + switch (_actionIndex++) { + case 0: + setDelay(10); + break; + case 1: + SceneItem::display(9999, 0, SET_Y, 10, SET_X, 30, SET_FONT, 2, SET_BG_COLOUR, -1, SET_EXT_BGCOLOUR, 23, SET_WIDTH, 260, SET_KEEP_ONSCREEN, 1, LIST_END); + setDelay(300); + break; + case 2: + _globals->_stripNum = 3600; + _globals->_sceneManager.changeScene(3600); + default: + break; + } +} + +void Scene9999::postInit(SceneObjectList *OwnerList) { + loadScene(9998); + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + + _object1.postInit(); + _object1.setVisage(1303); + _object1.setStrip2(3); + _object1.setPosition(Common::Point(160, 152), 0); + + _globals->_player.postInit(); + _globals->_player.setVisage(1303); + _globals->_player.setStrip2(1); + _globals->_player.setPriority2(250); + _globals->_player.animate(ANIM_MODE_2, 0); + _globals->_player.setPosition(Common::Point(194, 98), 0); + _globals->_player._numFrames = 20; + _globals->_player.disableControl(); + + _object2.postInit(); + _object2.setVisage(1303); + _object2.setStrip2(2); + _object2.setPriority2(2); + _object2.setPosition(Common::Point(164, 149), 0); + + _object3.postInit(); + _object3.setVisage(1303); + _object3.setStrip2(2); + _object3.setPriority2(2); + _object3.setFrame(2); + _object3.setPosition(Common::Point(292, 149), 0); + _object3.setAction(&_action3); + + if (_globals->_sceneManager._previousScene == 3500) + setAction(&_action2); + else + setAction(&_action1); + + _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y); + _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); + _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + + if (_globals->_sceneManager._previousScene == 3500) + _globals->_stripNum = 2222; + else + _globals->_stripNum = 2121; + + _globals->_soundHandler.startSound(118, 0, 127); + +} + +} // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h new file mode 100644 index 0000000000..c321d53e85 --- /dev/null +++ b/engines/tsage/ringworld_scenes10.h @@ -0,0 +1,248 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.h $ + * $Id: scene_logic.h 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#ifndef TSAGE_RINGWORLD_SCENES10_H +#define TSAGE_RINGWORLD_SCENES10_H + +#include "common/scummsys.h" +#include "tsage/ringworld_logic.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" + +namespace tSage { + +class Scene2: public Scene { +public : + int _sceneState; + + Scene2(); + virtual void synchronise(Serialiser &s) { + Scene::synchronise(s); + s.syncAsSint16LE(_sceneState); + } +}; + +class Object9350: public SceneObject { +public: + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void draw(); +}; + +class Scene9100: public Scene { + /* Items */ + class SceneHotspot1: public SceneHotspot_3 { + public: + virtual void doAction(int action); + }; + + SequenceManager _sequenceManager; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SceneHotspot1 _sceneHotspot1; + SceneHotspot_3 _sceneHotspot2; + SceneHotspot_3 _sceneHotspot3; + SceneHotspot_3 _sceneHotspot4; + SceneHotspot_3 _sceneHotspot5; + SceneHotspot_3 _sceneHotspot6; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9150: public Scene2 { + class Object3: public SceneObject4 { + public: + virtual void signal(); + virtual void dispatch(); + }; + + SequenceManager _sequenceManager1; + SequenceManager _sequenceManager2; + SceneObject _object1; + SceneObject _object2; + Object3 _object3; + SceneHotspot_3 _sceneHotspot1; + SceneHotspot_3 _sceneHotspot2; + SceneHotspot_3 _sceneHotspot3; + SceneHotspot_3 _sceneHotspot4; + SceneHotspot_3 _sceneHotspot5; + SceneHotspot_3 _sceneHotspot6; + SceneHotspot_3 _sceneHotspot7; + SceneHotspot_3 _sceneHotspot8; + SceneHotspot_3 _sceneHotspot9; + SceneHotspot_3 _sceneHotspot10; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9200: public Scene2 { + class SceneHotspot1: public SceneHotspot_3{ + public: + virtual void doAction(int action); + }; + + SequenceManager _sequenceManager; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + Action _action1; + SpeakerGText _speakerGText; + SpeakerGR _speakerGR; + SpeakerQText _speakerQText; + SoundHandler _soundHandler; + SceneHotspot1 _hotspot1; + SceneHotspot_3 _hotspot2; + SceneHotspot_3 _hotspot3; + SceneHotspot_3 _hotspot4; + SceneHotspot_3 _hotspot5; + SceneHotspot_3 _hotspot6; + SceneHotspot_3 _hotspot7; + SceneHotspot_3 _hotspot8; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); + virtual void process(Event &event); +}; + +class Scene9300: public Scene { + SequenceManager _sequenceManager; + SceneObject _object1; + SceneObject _object2; + SceneHotspot_3 _hotspot1; + SceneHotspot_3 _hotspot2; + SceneHotspot_3 _hotspot3; + SceneHotspot_3 _hotspot4; + SceneHotspot_3 _hotspot5; + SceneHotspot_3 _hotspot6; + SceneHotspot_3 _hotspot7; + SceneHotspot_3 _hotspot8; + SceneHotspot_3 _hotspot9; + SceneHotspot_3 _hotspot10; + SceneHotspot_3 _hotspot11; + SceneHotspot_3 _hotspot12; + SceneHotspot_3 _hotspot13; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9350: public Scene2 { + SequenceManager _sequenceManager; + Object9350 _object1; + SceneObject _object2; + SceneHotspot_3 _sceneHotspot1; + SceneHotspot_3 _sceneHotspot2; + SceneHotspot_3 _sceneHotspot3; + SceneHotspot_3 _sceneHotspot4; + SceneHotspot_3 _sceneHotspot5; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9360: public Scene2 { + SequenceManager _sequenceManager; + Action _action1; + Object9350 _object1; + SceneHotspot_3 _hotspot1; + SceneHotspot_3 _hotspot2; + SceneHotspot_3 _hotspot3; + SceneHotspot_3 _hotspot4; + SceneHotspot_3 _hotspot5; + SceneHotspot_3 _hotspot6; + SceneHotspot_3 _hotspot7; + SceneHotspot_3 _hotspot8; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9700: public Scene2 { + SequenceManager _sequenceManager; + SceneObject _object1; + SceneHotspot_3 _sceneHotspot1; + SceneHotspot_3 _sceneHotspot2; + SceneHotspot_3 _sceneHotspot3; + SceneHotspot_3 _sceneHotspot4; + SceneHotspot_3 _sceneHotspot5; + SceneHotspot_3 _sceneHotspot6; + GfxButton _gfxButton1; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void process(Event &event); +}; + +class Scene9750: public Scene { +public: + SequenceManager _sequenceManager; + SceneObject _object1; + SceneObject _object2; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene9999: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + +public: + + Action1 _action1; + Action2 _action2; + Action _action3; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + + virtual void postInit(SceneObjectList *OwnerList = NULL); +}; + + +} // End of namespace tSage + +#endif diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp new file mode 100644 index 0000000000..1721c04df9 --- /dev/null +++ b/engines/tsage/ringworld_scenes8.cpp @@ -0,0 +1,2509 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.cpp $ + * $Id: scene_logic.cpp 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#include "graphics/cursorman.h" +#include "tsage/ringworld_scenes8.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" + +namespace tSage { + +/*-------------------------------------------------------------------------- + * Scene 7000 + * + *--------------------------------------------------------------------------*/ + +void Scene7000::Action1::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + _globals->_player.disableControl(); + setDelay(3); + break; + case 1: + setAction(&scene->_action6, this); + break; + case 2: + scene->_soundHandler.startSound(252, 0, 127); + scene->_object8.remove(); + scene->_object1.postInit(); + scene->_object1.setVisage(7003); + scene->_object1.animate(ANIM_MODE_5, this); + scene->_object1.setPosition(Common::Point(151, 182), 0); + scene->_object1.setPriority2(205); + _globals->_sceneItems.push_front(&scene->_object1); + break; + case 3: + scene->_object1.setStrip(4); + scene->_object1.animate(ANIM_MODE_8, 0, 0); + scene->_stripManager.start(7005, this); + break; + case 4: + scene->_object1.animate(ANIM_MODE_2, 0); + setDelay(3); + break; + case 5: + _globals->_player.enableControl(); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action2::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + _globals->_player.disableControl(); + setDelay(3); + break; + case 1: + _globals->_player.addMover(0, 0); + _globals->_player.setVisage(7006); + _globals->_player.setStrip(1); + _globals->_player.setFrame(1); + _globals->_player.setPosition(Common::Point(_globals->_player._position.x, _globals->_player._position.y + 13)); + _globals->_player.changeZoom(68); + _globals->_player.animate(ANIM_MODE_5, this); + scene->_object1.remove(); + break; + case 2: + _globals->_sceneManager.changeScene(7100); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action3::dispatch() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + Action::dispatch(); + if (_actionIndex == 4) + scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y)); +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action3::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(30); + scene->setZoomPercents(10, 10, 62, 100); + scene->_object4.postInit(); + scene->_object4.setVisage(5001); + scene->_object4.setStrip2(2); + scene->_object4.animate(ANIM_MODE_8, 0, 0); + scene->_object4.setPosition(Common::Point(10, 18), 0); + scene->_object4.setPriority2(10); + scene->_object4.changeZoom(100); + scene->_object4.flag100(); + break; + case 1: { + NpcMover *mover = new NpcMover(); + Common::Point pt(107, 65); + scene->_object3.addMover(mover, &pt, this); + break; + } + case 2: + scene->_object3.setPriority2(10); + scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15), 0); + scene->_object4.unflag100(); + setDelay(30); + break; + case 3: { + NpcMover *mover = new NpcMover(); + Common::Point pt(107, 92); + scene->_object3.addMover(mover, &pt, this); + break; + } + case 4: + scene->_object4.remove(); + _globals->_sceneManager.changeScene(2100); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action4::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + _globals->_player.disableControl(); + scene->_object1.animate(ANIM_MODE_6, this); + break; + case 1: + scene->_object1.flag100(); + setDelay(300); + break; + case 2: + _globals->_soundHandler.startSound(252, 0, 127); + scene->_object1.unflag100(); + scene->_object1.setStrip(3); + scene->_object1.setFrame(1); + scene->_object1.animate(ANIM_MODE_5, this); + break; + case 3: + scene->_object1.setStrip(1); + scene->_object1.animate(ANIM_MODE_8, 0, 0); + _globals->setFlag(81); + _globals->_player.enableControl(); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action5::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: { + NpcMover *playerMover = new NpcMover(); + Common::Point pt(88, 121); + _globals->_player.addMover(playerMover, &pt, this); + break; + } + case 1: + _globals->_player.checkAngle(&scene->_object1); + _globals->_soundHandler.startSound(252, 0, 127); + scene->_object1.setStrip(2); + scene->_stripManager.start(7015, this); + break; + case 2: + scene->_object1.setStrip(1); + scene->_object1.setFrame(4); + scene->_object1.animate(ANIM_MODE_6, this); + break; + case 3: { + scene->_object1.remove(); + NpcMover *mover = new NpcMover(); + Common::Point pt(31, 94); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 4: { + NpcMover *mover = new NpcMover(); + Common::Point pt(11, 94); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 5: { + _globals->_player.setPriority2(10); + NpcMover *mover = new NpcMover(); + Common::Point pt(11, 89); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 6: { + NpcMover *mover = new NpcMover(); + Common::Point pt(41, 89); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 7: + _globals->clearFlag(36); + _globals->clearFlag(37); + _globals->clearFlag(72); + _globals->clearFlag(13); + _globals->_sceneManager.changeScene(2100); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action6::signal() { + switch (_actionIndex++) { + case 0: + _globals->_player.disableControl(); + setDelay(3); + break; + case 1: { + NpcMover *mover = new NpcMover(); + Common::Point pt(12, 91); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 2: { + NpcMover *mover = new NpcMover(); + Common::Point pt(8, 91); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 3: { + NpcMover *mover = new NpcMover(); + Common::Point pt(31, 96); + _globals->_player.addMover(mover, &pt, this); + _globals->_player.setPriority2(-1); + break; + } + case 4: { + NpcMover *mover = new NpcMover(); + Common::Point pt(83, 117); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 5: { + NpcMover *mover = new NpcMover(); + Common::Point pt(95, 121); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 6: + _globals->_player.setStrip(3); + _globals->_player.setFrame(1); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Action7::signal() { + switch (_actionIndex++) { + case 0: + _globals->_player.disableControl(); + setDelay(3); + break; + case 1: + setDelay(3); + break; + case 2: { + NpcMover *mover = new NpcMover(); + Common::Point pt(31, 94); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 3: { + NpcMover *mover = new NpcMover(); + Common::Point pt(11, 94); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 4: { + _globals->_player.setPriority2(10); + NpcMover *mover = new NpcMover(); + Common::Point pt(11, 89); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 5: { + NpcMover *mover = new NpcMover(); + Common::Point pt(41, 89); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 6: + if (_globals->getFlag(13)) + _globals->_sceneManager.changeScene(2280); + else + _globals->_sceneManager.changeScene(2320); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::SceneItem1::doAction(int action) { + if (action == CURSOR_LOOK) + SceneItem::display(7000, 2, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + + SceneItem::doAction(action); +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::Object1::doAction(int action) { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + switch (action) { + case OBJECT_TRANSLATOR: + _globals->_player.disableControl(); + _globals->_inventory._translator._sceneNumber = 7000; + if (_globals->_inventory._waldos._sceneNumber == 7000) { + if (_globals->_inventory._jar._sceneNumber == 7000) { + scene->_sceneMode = 7012; + scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0); + } else { + scene->_sceneMode = 7015; + scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, 0, 0); + } + } else { + if (_globals->_inventory._jar._sceneNumber == 7000) { + scene->_sceneMode = 7011; + scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0); + } else { + scene->_sceneMode = 7004; + scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, 0, 0); + } + } + break; + case OBJECT_WALDOS: + _globals->_player.disableControl(); + _globals->_inventory._waldos._sceneNumber = 7000; + if (_globals->_inventory._translator._sceneNumber == 7000) { + if (_globals->_inventory._jar._sceneNumber == 7000) { + scene->_sceneMode = 7015; + scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, 0, 0); + } else { + scene->_sceneMode = 7006; + scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, 0, 0); + } + } else { + scene->_sceneMode = 7009; + scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, 0, 0); + } + break; + case OBJECT_JAR: + _globals->_player.disableControl(); + _globals->_inventory._jar._sceneNumber = 7000; + if (_globals->_inventory._translator._sceneNumber == 7000) { + if (_globals->_inventory._waldos._sceneNumber == 7000) { + scene->_sceneMode = 7007; + scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, 0, 0); + } else { + scene->_sceneMode = 7015; + scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, 0, 0); + } + } else { + scene->_sceneMode = 7008; + scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, 0, 0); + } + break; + case CURSOR_LOOK: + if (_globals->getFlag(81)) + SceneItem::display(7000, 1, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneItem::display(7000, 0, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (_globals->getFlag(81)) { + _globals->_inventory._stasisBox._sceneNumber = 1; + _globals->_player.disableControl(); + scene->setAction(&scene->_action5); + } else { + SceneItem::display(7000, 5, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } + break; + case CURSOR_TALK: + if (_globals->getFlag(81)) { + _globals->_inventory._stasisBox._sceneNumber = 1; + _globals->_player.disableControl(); + scene->setAction(&scene->_action5); + } else if (_globals->getFlag(52)) { + scene->_sceneMode = 7005; + scene->setAction(&scene->_sequenceManager, scene, 7013, 0, 0); + } else if (_globals->getFlag(13)) { + _globals->_sceneManager._sceneNumber = 7002; + scene->setAction(&scene->_sequenceManager, scene, 7014, 0, 0); + } else { + _globals->_sceneManager._sceneNumber = 7002; + scene->setAction(&scene->_sequenceManager, scene, 7002, 0, 0); + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::dispatch() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + + if (!_action) { + if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 8) { + if (!_globals->getFlag(13)) { + _globals->_player.disableControl(); + _globals->_player.addMover(0); + SceneItem::display(7000, 3, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + _sceneMode = 7001; + setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL); + } else if (!_globals->getFlag(52)) { + setAction(&_action2); + } else { + _globals->_player.disableControl(); + _sceneMode = 7003; + setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, 0); + } + } + if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 9) + scene->setAction(&scene->_action7); + } + Scene::dispatch(); +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::postInit(SceneObjectList *OwnerList) { + loadScene(7000); + Scene::postInit(); + setZoomPercents(93, 25, 119, 55); + _stripManager.addSpeaker(&_speakerSKText); + _stripManager.addSpeaker(&_speakerSKL); + _stripManager.addSpeaker(&_speakerQText); + _stripManager.addSpeaker(&_speakerQL); + _stripManager.addSpeaker(&_speakerQR); + + _speakerSKText._npc = &_object1; + _speakerQText._npc = &_globals->_player; + + _object5.postInit(); + _object5.setVisage(7001); + _object5.setStrip2(1); + _object5.animate(ANIM_MODE_2, 0); + _object5.setPosition(Common::Point(49, 147), 0); + _object5.setPriority2(1); + + _object6.postInit(); + _object6.setVisage(7001); + _object6.setStrip2(2); + _object6.animate(ANIM_MODE_2, 0); + _object6.setPosition(Common::Point(160, 139), 0); + _object6.setPriority2(1); + + _object7.postInit(); + _object7.setVisage(7001); + _object7.setStrip2(3); + _object7.animate(ANIM_MODE_2, 0); + _object7.setPosition(Common::Point(272, 129), 0); + _object7.setPriority2(1); + + _object8.postInit(); + _object8.setVisage(7001); + _object8.setStrip2(4); + _object8.animate(ANIM_MODE_2, 0); + _object8.setPosition(Common::Point(176, 175), 0); + _object8.setPriority2(1); + + if (_globals->getFlag(72)) { + _object3.postInit(); + _object3.setVisage(5001); + _object3.setStrip2(1); + _object3.animate(ANIM_MODE_2, 0); + _object3.setPosition(Common::Point(107, 92), 0); + _object3.changeZoom(100); + _object3.setPriority2(10); + + _object1.postInit(); + _object1.setVisage(7003); + if (_globals->getFlag(81)) + _object1.setStrip(4); + else + _object1.setStrip(2); + _object1.setPosition(Common::Point(87, 129), 0); + _object1._numFrames = 4; + _object1.changeZoom(45); + _object1.animate(ANIM_MODE_8, 0, 0); + _globals->_sceneItems.addItems(&_object1, 0); + } + _soundHandler.startSound(251, 0, 127); + if (_globals->_sceneManager._previousScene == 2100) { + if (_globals->getFlag(72)) { + _globals->_player.postInit(); + _globals->_player.setVisage(0); + _globals->_player.animate(ANIM_MODE_1, 0); + SceneObjectWrapper *wrapper = new SceneObjectWrapper(); + _globals->_player.setObjectWrapper(wrapper); + _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.changeZoom(-1); + _globals->_player.setPriority2(10); + if (_globals->getFlag(81)) { + setAction(&_action4); + } else { + _object1.setPosition(Common::Point(151, 182), 0); + setAction(&_action1); + } + } else { + _globals->_soundHandler.startSound(250, 0, 127); + _globals->setFlag(72); + + _object3.postInit(); + _object3.setVisage(5001); + _object3.setStrip2(1); + _object3.animate(ANIM_MODE_1, 0); + _object3.setPosition(Common::Point(307, 0), 0); + _object3.changeZoom(-1); + setAction(&_action3); + } + } else if (_globals->_sceneManager._previousScene == 2280) { + _globals->_player.postInit(); + _globals->_player.setVisage(2170); + _globals->_player.animate(ANIM_MODE_1, 0); + SceneObjectWrapper *wrapper = new SceneObjectWrapper(); + _globals->_player.setObjectWrapper(wrapper); + _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.changeZoom(-1); + _globals->_player.setPriority2(10); + _globals->_player.disableControl(); + _sceneMode = 7001; + setAction(&_action6, this); + if (!_globals->getFlag(81)) { + _object1.setPosition(Common::Point(151, 182), 0); + _object1.changeZoom(100); + } + _object8.remove(); + _object9.remove(); + } else if (_globals->_sceneManager._previousScene == 2320) { + _globals->_player.postInit(); + _globals->_player.setVisage(0); + _globals->_player.animate(ANIM_MODE_1, 0); + SceneObjectWrapper *wrapper = new SceneObjectWrapper(); + _globals->_player.setObjectWrapper(wrapper); + _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.changeZoom(-1); + _globals->_player.setPriority2(10); + _sceneMode = 7001; + setAction(&_action6, this); + } else { + _globals->setFlag(72); + + _object3.postInit(); + _object3.setVisage(5001); + _object3.setStrip2(1); + _object3.setPosition(Common::Point(307, 0), 0); + _soundHandler.startSound(151, 0, 127); + _soundHandler.proc5(1); + _globals->_soundHandler.startSound(250, 0, 127); + setAction(&_action3); + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7000::signal() { + Scene7000 *scene = (Scene7000 *)_globals->_sceneManager._scene; + switch (_sceneMode) { + case 7001: + case 7002: + case 7004: + case 7009: + _globals->_player.enableControl(); + break; + case 7003: + _sceneMode = 7001; + setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL); + break; + case 7011: + _sceneMode = 7005; + setAction(&scene->_sequenceManager, this, 7005, &_globals->_player, NULL); + break; + case 7012: + _sceneMode = 7005; + setAction(&scene->_sequenceManager, this, 7012, &_globals->_player, NULL); + break; + case 7015: + setAction(&_action4); + break; + } +} + + +/*-------------------------------------------------------------------------- + * Scene 7100 + * + *--------------------------------------------------------------------------*/ + +void Scene7100::Action3::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + break; + case 1: { + Common::Point pt(433, 308); + NpcMover *mover = new NpcMover(); + scene->_object4.addMover(mover, &pt, this); + break; + } + case 2: + scene->_object4.remove(); + remove(); + break; + } +} + +void Scene7100::Action4::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(_globals->_randomSource.getRandomNumber(1) + 1); + break; + case 1: { + scene->_object5.setStrip(3); + Common::Point pt(85, 52); + NpcMover *mover = new NpcMover(); + scene->_object5.addMover(mover, &pt, this); + break; + } + case 2: { + scene->_object5.setStrip(4); + Common::Point pt(20, 52); + NpcMover *mover = new NpcMover(); + scene->_object5.addMover(mover, &pt, this); + break; + } + case 3: + _actionIndex = 0; + setDelay(1); + break; + } +} + +void Scene7100::Action5::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + break; + case 1: { + Common::Point pt(59, 151); + NpcMover *mover = new NpcMover(); + scene->_object9.addMover(mover, &pt, this); + break; + } + case 2: { + scene->_object9.setStrip2(1); + Common::Point pt(127, 144); + NpcMover *mover = new NpcMover(); + scene->_object9.addMover(mover, &pt, this); + break; + } + case 3: { + scene->_object9.setStrip2(2); + scene->_object9.setPriority2(180); + Common::Point pt(8, 181); + NpcMover *mover = new NpcMover(); + scene->_object9.addMover(mover, &pt, this); + break; + } + case 4: { + scene->_object9.remove(); + remove(); + } + } +} + +void Scene7100::Action6::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + scene->_object10.setPriority2(8); + scene->_object10.setPosition(Common::Point(155, 187), 0); + + scene->_object11.setPriority2(8); + scene->_object11.setPosition(Common::Point(155, 190), 0); + + scene->_object12.setPriority2(8); + scene->_object12.setPosition(Common::Point(151, 193), 0); + break; + case 1: { + Common::Point pt1(167, 187); + NpcMover *mover1 = new NpcMover(); + scene->_object10.addMover(mover1, &pt1, this); + + Common::Point pt2(165, 185); + NpcMover *mover2 = new NpcMover(); + scene->_object11.addMover(mover2, &pt2, 0); + + Common::Point pt3(163, 183); + NpcMover *mover3 = new NpcMover(); + scene->_object12.addMover(mover3, &pt3, 0); + break; + } + case 2: { + scene->_object10.setStrip2(6); + Common::Point pt1(91, 187); + NpcMover *mover1 = new NpcMover(); + scene->_object10.addMover(mover1, &pt1, this); + + scene->_object11.setStrip2(6); + scene->_object11.setPriority2(50); + Common::Point pt2(89, 185); + NpcMover *mover2 = new NpcMover(); + scene->_object11.addMover(mover2, &pt2, 0); + + scene->_object12.setStrip2(6); + scene->_object12.setPriority2(50); + Common::Point pt3(87, 183); + NpcMover *mover3 = new NpcMover(); + scene->_object12.addMover(mover3, &pt3, 0); + break; + } + case 3: + _actionIndex = 0; + setDelay(1); + break; + } +} + +void Scene7100::Action7::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + break; + case 1: { + scene->_object13.setStrip2(8); + Common::Point pt(324, 87); + NpcMover *mover = new NpcMover(); + scene->_object13.addMover(mover, &pt, this); + break; + } + case 2: { + scene->_object13.setStrip2(2); + Common::Point pt(524, 104); + NpcMover *mover = new NpcMover(); + scene->_object13.addMover(mover, &pt, 0); + break; + } + case 3: + _actionIndex = 0; + setDelay(1); + break; + } +} + +void Scene7100::Action8::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + break; + case 1: { + scene->_object17.setStrip2(4); + scene->_object18.setStrip2(4); + scene->_object19.setStrip2(4); + + Common::Point pt1(482, 153); + NpcMover *mover1 = new NpcMover(); + scene->_object17.addMover(mover1, &pt1, this); + + Common::Point pt2(480, 146); + NpcMover *mover2 = new NpcMover(); + scene->_object18.addMover(mover2, &pt2, 0); + + Common::Point pt3(470, 153); + NpcMover *mover3 = new NpcMover(); + scene->_object19.addMover(mover3, &pt3, 0); + break; + } + case 2: { + scene->_object17.setStrip2(3); + scene->_object18.setStrip2(3); + scene->_object19.setStrip2(3); + + Common::Point pt1(506, 186); + NpcMover *mover1 = new NpcMover(); + scene->_object17.addMover(mover1, &pt1, this); + + Common::Point pt2(502, 179); + NpcMover *mover2 = new NpcMover(); + scene->_object18.addMover(mover2, &pt2, 0); + + Common::Point pt3(495, 184); + NpcMover *mover3 = new NpcMover(); + scene->_object19.addMover(mover3, &pt3, 0); + break; + } + case 3: { + scene->_object17.setStrip2(4); + scene->_object18.setStrip2(4); + scene->_object19.setStrip2(4); + + Common::Point pt1(386, 167); + NpcMover *mover1 = new NpcMover(); + scene->_object17.addMover(mover1, &pt1, this); + + Common::Point pt2(379, 161); + NpcMover *mover2 = new NpcMover(); + scene->_object18.addMover(mover2, &pt2, 0); + + Common::Point pt3(373, 167); + NpcMover *mover3 = new NpcMover(); + scene->_object19.addMover(mover3, &pt3, 0); + break; + } + case 4: { + scene->_object17.setStrip2(3); + scene->_object18.setStrip2(3); + scene->_object19.setStrip2(3); + + Common::Point pt1(479, 193); + NpcMover *mover1 = new NpcMover(); + scene->_object17.addMover(mover1, &pt1, this); + + Common::Point pt2(473, 187); + NpcMover *mover2 = new NpcMover(); + scene->_object18.addMover(mover2, &pt2, 0); + + Common::Point pt3(466, 192); + NpcMover *mover3 = new NpcMover(); + scene->_object19.addMover(mover3, &pt3, 0); + break; + } + case 5: { + Common::Point pt1(552, 183); + NpcMover *mover1 = new NpcMover(); + scene->_object17.addMover(mover1, &pt1, this); + + Common::Point pt2(552, 178); + NpcMover *mover2 = new NpcMover(); + scene->_object18.addMover(mover2, &pt2, 0); + + Common::Point pt3(541, 183); + NpcMover *mover3 = new NpcMover(); + scene->_object19.addMover(mover3, &pt3, 0); + + _actionIndex = 0; + break; + } + } +} + +void Scene7100::Action9::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1); + break; + case 1: { + scene->_object24.setStrip2(1); + Common::Point pt(64, 159); + NpcMover *mover = new NpcMover(); + scene->_object24.addMover(mover, &pt, this); + break; + } + case 2: { + scene->_object24.setStrip2(2); + scene->_object24.setPriority2(160); + Common::Point pt(34, 159); + NpcMover *mover = new NpcMover(); + scene->_object24.addMover(mover, &pt, this); + break; + } + case 3: { + scene->_object24.setStrip2(1); + Common::Point pt(64, 159); + NpcMover *mover = new NpcMover(); + scene->_object24.addMover(mover, &pt, this); + break; + } + case 4: { + scene->_object24.setStrip2(2); + scene->_object24.setPriority2(180); + Common::Point pt(-12, 182); + NpcMover *mover = new NpcMover(); + scene->_object24.addMover(mover, &pt, this); + break; + } + case 5: { + _actionIndex = 0; + setDelay(1); + break; + } + } +} + +void Scene7100::Action10::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(1000); + break; + case 1: { + Common::Point pt(610, -60); + NpcMover *mover = new NpcMover(); + scene->_object25.addMover(mover, &pt, this); + break; + } + case 2: + scene->_object25.remove(); + remove(); + break; + } +} + +void Scene7100::Action11::signal() { + Scene7100 *scene = (Scene7100 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(30); + break; + case 1: { + Common::Point pt(154, 175); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, this); + ObjectMover2 *mover2 = new ObjectMover2(); + scene->_object1.addMover(mover2, 25, 35, &_globals->_player); + break; + } + case 2: { + Common::Point pt(700, 155); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 3: + _globals->_sceneManager.changeScene(7200); + remove(); + break; + } +} + +void Scene7100::postInit(SceneObjectList *OwnerList) { + loadScene(7100); + Scene::postInit(); + setZoomPercents(60, 85, 200, 100); + + _object2.postInit(); + _object2.setVisage(7161); + _object2.animate(ANIM_MODE_2, 0); + _object2.setPosition(Common::Point(10, 140), 0); + _object2._numFrames = 1; + _object2.setPriority2(180); + _object2.setAction(&_action1, 0); + + _object3.postInit(); + _object3.setVisage(7161); + _object3.animate(ANIM_MODE_2, 0); + _object3.setPosition(Common::Point(34, 115), 0); + _object3._numFrames = 1; + _object3.setPriority2(180); + _object3.setAction(&_action2, 0); + + _object4.postInit(); + _object4.setVisage(7164); + _object4.animate(ANIM_MODE_2, 0); + _object4.setPosition(Common::Point(-10, 159), 0); + _object4._numFrames = 2; + _object4.setPriority2(250); + _object4.setAction(&_action3, 0); + + _object5.postInit(); + _object5.setVisage(7162); + _object5.setStrip(3); + _object5.animate(ANIM_MODE_2, 0); + _object5.setPosition(Common::Point(20, 52), 0); + _object5.setAction(&_action4, 0); + + _object9.postInit(); + _object9.setVisage(7160); + _object5.setStrip(2); + _object9.animate(ANIM_MODE_2, 0); + _object9.setPosition(Common::Point(110, 168), 0); + _object9._numFrames = 2; + _object9.setPriority2(16); + _object9.setAction(&_action5, 0); + + _object13.postInit(); + _object13.setVisage(7161); + _object13.setStrip(8); + _object13.animate(ANIM_MODE_2, 0); + _object13.setPosition(Common::Point(524, 104), 0); + _object13._numFrames = 5; + _object13.setPriority2(250); + _object13.setAction(&_action7, 0); + + _object17.postInit(); + _object17.setVisage(7160); + _object17.setStrip(3); + _object17.animate(ANIM_MODE_2, 0); + _object17.setPosition(Common::Point(552, 183), 0); + _object17._numFrames = 4; + _object17._moveDiff.x = 12; + _object17._moveDiff.y = 12; + _object17.setAction(&_action8, 0); + + _object18.postInit(); + _object18.setVisage(7160); + _object18.setStrip(3); + _object18.animate(ANIM_MODE_2, 0); + _object18.setPosition(Common::Point(552, 178), 0); + _object18._numFrames = 4; + _object18._moveDiff.x = 12; + _object18._moveDiff.y = 12; + + _object19.postInit(); + _object19.setVisage(7160); + _object19.setStrip(3); + _object19.animate(ANIM_MODE_2, 0); + _object19.setPosition(Common::Point(541, 183), 0); + _object19._numFrames = 4; + _object19._moveDiff.x = 12; + _object19._moveDiff.y = 12; + + _object24.postInit(); + _object24.setVisage(7162); + _object24.setStrip(1); + _object24.animate(ANIM_MODE_2, 0); + _object24.setPosition(Common::Point(-12, 182), 0); + _object24._numFrames = 4; + _object24.setPriority2(180); + _object24.setAction(&_action9, 0); + + _object25.postInit(); + _object25.setVisage(7163); + _object25.animate(ANIM_MODE_2, 0); + _object25.setPosition(Common::Point(551, 145), 0); + _object25._numFrames = 5; + _object25.setPriority2(160); + _object25.setAction(&_action10, 0); + + // Swimmer 1 + _globals->_player.postInit(); + _globals->_player.setVisage(7101); + _globals->_player.animate(ANIM_MODE_2, 0); + _globals->_player._moveDiff.x = 4; + _globals->_player._moveDiff.y = 2; + _globals->_player.setPosition(Common::Point(135, 135), 0); + _globals->_player.setPriority2(200); + _globals->_player.disableControl(); + + // Swimmer 2 + _object1.postInit(); + _object1.setVisage(7110); + _object1.animate(ANIM_MODE_1, 0); + _object1._moveDiff.x = 4; + _object1._moveDiff.y = 2; + _object1.setPosition(Common::Point(100, 100), 0); + + setAction(&_action11); + _soundHandler1.startSound(270, 0, 127); + _soundHandler2.startSound(275, 0, 127); + _globals->_soundHandler.startSound(270, 0, 127); +} +/*-------------------------------------------------------------------------- + * Scene 7200 + * + *--------------------------------------------------------------------------*/ + +void Scene7200::Action1::signal() { + Scene7200 *scene = (Scene7200 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(15); + break; + case 1: { + PlayerMover *mover1 = new PlayerMover(); + Common::Point pt1(165, 147); + scene->_swimmer.addMover(mover1, &pt1, this); + Common::Point pt2(207, 138); + PlayerMover *mover2 = new PlayerMover(); + _globals->_player.addMover(mover2, &pt2, this); + break; + } + case 2: + break; + case 3: + _globals->_sceneManager.changeScene(7300); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7200::Action2::signal() { + Scene7200 *scene = (Scene7200 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(3); + break; + case 1: { + scene->_object2.setPriority2(25); + scene->_object3.setPriority2(25); + scene->_object4.setPriority2(25); + scene->_object2.setStrip(1); + scene->_object3.setStrip(1); + scene->_object4.setStrip(1); + NpcMover *mover1 = new NpcMover(); + Common::Point pt1(54, 90); + scene->_object2.addMover(mover1, &pt1, this); + NpcMover *mover2 = new NpcMover(); + Common::Point pt2(56, 85); + scene->_object3.addMover(mover2, &pt2, 0); + NpcMover *mover3 = new NpcMover(); + Common::Point pt3(54, 80); + scene->_object4.addMover(mover3, &pt3, 0); + break; + } + case 2: { + scene->_object2.setPriority2(160); + scene->_object3.setPriority2(160); + scene->_object4.setPriority2(160); + scene->_object2.setStrip(2); + scene->_object3.setStrip(2); + scene->_object4.setStrip(2); + NpcMover *mover1 = new NpcMover(); + Common::Point pt1(10, 89); + scene->_object2.addMover(mover1, &pt1, this); + NpcMover *mover2 = new NpcMover(); + Common::Point pt2(12, 84); + scene->_object3.addMover(mover2, &pt2, 0); + NpcMover *mover3 = new NpcMover(); + Common::Point pt3(10, 79); + scene->_object4.addMover(mover3, &pt3, 0); + break; + } + case 3: + _actionIndex = 0; + setDelay(1); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7200::postInit(SceneObjectList *OwnerList) { + loadScene(7200); + Scene::postInit(); + _object2.postInit(); + _object2.setVisage(7160); + _object2.animate(ANIM_MODE_2, 0); + _object2.setZoom(10); + _object2.setPosition(Common::Point(53, 88), 0); + _object2.setAction(&_action2); + + _object3.postInit(); + _object3.setVisage(7160); + _object3.animate(ANIM_MODE_2, 0); + _object3.setZoom(10); + _object3.setPosition(Common::Point(55, 83), 0); + + _object4.postInit(); + _object4.setVisage(7160); + _object4.animate(ANIM_MODE_2, 0); + _object4.setZoom(10); + _object4.setPosition(Common::Point(57, 78), 0); + + _object5.postInit(); + _object5.setVisage(7201); + _object5.setPosition(Common::Point(300, 172), 0); + _object5.setPriority(172); + _object5.animate(ANIM_MODE_2, 0); + _object5._numFrames = 3; + + _object6.postInit(); + _object6.setVisage(7201); + _object6.setStrip2(3); + _object6.setPosition(Common::Point(144, 97), 0); + _object6.setPriority(199); + _object6.animate(ANIM_MODE_2, 0); + _object6._numFrames = 3; + + _object7.postInit(); + _object7.setVisage(7201); + _object7.setStrip2(4); + _object7.setPosition(Common::Point(115, 123), 0); + _object7.setPriority(199); + _object7.animate(ANIM_MODE_2, 0); + _object7._numFrames = 3; + + _object8.postInit(); + _object8.setVisage(7201); + _object8.setStrip2(6); + _object8.setPosition(Common::Point(140, 173), 0); + _object8.setPriority(199); + _object8.animate(ANIM_MODE_2, 0); + _object8._numFrames = 3; + + _object9.postInit(); + _object9.setVisage(7201); + _object9.setStrip2(7); + _object9.setPosition(Common::Point(215, 196), 0); + _object9.setPriority(199); + _object9.animate(ANIM_MODE_2, 0); + _object9._numFrames = 3; + + // Orange swimmer + _globals->_player.postInit(); + _globals->_player.setVisage(7110); + _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.setObjectWrapper(new SceneObjectWrapper()); + _globals->_player.setZoom(50); + _globals->_player.setPosition(Common::Point(-18, 16), 0); + _globals->_player.disableControl(); + + _swimmer.postInit(); + _swimmer.setVisage(7101); + _swimmer.animate(ANIM_MODE_1, 0); + _swimmer.setObjectWrapper(new SceneObjectWrapper()); + _swimmer.setZoom(50); + _swimmer.setPosition(Common::Point(-8, 16), 0); + + setAction(&_action1); + _soundHandler.startSound(271, 0, 127); +} + +/*-------------------------------------------------------------------------- + * Scene 7300 + * + *--------------------------------------------------------------------------*/ + +void Scene7300::Action1::signal() { + Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + case 1: + case 3: + setDelay(30); + break; + case 2: + scene->_stripManager.start(7300, this); + break; + case 4: { + NpcMover *mover = new NpcMover(); + Common::Point pt(102, 122); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 5: + _globals->_player.setStrip(2); + _globals->_player.setFrame(1); + _globals->_player.animate(ANIM_MODE_5, this); + break; + case 6: + _globals->_player.setStrip(3); + _globals->_player._numFrames = 5; + _globals->_player.animate(ANIM_MODE_2, this); + if (_globals->_inventory._translator._sceneNumber == 1) + scene->_stripManager.start(7310, this); + else + scene->_stripManager.start(7305, this); + break; + case 7: + setDelay(3); + _globals->_soundHandler.proc1(0); + break; + case 8: + _globals->_sceneManager.changeScene(2280); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7300::Action2::signal() { + Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(5); + break; + case 1: + NpcMover *mover1 = new NpcMover(); + Common::Point pt(_globals->_randomSource.getRandomNumber(203), _globals->_randomSource.getRandomNumber(96)); + scene->_object3.addMover(mover1, &pt, this); + _actionIndex = 0; + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7300::Action3::signal() { + Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(5); + break; + case 1: + NpcMover *mover1 = new NpcMover(); + Common::Point pt(_globals->_randomSource.getRandomNumber(76), _globals->_randomSource.getRandomNumber(78)); + scene->_object1.addMover(mover1, &pt, this); + _actionIndex = 0; + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7300::Action4::signal() { + switch (_actionIndex++) { + case 0: + setDelay(5); + break; + case 1: + _actionIndex = 0; + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7300::dispatch() { + Scene7300 *scene = (Scene7300 *)_globals->_sceneManager._scene; + scene->_object4.setPosition(Common::Point(scene->_object3._position.x + 15, scene->_object3._position.y + 61)); + scene->_object2.setPosition(Common::Point(scene->_object1._position.x + 1, scene->_object1._position.y - 31)); + + Scene::dispatch(); +} + +/*--------------------------------------------------------------------------*/ + +void Scene7300::postInit(SceneObjectList *OwnerList) { + loadScene(7300); + + Scene::postInit(); + setZoomPercents(60, 85, 200, 100); + + _globals->setFlag(52); + _globals->setFlag(24); + _globals->setFlag(109); + + _stripManager.addSpeaker(&_speakerPOR); + _stripManager.addSpeaker(&_speakerPOText); + _stripManager.addSpeaker(&_speakerSKText); + _stripManager.addSpeaker(&_speakerQU); + + _speakerSKText.setTextPos(Common::Point(100, 20)); + _speakerPOText.setTextPos(Common::Point(100, 160)); + + _object4.postInit(); + _object4.setVisage(7311); + _object4.setStrip(1); + _object4.setFrame(1); + _object4.setPosition(Common::Point(218, 157), 0); + + _object3.postInit(); + _object3.setVisage(7311); + _object3.setStrip(2); + _object3.setFrame(1); + _object3.setPosition(Common::Point(203, 96), 0); + _object3._numFrames = 2; + _object3._moveDiff = Common::Point(1, 1); + _object3.animate(ANIM_MODE_8, 0, 0); + _object3._field7A = 2; + _object3.setAction(&_action2); + + _globals->_player.postInit(); + _globals->_player.setVisage(7305); + _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.setPosition(Common::Point(-100, 100), 0); + _globals->_player.disableControl(); + + _object1.postInit(); + _object1.setVisage(7312); + _object1.animate(ANIM_MODE_1, 0); + _object1._moveDiff = Common::Point(1, 1); + _object1.setPosition(Common::Point(76, 78), 0); + _object1._field7A = 1; + _object1.setAction(&_action3); + + _object2.postInit(); + _object2.setVisage(7312); + _object2.setStrip(2); + _object2.animate(ANIM_MODE_2, 0); + _object2.setPosition(Common::Point(77, 47), 0); + _object2.setPriority2(190); + + _object5.postInit(); + _object5.setVisage(7300); + _object5.setPosition(Common::Point(106, 45), 0); + _object5.animate(ANIM_MODE_2, 0); + _object5._numFrames = 5; + + _object6.postInit(); + _object6.setVisage(7300); + _object6.setStrip2(2); + _object6.setPosition(Common::Point(283, 193), 0); + _object6.animate(ANIM_MODE_2, 0); + _object6._numFrames = 3; + + _object7.postInit(); + _object7.setVisage(7300); + _object7.setStrip(4); + _object7.setPosition(Common::Point(295, 77), 0); + _object7.animate(ANIM_MODE_2, 0); + _object7._numFrames = 3; + + _object8.postInit(); + _object8.setVisage(7300); + _object8.setStrip(5); + _object8.setPosition(Common::Point(1, 147), 0); + _object8.animate(ANIM_MODE_2, 0); + _object8._numFrames = 2; + + setAction(&_action1); + _globals->_soundHandler.startSound(272, 0, 127); +} + +/*-------------------------------------------------------------------------- + * Scene 7600 + * + *--------------------------------------------------------------------------*/ + +void Scene7600::Action1::signal() { + switch (_actionIndex++) { + case 0: + setDelay(120); + break; + case 1: { + PlayerMover *mover = new PlayerMover(); + Common::Point pt(389, 57); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 2: + _globals->_sceneManager.changeScene(7700); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7600::Action2::signal() { + switch (_actionIndex++) { + case 0: + setDelay(30); + break; + case 1: { + NpcMover *mover = new NpcMover(); + Common::Point pt(-30, 195); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 2: + _globals->_sceneManager.changeScene(2320); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene7600::postInit(SceneObjectList *OwnerList) { + Scene::postInit(); + setZoomPercents(100, 0, 200, 100); + + _object2.postInit(); + _object2.setVisage(7601); + _object2.setStrip(1); + _object2.animate(ANIM_MODE_2, 0); + _object2.setPosition(Common::Point(48, 135)); + _object2.setPriority2(1); + + _object3.postInit(); + _object3.setVisage(7601); + _object3.setStrip(2); + _object3.animate(ANIM_MODE_2, 0); + _object3.setPosition(Common::Point(158, 136)); + _object3.setPriority2(1); + + _object4.postInit(); + _object4.setVisage(7601); + _object4.setStrip(3); + _object4.animate(ANIM_MODE_2, 0); + _object4.setPosition(Common::Point(293, 141)); + _object4.setPriority2(1); + + _object5.postInit(); + _object5.setVisage(7601); + _object5.setStrip(4); + _object5.animate(ANIM_MODE_2, 0); + _object5.setPosition(Common::Point(405, 143)); + _object5.setPriority2(1); + + _object6.postInit(); + _object6.setVisage(7601); + _object6.setStrip(5); + _object6.animate(ANIM_MODE_2, 0); + _object6.setPosition(Common::Point(379, 191)); + _object6.setPriority2(1); + + _globals->_player.postInit(); + _globals->_player.setVisage(2333); + _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.setObjectWrapper(new SceneObjectWrapper()); + _globals->_player.setStrip(1); + _globals->_player._moveDiff = Common::Point(16, 16); + _globals->_player.changeZoom(-1); + _globals->_player.disableControl(); + + if (_globals->_sceneManager._previousScene == 7700) { + _globals->_player.setPosition(Common::Point(389, 57)); + setAction(&_action2); + } else { + _globals->_player.setPosition(Common::Point(-50, 195)); + setAction(&_action1); + } + _sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y); + loadScene(7600); + _soundHandler2.startSound(255); + _soundHandler1.startSound(251); +} + +/*-------------------------------------------------------------------------- + * Scene 7700 + * + *--------------------------------------------------------------------------*/ + +void Scene7700::Action1::signal() { + SceneObject *fmtObj = (SceneObject *) _fmt; + switch (_actionIndex++) { + case 0: { + PlayerMover *mover1 = new PlayerMover(); + Common::Point pt = Common::Point(fmtObj->_position.x, fmtObj->_position.y + 30); + _globals->_player.addMover(mover1, &pt, this); + break; + } + case 1: + _globals->_player.checkAngle(fmtObj); + if (_globals->_player._field8C == 0) + fmtObj->animate(ANIM_MODE_5, this); + else + fmtObj->animate(ANIM_MODE_6, this); + break; + case 2: + remove(); + break; + } +} + +void Scene7700::Action2::signal() { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + switch (_actionIndex++) { + case 0: + case 2: + setDelay(_globals->_randomSource.getRandomNumber(60) + 60); + break; + case 1: + scene->_prof.animate(ANIM_MODE_7, 0, 0); + setDelay(20); + break; + case 3: + scene->_prof.animate(ANIM_MODE_6, this); + _actionIndex = 0; + break; + } +} + +void Scene7700::Action3::signal() { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + switch (_actionIndex++) { + case 0: + scene->_object15.animate(ANIM_MODE_5, this); + break; + case 1: + scene->_sceneItem10.remove(); + scene->_object15.remove(); + scene->_sceneHotspot8.remove(); + scene->_sceneHotspot9.remove(); + scene->_object19.remove(); + setDelay(60); + // No break on purpose! + case 2: + scene->_soundHandler.startSound(260, 0, 127); + scene->_object8.setVisage(7703); + scene->_object8.setPosition(Common::Point(177, 97), 0); + scene->_object8.setStrip2(3); + scene->_object8.animate(ANIM_MODE_5, this); + scene->_object8._numFrames = 3; + break; + case 3: + _globals->_player.enableControl(); + remove(); + break; + } +} + +void Scene7700::Action4::signal() { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + switch (_actionIndex++) { + case 2: + scene->_object13.remove(); + // No break on purpose! + case 0: + setDelay(3); + break; + case 1: + CursorMan.showMouse(false); + scene->_object13.postInit(); + scene->_object13.setVisage(7700); + scene->_object13.setStrip2(7); + scene->_object13.setPosition(Common::Point(151, 33), 0); + scene->_object13.animate(ANIM_MODE_5, this); + break; + case 3: + CursorMan.showMouse(true); + SceneItem::display(7700, 11, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + _globals->_player.enableControl(); + remove(); + break; + } +} + +void Scene7700::Action5::signal() { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + switch (_actionIndex++) { + case 0: + setDelay(_globals->_randomSource.getRandomNumber(240)); + break; + case 1: { + scene->_cloud.setFrame(_globals->_randomSource.getRandomNumber(1) + 1); + scene->_cloud.setPosition(Common::Point(133, 145 + _globals->_randomSource.getRandomNumber(54)), 0); + + Common::Point pt(360, scene->_cloud._position.y); + NpcMover *mover = new NpcMover(); + scene->_cloud.addMover(mover, &pt, this); + _actionIndex = 0; + break; + } + } +} + +void Scene7700::Action6::signal() { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + switch (_actionIndex++) { + case 0: + setDelay(5); + break; + case 1: { + Common::Point pt(2, 66); + NpcMover *mover = new NpcMover(); + scene->_easterEgg1.addMover(mover, &pt, this); + break; + } + case 2: + scene->_easterEgg1.setStrip(2); + scene->_easterEgg1.setPosition(Common::Point(43, 65), 0); + + scene->_easterEgg2.postInit(); + scene->_easterEgg2.setVisage(7708); + scene->_easterEgg2.setStrip(3); + scene->_easterEgg2.setPosition(Common::Point(116, 54), 0); + scene->_easterEgg2.animate(ANIM_MODE_2, 0); + + setDelay(120); + break; + case 3: + scene->_easterEgg1.remove(); + scene->_easterEgg2.remove(); + remove(); + break; + } +} + +void Scene7700::SceneHotspot1::doAction(int action) { + if (action == CURSOR_LOOK) + SceneItem::display(7700, 4, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneHotspot::doAction(action); +} + +void Scene7700::SceneHotspot2::doAction(int action) { + if (action == CURSOR_LOOK) + SceneItem::display(7700, 6, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneHotspot::doAction(action); +} + +void Scene7700::SceneHotspot3::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case OBJECT_KEY: + SceneItem::display(7702, 3, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + _globals->_inventory._key._sceneNumber = 7700; + break; + case CURSOR_LOOK: + if (_globals->_inventory._key._sceneNumber == 7700) + scene->setAction(&scene->_action4, 0); + else + SceneItem::display(7700, 53, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (!_globals->getFlag(78)) { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + } else if (_globals->_inventory._key._sceneNumber == 7700) { + _globals->_player.disableControl(); + scene->_sceneMode = 7705; + scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, 0); + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneHotspot4::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (!_globals->getFlag(78)) { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + } else { + SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneHotspot5::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 28, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (_globals->getFlag(78)) { + if (_globals->_inventory._paper._sceneNumber == 7700) { + _globals->_player.disableControl(); + scene->_sceneMode = 7708; + scene->setAction(&scene->_sequenceManager, scene, 7708, &_globals->_player, 0); + } + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneHotspot6::doAction(int action) { + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 43, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + SceneItem::display(7700, 56, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneItem7::doAction(int action) { + if (action == CURSOR_LOOK) + SceneItem::display(7700, 51, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); +} + +void Scene7700::SceneHotspot8::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + scene->_sceneMode = 7709; + scene->_soundHandler.startSound(259, 0, 127); + scene->_object15.setFrame(scene->_object15.getFrameCount()); + scene->_object15.animate(ANIM_MODE_6, scene); + if ((scene->_field977 == 2) && (scene->_field97B == 0)) { + scene->_field979++; + } else { + scene->_field97B = 0; + scene->_field979 = 0; + scene->_field977 = 0; + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneHotspot9::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + scene->_sceneMode = 7709; + scene->_soundHandler.startSound(259, 0, 127); + scene->_object15.setFrame(1); + scene->_object15.animate(ANIM_MODE_5, scene); + if (scene->_field977 > 2) { + scene->_field97B = 0; + scene->_field979 = 0; + scene->_field977 = 0; + } + + if (scene->_field979 != 0) { + if (scene->_field979 != 4) { + scene->_field97B = 0; + scene->_field979 = 0; + scene->_field977 = 0; + } else { + scene->_field97B++; + if (scene->_field97B == 3) { + _globals->_player.disableControl(); + scene->setAction(&scene->_action3); + } + } + } else { + scene->_field977++; + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::SceneItem10::doAction(int action) { +} + +void Scene7700::Object1::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + if (action == CURSOR_LOOK) { + SceneItem::display(7700, _field88, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else if (action == CURSOR_USE) { + if (_globals->getFlag(78)) { + _globals->_player.disableControl(); + scene->setAction(&scene->_action1, this); + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + } + } else { + SceneHotspot::doAction(action); + } +} + +void Scene7700::SceneHotspot11::doAction(int action) { + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, _field28, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + SceneItem::display(7701, _field26, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::Object1::signal() { + if (_state == 0) { + _state = 1; + SceneItem::display(7701, _field8A, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else { + _state = 0; + } + _globals->_player.enableControl(); +} + +void Scene7700::Object3::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + if (action == CURSOR_LOOK) { + SceneItem::display(7700, 34, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else if (action == CURSOR_USE) { + if (_globals->getFlag(78)) { + if (scene->_object3._frame == 1) { + _globals->_player.disableControl(); + scene->_sceneMode = 7707; + scene->setAction(&scene->_sequenceManager, scene, 7707, &_globals->_player, this, 0); + } else { + SceneItem::display(7700, 60, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + } + } else { + SceneHotspot::doAction(action); + } +} + +void Scene7700::Object7::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + if (_globals->getFlag(78)) + SceneItem::display(7700, 45, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneItem::display(7700, 44, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (_globals->getFlag(78)) { + SceneItem::display(7701, 41, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7714, 0); + } + break; + case CURSOR_TALK: + if (_globals->getFlag(78)) { + SceneItem::display(7702, 1, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else { + _globals->_player.disableControl(); + if (_state == 0) { + _state = 1; + scene->_sceneMode = 7703; + scene->setAction(&scene->_sequenceManager, scene, 7703, 0); + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7712, 0); + } + } + break; + case OBJECT_STUNNER: + if (!_globals->getFlag(78)) { + _globals->_soundHandler.proc3(); + _globals->setFlag(78); + setAction(0); + _globals->_player.disableControl(); + scene->_sceneMode = 7704; + scene->setAction(&scene->_sequenceManager, scene, 7704, &_globals->_player, this, 0); + } + break; + default: + SceneHotspot::doAction(action); + break; + } +} + +void Scene7700::Object8::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + if ((action == CURSOR_LOOK) || (action == CURSOR_USE)) { + if (_strip == 3) { + scene->_object9.postInit(); + scene->_object9.setVisage(7701); + scene->_object9.setStrip2(3); + scene->_object9.setPosition(Common::Point(91, 166), 0); + scene->_object9.setPriority2(200); + + scene->_object14.postInit(); + scene->_object14.setVisage(7701); + scene->_object14.setStrip(2); + scene->_object14.setPriority2(250); + scene->_object14.setPosition(Common::Point(139, 151), 0); + + scene->_gfxButton.setText(EXIT_MSG); + scene->_gfxButton._bounds.centre(140, 189); + scene->_gfxButton.draw(); + scene->_gfxButton._bounds.expandPanes(); + + _globals->_sceneItems.push_front(&scene->_object10); + _globals->_sceneItems.push_front(&scene->_object9); + _globals->_player._canWalk = false; + } else { + scene->_object15.postInit(); + scene->_object15.setVisage(7701); + scene->_object15.setPosition(Common::Point(140, 165), 0); + scene->_object15.setPriority2(200); + + scene->_gfxButton.setText(EXIT_MSG); + scene->_gfxButton._bounds.centre(140, 186); + scene->_gfxButton.draw(); + scene->_gfxButton._bounds.expandPanes(); + + scene->_object19.postInit(); + scene->_object19.setVisage(7700); + scene->_object19.setStrip(6); + scene->_object19.setPosition(Common::Point(140, 192), 0); + + _globals->_sceneItems.push_front(&scene->_object10); + _globals->_sceneItems.push_front(&scene->_object8); + _globals->_sceneItems.push_front(&scene->_object9); + _globals->_events.setCursor(CURSOR_WALK); + _globals->_player._canWalk = false; + } + } else { + SceneHotspot::doAction(action); + } +} + +void Scene7700::Object9::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + SceneItem::display(7700, 49, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + SceneItem::display(7701, 42, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_TALK: + SceneItem::display(7702, 4, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case OBJECT_KEY: + if (_frame == 1) { + if (!_globals->getFlag(80)) { + scene->_object10.postInit(); + scene->_object10.setVisage(7701); + scene->_object10.setStrip(4); + scene->_object10.setPosition(Common::Point(159, 136)); + _globals->_sceneItems.push_front(&scene->_object10); + scene->_object10.setPriority2(240); + } + scene->_soundHandler.startSound(262, 0, 127); + scene->_object14.animate(ANIM_MODE_5, 0); + } + _globals->_events.setCursor(CURSOR_WALK); + break; + default: + SceneHotspot::doAction(action); + } +} + +void Scene7700::Object10::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + if (action == CURSOR_LOOK) { + SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else if (action == CURSOR_USE) { + _globals->setFlag(80); + scene->_sceneItem10.remove(); + scene->_gfxButton._bounds.expandPanes(); + scene->_object14.remove(); + scene->_object9.remove(); + remove(); + } else { + SceneHotspot::doAction(action); + } +} + +void Scene7700::Object11::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + switch (action) { + case OBJECT_SCANNER: + if (_frame != 1) + SceneItem::display(7701, 44, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneItem::doAction(action); + break; + case CURSOR_LOOK: + if (_frame != 1) + SceneItem::display(7700, 9, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + else + SceneItem::display(7700, 52, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case CURSOR_USE: + if (_frame != 1) { + SceneItem::display(7701, 8, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else { + _globals->setFlag(49); + _globals->_player.disableControl(); + scene->_sceneMode = 7706; + scene->setAction(&scene->_sequenceManager, scene, 7706, &_globals->_player, this, NULL); + } + break; + case OBJECT_EMPTY_JAR: + _globals->_inventory._emptyJar._sceneNumber = 0; + _globals->_inventory._jar._sceneNumber = 1; + _globals->_player.disableControl(); + scene->_sceneMode = 7710; + scene->setAction(&scene->_sequenceManager, scene, 7710, &_globals->_player, NULL); + break; + default: + SceneHotspot::doAction(action); + } +} + +void Scene7700::Object12::doAction(int action) { + Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; + + if (action == CURSOR_LOOK) { + SceneItem::display(7700, 15, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + } else if (action == CURSOR_USE) { + if (_globals->getFlag(78)) { + scene->_sceneMode = 7713; + scene->setAction(&scene->_sequenceManager, scene, 7713, &_globals->_player, NULL); + } else { + scene->_sceneMode = 7712; + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); + } + } else { + SceneHotspot::doAction(action); + } +} + +void Scene7700::signal() { + switch (_sceneMode) { + case 7701: + _globals->_player.setPriority2(-1); + _globals->_player.setStrip2(-1); + if (_globals->getFlag(78)) { + _globals->_player.enableControl(); + } else { + _sceneMode = 7711; + setAction(&_sequenceManager, this, 7711, 0); + } + break; + case 7702: + _soundHandler.proc1(0); + _globals->_sceneManager.changeScene(7600); + break; + case 7703: + case 7706: + case 7707: + case 7711: + case 7712: + _globals->_player.enableControl(); + break; + case 7704: + _globals->_soundHandler.startSound(256, 0, 127); + _prof.setStrip2(4); + _prof.setFrame2(1); + _prof.setPosition(Common::Point(159, 87), 0); + _globals->_player.enableControl(); + break; + case 7705: + case 7708: + _globals->_inventory._key._sceneNumber = 1; + _globals->_player.enableControl(); + break; + case 7709: + _globals->_events.setCursor(CURSOR_USE); + break; + case 7710: + _globals->_player.enableControl(); + SceneItem::display(7700, 62, SET_WIDTH, 200, SET_EXT_BGCOLOUR, 7, LIST_END); + break; + case 7713: + _emptyJar.remove(); + _globals->_inventory._emptyJar._sceneNumber = 1; + break; + default: + break; + } +} + +void Scene7700::process(Event &event) { + Scene::process(event); + + if (_globals->_sceneItems.contains(&_sceneItem10)) { + if (_gfxButton.process(event)) { + _sceneItem10.remove(); + _sceneHotspot15.remove(); + _sceneHotspot9.remove(); + if (_globals->_sceneObjects->contains(&_object10)) + _object10.remove(); + if (_globals->_sceneObjects->contains(&_object14)) + _object14.remove(); + _object19.remove(); + _gfxButton._bounds.expandPanes(); + _globals->_player._canWalk = true; + } + } + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_p)) { + event.handled = true; + if (!_globals->_sceneObjects->contains(&_easterEgg1)) { + _easterEgg1.postInit(); + _easterEgg1.setVisage(7708); + _easterEgg1.setPosition(Common::Point(163, 50), 0); + _easterEgg1.setPriority2(1); + _easterEgg1.animate(ANIM_MODE_2, 0); + _easterEgg1.setAction(&_action6); + } + } +} + +void Scene7700::dispatch() { + if ((_globals->_sceneRegions.indexOf(_globals->_player._position) == 6) || (_globals->_player._position.x < 10)) + _globals->_player.changeZoom(100 - ((_globals->_player._position.y - 68) / 2)); + else + _globals->_player.changeZoom(-1); + + if ((_action == 0) && (_globals->_sceneRegions.indexOf(_globals->_player._position) == 30)) { + _globals->_player.disableControl(); + _sceneMode = 7702; + setAction(&_sequenceManager, this, 7702, &_globals->_player, 0); + } + Scene::dispatch(); +} + +void Scene7700::postInit(SceneObjectList *OwnerList) { + loadScene(7700); + Scene::postInit(); + setZoomPercents(100, 80, 200, 100); + _globals->setFlag(53); + _field97B = 0; + _field979 = 0; + _field977 = 0; + + _stripManager.addSpeaker(&_speakerEText); + _stripManager.addSpeaker(&_speakerQText); + _speakerQText._npc = &_globals->_player; + _speakerEText._npc = &_prof; + + _globals->_player.postInit(); + _globals->_player.setVisage(4201); + _globals->_player.animate(ANIM_MODE_1, 0); + SceneObjectWrapper *wrapper = new SceneObjectWrapper(); + _globals->_player.setObjectWrapper(wrapper); + _globals->_player.setPosition(Common::Point(-19, 68), 0); + _globals->_player.setStrip2(7); + _globals->_player.setPriority2(95); + _globals->_player.changeZoom(80); + _globals->_player._moveDiff.x = 6; + _globals->_player._moveDiff.y = 3; + _globals->_player.disableControl(); + + _prof.postInit(); + _prof.setVisage(7706); + + if (_globals->getFlag(78)) { + _prof.setStrip2(4); + _prof.setPriority2(80); + _prof.setPosition(Common::Point(159, 87), 0); + } else { + _prof.setPosition(Common::Point(203, 87), 0); + _prof.setStrip2(2); + _prof._numFrames = 6; + _prof.setAction(&_action2); + } + + _cloud.postInit(); + _cloud.setVisage(7700); + _cloud.setStrip2(5); + _cloud.setPriority2(1); + _cloud.setPosition(Common::Point(133, 160), 0); + _cloud._moveDiff.x = 1; + _cloud._field7A = 7; + _cloud.setAction(&_action5); + + _object1.postInit(); + _object1.setVisage(7700); + _object1.setPosition(Common::Point(184, 61), 0); + _object1._field88 = 18; + _object1._field8A = 16; + + _object2.postInit(); + _object2.setVisage(7700); + _object2.setPosition(Common::Point(184, 70), 0); + _object2.setPriority2(60); + _object2._field88 = 19; + _object2._field8A = 17; + + _object3.postInit(); + _object3.setVisage(7703); + _object3.setPosition(Common::Point(288, 36), 0); + _object3.setStrip(2); + + _object4.postInit(); + _object4.setVisage(7700); + _object4.setPosition(Common::Point(268, 59), 0); + _object4.setStrip(2); + _object4._field88 = 37; + _object4._field8A = 35; + + _object5.postInit(); + _object5.setVisage(7700); + _object5.setPosition(Common::Point(268, 67), 0); + _object5.setPriority2(58); + _object5.setStrip2(3); + _object5._field88 = 38; + _object5._field8A = 36; + + _object6.postInit(); + _object6.setVisage(7700); + _object6.setPosition(Common::Point(268, 75), 0); + _object6.setPriority2(57); + _object6.setStrip2(4); + _object6._field88 = 40; + _object6._field8A = 43; + + _object8.postInit(); + _object8.setVisage(7703); + _object8.setPosition(Common::Point(203, 91), 0); + _object8.setStrip2(4); + _object8.setPriority2(86); + + _sceneHotspot8.setBounds(82, 141, 161, 92); + _sceneHotspot9.setBounds(82, 187, 161, 141); + + _cork.postInit(); + _cork.setVisage(7703); + _cork.setPosition(Common::Point(32, 128), 0); + + if (_globals->getFlag(49)) + _cork.setFrame(_cork.getFrameCount()); + + if (_globals->_inventory._emptyJar._sceneNumber == 7700) { + _emptyJar.postInit(); + _emptyJar.setVisage(7700); + _emptyJar.setStrip(8); + _emptyJar.setPosition(Common::Point(189, 48), 0); + _globals->_sceneItems.addItems(&_emptyJar, NULL); + } + _sceneHotspot1._sceneRegionId = 28; + _sceneHotspot2._sceneRegionId = 6; + _sceneHotspot3._sceneRegionId = 10; + _sceneHotspot4._sceneRegionId = 11; + _sceneHotspot5._sceneRegionId = 9; + _sceneHotspot6._sceneRegionId = 7; + + _sceneItem7.setBounds(0, 320, 200, 0); + _sceneItem10.setBounds(0, 320, 200, 0); + + _sceneHotspot11._sceneRegionId = 57; + _sceneHotspot11._field26 = 0; + _sceneHotspot11._field28 = 0; + _sceneHotspot12._sceneRegionId = 2; + _sceneHotspot12._field26 = 2; + _sceneHotspot12._field28 = 2; + _sceneHotspot13._sceneRegionId = 12; + _sceneHotspot13._field26 = 3; + _sceneHotspot13._field28 = 3; + _sceneHotspot14._sceneRegionId = 18; + _sceneHotspot14._field26 = 4; + _sceneHotspot14._field28 = 5; + _sceneHotspot15.setBounds(0, 55, 50, 8); + _sceneHotspot15._field26 = 6; + _sceneHotspot15._field28 = 7; + _sceneHotspot16.setBounds(0, 130, 34, 103); + _sceneHotspot16._field26 = 8; + _sceneHotspot16._field28 = 9; + _sceneHotspot17.setBounds(41, 180, 46, 170); + _sceneHotspot17._field26 = 11; + _sceneHotspot17._field28 = 13; + _sceneHotspot18.setBounds(38, 187, 46, 180); + _sceneHotspot18._field26 = 12; + _sceneHotspot18._field28 = 14; + _sceneHotspot19._sceneRegionId = 3; + _sceneHotspot19._field26 = 14; + _sceneHotspot19._field28 = 16; + _sceneHotspot20._sceneRegionId = 14; + _sceneHotspot20._field26 = 15; + _sceneHotspot20._field28 = 17; + _sceneHotspot21.setBounds(9, 215, 26, 210); + _sceneHotspot21._field26 = 18; + _sceneHotspot21._field28 = 20; + _sceneHotspot22.setBounds(10, 221, 26, 215); + _sceneHotspot22._field26 = 19; + _sceneHotspot22._field28 = 21; + _sceneHotspot23.setBounds(6, 230, 26, 225); + _sceneHotspot23._field26 = 20; + _sceneHotspot23._field28 = 22; + _sceneHotspot24._sceneRegionId = 13; + _sceneHotspot24._field26 = 21; + _sceneHotspot24._field28 = 23; + _sceneHotspot25._sceneRegionId = 21; + _sceneHotspot25._field26 = 22; + _sceneHotspot25._field28 = 24; + _sceneHotspot26._sceneRegionId = 19; + _sceneHotspot26._field26 = 23; + _sceneHotspot26._field28 = 25; + _sceneHotspot27._sceneRegionId = 27; + _sceneHotspot27._field26 = 24; + _sceneHotspot27._field28 = 26; + _sceneHotspot28._sceneRegionId = 15; + _sceneHotspot28._field26 = 25; + _sceneHotspot28._field28 = 27; + _sceneHotspot29._sceneRegionId = 26; + _sceneHotspot29._field26 = 27; + _sceneHotspot29._field28 = 29; + _sceneHotspot30.setBounds(0, 317, 34, 310); + _sceneHotspot30._field26 = 28; + _sceneHotspot30._field28 = 30; + _sceneHotspot31._sceneRegionId = 17; + _sceneHotspot31._field26 = 29; + _sceneHotspot31._field28 = 31; + _sceneHotspot32._sceneRegionId = 25; + _sceneHotspot32._field26 = 30; + _sceneHotspot32._field28 = 32; + _sceneHotspot33._sceneRegionId = 5; + _sceneHotspot33._field26 = 31; + _sceneHotspot33._field28 = 33; + _sceneHotspot34.setBounds(42, 292, 48, 281); + _sceneHotspot34._field26 = 32; + _sceneHotspot34._field28 = 35; + _sceneHotspot35._sceneRegionId = 24; + _sceneHotspot35._field26 = 38; + _sceneHotspot35._field28 = 41; + _sceneHotspot36._sceneRegionId = 1; + _sceneHotspot36._field26 = 39; + _sceneHotspot36._field28 = 42; + + _globals->_sceneItems.addItems(&_prof, &_sceneHotspot35, &_object8, &_sceneHotspot34, &_sceneHotspot33, &_sceneHotspot32, NULL); + _globals->_sceneItems.addItems(&_sceneHotspot31, &_sceneHotspot30, &_sceneHotspot29, &_sceneHotspot5, &_sceneHotspot28, &_sceneHotspot27, NULL); + _globals->_sceneItems.addItems(&_sceneHotspot26, &_sceneHotspot25, &_sceneHotspot24, &_sceneHotspot23, &_sceneHotspot22, &_sceneHotspot21, NULL); + _globals->_sceneItems.addItems(&_sceneHotspot20, &_sceneHotspot19, &_sceneHotspot18, &_sceneHotspot17, &_sceneHotspot4, &_sceneHotspot3, NULL); + _globals->_sceneItems.addItems(&_sceneHotspot16, &_sceneHotspot15, &_sceneHotspot2, &_sceneHotspot14, &_cork, &_sceneHotspot1, NULL); + _globals->_sceneItems.addItems(&_sceneHotspot13, &_sceneHotspot12, &_sceneHotspot11, &_object2, &_object1, &_object3, NULL); + _globals->_sceneItems.addItems(&_object6, &_object5, &_object4, &_sceneHotspot6, &_sceneHotspot36, &_sceneItem7, NULL); + + _sceneMode = 7701; + setAction(&_sequenceManager, this, 7701, &_globals->_player, 0); + _soundHandler.startSound(256, 0, 127); +} + +Scene7700::Scene7700() { + _object1._state = 0; + _object2._state = 0; + _object3._state = 0; + _object4._state = 0; + _object5._state = 0; + _object6._state = 0; + _prof._state = 0; +} + +} // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h new file mode 100644 index 0000000000..406ba0894f --- /dev/null +++ b/engines/tsage/ringworld_scenes8.h @@ -0,0 +1,475 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL: https://scummvm-misc.svn.sourceforge.net/svnroot/scummvm-misc/trunk/engines/tsage/scene_logic.h $ + * $Id: scene_logic.h 232 2011-02-12 11:56:38Z dreammaster $ + * + */ + +#ifndef TSAGE_RINGWORLD_SCENES8_H +#define TSAGE_RINGWORLD_SCENES8_H + +#include "common/scummsys.h" +#include "tsage/ringworld_logic.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" + +namespace tSage { + +class Scene7000: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + class Action3: public Action { + public: + virtual void dispatch(); + virtual void signal(); + }; + class Action4: public Action { + public: + virtual void signal(); + }; + class Action5: public Action { + public: + virtual void signal(); + }; + class Action6: public Action { + public: + virtual void signal(); + }; + class Action7: public Action { + public: + virtual void signal(); + }; + + /* Objects */ + class Object1: public SceneObject { + public: + virtual void doAction(int action); + }; + + /* Items */ + class SceneItem1: public SceneItem { + public: + virtual void doAction(int action); + }; + +public: + SoundHandler _soundHandler; + SequenceManager _sequenceManager; + SpeakerSKText _speakerSKText; + SpeakerSKL _speakerSKL; + SpeakerQL _speakerQL; + SpeakerQR _speakerQR; + SpeakerQText _speakerQText; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SceneObject _object7; + SceneObject _object8; + SceneObject _object9; + SceneObject _object10; + Action1 _action1; + Action2 _action2; + Action3 _action3; + Action4 _action4; + Action5 _action5; + Action6 _action6; + Action7 _action7; + SceneItem1 _sceneItem1; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void dispatch(); +}; + +class Scene7100: public Scene { + /* Actions */ + class Action3: public Action { + public: + virtual void signal(); + }; + class Action4: public Action { + public: + virtual void signal(); + }; + class Action5: public Action { + public: + virtual void signal(); + }; + class Action6: public Action { + public: + virtual void signal(); + }; + class Action7: public Action { + public: + virtual void signal(); + }; + class Action8: public Action { + public: + virtual void signal(); + }; + class Action9: public Action { + public: + virtual void signal(); + }; + class Action10: public Action { + public: + virtual void signal(); + }; + class Action11: public Action { + public: + virtual void signal(); + }; + +public: + SoundHandler _soundHandler1; + SoundHandler _soundHandler2; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SceneObject _object7; + SceneObject _object8; + SceneObject _object9; + SceneObject _object10; + SceneObject _object11; + SceneObject _object12; + SceneObject _object13; + SceneObject _object14; + SceneObject _object15; + SceneObject _object16; + SceneObject _object17; + SceneObject _object18; + SceneObject _object19; + SceneObject _object20; + SceneObject _object21; + SceneObject _object22; + SceneObject _object23; + SceneObject _object24; + SceneObject _object25; + Action _action1; + Action _action2; + Action3 _action3; + Action4 _action4; + Action5 _action5; + Action6 _action6; + Action7 _action7; + Action8 _action8; + Action9 _action9; + Action10 _action10; + Action11 _action11; + + virtual void postInit(SceneObjectList *OwnerList = NULL); +}; + +class Scene7200: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + +public: + Action1 _action1; + Action2 _action2; + SceneObject _swimmer; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SceneObject _object7; + SceneObject _object8; + SceneObject _object9; + SoundHandler _soundHandler; + + virtual void postInit(SceneObjectList *OwnerList = NULL); +}; + +class Scene7300: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + class Action3: public Action { + public: + virtual void signal(); + }; + class Action4: public Action { + public: + virtual void signal(); + }; + +public: + SpeakerPOR _speakerPOR; + SpeakerPOText _speakerPOText; + SpeakerSKText _speakerSKText; + SpeakerQU _speakerQU; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SceneObject _object7; + SceneObject _object8; + Action1 _action1; + Action2 _action2; + Action3 _action3; + Action4 _action4; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void dispatch(); +}; + +class Scene7600: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + +public: + Action1 _action1; + Action2 _action2; + SceneObject _object1; + SceneObject _object2; + SceneObject _object3; + SceneObject _object4; + SceneObject _object5; + SceneObject _object6; + SoundHandler _soundHandler1; + SoundHandler _soundHandler2; + + virtual void postInit(SceneObjectList *OwnerList = NULL); +}; + +class Scene7700: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + class Action3: public Action { + public: + virtual void signal(); + }; + class Action4: public Action { + public: + virtual void signal(); + }; + class Action5: public Action { + public: + virtual void signal(); + }; + class Action6: public Action { + public: + virtual void signal(); + }; + + class Object1: public SceneObject3 { + public: + virtual void signal(); + virtual void doAction(int action); + }; + class Object3: public SceneObject3 { + public: + virtual void doAction(int action); + }; + class Object7: public SceneObjectExt { + public: + virtual void doAction(int action); + }; + class Object8: public SceneObject { + public: + virtual void doAction(int action); + }; + class Object9: public SceneObject { + public: + virtual void doAction(int action); + }; + class Object10: public SceneObject { + public: + virtual void doAction(int action); + }; + class Object11: public SceneObject { + public: + virtual void doAction(int action); + }; + class Object12: public SceneObject { + public: + virtual void doAction(int action); + }; + + /* Items */ + class SceneHotspot1: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot2: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot3: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot4: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot5: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot6: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneItem7: public SceneItem { + public: + virtual void doAction(int action); + }; + class SceneHotspot8: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneHotspot9: public SceneHotspot { + public: + virtual void doAction(int action); + }; + class SceneItem10: public SceneItem { + public: + virtual void doAction(int action); + }; + class SceneHotspot11: public SceneHotspot_2 { + public: + virtual void doAction(int action); + }; +public: + SoundHandler _soundHandler; + SequenceManager _sequenceManager; + GfxButton _gfxButton; + SpeakerEText _speakerEText; + SpeakerQText _speakerQText; + Object1 _object1; + Object1 _object2; + Object3 _object3; + Object1 _object4; + Object1 _object5; + Object1 _object6; + Object7 _prof; + Object8 _object8; + Object9 _object9; + Object10 _object10; + Object11 _cork; + Object12 _emptyJar; + SceneObject _object13; + SceneObject _object14; + SceneObject _object15; + SceneObject _cloud; + SceneObject _easterEgg1; + SceneObject _easterEgg2; + SceneObject _object19; + Action1 _action1; + Action2 _action2; + Action3 _action3; + Action4 _action4; + Action5 _action5; + Action6 _action6; + SceneHotspot1 _sceneHotspot1; + SceneHotspot2 _sceneHotspot2; + SceneHotspot3 _sceneHotspot3; + SceneHotspot4 _sceneHotspot4; + SceneHotspot5 _sceneHotspot5; + SceneHotspot6 _sceneHotspot6; + SceneItem7 _sceneItem7; + SceneHotspot8 _sceneHotspot8; + SceneHotspot9 _sceneHotspot9; + SceneItem10 _sceneItem10; + SceneHotspot11 _sceneHotspot11; + SceneHotspot11 _sceneHotspot12; + SceneHotspot11 _sceneHotspot13; + SceneHotspot11 _sceneHotspot14; + SceneHotspot11 _sceneHotspot15; + SceneHotspot11 _sceneHotspot16; + SceneHotspot11 _sceneHotspot17; + SceneHotspot11 _sceneHotspot18; + SceneHotspot11 _sceneHotspot19; + SceneHotspot11 _sceneHotspot20; + SceneHotspot11 _sceneHotspot21; + SceneHotspot11 _sceneHotspot22; + SceneHotspot11 _sceneHotspot23; + SceneHotspot11 _sceneHotspot24; + SceneHotspot11 _sceneHotspot25; + SceneHotspot11 _sceneHotspot26; + SceneHotspot11 _sceneHotspot27; + SceneHotspot11 _sceneHotspot28; + SceneHotspot11 _sceneHotspot29; + SceneHotspot11 _sceneHotspot30; + SceneHotspot11 _sceneHotspot31; + SceneHotspot11 _sceneHotspot32; + SceneHotspot11 _sceneHotspot33; + SceneHotspot11 _sceneHotspot34; + SceneHotspot11 _sceneHotspot35; + SceneHotspot11 _sceneHotspot36; + int _field977, _field979, _field97B; + + Scene7700(); + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void process(Event &event); + virtual void dispatch(); +}; + +} // End of namespace tSage + +#endif |