aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-03-23 22:56:51 +1100
committerPaul Gilbert2011-03-23 22:56:51 +1100
commitf612695a33288729062293a6e4fb33d343244054 (patch)
treed77ef24eb5af451670331ca2024fc600c42d4304 /engines
parent5e6cc67e2e9b4ccd2cf6b02ec6b1a92841eae421 (diff)
downloadscummvm-rg350-f612695a33288729062293a6e4fb33d343244054.tar.gz
scummvm-rg350-f612695a33288729062293a6e4fb33d343244054.tar.bz2
scummvm-rg350-f612695a33288729062293a6e4fb33d343244054.zip
TSAGE: Implemented Scene #4045 - Temple Antechamber
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/ringworld_logic.cpp47
-rw-r--r--engines/tsage/ringworld_logic.h11
-rw-r--r--engines/tsage/ringworld_scenes5.cpp351
-rw-r--r--engines/tsage/ringworld_scenes5.h55
4 files changed, 464 insertions, 0 deletions
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index 19128d0d07..5d6c76e806 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -112,6 +112,8 @@ Scene *SceneFactory::createScene(int sceneNumber) {
case 4010: return new Scene4010();
// Village - Puzzle Board
case 4025: return new Scene4025();
+ // Village - Temple Antechamber
+ case 4045: return new Scene4045();
/* Scene group 6 */
@@ -729,4 +731,49 @@ void SpeakerPL::removeText() {
AnimatedSpeaker::removeText();
}
+/*--------------------------------------------------------------------------*/
+
+SpeakerPR::SpeakerPR() {
+ _speakerName = "PR";
+ _newSceneNumber = 4061;
+ _textPos = Common::Point(10, 40);
+ _colour1 = 5;
+}
+
+void SpeakerPR::setText(const Common::String &msg) {
+ _object1.postInit(&_objectList);
+ _object1.setVisage(4063);
+ _object1.setStrip2(1);
+ _object1.setPriority2(255);
+ _object1.changeZoom(100);
+ _object1._frame = 1;
+ _object1.setPosition(Common::Point(212, 117));
+ _object1.animate(ANIM_MODE_7, 0, NULL);
+
+ _object2.postInit(&_objectList);
+ _object2.setVisage(4063);
+ _object2.setStrip2(2);
+ _object2.setPriority2(200);
+ _object2.changeZoom(100);
+ _object2._frame = 1;
+ _object2.setPosition(Common::Point(214, 62));
+ _object2.setAction(&_speakerAction, NULL);
+
+ _object3.postInit(&_objectList);
+ _object3.setVisage(4063);
+ _object3.setStrip2(3);
+ _object3.setPriority2(255);
+ _object3.changeZoom(100);
+ _object3._frame = 1;
+ _object3.setPosition(Common::Point(214, 59));
+ _object3.setAction(&_speakerAction2, NULL);
+
+ Speaker::setText(msg);
+}
+
+void SpeakerPR::removeText() {
+ _object3.remove();
+ AnimatedSpeaker::removeText();
+}
+
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_logic.h b/engines/tsage/ringworld_logic.h
index 80e010a3da..0056595fb6 100644
--- a/engines/tsage/ringworld_logic.h
+++ b/engines/tsage/ringworld_logic.h
@@ -266,6 +266,17 @@ public:
virtual void removeText();
};
+class SpeakerPR: public AnimatedSpeaker {
+public:
+ SceneObject _object3;
+ SpeakerAction _speakerAction2;
+
+ SpeakerPR();
+
+ virtual Common::String getClassName() { return "SpeakerPR"; }
+ virtual void setText(const Common::String &msg);
+ virtual void removeText();
+};
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp
index 5eb0decb2b..1884b2a965 100644
--- a/engines/tsage/ringworld_scenes5.cpp
+++ b/engines/tsage/ringworld_scenes5.cpp
@@ -1624,5 +1624,356 @@ void Scene4025::dispatch() {
Scene::dispatch();
}
+/*--------------------------------------------------------------------------
+ * Scene 4045 - Village - Temple Antechamber
+ *
+ *--------------------------------------------------------------------------*/
+
+void Scene4045::Action1::signal() {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ _globals->_player.disableControl();
+ setDelay(60);
+ break;
+ case 1:
+ _globals->_events.setCursor(CURSOR_WALK);
+ scene->_stripManager.start(4040, this, scene);
+ break;
+ case 2:
+ scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ scene->_hotspot4.animate(ANIM_MODE_5, this);
+ break;
+ case 3:
+ setDelay(60);
+ break;
+ case 4:
+ scene->_hotspot4.animate(ANIM_MODE_6, this);
+ break;
+ case 5:
+ ADD_MOVER(_globals->_player, 150, 300);
+ break;
+ case 6:
+ _globals->_stripNum = 4000;
+ _globals->_sceneManager.changeScene(4000);
+ remove();
+ break;
+ }
+}
+
+void Scene4045::Action2::signal() {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ _globals->_player.disableControl();
+ setDelay(15);
+ break;
+ case 1:
+ scene->_stripManager.start(_globals->_stripNum, this, scene);
+ break;
+ case 2:
+ scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ setDelay(10);
+ break;
+ case 3:
+ if (_globals->getFlag(38)) {
+ _globals->_player.enableControl();
+ remove();
+ } else {
+ ADD_MOVER(_globals->_player, 150, 300);
+ }
+ break;
+ case 4:
+ _globals->setFlag(39);
+ _globals->_sceneManager.changeScene(4000);
+ break;
+ }
+}
+
+void Scene4045::Action3::signal() {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ _globals->_player.disableControl();
+ scene->_hotspot4.animate(ANIM_MODE_5, this);
+ break;
+ case 1:
+ scene->_stripManager.start(4504, this, scene);
+ break;
+ case 2:
+ scene->_hotspot4.animate(ANIM_MODE_6, NULL);
+ scene->_hotspot5.animate(ANIM_MODE_NONE, NULL);
+ ADD_MOVER(_globals->_player, 91, 1264);
+ break;
+ case 3:
+ _globals->_player.enableControl();
+ remove();
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene4045::Hotspot1::doAction(int action) {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (action) {
+ case OBJECT_STUNNER:
+ SceneItem::display2(4045, 19);
+ break;
+ case CURSOR_LOOK:
+ SceneItem::display2(4045, (_strip == 1) ? 5 : 14);
+ break;
+ case CURSOR_USE:
+ SceneItem::display2(4045, 18);
+ break;
+ case CURSOR_TALK:
+ if (_strip == 5) {
+ setStrip(6);
+ animate(ANIM_MODE_NONE, 0);
+ }
+ if (_globals->_player._position.y < 135) {
+ scene->_sceneMode = 4046;
+ _numFrames = 10;
+ _globals->_player.disableControl();
+
+ scene->setAction(&scene->_sequenceManager, this, 4046, &_globals->_player, this, NULL);
+ } else {
+ if (!_globals->getFlag(31)) {
+ _globals->setFlag(31);
+ _globals->_stripNum = 4080;
+ } else if (!_globals->getFlag(38))
+ _globals->_stripNum = 4060;
+ else
+ _globals->_stripNum = 4503;
+
+ scene->setAction(&scene->_action2);
+ }
+ break;
+ default:
+ SceneHotspot::doAction(action);
+ break;
+ }
+}
+
+void Scene4045::Hotspot2::doAction(int action) {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (action) {
+ case CURSOR_LOOK:
+ SceneItem::display2(4045, 9);
+ break;
+ case CURSOR_TALK:
+ scene->_sceneMode = 4102;
+ _globals->_player.disableControl();
+ scene->setAction(&scene->_sequenceManager, scene, 4104, NULL);
+ break;
+ default:
+ SceneHotspot::doAction(action);
+ break;
+ }
+}
+
+void Scene4045::Hotspot6::doAction(int action) {
+ Scene4045 *scene = (Scene4045 *)_globals->_sceneManager._scene;
+
+ switch (action) {
+ case CURSOR_LOOK:
+ SceneItem::display2(4045, 17);
+ break;
+ case CURSOR_USE:
+ if (_globals->_player._position.y < 135) {
+ SceneItem::display2(4045, 16);
+ _globals->_inventory._peg._sceneNumber = 1;
+ _globals->_events.setCursor(CURSOR_WALK);
+ remove();
+ } else {
+ scene->_sceneMode = 4047;
+ _globals->_player.disableControl();
+ scene->setAction(&scene->_sequenceManager, scene, 4047, &_globals->_player, &scene->_hotspot1, NULL);
+ }
+ break;
+ default:
+ SceneHotspot::doAction(action);
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Scene4045::Scene4045():
+ _hotspot3(0, CURSOR_LOOK, 4045, 1, CURSOR_USE, 4100, 21, LIST_END),
+ _hotspot7(9, CURSOR_LOOK, 4045, 0, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot8(10, CURSOR_LOOK, 4045, 2, LIST_END),
+ _hotspot9(11, CURSOR_LOOK, 4045, 3, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4045, 19, LIST_END),
+ _hotspot11(13, CURSOR_LOOK, 4045, 6, CURSOR_USE, 4045, 15, LIST_END),
+ _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4045, 29, LIST_END),
+ _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4045, 19, LIST_END),
+ _hotspot14(0, CURSOR_LOOK, 4045, 10, LIST_END) {
+
+ _hotspot14.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+}
+
+void Scene4045::postInit(SceneObjectList *OwnerList) {
+ loadScene(4045);
+ Scene::postInit();
+ setZoomPercents(100, 60, 200, 100);
+
+ _stripManager.addSpeaker(&_speakerQR);
+ _stripManager.addSpeaker(&_speakerML);
+ _stripManager.addSpeaker(&_speakerPR);
+ _stripManager.addSpeaker(&_speakerPText);
+ _stripManager.addSpeaker(&_speakerQText);
+ _stripManager.addSpeaker(&_speakerQL);
+ _stripManager.setCallback(this);
+
+ _speakerQText._textPos.y = 140;
+
+ _hotspot3.postInit();
+ _hotspot3.setVisage(4045);
+ _hotspot3.setPosition(Common::Point(47, 111));
+ _hotspot3.animate(ANIM_MODE_2, NULL);
+ _hotspot3.setPriority2(156);
+ _globals->_sceneItems.push_back(&_hotspot3);
+
+ _globals->_player.postInit();
+ _globals->_player.setVisage(4200);
+ _globals->_player.setObjectWrapper(new SceneObjectWrapper());
+ _globals->_player.animate(ANIM_MODE_1, NULL);
+ _globals->_player._moveDiff = Common::Point(7, 4);
+
+ _hotspot1.postInit();
+ _hotspot1.setVisage(4051);
+
+ _hotspot5.postInit();
+ _hotspot5.setVisage(4051);
+ _hotspot5.setStrip(4);
+ _hotspot5.setPriority2(152);
+
+ if(_globals->_sceneManager._previousScene == 4050) {
+ _globals->_soundHandler.startSound(155);
+ _globals->_player.setPosition(Common::Point(72, 128));
+ _globals->_player.enableControl();
+
+ _hotspot1.setStrip(5);
+ _hotspot1.setPosition(Common::Point(173, 99));
+ _hotspot1._numFrames = 1;
+ _hotspot1.animate(ANIM_MODE_2, NULL);
+
+ _hotspot5.setPosition(Common::Point(177, 40));
+
+ if (_globals->_inventory._peg._sceneNumber == 4045) {
+ _hotspot6.postInit();
+ _hotspot6.setVisage(4045);
+ _hotspot6.setStrip(2);
+ _hotspot6.setPosition(Common::Point(108, 82));
+ _globals->_sceneItems.push_back(&_hotspot6);
+ }
+ } else {
+ _globals->_player.setPosition(Common::Point(108, 192));
+ _globals->_player.setStrip(4);
+
+ if (!_globals->getFlag(36) && !_globals->getFlag(43)) {
+ _hotspot2.postInit();
+ _hotspot2.setVisage(4102);
+ _hotspot2.animate(ANIM_MODE_NONE, NULL);
+ _hotspot2.setStrip(3);
+ _hotspot2.changeZoom(-1);
+ _hotspot2.setPosition(Common::Point(66, 209));
+ _globals->_sceneItems.push_back(&_hotspot2);
+ }
+
+ if (_globals->getFlag(31)) {
+ _hotspot1.setVisage(4051);
+ _hotspot1.setStrip(5);
+ _hotspot1.setPosition(Common::Point(173, 99));
+ _hotspot1._numFrames = 1;
+ _hotspot1.animate(ANIM_MODE_2, NULL);
+
+ _hotspot5.setPosition(Common::Point(177, 40));
+
+ if (_globals->_inventory._peg._sceneNumber == 4045) {
+ _hotspot6.postInit();
+ _hotspot6.setVisage(4045);
+ _hotspot6.setStrip(2);
+ _hotspot6.setPosition(Common::Point(108, 82));
+ _globals->_sceneItems.push_back(&_hotspot6);
+ }
+ } else {
+ _hotspot1.setPosition(Common::Point(186, 149));
+
+ _hotspot4.postInit();
+ _hotspot4.setVisage(4051);
+ _hotspot4.setStrip(2);
+ _hotspot4.setPriority2(152);
+ _hotspot4.setPosition(Common::Point(202, 80));
+
+ _hotspot5.setPosition(Common::Point(192, 77));
+ _globals->setFlag(31);
+ setAction(&_action1);
+
+ _globals->_player.disableControl();
+ }
+ }
+
+ _globals->_sceneItems.addItems(&_hotspot1, &_hotspot7, &_hotspot8, &_hotspot9, &_hotspot10,
+ &_hotspot13, &_hotspot11, &_hotspot12, &_hotspot14, NULL);
+}
+
+void Scene4045::stripCallback(int v) {
+ switch (v) {
+ case 1:
+ _hotspot5.animate(ANIM_MODE_7, 0, NULL);
+ break;
+ case 2:
+ _hotspot5.animate(ANIM_MODE_NONE, NULL);
+ break;
+ }
+}
+
+void Scene4045::signal() {
+ switch (_sceneMode) {
+ case 4046:
+ case 4047:
+ _hotspot5.animate(ANIM_MODE_NONE, NULL);
+ break;
+ case 4050:
+ _globals->_sceneManager.changeScene(4000);
+ break;
+ case 4102:
+ _globals->_player.enableControl();
+ break;
+ }
+}
+
+void Scene4045::dispatch() {
+ if (!_action) {
+ if (_globals->_player.getRegionIndex() == 8) {
+ _globals->_player.addMover(NULL);
+ if (_hotspot1._strip == 1) {
+ _globals->_player.disableControl();
+ _sceneMode = 4046;
+ _hotspot1._numFrames = 10;
+ setAction(&_sequenceManager, this, 4046, &_globals->_player, &_hotspot1, NULL);
+ } else {
+ setAction(&_action3);
+ }
+ }
+
+ if (_globals->_player.getRegionIndex() == 10)
+ _globals->_sceneManager.changeScene(4050);
+ if (_globals->_player._position.y >= 196) {
+ _sceneMode = 4050;
+ _globals->_player.disableControl();
+ setAction(&_sequenceManager, this, 4105, &_globals->_player, NULL);
+ }
+ }
+
+ Scene::dispatch();
+}
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h
index cb95466d47..d4808a6082 100644
--- a/engines/tsage/ringworld_scenes5.h
+++ b/engines/tsage/ringworld_scenes5.h
@@ -255,6 +255,61 @@ public:
virtual void dispatch();
};
+class Scene4045: 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();
+ };
+
+ /* Hotspots */
+ class Hotspot1: public SceneObject {
+ public:
+ virtual void doAction(int action);
+ };
+ class Hotspot2: public SceneObject {
+ public:
+ virtual void doAction(int action);
+ };
+ class Hotspot6: public SceneObject {
+ public:
+ virtual void doAction(int action);
+ };
+
+public:
+ SequenceManager _sequenceManager;
+ SpeakerQR _speakerQR;
+ SpeakerML _speakerML;
+ SpeakerPR _speakerPR;
+ SpeakerPText _speakerPText;
+ SpeakerQText _speakerQText;
+ SpeakerQL _speakerQL;
+ Hotspot1 _hotspot1;
+ Hotspot2 _hotspot2;
+ DisplayHotspot _hotspot3;
+ SceneObject _hotspot4, _hotspot5;
+ Hotspot6 _hotspot6;
+ DisplayHotspot _hotspot7, _hotspot8, _hotspot9, _hotspot10;
+ DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14;
+ Action1 _action1;
+ Action _action2;
+ Action _action3;
+
+ Scene4045();
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void stripCallback(int v);
+ virtual void signal();
+ virtual void dispatch();
+};
+
} // End of namespace tSage
#endif