diff options
Diffstat (limited to 'engines/tsage/ringworld2/ringworld2_scenes0.cpp')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.cpp | 391 |
1 files changed, 200 insertions, 191 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 3b7d283e44..634ecf3ddb 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -2042,8 +2042,8 @@ void Scene200::WestExit::changeScene() { /*--------------------------------------------------------------------------*/ void Scene200::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(200); + SceneExt::postInit(); _westExit.setDetails(Rect(94, 0, 123, 58), EXITCURSOR_W, 175); _westExit.setDest(Common::Point(125, 52)); @@ -2708,6 +2708,8 @@ void Scene250::signal() { case 7: _field418 = 1; if ((_field414 + 12) == _field412) + _sceneMode = 9; + else _sceneMode = 8; signal(); break; @@ -2741,7 +2743,7 @@ void Scene250::signal() { R2_GLOBALS._sceneManager.changeScene(300); break; case 139: - R2_GLOBALS._sceneManager.changeScene(139); + R2_GLOBALS._sceneManager.changeScene(700); break; case 91: R2_GLOBALS._sceneManager.changeScene(850); @@ -3181,8 +3183,9 @@ void Scene300::synchronize(Serializer &s) { } void Scene300::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(300); + SceneExt::postInit(); + _sound1.play(23); setZoomPercents(75, 93, 120, 100); @@ -3233,7 +3236,7 @@ void Scene300::postInit(SceneObjectList *OwnerList) { _protocolDisplay.postInit(); _protocolDisplay.setup(300, 6, 1); _protocolDisplay.setPosition(Common::Point(287, 71)); - _protocolDisplay.animate(ANIM_MODE_7, NULL); + _protocolDisplay.animate(ANIM_MODE_7, 0, NULL); _protocolDisplay._numFrames = 5; _object6.postInit(); @@ -4908,7 +4911,7 @@ bool Scene500::Doorway::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager1, scene, 524, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 500; - scene->setAction(&scene->_sequenceManager1, scene, 500, &R2_GLOBALS._player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 500, &R2_GLOBALS._player, this, NULL); } return true; @@ -4986,7 +4989,7 @@ bool Scene500::SonicStunner::startAction(CursorType action, Event &event) { 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); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, this, NULL); return true; } else { return SceneActor::startAction(action, event); @@ -5075,7 +5078,7 @@ void Scene500::postInit(SceneObjectList *OwnerList) { } } - if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) != 500) && R2_GLOBALS.getFlag(27)) { + 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)); @@ -5230,7 +5233,7 @@ void Scene500::signal() { R2_GLOBALS._sceneManager.changeScene(700); break; case 501: - if (R2_GLOBALS._player._characterScene[R2_QUINN] == 500) { + if (R2_GLOBALS._player._characterScene[R2_MIRANDA] == 500) { _stripNumber = 1100; _sceneMode = 523; setAction(&_sequenceManager1, this, 523, &R2_GLOBALS._player, NULL); @@ -5338,9 +5341,10 @@ void Scene525::signal() { } /*-------------------------------------------------------------------------- - * Scene 600 - + * Scene 600 - Drive Room * *--------------------------------------------------------------------------*/ + Scene600::Scene600() { _field412 = 0; for (int i = 0; i < 256; i++) @@ -5355,11 +5359,12 @@ void Scene600::synchronize(Serializer &s) { s.syncAsByte(_fieldAD2[i]); } -bool Scene600::Item1::startAction(CursorType action, Event &event) { +bool Scene600::CompartmentHotspot::startAction(CursorType action, Event &event) { if ((action != R2_NEGATOR_GUN) || (!R2_GLOBALS.getFlag(5)) || (R2_GLOBALS.getFlag(8))) return SceneHotspot::startAction(action, event); - SceneItem::display(600, 32, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5368,12 +5373,14 @@ bool Scene600::Item4::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); if ((R2_GLOBALS.getFlag(5)) && (!R2_GLOBALS.getFlag(8))) { - SceneItem::display(600, 32, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } if (R2_GLOBALS.getFlag(5)) { - SceneItem::display(600, 30, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(600, 30, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5394,13 +5401,14 @@ bool Scene600::Item4::startAction(CursorType action, Event &event) { } void Scene600::Actor4::signal() { - Common::Point pt(36, 177 + R2_GLOBALS._randomSource.getRandomNumber(5)); + Common::Point pt(177 + R2_GLOBALS._randomSource.getRandomNumber(5), + 108 + R2_GLOBALS._randomSource.getRandomNumber(3)); NpcMover *mover = new NpcMover(); addMover(mover, &pt, this); } bool Scene600::Actor4::startAction(CursorType action, Event &event) { - if ((action >= CURSOR_WALK) && (action < R2CURSORS_START)) + if (action >= CURSOR_WALK) // Only action cursors return SceneActor::startAction(action, event); @@ -5412,7 +5420,7 @@ void Scene600::Actor4::draw() { SceneActor::draw(); } -bool Scene600::Actor5::startAction(CursorType action, Event &event) { +bool Scene600::Doorway::startAction(CursorType action, Event &event) { if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) return false; @@ -5423,10 +5431,10 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) { if ((R2_INVENTORY.getObjectScene(R2_CLAMP) == 600) && (!R2_GLOBALS.getFlag(6))) { R2_GLOBALS._player.disableControl(); - scene->_actor6.setDetails(600, 11, -1, -1, 3, (SceneItem *) NULL); + scene->_laser.setDetails(600, 11, -1, -1, 3, (SceneItem *) NULL); R2_GLOBALS.setFlag(6); scene->_sceneMode = 609; - scene->setAction(&scene->_sequenceManager1, scene, 609, &R2_GLOBALS._player, &scene->_actor5, &scene->_actor6, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 609, &R2_GLOBALS._player, &scene->_doorway, &scene->_laser, &scene->_actor1, NULL); return true; } @@ -5436,7 +5444,7 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) { if (!R2_GLOBALS.getFlag(6)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 616; - scene->setAction(&scene->_sequenceManager1, scene, 616, &R2_GLOBALS._player, &scene->_actor5, &scene->_actor6, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 616, &R2_GLOBALS._player, &scene->_doorway, &scene->_laser, NULL); return true; } @@ -5445,15 +5453,15 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) { else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 601; - scene->setAction(&scene->_sequenceManager1, scene, 601, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 601, &R2_GLOBALS._player, &scene->_doorway, NULL); } return true; } -bool Scene600::Actor6::startAction(CursorType action, Event &event) { +bool Scene600::Laser::startAction(CursorType action, Event &event) { Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; - if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) { + if (action < CURSOR_WALK) { switch (action) { case R2_COM_SCANNER: if (R2_GLOBALS.getFlag(6)) { @@ -5463,7 +5471,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { } else { R2_GLOBALS._player.disableControl(); scene->_actor8.postInit(); - scene->_actor8.setDetails(600, 20, -1, -1, 4, &scene->_actor6); + scene->_actor8.setDetails(600, 20, -1, -1, 4, &scene->_laser); scene->_sceneMode = 607; scene->setAction(&scene->_sequenceManager1, scene, 607, &R2_GLOBALS._player, &scene->_actor8, NULL); return true; @@ -5478,8 +5486,8 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { return true; } else { R2_GLOBALS._player.disableControl(); - scene->_actor7.postInit(); - scene->_actor7.setDetails(600, 27, -1, -1, 5, &scene->_actor6); + scene->_aerosol.postInit(); + scene->_aerosol.setDetails(600, 27, -1, -1, 5, &scene->_laser); scene->_actor4.postInit(); scene->_actor4.setup(601, 3, 1); @@ -5487,11 +5495,11 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { scene->_actor4._moveDiff = Common::Point(1, 1); scene->_actor4._moveRate = 2; scene->_actor4._numFrames = 3; - scene->_actor4.setDetails(600, 24, 25, 26, 5, &scene->_actor7); + scene->_actor4.setDetails(600, 24, 25, 26, 5, &scene->_aerosol); scene->_sceneMode = 605; - scene->setAction(&scene->_sequenceManager1, scene, 605, &R2_GLOBALS._player, &scene->_actor7, &scene->_actor4, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 605, &R2_GLOBALS._player, &scene->_aerosol, &scene->_actor4, &scene->_doorway, NULL); return true; } break; @@ -5499,7 +5507,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { if (R2_GLOBALS.getFlag(5)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 606; - scene->setAction(&scene->_sequenceManager1, scene, 606, &R2_GLOBALS._player, &scene->_actor6, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 606, &R2_GLOBALS._player, &scene->_laser, NULL); return true; } else { return SceneActor::startAction(action, event); @@ -5509,7 +5517,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { return false; break; } - } else if (action != CURSOR_USE) { + } else if (action == CURSOR_USE) { if (R2_GLOBALS.getFlag(5)) { return SceneActor::startAction(action, event); } else { @@ -5522,7 +5530,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene600::Actor7::startAction(CursorType action, Event &event) { +bool Scene600::Aerosol::startAction(CursorType action, Event &event) { Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) { @@ -5530,7 +5538,7 @@ bool Scene600::Actor7::startAction(CursorType action, Event &event) { } else if (action == CURSOR_USE) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 614; - scene->setAction(&scene->_sequenceManager1, scene, 614, &R2_GLOBALS._player, &scene->_actor7, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 614, &R2_GLOBALS._player, &scene->_aerosol, NULL); return true; } else { return SceneActor::startAction(action, event); @@ -5544,7 +5552,7 @@ bool Scene600::Actor8::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 615; scene->setAction(&scene->_sequenceManager1, scene, 615, &R2_GLOBALS._player, &scene->_actor8, NULL); - } else if ((action == R2_SONIC_STUNNER) && (R2_INVENTORY.getObjectScene(9) == 600) && (R2_GLOBALS._v565F1[1] == 2) && (!R2_GLOBALS.getFlag(8))){ + } else if ((action == R2_SONIC_STUNNER) && (R2_INVENTORY.getObjectScene(9) == 600) && (R2_GLOBALS._scannerFrequencies[1] == 2) && (!R2_GLOBALS.getFlag(8))){ R2_GLOBALS._player.disableControl(); scene->_sceneMode = 608; scene->setAction(&scene->_sequenceManager1, scene, 608, &R2_GLOBALS._player, &scene->_actor4, NULL); @@ -5564,21 +5572,21 @@ void Scene600::postInit(SceneObjectList *OwnerList) { warning("FIXME: loop to initialize _fieldAD2[]"); - _actor5.postInit(); - _actor5.setVisage(600); - _actor5.setPosition(Common::Point(29, 147)); - _actor5.fixPriority(10); - _actor5.setDetails(300, 3, -1, -1, 1, (SceneItem *) NULL); + _doorway.postInit(); + _doorway.setVisage(600); + _doorway.setPosition(Common::Point(29, 147)); + _doorway.fixPriority(10); + _doorway.setDetails(300, 3, -1, -1, 1, (SceneItem *) NULL); - _actor6.postInit(); - _actor6.setPosition(Common::Point(246, 41)); + _laser.postInit(); + _laser.setPosition(Common::Point(246, 41)); if (R2_INVENTORY.getObjectScene(9) == 600) { _actor8.postInit(); _actor8.setup(602, 5, 1); _actor8.setPosition(Common::Point(246, 41)); _actor8.setDetails(600, 20, -1, -1, 1, (SceneItem *) NULL); - switch (R2_GLOBALS._v565F1[1] - 2) { + switch (R2_GLOBALS._scannerFrequencies[1] - 2) { case 0: R2_GLOBALS._sound4.play(45); break; @@ -5597,11 +5605,11 @@ void Scene600::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS.getFlag(6)) { - _actor6.setup(602, 7, 1); - _actor6.setDetails(600, 11, -1, -1, 1, (SceneItem *) NULL); + _laser.setup(602, 7, 1); + _laser.setDetails(600, 11, -1, -1, 1, (SceneItem *) NULL); } else { - _actor6.setup(600, 2, 1); - _actor6.setDetails(600, 10, -1, -1, 1, (SceneItem *) NULL); + _laser.setup(600, 2, 1); + _laser.setDetails(600, 10, -1, -1, 1, (SceneItem *) NULL); _actor1.postInit(); _actor1.setup(600, 3, 5); @@ -5614,10 +5622,10 @@ void Scene600::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS.getFlag(5)) { if (R2_INVENTORY.getObjectScene(12) == 600) { - _actor7.postInit(); - _actor7.setup(602, 2, 2); - _actor7.setPosition(Common::Point(189, 95)); - _actor7.setDetails(600, 27, -1, -1, 1, (SceneItem *) NULL); + _aerosol.postInit(); + _aerosol.setup(602, 2, 2); + _aerosol.setPosition(Common::Point(189, 95)); + _aerosol.setDetails(600, 27, -1, -1, 1, (SceneItem *) NULL); } if (R2_GLOBALS.getFlag(8)) { @@ -5651,30 +5659,30 @@ void Scene600::postInit(SceneObjectList *OwnerList) { _item3.setDetails(11, 600, 14, -1, -1); if (R2_GLOBALS.getFlag(9)) { - _item1.setDetails(Rect(159, 3, 315, 95), 600, 7, -1, -1, 1, NULL); + _background.setDetails(Rect(159, 3, 315, 95), 600, 7, -1, -1, 1, NULL); } else { _item4.setDetails(Rect(173, 15, 315, 45), 600, 21, -1, 23, 1, NULL); - _item1.setDetails(Rect(159, 3, 315, 95), 600, 6, -1, -1, 1, NULL); + _background.setDetails(Rect(159, 3, 315, 95), 600, 6, -1, -1, 1, NULL); } _item5.setDetails(Rect(0, 0, 320, 200), 600, 0, -1, -1, 1, NULL); _sceneMode = 600; if (R2_GLOBALS._sceneManager._previousScene == 700) { if (R2_GLOBALS.getFlag(6)) { - setAction(&_sequenceManager1, this, 600, &R2_GLOBALS._player, &_actor5, NULL); + setAction(&_sequenceManager1, this, 600, &R2_GLOBALS._player, &_doorway, NULL); } else if (R2_GLOBALS.getFlag(5)) { - setAction(&_sequenceManager1, this, 603, &R2_GLOBALS._player, &_actor5, &_actor6, &_actor1, NULL); + setAction(&_sequenceManager1, this, 603, &R2_GLOBALS._player, &_doorway, &_laser, &_actor1, NULL); } else { - setAction(&_sequenceManager1, this, 602, &R2_GLOBALS._player, &_actor5, &_actor6, &_actor1, NULL); + setAction(&_sequenceManager1, this, 602, &R2_GLOBALS._player, &_doorway, &_laser, &_actor1, NULL); } } else if (R2_GLOBALS.getFlag(5)) { R2_GLOBALS._player.setPosition(Common::Point(50, 140)); R2_GLOBALS._player.setStrip(3); - _actor6.setFrame(_actor6.getFrameCount()); + _laser.setFrame(_laser.getFrameCount()); signal(); } else { - _actor5.setFrame(7); - _actor6.setFrame(7); + _doorway.setFrame(7); + _laser.setFrame(7); R2_GLOBALS._player.setPosition(Common::Point(28, 140)); R2_GLOBALS._player.setStrip(5); signal(); @@ -5703,7 +5711,7 @@ void Scene600::signal() { R2_GLOBALS._walkRegions.enableRegion(9); R2_GLOBALS._walkRegions.enableRegion(10); - R2_INVENTORY.setObjectScene(12, 600); + R2_INVENTORY.setObjectScene(R2_AEROSOL, 600); R2_GLOBALS.setFlag(5); _actor4._effect = 3; @@ -5730,12 +5738,12 @@ void Scene600::signal() { _actor3.remove(); R2_GLOBALS._sceneItems.remove(&_item4); _actor2.setDetails(600, 21, -1, 23, 4, &_item4); - _item1.setDetails(600, 7, -1, -1, 3, (SceneItem *) NULL); + _background.setDetails(600, 7, -1, -1, 3, (SceneItem *) NULL); R2_GLOBALS._player.enableControl(CURSOR_USE); break; case 614: R2_GLOBALS._player.enableControl(); - _actor7.remove(); + _aerosol.remove(); R2_INVENTORY.setObjectScene(12, 1); R2_GLOBALS._walkRegions.disableRegion(7); break; @@ -5753,8 +5761,9 @@ void Scene600::signal() { } void Scene600::process(Event &event) { - if ((!R2_GLOBALS._player._canWalk) && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN)) { - if (!_actor5.contains(event.mousePos) || (_actor5._frame <= 1)) { + if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) + && (R2_GLOBALS._events.getCursor() == CURSOR_WALK)) { + if (!_doorway.contains(event.mousePos) || (_doorway._frame <= 1)) { if (R2_GLOBALS.getFlag(5)) { _field412 += 10; } else { @@ -5766,7 +5775,7 @@ void Scene600::process(Event &event) { } else { R2_GLOBALS._player.disableControl(); _sceneMode = 613; - setAction(&_sequenceManager1, this, 613, &R2_GLOBALS._player, &_actor6, NULL); + setAction(&_sequenceManager1, this, 613, &R2_GLOBALS._player, &_laser, NULL); event.handled = true; } } else if ((!R2_GLOBALS.getFlag(6)) && (R2_GLOBALS._player._mover) && (_field412 < 10)){ @@ -5778,9 +5787,9 @@ void Scene600::process(Event &event) { void Scene600::dispatch() { if ((_field412 != 0) && (_sceneMode != 600) && (_sceneMode != 603) && (_sceneMode != 602)) { - if ( ((_actor6._strip == 4) && (_actor6._frame > 1)) + if ( ((_laser._strip == 4) && (_laser._frame > 1)) || (_sceneMode == 601) - || ((_sceneMode == 616) && (_actor5._frame > 1)) ) + || ((_sceneMode == 616) && (_doorway._frame > 1)) ) _field412 = 0; else { _field412--; @@ -5803,7 +5812,7 @@ void Scene600::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 700 - + * Scene 700 - Lander Bay 2 * *--------------------------------------------------------------------------*/ Scene700::Scene700() { @@ -5849,7 +5858,7 @@ bool Scene700::Item12::startAction(CursorType action, Event &event) { break; } - scene->setAction(&scene->_sequenceManager, this, 707, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager, scene, 707, &R2_GLOBALS._player, &scene->_actor5, NULL); return true; } @@ -5910,7 +5919,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) { case 0: if ((_strip == 2) && (_frame == 1)) { R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._player._position.x <= 100) { + if (R2_GLOBALS._player._position.y <= 100) { scene->_sceneMode = 710; scene->setAction(&scene->_sequenceManager, scene, 710, &R2_GLOBALS._player, this, NULL); } else { @@ -5969,10 +5978,10 @@ bool Scene700::Actor6::startAction(CursorType action, Event &event) { } void Scene700::postInit(SceneObjectList *OwnerList) { + loadScene(700); if (R2_GLOBALS._sceneManager._previousScene == 900) - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, 200); - loadScene(700); R2_GLOBALS._v558B6.set(60, 0, 260, 200); SceneExt::postInit(); @@ -5994,7 +6003,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { _actor1.postInit(); _actor1.setup(700, 4, 1); - _actor1.setPosition(Common::Point(355 - ((R2_GLOBALS._v565E3 * 8) / 5), ((R2_GLOBALS._v565E1 + 20 ) / 5) - 12)); + _actor1.setPosition(Common::Point(355 - ((R2_GLOBALS._electromagnetZoom * 8) / 5), ((R2_GLOBALS._electromagnetChangeAmount + 20 ) / 5) - 12)); _actor1.fixPriority(10); _actor1.setDetails(700, 12, -1, 14, 1, (SceneItem *) NULL); @@ -6041,7 +6050,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { case 700: switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) + if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _actor5.setup(701, 2, 1); else _actor5.setup(701, 2, 8); @@ -6158,9 +6167,7 @@ void Scene700::signal() { } break; case 3: - R2_INVENTORY.setObjectScene(5, 600); - R2_INVENTORY.setObjectScene(16, 700); - R2_GLOBALS._player.enableControl(); + R2_GLOBALS._sceneManager.changeScene(600); break; case 4: _sceneMode = 5; @@ -6206,7 +6213,7 @@ void Scene700::signal() { _sceneMode = 17; _actor5.setup(701, 1, 8); _actor5.setDetails(700, 38, -1, -1, 3, (SceneItem *) NULL); - if ((R2_GLOBALS._v565E5 != 0) && (_actor5._position.x == _actor1._position.x + 1) && (_actor5._position.x == 148 - (((R2_GLOBALS._v565E1 + 10) / 5) * 4))) { + if ((R2_GLOBALS._v565E5 != 0) && (_actor5._position.x == _actor1._position.x + 1) && (_actor5._position.x == 148 - (((R2_GLOBALS._electromagnetChangeAmount + 10) / 5) * 4))) { _actor5.animate(ANIM_MODE_6, NULL); Common::Point pt(_actor5._position.x, _actor1._position.y + 120); NpcMover *mover = new NpcMover(); @@ -6231,7 +6238,7 @@ void Scene700::signal() { break; case 21: _actor5.fixPriority(77); - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) + if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _actor5.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); @@ -6249,7 +6256,7 @@ void Scene700::signal() { case 706: _actor5.setDetails(700, 38, -1, -1, 3, (SceneItem *) NULL); _actor5.fixPriority(77); - if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) + if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) _actor5.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); @@ -6416,8 +6423,8 @@ bool Scene800::Cabinet::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ void Scene800::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(800); + SceneExt::postInit(); _door.postInit(); _door.setVisage(800); @@ -7006,8 +7013,8 @@ bool Scene850::Panel::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ void Scene850::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(850); + SceneExt::postInit(); _liftDoor.postInit(); _liftDoor.setup(850, 2, 1); @@ -7103,44 +7110,47 @@ void Scene850::signal() { } /*-------------------------------------------------------------------------- - * Scene 900 - + * Scene 900 - Lander Bay 2 - Crane Controls * *--------------------------------------------------------------------------*/ -Scene900::Actor4::Actor4() { - _fieldA4 = 0; + +Scene900::Button::Button() { + _buttonId = 0; } -void Scene900::Actor4::synchronize(Serializer &s) { +void Scene900::Button::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); + s.syncAsSint16LE(_buttonId); } -void Scene900::Actor4::sub96135(int arg1) { - _fieldA4 = arg1; + +void Scene900::Button::initButton(int buttonId) { + _buttonId = buttonId; + postInit(); setDetails(900, -1, -1, -1, 2, (SceneItem *) NULL); } Scene900::Scene900() { _field412 = 0; - _field414 = 0; - _field416 = 0; + _magnetChangeAmount.x = 0; + _magnetChangeAmount.y = 0; } void Scene900::synchronize(Serializer &s) { SceneExt::synchronize(s); s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_magnetChangeAmount.x); + s.syncAsSint16LE(_magnetChangeAmount.y); } -bool Scene900::Actor4::startAction(CursorType action, Event &event) { +bool Scene900::Button::startAction(CursorType action, Event &event) { Scene900 *scene = (Scene900 *)R2_GLOBALS._sceneManager._scene; if (action == CURSOR_USE) { R2_GLOBALS._sound2.play(14); - switch (_fieldA4) { + switch (_buttonId) { case 2: if (scene->_field412 == 1) { scene->_sceneMode = 2; @@ -7150,15 +7160,15 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { scene->_aSound1.play(30); setup(900, 3, 11); R2_GLOBALS._v565E5 = 1; - if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS == 700)) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS == 700)) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { scene->_actor2.animate(ANIM_MODE_6, NULL); } else { - if (((scene->_actor3._percent * 49) / 100) + scene->_actor3._position.x == scene->_actor2._position.x) { - if (scene->_actor2._position.x == 166 - (R2_GLOBALS._v565E3 / 15)) { + if (((scene->_electromagnet._percent * 49) / 100) + scene->_electromagnet._position.x == scene->_actor2._position.x) { + if (scene->_actor2._position.x == 166 - (R2_GLOBALS._electromagnetZoom / 15)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 4; - scene->_actor2._moveDiff.y = (scene->_actor2._position.y - (scene->_actor3._position.y + ((scene->_actor3._percent * 3) / 10) - 2)) / 9; - Common::Point pt(scene->_actor3._position.x + ((scene->_actor3._percent * 49) / 100), scene->_actor3._position.y + ((scene->_actor3._percent * 3) / 10) - 2); + scene->_actor2._moveDiff.y = (scene->_actor2._position.y - (scene->_electromagnet._position.y + ((scene->_electromagnet._percent * 3) / 10) - 2)) / 9; + Common::Point pt(scene->_electromagnet._position.x + ((scene->_electromagnet._percent * 49) / 100), scene->_electromagnet._position.y + ((scene->_electromagnet._percent * 3) / 10) - 2); NpcMover *mover = new NpcMover(); scene->_actor2.addMover(mover, &pt, this); scene->_actor2.animate(ANIM_MODE_6, NULL); @@ -7179,7 +7189,7 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { scene->_sceneMode = 5; scene->_actor2.animate(ANIM_MODE_5, NULL); scene->_actor2._moveDiff.y = (166 - scene->_actor2._position.y) / 9; - Common::Point pt(scene->_actor2._position.x, 166 - (R2_GLOBALS._v565E3 / 15)); + Common::Point pt(scene->_actor2._position.x, 166 - (R2_GLOBALS._electromagnetZoom / 15)); NpcMover *mover = new NpcMover(); scene->_actor2.addMover(mover, &pt, this); } @@ -7196,30 +7206,30 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { return true; break; case 4: - if ((scene->_field416 == 0) && (scene->_field414 == 0) && (R2_GLOBALS._v565E3 != 0)) { + if ((scene->_magnetChangeAmount.y == 0) && (scene->_magnetChangeAmount.x == 0) && (R2_GLOBALS._electromagnetZoom != 0)) { scene->_aSound1.play(38); - scene->_field416 = -5; + scene->_magnetChangeAmount.y = -5; } return true; break; case 5: - if ((scene->_field416 == 0) && (scene->_field414 == 0) && (R2_GLOBALS._v565E3 < 135)) { + if ((scene->_magnetChangeAmount.y == 0) && (scene->_magnetChangeAmount.x == 0) && (R2_GLOBALS._electromagnetZoom < 135)) { scene->_aSound1.play(38); - scene->_field416 = 5; + scene->_magnetChangeAmount.y = 5; } return true; break; case 6: - if ((scene->_field416 == 0) && (scene->_field414 == 0) && (R2_GLOBALS._v565E1 > -10)) { + if ((scene->_magnetChangeAmount.y == 0) && (scene->_magnetChangeAmount.x == 0) && (R2_GLOBALS._electromagnetChangeAmount > -10)) { scene->_aSound1.play(38); - scene->_field414 = -5; + scene->_magnetChangeAmount.x = -5; } return true; break; case 7: - if ((scene->_field416 == 0) && (scene->_field414 == 0) && (R2_GLOBALS._v565E1 < 20)) { + if ((scene->_magnetChangeAmount.y == 0) && (scene->_magnetChangeAmount.x == 0) && (R2_GLOBALS._electromagnetChangeAmount < 20)) { scene->_aSound1.play(38); - scene->_field414 = 5; + scene->_magnetChangeAmount.x = 5; } return true; break; @@ -7234,12 +7244,12 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { default: if (scene->_field412 == 1) { R2_GLOBALS._player.disableControl(); - scene->_actor5.remove(); - scene->_actor6.remove(); - scene->_actor7.remove(); - scene->_actor8.remove(); - scene->_actor9.remove(); - scene->_actor10.remove(); + scene->_button2.remove(); + scene->_button3.remove(); + scene->_button4.remove(); + scene->_button5.remove(); + scene->_button6.remove(); + scene->_button7.remove(); R2_GLOBALS._sound2.play(37); scene->_sceneMode = 901; scene->setAction(&scene->_sequenceManager1, scene, 901, &scene->_actor1, this ,NULL); @@ -7252,10 +7262,8 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { break; } } else if (action == CURSOR_LOOK) { - if ((_fieldA4 == 2) && (scene->_field412 == 2)) - SceneItem::display(900, 21, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - else - SceneItem::display(900, _fieldA4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(900, ((_buttonId == 2) && (scene->_field412 == 2)) ? 21 : _buttonId + 11, + SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, SET_Y, 20, SET_EXT_BGCOLOR, 7, -999); return true; } else { return SceneActor::startAction(action, event); @@ -7275,16 +7283,15 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _actor1.postInit(); _actor1.setDetails(900, 3, -1, -1, 1, (SceneItem *) NULL); - _field414 = 0; - _field416 = 0; + _magnetChangeAmount.x = 0; + _magnetChangeAmount.y = 0; - _actor3.postInit(); - _actor3.fixPriority(1); - // useless, the original use it for debugging purposes: strcpy(_actor3._actorName, "Crane"); - _actor3.setup(900, 1, 2); - _actor3.setPosition(Common::Point(89, 0)); - _actor3._effect = 1; - _actor3.setDetails(900, 6, -1, 8, 1, (SceneItem *) NULL); + _electromagnet.postInit(); + _electromagnet.fixPriority(1); + _electromagnet.setup(900, 1, 2); + _electromagnet.setPosition(Common::Point(89, 0)); + _electromagnet._effect = 1; + _electromagnet.setDetails(900, 6, -1, 8, 1, (SceneItem *) NULL); if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { _actor2.postInit(); @@ -7294,7 +7301,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) { if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 700) { _actor2.setup(901, 3, 2); - } else if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { + } else if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { _actor2.setup(901, 2, 1); } else { _actor2.setup(901, 2, 8); @@ -7306,7 +7313,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._v565E7 == 0) { _actor2.setup(901, 1, 8); // Original set two times the same values: skipped - _actor2.setPosition(Common::Point((((100 - ((R2_GLOBALS._v565EB * 350) / 100)) * 49) / 100) + ((R2_GLOBALS._v565E9 * _actor3._percent * 6) / 100) + 89, 166 - (R2_GLOBALS._v565EB / 3))); + _actor2.setPosition(Common::Point((((100 - ((R2_GLOBALS._v565EB * 350) / 100)) * 49) / 100) + ((R2_GLOBALS._v565E9 * _electromagnet._percent * 6) / 100) + 89, 166 - (R2_GLOBALS._v565EB / 3))); _actor2.changeZoom(((100 - ((R2_GLOBALS._v565EB * 350) / 100) + 52) / 10) * 10); } } @@ -7329,68 +7336,68 @@ void Scene900::signal() { _field412 = 1; R2_GLOBALS._sound2.play(37); - _actor5.remove(); - _actor6.remove(); - _actor7.remove(); - _actor8.remove(); - _actor9.remove(); - _actor10.remove(); + _button2.remove(); + _button3.remove(); + _button4.remove(); + _button5.remove(); + _button6.remove(); + _button7.remove(); - _actor5.sub96135(2); - _actor5.setup(900, 2, 1); - _actor5.setPosition(Common::Point(36, 166)); + _button2.initButton(2); + _button2.setup(900, 2, 1); + _button2.setPosition(Common::Point(36, 166)); - _actor6.sub96135(3); - _actor6.setup(900, 2, 5); - _actor6.setPosition(Common::Point(117, 166)); + _button3.initButton(3); + _button3.setup(900, 2, 5); + _button3.setPosition(Common::Point(117, 166)); break; case 2: _field412 = 2; - _actor5.remove(); - _actor6.remove(); + _button2.remove(); + _button3.remove(); - _actor5.sub96135(2); + _button2.initButton(2); if (R2_GLOBALS._v565E5 == 0) - _actor5.setup(900, 3, 9); + _button2.setup(900, 3, 9); else - _actor5.setup(900, 3, 11); - _actor5.setPosition(Common::Point(36, 166)); + _button2.setup(900, 3, 11); + _button2.setPosition(Common::Point(36, 166)); - _actor7.sub96135(5); - _actor7.setup(900, 3, 3); - _actor7.setPosition(Common::Point(76, 134)); + _button4.initButton(5); + _button4.setup(900, 3, 3); + _button4.setPosition(Common::Point(76, 134)); - _actor8.sub96135(4); - _actor8.setup(900, 3, 7); - _actor8.setPosition(Common::Point(76, 156)); + _button5.initButton(4); + _button5.setup(900, 3, 7); + _button5.setPosition(Common::Point(76, 156)); - _actor9.sub96135(6); - _actor9.setup(900, 3, 1); - _actor9.setPosition(Common::Point(55, 144)); + _button6.initButton(6); + _button6.setup(900, 3, 1); + _button6.setPosition(Common::Point(55, 144)); - _actor10.sub96135(7); - _actor10.setup(900, 3, 5); - _actor10.setPosition(Common::Point(99, 144)); + _button7.initButton(7); + _button7.setup(900, 3, 5); + _button7.setPosition(Common::Point(99, 144)); break; case 3: _field412 = 3; - _actor5.remove(); - _actor6.remove(); - _actor7.remove(); - _actor8.remove(); - _actor9.remove(); - _actor10.remove(); + _button2.remove(); + _button3.remove(); + _button4.remove(); + _button5.remove(); + _button6.remove(); + _button7.remove(); - _actor5.sub96135(8); - _actor5.setup(900, 4, 1); - _actor5.setPosition(Common::Point(36, 166)); + _button2.initButton(8); + _button2.setup(900, 4, 1); + _button2.setPosition(Common::Point(36, 166)); - _actor6.sub96135(9); - _actor6.setup(900, 4, 5); - _actor6.setPosition(Common::Point(117, 166)); + _button3.initButton(9); + _button3.setup(900, 4, 5); + _button3.setPosition(Common::Point(117, 166)); break; case 4: _sceneMode = 0; @@ -7404,9 +7411,9 @@ void Scene900::signal() { _actor1.setup(900, 1, 1); - _actor4.sub96135(1); - _actor4.setup(900, 1, 3); - _actor4.setPosition(Common::Point(77, 168)); + _button1.initButton(1); + _button1.setup(900, 1, 3); + _button1.setPosition(Common::Point(77, 168)); _sceneMode = 1; signal(); @@ -7425,26 +7432,28 @@ void Scene900::signal() { } void Scene900::dispatch() { - if (_field416 != 0) { - if (_field416 < 0) { - R2_GLOBALS._v565E3--; - ++_field416; + if (_magnetChangeAmount.y != 0) { + if (_magnetChangeAmount.y < 0) { + R2_GLOBALS._electromagnetZoom--; + ++_magnetChangeAmount.y; } else { - ++R2_GLOBALS._v565E3; - _field416--; + ++R2_GLOBALS._electromagnetZoom; + _magnetChangeAmount.y--; } } - if (_field414 != 0) { - R2_GLOBALS._v565E1--; - ++_field414; - } else { - ++R2_GLOBALS._v565E1; - _field414++; + if (_magnetChangeAmount.x != 0) { + if (_magnetChangeAmount.x < 0) { + R2_GLOBALS._electromagnetChangeAmount--; + ++_magnetChangeAmount.x; + } else { + ++R2_GLOBALS._electromagnetChangeAmount; + _magnetChangeAmount.x--; + } } if (R2_GLOBALS._sceneObjects->contains(&_actor2)) { - if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { + if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._electromagnetChangeAmount == 20) && (R2_GLOBALS._electromagnetZoom == 70)) { if ((_actor2._frame > 1) && (_actor2._animateMode != ANIM_MODE_6)) _actor2.animate(ANIM_MODE_6, NULL); } else { @@ -7453,17 +7462,17 @@ void Scene900::dispatch() { } } - _actor3.changeZoom(100 - ((R2_GLOBALS._v565E3 * 70) / 100)); - _actor3.setPosition(Common::Point(((_actor3._percent * R2_GLOBALS._v565E1 * 6) / 100) + 89, R2_GLOBALS._v565E3)); + _electromagnet.changeZoom(100 - ((R2_GLOBALS._electromagnetZoom * 70) / 100)); + _electromagnet.setPosition(Common::Point(((_electromagnet._percent * R2_GLOBALS._electromagnetChangeAmount * 6) / 100) + 89, R2_GLOBALS._electromagnetZoom)); if ((R2_GLOBALS._sceneObjects->contains(&_actor2)) && (R2_GLOBALS._v565E7 != 0) && (!_actor2._mover) && (_actor2._animateMode == ANIM_MODE_NONE)) { - _actor2.setPosition(Common::Point(_actor3._position.x + ((_actor3._percent * 49) / 100), _actor3._position.y + ((_actor3._percent * 3) / 10))); - if (R2_GLOBALS._v565E3 >= 75) { + _actor2.setPosition(Common::Point(_electromagnet._position.x + ((_electromagnet._percent * 49) / 100), _electromagnet._position.y + ((_electromagnet._percent * 3) / 10))); + if (R2_GLOBALS._electromagnetZoom >= 75) { _actor2.setup(901, 1, 1); - _actor2.changeZoom(((_actor3._percent + 52) / 10) * 10); + _actor2.changeZoom(((_electromagnet._percent + 52) / 10) * 10); } else { _actor2.setup(901, 5, 1); - _actor2.changeZoom(((_actor3._percent / 10) * 10) + 30); + _actor2.changeZoom(((_electromagnet._percent / 10) * 10) + 30); } } Scene::dispatch(); |