aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorPaul Gilbert2012-01-22 13:16:09 +1100
committerPaul Gilbert2012-01-22 13:16:09 +1100
commit4e118ccf98e3cc442636da3dddaf965e587ccf15 (patch)
tree8d172aa3897e55e3470524d4c2195b5f2c9c2553 /engines/tsage
parent1758845af5e0aa09f1ab253710e2037a7dfc9e46 (diff)
downloadscummvm-rg350-4e118ccf98e3cc442636da3dddaf965e587ccf15.tar.gz
scummvm-rg350-4e118ccf98e3cc442636da3dddaf965e587ccf15.tar.bz2
scummvm-rg350-4e118ccf98e3cc442636da3dddaf965e587ccf15.zip
TSAGE: Implemented R2R Scene 500
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/events.h7
-rw-r--r--engines/tsage/globals.cpp2
-rw-r--r--engines/tsage/globals.h1
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp58
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h14
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp519
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h79
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.cpp6
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.cpp4
10 files changed, 679 insertions, 13 deletions
diff --git a/engines/tsage/events.h b/engines/tsage/events.h
index dcff1b45b8..6f54163682 100644
--- a/engines/tsage/events.h
+++ b/engines/tsage/events.h
@@ -88,9 +88,10 @@ enum CursorType {
// Ringworld 2 objects
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_OPTICAL_FIBRE = 14,
- R2_CLAMP = 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,
+ R2_SONIC_STUNNER = 7, R2_8 = 8, R2_9 = 9, R2_10 = 10, R2_11 = 11, R2_AEROSOL = 12, R2_13 = 13,
+ R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_16 = 16, R2_17 = 17, R2_18 = 18, R2_19 = 19,
+ R2_REBREATHER_TANK = 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,
R2_29 = 29, R2_30 = 30, R2_31 = 31, R2_32 = 32, R2_33 = 33, R2_34 = 34, R2_35 = 35,
R2_36 = 36, R2_37 = 37, R2_38 = 38, R2_39 = 39, R2_40 = 40, R2_41 = 41, R2_42 = 42,
R2_43 = 43, R2_44 = 44, R2_45 = 45, R2_46 = 46, R2_47 = 47, R2_48 = 48, R2_49 = 49,
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index e058be871b..f0f02d4acb 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -400,6 +400,7 @@ void Ringworld2Globals::reset() {
_v56605[13] = 31;
_v566A6 = 3800;
+ _v566A3 = 2;
_v566A8 = 5;
_v566A9 = 0;
_v566AA = 0;
@@ -458,6 +459,7 @@ void Ringworld2Globals::synchronize(Serializer &s) {
s.syncAsSint16LE(_v565F5);
s.syncAsSint16LE(_v565F6);
s.syncAsSint16LE(_v565FA);
+ s.syncAsSint16LE(_v566A3);
s.syncAsSint16LE(_v566A6);
s.syncAsSint16LE(_v56A93);
s.syncAsSint16LE(_v56A9C);
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 285e48e611..b9babde131 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -263,6 +263,7 @@ public:
byte _v565AE;
byte _v56605[14];
int _v566A6;
+ byte _v566A3;
byte _v566A8;
byte _v566A9;
byte _v566AA;
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 0309fa6860..d81672807a 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -78,6 +78,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Science Lab
return new Scene400();
case 500:
+ // Lander Bay 2 Storage
+ return new Scene500();
case 525:
case 600:
case 700:
@@ -382,7 +384,7 @@ bool SceneExt::display(CursorType action, Event &event) {
else
SceneItem::display2(5, 0);
break;
- case R2_7:
+ case R2_SONIC_STUNNER:
if ((R2_GLOBALS._v565F1[1] == 2) || ((R2_GLOBALS._v565F1[1] == 1) &&
(R2_GLOBALS._v565F1[2] == 2) && (R2_GLOBALS._sceneManager._previousScene == 300))) {
R2_GLOBALS._sound4.stop();
@@ -744,12 +746,12 @@ void Ringworld2InvObjectList::reset() {
setObjectScene(R2_STEPPING_DISKS, 100);
setObjectScene(R2_ATTRACTOR_UNIT, 400);
setObjectScene(R2_SENSOR_PROBE, 400);
- setObjectScene(R2_7, 500);
+ setObjectScene(R2_SONIC_STUNNER, 500);
setObjectScene(R2_8, 700);
setObjectScene(R2_9, 800);
setObjectScene(R2_10, 100);
setObjectScene(R2_11, 400);
- setObjectScene(R2_12, 500);
+ setObjectScene(R2_AEROSOL, 500);
setObjectScene(R2_13, 1550);
setObjectScene(R2_OPTICAL_FIBRE, 850);
setObjectScene(R2_CLAMP, 850);
@@ -757,7 +759,7 @@ void Ringworld2InvObjectList::reset() {
setObjectScene(R2_17, 1550);
setObjectScene(R2_18, 1550);
setObjectScene(R2_19, 1550);
- setObjectScene(R2_20, 500);
+ setObjectScene(R2_REBREATHER_TANK, 500);
setObjectScene(R2_21, 500);
setObjectScene(R2_22, 1550);
setObjectScene(R2_23, 1580);
@@ -1104,6 +1106,54 @@ void SceneExit::process(Event &event) {
}
}
+/*--------------------------------------------------------------------------*/
+
+void SceneAreaObject::remove() {
+ _object1.remove();
+ SceneArea::remove();
+ --R2_GLOBALS._insetUp;
+}
+
+void SceneAreaObject::process(Event &event) {
+ if (_insetCount == R2_GLOBALS._insetUp) {
+ CursorType cursor = R2_GLOBALS._events.getCursor();
+
+ if (_bounds.contains(event.mousePos)) {
+ // Cursor moving in bounded area
+ if (cursor == _cursorNum) {
+ R2_GLOBALS._events.setCursor(_savedCursorNum);
+ }
+ } else if (event.mousePos.y < 168) {
+ if (_cursorNum != cursor)
+ // Cursor moved outside bounded area
+ R2_GLOBALS._events.setCursor(_savedCursorNum);
+
+ if (event.eventType == EVENT_BUTTON_DOWN) {
+ R2_GLOBALS._events.setCursor(_savedCursorNum);
+ event.handled = true;
+ }
+ }
+ }
+}
+
+void SceneAreaObject::setDetails(int visage, int strip, int frameNumber, const Common::Point &pt) {
+ _object1.postInit();
+ _object1.setup(visage, strip, frameNumber);
+ _object1.setPosition(pt);
+ _object1.fixPriority(250);
+
+ _cursorNum = CURSOR_INVALID;
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+ scene->_sceneAreas.push_front(this);
+
+ _insetCount = ++R2_GLOBALS._insetUp;
+}
+
+void SceneAreaObject::setDetails(int resNum, int lookLineNum, int talkLineNum, int useLineNum) {
+ ((SceneHotspot *)(this))->setDetails(resNum, lookLineNum, talkLineNum, useLineNum,
+ 2, (SceneItem *)NULL);
+}
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index 9b64063803..14ab1d0081 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -273,6 +273,20 @@ public:
}
};
+class SceneAreaObject: public SceneArea {
+ class Object1: public SceneActor {
+ public:
+ };
+public:
+ Object1 _object1;
+ int _insetCount;
+
+ virtual void remove();
+ virtual void process(Event &event);
+ void setDetails(int visage, int strip, int frameNumber, const Common::Point &pt);
+ void setDetails(int resNum, int lookLineNum, int talkLineNum, int useLineNum);
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index e0713fd4b9..784968b5cb 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -3922,6 +3922,525 @@ void Scene400::dispatch() {
}
/*--------------------------------------------------------------------------
+ * Scene 500 - Lander Bay 2 Storage
+ *
+ *--------------------------------------------------------------------------*/
+
+bool Scene500::ControlPanel::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) {
+ R2_GLOBALS._player.disableControl();
+
+ if (R2_GLOBALS.getFlag(26)) {
+ scene->_stripNumber = 1104;
+ scene->_sceneMode = 524;
+ scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, NULL);
+ } else {
+ scene->_sceneMode = 510;
+ scene->setAction(&scene->_sequenceManager1, scene, 510, &R2_GLOBALS._player, NULL);
+ }
+ return true;
+ } else {
+ return SceneHotspot::startAction(action, event);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+bool Scene500::Object2::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_TALK) {
+ R2_GLOBALS._player.disableControl();
+ if (R2_GLOBALS._player._characterIndex == 1) {
+ scene->_stripNumber = R2_GLOBALS.getFlag(26) ? 1101 : 1103;
+ } else {
+ scene->_stripNumber = R2_GLOBALS.getFlag(26) ? 1102 : 1105;
+ }
+
+ scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::Object3::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ switch (action) {
+ case CURSOR_LOOK:
+ SceneItem::display2(500, R2_GLOBALS.getFlag(28) ? 28 : _strip + 25);
+ return true;
+
+ case CURSOR_USE:
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ if ((_strip != 3) && (_strip != 7))
+ SceneItem::display2(500, _strip);
+ else if (R2_GLOBALS.getFlag(26)) {
+ R2_GLOBALS._player.disableControl();
+ scene->_stripNumber = 1103;
+ scene->_sceneMode = 524;
+ scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, NULL);
+ } else if (!R2_GLOBALS.getFlag(28))
+ SceneItem::display2(500, 41);
+ else if (!R2_GLOBALS.getFlag(40))
+ SceneItem::display2(500, 40);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 512;
+ scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, &scene->_object3, NULL);
+ R2_GLOBALS.setFlag(26);
+ }
+ } else {
+ SceneItem::display2(500, 42);
+ }
+ return true;
+
+ case R2_REBREATHER_TANK:
+ if (!R2_GLOBALS.getFlag(25))
+ SceneItem::display2(500, 10);
+ else if (_strip != 3)
+ SceneItem::display2(500, _strip + 25);
+ else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 515;
+ scene->setAction(&scene->_sequenceManager1, scene, 515, &R2_GLOBALS._player, &scene->_object3, NULL);
+ R2_GLOBALS.setFlag(28);
+ }
+ return true;
+
+ case R2_21:
+ SceneItem::display2(500, 53);
+ return true;
+
+ default:
+ if (action < R2_LAST_INVENT) {
+ SceneItem::display2(500, action);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+ }
+}
+
+bool Scene500::Doorway::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) {
+ R2_GLOBALS._player.disableControl();
+
+ if (R2_GLOBALS.getFlag(26)) {
+ scene->_stripNumber = 1104;
+ scene->_sceneMode = 524;
+ scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, NULL);
+ } else {
+ scene->_sceneMode = 500;
+ scene->setAction(&scene->_sequenceManager1, scene, 500, &R2_GLOBALS._player, NULL);
+ }
+
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ switch (action) {
+ case CURSOR_LOOK:
+ SceneItem::display2(500, R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) ? 50 : 49);
+ return true;
+
+ case CURSOR_USE:
+ if (R2_GLOBALS._player._characterIndex != R2_QUINN) {
+ SceneItem::display2(500, 52);
+ return true;
+ } else if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) != 1) &&
+ (R2_GLOBALS._player._characterIndex != R2_SEEKER) && !R2_GLOBALS.getFlag(28)) {
+ R2_GLOBALS._player.disableControl();
+
+ if (_position.y == 120) {
+ scene->_sceneMode = 513;
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player,
+ &scene->_tanks1, NULL);
+ } else {
+ scene->_sceneMode = 514;
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player,
+ &scene->_tanks2, NULL);
+ }
+ return true;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return SceneActor::startAction(action, event);
+}
+
+bool Scene500::AirLock::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && R2_GLOBALS.getFlag(26)) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = (R2_GLOBALS._player._characterIndex == R2_QUINN) ? 521 : 522;
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player,
+ &scene->_object2, &scene->_airLock, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::Aerosol::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if (action == CURSOR_USE) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 503;
+ scene->setAction(&scene->_sequenceManager1, scene, 503, &R2_GLOBALS._player, this, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::SonicStunner::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 520 : 502;
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::Locker1::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) {
+ R2_GLOBALS._player.disableControl();
+
+ if (R2_GLOBALS.getFlag(11))
+ scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 517 : 505;
+ else
+ scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 516 : 504;
+
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, this, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::Locker2::startAction(CursorType action, Event &event) {
+ Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) {
+ R2_GLOBALS._player.disableControl();
+
+ if (R2_GLOBALS.getFlag(12))
+ scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 519 : 507;
+ else
+ scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 518 : 506;
+
+ scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, this, NULL);
+ return true;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+bool Scene500::Object::startAction(CursorType action, Event &event) {
+ if (action == CURSOR_USE) {
+ return false;
+ } else {
+ return SceneActor::startAction(action, event);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene500::postInit(SceneObjectList *OwnerList) {
+ SceneExt::postInit();
+ loadScene(500);
+
+ Common::fill(&_buffer[0], &_buffer[2710], 0);
+ _stripManager.setColors(60, 255);
+ _stripManager.setFontNumber(50);
+ _stripManager.addSpeaker(&_seekerSpeaker);
+ _stripManager.addSpeaker(&_quinnSpeaker);
+
+ if (R2_GLOBALS.getFlag(25)) {
+ R2_GLOBALS._player._characterScene[R2_SEEKER] = 500;
+
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ R2_GLOBALS._walkRegions.disableRegion(1);
+
+ _object2.postInit();
+ _object2._effect = 1;
+ _object2.setup(1505, 1, 1);
+ _object2._moveDiff.x = 5;
+ _object2.setPosition(Common::Point(42, 151));
+ _object2.setDetails(500, 34, 35, 36, 1, (SceneItem *)NULL);
+ } else if (R2_GLOBALS._player._characterScene[R2_QUINN] == 500) {
+ _object2.postInit();
+ _object2._effect = 1;
+ _object2.setup(R2_GLOBALS.getFlag(26) ? 1500 : 10, 1, 1);
+ _object2.setPosition(Common::Point(42, 151));
+
+ R2_GLOBALS._walkRegions.disableRegion(1);
+ R2_GLOBALS._walkRegions.disableRegion(2);
+ R2_GLOBALS._walkRegions.disableRegion(3);
+
+ _object2.setDetails(500, 37, 38, -1, 1, (SceneItem *)NULL);
+ }
+ }
+
+ if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) != 500) && R2_GLOBALS.getFlag(27)) {
+ _tanks1.postInit();
+ _tanks1.setup(502, 7, 1);
+ _tanks1.setPosition(Common::Point(281, 120));
+ _tanks1.setDetails(500, -1, -1, -1, 1, (SceneItem *)NULL);
+ } else {
+ if (R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 500) {
+ _tanks1.postInit();
+ _tanks1.setup(502, 7, 1);
+ _tanks1.setPosition(Common::Point(281, 120));
+ _tanks1.setDetails(500, -1, -1, -1, 1, (SceneItem *)NULL);
+ }
+
+ _tanks2.postInit();
+ _tanks2.setup(502, 7, 1);
+ _tanks2.setPosition(Common::Point(286, 121));
+ _tanks2.setDetails(500, -1, -1, -1, 1, (SceneItem *)NULL);
+ }
+
+ _doorway.postInit();
+ _doorway.setup(501, 1, 1);
+ _doorway.setPosition(Common::Point(132, 85));
+ _doorway.setDetails(500, 15, -1, 17, 1, (SceneItem *)NULL);
+
+ _airLock.postInit();
+ _airLock.setup(501, 2, 1);
+ _airLock.setPosition(Common::Point(41, 121));
+
+ if (!R2_GLOBALS.getFlag(25))
+ _airLock.setDetails(500, 6, -1, 10, 1, (SceneItem *)NULL);
+ else if ((R2_GLOBALS._player._characterScene[R2_QUINN] != 500) ||
+ (R2_GLOBALS._player._characterScene[R2_SEEKER] != 500))
+ _airLock.setDetails(500, 6, -1, 40, 1, (SceneItem *)NULL);
+ else
+ _airLock.setDetails(500, 6, -1, 9, 1, (SceneItem *)NULL);
+
+ _locker1.postInit();
+ _locker1.setup(500, 3, R2_GLOBALS.getFlag(11) ? 6 : 1);
+ _locker1.setPosition(Common::Point(220, 82));
+ _locker1.setDetails(500, 27, -1, -1, 1, (SceneItem *)NULL);
+
+ _locker2.postInit();
+ _locker2.setup(500, 4, R2_GLOBALS.getFlag(12) ? 6 : 1);
+ _locker2.setPosition(Common::Point(291, 98));
+ _locker2.fixPriority(121);
+ _locker2.setDetails(500, 27, -1, -1, 1, (SceneItem *)NULL);
+
+ if (R2_INVENTORY.getObjectScene(R2_AEROSOL) == 500) {
+ _aerosol.postInit();
+ _aerosol.setup(500, 5, 2);
+ _aerosol.setPosition(Common::Point(286, 91));
+ _aerosol.fixPriority(120);
+ _aerosol.setDetails(500, 24, 25, 26, 1, (SceneItem *)NULL);
+ }
+
+ if (R2_INVENTORY.getObjectScene(R2_SONIC_STUNNER) == 500) {
+ _sonicStunner.postInit();
+ _sonicStunner.setup(500, 5, 1);
+ _sonicStunner.setPosition(Common::Point(214, 76));
+ _sonicStunner.setDetails(500, 21, 22, 23, 1, (SceneItem *)NULL);
+ }
+
+ _object1.postInit();
+ _object1._effect = 1;
+ _object1.setup(502, 1, 1);
+ _object1.setPosition(Common::Point(258, 99));
+ _object1.fixPriority(50);
+
+ _object8.postInit();
+ _object8.setPosition(Common::Point(250, 111));
+
+ if (!R2_GLOBALS.getFlag(35)) {
+ _object8.setup(501, 3, 1);
+ } else {
+ _object8.setup(500, 8, 7);
+
+ _object3.postInit();
+ _object3._effect = 1;
+ _object3.setPosition(Common::Point(247, 52));
+ _object3.setDetails(500, -1, -1, -1, 2, (SceneItem *)NULL);
+
+ if (!R2_GLOBALS.getFlag(26)) {
+ if (R2_GLOBALS.getFlag(28))
+ _object3.setup(502, 7, 2);
+ else
+ _object3.setup(502, R2_GLOBALS._v566A3 + 2, 7);
+ }
+ }
+
+ R2_GLOBALS._player.postInit();
+ R2_GLOBALS._player.setVisage(10);
+ R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ R2_GLOBALS._player._moveDiff.x = 5;
+
+ _controlPanel.setDetails(Rect(175, 62, 191, 80), 500, 31, 32, 33, 1, (SceneItem *)NULL);
+ _item2.setDetails(Rect(13, 58, 70, 118), 500, 12, -1, -1, 1, (SceneItem *)NULL);
+ _background.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 500, 0, -1, -1, 1, (SceneItem *)NULL);
+
+ if ((R2_GLOBALS._player._characterIndex == R2_QUINN) && (R2_GLOBALS._sceneManager._previousScene == 700)) {
+ R2_GLOBALS._player.disableControl();
+ _sceneMode = 501;
+ setAction(&_sequenceManager1, this, 501, &R2_GLOBALS._player, &_doorway, NULL);
+ } else {
+ if (R2_GLOBALS._player._characterIndex != R2_QUINN) {
+ R2_GLOBALS._player.setup(1505, 6, 1);
+ } else {
+ R2_GLOBALS._player.setup(R2_GLOBALS.getFlag(26) ? 1500 : 10, 6, 1);
+ }
+
+ R2_GLOBALS._player.setPosition(Common::Point(123, 135));
+ R2_GLOBALS._player.enableControl();
+ }
+}
+
+void Scene500::synchronize(Serializer &s) {
+ SceneExt::synchronize(s);
+ s.syncAsSint16LE(_stripNumber);
+}
+
+void Scene500::signal() {
+ switch (_sceneMode) {
+ case 3:
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 5:
+ _sceneMode = 12;
+ _sound1.play(127);
+ _object1.animate(ANIM_MODE_6, this);
+
+ R2_GLOBALS.clearFlag(35);
+ _object3.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 6:
+ _sceneMode = 11;
+ _sound1.play(127);
+ _object1.animate(ANIM_MODE_5, this);
+
+ R2_GLOBALS.clearFlag(35);
+ _object3.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 7:
+ _sound1.play(126);
+ _object8.animate(ANIM_MODE_6, this);
+
+ R2_GLOBALS.clearFlag(35);
+ _object3.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 500:
+ R2_GLOBALS._sceneManager.changeScene(700);
+ break;
+ case 501:
+ if (R2_GLOBALS._player._characterScene[R2_QUINN] == 500) {
+ _stripNumber = 1100;
+ _sceneMode = 523;
+ setAction(&_sequenceManager1, this, 523, &R2_GLOBALS._player, NULL);
+ } else {
+ R2_GLOBALS._player.enableControl();
+ }
+ break;
+ case 502:
+ case 520:
+ R2_INVENTORY.setObjectScene(R2_SONIC_STUNNER, 1);
+ _sonicStunner.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 503:
+ R2_INVENTORY.setObjectScene(R2_AEROSOL, 1);
+ _aerosol.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 504:
+ case 516:
+ R2_GLOBALS.setFlag(11);
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 505:
+ case 517:
+ R2_GLOBALS.clearFlag(11);
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 506:
+ case 518:
+ R2_GLOBALS.setFlag(11);
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 507:
+ case 519:
+ R2_GLOBALS.clearFlag(12);
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 509:
+ R2_GLOBALS.clearFlag(35);
+ _object3.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 510:
+ R2_GLOBALS._player.enableControl();
+ _area1.setDetails(500, 6, 1, Common::Point(160, 120));
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 513:
+ R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1);
+ _tanks1.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 514:
+ R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1);
+ R2_GLOBALS.setFlag(27);
+ _tanks2.remove();
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 515:
+ R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 0);
+ R2_GLOBALS.setFlag(28);
+ R2_GLOBALS._player.enableControl();
+ break;
+ case 521:
+ case 522:
+ R2_GLOBALS._sceneManager.changeScene(525);
+ break;
+ case 523:
+ case 524:
+ R2_GLOBALS._events.setCursor(CURSOR_ARROW);
+ _sceneMode = 8;
+ _stripManager.start(_stripNumber, this);
+ break;
+ default:
+ R2_GLOBALS._player.enableControl();
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------
* Scene 800 - Sick Bay
*
*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h
index 177cdc3774..c7b0ecfc83 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.h
@@ -442,6 +442,85 @@ public:
virtual void dispatch();
};
+class Scene500: public SceneExt {
+ /* Items */
+ class ControlPanel: public SceneHotspot {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+
+ /* Objects */
+ class Object2: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Object3: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Doorway: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class OxygenTanks: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class AirLock: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Object8: public SceneActor {
+ // This classes uses a custom draw method
+ };
+ class Aerosol: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class SonicStunner: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Locker1: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Locker2: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+ class Object: public SceneActor {
+ public:
+ virtual bool startAction(CursorType action, Event &event);
+ };
+public:
+ int _stripNumber;
+ byte _buffer[2710];
+ SpeakerSeeker _seekerSpeaker;
+ SpeakerQuinn _quinnSpeaker;
+ SceneHotspot _background, _item2;
+ ControlPanel _controlPanel;
+ SceneActor _object1;
+ Object2 _object2;
+ Object3 _object3;
+ Doorway _doorway;
+ OxygenTanks _tanks1, _tanks2;
+ AirLock _airLock;
+ Object8 _object8;
+ Aerosol _aerosol;
+ SonicStunner _sonicStunner;
+ Locker1 _locker1;
+ Locker2 _locker2;
+ SceneAreaObject _area1;
+ Object _obj1, _obj2, _obj3;
+ ASoundExt _sound1;
+ SequenceManager _sequenceManager1, _sequenceManager2;
+public:
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void synchronize(Serializer &s);
+ virtual void signal();
+};
+
class Scene800: public SceneExt {
/* Items */
class Button: public NamedHotspot {
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index eb374b3d50..18ca3b060d 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -277,7 +277,7 @@ bool Scene1100::Actor17::startAction(CursorType action, Event &event) {
return SceneActor::startAction(action, event);
}
break;
- case R2_7:
+ case R2_SONIC_STUNNER:
// No break on purpose
case R2_44:
if (_visage == 1105) {
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index ef2d0526ae..a1409067dc 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
@@ -1035,7 +1035,7 @@ bool Scene2350::Actor2::startAction(CursorType action, Event &event) {
bool Scene2350::Actor3::startAction(CursorType action, Event &event) {
Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene;
- if ((action == R2_20) && (R2_GLOBALS.getFlag(74))) {
+ if ((action == R2_REBREATHER_TANK) && (R2_GLOBALS.getFlag(74))) {
R2_GLOBALS._player.disableControl();
scene->_actor1.postInit();
scene->_sceneMode = 2355;
@@ -2488,7 +2488,7 @@ void Scene2500::signal() {
bool Scene2525::Item5::startAction(CursorType action, Event &event) {
Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene;
- if ((action == R2_20) && (!R2_GLOBALS.getFlag(74))) {
+ if ((action == R2_REBREATHER_TANK) && (!R2_GLOBALS.getFlag(74))) {
R2_GLOBALS._player.disableControl();
scene->_sceneMode = 2526;
scene->setAction(&scene->_sequenceManager, scene, 2526, &R2_GLOBALS._player, NULL);
@@ -4177,7 +4177,7 @@ bool Scene2800::Actor1::startAction(CursorType action, Event &event) {
scene->_sceneMode = 2803;
scene->_stripManager.start(scene->_field412, scene);
return true;
- } else if (action == R2_7) {
+ } else if (action == R2_SONIC_STUNNER) {
R2_GLOBALS._events.setCursor(CURSOR_ARROW);
R2_GLOBALS._player.disableControl();
R2_GLOBALS.setFlag(47);
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
index 266098a2ca..c6c1b0610c 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
@@ -3029,10 +3029,10 @@ bool Scene3600::Actor13::startAction(CursorType action, Event &event) {
scene->_stripManager.start(3327, scene);
return true;
- case R2_7:
+ case R2_SONIC_STUNNER:
// No break on purpose
case R2_44:
- if (action == R2_7)
+ if (action == R2_SONIC_STUNNER)
R2_GLOBALS._sound3.play(43);
else
R2_GLOBALS._sound3.play(99);