aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/ringworld2
diff options
context:
space:
mode:
authorPaul Gilbert2011-12-17 09:05:09 +1100
committerPaul Gilbert2011-12-17 09:05:09 +1100
commit29a20ed7dddb178eecfbcc4b7db11364c2c30606 (patch)
tree1535f9ec734ca5e90d8f877cdd984ffc824be3f8 /engines/tsage/ringworld2
parent654a60a90cfec631893598325dbfc5ab8adbfa35 (diff)
downloadscummvm-rg350-29a20ed7dddb178eecfbcc4b7db11364c2c30606.tar.gz
scummvm-rg350-29a20ed7dddb178eecfbcc4b7db11364c2c30606.tar.bz2
scummvm-rg350-29a20ed7dddb178eecfbcc4b7db11364c2c30606.zip
TSAGE: Implemented R2R Scene 850 - Deck #5 By Lift
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp7
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp176
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h39
3 files changed, 219 insertions, 3 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index a33a9a5e9e..201b44eeef 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -77,7 +77,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
case 700:
case 800:
case 825:
+ error("Missing scene %d from group 0", sceneNumber);
case 850:
+ // Deck #5 - By Lift
+ return new Scene850();
case 900:
error("Missing scene %d from group 0", sceneNumber);
/* Scene group #1 */
@@ -607,8 +610,8 @@ void Ringworld2InvObjectList::reset() {
setObjectScene(R2_11, 400);
setObjectScene(R2_12, 500);
setObjectScene(R2_13, 1550);
- setObjectScene(R2_14, 850);
- setObjectScene(R2_15, 850);
+ setObjectScene(R2_OPTICAL_FIBRE, 850);
+ setObjectScene(R2_CLAMP, 850);
setObjectScene(R2_16, 0);
setObjectScene(R2_17, 1550);
setObjectScene(R2_18, 1550);
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 1c25c896a6..7a3b0cdd78 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -1701,7 +1701,7 @@ void Scene250::signal() {
R2_GLOBALS._sceneManager.changeScene(139);
break;
case 91:
- R2_GLOBALS._sceneManager.changeScene(91);
+ R2_GLOBALS._sceneManager.changeScene(850);
break;
default:
break;
@@ -2900,6 +2900,180 @@ void Scene400::dispatch() {
}
}
+/*--------------------------------------------------------------------------
+ * Scene 850 - Deck #5 - By Lift
+ *
+ *--------------------------------------------------------------------------*/
+
+bool Scene850::Indicator::startAction(CursorType action, Event &event) {
+ Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) != 850))
+ return NamedHotspot::startAction(action, event);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 851;
+ scene->setAction(&scene->_sequenceManager1, scene, 851, &R2_GLOBALS._player, &scene->_fibre, NULL);
+ return true;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+bool Scene850::LiftDoor::startAction(CursorType action, Event &event) {
+ Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action != CURSOR_USE)
+ return SceneActor::startAction(action, event);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 202;
+ scene->setAction(&scene->_sequenceManager1, scene, 202, &R2_GLOBALS._player, this, NULL);
+ return true;
+ }
+}
+
+bool Scene850::SickBayDoor::startAction(CursorType action, Event &event) {
+ Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action != CURSOR_USE)
+ return SceneActor::startAction(action, event);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 204;
+ scene->setAction(&scene->_sequenceManager1, scene, 204, &R2_GLOBALS._player, this, NULL);
+ return true;
+ }
+}
+
+bool Scene850::Clamp::startAction(CursorType action, Event &event) {
+ Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene;
+
+ if (!R2_GLOBALS.getFlag(7))
+ return false;
+ else if (action != CURSOR_USE)
+ return SceneActor::startAction(action, event);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_object1.postInit();
+ scene->_sceneMode = 850;
+ scene->setAction(&scene->_sequenceManager1, scene, 850, &R2_GLOBALS._player, this, &scene->_object1, NULL);
+ return true;
+ }
+}
+
+bool Scene850::Panel::startAction(CursorType action, Event &event) {
+ Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action != CURSOR_USE) || R2_GLOBALS.getFlag(7))
+ return SceneActor::startAction(action, event);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 852;
+ scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, this, &scene->_object1, NULL);
+ return true;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene850::postInit(SceneObjectList *OwnerList) {
+ SceneExt::postInit();
+ loadScene(850);
+
+ _liftDoor.postInit();
+ _liftDoor.setup(850, 2, 1);
+ _liftDoor.setPosition(Common::Point(188, 79));
+ _liftDoor.setDetails(850, 3, -1, -1, 1, NULL);
+
+ _sickBayDoor.postInit();
+ _sickBayDoor.setup(850, 3, 1);
+ _sickBayDoor.setPosition(Common::Point(62, 84));
+ _sickBayDoor.setDetails(850, 9, -1, -1, 1, NULL);
+
+ if (R2_INVENTORY.getObjectScene(R2_CLAMP) == 850) {
+ _clamp.postInit();
+ _clamp.setup(850, 5, 1);
+ _clamp.setPosition(Common::Point(242, 93));
+ _clamp.fixPriority(81);
+ _clamp.animate(ANIM_MODE_2, NULL);
+ _clamp.setDetails(850, 27, -1, -1, 1, NULL);
+ }
+
+ _panel.postInit();
+ _panel.setVisage(850);
+
+ if (R2_GLOBALS.getFlag(7))
+ _panel.setFrame(7);
+
+ _panel.setPosition(Common::Point(232, 119));
+ _panel.fixPriority(82);
+ _panel.setDetails(850, 24, -1, -1, 1, NULL);
+
+ if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 850) {
+ _fibre.postInit();
+ _fibre.setup(850, 6, 1);
+ _fibre.setPosition(Common::Point(280, 87));
+ }
+
+ R2_GLOBALS._player.postInit();
+ R2_GLOBALS._player.setVisage(10);
+ R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
+ R2_GLOBALS._player.disableControl();
+
+ _eastDoor.setDetails(Rect(289, 53, 315, 125), 850, 6, -1, 8, 1, NULL);
+ _indicator.setDetails(Rect(275, 67, 286, 79), 850, 18, -1, 20, 1, NULL);
+ _sickBayIndicator.setDetails(Rect(41, 51, 48, 61), 850, 15, -1, -1, 1, NULL);
+ _liftControls.setDetails(Rect(156, 32, 166, 44), 850, 21, -1, -1, 1, NULL);
+ _compartment.setDetails(Rect(4, 88, 153, 167), 850, 12, -1, -1, 1, NULL);
+ _background.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 850, 0, -1, -1, 1, NULL);
+
+ switch (R2_GLOBALS._sceneManager._previousScene) {
+ case 250:
+ _sceneMode = 203;
+ setAction(&_sequenceManager1, this, 203, &R2_GLOBALS._player, &_liftDoor, NULL);
+ break;
+ case 800:
+ _sceneMode = 205;
+ setAction(&_sequenceManager1, this, 205, &R2_GLOBALS._player, &_sickBayDoor, NULL);
+ break;
+ default:
+ R2_GLOBALS._player.setStrip(3);
+ R2_GLOBALS._player.setPosition(Common::Point(215, 115));
+ R2_GLOBALS._player.enableControl();
+ break;
+ }
+}
+
+void Scene850::signal() {
+ switch (_sceneMode) {
+ case 202:
+ R2_GLOBALS._sceneManager.changeScene(250);
+ break;
+ case 204:
+ R2_GLOBALS._sceneManager.changeScene(800);
+ break;
+ case 850:
+ R2_INVENTORY.setObjectScene(R2_CLAMP, 1);
+ _clamp.remove();
+ _object1.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 851:
+ R2_INVENTORY.setObjectScene(R2_OPTICAL_FIBRE, 1);
+ _fibre.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 852:
+ R2_GLOBALS.setFlag(7);
+ R2_GLOBALS._player.enableControl();
+ break;
+ default:
+ R2_GLOBALS._player.enableControl();
+ break;
+ }
+}
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h
index a0c3f92668..5f2d768f90 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.h
@@ -370,6 +370,45 @@ public:
virtual void dispatch();
};
+class Scene850: public SceneExt {
+ /* Items */
+ class Indicator: public NamedHotspot {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+
+ /* Objects */
+ class LiftDoor: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class SickBayDoor: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Clamp: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Panel: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+public:
+ NamedHotspot _background, _eastDoor, _compartment, _sickBayIndicator;
+ NamedHotspot _liftControls;
+ Indicator _indicator;
+ SceneActor _object1, _fibre;
+ LiftDoor _liftDoor;
+ SickBayDoor _sickBayDoor;
+ Clamp _clamp;
+ Panel _panel;
+ SequenceManager _sequenceManager1;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void signal();
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE