aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/events.h3
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp9
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp242
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h46
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.cpp12
5 files changed, 296 insertions, 16 deletions
diff --git a/engines/tsage/events.h b/engines/tsage/events.h
index 1942c98901..ecc710ed99 100644
--- a/engines/tsage/events.h
+++ b/engines/tsage/events.h
@@ -83,7 +83,8 @@ enum CursorType {
INV_CARAVAN_KEY = 67, BF_LAST_INVENT = 68,
// Ringworld 2 objects
- R2_OPTO_DISK = 1, R2_2 = 2, R2_NEGATOR_GUN = 3, R2_STEPPING_DISKS = 4, R2_5 = 5, R2_6 = 6,
+ R2_OPTO_DISK = 1, R2_READER = 2, R2_NEGATOR_GUN = 3, R2_STEPPING_DISKS = 4,
+ R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6,
R2_7 = 7, R2_8 = 8, R2_9 = 9, R2_10 = 10, R2_11 = 11, R2_12 = 12, R2_13 = 13, R2_14 = 14,
R2_15 = 15, R2_16 = 16, R2_17 = 17, R2_18 = 18, R2_19 = 19, R2_20 = 20, R2_21 = 21,
R2_22 = 22, R2_23 = 23, R2_24 = 24, R2_25 = 25, R2_26 = 26, R2_27 = 27, R2_28 = 28,
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index e2e0c71a03..c6ad92bd91 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -57,7 +57,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
case 300:
return new Scene300();
case 325:
+ error("Missing scene %d from group 0", sceneNumber);
case 400:
+ // Science Lab
+ return new Scene400();
case 500:
case 525:
case 600:
@@ -576,11 +579,11 @@ void Ringworld2InvObjectList::reset() {
// Set up default inventory
setObjectScene(R2_OPTO_DISK, 800);
- setObjectScene(R2_2, 400);
+ setObjectScene(R2_READER, 400);
setObjectScene(R2_NEGATOR_GUN, 100);
setObjectScene(R2_STEPPING_DISKS, 100);
- setObjectScene(R2_5, 400);
- setObjectScene(R2_6, 400);
+ setObjectScene(R2_ATTRACTOR_UNIT, 400);
+ setObjectScene(R2_SENSOR_PROBE, 400);
setObjectScene(R2_7, 500);
setObjectScene(R2_8, 700);
setObjectScene(R2_9, 800);
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 661a52d601..c3f97f1eef 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -64,7 +64,7 @@ void Scene50::process(Event &event) {
event.handled = true;
warning("TODO: incomplete Scene50::process()");
// CursorType _oldCursorId = _cursorId;
- g_globals->_events.setCursor(R2_2);
+ g_globals->_events.setCursor(CURSOR_ARROW);
// _cursorManager.sub_1D474(2, 0);
// sub_5566A(1);
// _cursorManager._fieldE = _oldCursorId;
@@ -1204,8 +1204,6 @@ Common::String Scene125::parseMessage(const Common::String &msg) {
*
*--------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------*/
-
void Scene150::postInit(SceneObjectList *OwnerList) {
SceneExt::postInit();
loadScene(100);
@@ -1675,7 +1673,7 @@ bool Scene300::Miranda::startAction(CursorType action, Event &event) {
SceneItem::display2(300, 54);
return true;
- case R2_2:
+ case R2_READER:
if (!R2_GLOBALS.getFlag(2) || !R2_GLOBALS.getFlag(3) || (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == 1))
SceneItem::display2(300, 55);
else {
@@ -1749,7 +1747,7 @@ bool Scene300::Seeker::startAction(CursorType action, Event &event) {
scene->setAction(&scene->_sequenceManager1, scene, 310, &R2_GLOBALS._player, NULL);
return true;
- case R2_2:
+ case R2_READER:
if (!R2_GLOBALS.getFlag(2) || !R2_GLOBALS.getFlag(3) || (R2_INVENTORY.getObjectScene(R2_OPTO_DISK) == 1))
break;
@@ -2325,7 +2323,7 @@ void Scene300::signal() {
void Scene300::signal309() {
if (R2_GLOBALS.getFlag(2))
- R2_GLOBALS._stripManager_lookupList[0] = (R2_INVENTORY.getObjectScene(R2_2) == 1) ? 3 : 2;
+ R2_GLOBALS._stripManager_lookupList[0] = (R2_INVENTORY.getObjectScene(R2_READER) == 1) ? 3 : 2;
if (R2_GLOBALS.getFlag(4))
R2_GLOBALS._stripManager_lookupList[0] = 4;
@@ -2362,6 +2360,238 @@ void Scene300::signal309() {
R2_GLOBALS._stripManager_lookupList[4] = 3;
}
+/*--------------------------------------------------------------------------
+ * Scene 400 - Science Lab
+ *
+ *--------------------------------------------------------------------------*/
+
+bool Scene400::Terminal::startAction(CursorType action, Event &event) {
+ Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 402;
+ scene->setAction(&scene->_sequenceManager1, scene, 402, &R2_GLOBALS._player, this, NULL);
+
+ return true;
+ } else {
+ return NamedHotspot::startAction(action, event);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+bool Scene400::Door::startAction(CursorType action, Event &event) {
+ Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 401;
+ scene->setAction(&scene->_sequenceManager1, scene, 401, &R2_GLOBALS._player, this, NULL);
+
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene400::Reader::startAction(CursorType action, Event &event) {
+ Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 405;
+ scene->setAction(&scene->_sequenceManager1, scene, 405, &R2_GLOBALS._player, this, NULL);
+
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene400::SensorProbe::startAction(CursorType action, Event &event) {
+ Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 404;
+ scene->setAction(&scene->_sequenceManager1, scene, 404, &R2_GLOBALS._player, this, NULL);
+
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene400::AttractorUnit::startAction(CursorType action, Event &event) {
+ Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 406;
+ scene->setAction(&scene->_sequenceManager1, scene, 406, &R2_GLOBALS._player, this, NULL);
+
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene400::postInit(SceneObjectList *OwnerList) {
+ SceneExt::postInit();
+ loadScene(400);
+ _sound1.play(20);
+
+ _door.postInit();
+ _door.setVisage(100);
+ _door.setPosition(Common::Point(123, 84));
+ _door.setDetails(400, 24, -1, 26, 1, NULL);
+
+ _consoleDisplay.postInit();
+ _consoleDisplay.setup(400, 4, 1);
+ _consoleDisplay.setPosition(Common::Point(236, 92));
+ _consoleDisplay.fixPriority(120);
+ _consoleDisplay.animate(ANIM_MODE_2, NULL);
+ _consoleDisplay._numFrames = 5;
+
+ _testerDisplay.postInit();
+ _testerDisplay.setup(400, 2, 1);
+ _testerDisplay.setPosition(Common::Point(198, 83));
+ _testerDisplay.animate(ANIM_MODE_2, NULL);
+ _testerDisplay._numFrames = 20;
+
+ if (R2_INVENTORY.getObjectScene(R2_READER) == 400) {
+ _reader.postInit();
+ _reader.setup(400, 5, 2);
+ _reader.setPosition(Common::Point(301, 95));
+ _reader.setDetails(400, 54, -1, 56, 1, NULL);
+ }
+
+ if (R2_INVENTORY.getObjectScene(R2_SENSOR_PROBE) == 400) {
+ _sensorProbe.postInit();
+ _sensorProbe.setup(400, 5, 1);
+ _sensorProbe.setPosition(Common::Point(251, 104));
+ _sensorProbe.fixPriority(121);
+ _sensorProbe.setDetails(400, 57, -1, 59, 1, NULL);
+ }
+
+ if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_UNIT) == 400) {
+ _attractorUnit.postInit();
+ _attractorUnit.setup(400, 5, 3);
+ _attractorUnit.setPosition(Common::Point(265, 129));
+ _attractorUnit.setDetails(400, 60, -1, 62, 1, NULL);
+ }
+
+ R2_GLOBALS._player.postInit();
+ R2_GLOBALS._player.setVisage(10);
+ R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
+ R2_GLOBALS._player.disableControl();
+
+ _equipment1.setDetails(11, 400, 3, -1, -1);
+ _equipment2.setDetails(24, 400, 3, -1, -1);
+ _equipment3.setDetails(25, 400, 3, -1, -1);
+ _equipment4.setDetails(26, 400, 3, -1, -1);
+ _equipment5.setDetails(28, 400, 3, -1, -1);
+ _equipment6.setDetails(29, 400, 3, -1, -1);
+ _desk.setDetails(12, 400, 6, -1, -1);
+ _desk2.setDetails(27, 400, 6, -1, -1);
+ _terminal.setDetails(13, 400, 6, -1, 11);
+ _duct.setDetails(14, 400, 12, -1, -1);
+ _console.setDetails(15, 400, 15, -1, 17);
+ _equalizer.setDetails(Rect(284, 99, 308, 108), 400, 36, -1, 38, 1, NULL);
+ _transducer.setDetails(Rect(295, 67, 314, 79), 400, 39, -1, 41, 1, NULL);
+ _optimizer.setDetails(Rect(308, 106, 315, 113), 400, 42, -1, 44, 1, NULL);
+ _soundModule.setDetails(Rect(291, 118, 315, 131), 400, 45, -1, 47, 1, NULL);
+ _tester.setDetails(Rect(179, 62, 217, 92), 400, 30, -1, 32, 1, NULL);
+ _helmet.setDetails(Rect(181, 53, 197, 65), 400, 48, -1, 50, 1, NULL);
+ _nullifier.setDetails(Rect(201, 56, 212, 65), 400, 51, -1, 50, 1, NULL);
+ _shelves.setDetails(16, 400, 18, -1, 20);
+ _cabinet.setDetails(17, 400, 21, -1, -1);
+ _doorDisplay.setDetails(Rect(161, 43, 166, 52), 400, 27, -1, -1, 1, NULL);
+ _lights.setDetails(Rect(113, 3, 168, 14), 400, 33, -1, -1, 1, NULL);
+ _background.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 400, 0, 1, -1, 1, NULL);
+
+ _sceneMode = 400;
+ switch (R2_GLOBALS._sceneManager._previousScene) {
+ case 125:
+ setAction(&_sequenceManager1, this, 403, &R2_GLOBALS._player, NULL);
+ break;
+ case 200:
+ setAction(&_sequenceManager1, this, 400, &R2_GLOBALS._player, &_door, NULL);
+ break;
+ default:
+ R2_GLOBALS._player.setStrip(3);
+ R2_GLOBALS._player.setPosition(Common::Point(180, 100));
+ R2_GLOBALS._player.enableControl();
+ break;
+ }
+}
+
+void Scene400::remove() {
+ R2_GLOBALS._sound1.fadeOut2(NULL);
+ SceneExt::remove();
+}
+
+void Scene400::signal() {
+ switch (_sceneMode) {
+ case 400:
+ case 403:
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 401:
+ R2_GLOBALS._sceneManager.changeScene(200);
+ break;
+ case 402:
+ R2_GLOBALS._sceneManager.changeScene(125);
+ break;
+ case 404:
+ // Getting the sensor probe
+ R2_INVENTORY.setObjectScene(R2_SENSOR_PROBE, 1);
+ _sensorProbe.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 405:
+ // Getting the reader
+ R2_INVENTORY.setObjectScene(R2_READER, 1);
+ _reader.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 406:
+ R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 1);
+ _attractorUnit.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ default:
+ break;
+ }
+}
+
+void Scene400::dispatch() {
+ switch (R2_GLOBALS._player.getRegionIndex() - 15) {
+ case 0:
+ case 11:
+ case 12:
+ R2_GLOBALS._player._shade = 2;
+ break;
+ case 9:
+ R2_GLOBALS._player._shade = 0;
+ break;
+ case 10:
+ R2_GLOBALS._player._shade = 1;
+ break;
+ case 13:
+ R2_GLOBALS._player._shade = 3;
+ break;
+ case 14:
+ R2_GLOBALS._player._shade = 4;
+ break;
+ default:
+ 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 5b3123b37f..646d23286a 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.h
@@ -292,6 +292,52 @@ public:
virtual void signal();
};
+class Scene400: public SceneExt {
+ /* Items */
+ class Terminal: public NamedHotspot {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+
+ /* Objects */
+ class Door: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Reader: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class SensorProbe: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class AttractorUnit: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+public:
+ NamedHotspot _background, _equipment1, _equipment2, _equipment3;
+ NamedHotspot _equipment4, _equipment5, _equipment6;
+ NamedHotspot _desk, _desk2, _console;
+ NamedHotspot _duct, _shelves, _cabinet, _doorDisplay, _lights;
+ NamedHotspot _equalizer, _transducer, _optimizer, _soundModule, _tester;
+ NamedHotspot _helmet, _nullifier;
+ Terminal _terminal;
+ SceneActor _consoleDisplay, _testerDisplay;
+ Door _door;
+ Reader _reader;
+ SensorProbe _sensorProbe;
+ AttractorUnit _attractorUnit;
+ SequenceManager _sequenceManager1;
+ ASoundExt _sound1;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void remove();
+ virtual void signal();
+ virtual void dispatch();
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index 4b4f9b8375..d820784c45 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
@@ -1047,7 +1047,7 @@ void Scene2000::synchronize(Serializer &s) {
*
*--------------------------------------------------------------------------*/
bool Scene2350::Actor2::startAction(CursorType action, Event &event) {
- if (action != R2_6)
+ if (action != R2_SENSOR_PROBE)
return(SceneActor::startAction(action, event));
return true;
}
@@ -1651,13 +1651,13 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) {
switch (action) {
case R2_34:
R2_GLOBALS._player.disableControl();
- R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS._events.setCursor(CURSOR_ARROW);
R2_GLOBALS.setFlag(82);
scene->_stripManager.start(603, scene);
return true;
case R2_35:
R2_GLOBALS._player.disableControl();
- R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS._events.setCursor(CURSOR_ARROW);
R2_GLOBALS.setFlag(82);
scene->_stripManager.start(602, scene);
R2_INVENTORY.setObjectScene(R2_35, 2000);
@@ -1665,7 +1665,7 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) {
case CURSOR_TALK:
R2_GLOBALS._player.disableControl();
scene->_sceneMode = 20;
- R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS._events.setCursor(CURSOR_ARROW);
if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) {
scene->_stripManager.start(605, scene);
return true;
@@ -1765,7 +1765,7 @@ void Scene2435::signal() {
g_globals->_sceneManager.changeScene(2000);
break;
case 20:
- R2_GLOBALS._player.enableControl(R2_6);
+ R2_GLOBALS._player.enableControl(CURSOR_TALK);
break;
case 30:
R2_GLOBALS._player._characterScene[1] = 2435;
@@ -1787,7 +1787,7 @@ void Scene2435::signal() {
case 2436:
R2_GLOBALS._walkRegions.enableRegion(2);
_sceneMode = 20;
- R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS._events.setCursor(CURSOR_ARROW);
_stripManager.start(709, this);
default:
R2_GLOBALS._player.enableControl();