diff options
Diffstat (limited to 'engines/tsage')
22 files changed, 2869 insertions, 2636 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index fbbf982c28..f7fbb1daa1 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1518,7 +1518,7 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { tempRect, Rect(0, 0, tempRect.width(), tempRect.height()), NULL); if (g_vm->getGameID() == GType_Ringworld2 && !GLOBALS._player._uiEnabled && T2_GLOBALS._interfaceY == UI_INTERFACE_Y) { - g_globals->_screenSurface.fillRect(Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT), 0); + g_globals->_screenSurface.fillRect(Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT - 1), 0); } for (SynchronizedList<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i) @@ -2066,8 +2066,8 @@ SceneObject::SceneObject() : SceneHotspot() { _visage = 0; _strip = 0; _frame = 0; - _effect = 0; - _shade = _shade2 = 0; + _effect = EFFECT_NONE; + _shade = _oldShade = 0; _linkedActor = NULL; _field8A = Common::Point(0, 0); @@ -2370,12 +2370,17 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_8: case ANIM_MODE_9: - _field68 = va_arg(va, int); - _endAction = va_arg(va, Action *); - _frameChange = 1; - _endFrame = getFrameCount(); - if (_frame == _endFrame) - setFrame(getNewFrame()); + if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) { + _frameChange = -1; + _field2E = _position; + } else { + _field68 = va_arg(va, int); + _endAction = va_arg(va, Action *); + _frameChange = 1; + _endFrame = getFrameCount(); + if (_frame == _endFrame) + setFrame(getNewFrame()); + } break; } va_end(va); @@ -2468,7 +2473,7 @@ void SceneObject::synchronize(Serializer &s) { if (g_vm->getGameID() == GType_Ringworld2) { s.syncAsSint16LE(_effect); s.syncAsSint16LE(_shade); - s.syncAsSint16LE(_shade2); + s.syncAsSint16LE(_oldShade); SYNC_POINTER(_linkedActor); } } @@ -2514,9 +2519,9 @@ void SceneObject::remove() { void SceneObject::dispatch() { if (g_vm->getGameID() == GType_Ringworld2) { - if (_shade != _shade2) + if (_shade != _oldShade) _flags |= OBJFLAG_PANES; - _shade2 = _shade; + _oldShade = _shade; } uint32 currTime = g_globals->_events.getFrameNumber(); @@ -2634,8 +2639,9 @@ void SceneObject::dispatch() { _linkedActor->setFrame(_frame); } - if ((_effect == 1) && (getRegionIndex() < 11)) - _shade = 0; + int regionIndex = getRegionIndex(); + if ((_effect == EFFECT_SHADED) && (regionIndex < 11)) + _shade = regionIndex; } } @@ -2664,7 +2670,24 @@ void SceneObject::removeObject() { GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); - return _visageImages.getFrame(_frame); + GfxSurface frame = _visageImages.getFrame(_frame); + + // If shading is needed, post apply the shadiing onto the frame + if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { + Graphics::Surface s = frame.lockSurface(); + byte *p = (byte *)s.getPixels(); + byte *endP = p + s.w * s.h; + + while (p < endP) { + if (*p != frame._transColor) + *p = R2_GLOBALS._fadePaletteMap[_shade - 1][*p]; + ++p; + } + + frame.unlockSurface(); + } + + return frame; } void SceneObject::reposition() { @@ -3285,7 +3308,7 @@ void Player::postInit(SceneObjectList *OwnerList) { { _moveDiff.x = 3; _moveDiff.y = 2; - _effect = 1; + _effect = EFFECT_SHADED; _shade = 0; _linkedActor = NULL; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 6156d13b34..2c88f6be79 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -466,6 +466,9 @@ enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MOD ANIM_MODE_9 = 9 }; +enum Effect { EFFECT_NONE = 0, EFFECT_SHADED = 1, EFFECT_2 = 2, EFFECT_3 = 3, + EFFECT_4 = 4, EFFECT_5 = 5 }; + class SceneObject; class Visage { @@ -550,7 +553,7 @@ public: // Ringworld 2 specific fields byte *_field9C; - int _shade, _shade2; + int _shade, _oldShade; int _effect; SceneObject *_linkedActor; public: diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index ac6ce0bf8e..d2d8464763 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -271,6 +271,11 @@ void EventsClass::setCursor(CursorType cursorType) { _currentCursor = cursorType; cursor = g_resourceManager->getSubResource(5, 1, cursorType - R2CURSORS_START, &size); break; + + case R2_CURSOR_ROPE: + _currentCursor = cursorType; + cursor = g_resourceManager->getSubResource(5, 4, 1, &size); + break; } // Decode the cursor diff --git a/engines/tsage/events.h b/engines/tsage/events.h index a1e9da3477..9ef4813e47 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -108,6 +108,7 @@ enum CursorType { EXITCURSOR_NE = 0x800D, EXITCURSOR_SE = 0x800E, EXITCURSOR_SW = 0x800F, EXITCURSOR_NW = 0x8010, SHADECURSOR_UP = 0x8011, SHADECURSOR_DOWN = 0x8012, SHADECURSOR_HAND = 0x8013, R2_CURSOR_20 = 0x8014, R2_CURSOR_21 = 0x8015, R2_CURSOR_22 = 0x8016, R2_CURSOR_23 = 0x8017, + R2_CURSOR_ROPE = 0x8025, // Cursors CURSOR_WALK = 0x100, CURSOR_LOOK = 0x200, CURSOR_700 = 700, CURSOR_USE = 0x400, CURSOR_TALK = 0x800, diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 7068c2fa1a..9bd7249902 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -427,34 +427,34 @@ void Ringworld2Globals::reset() { _spillLocation[12] = 27; _spillLocation[13] = 31; + // Initialise the vampire data within the Flub maze for (int i = 0; i < 18; i++) { - _v56613[(i * 4) ] = 1; - _v56613[(i * 4) + 2] = 0; - _v56613[(i * 4) + 3] = 0; + _vampireData[i]._isAlive = true; + _vampireData[i]._position = Common::Point(); } - _v56613[( 0 * 4) + 1] = 1; - _v56613[( 1 * 4) + 1] = 2; - _v56613[( 2 * 4) + 1] = 2; - _v56613[( 3 * 4) + 1] = 3; - _v56613[( 4 * 4) + 1] = 2; - _v56613[( 5 * 4) + 1] = 2; - _v56613[( 6 * 4) + 1] = 3; - _v56613[( 7 * 4) + 1] = 1; - _v56613[( 8 * 4) + 1] = 1; - _v56613[( 9 * 4) + 1] = 3; - _v56613[(10 * 4) + 1] = 3; - _v56613[(11 * 4) + 1] = 1; - _v56613[(12 * 4) + 1] = 2; - _v56613[(13 * 4) + 1] = 3; - _v56613[(14 * 4) + 1] = 2; - _v56613[(15 * 4) + 1] = 3; - _v56613[(16 * 4) + 1] = 1; - _v56613[(17 * 4) + 1] = 1; + _vampireData[0]._shotsRequired = 1; + _vampireData[1]._shotsRequired = 2; + _vampireData[2]._shotsRequired = 2; + _vampireData[3]._shotsRequired = 3; + _vampireData[4]._shotsRequired = 2; + _vampireData[5]._shotsRequired = 2; + _vampireData[6]._shotsRequired = 3; + _vampireData[7]._shotsRequired = 1; + _vampireData[8]._shotsRequired = 1; + _vampireData[9]._shotsRequired = 3; + _vampireData[10]._shotsRequired = 3; + _vampireData[11]._shotsRequired = 1; + _vampireData[12]._shotsRequired = 2; + _vampireData[13]._shotsRequired = 3; + _vampireData[14]._shotsRequired = 2; + _vampireData[15]._shotsRequired = 3; + _vampireData[16]._shotsRequired = 1; + _vampireData[17]._shotsRequired = 1; _v566A6 = 3800; _landerSuitNumber = 2; - _v566A4 = 1; - _v566A5 = 0; + _flubMazeArea = 1; + _flubMazeEntryDirection = 0; _desertStepsRemaining = 5; _desertCorrectDirection = 0; _desertPreviousDirection = 0; @@ -463,11 +463,10 @@ void Ringworld2Globals::reset() { _desertWrongDirCtr = -1; _balloonAltitude = 5; _scene1925CurrLevel = 0; //_v56A9C - _v56A9E = 0; + _walkwaySceneNumber = 0; _v56AA0 = 0; - _v56AA1 = 0; - _v56AA2 = 60; - _v56AA4 = 660; + _scientistConvIndex = 0; + _ventCellPos = Common::Point(60, 660); _v56AA6 = 1; _v56AA7 = 1; _v56AA8 = 1; @@ -504,7 +503,7 @@ void Ringworld2Globals::reset() { _player._characterIndex = R2_QUINN; _player._characterScene[R2_QUINN] = 100; _player._characterScene[R2_SEEKER] = 300; - _player._characterScene[3] = 300; + _player._characterScene[R2_MIRANDA] = 300; } void Ringworld2Globals::synchronize(Serializer &s) { @@ -530,9 +529,9 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_v566A6); s.syncAsSint16LE(_desertWrongDirCtr); s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C - s.syncAsSint16LE(_v56A9E); - s.syncAsSint16LE(_v56AA2); - s.syncAsSint16LE(_v56AA4); + s.syncAsSint16LE(_walkwaySceneNumber); + s.syncAsSint16LE(_ventCellPos.x); + s.syncAsSint16LE(_ventCellPos.y); s.syncAsSint16LE(_v56AAB); s.syncAsSint16LE(_scene180Mode); s.syncAsSint16LE(_v57709); @@ -553,13 +552,13 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsByte(_scannerFrequencies[i]); s.syncAsByte(_v565AE); - s.syncAsByte(_v566A4); - s.syncAsByte(_v566A5); + s.syncAsByte(_flubMazeArea); + s.syncAsByte(_flubMazeEntryDirection); s.syncAsByte(_desertStepsRemaining); s.syncAsByte(_desertCorrectDirection); s.syncAsByte(_desertPreviousDirection); s.syncAsByte(_v56AA0); - s.syncAsByte(_v56AA1); + s.syncAsByte(_scientistConvIndex); s.syncAsByte(_v56AA6); s.syncAsByte(_v56AA7); s.syncAsByte(_v56AA8); @@ -580,6 +579,14 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_balloonPosition.x); s.syncAsSint16LE(_balloonPosition.y); + + // Synchronise Flub maze vampire data + for (i = 0; i < 18; ++i) { + s.syncAsSint16LE(_vampireData[i]._isAlive); + s.syncAsSint16LE(_vampireData[i]._shotsRequired); + s.syncAsSint16LE(_vampireData[i]._position.x); + s.syncAsSint16LE(_vampireData[i]._position.y); + } } } // end of namespace Ringworld2 diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 0684076b1e..ad47f7f620 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -244,6 +244,12 @@ namespace Ringworld2 { class ScannerDialog; +struct VampireData { + bool _isAlive; + int _shotsRequired; + Common::Point _position; +}; + class Ringworld2Globals: public TsAGE2Globals { public: ASoundExt _sound1, _sound2, _sound3, _sound4; @@ -270,9 +276,9 @@ public: int _v5657C; byte _v565AE; byte _spillLocation[14]; - int _v56613[76]; - byte _v566A4; - byte _v566A5; + VampireData _vampireData[18]; + byte _flubMazeArea; + byte _flubMazeEntryDirection; int _v566A6; byte _landerSuitNumber; byte _desertStepsRemaining; @@ -282,10 +288,10 @@ public: int _desertWrongDirCtr; byte _balloonAltitude; int _scene1925CurrLevel; //_v56A9C - int _v56A9E; + int _walkwaySceneNumber; byte _v56AA0; - byte _v56AA1; - int _v56AA2; + byte _scientistConvIndex; + Common::Point _ventCellPos; int _v56AA4; byte _v56AA6; byte _v56AA7; diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 663697d94d..057d91a46e 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -235,7 +235,7 @@ void CharacterDialog::show() { scene->saveCharacter(oldCharacter); // Play the correctfrequency, if any, of the character being switched to's scanner device - if (R2_GLOBALS._player._characterScene[0] != 300) { + if (R2_GLOBALS._player._characterScene[R2_NONE] != 300) { switch (R2_GLOBALS._scannerFrequencies[R2_GLOBALS._player._characterIndex] - 1) { case 0: R2_GLOBALS._sound4.stop(); diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 013abfa4a4..b86b8283ed 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -38,8 +38,6 @@ namespace TsAGE { namespace Ringworld2 { Scene *Ringworld2Game::createScene(int sceneNumber) { - warning("Switching to scene %d", sceneNumber); - switch (sceneNumber) { /* Scene group #0 */ case 50: @@ -118,6 +116,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 1100: return new Scene1100(); case 1200: + // ARM Base - Air Ducts Maze return new Scene1200(); case 1337: case 1330: @@ -162,10 +161,13 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains Elevator Exit return new Scene1900(); case 1925: + // Spill Mountains Elevator Shaft return new Scene1925(); case 1945: + // Spill Mountains Shaft Bottom return new Scene1945(); case 1950: + // Flup Tube Corridor Maze return new Scene1950(); /* Scene group #2 */ // @@ -215,13 +217,13 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains: Exit return new Scene2600(); case 2700: - // Forest Maze + // Outer Forest return new Scene2700(); case 2750: - // Forest Maze + // Inner Forest return new Scene2750(); case 2800: - // Exiting Forest + // Guard post return new Scene2800(); case 2900: // Balloon Cutscene @@ -262,18 +264,19 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Room with large stasis field negator return new Scene3250(); case 3255: + // Guard Post return new Scene3255(); case 3260: - // Computer room + // ARM Base - Computer room return new Scene3260(); case 3275: - // Hall + // ARM Base - Hall return new Scene3275(); case 3350: // Cutscene - Ship landing return new Scene3350(); case 3375: - // Outer walkway + // Circular Walkway return new Scene3375(); case 3385: // Corridor @@ -297,6 +300,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Desert return new Scene3800(); case 3900: + // Forest Entrance return new Scene3900(); default: error("Unknown scene number - %d", sceneNumber); @@ -375,6 +379,10 @@ void SceneExt::remove() { _sceneAreas.clear(); Scene::remove(); R2_GLOBALS._uiElements._active = true; + + if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && + R2_GLOBALS._events.getCursor() <= SHADECURSOR_DOWN) + R2_GLOBALS._events.setCursor(CURSOR_WALK); } void SceneExt::process(Event &event) { @@ -777,116 +785,115 @@ bool DisplayObject::performAction(int action) { Ringworld2InvObjectList::Ringworld2InvObjectList(): _none(1, 1), - _inv1(1, 2), - _inv2(1, 3), + _optoDisk(1, 2), + _reader(1, 3), _negatorGun(1, 4), _steppingDisks(1, 5), - _inv5(1, 6), - _inv6(1, 7), - _inv7(1, 8), - _inv8(1, 9), - _inv9(1, 10), - _inv10(1, 11), - _inv11(1, 12), - _inv12(1, 13), - _inv13(1, 14), - _inv14(1, 15), - _inv15(1, 16), - _inv16(1, 17), - _inv17(2, 2), - _inv18(2, 3), - _inv19(2, 4), - _inv20(2, 5), - _inv21(2, 5), - _inv22(2, 6), - _inv23(2, 7), - _inv24(2, 8), - _inv25(2, 9), - _inv26(2, 10), - _inv27(2, 11), - _inv28(2, 12), - _inv29(2, 13), - _inv30(2, 14), - _inv31(2, 15), - _inv32(2, 16), - _inv33(3, 2), - _inv34(3, 3), - _inv35(3, 4), - _inv36(3, 5), - _inv37(3, 6), - _inv38(3, 7), - _inv39(1, 10), - _inv40(3, 8), - _inv41(3, 9), - _inv42(3, 10), - _inv43(3, 11), - _inv44(3, 12), - _inv45(3, 13), - _inv46(3, 17), - _inv47(3, 14), - _inv48(3, 14), - _inv49(3, 15), - _inv50(3, 15), - _inv51(3, 17), - _inv52(4, 2) { + _attractorUnit(1, 6), + _sensorProbe(1, 7), + _sonicStunner(1, 8), + _cableHarness(1, 9), + _comScanner(1, 10), + _spentPowerCapsule(1, 11), // 10 + _chargedPowerCapsule(1, 12), + _aerosol(1, 13), + _remoteControl(1, 14), + _opticalFibre(1, 15), + _clamp(1, 16), + _attractorHarness(1, 17), + _fuelCell(2, 2), + _gyroscope(2, 3), + _airbag(2, 4), + _rebreatherTank(2, 5), // 20 + _reserveTank(2, 5), + _guidanceModule(2, 6), + _thrusterValve(2, 7), + _balloonBackpack(2, 8), + _radarMechanism(2, 9), + _joystick(2, 10), + _ignitor(2, 11), + _diagnosticsDisplay(2, 12), + _glassDome(2, 13), + _wickLamp(2, 14), // 30 + _scrithKey(2, 15), + _tannerMask(2, 16), + _pureGrainAlcohol(3, 2), + _blueSapphire(3, 3), + _ancientScrolls(3, 4), + _flute(3, 5), + _gunpowder(3, 6), + _unused(3, 7), + _comScanner2(1, 10), + _superconductorWire(3, 8), // 40 + _pillow(3, 9), + _foodTray(3, 10), + _laserHacksaw(3, 11), + _photonStunner(3, 12), + _battery(3, 13), + _soakedFaceMask(2, 17), + _lightBulb(3, 14), + _alcoholLamp1(2, 14), + _alcoholLamp2(3, 15), + _alocholLamp3(3, 15), // 50 + _brokenDisplay(3, 17), + _toolbox(4, 2) { // Add the items to the list _itemList.push_back(&_none); - _itemList.push_back(&_inv1); - _itemList.push_back(&_inv2); + _itemList.push_back(&_optoDisk); + _itemList.push_back(&_reader); _itemList.push_back(&_negatorGun); _itemList.push_back(&_steppingDisks); - _itemList.push_back(&_inv5); - _itemList.push_back(&_inv6); - _itemList.push_back(&_inv7); - _itemList.push_back(&_inv8); - _itemList.push_back(&_inv9); - _itemList.push_back(&_inv10); - _itemList.push_back(&_inv11); - _itemList.push_back(&_inv12); - _itemList.push_back(&_inv13); - _itemList.push_back(&_inv14); - _itemList.push_back(&_inv15); - _itemList.push_back(&_inv16); - _itemList.push_back(&_inv17); - _itemList.push_back(&_inv18); - _itemList.push_back(&_inv19); - _itemList.push_back(&_inv20); - _itemList.push_back(&_inv21); - _itemList.push_back(&_inv22); - _itemList.push_back(&_inv23); - _itemList.push_back(&_inv24); - _itemList.push_back(&_inv25); - _itemList.push_back(&_inv26); - _itemList.push_back(&_inv27); - _itemList.push_back(&_inv28); - _itemList.push_back(&_inv29); - _itemList.push_back(&_inv30); - _itemList.push_back(&_inv31); - _itemList.push_back(&_inv32); - _itemList.push_back(&_inv33); - _itemList.push_back(&_inv34); - _itemList.push_back(&_inv35); - _itemList.push_back(&_inv36); - _itemList.push_back(&_inv37); - _itemList.push_back(&_inv38); - _itemList.push_back(&_inv39); - _itemList.push_back(&_inv40); - _itemList.push_back(&_inv41); - _itemList.push_back(&_inv42); - _itemList.push_back(&_inv43); - _itemList.push_back(&_inv44); - _itemList.push_back(&_inv45); - _itemList.push_back(&_inv46); - _itemList.push_back(&_inv47); - _itemList.push_back(&_inv48); - _itemList.push_back(&_inv49); - _itemList.push_back(&_inv50); - _itemList.push_back(&_inv51); - _itemList.push_back(&_inv52); + _itemList.push_back(&_attractorUnit); + _itemList.push_back(&_sensorProbe); + _itemList.push_back(&_sonicStunner); + _itemList.push_back(&_cableHarness); + _itemList.push_back(&_comScanner); + _itemList.push_back(&_spentPowerCapsule); // 10 + _itemList.push_back(&_chargedPowerCapsule); + _itemList.push_back(&_aerosol); + _itemList.push_back(&_remoteControl); + _itemList.push_back(&_opticalFibre); + _itemList.push_back(&_clamp); + _itemList.push_back(&_attractorHarness); + _itemList.push_back(&_fuelCell); + _itemList.push_back(&_gyroscope); + _itemList.push_back(&_airbag); + _itemList.push_back(&_rebreatherTank); // 20 + _itemList.push_back(&_reserveTank); + _itemList.push_back(&_guidanceModule); + _itemList.push_back(&_thrusterValve); + _itemList.push_back(&_balloonBackpack); + _itemList.push_back(&_radarMechanism); + _itemList.push_back(&_joystick); + _itemList.push_back(&_ignitor); + _itemList.push_back(&_diagnosticsDisplay); + _itemList.push_back(&_glassDome); + _itemList.push_back(&_wickLamp); // 30 + _itemList.push_back(&_scrithKey); + _itemList.push_back(&_tannerMask); + _itemList.push_back(&_pureGrainAlcohol); + _itemList.push_back(&_blueSapphire); + _itemList.push_back(&_ancientScrolls); + _itemList.push_back(&_flute); + _itemList.push_back(&_gunpowder); + _itemList.push_back(&_unused); + _itemList.push_back(&_comScanner2); + _itemList.push_back(&_superconductorWire); // 40 + _itemList.push_back(&_pillow); + _itemList.push_back(&_foodTray); + _itemList.push_back(&_laserHacksaw); + _itemList.push_back(&_photonStunner); + _itemList.push_back(&_battery); + _itemList.push_back(&_soakedFaceMask); + _itemList.push_back(&_lightBulb); + _itemList.push_back(&_alcoholLamp1); + _itemList.push_back(&_alcoholLamp2); + _itemList.push_back(&_alocholLamp3); // 50 + _itemList.push_back(&_brokenDisplay); + _itemList.push_back(&_toolbox); _selectedItem = NULL; - } void Ringworld2InvObjectList::reset() { @@ -1060,7 +1067,7 @@ bool Ringworld2InvObjectList::SelectItem(int objectNumber) { currentItem == R2_PURE_GRAIN_ALCOHOL) { R2_INVENTORY.setObjectScene(R2_TANNER_MASK, 0); R2_INVENTORY.setObjectScene(R2_PURE_GRAIN_ALCOHOL, 0); - R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 1); + R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, R2_SEEKER); } else { selectDefault(objectNumber); } @@ -1109,19 +1116,31 @@ void Ringworld2Game::start() { if (slot >= 0) R2_GLOBALS._sceneHandler->_loadGameSlot = slot; else { - // Switch to the first game scene + // Switch to the first title screen R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._uiElements._active = true; - R2_GLOBALS._sceneManager.setNewScene(100); + R2_GLOBALS._sceneManager.setNewScene(180); } g_globals->_events.showCursor(); } +void Ringworld2Game::restartGame() { + if (MessageDialog::show(Ringworld2::R2_RESTART_MSG, CANCEL_BTN_STRING, YES_MSG) == 1) + restart(); +} + void Ringworld2Game::restart() { g_globals->_scenePalette.clearListeners(); g_globals->_soundHandler.stop(); + // Reset the globals + g_globals->reset(); + + // Clear save/load slots + g_globals->_sceneHandler->_saveGameSlot = -1; + g_globals->_sceneHandler->_loadGameSlot = -1; + // Change to the first game scene g_globals->_sceneManager.changeScene(100); } @@ -1298,18 +1317,18 @@ GfxSurface SceneActor::getFrame() { // TODO: Proper effects handling switch (_effect) { - case 0: - case 5: + case EFFECT_NONE: + case EFFECT_5: // TODO: Figure out purpose of setting image flags to 64, and getting // scene priorities -1 or _shade break; - case 1: + case EFFECT_SHADED: // TODO: Transposing using R2_GLOBALS._pixelArrayMap break; - case 2: + case EFFECT_2: // No effect break; - case 4: + case EFFECT_4: break; default: // TODO: Default effect @@ -1344,10 +1363,13 @@ void SceneArea::remove() { } void SceneArea::process(Event &event) { + Common::Point mousePos = event.mousePos; + mousePos.x += R2_GLOBALS._sceneManager._scene->_sceneBounds.left; + if (!R2_GLOBALS._insetUp && _enabled && R2_GLOBALS._events.isCursorVisible()) { CursorType cursor = R2_GLOBALS._events.getCursor(); - if (_bounds.contains(event.mousePos)) { + if (_bounds.contains(mousePos)) { // Cursor moving in bounded area if (cursor != _cursorNum) { _savedCursorNum = cursor; @@ -1355,7 +1377,7 @@ void SceneArea::process(Event &event) { R2_GLOBALS._events.setCursor(_cursorNum); } _insideArea = true; - } else if ((event.mousePos.y < 171) && _insideArea && (_cursorNum == cursor) && + } else if ((mousePos.y < 171) && _insideArea && (_cursorNum == cursor) && (_savedCursorNum != CURSOR_NONE)) { // Cursor moved outside bounded area R2_GLOBALS._events.setCursor(_savedCursorNum); @@ -1395,20 +1417,23 @@ void SceneExit::changeScene() { } void SceneExit::process(Event &event) { + Common::Point mousePos = event.mousePos; + mousePos.x += R2_GLOBALS._sceneManager._scene->_sceneBounds.left; + if (!R2_GLOBALS._insetUp) { SceneArea::process(event); if (_enabled) { if (event.eventType == EVENT_BUTTON_DOWN) { - if (!_bounds.contains(event.mousePos)) + if (!_bounds.contains(mousePos)) _moving = false; else if (!R2_GLOBALS._player._canWalk) { _moving = false; changeScene(); event.handled = true; } else { - Common::Point dest((_destPos.x == -1) ? event.mousePos.x : _destPos.x, - (_destPos.y == -1) ? event.mousePos.y : _destPos.y); + Common::Point dest((_destPos.x == -1) ? mousePos.x : _destPos.x, + (_destPos.y == -1) ? mousePos.y : _destPos.y); ADD_PLAYER_MOVER(dest.x, dest.y); _moving = true; @@ -1491,7 +1516,7 @@ MazeUI::~MazeUI() { } void MazeUI::synchronize(Serializer &s) { - SavedObject::synchronize(s); + SceneObject::synchronize(s); s.syncAsSint16LE(_resNum); if (s.isLoading()) @@ -1503,7 +1528,6 @@ void MazeUI::synchronize(Serializer &s) { } void MazeUI::load(int resNum) { - postInit(); clear(); _resNum = resNum; @@ -2073,7 +2097,7 @@ void AnimationPlayer::close() { _field38 = 0; if (g_globals != NULL) - R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0); + R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) { @@ -2119,19 +2143,19 @@ void AnimationPlayer::getSlices() { /*--------------------------------------------------------------------------*/ AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { - _v = 0; + _isActive = false; _field3A = 0; } void AnimationPlayerExt::synchronize(Serializer &s) { AnimationPlayer::synchronize(s); - s.syncAsSint16LE(_v); + s.syncAsSint16LE(_isActive); } /*--------------------------------------------------------------------------*/ ModalWindow::ModalWindow() { - _field20 = 0; + _insetCount = 0; } void ModalWindow::remove() { @@ -2146,11 +2170,11 @@ void ModalWindow::remove() { void ModalWindow::synchronize(Serializer &s) { SceneArea::synchronize(s); - s.syncAsByte(_field20); + s.syncAsByte(_insetCount); } void ModalWindow::process(Event &event) { - if (_field20 != R2_GLOBALS._insetUp) + if (_insetCount != R2_GLOBALS._insetUp) return; CursorType cursor = R2_GLOBALS._events.getCursor(); @@ -2182,7 +2206,7 @@ void ModalWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, _cursorNum = CURSOR_INVALID; scene->_sceneAreas.push_front(this); ++R2_GLOBALS._insetUp; - _field20 = R2_GLOBALS._insetUp; + _insetCount = R2_GLOBALS._insetUp; } void ModalWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index c7e36fc5f0..aeac2fdd6a 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -163,58 +163,58 @@ private: static void selectDefault(int obectNumber); public: InvObject _none; - InvObject _inv1; - InvObject _inv2; + InvObject _optoDisk; + InvObject _reader; InvObject _negatorGun; InvObject _steppingDisks; - InvObject _inv5; - InvObject _inv6; - InvObject _inv7; - InvObject _inv8; - InvObject _inv9; - InvObject _inv10; - InvObject _inv11; - InvObject _inv12; - InvObject _inv13; - InvObject _inv14; - InvObject _inv15; - InvObject _inv16; - InvObject _inv17; - InvObject _inv18; - InvObject _inv19; - InvObject _inv20; - InvObject _inv21; - InvObject _inv22; - InvObject _inv23; - InvObject _inv24; - InvObject _inv25; - InvObject _inv26; - InvObject _inv27; - InvObject _inv28; - InvObject _inv29; - InvObject _inv30; - InvObject _inv31; - InvObject _inv32; - InvObject _inv33; - InvObject _inv34; - InvObject _inv35; - InvObject _inv36; - InvObject _inv37; - InvObject _inv38; - InvObject _inv39; - InvObject _inv40; - InvObject _inv41; - InvObject _inv42; - InvObject _inv43; - InvObject _inv44; - InvObject _inv45; - InvObject _inv46; - InvObject _inv47; - InvObject _inv48; - InvObject _inv49; - InvObject _inv50; - InvObject _inv51; - InvObject _inv52; + InvObject _attractorUnit; + InvObject _sensorProbe; + InvObject _sonicStunner; + InvObject _cableHarness; + InvObject _comScanner; + InvObject _spentPowerCapsule; // 10 + InvObject _chargedPowerCapsule; + InvObject _aerosol; + InvObject _remoteControl; + InvObject _opticalFibre; + InvObject _clamp; + InvObject _attractorHarness; + InvObject _fuelCell; + InvObject _gyroscope; + InvObject _airbag; + InvObject _rebreatherTank; // 20 + InvObject _reserveTank; + InvObject _guidanceModule; + InvObject _thrusterValve; + InvObject _balloonBackpack; + InvObject _radarMechanism; + InvObject _joystick; + InvObject _ignitor; + InvObject _diagnosticsDisplay; + InvObject _glassDome; + InvObject _wickLamp; // 30 + InvObject _scrithKey; + InvObject _tannerMask; + InvObject _pureGrainAlcohol; + InvObject _blueSapphire; + InvObject _ancientScrolls; + InvObject _flute; + InvObject _gunpowder; + InvObject _unused; + InvObject _comScanner2; + InvObject _superconductorWire; // 40 + InvObject _pillow; + InvObject _foodTray; + InvObject _laserHacksaw; + InvObject _photonStunner; + InvObject _battery; + InvObject _soakedFaceMask; + InvObject _lightBulb; + InvObject _alcoholLamp1; + InvObject _alcoholLamp2; + InvObject _alocholLamp3; // 50 + InvObject _brokenDisplay; + InvObject _toolbox; Ringworld2InvObjectList(); void reset(); @@ -228,6 +228,7 @@ public: class Ringworld2Game: public Game { public: virtual void start(); + virtual void restartGame(); virtual void restart(); virtual void endGame(int resNum, int lineNum); @@ -441,7 +442,7 @@ public: class AnimationPlayerExt: public AnimationPlayer { public: - int _v; + bool _isActive; public: AnimationPlayerExt(); @@ -451,7 +452,7 @@ public: class ModalWindow: public SceneArea { public: SceneActor _object1; - byte _field20; + int _insetCount; public: ModalWindow(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 40e17b6ed9..4ca8eee5de 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -228,6 +228,7 @@ bool Scene100::Terminal::startAction(CursorType action, Event &event) { void Scene100::postInit(SceneObjectList *OwnerList) { loadScene(100); R2_GLOBALS._scenePalette.loadPalette(0); + R2_GLOBALS._scenePalette.setEntry(255, 255, 255, 255); SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene != 125) @@ -1480,14 +1481,14 @@ void Scene180::Action1::signal() { case 0: case 1: case 2: - scene->_object5.setStrip((_actionIndex == 1) ? 1 : 2); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip((_actionIndex == 1) ? 1 : 2); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); break; case 4: - scene->_object5.setStrip(3); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip(3); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); _actionIndex = 0; break; } @@ -1495,7 +1496,7 @@ void Scene180::Action1::signal() { /*--------------------------------------------------------------------------*/ -Scene180::Scene180(): SceneExt(), _webbsterSpeaker(27) { +Scene180::Scene180(): SceneExt() { _field412 = 0; _frameInc = 0; _frameNumber = R2_GLOBALS._events.getFrameNumber(); @@ -1562,7 +1563,7 @@ void Scene180::signal() { _field412 = 1; R2_GLOBALS._sceneManager._hasPalette = true; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 1; @@ -1605,7 +1606,7 @@ void Scene180::signal() { case 5: _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 2; _animationPlayer.load(2); @@ -1648,9 +1649,9 @@ void Scene180::signal() { case 11: _field412 = 1; - _object4.postInit(); - _object5.postInit(); - setAction(&_sequenceManager, this, 4000, &_object4, &_object5, NULL); + _door.postInit(); + _shipDisplay.postInit(); + setAction(&_sequenceManager, this, 4000, &_door, &_shipDisplay, NULL); break; case 12: @@ -1666,37 +1667,37 @@ void Scene180::signal() { break; case 13: - setAction(&_sequenceManager, this, 4001, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4001, &_door, &_shipDisplay, NULL); break; case 15: - setAction(&_sequenceManager, this, 4002, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4002, &_door, &_shipDisplay, NULL); break; case 17: - setAction(&_sequenceManager, this, 4003, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4003, &_door, &_shipDisplay, NULL); break; case 19: - setAction(&_sequenceManager, this, 4004, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4004, &_door, &_shipDisplay, NULL); break; case 21: - setAction(&_sequenceManager, this, 4005, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4005, &_door, &_shipDisplay, NULL); break; case 23: - setAction(&_sequenceManager, this, 4006, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4006, &_door, &_shipDisplay, NULL); break; case 25: - setAction(&_sequenceManager, this, 4007, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4007, &_door, &_shipDisplay, NULL); break; case 27: _field412 = 0; - _object4.remove(); - _object5.remove(); + _door.remove(); + _shipDisplay.remove(); setSceneDelay(2); break; @@ -1710,7 +1711,7 @@ void Scene180::signal() { case 29: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_42; R2_GLOBALS._scene180Mode = 3; _animationPlayer.load(3); @@ -1719,12 +1720,12 @@ void Scene180::signal() { case 31: R2_GLOBALS._sound2.play(7); - _object4.postInit(); - _object4.setVisage(76); - _object4.setStrip(1); - _object4.setFrame(1); - _object4.setPosition(Common::Point(288, 143)); - _object4.fixPriority(210); + _door.postInit(); + _door.setVisage(76); + _door.setStrip(1); + _door.setFrame(1); + _door.setPosition(Common::Point(288, 143)); + _door.fixPriority(210); loadScene(75); @@ -1739,68 +1740,71 @@ void Scene180::signal() { case 32: _field412 = 1; - _object2.postInit(); - _object2.setPosition(Common::Point(161, 97)); - _object2.hide(); + _teal.postInit(); + _teal.setPosition(Common::Point(161, 97)); + _teal.hide(); - _object3.postInit(); - _object3.setPosition(Common::Point(60, 96)); - _object3.hide(); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 11, this); + _webbser.postInit(); + _webbser.setPosition(Common::Point(60, 96)); + _webbser.hide(); + _stripManager.start(11, this); break; case 33: - _object2.hide(); + _teal.hide(); - _object3.setup(76, 4, 1); - _object3.setFrame(_object3.getFrameCount()); + _webbser.setup(76, 4, 1); + _webbser.setFrame(_webbser.getFrameCount()); - _object5.postInit(); - _object5.setup(75, 1, 1); - _object5.setPosition(Common::Point(221, 125)); - _object5.fixPriority(210); - _object5.setAction(&_action1); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 12, this); + _shipDisplay.postInit(); + _shipDisplay.setup(75, 1, 1); + _shipDisplay.setPosition(Common::Point(221, 125)); + _shipDisplay.fixPriority(210); + _shipDisplay.setAction(&_action1); + _stripManager.start(12, this); break; case 34: - _object2.hide(); - _object3.hide(); + _teal.hide(); + _webbser.hide(); - _object1.postInit(); - _object1.setup(76, 2, 1); - _object1.setPosition(Common::Point(287, 135)); - _object1.fixPriority(200); + _dutyOfficer.postInit(); + _dutyOfficer.setup(76, 2, 1); + _dutyOfficer.setPosition(Common::Point(287, 135)); + _dutyOfficer.fixPriority(200); _sound1.play(19); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 5, this); + _door.animate(ANIM_MODE_5, this); break; case 35: - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 13, this); + _stripManager.start(13, this); break; case 36: - _object2.remove(); + _teal.remove(); _sound1.play(19); - - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 6, this); + _door.animate(ANIM_MODE_6, this); break; case 37: _field412 = 0; - _object1.remove(); + _dutyOfficer.remove(); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 8, this); break; case 38: - _object4.remove(); - _object5.setAction(NULL); - _object5.remove(); - + _door.remove(); + _shipDisplay.setAction(NULL); + _shipDisplay.remove(); + + // TODO: Figure out why end action on sounds aren't firing. For now, I'm + // simply setting up a scene delay to ensure the signal() method gets + // called again after a brief delay + setSceneDelay(10); R2_GLOBALS._sound2.fadeOut2(NULL); - R2_GLOBALS._sound1.fadeOut2(NULL); + R2_GLOBALS._sound1.fadeOut2(NULL /* this */); break; case 39: @@ -1823,7 +1827,7 @@ void Scene180::signal() { case 41: _field412 = 1; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; break; case 42: @@ -1842,13 +1846,14 @@ void Scene180::signal() { break; case 45: - R2_GLOBALS._scenePalette.addFader(_animationPlayer._subData._palData, 256, 28, this); + _field412 = 1; + _stripManager.start(28, this); break; case 48: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 15; _animationPlayer.load(15, NULL); @@ -1905,9 +1910,9 @@ void Scene180::dispatch() { } } - if (_animationPlayer._v) { + if (_animationPlayer._isActive) { if (_animationPlayer.isCompleted()) { - _animationPlayer._v = 0; + _animationPlayer._isActive = false; _animationPlayer.close(); _animationPlayer.remove(); @@ -2805,12 +2810,12 @@ void Scene300::Action1::signal() { switch (_actionIndex) { case 0: - setAction(&scene->_sequenceManager2, this, 311, (R2_GLOBALS._player._characterIndex == 1) ? + setAction(&scene->_sequenceManager2, this, 311, (R2_GLOBALS._player._characterIndex == R2_QUINN) ? (SceneObject *)&R2_GLOBALS._player : (SceneObject *)&scene->_quinn); _actionIndex = 2; break; case 1: - setAction(&scene->_sequenceManager2, this, 312, (R2_GLOBALS._player._characterIndex == 1) ? + setAction(&scene->_sequenceManager2, this, 312, (R2_GLOBALS._player._characterIndex == R2_QUINN) ? (SceneObject *)&R2_GLOBALS._player : (SceneObject *)&scene->_quinn); _actionIndex = 0; break; @@ -2904,7 +2909,7 @@ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { return true; case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { SceneItem::display2(300, 47); return true; } @@ -2927,7 +2932,7 @@ bool Scene300::MirandaWorkstation::startAction(CursorType action, Event &event) return true; case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { SceneItem::display2(300, 47); return true; } @@ -2943,7 +2948,7 @@ bool Scene300::MirandaWorkstation::startAction(CursorType action, Event &event) bool Scene300::SeekerWorkstation::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { SceneItem::display2(300, 47); return true; } @@ -3452,8 +3457,8 @@ void Scene300::postInit(SceneObjectList *OwnerList) { case 3: if (R2_GLOBALS._sceneManager._previousScene == 1500) { - R2_GLOBALS._player._oldCharacterScene[3] = 3150; - R2_GLOBALS._player._characterScene[3] = 3150; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3150; R2_GLOBALS._player._effect = 0; R2_GLOBALS._player.setAction(NULL); R2_GLOBALS._player.disableControl(); @@ -4281,7 +4286,7 @@ void Scene325::consoleAction(int id) { break; case 11: - if (R2_GLOBALS.getFlag(57) && (R2_GLOBALS._player._characterIndex == 1) && !R2_GLOBALS.getFlag(25)) { + if (R2_GLOBALS.getFlag(57) && (R2_GLOBALS._player._characterIndex == R2_QUINN) && !R2_GLOBALS.getFlag(25)) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); _sceneMode = 13; @@ -5172,7 +5177,7 @@ void Scene500::PanelDialog::Button::doButtonPress() { case 2: if (++R2_GLOBALS._landerSuitNumber == 4) - R2_GLOBALS._v566A4 = 1; + R2_GLOBALS._flubMazeArea = 1; if (R2_GLOBALS.getFlag(35)) { scene->_sceneMode = 6; @@ -5225,7 +5230,7 @@ void Scene500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_SEEKER] = 500; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(1); _seeker.postInit(); _seeker._effect = 1; @@ -5239,9 +5244,9 @@ void Scene500::postInit(SceneObjectList *OwnerList) { _seeker.setup(R2_GLOBALS.getFlag(26) ? 1500 : 10, 1, 1); _seeker.setPosition(Common::Point(42, 151)); - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); _seeker.setDetails(500, 37, 38, -1, 1, (SceneItem *)NULL); } @@ -5757,7 +5762,7 @@ void Scene600::postInit(SceneObjectList *OwnerList) { loadScene(600); SceneExt::postInit(); R2_GLOBALS.setFlag(39); - R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(3); _field412 = 0; // Initialize pixel map for the obscuring effect @@ -5907,10 +5912,10 @@ void Scene600::signal() { case 605: // After cloud is active R2_GLOBALS._player.enableControl(); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(9); - R2_GLOBALS._walkRegions.enableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(10); R2_INVENTORY.setObjectScene(R2_AEROSOL, 600); R2_GLOBALS.setFlag(5); @@ -5932,9 +5937,9 @@ void Scene600::signal() { // deactivate cloud R2_GLOBALS.setFlag(8); _smoke.remove(); - R2_GLOBALS._walkRegions.disableRegion(6); - R2_GLOBALS._walkRegions.disableRegion(9); - R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.enableRegion(10); R2_GLOBALS._player.enableControl(); break; case 612: @@ -5951,7 +5956,7 @@ void Scene600::signal() { R2_GLOBALS._player.enableControl(); _aerosol.remove(); R2_INVENTORY.setObjectScene(R2_AEROSOL, 1); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(7); break; case 615: // Pick up Com Scanner diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index df0b4d8fc6..b735f7cc23 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -197,11 +197,11 @@ class Scene180: public SceneExt { private: void setSceneDelay(int v); public: - SpeakerWebbster _webbsterSpeaker; - SpeakerDutyOfficer _dutyOfficerSpeaker; - SpeakerTeal _tealSpeaker; + SpeakerWebbster180 _webbsterSpeaker; + SpeakerDutyOfficer180 _dutyOfficerSpeaker; + SpeakerTeal180 _tealSpeaker; SpeakerGameText _gameTextSpeaker; - SceneActor _object1, _object2, _object3, _object4, _object5; + SceneActor _dutyOfficer, _teal, _webbser, _door, _shipDisplay; ScenePalette _palette; SceneText _textList[20]; AnimationPlayerExt _animationPlayer; @@ -306,7 +306,6 @@ public: virtual void dispatch(); }; - class Scene250: public SceneExt { class Button: public SceneActor { public: @@ -477,7 +476,6 @@ public: virtual void dispatch(); }; - class Scene400: public SceneExt { /* Items */ class Terminal: public NamedHotspot { diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 0941f09677..29bef2ccb2 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -68,7 +68,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { _sceneMode = 100; break; case 2800: - _sceneMode = 2800; + _sceneMode = 70; break; case 3100: if (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 1000) @@ -462,7 +462,7 @@ void Scene1000::dispatch() { _animationPlayer.remove(); if (_sceneMode == 52) - _endHandler = this; + _animationPlayer._endAction = this; } else { _animationPlayer.dispatch(); } @@ -1146,7 +1146,7 @@ void Scene1100::signal() { break; case 26: R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _stripManager.start(302, this); break; case 27: @@ -1155,7 +1155,7 @@ void Scene1100::signal() { break; case 28: R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _stripManager.start(303, this); break; case 29: @@ -1248,7 +1248,7 @@ void Scene1100::signal() { _stripManager.start3(314, this, _stripManager._lookupList); break; case 1116: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._stripManager_lookupList[9] = 1; R2_GLOBALS._stripManager_lookupList[10] = 1; R2_GLOBALS._stripManager_lookupList[11] = 1; @@ -1311,7 +1311,7 @@ void Scene1100::saveCharacter(int characterIndex) { *--------------------------------------------------------------------------*/ Scene1200::Scene1200() { - _field412 = 0; + _nextCrawlDirection = 0; _field414 = 0; _field416 = 0; _field418 = 0; @@ -1322,7 +1322,7 @@ Scene1200::Scene1200() { void Scene1200::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_nextCrawlDirection); s.syncAsSint16LE(_field414); s.syncAsSint16LE(_field416); s.syncAsSint16LE(_field418); @@ -1418,7 +1418,7 @@ bool Scene1200::LaserPanel::Jumper::startAction(CursorType action, Event &event) switch (R2_GLOBALS._v56AA7) { case 1: - setFrame2(1); + setFrame2(2); setPosition(Common::Point(152, 101)); break; case 2: @@ -1482,20 +1482,14 @@ void Scene1200::LaserPanel::remove() { Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene; scene->_field41A = 0; - warning("Unexpected _sceneAreas.remove() call"); -// scene->_sceneAreas.remove(&_jumper1); -// scene->_sceneAreas.remove(&_jumper2); -// scene->_sceneAreas.remove(&_jumper3); + scene->_sceneAreas.remove(&_jumper1); + scene->_sceneAreas.remove(&_jumper2); + scene->_sceneAreas.remove(&_jumper3); _jumper1.remove(); _jumper2.remove(); _jumper3.remove(); - // sub201EA - R2_GLOBALS._sceneItems.remove((SceneItem *)this); - _object1.remove(); - SceneArea::remove(); - R2_GLOBALS._insetUp--; - + ModalWindow::remove(); R2_GLOBALS._player._canWalk = true; } @@ -1506,7 +1500,7 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene < 3200) R2_GLOBALS._sound1.play(257); - _field412 = 1; + _nextCrawlDirection = CRAWL_EAST; _field414 = 0; _field416 = 0; _field418 = 0; @@ -1526,15 +1520,16 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setup(3156, 1, 6); R2_GLOBALS._player.setPosition(Common::Point(160, 70)); R2_GLOBALS._player._numFrames = 10; - R2_GLOBALS._player._oldCharacterScene[3] = 1200; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 1200; _actor1.postInit(); _actor1.hide(); _mazeUI.setDisplayBounds(Rect(110, 20, 210, 120)); + _mazeUI.postInit(); _mazeUI.load(1); - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); R2_GLOBALS._player.enableControl(); _item1.setDetails(Rect(0, 0, 320, 200), 1200, 0, 1, 2, 1, NULL); @@ -1790,7 +1785,7 @@ void Scene1200::process(Event &event) { return; if (event.eventType == EVENT_BUTTON_DOWN) { - Common::Point cellPos(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4); + Common::Point cellPos = R2_GLOBALS._ventCellPos; _mazeUI.pixelToCellXY(cellPos); int cellId = _mazeUI.getCellFromPixelXY(event.mousePos); @@ -1840,7 +1835,7 @@ void Scene1200::process(Event &event) { R2_GLOBALS._sceneManager.changeScene(3150); break; case 33: - if (R2_GLOBALS._v56AA1 >= 4) + if (R2_GLOBALS._scientistConvIndex >= 4) R2_GLOBALS._sceneManager.changeScene(3250); else SceneItem::display(1200, 6, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); @@ -1860,7 +1855,7 @@ void Scene1200::process(Event &event) { case 3: // It was your cell. SceneItem::display(1200, 8, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - break; + break; case 9: R2_GLOBALS._sceneManager.changeScene(3240); break; @@ -1914,20 +1909,20 @@ void Scene1200::process(Event &event) { } switch (event.kbd.keycode) { - case Common::KEYCODE_1: - warning("FIXME: keycode = 0x4800"); + case Common::KEYCODE_KP8: + case Common::KEYCODE_UP: startCrawling(CRAWL_NORTH); break; - case Common::KEYCODE_2: - warning("FIXME: keycode = 0x4B00"); + case Common::KEYCODE_KP4: + case Common::KEYCODE_LEFT: startCrawling(CRAWL_WEST); break; - case Common::KEYCODE_3: - warning("FIXME: keycode = 0x4D00"); + case Common::KEYCODE_KP6: + case Common::KEYCODE_RIGHT: startCrawling(CRAWL_EAST); break; - case Common::KEYCODE_4: - warning("FIXME: keycode = 0x5000"); + case Common::KEYCODE_KP2: + case Common::KEYCODE_DOWN: startCrawling(CRAWL_SOUTH); break; default: @@ -1945,49 +1940,47 @@ void Scene1200::dispatch() { Scene::dispatch(); if (_fixupMaze) { - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); - - warning("_gfxManager.sub294AC(unk);"); - warning("tmpRect.sub14DF3();"); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); + //_mazeUI.draw(); _fixupMaze = false; } if (_field414 != 0) { tmpRect.set(110, 20, 210, 120); _field414--; - switch (_field412 - 1) { - case 0: - R2_GLOBALS._v56AA2 += 2; + + switch (_nextCrawlDirection) { + case CRAWL_EAST: + R2_GLOBALS._ventCellPos.x += 2; break; - case 1: - R2_GLOBALS._v56AA2 -= 2; + case CRAWL_WEST: + R2_GLOBALS._ventCellPos.x -= 2; break; - case 2: - R2_GLOBALS._v56AA4 += 2; + case CRAWL_SOUTH: + R2_GLOBALS._ventCellPos.y += 2; break; - case 3: - R2_GLOBALS._v56AA4 -= 2; + case CRAWL_NORTH: + R2_GLOBALS._ventCellPos.y -= 2; break; default: break; } - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); - debug("_gfxManager.sub294AC(unk);"); - debug("tmpRect.sub14DF3();"); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); + //_mazeUI.draw(); if (_field416 != 0) { - switch(_field412 - 1) { - case 0: + switch(_nextCrawlDirection) { + case CRAWL_EAST: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x - 2, R2_GLOBALS._player._position.y)); break; - case 1: + case CRAWL_WEST: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x + 2, R2_GLOBALS._player._position.y)); break; - case 2: + case CRAWL_SOUTH: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y - 2)); break; - case 3: + case CRAWL_NORTH: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y + 2)); break; default: @@ -2008,7 +2001,7 @@ void Scene1200::saveCharacter(int characterIndex) { } void Scene1200::startCrawling(CrawlDirection dir) { - Common::Point cellPos = Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4); + Common::Point cellPos = R2_GLOBALS._ventCellPos; _mazeUI.pixelToCellXY(cellPos); switch (dir) { @@ -2023,26 +2016,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1200; setAction(&_sequenceManager, this, 1200, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(200, 69)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 15; else _sceneMode = 10; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 76; else _sceneMode = 75; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 101; else _sceneMode = 100; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 111; else @@ -2052,7 +2045,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 1; + _nextCrawlDirection = 1; signal(); } break; @@ -2067,26 +2060,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1201; setAction(&_sequenceManager, this, 1201, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(120, 69)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 56; else _sceneMode = 55; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 25; else _sceneMode = 20; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 91; else _sceneMode = 90; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 121; else @@ -2096,7 +2089,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 2; + _nextCrawlDirection = 2; signal(); } break; @@ -2109,26 +2102,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1203; setAction(&_sequenceManager, this, 1203, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(160, 110)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 51; else _sceneMode = 50; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 81; else _sceneMode = 80; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 35; else _sceneMode = 30; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 116; else @@ -2138,7 +2131,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 3; + _nextCrawlDirection = 3; signal(); } break; @@ -2151,26 +2144,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1202; setAction(&_sequenceManager, this, 1202, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(160, 30)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 61; else _sceneMode = 60; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 71; else _sceneMode = 70; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 96; else _sceneMode = 95; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 45; else @@ -2182,7 +2175,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 4; + _nextCrawlDirection = 4; signal(); } break; @@ -7877,7 +7870,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { _companion.setDetails(1550, -1, -1, -1, 2, (SceneItem *) NULL); assert(_field419 >= 1550); - R2_GLOBALS._walkRegions.enableRegion(k5A750[_field419 - 1550]); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); setAction(&_sequenceManager1, this, 1590, &_companion, NULL); } else if ((_sceneMode != 1577) && (_sceneMode != 1578)) @@ -7955,7 +7948,7 @@ void Scene1550::signal() { case 42: { _sceneMode = 43; int junkRegionIndex = R2_GLOBALS._scene1550JunkLocations[_junk[0]._junkNumber + 3]; - R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[junkRegionIndex]); + R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[junkRegionIndex]); switch (_junk[0]._frame) { case 1: @@ -9011,10 +9004,10 @@ void Scene1550::enterArea() { _junk[di].setPosition(Common::Point(150, 70)); _junk[di].setup(1562, 1, 1); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[2]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[3]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[6]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[7]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[2]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[3]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[6]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[7]); if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { _actor9.postInit(); @@ -9033,7 +9026,7 @@ void Scene1550::enterArea() { } _junk[di].setPosition(Common::Point(k5A72E[tmpIdx], k5A73F[tmpIdx])); if (scene1550JunkRegions[tmpIdx] != 0) - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[tmpIdx]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[tmpIdx]); di++; } } @@ -9092,7 +9085,7 @@ void Scene1550::enterArea() { _actor4.setPosition(Common::Point(172, 48)); _actor4.fixPriority(169); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[15]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[15]); break; case 2: _wreckage.postInit(); @@ -9249,7 +9242,7 @@ void Scene1550::enterArea() { _companion.changeZoom(-1); assert((_field419 >= 1550) && (_field419 <= 2008)); - R2_GLOBALS._walkRegions.enableRegion(k5A750[_field419 - 1550]); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); _companion.setPosition(Common::Point(k5A72E[k5A76D[_field419 - 1550]], k5A73F[k5A76D[_field419 - 1550]] + 8)); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS._player._characterScene[R2_SEEKER] == 1580) { @@ -10403,8 +10396,8 @@ void Scene1700::enterArea() { _ledgeHopper.setup(1701, 1, 1); _ledgeHopper.setPosition(Common::Point(220, 137)); _ledgeHopper.setDetails(1700, 6, -1, -1, 2, (SceneItem *) NULL); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(12); } if ((R2_GLOBALS._rimLocation + 2) % 4 == 0) { @@ -10428,7 +10421,7 @@ void Scene1700::enterArea() { _slabEast.setup(1700, 1, 2); _slabEast.setPosition(Common::Point(424, 84)); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(11); } if ((R2_GLOBALS._rimLocation + 399) % 800 == 0) { @@ -10441,7 +10434,7 @@ void Scene1700::enterArea() { _westExit._enabled = true; } else { - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _westExit._enabled = false; } @@ -10587,11 +10580,11 @@ void Scene1700::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setPosition(Common::Point(109, 160)); _actor12.setPosition(Common::Point(156, 160)); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { R2_GLOBALS._player.setPosition(Common::Point(156, 160)); _actor12.setPosition(Common::Point(109, 160)); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } _sceneMode = 50; setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); @@ -10630,13 +10623,13 @@ void Scene1700::signal() { Common::Point pt2(156, 160); NpcMover *mover2 = new NpcMover(); _actor12.addMover(mover2, &pt2, NULL); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { _actor12.setPosition(Common::Point(109, 170)); Common::Point pt3(109, 160); NpcMover *mover3 = new NpcMover(); _actor12.addMover(mover3, &pt3, NULL); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } } break; @@ -10655,13 +10648,13 @@ void Scene1700::signal() { Common::Point pt2(155, 10); NpcMover *mover2 = new NpcMover(); _actor12.addMover(mover2, &pt2, NULL); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { _actor12.setPosition(Common::Point(188, 0)); Common::Point pt3(188, 10); NpcMover *mover3 = new NpcMover(); _actor12.addMover(mover3, &pt3, NULL); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } } break; @@ -10702,13 +10695,13 @@ void Scene1700::signal() { _actor12.setObjectWrapper(new SceneObjectWrapper()); _actor12._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); - R2_GLOBALS._walkRegions.enableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(14); break; case 8: R2_GLOBALS._player._strip = 2; _actor12._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(12); break; case 30: _sceneMode = 31; @@ -10730,17 +10723,17 @@ void Scene1700::signal() { break; case 50: if (R2_GLOBALS._player._characterIndex == R2_QUINN) - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); else - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); R2_GLOBALS._player.enableControl(); break; case 1704: R2_GLOBALS._sound1.play(134); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(12); R2_GLOBALS._player.fixPriority(-1); R2_GLOBALS._player.enableControl(CURSOR_WALK); break; @@ -11301,7 +11294,7 @@ void Scene1800::Exit1::changeScene() { Scene1800 *scene = (Scene1800 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(14)) { scene->_sceneMode = 3; @@ -11390,7 +11383,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setObjectWrapper(NULL); R2_GLOBALS._player.setup(1801, 5, 12); R2_GLOBALS._player.setPosition(Common::Point(160, 139)); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(9); _doors.hide(); } else { R2_GLOBALS._player.setVisage(1507); @@ -11407,7 +11400,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { _companion.setObjectWrapper(NULL); _companion.setup(1801, 5, 12); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(9); _doors.hide(); } else { _companion.setup(1507, 1, 1); @@ -11427,11 +11420,11 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setStrip(5); if (R2_GLOBALS.getFlag(14)) { _companion.setPosition(Common::Point(160, 139)); - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); } else { _companion.setPosition(Common::Point(209, 150)); _companion.setStrip(6); - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); } } else { if (R2_GLOBALS.getFlag(14)) { @@ -11443,8 +11436,8 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { } _companion.setPosition(Common::Point(114, 150)); _companion.setStrip(5); - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); } } else { if (R2_GLOBALS._player._characterIndex == R2_QUINN) { @@ -11497,7 +11490,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; } else { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } } else if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1850) { if (R2_GLOBALS.getFlag(29)) { @@ -11586,7 +11579,7 @@ void Scene1800::signal() { R2_GLOBALS._player.enableControl(CURSOR_USE); break; case 1800: - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); if (R2_GLOBALS.getFlag(63)) R2_GLOBALS._player.enableControl(CURSOR_USE); else { @@ -11596,14 +11589,14 @@ void Scene1800::signal() { } break; case 1801: - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); R2_GLOBALS.setFlag(63); // The following check is completely dumb. // Either an original bug, or dead code. if (R2_GLOBALS.getFlag(63)) { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { _sceneMode = 10; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -11636,14 +11629,14 @@ void Scene1800::signal() { case 1814: // No break on purpose case 1815: - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); R2_GLOBALS._player.enableControl(); break; case 1816: // No break on purpose case 1817: - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); R2_GLOBALS._player.enableControl(); break; default: @@ -11908,19 +11901,19 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { _rightDoor.setPosition(Common::Point(253, 102)); _rightDoor.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _robot.postInit(); if (R2_GLOBALS.getFlag(34)) { - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _robot.setup(1851, 4, 3); } else if (R2_GLOBALS.getFlag(30)) { _robot.setup(1851, 2, 2); } else { - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); if (R2_GLOBALS.getFlag(33)) { - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _robot.setup(1851, 1, 3); } else { _robot.setup(1851, 2, 1); @@ -12167,7 +12160,7 @@ void Scene1850::signal() { _companion._effect = 6; _companion._shade = 6; - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); if (R2_GLOBALS.getFlag(68)) { R2_GLOBALS._player.enableControl(); @@ -12229,7 +12222,7 @@ void Scene1850::signal() { } else if (R2_GLOBALS.getFlag(33)) { R2_GLOBALS.setFlag(62); R2_GLOBALS.setFlag(34); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _actor2.postInit(); _actor2.setDetails(1850, 6, -1, -1, 5, &_robot); @@ -12330,10 +12323,10 @@ void Scene1850::signal() { _field41E = 0; break; case 1870: - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1); R2_GLOBALS.setFlag(32); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 1875: R2_INVENTORY.setObjectScene(R2_AIRBAG, 1850); @@ -12376,7 +12369,7 @@ void Scene1850::signal() { case 1878: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1850); R2_GLOBALS.setFlag(33); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._player.enableControl(); break; case 1879: @@ -12396,7 +12389,7 @@ void Scene1850::signal() { } void Scene1850::process(Event &event) { - if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) + if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_WALK) && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { _field41A = event.mousePos; R2_GLOBALS._player.disableControl(); @@ -12697,7 +12690,7 @@ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { void Scene1900::WestExit::changeScene() { Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 10; Common::Point pt(-10, 135); @@ -12708,7 +12701,7 @@ void Scene1900::WestExit::changeScene() { void Scene1900::EastExit::changeScene() { Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 11; Common::Point pt(330, 135); @@ -12813,7 +12806,7 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); _actor1.setPosition(Common::Point(30, 110)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _actor1.setup(2008, 3, 1); _actor1.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); } @@ -12822,7 +12815,7 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); _actor1.setPosition(Common::Point(30, 110)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 3, 1); _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); @@ -12897,12 +12890,12 @@ void Scene1900::signal() { R2_GLOBALS._scene1925CurrLevel = -3; // No break on purpose case 1905: - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._sceneManager.changeScene(1925); break; case 1910: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 2535); - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1900; R2_GLOBALS._player._oldCharacterScene[R2_SEEKER] = 1900; R2_GLOBALS._sceneManager.changeScene(2450); @@ -12917,9 +12910,10 @@ void Scene1900::signal() { } /*-------------------------------------------------------------------------- - * Scene 1925 - + * Scene 1925 - Spill Mountains Elevator Shaft * *--------------------------------------------------------------------------*/ + Scene1925::Scene1925() { _field9B8 = 0; for (int i = 0; i < 5; i++) @@ -12934,7 +12928,7 @@ void Scene1925::synchronize(Serializer &s) { s.syncAsSint16LE(_levelResNum[i]); } -bool Scene1925::Hotspot2::startAction(CursorType action, Event &event) { +bool Scene1925::Button::startAction(CursorType action, Event &event) { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -12950,12 +12944,12 @@ bool Scene1925::Hotspot2::startAction(CursorType action, Event &event) { else scene->_sceneMode = 1930; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); return true; } -bool Scene1925::Hotspot3::startAction(CursorType action, Event &event) { +bool Scene1925::Ladder::startAction(CursorType action, Event &event) { if ((!R2_GLOBALS.getFlag(29)) || (action != CURSOR_USE)) return SceneHotspot::startAction(action, event); @@ -13057,7 +13051,7 @@ void Scene1925::Exit3::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 1921; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } @@ -13066,7 +13060,7 @@ void Scene1925::Exit4::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 1920; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } @@ -13092,7 +13086,7 @@ void Scene1925::changeLevel(bool upFlag) { break; case 3: loadScene(_levelResNum[4]); - _item2.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 2, NULL); + _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 2, NULL); _actor1.setDetails(1925, 0, 1, 2, 2, (SceneItem *) NULL); _actor1.show(); break; @@ -13101,7 +13095,7 @@ void Scene1925::changeLevel(bool upFlag) { // No break on purpose default: loadScene(_levelResNum[(R2_GLOBALS._scene1925CurrLevel % 4)]); - R2_GLOBALS._sceneItems.remove(&_item2); + R2_GLOBALS._sceneItems.remove(&_button); R2_GLOBALS._sceneItems.remove(&_actor1); _actor1.hide(); break; @@ -13136,11 +13130,11 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { switch (R2_GLOBALS._scene1925CurrLevel) { case -2: _exit4.setDetails(Rect(203, 44, 247, 111), EXITCURSOR_E, 1925); - _item3.setDetails(Rect(31, 3, 45, 167), 1925, 6, -1, 8, 1, NULL); + _ladder.setDetails(Rect(31, 3, 45, 167), 1925, 6, -1, 8, 1, NULL); break; case 3: _actor1.setDetails(1925, 0, 1, 2, 1, (SceneItem *) NULL); - _item2.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 1, NULL); + _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 1, NULL); // No break on purpose case -3: _exit3.setDetails(Rect(83, 38, 128, 101), EXITCURSOR_W, 1925); @@ -13148,7 +13142,7 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { default: _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1925); _exit2.setDetails(Rect(128, 160, 190, 167), EXITCURSOR_S, 1925); - _item3.setDetails(Rect(141, 11, 167, 159), 1925, 6, -1, -1, 1, NULL); + _ladder.setDetails(Rect(141, 11, 167, 159), 1925, 6, -1, -1, 1, NULL); break; } @@ -13237,24 +13231,25 @@ void Scene1925::signal() { } /*-------------------------------------------------------------------------- - * Scene 1945 - + * Scene 1945 - Spill Mountains Shaft Bottom * *--------------------------------------------------------------------------*/ + Scene1945::Scene1945() { - _fieldEAA = 0; - _fieldEAC = 0; - _fieldEAE = CURSOR_NONE; + _nextSceneMode1 = 0; + _nextSceneMode2 = 0; + _lampUsed = CURSOR_NONE; } void Scene1945::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_fieldEAA); - s.syncAsSint16LE(_fieldEAC); - s.syncAsSint16LE(_fieldEAE); + s.syncAsSint16LE(_nextSceneMode1); + s.syncAsSint16LE(_nextSceneMode2); + s.syncAsSint16LE(_lampUsed); } -bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { +bool Scene1945::Ice::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -13265,10 +13260,10 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { scene->_sceneMode = 1942; else { scene->_sceneMode = 1940; - scene->_fieldEAA = 1942; + scene->_nextSceneMode1 = 1942; } // At this point the original check if _sceneMode != 0. Skipped. - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_gunpowder, NULL); return true; break; case CURSOR_USE: @@ -13283,9 +13278,9 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; if (event.mousePos.x > 130) - scene->_item3.setDetails(1945, 3, -1, -1, 3, (SceneItem *) NULL); + scene->_ice.setDetails(1945, 3, -1, -1, 3, (SceneItem *) NULL); else - scene->_item3.setDetails(1945, 3, -1, 5, 3, (SceneItem *) NULL); + scene->_ice.setDetails(1945, 3, -1, 5, 3, (SceneItem *) NULL); } // No break on purpose default: @@ -13294,7 +13289,7 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { } } -bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { +bool Scene1945::Ladder::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -13305,7 +13300,7 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; + scene->_nextSceneMode1 = 1947; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; @@ -13322,23 +13317,23 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { return true; } -bool Scene1945::Actor3::startAction(CursorType action, Event &event) { - if ((action == R2_ALCOHOL_LAMP_3) && (action == R2_ALCOHOL_LAMP_2)) { +bool Scene1945::Gunpowder::startAction(CursorType action, Event &event) { + if ((action == R2_ALCOHOL_LAMP_3) || (action == R2_ALCOHOL_LAMP_2)) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; - scene->_fieldEAE = action; + scene->_lampUsed = action; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode= 1947; - scene->_fieldEAA = 1943; + scene->_nextSceneMode1 = 1943; } else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50)) { scene->_sceneMode = 1940; - scene->_fieldEAA = 1943; + scene->_nextSceneMode1 = 1943; } else { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; - scene->_fieldEAC = 1943; + scene->_nextSceneMode1 = 1947; + scene->_nextSceneMode2 = 1943; } // At this point the original check if _sceneMode != 0. Skipped. scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); @@ -13357,7 +13352,7 @@ void Scene1945::ExitUp::changeScene() { if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; + scene->_nextSceneMode1 = 1947; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; @@ -13371,7 +13366,7 @@ void Scene1945::ExitUp::changeScene() { } } -void Scene1945::Exit2::changeScene() { +void Scene1945::CorridorExit::changeScene() { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -13380,7 +13375,7 @@ void Scene1945::Exit2::changeScene() { if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50)) { scene->_sceneMode = 1940; - scene->_fieldEAA = 1945; + scene->_nextSceneMode1 = 1945; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1945; @@ -13402,21 +13397,21 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterIndex = R2_SEEKER; _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1945); - _exit2.setDetails(Rect(238, 144, 274, 167), EXITCURSOR_E, 1945); + _corridorExit.setDetails(Rect(238, 144, 274, 167), EXITCURSOR_E, 1945); - _item4.setDetails(Rect(141, 3, 167, 126), 1945, 9, -1, -1, 1, NULL); + _ladder.setDetails(Rect(141, 3, 167, 126), 1945, 9, -1, -1, 1, NULL); if (!R2_GLOBALS.getFlag(43)) { - _exit2._enabled = false; - _actor3.postInit(); - _actor3.setup(1945, 4, 1); - _actor3.setPosition(Common::Point(253, 169)); - _actor3.fixPriority(150); + _corridorExit._enabled = false; + _gunpowder.postInit(); + _gunpowder.setup(1945, 4, 1); + _gunpowder.setPosition(Common::Point(253, 169)); + _gunpowder.fixPriority(150); if (R2_GLOBALS.getFlag(42)) - _actor3.setDetails(1945, 15, -1, -1, 1, (SceneItem *) NULL); + _gunpowder.setDetails(1945, 15, -1, -1, 1, (SceneItem *) NULL); else - _actor3.hide(); + _gunpowder.hide(); _actor1.postInit(); _actor1.setup(1945, 8, 1); @@ -13427,7 +13422,7 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { _actor2.setup(1945, 3, 1); _actor2.hide(); } else { - _exit2._enabled = true; + _corridorExit._enabled = true; } switch (R2_GLOBALS._sceneManager._previousScene) { @@ -13450,10 +13445,10 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._player._canWalk = false; - _fieldEAA = 0; - _fieldEAC = 0; + _nextSceneMode1 = 0; + _nextSceneMode2 = 0; - _item3.setDetails(11, 1945, 3, -1, 5); + _ice.setDetails(11, 1945, 3, -1, 5); _item1.setDetails(Rect(238, 144, 274, 167), 1945, 0, -1, 2, 1, NULL); _item2.setDetails(Rect(27, 3, 292, 167), 1945, 3, -1, -1, 1, NULL); } @@ -13466,8 +13461,8 @@ void Scene1945::remove() { void Scene1945::signal() { switch (_sceneMode) { case 1940: - if (_fieldEAA == 1943) { - _sceneMode = _fieldEAA; + if (_nextSceneMode1 == 1943) { + _sceneMode = _nextSceneMode1; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { _sceneMode = 1946; @@ -13476,27 +13471,27 @@ void Scene1945::signal() { return; break; case 1941: - if (_fieldEAA == 0) { + if (_nextSceneMode1 == 0) { R2_GLOBALS._scene1925CurrLevel = 0; R2_GLOBALS.setFlag(29); R2_GLOBALS._sceneManager.changeScene(1925); } else { - _sceneMode = _fieldEAA; - _fieldEAA = 0; + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); } return; case 1942: R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 0); - _actor3.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); + _gunpowder.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); R2_GLOBALS.setFlag(42); break; case 1943: R2_GLOBALS._sound1.fadeOut2(NULL); - R2_INVENTORY.setObjectScene(_fieldEAE, 0); + R2_INVENTORY.setObjectScene(_lampUsed, 0); _sceneMode = 1948; - setAction(&_sequenceManager1, this, _sceneMode, &_actor3, &_actor2, &_actor1, NULL); - setAction(&_sequenceManager2, NULL, 1941, &R2_GLOBALS._player, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_gunpowder, &_actor2, &_actor1, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager2, NULL, 1941, &R2_GLOBALS._player, NULL); return; case 1944: break; @@ -13504,17 +13499,17 @@ void Scene1945::signal() { R2_GLOBALS._sceneManager.changeScene(1950); return; case 1946: - if (_fieldEAA == 1942) { - _sceneMode = _fieldEAA; - _fieldEAA = 0; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor3, NULL); + if (_nextSceneMode1 == 1942) { + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 0; + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_gunpowder, NULL); return; } break; case 1947: - if (_fieldEAA == 1943) { - _sceneMode = _fieldEAA; - _fieldEAA = 1948; + if (_nextSceneMode1 == 1943) { + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 1948; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { _sceneMode = 1941; @@ -13523,20 +13518,20 @@ void Scene1945::signal() { return; case 1948: R2_GLOBALS._sound1.play(220); - _exit2._enabled = true; - R2_GLOBALS._sceneItems.remove(&_actor3); + _corridorExit._enabled = true; + R2_GLOBALS._sceneItems.remove(&_gunpowder); R2_GLOBALS.clearFlag(42); - R2_GLOBALS.clearFlag(43); - _fieldEAA = 1940; + R2_GLOBALS.setFlag(43); + _nextSceneMode1 = 1940; // No break on purpose case 1949: - _sceneMode = _fieldEAA; - if (_fieldEAC == 1943) { - _fieldEAA = _fieldEAC; - _fieldEAC = 0; + _sceneMode = _nextSceneMode1; + if (_nextSceneMode2 == 1943) { + _nextSceneMode1 = _nextSceneMode2; + _nextSceneMode2 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { - _fieldEAA = 0; + _nextSceneMode1 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); } return; @@ -13549,114 +13544,93 @@ void Scene1945::signal() { } /*-------------------------------------------------------------------------- - * Scene 1950 - + * Scene 1950 - Flup Tube Corridor Maze * *--------------------------------------------------------------------------*/ -Scene1950::Area1::Area1() { + +Scene1950::KeypadWindow::KeypadWindow() { _field20 = 0; - _fieldB65 = 0; + _buttonIndex = 0; } -void Scene1950::Area1::synchronize(Serializer &s) { + +void Scene1950::KeypadWindow::synchronize(Serializer &s) { SceneArea::synchronize(s); s.syncAsByte(_field20); - s.syncAsSint16LE(_fieldB65); -} - -Scene1950::Scene1950() { - _field412 = 0; - _field414 = 0; - _field416 = 0; - _field418 = Common::Point(0, 0); - _field41C = 0; + s.syncAsSint16LE(_buttonIndex); } -void Scene1950::synchronize(Serializer &s) { - SceneExt::synchronize(s); - - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418.x); - s.syncAsSint16LE(_field418.y); - s.syncAsSint16LE(_field41C); -} - -Scene1950::Area1::Actor10::Actor10() { - _fieldA4 = 0; - _fieldA6 = 0; - _fieldA8 = 0; +Scene1950::KeypadWindow::KeypadButton::KeypadButton() { + _buttonIndex = 0; + _pressed = false; + _toggled = false; } -void Scene1950::Area1::Actor10::synchronize(Serializer &s) { +void Scene1950::KeypadWindow::KeypadButton::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); - s.syncAsSint16LE(_fieldA6); - s.syncAsSint16LE(_fieldA8); + s.syncAsSint16LE(_buttonIndex); + s.syncAsSint16LE(_pressed); + s.syncAsSint16LE(_toggled); } -void Scene1950::Area1::Actor10::init(int indx) { -// Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; +void Scene1950::KeypadWindow::KeypadButton::init(int indx) { + Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - _fieldA4 = indx; - _fieldA6 = 0; - _fieldA8 = 0; + _buttonIndex = indx; + _pressed = false; + _toggled = false; postInit(); setup(1971, 2, 1); fixPriority(249); - setPosition(Common::Point(((_fieldA4 / 4) * 22) + 127, ((_fieldA4 / 4) * 19) + 71)); - warning("FIXME: invalid call to scene->_sceneAreas.push_front(this);"); + setPosition(Common::Point(((_buttonIndex % 4) * 22) + 127, ((_buttonIndex / 4) * 19) + 71)); + scene->_sceneAreas.push_front(this); } -void Scene1950::Area1::Actor10::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && (_fieldA6 == 0)) { +void Scene1950::KeypadWindow::KeypadButton::process(Event &event) { + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + && (_bounds.contains(event.mousePos)) && !_pressed) { R2_GLOBALS._sound2.play(227); - if (_fieldA8 == 0) { + if (!_toggled) { setFrame(2); - _fieldA8 = 1; + _toggled = true; } else { setFrame(1); - _fieldA8 = 0; + _toggled = false; } - _fieldA6 = 1; + _pressed = true; event.handled = true; } - if ((event.eventType == EVENT_BUTTON_UP) && (_fieldA6 != 0)) { - _fieldA6 = 0; + if ((event.eventType == EVENT_BUTTON_UP) && _pressed) { + _pressed = false; event.handled = true; Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - scene->subBF4B4(_fieldA4); + scene->doButtonPress(_buttonIndex); } } -bool Scene1950::Area1::Actor10::startAction(CursorType action, Event &event) { +bool Scene1950::KeypadWindow::KeypadButton::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) return false; return SceneActor::startAction(action, event); } -void Scene1950::Area1::remove() { +void Scene1950::KeypadWindow::remove() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - for (_fieldB65 = 0; _fieldB65 < 16; ++_fieldB65) { - warning("Unexpected _sceneAreas.remove() call"); - // R2_GLOBALS._sceneAreas.remove(&_arrActor1[_fieldB65]); - _arrActor1[_fieldB65].remove(); + for (_buttonIndex = 0; _buttonIndex < 16; ++_buttonIndex) { + scene->_sceneAreas.remove(&_buttons[_buttonIndex]); + _buttons[_buttonIndex].remove(); } - // sub201EA - R2_GLOBALS._sceneItems.remove((SceneItem *)this); - _areaActor.remove(); - SceneArea::remove(); - R2_GLOBALS._insetUp--; + ModalWindow::remove(); if (!R2_GLOBALS.getFlag(37)) R2_GLOBALS._sound2.play(278); - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - scene->_exit3._enabled = true; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + scene->_eastExit._enabled = true; if (!R2_GLOBALS.getFlag(37)) { if (R2_GLOBALS.getFlag(36)) { @@ -13669,62 +13643,31 @@ void Scene1950::Area1::remove() { } } -void Scene1950::Area1::process(Event &event) { - // This is a copy of Scene1200::LaserPanel::process - if (_field20 != R2_GLOBALS._insetUp) - return; - - CursorType cursor = R2_GLOBALS._events.getCursor(); - - if (_areaActor._bounds.contains(event.mousePos.x + g_globals->gfxManager()._bounds.left , event.mousePos.y)) { - if (cursor == _cursorNum) { - R2_GLOBALS._events.setCursor(_savedCursorNum); - } - } else if (event.mousePos.y < 168) { - if (cursor != _cursorNum) { - _savedCursorNum = cursor; - R2_GLOBALS._events.setCursor(CURSOR_INVALID); - } - if (event.eventType == EVENT_BUTTON_DOWN) { - event.handled = true; - R2_GLOBALS._events.setCursor(_savedCursorNum); - remove(); - } - } -} - -void Scene1950::Area1::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { +void Scene1950::KeypadWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._player._canWalk = false; - // UnkArea1200::proc12(); - _areaActor.postInit(); - _areaActor.setup(visage, stripFrameNum, frameNum); - _areaActor.setPosition(Common::Point(posX, posY)); - _areaActor.fixPriority(250); - _cursorNum = CURSOR_INVALID; - scene->_sceneAreas.push_front(this); - ++R2_GLOBALS._insetUp; - _field20 = R2_GLOBALS._insetUp; - // + ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY); - _areaActor.fixPriority(248); - scene->_exit3._enabled = false; + _object1.fixPriority(248); + scene->_eastExit._enabled = false; proc13(1950, 27, 28, 27); - for (_fieldB65 = 0; _fieldB65 < 16; _fieldB65++) - _arrActor1[_fieldB65].init(_fieldB65); + for (_buttonIndex = 0; _buttonIndex < 16; _buttonIndex++) + _buttons[_buttonIndex].init(_buttonIndex); } -void Scene1950::Area1::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { +void Scene1950::KeypadWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { // Copy of Scene1200::LaserPanel::proc13() _areaActor.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); } -bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { +/*--------------------------------------------------------------------------*/ + +bool Scene1950::Keypad::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(37))) return SceneHotspot::startAction(action, event); @@ -13741,7 +13684,7 @@ bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { return true; } -bool Scene1950::Actor2::startAction(CursorType action, Event &event) { +bool Scene1950::Door::startAction(CursorType action, Event &event) { if (action != R2_SCRITH_KEY) return SceneActor::startAction(action, event); @@ -13750,11 +13693,11 @@ bool Scene1950::Actor2::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_SCRITH_KEY, 0); scene->_sceneMode = 1958; - scene->setAction(&scene->_sequenceManager, scene, 1958, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 1958, &R2_GLOBALS._player, &scene->_door, NULL); return true; } -bool Scene1950::Actor3::startAction(CursorType action, Event &event) { +bool Scene1950::Scrolls::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) != 1950)) return SceneActor::startAction(action, event); @@ -13767,7 +13710,7 @@ bool Scene1950::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene1950::Actor5::startAction(CursorType action, Event &event) { +bool Scene1950::Gem::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (!R2_GLOBALS.getFlag(37))) return SceneActor::startAction(action, event); @@ -13780,69 +13723,70 @@ bool Scene1950::Actor5::startAction(CursorType action, Event &event) { return true; } -Scene1950::Actor8::Actor8() { - _fieldA4 = 0; - _fieldA6 = 0; +/*--------------------------------------------------------------------------*/ + +Scene1950::Vampire::Vampire() { _fieldA8 = 0; _fieldAA = 0; - _fieldAC = 0; + _vampireMode = 0; _fieldAE = 0; _fieldAF = 0; } -void Scene1950::Actor8::synchronize(Serializer &s) { +void Scene1950::Vampire::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); - s.syncAsSint16LE(_fieldA6); + s.syncAsSint16LE(_deadPosition.x); + s.syncAsSint16LE(_deadPosition.y); s.syncAsSint16LE(_fieldA8); s.syncAsSint16LE(_fieldAA); - s.syncAsSint16LE(_fieldAC); + s.syncAsSint16LE(_vampireMode); s.syncAsByte(_fieldAE); s.syncAsByte(_fieldAF); } -void Scene1950::Actor8::signal() { +void Scene1950::Vampire::signal() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - switch (_fieldAC) { + switch (_vampireMode) { case 19: { - _fieldAC = 0; + _vampireMode = 0; setVisage(1960); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(2); else setStrip(1); NpcMover *mover = new NpcMover(); - R2_GLOBALS._player.addMover(mover, &scene->_field418, this); + addMover(mover, &scene->_field418, scene); } break; case 20: { - _fieldAC = 19; + // Non fatal shot + _vampireMode = 19; R2_GLOBALS._player.setVisage(22); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1]--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired--; - if (R2_GLOBALS._v566A5 == 3) - _fieldA4 = _position.x + 10; + if (R2_GLOBALS._flubMazeEntryDirection == 3) + _deadPosition.x = _position.x + 10; else - _fieldA4 = _position.x - 10; + _deadPosition.x = _position.x - 10; + _deadPosition.y = _position.y - 4; - _fieldA6 = _position.y -4; setVisage(1961); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(2); else setStrip(1); animate(ANIM_MODE_2, NULL); - Common::Point pt(_fieldA4, _fieldA6); + Common::Point pt = _deadPosition; PlayerMover *mover = new PlayerMover(); addMover(mover, &pt, this); @@ -13850,15 +13794,16 @@ void Scene1950::Actor8::signal() { } break; case 21: + // Fatal shot R2_GLOBALS._player.setVisage(22); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); setVisage(1961); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(4); else setStrip(3); @@ -13868,47 +13813,47 @@ void Scene1950::Actor8::signal() { R2_GLOBALS._sound2.play(226); animate(ANIM_MODE_5, NULL); fixPriority(10); - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) ]--; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1]--; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 2] = _position.x; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 3] = _position.y; + + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive = false; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._position = _position; _fieldA8 = (_position.x - R2_GLOBALS._player._position.x) / 2; _fieldAA = (_position.y - R2_GLOBALS._player._position.y) / 2; _fieldAE = 0; for (_fieldAF = 0; _fieldAF < 18; ++_fieldAF) - if (R2_GLOBALS._v56613[4 * _fieldAF] == 0) + if (!R2_GLOBALS._vampireData[_fieldAF]._isAlive) ++_fieldAE; if (_fieldAE == 18) { R2_GLOBALS.setFlag(36); - _fieldAC = 23; + _vampireMode = 23; Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else if (_fieldAE == 1) { - _fieldAC = 22; + _vampireMode = 22; Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } - if (R2_GLOBALS._v566A5 == 3) - scene->_exit3._enabled = true; + if (R2_GLOBALS._flubMazeEntryDirection == 3) + scene->_eastExit._enabled = true; else - scene->_exit6._enabled = true; + scene->_westExit._enabled = true; scene->_field416 = 0; break; case 22: SceneItem::display(1950, 18, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 23: SceneItem::display(1950, 25, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - scene->_sceneMode = R2_GLOBALS._v566A5; + scene->_sceneMode = R2_GLOBALS._flubMazeEntryDirection; scene->setAction(&scene->_sequenceManager, scene, 1960, &R2_GLOBALS._player, NULL); break; default: @@ -13916,21 +13861,22 @@ void Scene1950::Actor8::signal() { } } -bool Scene1950::Actor8::startAction(CursorType action, Event &event) { +bool Scene1950::Vampire::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_PHOTON_STUNNER)) + if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || + (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1] <= 1) - _fieldAC = 21; + if (R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired <= 1) + _vampireMode = 21; else - _fieldAC = 20; + _vampireMode = 20; R2_GLOBALS._player.setVisage(25); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(2); else R2_GLOBALS._player.setStrip(1); @@ -13940,12 +13886,14 @@ bool Scene1950::Actor8::startAction(CursorType action, Event &event) { return true; } -void Scene1950::Exit1::changeScene() { +/*--------------------------------------------------------------------------*/ + +void Scene1950::NorthExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 1; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 1; scene->_sceneMode = 11; Common::Point pt(160, 127); @@ -13953,12 +13901,12 @@ void Scene1950::Exit1::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit2::changeScene() { +void Scene1950::UpExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 2; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 2; scene->_sceneMode = 12; if (scene->_field412 == 0) { @@ -13974,12 +13922,12 @@ void Scene1950::Exit2::changeScene() { } } -void Scene1950::Exit3::changeScene() { +void Scene1950::EastExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 3; scene->_sceneMode = 13; if (scene->_field416 != 0) @@ -13990,12 +13938,12 @@ void Scene1950::Exit3::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit4::changeScene() { +void Scene1950::DownExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 4; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 4; scene->_sceneMode = 14; if (R2_GLOBALS.getFlag(36)) @@ -14004,12 +13952,12 @@ void Scene1950::Exit4::changeScene() { scene->setAction(&scene->_sequenceManager, scene, 1973, &R2_GLOBALS._player, NULL); } -void Scene1950::Exit5::changeScene() { +void Scene1950::SouthExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 5; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 5; scene->_sceneMode = 15; Common::Point pt(160, 213); @@ -14017,13 +13965,15 @@ void Scene1950::Exit5::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit6::changeScene() { +void Scene1950::WestExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 5; - if (R2_GLOBALS._v566A4 == 2) { + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 6; + + if (R2_GLOBALS._flubMazeArea == 2) { + // In the very first corridor area after the Scrith Door if ((R2_GLOBALS.getFlag(36)) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 2) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2)) { scene->_sceneMode = 1961; Common::Point pt(-20, 160); @@ -14050,28 +14000,28 @@ void Scene1950::Exit6::changeScene() { } } -void Scene1950::Exit7::changeScene() { +void Scene1950::ShaftExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 0; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 0; scene->_sceneMode = 1951; scene->setAction(&scene->_sequenceManager, scene, 1951, &R2_GLOBALS._player, NULL); } -void Scene1950::Exit8::changeScene() { +void Scene1950::DoorExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._player.disableControl(CURSOR_WALK); + R2_GLOBALS._flubMazeEntryDirection = 3; if (R2_GLOBALS._player._visage == 22) { scene->_sceneMode = 1975; scene->setAction(&scene->_sequenceManager, scene, 1975, &R2_GLOBALS._player, NULL); } else { SceneItem::display(1950, 22, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._v566A5 = 0; + R2_GLOBALS._flubMazeEntryDirection = 0; scene->_sceneMode = 0; Common::Point pt(250, 150); NpcMover *mover = new NpcMover(); @@ -14080,33 +14030,55 @@ void Scene1950::Exit8::changeScene() { } } -void Scene1950::subBDC1E() { - _exit1._enabled = false; - _exit2._enabled = false; - _exit3._enabled = false; - _exit4._enabled = false; - _exit5._enabled = false; - _exit6._enabled = false; - _exit7._enabled = false; - _exit8._enabled = false; - _exit1._insideArea = false; - _exit2._insideArea = false; - _exit3._insideArea = false; - _exit4._insideArea = false; - _exit5._insideArea = false; - _exit6._insideArea = false; - _exit7._insideArea = false; - _exit8._insideArea = false; - _exit1._moving = false; - _exit2._moving = false; - _exit3._moving = false; - _exit4._moving = false; - _exit5._moving = false; - _exit6._moving = false; - _exit7._moving = false; - _exit8._moving = false; +/*--------------------------------------------------------------------------*/ + +Scene1950::Scene1950() { + _field412 = 0; + _field414 = 0; + _field416 = 0; + _field418 = Common::Point(0, 0); + _vampireIndex = 0; +} + +void Scene1950::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_field414); + s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_field418.x); + s.syncAsSint16LE(_field418.y); + s.syncAsSint16LE(_vampireIndex); +} + +void Scene1950::initArea() { + _northExit._enabled = false; + _upExit._enabled = false; + _eastExit._enabled = false; + _downExit._enabled = false; + _southExit._enabled = false; + _westExit._enabled = false; + _shaftExit._enabled = false; + _doorExit._enabled = false; + _northExit._insideArea = false; + _upExit._insideArea = false; + _eastExit._insideArea = false; + _downExit._insideArea = false; + _southExit._insideArea = false; + _westExit._insideArea = false; + _shaftExit._insideArea = false; + _doorExit._insideArea = false; + _northExit._moving = false; + _upExit._moving = false; + _eastExit._moving = false; + _downExit._moving = false; + _southExit._moving = false; + _westExit._moving = false; + _shaftExit._moving = false; + _doorExit._moving = false; _field412 = 0; - switch (R2_GLOBALS._v566A4 - 1) { + + switch (R2_GLOBALS._flubMazeArea - 1) { case 0: loadScene(1948); break; @@ -14337,19 +14309,19 @@ void Scene1950::subBDC1E() { break; } - if (R2_GLOBALS._v566A4 != 1) + if (R2_GLOBALS._flubMazeArea != 1) R2_GLOBALS._walkRegions.load(1950); - switch (R2_GLOBALS._v566A4 - 1) { + switch (R2_GLOBALS._flubMazeArea - 1) { case 0: - _exit7._enabled = true; + _shaftExit._enabled = true; if ((R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950)) - _exit8._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + _doorExit._enabled = true; + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); break; case 1: // No break on purpose @@ -14414,8 +14386,8 @@ void Scene1950::subBDC1E() { case 102: // No break on purpose case 103: - _exit3._enabled = true; - _exit6._enabled = true; + _eastExit._enabled = true; + _westExit._enabled = true; break; case 4: // No break on purpose @@ -14466,9 +14438,9 @@ void Scene1950::subBDC1E() { case 100: // No break on purpose case 104: - _exit6._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(9); + _westExit._enabled = true; + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(9); break; case 5: // No break on purpose @@ -14517,25 +14489,25 @@ void Scene1950::subBDC1E() { case 99: // No break on purpose case 101: - _exit3._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(13); + _eastExit._enabled = true; + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(13); break; default: - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(9); - R2_GLOBALS._walkRegions.enableRegion(13); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(13); break; } - _object1.remove(); - _object1.removeObject(); - _actor1.remove(); + _northDoorway.remove(); + _northDoorway.removeObject(); + _southDoorway.remove(); - switch (R2_GLOBALS._v566A4 - 4) { + switch (R2_GLOBALS._flubMazeArea - 4) { case 0: // No break on purpose case 3: @@ -14573,17 +14545,17 @@ void Scene1950::subBDC1E() { case 82: // No break on purpose case 90: - _exit1._enabled = true; - _object1.setup2(1950, (R2_GLOBALS._v566A4 % 2) + 1, 1, 160, 237, 25, 0); - - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(2); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + _northExit._enabled = true; + _northDoorway.setup(1950, (R2_GLOBALS._flubMazeArea % 2) + 1, 1, 160, 137, 25); + //visage,strip,frame,px,py,priority,effect + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(2); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); break; case 7: // No break on purpose @@ -14622,44 +14594,45 @@ void Scene1950::subBDC1E() { case 89: // No break on purpose case 97: - _exit5._enabled = true; - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(3); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _southExit._enabled = true; + + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(3); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); break; case 58: // No break on purpose case 74: // No break on purpose case 80: - _exit1._enabled = true; - _exit5._enabled = true; + _northExit._enabled = true; + _southExit._enabled = true; - _object1.setup(1950, (R2_GLOBALS._v566A4 % 2) + 1, 1, 160, 137, 25); + _northDoorway.setup(1950, (R2_GLOBALS._flubMazeArea % 2) + 1, 1, 160, 137, 25); - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(3); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(3); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); break; default: - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip(((R2_GLOBALS._v566A4 - 1) % 35) + 1); - _actor1.setFrame(2); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip(((R2_GLOBALS._flubMazeArea - 1) / 35) % 2 + 1); + _southDoorway.setFrame(2); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); break; } - switch (R2_GLOBALS._v566A4 - 3) { + switch (R2_GLOBALS._flubMazeArea - 3) { case 0: // No break on purpose case 3: @@ -14703,7 +14676,8 @@ void Scene1950::subBDC1E() { case 60: // No break on purpose case 63: - _exit2._enabled = true; + _upExit._enabled = true; + break; case 54: // No break on purpose case 61: @@ -14711,7 +14685,7 @@ void Scene1950::subBDC1E() { case 62: // No break on purpose case 65: - _exit2._enabled = true; + _upExit._enabled = true; // No break on purpose case 35: // No break on purpose @@ -14756,136 +14730,141 @@ void Scene1950::subBDC1E() { case 98: // No break on purpose case 100: - _exit4._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + _downExit._enabled = true; + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); default: break; } R2_GLOBALS._uiElements.draw(); } -void Scene1950::subBE59B() { +void Scene1950::enterArea() { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - _actor8.remove(); - _actor2.remove(); - _actor3.remove(); + _vampire.remove(); + _door.remove(); + _scrolls.remove(); _field416 = 0; - _field41C = 0; + _vampireIndex = 0; - switch (R2_GLOBALS._v566A4) { + // Certain areas have a vampire in them + switch (R2_GLOBALS._flubMazeArea) { case 10: - _field41C = 1; + _vampireIndex = 1; break; case 13: - _field41C = 2; + _vampireIndex = 2; break; case 16: - _field41C = 3; + _vampireIndex = 3; break; case 17: - _field41C = 4; + _vampireIndex = 4; break; case 24: - _field41C = 5; + _vampireIndex = 5; break; case 25: - _field41C = 6; + _vampireIndex = 6; break; case 31: - _field41C = 7; + _vampireIndex = 7; break; case 40: - _field41C = 8; + _vampireIndex = 8; break; case 45: - _field41C = 9; + _vampireIndex = 9; break; case 46: - _field41C = 10; + _vampireIndex = 10; break; case 73: - _field41C = 11; + _vampireIndex = 11; break; case 75: - _field41C = 12; + _vampireIndex = 12; break; case 80: - _field41C = 13; + _vampireIndex = 13; break; case 87: - _field41C = 14; + _vampireIndex = 14; break; case 88: - _field41C = 15; + _vampireIndex = 15; break; case 96: - _field41C = 16; + _vampireIndex = 16; break; case 97: - _field41C = 17; + _vampireIndex = 17; break; case 104: - _field41C = 18; + _vampireIndex = 18; break; default: break; } - if (_field41C != 0) { - _actor8.postInit(); - _actor8._numFrames = 6; - _actor8._moveRate = 6; - _actor8._moveDiff = Common::Point(3, 2); - _actor8._effect = 1; - if (R2_GLOBALS._v56613[(_field41C - 1) * 4] == 0) { - _actor8.setPosition(Common::Point(R2_GLOBALS._v56613[((_field41C - 1) * 4) + 2], R2_GLOBALS._v56613[((_field41C - 1) * 4) + 3])); - _actor8.animate(ANIM_MODE_NONE, NULL); - _actor8.addMover(NULL); - _actor8.setVisage(1961); - _actor8.setStrip(4); - _actor8.setFrame(10); - _actor8.fixPriority(10); - _actor8.setDetails(1950, 15, -1, 17, 2, (SceneItem *) NULL); + if (_vampireIndex != 0) { + _vampire.postInit(); + _vampire._numFrames = 6; + _vampire._moveRate = 6; + _vampire._moveDiff = Common::Point(3, 2); + _vampire._effect = 1; + + if (!R2_GLOBALS._vampireData[_vampireIndex - 1]._isAlive) { + // Show vampire ashes + _vampire.setPosition(Common::Point(R2_GLOBALS._vampireData[_vampireIndex - 1]._position)); + _vampire.animate(ANIM_MODE_NONE, NULL); + _vampire.addMover(NULL); + _vampire.setVisage(1961); + _vampire.setStrip(4); + _vampire.setFrame(10); + _vampire.fixPriority(10); + _vampire.setDetails(1950, 15, -1, 17, 2, (SceneItem *) NULL); } else { - _actor8.setVisage(1960); - _actor8.setPosition(Common::Point(160, 130)); - _actor8.animate(ANIM_MODE_2, NULL); - _actor8.setDetails(1950, 12, -1, 14, 2, (SceneItem *) NULL); + // Start the vampire + _vampire.setVisage(1960); + _vampire.setPosition(Common::Point(160, 130)); + _vampire.animate(ANIM_MODE_2, NULL); + _vampire.setDetails(1950, 12, -1, 14, 2, (SceneItem *) NULL); _field416 = 1; } } - if ((R2_GLOBALS._v566A4 == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { - _actor2.postInit(); - _actor2.setVisage(1948); - _actor2.setStrip(3); - _actor2.setPosition(Common::Point(278, 155)); - _actor2.fixPriority(100); - _actor2.setDetails(1950, 19, 20, 23, 2, (SceneItem *) NULL); + if ((R2_GLOBALS._flubMazeArea == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { + // Show doorway at the right hand side of the very first flub corridor + _door.postInit(); + _door.setVisage(1948); + _door.setStrip(3); + _door.setPosition(Common::Point(278, 155)); + _door.fixPriority(100); + _door.setDetails(1950, 19, 20, 23, 2, (SceneItem *) NULL); } - if (R2_GLOBALS._v566A4 == 102) { + if (R2_GLOBALS._flubMazeArea == 102) { R2_GLOBALS._walkRegions.load(1951); - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - - _actor6.postInit(); - _actor6.setVisage(1970); - _actor6.setStrip(1); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + + _cube.postInit(); + _cube.setVisage(1970); + _cube.setStrip(1); if (R2_GLOBALS.getFlag(37)) - _actor6.setFrame(3); + _cube.setFrame(3); else - _actor6.setFrame(1); - _actor6.setPosition(Common::Point(193, 158)); - _actor6.setDetails(1950, 3, 4, 5, 2, (SceneItem *) NULL); + _cube.setFrame(1); + _cube.setPosition(Common::Point(193, 158)); + _cube.setDetails(1950, 3, 4, 5, 2, (SceneItem *) NULL); _actor7.postInit(); _actor7.setVisage(1970); @@ -14895,67 +14874,68 @@ void Scene1950::subBE59B() { _actor7.setPosition(Common::Point(194, 158)); _actor7.fixPriority(159); - _item2.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); + _keypad.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); if (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950) { - _actor5.postInit(); - _actor5.setVisage(1970); - _actor5.setStrip(1); - _actor5.setFrame(2); - _actor5.fixPriority(160); + _gem.postInit(); + _gem.setVisage(1970); + _gem.setStrip(1); + _gem.setFrame(2); + _gem.fixPriority(160); } if (R2_GLOBALS.getFlag(37)) { - _actor5.setPosition(Common::Point(192, 118)); - _actor5.setDetails(1950, 9, 4, -1, 2, (SceneItem *) NULL); + _gem.setPosition(Common::Point(192, 118)); + _gem.setDetails(1950, 9, 4, -1, 2, (SceneItem *) NULL); } else { - _actor4.postInit(); - _actor4.setVisage(1970); - _actor4.setStrip(4); - _actor4._numFrames = 4; - _actor4.animate(ANIM_MODE_8, NULL); - _actor4.setPosition(Common::Point(192, 121)); - _actor4.fixPriority(159); - _actor4.setDetails(1950, 6, 7, 8, 2, (SceneItem *) NULL); - - _actor5.setPosition(Common::Point(192, 109)); - _actor5.setDetails(1950, 9, 7, 8, 2, (SceneItem *) NULL); - } - - _actor3.postInit(); - _actor3.setVisage(1972); - _actor3.setStrip(1); - _actor3.setPosition(Common::Point(76, 94)); - _actor3.fixPriority(25); - _actor3.setDetails(1950, 30, -1, -1, 2, (SceneItem *) NULL); + _containmentField.postInit(); + _containmentField.setVisage(1970); + _containmentField.setStrip(4); + _containmentField._numFrames = 4; + _containmentField.animate(ANIM_MODE_8, 0, NULL); + _containmentField.setPosition(Common::Point(192, 121)); + _containmentField.fixPriority(159); + _containmentField.setDetails(1950, 6, 7, 8, 2, (SceneItem *) NULL); + + _gem.setPosition(Common::Point(192, 109)); + _gem.setDetails(1950, 9, 7, 8, 2, (SceneItem *) NULL); + } + + _scrolls.postInit(); + _scrolls.setVisage(1972); + _scrolls.setStrip(1); + _scrolls.setPosition(Common::Point(76, 94)); + _scrolls.fixPriority(25); + _scrolls.setDetails(1950, 30, -1, -1, 2, (SceneItem *) NULL); if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) - _actor3.setFrame(2); + _scrolls.setFrame(2); else - _actor3.setFrame(1); + _scrolls.setFrame(1); _field414 = 1; } else if (_field414 != 0) { - _actor6.remove(); - _actor4.remove(); - _actor5.remove(); + _cube.remove(); + _containmentField.remove(); + _gem.remove(); _actor7.remove(); - _actor3.remove(); + _scrolls.remove(); - _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); + R2_GLOBALS._sceneItems.remove(&_background); + _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); } - switch (R2_GLOBALS._v566A5) { + switch (R2_GLOBALS._flubMazeEntryDirection) { case 0: _sceneMode = 1950; if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) { R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { setAction(&_sequenceManager, this, 1950, &R2_GLOBALS._player, NULL); } break; case 1: { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(160, 213)); Common::Point pt(160, 160); NpcMover *mover = new NpcMover(); @@ -14963,30 +14943,31 @@ void Scene1950::subBE59B() { } break; case 2: - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; if (R2_GLOBALS.getFlag(36)) setAction(&_sequenceManager, this, 1957, &R2_GLOBALS._player, NULL); else setAction(&_sequenceManager, this, 1974, &R2_GLOBALS._player, NULL); break; case 3: + // Entering from the left if (_field416 == 0) { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt(30, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else { _sceneMode = 18; - _exit3._enabled = false; + _eastExit._enabled = false; _field418 = Common::Point(60, 152); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _actor8.setStrip(2); + _vampire.setStrip(2); NpcMover *mover = new NpcMover(); - _actor8.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_field418, this); R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt2(30, 160); @@ -14995,7 +14976,7 @@ void Scene1950::subBE59B() { } break; case 4: - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; if (_field412 == 0) { if (R2_GLOBALS.getFlag(36)) setAction(&_sequenceManager, this, 1955, &R2_GLOBALS._player, NULL); @@ -15009,7 +14990,7 @@ void Scene1950::subBE59B() { } break; case 5: { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(160, 127)); Common::Point pt(160, 160); NpcMover *mover = new NpcMover(); @@ -15017,9 +14998,10 @@ void Scene1950::subBE59B() { } break; case 6: + // Entering from the right if (_field416 == 0) { - _sceneMode = R2_GLOBALS._v566A5; - if (R2_GLOBALS._v566A4 == 1) { + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; + if (R2_GLOBALS._flubMazeArea == 1) { setAction(&_sequenceManager, this, 1961, &R2_GLOBALS._player, NULL); } else { R2_GLOBALS._player.setPosition(Common::Point(340, 160)); @@ -15029,16 +15011,16 @@ void Scene1950::subBE59B() { } } else { _sceneMode = 17; - _exit6._enabled = false; + _westExit._enabled = false; _field418 = Common::Point(259, 152); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _actor8.setStrip(1); + _vampire.setStrip(1); NpcMover *mover = new NpcMover(); - _actor8.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_field418, this); R2_GLOBALS._player.setPosition(Common::Point(340, 160)); Common::Point pt2(289, 160); @@ -15051,65 +15033,74 @@ void Scene1950::subBE59B() { } } -void Scene1950::subBF4B4(int indx) { +void Scene1950::doButtonPress(int indx) { + Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); - int si = indx - 1; - if ((indx / 4) == (si / 4)) { - if (si < 0) - si = 3; - } else - si = 4; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + int prevIndex = indx - 1; + if ((indx / 4) == (prevIndex / 4)) { + if (prevIndex < 0) + prevIndex = 3; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + prevIndex += 4; } - si = indx + 1; - if ((indx / 4) == (si / 4)) { - if (si > 15) - si = 12; - } else - si -= 4; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; + } else { + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; + } + + prevIndex = indx + 1; + if ((indx / 4) == (prevIndex / 4)) { + if (prevIndex > 15) + prevIndex = 12; + } else { + prevIndex -= 4; + } - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; } - si = indx - 4; - if (si < 0) - si += 16; + prevIndex = indx - 4; + if (prevIndex < 0) + prevIndex += 16; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; } - si = indx + 4; - if (si > 15) - si -= 16; + prevIndex = indx + 4; + if (prevIndex > 15) + prevIndex -= 16; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; } + // Check whether all the buttons are highlighted int cpt = 0; - for (si = 0; si < 16; si++) { - if (_area1._arrActor1[si]._fieldA8 != 0) + for (prevIndex = 0; prevIndex < 16; prevIndex++) { + if (_KeypadWindow._buttons[prevIndex]._toggled) ++cpt; } @@ -15119,9 +15110,7 @@ void Scene1950::subBF4B4(int indx) { } else { R2_GLOBALS.setFlag(37); _sceneMode = 24; - // TODO: check if correct. The original doesn't countain a sceneActor in - // this call, but it's extremely unusual - setAction(&_sequenceManager, this, 1976, NULL); + setAction(&_sequenceManager, scene, 1976, NULL); } } @@ -15129,37 +15118,37 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { _field412 = 0; _field414 = 0; _field416 = 0; - _field41C = 0; + _vampireIndex = 0; if (R2_GLOBALS._sceneManager._previousScene == 300) - R2_GLOBALS._v566A4 = 103; + R2_GLOBALS._flubMazeArea = 103; - subBDC1E(); + initArea(); SceneExt::postInit(); R2_GLOBALS._sound1.play(105); - _exit1.setDetails(Rect(130, 46, 189, 135), SHADECURSOR_UP, 1950); - _exit1.setDest(Common::Point(160, 145)); + _northExit.setDetails(Rect(130, 46, 189, 135), SHADECURSOR_UP, 1950); + _northExit.setDest(Common::Point(160, 145)); - _exit2.setDetails(Rect(208, 0, 255, 73), EXITCURSOR_N, 1950); - _exit2.setDest(Common::Point(200, 151)); + _upExit.setDetails(Rect(208, 0, 255, 73), EXITCURSOR_N, 1950); + _upExit.setDest(Common::Point(200, 151)); - _exit3.setDetails(Rect(305, 95, 320, 147), EXITCURSOR_E, 1950); - _exit3.setDest(Common::Point(312, 160)); + _eastExit.setDetails(Rect(305, 95, 320, 147), EXITCURSOR_E, 1950); + _eastExit.setDest(Common::Point(312, 160)); - _exit4.setDetails(Rect(208, 99, 255, 143), EXITCURSOR_S, 1950); - _exit4.setDest(Common::Point(200, 151)); + _downExit.setDetails(Rect(208, 99, 255, 143), EXITCURSOR_S, 1950); + _downExit.setDest(Common::Point(200, 151)); - _exit5.setDetails(Rect(113, 154, 206, 168), SHADECURSOR_DOWN, 1950); - _exit5.setDest(Common::Point(160, 165)); + _southExit.setDetails(Rect(113, 154, 206, 168), SHADECURSOR_DOWN, 1950); + _southExit.setDest(Common::Point(160, 165)); - _exit6.setDetails(Rect(0, 95, 14, 147), EXITCURSOR_W, 1950); - _exit6.setDest(Common::Point(7, 160)); + _westExit.setDetails(Rect(0, 95, 14, 147), EXITCURSOR_W, 1950); + _westExit.setDest(Common::Point(7, 160)); - _exit7.setDetails(Rect(72, 54, 120, 128), EXITCURSOR_NW, 1950); - _exit7.setDest(Common::Point(120, 140)); + _shaftExit.setDetails(Rect(72, 54, 120, 128), EXITCURSOR_NW, 1950); + _shaftExit.setDest(Common::Point(120, 140)); - _exit8.setDetails(Rect(258, 60, 300, 145), EXITCURSOR_NE, 1950); - _exit8.setDest(Common::Point(268, 149)); + _doorExit.setDetails(Rect(258, 60, 300, 145), EXITCURSOR_NE, 1950); + _doorExit.setDest(Common::Point(268, 149)); R2_GLOBALS._player.postInit(); if ( (R2_INVENTORY.getObjectScene(R2_TANNER_MASK) == 0) && (R2_INVENTORY.getObjectScene(R2_PURE_GRAIN_ALCOHOL) == 0) @@ -15169,9 +15158,9 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setVisage(20); R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 1, NULL); - subBE59B(); + enterArea(); } void Scene1950::remove() { @@ -15183,45 +15172,50 @@ void Scene1950::remove() { void Scene1950::signal() { switch (_sceneMode) { case 11: - R2_GLOBALS._v566A4 += 7; - subBDC1E(); - subBE59B(); + R2_GLOBALS._flubMazeArea += 7; + initArea(); + enterArea(); break; case 12: - R2_GLOBALS._v566A4 += 35; - subBDC1E(); - subBE59B(); + // Moving up a ladder within the Flub maze + R2_GLOBALS._flubMazeArea += 35; + initArea(); + enterArea(); break; case 1975: - SceneItem::display(1950, 21, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, + SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); // No break on purpose case 13: - ++R2_GLOBALS._v566A4; - subBDC1E(); - subBE59B(); + // Moving east within the Flub maze + ++R2_GLOBALS._flubMazeArea; + initArea(); + enterArea(); break; case 14: - R2_GLOBALS._v566A4 += 221; - subBDC1E(); - subBE59B(); + // Moving down a ladder within the Flub maze + R2_GLOBALS._flubMazeArea -= 35; + initArea(); + enterArea(); break; case 15: - R2_GLOBALS._v566A4 += 249; - subBDC1E(); - subBE59B(); + R2_GLOBALS._flubMazeArea -= 7; + initArea(); + enterArea(); break; case 16: + // Moving west within the Flub maze // No break on purpose case 1961: - --R2_GLOBALS._v566A4; - subBDC1E(); - subBE59B(); + --R2_GLOBALS._flubMazeArea; + initArea(); + enterArea(); break; case 17: { _sceneMode = 13; - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._flubMazeEntryDirection = 3; _field416 = 0; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); @@ -15230,14 +15224,14 @@ void Scene1950::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); Common::Point pt2(289, 160); NpcMover *mover2 = new NpcMover(); - _actor8.addMover(mover2, &pt2, NULL); + _vampire.addMover(mover2, &pt2, NULL); } break; case 18: { _sceneMode = 16; - R2_GLOBALS._v566A5 = 6; + R2_GLOBALS._flubMazeEntryDirection = 6; _field416 = 0; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); @@ -15246,14 +15240,14 @@ void Scene1950::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); Common::Point pt2(30, 160); NpcMover *mover2 = new NpcMover(); - _actor8.addMover(mover2, &pt2, NULL); + _vampire.addMover(mover2, &pt2, NULL); } break; case 24: - _area1.remove(); + _KeypadWindow.remove(); _sceneMode = 1966; - _actor6.setFrame(3); - setAction(&_sequenceManager, this, 1966, &_actor4, &_actor5, NULL); + _cube.setFrame(3); + setAction(&_sequenceManager, this, 1966, &_containmentField, &_gem, NULL); break; case 1951: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -15262,31 +15256,31 @@ void Scene1950::signal() { case 1958: SceneItem::display(1950, 24, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); - _exit8._enabled = true; + R2_GLOBALS._player.enableControl(CURSOR_WALK); + _doorExit._enabled = true; break; case 1959: R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 0); R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); - _exit8._enabled = true; + R2_GLOBALS._player.enableControl(CURSOR_WALK); + _doorExit._enabled = true; break; case 1962: // No break on purpose case 1963: R2_GLOBALS._player.enableControl(); - _area1.proc12(1971, 1, 1, 160, 135); + _KeypadWindow.proc12(1971, 1, 1, 160, 135); break; case 1964: // No break on purpose case 1965: if (!R2_GLOBALS.getFlag(37)) { SceneItem::display(1950, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._player.enableControl(); } + R2_GLOBALS._player.enableControl(); break; case 1966: - _actor4.remove(); + _containmentField.remove(); if (R2_GLOBALS.getFlag(36)) { _sceneMode = 1964; setAction(&_sequenceManager, this, 1964, &R2_GLOBALS._player, NULL); @@ -15294,11 +15288,12 @@ void Scene1950::signal() { _sceneMode = 1965; setAction(&_sequenceManager, this, 1965, &R2_GLOBALS._player, NULL); } - _actor5.setDetails(1950, 9, -1, -1, 2, (SceneItem *) NULL); + _gem.setDetails(1950, 9, -1, -1, 2, (SceneItem *) NULL); + break; case 1967: { _sceneMode = 0; R2_INVENTORY.setObjectScene(R2_SAPPHIRE_BLUE, 2); - _actor5.remove(); + _gem.remove(); if (R2_GLOBALS.getFlag(36)) R2_GLOBALS._player.setVisage(20); else @@ -15311,9 +15306,9 @@ void Scene1950::signal() { } break; case 1968: - R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.enableControl(); R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2); - _actor3.setFrame(2); + _scrolls.setFrame(2); if (R2_GLOBALS.getFlag(36)) R2_GLOBALS._player.setVisage(20); else @@ -15322,24 +15317,25 @@ void Scene1950::signal() { break; default: R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } void Scene1950::process(Event &event) { if ( (event.eventType == EVENT_BUTTON_DOWN) - && (R2_GLOBALS._player._uiEnabled) - && (R2_GLOBALS._events.getCursor() == R2_LIGHT_BULB) - && (R2_GLOBALS._player._bounds.contains(event.mousePos)) - && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0)) { + && (R2_GLOBALS._player._uiEnabled) + && (R2_GLOBALS._events.getCursor() == R2_SOAKED_FACEMASK) + && (R2_GLOBALS._player._bounds.contains(event.mousePos)) + && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0)) { event.handled = true; R2_GLOBALS._player.disableControl(); - _exit7._enabled = false; - _exit8._enabled = false; + _shaftExit._enabled = false; + _doorExit._enabled = false; _sceneMode = 1959; setAction(&_sequenceManager, this, 1959, &R2_GLOBALS._player, NULL); } + Scene::process(event); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 82895c7ab0..824df607b3 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -163,7 +163,7 @@ public: MazeUI _mazeUI; SequenceManager _sequenceManager; - int _field412; + int _nextCrawlDirection; int _field414; int _field416; int _field418; @@ -1011,11 +1011,11 @@ public: }; class Scene1925 : public SceneExt { - class Hotspot2 : public NamedHotspot { + class Button : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Hotspot3 : public NamedHotspot { + class Ladder : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1038,8 +1038,8 @@ class Scene1925 : public SceneExt { }; public: NamedHotspot _item1; - Hotspot2 _item2; - Hotspot3 _item3; + Button _button; + Ladder _ladder; SceneActor _actor1; ExitUp _exitUp; Exit2 _exit2; @@ -1060,16 +1060,16 @@ public: }; class Scene1945 : public SceneExt { - class Hotspot3 : public NamedHotspot { + class Ice : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Hotspot4 : public NamedHotspot { + class Ladder : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Gunpowder : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1078,26 +1078,26 @@ class Scene1945 : public SceneExt { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class CorridorExit : public SceneExit { public: virtual void changeScene(); }; public: NamedHotspot _item1; NamedHotspot _item2; - Hotspot3 _item3; - Hotspot4 _item4; + Ice _ice; + Ladder _ladder; SceneActor _actor1; SceneActor _actor2; - Actor3 _actor3; + Gunpowder _gunpowder; ExitUp _exitUp; - Exit2 _exit2; + CorridorExit _corridorExit; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; - int _fieldEAA; - int _fieldEAC; - CursorType _fieldEAE; + int _nextSceneMode1; + int _nextSceneMode2; + CursorType _lampUsed; Scene1945(); void synchronize(Serializer &s); @@ -1108,15 +1108,16 @@ public: }; class Scene1950 : public SceneExt { - class Area1: public SceneArea { + /* Windows */ + class KeypadWindow: public ModalWindow { public: - class Actor10 : public SceneActor { + class KeypadButton : public SceneActor { public: - int _fieldA4; - int _fieldA6; - int _fieldA8; + int _buttonIndex; + bool _pressed; + bool _toggled; - Actor10(); + KeypadButton(); void synchronize(Serializer &s); void init(int indx); @@ -1125,30 +1126,29 @@ class Scene1950 : public SceneExt { }; SceneActor _areaActor; - Actor10 _arrActor1[16]; + KeypadButton _buttons[16]; byte _field20; - int _fieldB65; - - Area1(); - void synchronize(Serializer &s); + int _buttonIndex; + KeypadWindow(); + virtual void synchronize(Serializer &s); virtual void remove(); - virtual void process(Event &event); virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); }; - class Hotspot2 : public NamedHotspot { + class Keypad : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + /* Actors */ + class Door : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Scrolls : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1156,94 +1156,95 @@ class Scene1950 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor5 : public SceneActor { + class Gem : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor8 : public SceneActor { + class Vampire : public SceneActor { public: - int _fieldA4; - int _fieldA6; + Common::Point _deadPosition; int _fieldA8; int _fieldAA; - int _fieldAC; + int _vampireMode; byte _fieldAE; byte _fieldAF; - Actor8(); + Vampire(); void synchronize(Serializer &s); virtual void signal(); virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + /* Exits */ + class NorthExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class UpExit : public SceneExit { public: virtual void changeScene(); }; - class Exit3 : public SceneExit { + class EastExit : public SceneExit { public: virtual void changeScene(); }; - class Exit4 : public SceneExit { + class DownExit : public SceneExit { public: virtual void changeScene(); }; - class Exit5 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; - class Exit6 : public SceneExit { + class WestExit : public SceneExit { public: virtual void changeScene(); }; - class Exit7 : public SceneExit { + class ShaftExit : public SceneExit { public: virtual void changeScene(); }; - class Exit8 : public SceneExit { + class DoorExit : public SceneExit { public: virtual void changeScene(); }; +private: + void initArea(); + void enterArea(); + void doButtonPress(int indx); public: - NamedHotspot _item1; - Hotspot2 _item2; - SceneActor _actor1; - BackgroundSceneObject _object1; - Actor2 _actor2; - Actor3 _actor3; - SceneActor _actor4; - Actor5 _actor5; - SceneActor _actor6; + NamedHotspot _background; + Keypad _keypad; + SceneActor _southDoorway; + SceneObject _northDoorway; + Door _door; + Scrolls _scrolls; + SceneActor _containmentField; + Gem _gem; + SceneActor _cube; SceneActor _actor7; - Actor8 _actor8; - Area1 _area1; - Exit1 _exit1; - Exit2 _exit2; - Exit3 _exit3; - Exit4 _exit4; - Exit5 _exit5; - Exit6 _exit6; - Exit7 _exit7; - Exit8 _exit8; + Vampire _vampire; + KeypadWindow _KeypadWindow; + NorthExit _northExit; + UpExit _upExit; + EastExit _eastExit; + DownExit _downExit; + SouthExit _southExit; + WestExit _westExit; + ShaftExit _shaftExit; + DoorExit _doorExit; SequenceManager _sequenceManager; int _field412; int _field414; int _field416; Common::Point _field418; - int _field41C; + int _vampireIndex; Scene1950(); void synchronize(Serializer &s); - void subBDC1E(); - void subBE59B(); - void subBF4B4(int indx); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); virtual void signal(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 3eac2bffe1..a8e534d5cb 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -51,77 +51,77 @@ void Scene2000::initPlayer() { R2_GLOBALS._player.enableControl(); break; case 1: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2001; else _sceneMode = 2021; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 2: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2002; else _sceneMode = 2022; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 3: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2000; else _sceneMode = 2020; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 4: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2005; else _sceneMode = 2025; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 5: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2004; else _sceneMode = 2024; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 6: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2009; else _sceneMode = 2029; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 7: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2008; else _sceneMode = 2028; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 8: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2013; else _sceneMode = 2033; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 9: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2012; else _sceneMode = 2032; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 10: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2016; else _sceneMode = 2036; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 11: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2038; else _sceneMode = 2040; @@ -137,7 +137,7 @@ void Scene2000::initPlayer() { if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) && (R2_GLOBALS._spillLocation[R2_QUINN] == R2_GLOBALS._spillLocation[R2_SEEKER])) { _object1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object1.setup(20, 5, 1); _object1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -349,9 +349,9 @@ void Scene2000::initExits() { break; case 23: _northExit._enabled = true; - _northExit._bounds.set(108, 83, 128, 184); + _northExit._bounds.set(108, 83, 184, 125); _northExit.setDest(Common::Point(135, 129)); - _northExit._cursorNum = CURSOR_INVALID; + _northExit._cursorNum = EXITCURSOR_NE; loadScene(2275); R2_GLOBALS._walkRegions.load(2000); if (!_exitingFlag) @@ -601,25 +601,25 @@ void Scene2000::SouthExit::changeScene() { switch (scene->_mazePlayerMode) { case 4: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2003, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2023, &R2_GLOBALS._player, NULL); break; case 6: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2007, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2027, &R2_GLOBALS._player, NULL); break; case 8: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2011, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2031, &R2_GLOBALS._player, NULL); break; case 11: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 2039; else scene->_sceneMode = 2041; @@ -666,19 +666,19 @@ void Scene2000::NorthExit::changeScene() { switch (scene->_mazePlayerMode) { case 5: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2006, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2026, &R2_GLOBALS._player, NULL); break; case 7: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2010, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2030, &R2_GLOBALS._player, NULL); break; case 9: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2014, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2034, &R2_GLOBALS._player, NULL); @@ -698,56 +698,56 @@ void Scene2000::DoorExit::changeScene() { switch (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex]) { case 3: scene->_mazePlayerMode = 1; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 4: scene->_mazePlayerMode = 7; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 10: scene->_mazePlayerMode = 8; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 12: scene->_mazePlayerMode = 3; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 16: scene->_mazePlayerMode = 4; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 21: scene->_mazePlayerMode = 5; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 25: scene->_mazePlayerMode = 2; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 34: scene->_mazePlayerMode = 6; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); @@ -791,7 +791,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1030,12 +1030,6 @@ void Scene2000::process(Event &event) { void Scene2000::synchronize(Serializer &s) { SceneExt::synchronize(s); - // Synchronise active walk regions - int regionsId = R2_GLOBALS._walkRegions._resNum; - s.syncAsUint16LE(regionsId); - if (s.isLoading()) - R2_GLOBALS._walkRegions.load(regionsId); - s.syncAsByte(_exitingFlag); s.syncAsSint16LE(_mazePlayerMode); } @@ -1069,7 +1063,7 @@ void Scene2350::ExitUp::changeScene() { R2_GLOBALS._player.disableControl(CURSOR_CROSSHAIRS); scene->_sceneMode = 12; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2350, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2352, &R2_GLOBALS._player, NULL); @@ -1105,7 +1099,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1115,7 +1109,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor2.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor2.setup(20, 5, 1); _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1145,7 +1139,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { if (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex] == 34) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2351; else _sceneMode = 2353; @@ -1280,94 +1274,94 @@ void Scene2400::signal() { } /*-------------------------------------------------------------------------- - * Scene 2425 - Spill Mountains: + * Scene 2425 - Spill Mountains: The Hall Of Records * *--------------------------------------------------------------------------*/ -bool Scene2425::Item1::startAction(CursorType action, Event &event) { +bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_GUNPOWDER) && (!R2_GLOBALS.getFlag(84))) { + if ((action == R2_CURSOR_ROPE) && (!R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; - scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.setFlag(84); return true; - } else if (action == R2_GUNPOWDER) { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + } else if (action == R2_CURSOR_ROPE) { + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } else return NamedHotspot::startAction(action, event); } -bool Scene2425::Item2::startAction(CursorType action, Event &event) { +bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_GUNPOWDER) && (R2_GLOBALS.getFlag(84))) { + if ((action == R2_CURSOR_ROPE) && (R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; - scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.clearFlag(84); return true; - } else if (action == R2_GUNPOWDER) { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + } else if (action == R2_CURSOR_ROPE) { + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } else return NamedHotspot::startAction(action, event); } -bool Scene2425::Item3::startAction(CursorType action, Event &event) { +bool Scene2425::Crevasse::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_GUNPOWDER) + if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(84)) { scene->_sceneMode = 20; - scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.clearFlag(84); } else { scene->_sceneMode = 2425; - scene->setAction(&scene->_sequenceManager, scene, 2425, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2425, &R2_GLOBALS._player, &scene->_rope, NULL); } return true; } } bool Scene2425::Item4::startAction(CursorType action, Event &event) { - if (action != R2_GUNPOWDER) + if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } } -bool Scene2425::Actor1::startAction(CursorType action, Event &event) { - if (action == R2_STEPPING_DISKS) { - if (R2_GLOBALS._player._characterIndex == 2) { - R2_GLOBALS._events.setCursor(R2_GUNPOWDER); +bool Scene2425::Rope::startAction(CursorType action, Event &event) { + if (action == CURSOR_USE) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + R2_GLOBALS._events.setCursor(R2_CURSOR_ROPE); return true; } else { return SceneActor::startAction(action, event); } - } else if (R2_GLOBALS._events.getCursor() == R2_GUNPOWDER) + } else if (R2_GLOBALS._events.getCursor() == R2_CURSOR_ROPE) return false; else return SceneActor::startAction(action, event); } -bool Scene2425::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_GUNPOWDER) +bool Scene2425::Pictographs::startAction(CursorType action, Event &event) { + if (action != R2_CURSOR_ROPE) return SceneActor::startAction(action, event); else { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return SceneActor::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return SceneActor::startAction(CURSOR_USE, event); } } @@ -1398,7 +1392,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1407,39 +1401,39 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor2.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { - _actor2.setup(20, 5, 1); - _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _pictographs1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _pictographs1.setup(20, 5, 1); + _pictographs1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor2.setup(2008, 5, 1); - _actor2.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _pictographs1.setup(2008, 5, 1); + _pictographs1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor2.setPosition(Common::Point(250, 185)); + _pictographs1.setPosition(Common::Point(250, 185)); } - _actor1.postInit(); + _rope.postInit(); if (R2_GLOBALS._sceneManager._previousScene == 2455) - _actor1.setup(2426, 1, 1); + _rope.setup(2426, 1, 1); else - _actor1.setup(2426, 1, 2); + _rope.setup(2426, 1, 2); - _actor1.setPosition(Common::Point(290, 9)); - _actor1.fixPriority(20); - _actor1.setDetails(2455, 12, -1, -1, 1, (SceneItem *)NULL); - _item1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); - _item2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); + _rope.setPosition(Common::Point(290, 9)); + _rope.fixPriority(20); + _rope.setDetails(2455, 12, -1, -1, 1, (SceneItem *)NULL); + _ropeDest1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); + _ropeDest2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); // CHECKME: SceneActor using a SceneItem function?? -// _actor3.setDetails(11, 2425, 3, -1, 6); - _actor3._sceneRegionId = 11; - _actor3._resNum = 2425; - _actor3._lookLineNum = 3; - _actor3._talkLineNum = -1; - _actor3._useLineNum = 6; - g_globals->_sceneItems.push_back(&_actor3); - - _item3.setDetails(12, 2425, 7, -1, 9); +// _pictographs2.setDetails(11, 2425, 3, -1, 6); + _pictographs2._sceneRegionId = 11; + _pictographs2._resNum = 2425; + _pictographs2._lookLineNum = 3; + _pictographs2._talkLineNum = -1; + _pictographs2._useLineNum = 6; + g_globals->_sceneItems.push_back(&_pictographs2); + + _crevasse.setDetails(12, 2425, 7, -1, 9); _item4.setDetails(Rect(0, 0, 320, 200), 2425, 0, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -1460,7 +1454,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { break; case 2455: _sceneMode = 2428; - setAction(&_sequenceManager, this, 2428, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2428, &R2_GLOBALS._player, &_rope, NULL); break; default: R2_GLOBALS._player.setPosition(Common::Point(280, 150)); @@ -1483,7 +1477,7 @@ void Scene2425::signal() { break; case 20: _sceneMode = 2425; - setAction(&_sequenceManager, this, 2425, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2425, &R2_GLOBALS._player, &_rope, NULL); break; case 2425: g_globals->_sceneManager.changeScene(2455); @@ -1503,27 +1497,27 @@ bool Scene2430::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2430::Actor2::startAction(CursorType action, Event &event) { +bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != R2_STEPPING_DISKS) || (R2_GLOBALS._player._characterIndex != 2)) + if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2430; - scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_gunPowder, NULL); return true; } -bool Scene2430::Actor3::startAction(CursorType action, Event &event) { +bool Scene2430::OilLamp::startAction(CursorType action, Event &event) { Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != R2_STEPPING_DISKS) || (R2_GLOBALS._player._characterIndex != 2)) + if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2435; - scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_oilLamp, NULL); return true; } @@ -1546,23 +1540,23 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { _exit1.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_GUNPOWDER) == 2430) { - _actor2.postInit(); - _actor2.setup(2435, 1, 5); - _actor2.setPosition(Common::Point(205, 119)); - _actor2.fixPriority(152); - _actor2.setDetails(2430, 51, -1, 53, 1, (SceneItem *)NULL); + _gunPowder.postInit(); + _gunPowder.setup(2435, 1, 5); + _gunPowder.setPosition(Common::Point(205, 119)); + _gunPowder.fixPriority(152); + _gunPowder.setDetails(2430, 51, -1, 53, 1, (SceneItem *)NULL); } if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2435) { - _actor3.postInit(); - _actor3.setup(2435, 1, 1); - _actor3.setPosition(Common::Point(31, 65)); - _actor3.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); + _oilLamp.postInit(); + _oilLamp.setup(2435, 1, 1); + _oilLamp.setPosition(Common::Point(31, 65)); + _oilLamp.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1573,7 +1567,7 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1581,7 +1575,7 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _actor1.setPosition(Common::Point(189, 137)); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(4); } _item2.setDetails(Rect(11, 30, 37, 45), 2430, 3, -1, 5, 1, NULL); @@ -1618,12 +1612,12 @@ void Scene2430::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2430: - _actor2.remove(); + _gunPowder.remove(); R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 2); R2_GLOBALS._player.enableControl(); break; case 2435: - _actor3.remove(); + _oilLamp.remove(); R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_3, 2); R2_GLOBALS._player.enableControl(); break; @@ -1663,7 +1657,7 @@ bool Scene2435::Astor::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_ARROW); - if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) { + if ((R2_GLOBALS._player._characterIndex == R2_QUINN) || (R2_GLOBALS.getFlag(82))) { scene->_stripManager.start(605, scene); return true; } else if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) { @@ -1726,7 +1720,7 @@ void Scene2435::postInit(SceneObjectList *OwnerList) { _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _companion.setPosition(Common::Point(107, 145)); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); } _leftWindow.setDetails(Rect(52, 44, 96, 82), 2430, 3, -1, 5, 1, NULL); @@ -1777,14 +1771,14 @@ void Scene2435::signal() { _sceneMode = 2436; R2_GLOBALS._player.setStrip(7); _companion.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _companion.setVisage(20); else _companion.setVisage(2008); setAction(&_sequenceManager, this, 2436, &_companion, NULL); break; case 2436: - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_ARROW); _stripManager.start(709, this); @@ -1803,13 +1797,13 @@ bool Scene2440::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2440::Actor2::startAction(CursorType action, Event &event) { +bool Scene2440::OilLamp::startAction(CursorType action, Event &event) { Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 2)){ + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_SEEKER)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2440; - scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_oilLamp, NULL); return true; } @@ -1835,17 +1829,17 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_SE, 2000); _exit1.setDest(Common::Point(210, 160)); if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2440) { - _actor2.postInit(); - _actor2.setup(2435, 1, 1); - _actor2.setPosition(Common::Point(94, 80)); - _actor2.fixPriority(106); - _actor2.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); + _oilLamp.postInit(); + _oilLamp.setup(2435, 1, 1); + _oilLamp.setPosition(Common::Point(94, 80)); + _oilLamp.fixPriority(106); + _oilLamp.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.enableControl(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1855,7 +1849,7 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(210, 200)); if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1898,7 +1892,7 @@ void Scene2440::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2440: - _actor2.remove(); + _oilLamp.remove(); R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_2, 2); // No break on purpose default: @@ -1933,7 +1927,7 @@ void Scene2445::signal() { bool Scene2450::Parker::startAction(CursorType action, Event &event) { Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 1)) { + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2452; scene->setAction(&scene->_sequenceManager, scene, 2452, &R2_GLOBALS._player, &scene->_parker, NULL); @@ -1951,7 +1945,7 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { ++R2_GLOBALS._v565AE; scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_stripManager.start(699 + (R2_GLOBALS._v565AE * 2), scene); else scene->_stripManager.start(700 + (R2_GLOBALS._v565AE * 2), scene); @@ -1965,7 +1959,7 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { void Scene2450::Exit1::changeScene() { Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._player._characterIndex == 2) || (R2_GLOBALS.getFlag(61))) { + if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) || (R2_GLOBALS.getFlag(61))) { _enabled = false; R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.disableControl(); @@ -2023,7 +2017,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { break; case 2000: _sceneMode = 2451; - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS._player._characterScene[R2_SEEKER] == 2450) { _companion.postInit(); _companion.setup(20, 6, 1); @@ -2047,7 +2041,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { } break; case 2450: - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.postInit(); if (R2_GLOBALS.getFlag(61)) { R2_GLOBALS._player.setup(2008, 6, 1); @@ -2117,7 +2111,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { break; default: R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(61)) { R2_GLOBALS._player.setup(2008, 3, 1); } else { @@ -2223,18 +2217,18 @@ void Scene2450::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2455::Actor1::startAction(CursorType action, Event &event) { +bool Scene2455::Lamp::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; - scene->_actor2._lookLineNum = 9; - scene->_actor1.remove(); - scene->_actor3.postInit(); - scene->_actor3.setDetails(2455, 16, 1, -1, 2, (SceneItem *)NULL); - scene->setAction(&scene->_sequenceManager, scene, 2458, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, NULL); + scene->_pool._lookLineNum = 9; + scene->_lamp.remove(); + scene->_scrithKey.postInit(); + scene->_scrithKey.setDetails(2455, 16, 1, -1, 2, (SceneItem *)NULL); + scene->setAction(&scene->_sequenceManager, scene, 2458, &R2_GLOBALS._player, &scene->_pool, &scene->_scrithKey, NULL); return true; } } @@ -2242,31 +2236,31 @@ bool Scene2455::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2455::Actor2::startAction(CursorType action, Event &event) { +bool Scene2455::Pool::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; switch (action) { case R2_ALCOHOL_LAMP_2: if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) != 2455) { R2_GLOBALS._player.disableControl(); - scene->_actor1.postInit(); - scene->_actor1.setup(2456, 3, 3); - scene->_actor1.setPosition(Common::Point(162, 165)); - scene->_actor1.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); + scene->_lamp.postInit(); + scene->_lamp.setup(2456, 3, 3); + scene->_lamp.setPosition(Common::Point(162, 165)); + scene->_lamp.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); scene->_sceneMode = 11; - scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_pool, NULL); return true; } break; case R2_ALCOHOL_LAMP_3: if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) != 2455) { R2_GLOBALS._player.disableControl(); - scene->_actor1.postInit(); - scene->_actor1.setup(2456, 3, 3); - scene->_actor1.setPosition(Common::Point(162, 165)); - scene->_actor1.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); + scene->_lamp.postInit(); + scene->_lamp.setup(2456, 3, 3); + scene->_lamp.setPosition(Common::Point(162, 165)); + scene->_lamp.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); scene->_sceneMode = 12; - scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_pool, NULL); return true; } break; @@ -2277,13 +2271,13 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2455::Actor3::startAction(CursorType action, Event &event) { +bool Scene2455::ScrithKey::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; if (action == CURSOR_USE) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2459; - scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_scrithKey, NULL); return true; } @@ -2313,37 +2307,36 @@ void Scene2455::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(0, 0, 320, 15), EXITCURSOR_N, 2425); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2455) { - if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { - _actor1.postInit(); - _actor1.setup(2456, 3, 3); - _actor1.setPosition(Common::Point(162, 165)); - _actor1.setDetails(2455, 15, 1, -1, 1, (SceneItem *)NULL); - } - } else { - _actor3.postInit(); - _actor3.setup(2456, 3, 1); - _actor3.setPosition(Common::Point(176, 165)); - _actor3.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); - } - - _actor2.postInit(); + _scrithKey.postInit(); + _scrithKey.setup(2456, 3, 1); + _scrithKey.setPosition(Common::Point(176, 165)); + _scrithKey.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); + } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || + (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { + _lamp.postInit(); + _lamp.setup(2456, 3, 3); + _lamp.setPosition(Common::Point(162, 165)); + _lamp.setDetails(2455, 15, 1, -1, 1, (SceneItem *)NULL); + } + + _pool.postInit(); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2455) { - _actor2.setup(2456, 3, 2); - _actor2.setDetails(2455, 9, 1, -1, 1, (SceneItem *)NULL); + _pool.setup(2456, 3, 2); + _pool.setDetails(2455, 9, 1, -1, 1, (SceneItem *)NULL); } else { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) != 2455) && (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) != 2455)) - _actor2.setup(2455, 1, 1); + _pool.setup(2455, 1, 1); else - _actor2.setup(2456, 1, 1); - _actor2.setDetails(2455, 3, 1, -1, 1, (SceneItem *)NULL); + _pool.setup(2456, 1, 1); + _pool.setDetails(2455, 3, 1, -1, 1, (SceneItem *)NULL); } - _actor2.setPosition(Common::Point(162, 165)); - _actor2.fixPriority(20); + _pool.setPosition(Common::Point(162, 165)); + _pool.fixPriority(20); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) != 2455) - _actor2.animate(ANIM_MODE_2, NULL); + _pool.animate(ANIM_MODE_2, NULL); R2_GLOBALS._player.postInit(); - _item1.setDetails(Rect(0, 0, 320, 200), 2455, 0, 1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2455, 0, 1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2425) { @@ -2386,7 +2379,7 @@ void Scene2455::signal() { R2_GLOBALS._player._canWalk = false; break; case 2459: - _actor3.remove(); + _scrithKey.remove(); R2_INVENTORY.setObjectScene(R2_SCRITH_KEY, 2); R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; @@ -2436,7 +2429,7 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(11); R2_GLOBALS._player._moveDiff = Common::Point(2, 1); } else { @@ -2446,7 +2439,7 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(21, 3, 1); _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *)NULL); } else { @@ -2507,6 +2500,7 @@ void Scene2500::signal() { * Scene 2525 - Furnace room * *--------------------------------------------------------------------------*/ + bool Scene2525::Item5::startAction(CursorType action, Event &event) { Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; @@ -2520,16 +2514,16 @@ bool Scene2525::Item5::startAction(CursorType action, Event &event) { return SceneItem::startAction(action, event); } -bool Scene2525::Actor3::startAction(CursorType action, Event &event) { +bool Scene2525::GlassDome::startAction(CursorType action, Event &event) { Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2525; - scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_glassDome, NULL); } else { SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -2558,11 +2552,11 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(86, 155, 228, 168), EXITCURSOR_S, 2000); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2525) { - _actor3.postInit(); - _actor3.setup(2435, 1, 2); - _actor3.setPosition(Common::Point(78, 155)); - _actor3.fixPriority(155); - _actor3.setDetails(2525, 27, -1, -1, 1, (SceneItem *)NULL); + _glassDome.postInit(); + _glassDome.setup(2435, 1, 2); + _glassDome.setPosition(Common::Point(78, 155)); + _glassDome.fixPriority(155); + _glassDome.setDetails(2525, 27, -1, -1, 1, (SceneItem *)NULL); } _actor2.postInit(); @@ -2574,7 +2568,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2584,7 +2578,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -2593,7 +2587,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { } _actor1.setPosition(Common::Point(209, 162)); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(4); } _item5.setDetails(Rect(125, 73, 140, 86), 2525, 6, -1, -1, 1, NULL); @@ -2629,7 +2623,7 @@ void Scene2525::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2525: - _actor3.remove(); + _glassDome.remove(); R2_INVENTORY.setObjectScene(R2_GLASS_DOME, 2); R2_GLOBALS._player.enableControl(); break; @@ -2647,16 +2641,17 @@ void Scene2525::signal() { * Scene 2530 - Spill Mountains: Well * *--------------------------------------------------------------------------*/ -bool Scene2530::Actor2::startAction(CursorType action, Event &event) { + +bool Scene2530::Flask::startAction(CursorType action, Event &event) { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2530; - scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_flask, NULL); } else { SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -2664,29 +2659,29 @@ bool Scene2530::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene2530::Actor3::startAction(CursorType action, Event &event) { +bool Scene2530::Crank::startAction(CursorType action, Event &event) { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(73)) SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2532; - scene->setAction(&scene->_sequenceManager, scene, 2532, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2532, &R2_GLOBALS._player, &scene->_crank, NULL); } } else { if (R2_GLOBALS.getFlag(73)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2533; - scene->setAction(&scene->_sequenceManager, scene, 2533, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2533, &R2_GLOBALS._player, &scene->_crank, NULL); } else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2531; - scene->setAction(&scene->_sequenceManager, scene, 2531, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2531, &R2_GLOBALS._player, &scene->_crank, NULL); } } @@ -2714,27 +2709,27 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { _exit1.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_PURE_GRAIN_ALCOHOL) == 2530) { - _actor2.postInit(); - _actor2.setup(2435, 1, 3); - _actor2.setPosition(Common::Point(299, 80)); - _actor2.fixPriority(80); - _actor2.setDetails(2530, 28, -1, -1, 1, (SceneItem *)NULL); + _flask.postInit(); + _flask.setup(2435, 1, 3); + _flask.setPosition(Common::Point(299, 80)); + _flask.fixPriority(80); + _flask.setDetails(2530, 28, -1, -1, 1, (SceneItem *)NULL); } - _actor3.postInit(); + _crank.postInit(); if (R2_GLOBALS.getFlag(73)) { - _actor3.setup(2531, 4, 2); - _actor3.setPosition(Common::Point(154, 130)); + _crank.setup(2531, 4, 2); + _crank.setPosition(Common::Point(154, 130)); } else { - _actor3.setup(2531, 4, 1); - _actor3.setPosition(Common::Point(173, 131)); + _crank.setup(2531, 4, 1); + _crank.setPosition(Common::Point(173, 131)); } - _actor3.setDetails(2530, 22, -1, -1, 1, (SceneItem *)NULL); + _crank.setDetails(2530, 22, -1, -1, 1, (SceneItem *)NULL); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2745,7 +2740,7 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -2753,13 +2748,13 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _actor1.setPosition(Common::Point(20, 130)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); } _item2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL); _item5.setDetails(Rect(115, 112, 206, 130), 2530, 25, -1, 27, 1, NULL); - _item3.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL); + _shelf.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -2782,7 +2777,8 @@ void Scene2530::signal() { break; case 2530: R2_INVENTORY.setObjectScene(R2_PURE_GRAIN_ALCOHOL, 2); - _actor2.remove(); + _flask.remove(); + R2_GLOBALS._player.enableControl(); break; case 2531: // No break on purpose @@ -2830,7 +2826,7 @@ bool Scene2535::TannerMask::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2535; scene->setAction(&scene->_sequenceManager, scene, 2535, &R2_GLOBALS._player, &scene->_tannerMask, NULL); @@ -2876,7 +2872,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { _rebreatherTank.setup(2535, 3, 1); _rebreatherTank.setPosition(Common::Point(203, 131)); _rebreatherTank.setDetails(3, 20, -1, -1, 1, (SceneItem *)NULL); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(6); } if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 0) && (R2_GLOBALS.getFlag(73))) { @@ -2896,7 +2892,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2907,7 +2903,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _companion.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _companion.setup(20, 5, 1); _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -2915,7 +2911,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _companion.setPosition(Common::Point(245, 115)); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); } _roof.setDetails(Rect(96, 3, 215, 33), 2535, 3, 6, 5, 1, NULL); @@ -2945,13 +2941,13 @@ void Scene2535::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2535: - R2_INVENTORY.setObjectScene(R2_TANNER_MASK, 2); + R2_INVENTORY.setObjectScene(R2_TANNER_MASK, R2_SEEKER); _tannerMask.remove(); R2_GLOBALS._player.enableControl(); break; case 2536: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 0); - R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(6); if (!R2_GLOBALS.getFlag(73)) { _rebreatherTank.remove(); R2_GLOBALS._player.enableControl(); @@ -3022,11 +3018,19 @@ void Scene2600::signal() { } /*-------------------------------------------------------------------------- - * Scene 2700 - Forest Maze + * Scene 2700 - Outer Forest * *--------------------------------------------------------------------------*/ + Scene2700::Scene2700(): SceneExt() { _field412 = _field414 = _field416 = 0; + + _walkRect1.set(70, 122, 90, 132); + _walkRect2.set(150, 122, 160, 132); + _walkRect3.set(90, 142, 130, 157); + _walkRect4.set(175, 137, 200, 147); + _walkRect5.set(280, 127, 300, 137); + _walkRect6.set(240, 157, 265, 167); } void Scene2700::synchronize(Serializer &s) { @@ -3041,28 +3045,28 @@ void Scene2700::Action1::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor2.animate(ANIM_MODE_5, NULL); + scene->_ghoulHome6.animate(ANIM_MODE_5, NULL); } void Scene2700::Action2::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(300 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor3.animate(ANIM_MODE_5, NULL); + scene->_ghoulHome7.animate(ANIM_MODE_5, NULL); } void Scene2700::Action3::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(450 + R2_GLOBALS._randomSource.getRandomNumber(450)); - scene->_actor4.animate(ANIM_MODE_8, 1, NULL); + scene->_ghoulHome8.animate(ANIM_MODE_8, 1, NULL); } void Scene2700::Action4::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(300 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor5.animate(ANIM_MODE_8, 1, NULL); + scene->_ghoulHome9.animate(ANIM_MODE_8, 1, NULL); } void Scene2700::Area1::process(Event &event) { @@ -3177,39 +3181,33 @@ void Scene2700::postInit(SceneObjectList *OwnerList) { _area1.setDetails(Rect(135, 160, 185, 168), SHADECURSOR_DOWN); _area2.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); - _rect1.set(70, 122, 90, 132); - _rect2.set(150, 122, 160, 132); - _rect3.set(90, 142, 130, 157); - _rect4.set(175, 137, 200, 147); - _rect5.set(280, 127, 300, 137); - _rect6.set(240, 157, 265, 167); - - _actor2.postInit(); - _actor2.setup(2700, 1, 1); - _actor2.setPosition(Common::Point(140, 29)); - _actor2.setAction(&_action1); - _actor3.postInit(); - _actor3.setup(2700, 2, 1); - _actor3.setPosition(Common::Point(213, 32)); - _actor3.setAction(&_action2); - - _actor4.postInit(); - _actor4.setup(2700, 3, 1); - _actor4.setPosition(Common::Point(17, 39)); - _actor4.setAction(&_action3); - - _actor5.postInit(); - _actor5.setup(2700, 5, 1); - _actor5.setPosition(Common::Point(17, 71)); - _actor5.setAction(&_action4); - - _item2.setDetails(Rect(52, 38, 68, 60), 2700, 4, -1, 6, 1, NULL); - _item3.setDetails(Rect(113, 22, 127, 33), 2700, 4, -1, 6, 1, NULL); - _item4.setDetails(Rect(161, 44, 170, 52), 2700, 4, -1, 6, 1, NULL); - _item5.setDetails(Rect(221, 19, 233, 31), 2700, 4, -1, 6, 1, NULL); - _item6.setDetails(Rect(235, 59, 250, 75), 2700, 4, -1, 6, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2700, 4, -1, 6, 1, NULL); + _ghoulHome6.postInit(); + _ghoulHome6.setup(2700, 1, 1); + _ghoulHome6.setPosition(Common::Point(140, 29)); + _ghoulHome6.setAction(&_action1); + + _ghoulHome7.postInit(); + _ghoulHome7.setup(2700, 2, 1); + _ghoulHome7.setPosition(Common::Point(213, 32)); + _ghoulHome7.setAction(&_action2); + + _ghoulHome8.postInit(); + _ghoulHome8.setup(2700, 3, 1); + _ghoulHome8.setPosition(Common::Point(17, 39)); + _ghoulHome8.setAction(&_action3); + + _ghoulHome9.postInit(); + _ghoulHome9.setup(2700, 5, 1); + _ghoulHome9.setPosition(Common::Point(17, 71)); + _ghoulHome9.setAction(&_action4); + + _ghoulHome1.setDetails(Rect(52, 38, 68, 60), 2700, 4, -1, 6, 1, NULL); + _ghoulHome2.setDetails(Rect(113, 22, 127, 33), 2700, 4, -1, 6, 1, NULL); + _ghoulHome3.setDetails(Rect(161, 44, 170, 52), 2700, 4, -1, 6, 1, NULL); + _ghoulHome4.setDetails(Rect(221, 19, 233, 31), 2700, 4, -1, 6, 1, NULL); + _ghoulHome5.setDetails(Rect(235, 59, 250, 75), 2700, 4, -1, 6, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2700, 4, -1, 6, 1, NULL); _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -3467,31 +3465,31 @@ void Scene2700::signal() { R2_GLOBALS._player.disableControl(); _field412 = 0; _sceneMode = 2700; - setAction(&_sequenceManager, this, 2700, &_actor1, NULL); + setAction(&_sequenceManager, this, 2700, &_nej, NULL); break; case 12: R2_GLOBALS._sound1.play(234); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2711; _stripManager.start(_field416, this); break; case 13: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2712; _stripManager.start(_field416, this); break; case 14: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2713; _stripManager.start(_field416, this); break; case 15: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 11; _stripManager.start(_field416, this); break; case 2700: - _actor1.remove(); + _nej.remove(); R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 2703: @@ -3501,28 +3499,29 @@ void Scene2700::signal() { g_globals->_sceneManager.changeScene(2750); break; case 2710: + // Start of Nej assault _field416 = 1200; _sceneMode = 12; - _actor1.postInit(); - setAction(&_sequenceManager, this, 2710, &R2_GLOBALS._player, &_actor1, NULL); + _nej.postInit(); + setAction(&_sequenceManager, this, 2710, &R2_GLOBALS._player, &_nej, NULL); break; case 2711: R2_GLOBALS._player.disableControl(); _field416 = 1201; _sceneMode = 13; - setAction(&_sequenceManager, this, 2711, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2711, &R2_GLOBALS._player, &_nej, NULL); break; case 2712: R2_GLOBALS._player.disableControl(); _field416 = 1202; _sceneMode = 14; - setAction(&_sequenceManager, this, 2712, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2712, &R2_GLOBALS._player, &_nej, NULL); break; case 2713: R2_GLOBALS._player.disableControl(); _field416 = 1203; - _sceneMode = 14; - setAction(&_sequenceManager, this, 2713, &R2_GLOBALS._player, &_actor1, NULL); + _sceneMode = 15; + setAction(&_sequenceManager, this, 2713, &R2_GLOBALS._player, &_nej, NULL); break; default: R2_GLOBALS._player.enableControl(CURSOR_WALK); @@ -3536,7 +3535,8 @@ void Scene2700::process(Event &event) { _sceneMode = 10; _field414 = 2710; R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); + switch (_field412) { case 0: { _sceneMode = 2710; @@ -3584,43 +3584,44 @@ void Scene2700::process(Event &event) { default: break; } - event.handled = true; } else { SceneItem::display(2700, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } - } else if (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN) { - if (_rect1.contains(event.mousePos)) { - if (!_rect1.contains(R2_GLOBALS._player._position)) { + + event.handled = true; + } else if (R2_GLOBALS._events.getCursor() == CURSOR_WALK) { + if (_walkRect1.contains(event.mousePos)) { + if (!_walkRect1.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 1; } - } else if (_rect2.contains(event.mousePos)) { - if (!_rect2.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect2.contains(event.mousePos)) { + if (!_walkRect2.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 2; } - } else if (_rect3.contains(event.mousePos)) { - if (!_rect3.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect3.contains(event.mousePos)) { + if (!_walkRect3.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 3; } - } else if (_rect4.contains(event.mousePos)) { - if (!_rect4.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect4.contains(event.mousePos)) { + if (!_walkRect4.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 4; } - } else if (_rect5.contains(event.mousePos)) { - if (!_rect5.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect5.contains(event.mousePos)) { + if (!_walkRect5.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 5; } - } else if (_rect6.contains(event.mousePos)) { - if (!_rect6.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect6.contains(event.mousePos)) { + if (!_walkRect6.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 6; @@ -3703,9 +3704,10 @@ void Scene2700::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 2750 - Forest Maze + * Scene 2750 - Inner Forest * *--------------------------------------------------------------------------*/ + Scene2750::Scene2750(): SceneExt() { _field412 = _field414 = _field416 = 0; } @@ -3929,11 +3931,11 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { _actor11.setPosition(Common::Point(80, 35)); _actor11.setAction(&_action7); - _item2.setDetails(Rect(29, 50, 35, 56), 2750, 3, -1, 5, 1, NULL); - _item3.setDetails(Rect(47, 36, 54, 42), 2750, 3, -1, 5, 1, NULL); - _item4.setDetails(Rect(193, 21, 206, 34), 2750, 3, -1, 5, 1, NULL); - _item5.setDetails(Rect(301, 18, 315, 32), 2750, 3, -1, 5, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2700, 0, -1, 2, 1, NULL); + _ghoulHome1.setDetails(Rect(29, 50, 35, 56), 2750, 3, -1, 5, 1, NULL); + _ghoulHome2.setDetails(Rect(47, 36, 54, 42), 2750, 3, -1, 5, 1, NULL); + _ghoulHome3.setDetails(Rect(193, 21, 206, 34), 2750, 3, -1, 5, 1, NULL); + _ghoulHome4.setDetails(Rect(301, 18, 315, 32), 2750, 3, -1, 5, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2700, 0, -1, 2, 1, NULL); _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -3941,10 +3943,10 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_nejSpeaker); if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { - _actor1.postInit(); - _actor1.setup(2752, 5, 1); - _actor1.animate(ANIM_MODE_NONE, NULL); - _actor1.setPosition(Common::Point(101, 148)); + _nej.postInit(); + _nej.setup(2752, 5, 1); + _nej.animate(ANIM_MODE_NONE, NULL); + _nej.setPosition(Common::Point(101, 148)); } R2_GLOBALS._player.postInit(); @@ -3959,7 +3961,7 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.animate(ANIM_MODE_NONE, NULL); R2_GLOBALS._player.setPosition(Common::Point(81, 165)); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _field416 = 1204; _sceneMode = 11; _stripManager.start(_field416, this); @@ -4094,7 +4096,7 @@ void Scene2750::signal() { g_globals->_sceneManager.changeScene(2700); break; default: - R2_GLOBALS._player.enableControl(R2_NEGATOR_GUN); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -4159,9 +4161,10 @@ void Scene2750::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 2800 - Exiting forest + * Scene 2800 - Guard post * *--------------------------------------------------------------------------*/ + Scene2800::Scene2800(): SceneExt() { _field412 = 0; } @@ -4172,7 +4175,7 @@ void Scene2800::synchronize(Serializer &s) { s.syncAsSint16LE(_field412); } -bool Scene2800::Item2::startAction(CursorType action, Event &event) { +bool Scene2800::Outpost::startAction(CursorType action, Event &event) { Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if ((action == CURSOR_USE) && (R2_GLOBALS.getFlag(47))) { @@ -4184,12 +4187,12 @@ bool Scene2800::Item2::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); } -bool Scene2800::Actor1::startAction(CursorType action, Event &event) { +bool Scene2800::Guard::startAction(CursorType action, Event &event) { Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if (action == CURSOR_TALK) { R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS.setFlag(47); scene->_field412 = 1205; scene->_sceneMode = 2803; @@ -4200,7 +4203,7 @@ bool Scene2800::Actor1::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); R2_GLOBALS.setFlag(47); scene->_sceneMode = 10; - scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_guard, NULL); return true; } else return SceneActor::startAction(action, event); @@ -4271,37 +4274,37 @@ void Scene2800::Action2::signal() { case 4: setDelay(18); _object4.setStrip(4); - scene->_actor1.setVisage(2800); - scene->_actor1.setStrip(5); - scene->_actor1.setFrame(1); - scene->_actor1._numFrames = 5; - scene->_actor1._moveRate = 5; - scene->_actor1.setPosition(Common::Point(300, 104)); - scene->_actor1.fixPriority(110); - scene->_actor1.changeZoom(100); - scene->_actor1.show(); + scene->_guard.setVisage(2800); + scene->_guard.setStrip(5); + scene->_guard.setFrame(1); + scene->_guard._numFrames = 5; + scene->_guard._moveRate = 5; + scene->_guard.setPosition(Common::Point(300, 104)); + scene->_guard.fixPriority(110); + scene->_guard.changeZoom(100); + scene->_guard.show(); break; case 5: - scene->_actor1.animate(ANIM_MODE_5, this); + scene->_guard.animate(ANIM_MODE_5, this); break; case 6: { - scene->_actor1.changeZoom(-1); - scene->_actor1.setVisage(3107); - scene->_actor1.animate(ANIM_MODE_1, NULL); - scene->_actor1.setStrip(3); - scene->_actor1.setPosition(Common::Point(297, 140)); - scene->_actor1._numFrames = 10; - scene->_actor1._moveRate = 10; - scene->_actor1._moveDiff = Common::Point(3, 2); + scene->_guard.changeZoom(-1); + scene->_guard.setVisage(3107); + scene->_guard.animate(ANIM_MODE_1, NULL); + scene->_guard.setStrip(3); + scene->_guard.setPosition(Common::Point(297, 140)); + scene->_guard._numFrames = 10; + scene->_guard._moveRate = 10; + scene->_guard._moveDiff = Common::Point(3, 2); Common::Point pt(297, 160); NpcMover *mover = new NpcMover(); - scene->_actor1.addMover(mover, &pt, this); + scene->_guard.addMover(mover, &pt, this); break; } case 7: { - scene->_actor1.changeZoom(75); - scene->_actor1.updateAngle(R2_GLOBALS._player._position); + scene->_guard.changeZoom(75); + scene->_guard.updateAngle(R2_GLOBALS._player._position); Common::Point pt(105, 82); NpcMover *mover = new NpcMover(); @@ -4356,7 +4359,7 @@ void Scene2800::Action2::signal() { break; } case 13: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); scene->_field412 = 1207; scene->_stripManager.start(scene->_field412, this); break; @@ -4371,7 +4374,7 @@ void Scene2800::Action2::signal() { } case 15: setDelay(18); - scene->_actor1.updateAngle(R2_GLOBALS._player._position); + scene->_guard.updateAngle(R2_GLOBALS._player._position); R2_GLOBALS._player.setVisage(2800); R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.setFrame(1); @@ -4440,15 +4443,15 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { _actor3._numFrames = 6; if (!R2_GLOBALS.getFlag(47)) { - _actor1.postInit(); - _actor1.setVisage(3105); - _actor1.setStrip(3); - _actor1.setFrame(1); - _actor1.setZoom(50); - _actor1._moveDiff = Common::Point(2, 1); - _actor1.setPosition(Common::Point(122, 82)); - _actor1.animate(ANIM_MODE_NONE, NULL); - _actor1.setDetails(2800, -1, -1, -1, 1, (SceneItem *)NULL); + _guard.postInit(); + _guard.setVisage(3105); + _guard.setStrip(3); + _guard.setFrame(1); + _guard.setZoom(50); + _guard._moveDiff = Common::Point(2, 1); + _guard.setPosition(Common::Point(122, 82)); + _guard.animate(ANIM_MODE_NONE, NULL); + _guard.setDetails(2800, -1, -1, -1, 1, (SceneItem *)NULL); } _item1.setDetails(Rect(0, 0, 320, 200), 2800, -1, -1, -1, 1, NULL); @@ -4462,7 +4465,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { R2_GLOBALS._sound1.fadeSound(237); if (R2_GLOBALS.getFlag(47)) { - _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); } else { _actor2.postInit(); _actor2.setup(2752, 5, 1); @@ -4480,7 +4483,8 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(2, 2); R2_GLOBALS._player.disableControl(); - if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { + if (R2_INVENTORY.getObjectScene(R2_FLUTE) != 0) { + _sceneMode = 2800; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2800, &R2_GLOBALS._player, NULL); } else if (R2_GLOBALS.getFlag(47)) { R2_GLOBALS._player.setVisage(3110); @@ -4490,7 +4494,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { _sceneMode = 2801; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_guard, NULL); } } @@ -4498,7 +4502,7 @@ void Scene2800::signal() { switch (_sceneMode) { case 10: R2_GLOBALS._sound1.play(238); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _field412 = 1206; _sceneMode = 2804; _stripManager.start(_field412, this); @@ -4508,7 +4512,7 @@ void Scene2800::signal() { _object1.setAction(NULL); R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); break; case 12: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -4525,7 +4529,7 @@ void Scene2800::signal() { case 2803: R2_GLOBALS._player.disableControl(); _sceneMode = 10; - setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_guard, NULL); break; case 2804: R2_GLOBALS._player.disableControl(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index 422507883f..f90126b5a1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -141,15 +141,15 @@ public: }; class Scene2425 : public SceneExt { - class Item1 : public NamedHotspot { + class RopeDest1 : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item2 : public NamedHotspot { + class RopeDest2 : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item3 : public NamedHotspot { + class Crevasse : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -158,11 +158,11 @@ class Scene2425 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Rope : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Pictographs : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -172,13 +172,13 @@ class Scene2425 : public SceneExt { virtual void changeScene(); }; public: - Item1 _item1; - Item2 _item2; - Item3 _item3; + RopeDest1 _ropeDest1; + RopeDest2 _ropeDest2; + Crevasse _crevasse; Item4 _item4; - Actor1 _actor1; - Actor2 _actor2; - Actor2 _actor3; + Rope _rope; + Pictographs _pictographs1; + Pictographs _pictographs2; Exit1 _exit1; SequenceManager _sequenceManager; @@ -192,11 +192,11 @@ class Scene2430 : public SceneExt { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class GunPowder : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class OilLamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -220,8 +220,8 @@ public: NamedHotspot _item12; NamedHotspot _item13; Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; + GunPowder _gunPowder; + OilLamp _oilLamp; Exit1 _exit1; SequenceManager _sequenceManager; @@ -265,7 +265,7 @@ class Scene2440 : public SceneExt { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class OilLamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -283,7 +283,7 @@ public: NamedHotspot _item6; NamedHotspot _item7; Actor1 _actor1; - Actor2 _actor2; + OilLamp _oilLamp; Exit1 _exit1; SequenceManager _sequenceManager; @@ -333,15 +333,15 @@ public: }; class Scene2455 : public SceneExt { - class Actor1 : public SceneActor { + class Lamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Pool : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class ScrithKey : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -351,10 +351,10 @@ class Scene2455 : public SceneExt { virtual void changeScene(); }; public: - NamedHotspot _item1; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; + NamedHotspot _background; + Lamp _lamp; + Pool _pool; + ScrithKey _scrithKey; Exit1 _exit1; SequenceManager _sequenceManager; @@ -390,7 +390,7 @@ class Scene2525 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class GlassDome : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -407,7 +407,7 @@ public: Item5 _item5; SceneActor _actor1; SceneActor _actor2; - Actor3 _actor3; + GlassDome _glassDome; Exit1 _exit1; SequenceManager _sequenceManager; @@ -417,11 +417,11 @@ public: }; class Scene2530 : public SceneExt { - class Actor2 : public SceneActor { + class Flask : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Crank : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -431,14 +431,14 @@ class Scene2530 : public SceneExt { virtual void changeScene(); }; public: - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _item2; - NamedHotspot _item3; + NamedHotspot _shelf; NamedHotspot _item4; NamedHotspot _item5; SceneActor _actor1; - Actor2 _actor2; - Actor3 _actor3; + Flask _flask; + Crank _crank; Exit1 _exit1; SequenceManager _sequenceManager; @@ -520,24 +520,25 @@ class Scene2700 : public SceneExt { public: SpeakerQuinn2700 _quinnSpeaker; SpeakerNej2700 _nejSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - NamedHotspot _item6; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + NamedHotspot _background; + NamedHotspot _ghoulHome1; + NamedHotspot _ghoulHome2; + NamedHotspot _ghoulHome3; + NamedHotspot _ghoulHome4; + NamedHotspot _ghoulHome5; + SceneActor _nej; + SceneActor _ghoulHome6; + SceneActor _ghoulHome7; + SceneActor _ghoulHome8; + SceneActor _ghoulHome9; Action1 _action1; Action2 _action2; Action3 _action3; Action4 _action4; Area1 _area1; Area2 _area2; - Rect _rect1, _rect2, _rect3, _rect4, _rect5, _rect6; + Rect _walkRect1, _walkRect2, _walkRect3; + Rect _walkRect4, _walkRect5, _walkRect6; SequenceManager _sequenceManager; int _field412, _field414, _field416; @@ -589,12 +590,12 @@ class Scene2750 : public SceneExt { public: SpeakerQuinn2750 _quinnSpeaker; SpeakerNej2750 _nejSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - SceneActor _actor1; + NamedHotspot _background; + NamedHotspot _ghoulHome1; + NamedHotspot _ghoulHome2; + NamedHotspot _ghoulHome3; + NamedHotspot _ghoulHome4; + SceneActor _nej; SceneActor _actor2; SceneActor _actor3; SceneActor _actor4; @@ -626,12 +627,12 @@ public: }; class Scene2800 : public SceneExt { - class Item2 : public NamedHotspot { + class Outpost : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Guard : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -651,8 +652,8 @@ public: SpeakerNej2800 _nejSpeaker; SpeakerGuard2800 _guardSpeaker; NamedHotspot _item1; - Item2 _item2; - Actor1 _actor1; + Outpost _outpost; + Guard _guard; SceneActor _actor2; SceneActor _actor3; SceneObject _object1; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index b40263b2ae..c64665a839 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -30,9 +30,10 @@ namespace TsAGE { namespace Ringworld2 { /*-------------------------------------------------------------------------- - * Scene 3100 - + * Scene 3100 - ARM Base Hanager * *--------------------------------------------------------------------------*/ + Scene3100::Scene3100() { _field412 = 0; } @@ -63,7 +64,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; } else { loadScene(3100); - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, SCREEN_HEIGHT); } } else { loadScene(3100); @@ -148,7 +149,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setPosition(Common::Point(160, 150)); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._sound1.play(243); } @@ -172,7 +173,7 @@ void Scene3100::signal() { case 3100: R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 3101: R2_GLOBALS._sceneManager.changeScene(1000); @@ -182,7 +183,7 @@ void Scene3100::signal() { R2_GLOBALS._sceneManager.changeScene(1000); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -205,6 +206,7 @@ void Scene3100::dispatch() { * Scene 3125 - Ghouls dormitory * *--------------------------------------------------------------------------*/ + Scene3125::Scene3125() { _field412 = 0; } @@ -215,7 +217,7 @@ void Scene3125::synchronize(Serializer &s) { s.syncAsSint16LE(_field412); } -bool Scene3125::Item1::startAction(CursorType action, Event &event) { +bool Scene3125::Background::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -239,7 +241,7 @@ bool Scene3125::Item1::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Item2::startAction(CursorType action, Event &event) { +bool Scene3125::Table::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -262,15 +264,17 @@ bool Scene3125::Item2::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Item3::startAction(CursorType action, Event &event) { +bool Scene3125::Computer::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: R2_GLOBALS._player.disableControl(); - scene->_actor5.postInit(); + scene->_ghoul4.postInit(); scene->_sceneMode = 3126; - scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, &scene->_actor4, &scene->_actor1, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, + &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, + &scene->_ghoul4, NULL); break; case CURSOR_LOOK: SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); @@ -286,7 +290,7 @@ bool Scene3125::Item3::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Actor1::startAction(CursorType action, Event &event) { +bool Scene3125::Door::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -294,7 +298,7 @@ bool Scene3125::Actor1::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; - scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -303,43 +307,43 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); _field412 = 0; - _actor1.postInit(); - _actor1.setup(3175, 1, 1); - _actor1.setPosition(Common::Point(35, 72)); - _actor1.setDetails(3125, 12, 13, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3175, 1, 1); + _door.setPosition(Common::Point(35, 72)); + _door.setDetails(3125, 12, 13, -1, 1, (SceneItem *)NULL); - _actor2.postInit(); - _actor2.setup(3126, 4, 1); - _actor2.setPosition(Common::Point(71, 110)); - _actor2._numFrames = 20; + _ghoul1.postInit(); + _ghoul1.setup(3126, 4, 1); + _ghoul1.setPosition(Common::Point(71, 110)); + _ghoul1._numFrames = 20; - _actor3.postInit(); - _actor3.setup(3126, 1, 1); - _actor3.setPosition(Common::Point(215, 62)); - _actor3.fixPriority(71); + _ghoul2.postInit(); + _ghoul2.setup(3126, 1, 1); + _ghoul2.setPosition(Common::Point(215, 62)); + _ghoul2.fixPriority(71); - _actor4.postInit(); - _actor4.setup(3126, 1, 1); - _actor4.setPosition(Common::Point(171, 160)); - _actor4.fixPriority(201); + _ghoul3.postInit(); + _ghoul3.setup(3126, 1, 1); + _ghoul3.setPosition(Common::Point(171, 160)); + _ghoul3.fixPriority(201); - _item3.setDetails(12, 3125, 9, 13, -1); - _item2.setDetails(11, 3125, 15, 13, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3125, 0, 1, 2, 1, NULL); + _computer.setDetails(12, 3125, 9, 13, -1); + _table.setDetails(11, 3125, 15, 13, -1); + _background.setDetails(Rect(0, 0, 320, 200), 3125, 0, 1, 2, 1, NULL); R2_GLOBALS._sound1.play(262); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3250) { _sceneMode = 3175; - setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setPosition(Common::Point(89, 76)); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3125; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3125; } void Scene3125::signal() { @@ -362,7 +366,7 @@ void Scene3125::signal() { } void Scene3125::dispatch() { - if ((_sceneMode == 3126) && (_actor2._frame == 2) && (_field412 == 0)) { + if ((_sceneMode == 3126) && (_ghoul1._frame == 2) && (_field412 == 0)) { _field412 = 1; R2_GLOBALS._sound1.play(265); } @@ -373,7 +377,8 @@ void Scene3125::dispatch() { * Scene 3150 - Jail * *--------------------------------------------------------------------------*/ -bool Scene3150::Item5::startAction(CursorType action, Event &event) { + +bool Scene3150::LightFixture::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -383,16 +388,16 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3154; - scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_bulbOrWire, NULL); return true; case R2_SUPERCONDUCTOR_WIRE: if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && (R2_GLOBALS.getFlag(75))) { R2_GLOBALS._player.disableControl(); - scene->_actor3.postInit(); - scene->_actor3._effect = 3; - scene->_actor3._shade = 5; + scene->_bulbOrWire.postInit(); + scene->_bulbOrWire._effect = 3; + scene->_bulbOrWire._shade = 5; scene->_sceneMode = 3155; - scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_bulbOrWire, NULL); } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -403,39 +408,42 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { } } -bool Scene3150::Item6::startAction(CursorType action, Event &event) { +bool Scene3150::Toilet::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { case R2_PILLOW: R2_GLOBALS._player.disableControl(); - scene->_actor4.postInit(); - scene->_actor4._effect = 6; - scene->_actor4._shade = 3; + scene->_water.postInit(); + scene->_water._effect = 6; + scene->_water._shade = 3; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3158; - scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: - if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) && (R2_GLOBALS.getFlag(75))) { - scene->_actor5.postInit(); - scene->_actor5._effect = 6; - scene->_actor5._shade = 3; - scene->_actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && + (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) + && (R2_GLOBALS.getFlag(75))) { + scene->_foodTray.postInit(); + scene->_foodTray._effect = 6; + scene->_foodTray._shade = 3; + scene->_foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3159; - scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_foodTray, NULL); } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } + return true; default: return SceneHotspot::startAction(action, event); break; } } -bool Scene3150::Actor4::startAction(CursorType action, Event &event) { +bool Scene3150::Water::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -445,7 +453,7 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3151; - scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: return false; @@ -455,15 +463,15 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { } } -bool Scene3150::Actor5::startAction(CursorType action, Event &event) { +bool Scene3150::FoodTray::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(77))) - return SceneActor::startAction(action ,event); + return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3157; - scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_foodTray, NULL); return true; } @@ -479,7 +487,7 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 3153; - scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_water, NULL); } } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -495,20 +503,20 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { } } -bool Scene3150::Actor7::startAction(CursorType action, Event &event) { +bool Scene3150::AirVent::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; - scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_actor7, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_airVent, NULL); return true; } return SceneActor::startAction(action, event); } -void Scene3150::Exit1::changeScene() { +void Scene3150::DoorExit::changeScene() { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -521,7 +529,7 @@ void Scene3150::Exit1::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene3150::Exit2::changeScene() { +void Scene3150::VentExit::changeScene() { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -537,126 +545,126 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == -1) { R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2000); R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 3100; - R2_GLOBALS._player._oldCharacterScene[3] = 0; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 0; R2_GLOBALS._player._characterIndex = R2_MIRANDA; } SceneExt::postInit(); if (R2_GLOBALS.getFlag(78)) { - _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); - _exit1.setDest(Common::Point(70, 125)); + _doorExit.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _doorExit.setDest(Common::Point(70, 125)); } if (R2_GLOBALS.getFlag(80)) { - _exit2.setDetails(Rect(249, 36, 279, 60), EXITCURSOR_NE, 3150); - _exit2.setDest(Common::Point(241, 106)); + _ventExit.setDetails(Rect(249, 36, 279, 60), EXITCURSOR_NE, 3150); + _ventExit.setDest(Common::Point(241, 106)); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); - _actor2.postInit(); - _actor2.setPosition(Common::Point(64, 139)); + _doorBars.postInit(); + _doorBars.setPosition(Common::Point(64, 139)); if (R2_GLOBALS.getFlag(78)) { - _actor2.setup(3151, 1, 5); - _actor2.fixPriority(125); + _doorBars.setup(3151, 1, 5); + _doorBars.fixPriority(125); } else { - _actor2.setup(3151, 1, 1); - _actor2.setDetails(3150, 8, -1, 9, 1, (SceneItem *)NULL); + _doorBars.setup(3151, 1, 1); + _doorBars.setDetails(3150, 8, -1, 9, 1, (SceneItem *)NULL); } if (R2_GLOBALS.getFlag(78)) { - _actor1.postInit(); - _actor1.setup(3154, 1, 16); - _actor1.setPosition(Common::Point(104, 129)); - _actor1._effect = 6; - _actor1._shade = 3; - _actor1.setDetails(3150, 24, -1, -1, -1, (SceneItem *)NULL); + _guard.postInit(); + _guard.setup(3154, 1, 16); + _guard.setPosition(Common::Point(104, 129)); + _guard._effect = 6; + _guard._shade = 3; + _guard.setDetails(3150, 24, -1, -1, -1, (SceneItem *)NULL); } - _actor7.postInit(); - _actor7.setup(3154, 5, 1); + _airVent.postInit(); + _airVent.setup(3154, 5, 1); if (R2_GLOBALS.getFlag(80)) - _actor7.setPosition(Common::Point(264, 108)); + _airVent.setPosition(Common::Point(264, 108)); else - _actor7.setPosition(Common::Point(264, 58)); - _actor7.fixPriority(50); - _actor7.setDetails(3150, 17, -1, 19, 1, (SceneItem *)NULL); + _airVent.setPosition(Common::Point(264, 58)); + _airVent.fixPriority(50); + _airVent.setDetails(3150, 17, -1, 19, 1, (SceneItem *)NULL); if (R2_INVENTORY.getObjectScene(R2_PILLOW) == 3150) { - _actor4.postInit(); + _water.postInit(); if (R2_GLOBALS.getFlag(75)) { if (R2_GLOBALS.getFlag(76)) { - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - _actor4.setup(3152, 4, 10); - _actor4.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + _water.setup(3152, 4, 10); + _water.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL); } else { - _actor4.setup(3152, 7, 4); - _actor4.setDetails(3150, 13, -1, -1, 1, (SceneItem *)NULL); + _water.setup(3152, 7, 4); + _water.setDetails(3150, 13, -1, -1, 1, (SceneItem *)NULL); } - _actor4.fixPriority(110); - _actor4.setPosition(Common::Point(83, 88)); - _actor4._effect = 6; - _actor4._shade = 3; + _water.fixPriority(110); + _water.setPosition(Common::Point(83, 88)); + _water._effect = 6; + _water._shade = 3; } else { - _actor4.setup(3152, 7, 3); - _actor4.setPosition(Common::Point(143, 70)); - _actor4.setDetails(3150, 15, -1, -1, 1, (SceneItem *)NULL); + _water.setup(3152, 7, 3); + _water.setPosition(Common::Point(143, 70)); + _water.setDetails(3150, 15, -1, -1, 1, (SceneItem *)NULL); } } if (R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) == 3150) { - _actor3.postInit(); - _actor3.setup(3152, 7, 1); - _actor3.setPosition(Common::Point(73, 83)); + _bulbOrWire.postInit(); + _bulbOrWire.setup(3152, 7, 1); + _bulbOrWire.setPosition(Common::Point(73, 83)); } if (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) { - _actor3.postInit(); - _actor3.setup(3152, 7, 3); - _actor3.setPosition(Common::Point(70, 55)); - _actor3.fixPriority(111); - _actor3._effect = 6; - _actor3._shade = 5; + _bulbOrWire.postInit(); + _bulbOrWire.setup(3152, 7, 3); + _bulbOrWire.setPosition(Common::Point(70, 55)); + _bulbOrWire.fixPriority(111); + _bulbOrWire._effect = 6; + _bulbOrWire._shade = 5; } if (R2_INVENTORY.getObjectScene(R2_FOOD_TRAY) == 3150) { - _actor5.postInit(); + _foodTray.postInit(); if (R2_GLOBALS.getFlag(77)) { - _actor5.setup(3152, 7, 8); - _actor5.setPosition(Common::Point(82, 92)); - _actor5.fixPriority(111); - _actor5._effect = 6; - _actor5._shade = 3; + _foodTray.setup(3152, 7, 8); + _foodTray.setPosition(Common::Point(82, 92)); + _foodTray.fixPriority(111); + _foodTray._effect = 6; + _foodTray._shade = 3; } else { - _actor5.setup(3152, 7, 7); - _actor5.setPosition(Common::Point(155, 79)); + _foodTray.setup(3152, 7, 7); + _foodTray.setPosition(Common::Point(155, 79)); } - _actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + _foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); } - _actor6.postInit(); - _actor6.setup(3152, 7, 6); - _actor6.setPosition(Common::Point(98, 73)); - _actor6.setDetails(3150, 43, -1, -1, 1, (SceneItem *)NULL); - - _item2.setDetails(12, 3150, 10, -1, 12); - _item3.setDetails(Rect(186, 17, 210, 36), 3150, 6, -1, -1, 1, NULL); - _item4.setDetails(Rect(61, 21, 92, 41), 3150, 7, -1, -1, 1, NULL); - _item5.setDetails(Rect(63, 48, 78, 58), 3150, 6, -1, -1, 1, NULL); - _item6.setDetails(Rect(63, 81, 100, 95), 3150, 3, 4, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 200, 320), 3150, 0, 1, 2, 1, NULL); - - switch (R2_GLOBALS._player._oldCharacterScene[3]) { + _toiletFlush.postInit(); + _toiletFlush.setup(3152, 7, 6); + _toiletFlush.setPosition(Common::Point(98, 73)); + _toiletFlush.setDetails(3150, 43, -1, -1, 1, (SceneItem *)NULL); + + _bed.setDetails(12, 3150, 10, -1, 12); + _lightFixture2.setDetails(Rect(186, 17, 210, 36), 3150, 6, -1, -1, 1, NULL); + _bars.setDetails(Rect(61, 21, 92, 41), 3150, 7, -1, -1, 1, NULL); + _lightFixture.setDetails(Rect(63, 48, 78, 58), 3150, 6, -1, -1, 1, NULL); + _toilet.setDetails(Rect(63, 81, 100, 95), 3150, 3, 4, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 200, 320), 3150, 0, 1, 2, 1, NULL); + + switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) { case 0: _sceneMode = 3150; - _actor1.postInit(); - _actor1._effect = 6; - _actor1._shade = 5; - setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_actor1, &_actor2, NULL); + _guard.postInit(); + _guard._effect = 6; + _guard._shade = 5; + setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_guard, &_doorBars, NULL); break; case 1200: _sceneMode = 3162; @@ -678,16 +686,16 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if ((R2_GLOBALS._v56AA0 == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) && (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100)) { ++R2_GLOBALS._v56AA0; _sceneMode = 3156; - _actor1.postInit(); - _actor1._effect = 6; - _actor1._shade = 3; + _guard.postInit(); + _guard._effect = 6; + _guard._shade = 3; - _actor2.postInit(); - _actor5.postInit(); - _actor5._effect = 6; - _actor5._shade = 3; + _doorBars.postInit(); + _foodTray.postInit(); + _foodTray._effect = 6; + _foodTray._shade = 3; - setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor5, NULL); + setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_guard, &_doorBars, &_foodTray, NULL); } else { if (R2_GLOBALS._v56AA0 != 2) ++R2_GLOBALS._v56AA0; @@ -700,7 +708,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { } } - R2_GLOBALS._player._oldCharacterScene[3] = 3150; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; } void Scene3150::signal() { @@ -712,20 +720,20 @@ void Scene3150::signal() { R2_GLOBALS._sceneManager.changeScene(1200); break; case 3151: - _actor1.remove(); + _guard.remove(); R2_INVENTORY.setObjectScene(R2_PILLOW, 3); R2_GLOBALS._player.enableControl(); break; case 3153: R2_GLOBALS.setFlag(76); - _actor4.setDetails(3150, 14, -1, -1, 3, (SceneItem *)NULL); - _actor1.postInit(); - _actor1.setDetails(3150, 24, -1, -1, 2, (SceneItem *)NULL); + _water.setDetails(3150, 14, -1, -1, 3, (SceneItem *)NULL); + _guard.postInit(); + _guard.setDetails(3150, 24, -1, -1, 2, (SceneItem *)NULL); _sceneMode = 3161; - setAction(&_sequenceManager, this, 3161, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3161, &_guard, &_doorBars, NULL); break; case 3154: - _actor3.remove(); + _bulbOrWire.remove(); R2_INVENTORY.setObjectScene(R2_LIGHT_BULB, 3); R2_GLOBALS._player.enableControl(); break; @@ -734,20 +742,20 @@ void Scene3150::signal() { R2_GLOBALS._player.enableControl(); break; case 3156: - _actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + _foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); R2_INVENTORY.setObjectScene(R2_FOOD_TRAY, 3150); R2_GLOBALS._player.enableControl(); break; case 3157: - _actor5.remove(); + _foodTray.remove(); R2_INVENTORY.setObjectScene(R2_FOOD_TRAY, 3); R2_GLOBALS._player.enableControl(); break; case 3158: R2_GLOBALS.setFlag(75); R2_INVENTORY.setObjectScene(R2_PILLOW, 3150); - _actor4.fixPriority(110); - _actor4.setDetails(3150, 13, -1, -1, 2, (SceneItem *)NULL); + _water.fixPriority(110); + _water.setDetails(3150, 13, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._player.enableControl(); break; case 3159: @@ -761,13 +769,13 @@ void Scene3150::signal() { R2_GLOBALS._sceneManager.changeScene(1200); break; case 3161: - R2_GLOBALS._sceneItems.remove(&_actor2); - _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); - _exit1.setDest(Common::Point(70, 125)); - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._sceneItems.remove(&_doorBars); + _doorExit.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _doorExit.setDest(Common::Point(70, 125)); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS.setFlag(78); R2_GLOBALS._player.enableControl(); break; @@ -778,14 +786,14 @@ void Scene3150::signal() { } void Scene3150::dispatch() { - if (_actor5._position.x == 155) { - _actor5._effect = 0; - _actor5._shade = 0; + if (_foodTray._position.x == 155) { + _foodTray._effect = 0; + _foodTray._shade = 0; } - if (_actor1._visage == 3154) { - _actor1._effect = 0; - _actor1._shade = 0; + if (_guard._visage == 3154) { + _guard._effect = 0; + _guard._shade = 0; } Scene::dispatch(); @@ -795,6 +803,7 @@ void Scene3150::dispatch() { * Scene 3175 - Autopsy room * *--------------------------------------------------------------------------*/ + bool Scene3175::Item1::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; @@ -824,7 +833,7 @@ bool Scene3175::Item1::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3175::Actor3::startAction(CursorType action, Event &event) { +bool Scene3175::Corpse::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -853,14 +862,14 @@ bool Scene3175::Actor3::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3175::Actor1::startAction(CursorType action, Event &event) { +bool Scene3175::Door::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; - scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; break; case CURSOR_LOOK: @@ -881,37 +890,37 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { loadScene(3175); SceneExt::postInit(); - _actor1.postInit(); - _actor1.setup(3175, 1, 1); - _actor1.setPosition(Common::Point(35, 72)); - _actor1.setDetails(3175, 9, 10, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3175, 1, 1); + _door.setPosition(Common::Point(35, 72)); + _door.setDetails(3175, 9, 10, -1, 1, (SceneItem *)NULL); _actor2.postInit(); _actor2.setup(3175, 2, 1); _actor2.setPosition(Common::Point(87, 148)); - _actor3.postInit(); - _actor3.setup(3175, 3, 1); - _actor3.setPosition(Common::Point(199, 117)); - _actor3.setDetails(3175, 15, 16, 17, 1, (SceneItem *)NULL); + _corpse.postInit(); + _corpse.setup(3175, 3, 1); + _corpse.setPosition(Common::Point(199, 117)); + _corpse.setDetails(3175, 15, 16, 17, 1, (SceneItem *)NULL); _item2.setDetails(12, 3175, 3, 1, 5); _item3.setDetails(11, 3175, 6, 7, 8); - _item1.setDetails(Rect(0, 0, 320, 200), 3175, 0, 1, 2, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3175, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3250) { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setPosition(Common::Point(126, 77)); R2_GLOBALS._player.enableControl(); } else { _sceneMode = 3175; - setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_door, NULL); } - R2_GLOBALS._player._oldCharacterScene[3] = 3175; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3175; } void Scene3175::signal() { @@ -1032,6 +1041,7 @@ void Scene3230::signal() { * Scene 3240 - Cutscene : Teal monolog * *--------------------------------------------------------------------------*/ + void Scene3240::postInit(SceneObjectList *OwnerList) { loadScene(3240); R2_GLOBALS._uiElements._active = false; @@ -1059,6 +1069,7 @@ void Scene3240::signal() { * Scene 3245 - Cutscene : Discussions with Dr. Tomko * *--------------------------------------------------------------------------*/ + void Scene3245::postInit(SceneObjectList *OwnerList) { loadScene(3245); R2_GLOBALS._uiElements._active = false; @@ -1074,14 +1085,14 @@ void Scene3245::postInit(SceneObjectList *OwnerList) { _actor1.postInit(); _actor2.postInit(); - if (R2_GLOBALS._v56AA1 < 4) - ++R2_GLOBALS._v56AA1; + if (R2_GLOBALS._scientistConvIndex < 4) + ++R2_GLOBALS._scientistConvIndex; - if (R2_GLOBALS._v56AA1 >= 4) { + if (R2_GLOBALS._scientistConvIndex >= 4) { SceneItem::display(1200, 7, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); signal(); } else { - setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._v56AA1, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, &_actor1, &_actor2, NULL); } } @@ -1093,6 +1104,7 @@ void Scene3245::signal() { * Scene 3250 - Room with large stasis field negator * *--------------------------------------------------------------------------*/ + bool Scene3250::Item::startAction(CursorType action, Event &event) { Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; @@ -1122,7 +1134,7 @@ bool Scene3250::Item::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3250::Actor::startAction(CursorType action, Event &event) { +bool Scene3250::Door::startAction(CursorType action, Event &event) { Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1133,15 +1145,15 @@ bool Scene3250::Actor::startAction(CursorType action, Event &event) { switch(_position.x) { case 25: scene->_sceneMode = 3262; - scene->setAction(&scene->_sequenceManager, scene, 3262, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3262, &R2_GLOBALS._player, &scene->_leftDoor, NULL); break; case 259: scene->_sceneMode = 3260; - scene->setAction(&scene->_sequenceManager, scene, 3260, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3260, &R2_GLOBALS._player, &scene->_topDoor, NULL); break; case 302: scene->_sceneMode = 3261; - scene->setAction(&scene->_sequenceManager, scene, 3261, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3261, &R2_GLOBALS._player, &scene->_rightDoor, NULL); break; default: break; @@ -1153,37 +1165,37 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { loadScene(3250); if (R2_GLOBALS._sceneManager._previousScene == -1) { - R2_GLOBALS._player._oldCharacterScene[3] = 1200; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 1200; R2_GLOBALS._player._characterIndex = R2_MIRANDA; } SceneExt::postInit(); - _actor1.postInit(); - _actor1.setup(3250, 6, 1); - _actor1.setPosition(Common::Point(25, 148)); - _actor1.fixPriority(10); - _actor1.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _actor2.postInit(); - _actor2.setup(3250, 4, 1); - _actor2.setPosition(Common::Point(259, 126)); - _actor2.fixPriority(10); - _actor2.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _actor3.postInit(); - _actor3.setup(3250, 5, 1); - _actor3.setPosition(Common::Point(302, 138)); - _actor3.fixPriority(10); - _actor3.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _item3.setDetails(Rect(119, 111, 149, 168), 3250, 6, 7, 2, 1, NULL); - _item2.setDetails(Rect(58, 85, 231, 138), 3250, 12, 7, 2, 1, NULL); - _item4.setDetails(12, 3250, 3, 1, 2); - _item1.setDetails(Rect(0, 0, 320, 200), 3250, 0, 1, 2, 1, NULL); + _leftDoor.postInit(); + _leftDoor.setup(3250, 6, 1); + _leftDoor.setPosition(Common::Point(25, 148)); + _leftDoor.fixPriority(10); + _leftDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _topDoor.postInit(); + _topDoor.setup(3250, 4, 1); + _topDoor.setPosition(Common::Point(259, 126)); + _topDoor.fixPriority(10); + _topDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _rightDoor.postInit(); + _rightDoor.setup(3250, 5, 1); + _rightDoor.setPosition(Common::Point(302, 138)); + _rightDoor.fixPriority(10); + _rightDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _floodLights.setDetails(Rect(119, 111, 149, 168), 3250, 6, 7, 2, 1, NULL); + _tnuctipunShip.setDetails(Rect(58, 85, 231, 138), 3250, 12, 7, 2, 1, NULL); + _negator.setDetails(12, 3250, 3, 1, 2); + _background.setDetails(Rect(0, 0, 320, 200), 3250, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); - switch (R2_GLOBALS._player._oldCharacterScene[3]) { + switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) { case 1200: _sceneMode = 3250; _actor4.postInit(); @@ -1193,25 +1205,26 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { case 3125: if (R2_GLOBALS.getFlag(79)) { _sceneMode = 3254; - _actor5.postInit(); - _actor5._effect = 1; - _actor6.postInit(); - _actor6._effect = 1; - _actor7.postInit(); - _actor7._effect = 1; - setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_actor3, &_actor5, &_actor6, &_actor7, &_actor1, NULL); + _ghoul1.postInit(); + _ghoul1._effect = 1; + _ghoul2.postInit(); + _ghoul2._effect = 1; + _ghoul3.postInit(); + _ghoul3._effect = 1; + setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, + &_ghoul1, &_ghoul2, &_ghoul3, &_leftDoor, NULL); } else { _sceneMode = 3252; - setAction(&_sequenceManager, this, 3252, &R2_GLOBALS._player, &_actor3, NULL); + setAction(&_sequenceManager, this, 3252, &R2_GLOBALS._player, &_rightDoor, NULL); } break; case 3175: _sceneMode = 3251; - setAction(&_sequenceManager, this, 3251, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager, this, 3251, &R2_GLOBALS._player, &_topDoor, NULL); break; case 3255: _sceneMode = 3253; - setAction(&_sequenceManager, this, 3253, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 3253, &R2_GLOBALS._player, &_leftDoor, NULL); break; default: R2_GLOBALS._player.setup(31, 3, 1); @@ -1221,7 +1234,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { break; } - R2_GLOBALS._player._oldCharacterScene[3] = 3250; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3250; } void Scene3250::signal() { @@ -1257,9 +1270,10 @@ void Scene3250::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 3255 - + * Scene 3255 - Guard Post * *--------------------------------------------------------------------------*/ + void Scene3255::postInit(SceneObjectList *OwnerList) { loadScene(3255); SceneExt::postInit(); @@ -1278,30 +1292,31 @@ void Scene3255::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound2.play(268); _sceneMode = 3257; _actor3.postInit(); - _actor4.postInit(); - _actor4._effect = 1; - setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_actor4, &_actor3, NULL); + _quinn.postInit(); + _quinn._effect = 1; + setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_quinn, &_actor3, NULL); } else { - _actor1.postInit(); - _actor1.setup(303, 1, 1); - _actor1.setPosition(Common::Point(208, 128)); - _actor2.postInit(); - _actor2.setup(3107, 3, 1); - _actor2.setPosition(Common::Point(230, 127)); + _teal.postInit(); + _teal.setup(303, 1, 1); + _teal.setPosition(Common::Point(208, 128)); + _guard.postInit(); + _guard.setup(3107, 3, 1); + _guard.setPosition(Common::Point(230, 127)); _sceneMode = 3255; setAction(&_sequenceManager, this, 3255, &R2_GLOBALS._player, NULL); } - R2_GLOBALS._player._oldCharacterScene[3] = 3255; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3255; } void Scene3255::signal() { switch (_sceneMode) { case 10: _sceneMode = 3258; - _actor5.postInit(); - _actor6.postInit(); - _actor7.postInit(); - setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_actor4, &_actor3, &_actor5, &_actor6, &_actor7, NULL); + _ghoul1.postInit(); + _ghoul2.postInit(); + _ghoul3.postInit(); + setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, + &_actor3, &_ghoul1, &_ghoul2, &_ghoul3, NULL); break; case 3256: R2_GLOBALS._sceneManager.changeScene(3250); @@ -1323,40 +1338,40 @@ void Scene3255::signal() { void Scene3255::dispatch() { if (R2_GLOBALS.getFlag(79)) { - if (_actor5._position.y >= 95) { - if (_actor5._position.y <= 110) - _actor5._shade = 6 - (_actor5._position.y - 95) / 3; + if (_ghoul1._position.y >= 95) { + if (_ghoul1._position.y <= 110) + _ghoul1._shade = 6 - (_ghoul1._position.y - 95) / 3; else - _actor5._effect = 1; + _ghoul1._effect = 1; } else { - _actor5._effect = 6; - _actor5._shade = 6; + _ghoul1._effect = 6; + _ghoul1._shade = 6; } - if (_actor6._position.y >= 95) { - if (_actor6._position.y <= 110) - _actor6._shade = 6 - (_actor6._position.y - 95) / 3; + if (_ghoul2._position.y >= 95) { + if (_ghoul2._position.y <= 110) + _ghoul2._shade = 6 - (_ghoul2._position.y - 95) / 3; else - _actor6._effect = 1; + _ghoul2._effect = 1; } else { - _actor6._effect = 6; - _actor6._shade = 6; + _ghoul2._effect = 6; + _ghoul2._shade = 6; } - if (_actor7._position.y >= 95) { - if (_actor7._position.y <= 110) - _actor7._shade = 6 - (_actor7._position.y - 95) / 3; + if (_ghoul3._position.y >= 95) { + if (_ghoul3._position.y <= 110) + _ghoul3._shade = 6 - (_ghoul3._position.y - 95) / 3; else - _actor7._effect = 1; + _ghoul3._effect = 1; } else { - _actor7._effect = 6; - _actor7._shade = 6; + _ghoul3._effect = 6; + _ghoul3._shade = 6; } } if ((R2_GLOBALS._player._position.x > 250) && (R2_GLOBALS._player._shade == 1)) { R2_GLOBALS._player._effect = 6; - _actor4._effect = 6; + _quinn._effect = 6; } Scene::dispatch(); } @@ -1365,7 +1380,8 @@ void Scene3255::dispatch() { * Scene 3260 - Computer room * *--------------------------------------------------------------------------*/ -bool Scene3260::Actor13::startAction(CursorType action, Event &event) { + +bool Scene3260::Door::startAction(CursorType action, Event &event) { Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1373,11 +1389,11 @@ bool Scene3260::Actor13::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3271; - scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_actor13, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_door, NULL); return true; } -bool Scene3260::Actor14::startAction(CursorType action, Event &event) { +bool Scene3260::Toolbox::startAction(CursorType action, Event &event) { Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1385,7 +1401,7 @@ bool Scene3260::Actor14::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3272; - scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_actor14, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_toolbox, NULL); return true; } @@ -1402,53 +1418,53 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); R2_GLOBALS._sound1.play(285); - _actor13.postInit(); - _actor13.setup(3260, 6, 1); - _actor13.setPosition(Common::Point(40, 106)); - _actor13.setDetails(3260, 18, 1, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3260, 6, 1); + _door.setPosition(Common::Point(40, 106)); + _door.setDetails(3260, 18, 1, -1, 1, (SceneItem *)NULL); if (R2_INVENTORY.getObjectScene(R2_TOOLBOX) == 3260) { - _actor14.postInit(); - _actor14.setup(3260, 7, 1); - _actor14.setPosition(Common::Point(202, 66)); - _actor14.setDetails(3260, 12, 1, -1, 1, (SceneItem *)NULL); + _toolbox.postInit(); + _toolbox.setup(3260, 7, 1); + _toolbox.setPosition(Common::Point(202, 66)); + _toolbox.setDetails(3260, 12, 1, -1, 1, (SceneItem *)NULL); } - _actor1.postInit(); - _actor1.setup(3260, 1, 1); - _actor1.setPosition(Common::Point(93, 73)); - _actor1.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor1.setAction(&_action1, &_actor1); - - _actor2.postInit(); - _actor2.setup(3260, 2, 1); - _actor2.setPosition(Common::Point(142, 63)); - _actor2.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor2.setAction(&_action2, &_actor2); - - _actor3.postInit(); - _actor3.setup(3260, 2, 1); - _actor3.setPosition(Common::Point(166, 54)); - _actor3.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor3.setAction(&_action3, &_actor3); - - _actor4.postInit(); - _actor4.setup(3260, 2, 1); - _actor4.setPosition(Common::Point(190, 46)); - _actor4.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor4.setAction(&_action4, &_actor4); - - _actor5.postInit(); - _actor5.setup(3260, 2, 1); - _actor5.setPosition(Common::Point(142, 39)); - _actor5.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor5.setAction(&_action5, &_actor5); - - _actor6.postInit(); - _actor6.setup(3260, 2, 1); - _actor6.setPosition(Common::Point(166, 30)); - _actor6.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor6.setAction(&_action6, &_actor6); + _sceeen1.postInit(); + _sceeen1.setup(3260, 1, 1); + _sceeen1.setPosition(Common::Point(93, 73)); + _sceeen1.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _sceeen1.setAction(&_action1, &_sceeen1); + + _screen2.postInit(); + _screen2.setup(3260, 2, 1); + _screen2.setPosition(Common::Point(142, 63)); + _screen2.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen2.setAction(&_action2, &_screen2); + + _screen3.postInit(); + _screen3.setup(3260, 2, 1); + _screen3.setPosition(Common::Point(166, 54)); + _screen3.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen3.setAction(&_action3, &_screen3); + + _screen4.postInit(); + _screen4.setup(3260, 2, 1); + _screen4.setPosition(Common::Point(190, 46)); + _screen4.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen4.setAction(&_action4, &_screen4); + + _screen5.postInit(); + _screen5.setup(3260, 2, 1); + _screen5.setPosition(Common::Point(142, 39)); + _screen5.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen5.setAction(&_action5, &_screen5); + + _screen6.postInit(); + _screen6.setup(3260, 2, 1); + _screen6.setPosition(Common::Point(166, 30)); + _screen6.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen6.setAction(&_action6, &_screen6); _actor7.postInit(); _actor7.setup(3260, 2, 1); @@ -1468,37 +1484,37 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { _actor9.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); _actor9.setAction(&_action9, &_actor9); - _actor10.postInit(); - _actor10.setup(3260, 3, 1); - _actor10.setPosition(Common::Point(265, 163)); - _actor10.fixPriority(180); - _actor10._numFrames = 10; - _actor10.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); - _actor10.animate(ANIM_MODE_2, NULL); - - _actor11.postInit(); - _actor11.setup(3260, 4, 1); - _actor11.setPosition(Common::Point(127, 108)); - _actor11.fixPriority(120); - _actor11.setAction(&_action11, &_actor11); - _actor11._numFrames = 15; - _actor11.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); - _actor11.animate(ANIM_MODE_2, NULL); - - _actor12.postInit(); - _actor12.setup(3260, 5, 1); - _actor12.setPosition(Common::Point(274, 65)); - _actor12.setAction(&_action12, &_actor12); - _actor12._numFrames = 5; - _actor12.setDetails(3260, 9, 1, 11, 1, (SceneItem *)NULL); - _actor12.animate(ANIM_MODE_2, NULL); + _securityConsole.postInit(); + _securityConsole.setup(3260, 3, 1); + _securityConsole.setPosition(Common::Point(265, 163)); + _securityConsole.fixPriority(180); + _securityConsole._numFrames = 10; + _securityConsole.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); + _securityConsole.animate(ANIM_MODE_2, NULL); + + _computerConsole.postInit(); + _computerConsole.setup(3260, 4, 1); + _computerConsole.setPosition(Common::Point(127, 108)); + _computerConsole.fixPriority(120); + _computerConsole.setAction(&_action11, &_computerConsole); + _computerConsole._numFrames = 15; + _computerConsole.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); + _computerConsole.animate(ANIM_MODE_2, NULL); + + _lightingConsole.postInit(); + _lightingConsole.setup(3260, 5, 1); + _lightingConsole.setPosition(Common::Point(274, 65)); + _lightingConsole.setAction(&_action12, &_lightingConsole); + _lightingConsole._numFrames = 5; + _lightingConsole.setDetails(3260, 9, 1, 11, 1, (SceneItem *)NULL); + _lightingConsole.animate(ANIM_MODE_2, NULL); _item1.setDetails(Rect(0, 0, 320, 200), 3260, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3275) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3275) { _sceneMode = 3270; - setAction(&_sequenceManager, this, 3270, &R2_GLOBALS._player, &_actor13, NULL); + setAction(&_sequenceManager, this, 3270, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1506,7 +1522,7 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3260; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3260; } void Scene3260::remove() { @@ -1521,15 +1537,15 @@ void Scene3260::signal() { break; case 3272: _sceneMode = 3273; - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); SceneItem::display(3260, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_TOOLBOX, 3); R2_INVENTORY.setObjectScene(R2_LASER_HACKSAW, 3); - setAction(&_sequenceManager, this, 3273, &R2_GLOBALS._player, &_actor14, NULL); + setAction(&_sequenceManager, this, 3273, &R2_GLOBALS._player, &_toolbox, NULL); break; case 3273: - _actor4.remove(); + _screen4.remove(); R2_GLOBALS._player.enableControl(); break; default: @@ -1542,7 +1558,8 @@ void Scene3260::signal() { * Scene 3275 - Hall * *--------------------------------------------------------------------------*/ -bool Scene3275::Actor2::startAction(CursorType action, Event &event) { + +bool Scene3275::Door::startAction(CursorType action, Event &event) { Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1550,11 +1567,11 @@ bool Scene3275::Actor2::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3275; - scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_door, NULL); return true; } -void Scene3275::Exit1::changeScene() { +void Scene3275::CellExit::changeScene() { Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; scene->_sceneMode = 0; @@ -1573,33 +1590,31 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sceneManager._previousScene = 3260; if (R2_GLOBALS._sceneManager._previousScene == 3150) - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); - else - g_globals->gfxManager()._bounds.moveTo(Common::Point(0, 0)); + _sceneBounds = Rect(160, 0, 480, 200); SceneExt::postInit(); - _exit1.setDetails(Rect(398, 60, 439, 118), SHADECURSOR_UP, 3150); - _exit1.setDest(Common::Point(418, 128)); + _cellExit.setDetails(Rect(398, 60, 439, 118), SHADECURSOR_UP, 3150); + _cellExit.setDest(Common::Point(418, 128)); _actor1.postInit(); _actor1.setup(3275, 1, 7); _actor1.setPosition(Common::Point(419, 119)); - _actor2.postInit(); - _actor2.setup(3275, 2, 1); - _actor2.setPosition(Common::Point(56, 118)); - _actor2.setDetails(3275, 3, 4, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3275, 2, 1); + _door.setPosition(Common::Point(56, 118)); + _door.setDetails(3275, 3, 4, -1, 1, (SceneItem *)NULL); - _item2.setDetails(Rect(153, 58, 200, 120), 3275, 6, 7, 8, 1, NULL); - _item3.setDetails(Rect(275, 58, 331, 120), 3275, 6, 7, 8, 1, NULL); - _item4.setDetails(Rect(0, 66, 22, 127), 3275, 9, 10, 11, 1, NULL); - _item5.setDetails(Rect(457, 66, 480, 127), 3275, 9, 10, 11, 1, NULL); - _item1.setDetails(Rect(0, 0, 480, 200), 3275, 0, 1, 2, 1, NULL); + _emptyCell1.setDetails(Rect(153, 58, 200, 120), 3275, 6, 7, 8, 1, NULL); + _emptyCell2.setDetails(Rect(275, 58, 331, 120), 3275, 6, 7, 8, 1, NULL); + _securityBeams1.setDetails(Rect(0, 66, 22, 127), 3275, 9, 10, 11, 1, NULL); + _securityBeams2.setDetails(Rect(457, 66, 480, 127), 3275, 9, 10, 11, 1, NULL); + _background.setDetails(Rect(0, 0, 480, 200), 3275, 0, 1, 2, 1, NULL); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3150) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3150) { _sceneMode = 11; R2_GLOBALS._player.setup(30, 3, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1608,9 +1623,9 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { Common::Point pt(418, 128); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); - } else if (R2_GLOBALS._player._oldCharacterScene[3] == 3260) { + } else if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3260) { _sceneMode = 3276; - setAction(&_sequenceManager, this, 3276, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager, this, 3276, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 3, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1618,7 +1633,7 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3275; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3275; } void Scene3275::signal() { @@ -1639,10 +1654,12 @@ void Scene3275::signal() { * Scene 3350 - Cutscene - Ship landing * *--------------------------------------------------------------------------*/ + void Scene3350::postInit(SceneObjectList *OwnerList) { loadScene(3350); - R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._sound2.play(310); _rotation = R2_GLOBALS._scenePalette.addRotation(176, 203, 1); @@ -1699,14 +1716,9 @@ void Scene3350::signal() { } /*-------------------------------------------------------------------------- - * Scene 3375 - + * Scene 3375 - Circular Walkway * *--------------------------------------------------------------------------*/ -Scene3375::Scene3375() { - _field1488 = _field1492 = 0; - for (int i = 0; i < 4; ++i) - _field148A[i] = 0; -} void Scene3375::synchronize(Serializer &s) { SceneExt::synchronize(s); @@ -1714,94 +1726,94 @@ void Scene3375::synchronize(Serializer &s) { s.syncAsSint16LE(_field1488); s.syncAsSint16LE(_field1492); for (int i = 0; i < 4; ++i) - s.syncAsSint16LE(_field148A[i]); + s.syncAsSint16LE(_sceneAreas[i]); } -void Scene3375::subFC696(int sceneMode) { +void Scene3375::enterArea(int sceneMode) { switch (sceneMode) { case 3379: R2_GLOBALS._player.setPosition(Common::Point(0, 155)); - _actor1.setPosition(Common::Point(-20, 163)); - _actor2.setPosition(Common::Point(-5, 150)); - _actor3.setPosition(Common::Point(-20, 152)); + _companion1.setPosition(Common::Point(-20, 163)); + _companion2.setPosition(Common::Point(-5, 150)); + _webbster.setPosition(Common::Point(-20, 152)); break; case 3380: - ++R2_GLOBALS._v56A9E; - if (R2_GLOBALS._v56A9E >= 4) - R2_GLOBALS._v56A9E = 0; + ++R2_GLOBALS._walkwaySceneNumber; + if (R2_GLOBALS._walkwaySceneNumber >= 4) + R2_GLOBALS._walkwaySceneNumber = 0; - loadScene(_field148A[R2_GLOBALS._v56A9E]); + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); R2_GLOBALS._uiElements.show(); R2_GLOBALS._player.setStrip(4); R2_GLOBALS._player.setPosition(Common::Point(148, 230)); - _actor1.setPosition(Common::Point(191, 274)); - _actor1._effect = 1; - _actor2.setPosition(Common::Point(124, 255)); - _actor2._effect = 1; - _actor3.setPosition(Common::Point(155, 245)); - _actor3._effect = 1; + _companion1.setPosition(Common::Point(191, 274)); + _companion1._effect = 1; + _companion2.setPosition(Common::Point(124, 255)); + _companion2._effect = 1; + _webbster.setPosition(Common::Point(155, 245)); + _webbster._effect = 1; break; case 3381: - --R2_GLOBALS._v56A9E; - if (R2_GLOBALS._v56A9E < 0) - R2_GLOBALS._v56A9E = 3; + --R2_GLOBALS._walkwaySceneNumber; + if (R2_GLOBALS._walkwaySceneNumber < 0) + R2_GLOBALS._walkwaySceneNumber = 3; - loadScene(_field148A[R2_GLOBALS._v56A9E]); + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); R2_GLOBALS._uiElements.show(); R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.setPosition(Common::Point(201, 131)); - _actor1.setPosition(Common::Point(231, 127)); - _actor1._effect = 1; - _actor2.setPosition(Common::Point(231, 127)); - _actor2._effect = 1; - _actor3.setPosition(Common::Point(231, 127)); - _actor3._effect = 1; + _companion1.setPosition(Common::Point(231, 127)); + _companion1._effect = 1; + _companion2.setPosition(Common::Point(231, 127)); + _companion2._effect = 1; + _webbster.setPosition(Common::Point(231, 127)); + _webbster._effect = 1; break; default: R2_GLOBALS._player.setPosition(Common::Point(192, 155)); - _actor1.setPosition(Common::Point(138, 134)); - _actor2.setPosition(Common::Point(110, 139)); - _actor3.setPosition(Common::Point(125, 142)); + _companion1.setPosition(Common::Point(138, 134)); + _companion2.setPosition(Common::Point(110, 139)); + _webbster.setPosition(Common::Point(125, 142)); break; } - if (R2_GLOBALS._v56A9E == 2) { - R2_GLOBALS._sceneItems.remove(&_actor4); + if (R2_GLOBALS._walkwaySceneNumber == 2) { + R2_GLOBALS._sceneItems.remove(&_door); for (int i = 0; i <= 12; i++) R2_GLOBALS._sceneItems.remove(&_itemArray[i]); - R2_GLOBALS._sceneItems.remove(&_item1); + R2_GLOBALS._sceneItems.remove(&_background); - _actor4.show(); - _actor4.setDetails(3375, 9, 10, -1, 1, (SceneItem *)NULL); + _door.show(); + _door.setDetails(3375, 9, 10, -1, 1, (SceneItem *)NULL); for (int i = 0; i <= 12; i++) _itemArray[i].setDetails(3375, 3, -1, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, -1, 1, NULL); } else { - _actor4.hide(); - R2_GLOBALS._sceneItems.remove(&_actor4); + _door.hide(); + R2_GLOBALS._sceneItems.remove(&_door); } if (_sceneMode == 0) signal(); else - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } -bool Scene3375::Actor1::startAction(CursorType action, Event &event) { +bool Scene3375::Companion2::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -1809,14 +1821,14 @@ bool Scene3375::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor2::startAction(CursorType action, Event &event) { +bool Scene3375::Companion1::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -1824,7 +1836,7 @@ bool Scene3375::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor3::startAction(CursorType action, Event &event) { +bool Scene3375::Webbster::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -1836,57 +1848,58 @@ bool Scene3375::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor4::startAction(CursorType action, Event &event) { +bool Scene3375::Door::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + if (R2_GLOBALS._walkwaySceneNumber != 0) { + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } - R2_GLOBALS._walkRegions.disableRegion(6); - R2_GLOBALS._walkRegions.disableRegion(7); - R2_GLOBALS._walkRegions.disableRegion(8); + R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(8); R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3375; - scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; } -void Scene3375::Exit1::changeScene() { +void Scene3375::LeftExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3376; - if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + if (R2_GLOBALS._walkwaySceneNumber != 0) { + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } - if (scene->_actor1._position.y != 163) { - R2_GLOBALS._player.setStrip(-1); - scene->_actor1.setStrip2(-1); - scene->_actor2.setStrip2(-1); - scene->_actor3.setStrip2(-1); - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + if (scene->_companion1._position.y != 163) { + R2_GLOBALS._player.setStrip2(-1); + scene->_companion1.setStrip2(-1); + scene->_companion2.setStrip2(-1); + scene->_webbster.setStrip2(-1); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } else { R2_GLOBALS._player.setStrip2(2); - scene->_actor1.setStrip2(2); - scene->_actor2.setStrip2(2); - scene->_actor3.setStrip2(2); + scene->_companion1.setStrip2(2); + scene->_companion2.setStrip2(2); + scene->_webbster.setStrip2(2); R2_GLOBALS._sound2.play(314); Common::Point pt(50, 150); @@ -1895,7 +1908,7 @@ void Scene3375::Exit1::changeScene() { } } -void Scene3375::Exit2::changeScene() { +void Scene3375::DownExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -1906,18 +1919,18 @@ void Scene3375::Exit2::changeScene() { scene->_sceneMode = 3377; scene->_field1488 = 3381; - if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + if (R2_GLOBALS._walkwaySceneNumber != 0) { + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } -void Scene3375::Exit3::changeScene() { +void Scene3375::RightExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -1928,24 +1941,28 @@ void Scene3375::Exit3::changeScene() { scene->_sceneMode = 3378; scene->_field1488 = 3380; - if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + if (R2_GLOBALS._walkwaySceneNumber != 0) { + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } -void Scene3375::postInit(SceneObjectList *OwnerList) { - _field148A[0] = 3376; - _field148A[1] = 3377; - _field148A[2] = 3375; - _field148A[3] = 3378; +Scene3375::Scene3375() { + _field1488 = _field1492 = 0; + + _sceneAreas[0] = 3376; + _sceneAreas[1] = 3377; + _sceneAreas[2] = 3375; + _sceneAreas[3] = 3378; +} - loadScene(_field148A[R2_GLOBALS._v56A9E]); +void Scene3375::postInit(SceneObjectList *OwnerList) { + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); SceneExt::postInit(); R2_GLOBALS._sound1.play(313); @@ -1959,12 +1976,12 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3375; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3375; - R2_GLOBALS._player._characterScene[3] = 3375; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3375; setZoomPercents(126, 55, 200, 167); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); } else { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); @@ -1972,13 +1989,13 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.changeZoom(-1); switch (R2_GLOBALS._player._characterIndex) { - case 2: + case R2_SEEKER: if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._player.setup(20, 1, 1); else R2_GLOBALS._player.setup(20, 3, 1); break; - case 3: + case R2_MIRANDA: if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._player.setup(30, 1, 1); else @@ -1995,16 +2012,16 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; + _companion1.changeZoom(-1); + _companion1._effect = 1; int tmpStrip, tmpVisage; if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -2012,72 +2029,72 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else tmpStrip = 4; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) tmpVisage = 10; else tmpVisage = 20; - _actor1.setup(tmpVisage, tmpStrip, 1); - _actor1.animate(ANIM_MODE_1, NULL); + _companion1.setup(tmpVisage, tmpStrip, 1); + _companion1.animate(ANIM_MODE_1, NULL); - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else tmpStrip = 8; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) tmpVisage = 10; else tmpVisage = 30; - _actor2.setup(tmpVisage, tmpStrip, 1); - _actor2.animate(ANIM_MODE_1, NULL); + _companion2.setup(tmpVisage, tmpStrip, 1); + _companion2.animate(ANIM_MODE_1, NULL); - _actor3.postInit(); - _actor3._moveRate = 7; - _actor3._moveDiff = Common::Point(5, 3); - _actor3.changeZoom(-1); - _actor3._effect = 1; + _webbster.postInit(); + _webbster._moveRate = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.changeZoom(-1); + _webbster._effect = 1; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else tmpStrip = 4; - _actor3.setup(40, tmpStrip, 1); - _actor3.animate(ANIM_MODE_1, NULL); + _webbster.setup(40, tmpStrip, 1); + _webbster.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); - _actor3.setDetails(3375, 21, -1, -1, 1, (SceneItem *)NULL); - _actor1.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); + _companion2.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); + _webbster.setDetails(3375, 21, -1, -1, 1, (SceneItem *)NULL); + _companion1.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); - _actor4.postInit(); - _actor4.setup(3375, 1, 1); - _actor4.setPosition(Common::Point(254, 166)); - _actor4.fixPriority(140); - _actor4.hide(); + _door.postInit(); + _door.setup(3375, 1, 1); + _door.setPosition(Common::Point(254, 166)); + _door.fixPriority(140); + _door.hide(); - _exit1.setDetails(Rect(0, 84, 24, 167), EXITCURSOR_W, 3375); - _exit1.setDest(Common::Point(65, 155)); - _exit2.setDetails(Rect(103, 152, 183, 170), SHADECURSOR_DOWN, 3375); - _exit2.setDest(Common::Point(158, 151)); - _exit3.setDetails(Rect(180, 75, 213, 132), EXITCURSOR_E, 3375); - _exit3.setDest(Common::Point(201, 131)); + _leftExit.setDetails(Rect(0, 84, 24, 167), EXITCURSOR_W, 3375); + _leftExit.setDest(Common::Point(65, 155)); + _downExit.setDetails(Rect(103, 152, 183, 170), SHADECURSOR_DOWN, 3375); + _downExit.setDest(Common::Point(158, 151)); + _rightExit.setDetails(Rect(180, 75, 213, 132), EXITCURSOR_E, 3375); + _rightExit.setDest(Common::Point(201, 131)); for (int i = 0; i <= 12; ++i) _itemArray[i].setDetails(i, 3375, 3, -1, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, 1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, 1, 1, NULL); if (R2_GLOBALS._sceneManager._previousScene == 3385) _sceneMode = 3379; else _sceneMode = 0; - subFC696(_sceneMode); + enterArea(_sceneMode); } void Scene3375::remove() { @@ -2086,44 +2103,61 @@ void Scene3375::remove() { } void Scene3375::signalCase3379() { - switch (R2_GLOBALS._v56A9E) { + switch (R2_GLOBALS._walkwaySceneNumber) { case 0: - _exit1._enabled = true; - if (R2_GLOBALS._sceneManager._previousScene == 3385) - R2_GLOBALS._walkRegions.enableRegion(1); - else { - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + _leftExit._enabled = true; + if (R2_GLOBALS._sceneManager._previousScene == 3385) { + // WORKAROUND: The original disables the left entry region here for + // some reason. But there's also some walk issue even I leave it enabled. + // Instead, for now, add an extra walk into the properly enabled regions + _sceneMode = 1; + ADD_MOVER(R2_GLOBALS._player, 70, R2_GLOBALS._player._position.y); + R2_GLOBALS._sceneManager._previousScene = 3375; + R2_GLOBALS._player._effect = 1; + _companion1._effect = 1; + _companion2._effect = 1; + _webbster._effect = 1; + + return; + //R2_GLOBALS._walkRegions.disableRegion(1); + } else { + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); } - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + break; case 2: - _exit1._enabled = false; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(8); - R2_GLOBALS._walkRegions.enableRegion(9); + _leftExit._enabled = false; + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(9); + break; default: - _exit1._enabled = false; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + _leftExit._enabled = false; + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); break; } R2_GLOBALS._sceneManager._previousScene = 3375; R2_GLOBALS._player._effect = 1; - _actor1._effect = 1; - _actor2._effect = 1; - _actor3._effect = 1; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + _companion1._effect = 1; + _companion2._effect = 1; + _webbster._effect = 1; + R2_GLOBALS._player.enableControl(CURSOR_WALK); } void Scene3375::signal() { switch (_sceneMode) { + case 1: + R2_GLOBALS._player.enableControl(); + break; case 3375: R2_GLOBALS._sceneManager.changeScene(3400); break; @@ -2135,27 +2169,27 @@ void Scene3375::signal() { case 3378: _sceneMode = _field1488; _field1488 = 0; - _actor1._effect = 6; - _actor1._shade = 4; - _actor2._effect = 6; - _actor2._shade = 4; - _actor3._effect = 6; - _actor3._shade = 4; - subFC696(_sceneMode); + _companion1._effect = 6; + _companion1._shade = 4; + _companion2._effect = 6; + _companion2._shade = 4; + _webbster._effect = 6; + _webbster._shade = 4; + enterArea(_sceneMode); break; case 3379: signalCase3379(); break; case 9999: - if (_actor1._position.y == 163) + if (_companion1._position.y == 163) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(3); R2_GLOBALS._player.enableControl(CURSOR_TALK); default: - _actor1.setPriority(130); - _actor2.setPriority(132); - _actor3.setPriority(134); + _companion1.setPriority(130); + _companion2.setPriority(132); + _webbster.setPriority(134); signalCase3379(); break; } @@ -2167,28 +2201,29 @@ void Scene3375::dispatch() { else if ((R2_GLOBALS._player._position.y < 168) && (R2_GLOBALS._player._effect == 6)) R2_GLOBALS._player._effect = 1; - if ((_actor1._position.y >= 168) && (_actor1._effect == 1)) - _actor1._effect = 6; - else if ((_actor1._position.y < 168) && (_actor1._effect == 6)) - _actor1._effect = 1; + if ((_companion1._position.y >= 168) && (_companion1._effect == 1)) + _companion1._effect = 6; + else if ((_companion1._position.y < 168) && (_companion1._effect == 6)) + _companion1._effect = 1; - if ((_actor2._position.y >= 168) && (_actor2._effect == 1)) - _actor2._effect = 6; - else if ((_actor2._position.y < 168) && (_actor2._effect == 6)) - _actor2._effect = 1; + if ((_companion2._position.y >= 168) && (_companion2._effect == 1)) + _companion2._effect = 6; + else if ((_companion2._position.y < 168) && (_companion2._effect == 6)) + _companion2._effect = 1; - if ((_actor3._position.y >= 168) && (_actor3._effect == 1)) - _actor3._effect = 6; - else if ((_actor3._position.y < 168) && (_actor3._effect == 6)) - _actor3._effect = 1; + if ((_webbster._position.y >= 168) && (_webbster._effect == 1)) + _webbster._effect = 6; + else if ((_webbster._position.y < 168) && (_webbster._effect == 6)) + _webbster._effect = 1; Scene::dispatch(); } /*-------------------------------------------------------------------------- - * Scene 3385 - + * Scene 3385 - Corridor * *--------------------------------------------------------------------------*/ + Scene3385::Scene3385() { _field11B2 = 0; } @@ -2199,14 +2234,14 @@ void Scene3385::synchronize(Serializer &s) { s.syncAsSint16LE(_field11B2); } -bool Scene3385::Actor1::startAction(CursorType action, Event &event) { +bool Scene3385::Companion1::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -2214,14 +2249,14 @@ bool Scene3385::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor2::startAction(CursorType action, Event &event) { +bool Scene3385::Companion2::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -2229,7 +2264,7 @@ bool Scene3385::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor3::startAction(CursorType action, Event &event) { +bool Scene3385::Webbster::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2241,7 +2276,7 @@ bool Scene3385::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor4::startAction(CursorType action, Event &event) { +bool Scene3385::Door::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2252,7 +2287,9 @@ bool Scene3385::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3386; - scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + NULL); return true; } @@ -2264,7 +2301,9 @@ void Scene3385::Exit1::changeScene() { scene->_sceneMode = 3387; if (R2_GLOBALS._sceneManager._previousScene == 3375) - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, + &scene->_webbster, NULL); else scene->signal(); } @@ -2294,7 +2333,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3385; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3385; - R2_GLOBALS._player._characterScene[3] = 3385; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3385; if (R2_GLOBALS._sceneManager._previousScene == 3375) _field11B2 = 3; @@ -2304,16 +2343,16 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { setZoomPercents(102, 40, 200, 160); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, _field11B2, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, _field11B2, 1); else R2_GLOBALS._player.setup(10, _field11B2, 1); @@ -2321,74 +2360,74 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; - if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, _field11B2, 1); + _companion1.changeZoom(-1); + _companion1._effect = 1; + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _companion1.setup(10, _field11B2, 1); else - _actor1.setup(20, _field11B2, 1); - _actor1.animate(ANIM_MODE_1, NULL); - _actor1.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; - if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, _field11B2, 1); + _companion1.setup(20, _field11B2, 1); + _companion1.animate(ANIM_MODE_1, NULL); + _companion1.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); + + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) + _companion2.setup(10, _field11B2, 1); else - _actor2.setup(30, _field11B2, 1); - _actor2.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setup(40, _field11B2, 1); - _actor3.animate(ANIM_MODE_1, NULL); - _actor3.setDetails(3385, 15, -1, -1, 1, (SceneItem *) NULL); + _companion2.setup(30, _field11B2, 1); + _companion2.animate(ANIM_MODE_1, NULL); + _companion2.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); + + _webbster.postInit(); + _webbster._moveDiff = Common::Point(3, 2); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setup(40, _field11B2, 1); + _webbster.animate(ANIM_MODE_1, NULL); + _webbster.setDetails(3385, 15, -1, -1, 1, (SceneItem *) NULL); _exit1.setDetails(Rect(103, 152, 217, 170), SHADECURSOR_DOWN, 3395); _exit1.setDest(Common::Point(158, 151)); - _actor4.postInit(); - _actor4.setPosition(Common::Point(160, 100)); - _actor4.fixPriority(90); - _actor4.setDetails(3385, 3, 4, -1, 1, (SceneItem *) NULL); + _door.postInit(); + _door.setPosition(Common::Point(160, 100)); + _door.fixPriority(90); + _door.setDetails(3385, 3, 4, -1, 1, (SceneItem *) NULL); if (R2_GLOBALS._sceneManager._previousScene == 3375) { R2_GLOBALS._player.setPosition(Common::Point(158, 102)); - _actor1.setPosition(Common::Point(164, 100)); - _actor1.fixPriority(98); - _actor2.setPosition(Common::Point(150, 100)); - _actor2.fixPriority(97); - _actor3.setPosition(Common::Point(158, 100)); - _actor3.fixPriority(96); + _companion1.setPosition(Common::Point(164, 100)); + _companion1.fixPriority(98); + _companion2.setPosition(Common::Point(150, 100)); + _companion2.fixPriority(97); + _webbster.setPosition(Common::Point(158, 100)); + _webbster.fixPriority(96); _sceneMode = 3384; - _actor4.setup(3385, 1, 6); - _actor4.animate(ANIM_MODE_6, this); - setAction(&_action1, &_actor4); + _door.setup(3385, 1, 6); + _door.animate(ANIM_MODE_6, this); + setAction(&_action1, &_door); } else { R2_GLOBALS._player.setPosition(Common::Point(158, 230)); - _actor1.setPosition(Common::Point(191, 270)); - _actor2.setPosition(Common::Point(124, 255)); - _actor3.setPosition(Common::Point(155, 245)); - _actor4.setup(3385, 1, 1); + _companion1.setPosition(Common::Point(191, 270)); + _companion2.setPosition(Common::Point(124, 255)); + _webbster.setPosition(Common::Point(155, 245)); + _door.setup(3385, 1, 1); _sceneMode = 3385; - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } - _item1.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL); - R2_GLOBALS._v56A9E = 0; + _background.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL); + R2_GLOBALS._walkwaySceneNumber = 0; } void Scene3385::remove() { @@ -2412,15 +2451,16 @@ void Scene3385::signal() { R2_GLOBALS._player.enableControl(CURSOR_TALK); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } /*-------------------------------------------------------------------------- - * Scene 3395 - + * Scene 3395 - Walkway * *--------------------------------------------------------------------------*/ + Scene3395::Scene3395() { _field142E = 0; } @@ -2431,14 +2471,14 @@ void Scene3395::synchronize(Serializer &s) { s.syncAsSint16LE(_field142E); } -bool Scene3395::Actor1::startAction(CursorType action, Event &event) { +bool Scene3395::Companion1::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -2446,14 +2486,14 @@ bool Scene3395::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor2::startAction(CursorType action, Event &event) { +bool Scene3395::Companion2::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -2461,7 +2501,7 @@ bool Scene3395::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor3::startAction(CursorType action, Event &event) { +bool Scene3395::Webbster::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2473,7 +2513,7 @@ bool Scene3395::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor4::startAction(CursorType action, Event &event) { +bool Scene3395::Door::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2484,7 +2524,9 @@ bool Scene3395::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3396; - scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + NULL); return true; } @@ -2514,7 +2556,7 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3395; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3395; - R2_GLOBALS._player._characterScene[3] = 3395; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3395; if (R2_GLOBALS._sceneManager._previousScene == 3385) _field142E = 3; @@ -2524,16 +2566,16 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { setZoomPercents(51, 40, 200, 137); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, _field142E, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, _field142E, 1); else R2_GLOBALS._player.setup(10, _field142E, 1); @@ -2541,77 +2583,77 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; - if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, _field142E, 1); + _companion1.changeZoom(-1); + _companion1._effect = 1; + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _companion1.setup(10, _field142E, 1); else - _actor1.setup(20, _field142E, 1); - _actor1.animate(ANIM_MODE_1, NULL); - _actor1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; - if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, _field142E, 1); + _companion1.setup(20, _field142E, 1); + _companion1.animate(ANIM_MODE_1, NULL); + _companion1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) + _companion2.setup(10, _field142E, 1); else - _actor2.setup(30, _field142E, 1); - _actor2.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setup(40, _field142E, 1); - _actor3.animate(ANIM_MODE_1, NULL); - _actor3.setDetails(3385, 18, -1, -1, 1, (SceneItem *) NULL); - - _actor4.postInit(); - _actor4.setPosition(Common::Point(159, 50)); - _actor4.fixPriority(40); - _actor4.setDetails(3395, 6, 7, -1, 1, (SceneItem *) NULL); + _companion2.setup(30, _field142E, 1); + _companion2.animate(ANIM_MODE_1, NULL); + _companion2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _webbster.postInit(); + _webbster._moveDiff = Common::Point(3, 2); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setup(40, _field142E, 1); + _webbster.animate(ANIM_MODE_1, NULL); + _webbster.setDetails(3395, 18, -1, -1, 1, (SceneItem *) NULL); + + _door.postInit(); + _door.setPosition(Common::Point(159, 50)); + _door.fixPriority(40); + _door.setDetails(3395, 6, 7, -1, 1, (SceneItem *) NULL); if (R2_GLOBALS._sceneManager._previousScene == 3385) { R2_GLOBALS._player.setPosition(Common::Point(158, 53)); - _actor1.setPosition(Common::Point(164, 51)); - _actor1.fixPriority(48); - _actor2.setPosition(Common::Point(150, 51)); - _actor2.fixPriority(47); - _actor3.setPosition(Common::Point(158, 51)); - _actor3.fixPriority(46); + _companion1.setPosition(Common::Point(164, 51)); + _companion1.fixPriority(48); + _companion2.setPosition(Common::Point(150, 51)); + _companion2.fixPriority(47); + _webbster.setPosition(Common::Point(158, 51)); + _webbster.fixPriority(46); _sceneMode = 3394; - _actor4.setup(3395, 1, 7); - _actor4.animate(ANIM_MODE_6, this); - setAction(&_action1, &_actor4); + _door.setup(3395, 1, 7); + _door.animate(ANIM_MODE_6, this); + setAction(&_action1, &_door); } else { R2_GLOBALS._player.setPosition(Common::Point(158, 200)); - _actor1.setPosition(Common::Point(191, 255)); - _actor2.setPosition(Common::Point(124, 240)); - _actor3.setPosition(Common::Point(155, 242)); - _actor4.setup(3395, 1, 1); + _companion1.setPosition(Common::Point(191, 255)); + _companion2.setPosition(Common::Point(124, 240)); + _webbster.setPosition(Common::Point(155, 242)); + _door.setup(3395, 1, 1); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _sceneMode = 3395; - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } for (int i = 0; i <= 12; i++) { - _itemArray[i].setDetails(i, 3995, 0, -1, -1); + _itemArray[i].setDetails(i, 3395, 0, -1, -1); } - _item1.setDetails(Rect(0, 0, 320, 200), 3395, 3, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3395, 3, -1, -1, 1, NULL); } void Scene3395::remove() { @@ -2632,15 +2674,16 @@ void Scene3395::signal() { R2_GLOBALS._player.enableControl(CURSOR_TALK); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } /*-------------------------------------------------------------------------- - * Scene 3400 - + * Scene 3400 - Confrontation * *--------------------------------------------------------------------------*/ + Scene3400::Scene3400() { _field157C = 0; } @@ -2653,7 +2696,8 @@ void Scene3400::synchronize(Serializer &s) { void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, 200); + loadScene(3400); _field157C = 0; R2_GLOBALS._v558B6.set(60, 0, 260, 200); @@ -2671,7 +2715,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { setZoomPercents(51, 46, 180, 200); R2_GLOBALS._player._characterScene[R2_QUINN] = 3400; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3400; - R2_GLOBALS._player._characterScene[3] = 3400; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3400; _actor7.postInit(); _actor7.setup(3403, 1, 1); @@ -2679,16 +2723,16 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _actor7.fixPriority(89); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); R2_GLOBALS._player.setPosition(Common::Point(239, 64)); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, 5, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, 5, 1); else R2_GLOBALS._player.setup(10, 5, 1); @@ -2696,42 +2740,42 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._numFrames = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + _companion1._numFrames = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._numFrames = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._numFrames = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; - _actor1.setPosition(Common::Point(247, 63)); - if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, 5, 1); + _companion1.changeZoom(-1); + _companion1._effect = 1; + _companion1.setPosition(Common::Point(247, 63)); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _companion1.setup(10, 5, 1); else - _actor1.setup(20, 5, 1); - _actor1.animate(ANIM_MODE_1, NULL); - - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; - _actor2.setPosition(Common::Point(225, 63)); - if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, 5, 1); + _companion1.setup(20, 5, 1); + _companion1.animate(ANIM_MODE_1, NULL); + + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; + _companion2.setPosition(Common::Point(225, 63)); + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) + _companion2.setup(10, 5, 1); else - _actor2.setup(30, 5, 1); - _actor2.animate(ANIM_MODE_1, NULL); - - _actor3.postInit(); - _actor3._numFrames = 7; - _actor3._moveDiff = Common::Point(5, 3); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setPosition(Common::Point(235, 61)); - _actor3.setup(40, 3, 1); - _actor3.animate(ANIM_MODE_1, NULL); + _companion2.setup(30, 5, 1); + _companion2.animate(ANIM_MODE_1, NULL); + + _webbster.postInit(); + _webbster._numFrames = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setPosition(Common::Point(235, 61)); + _webbster.setup(40, 3, 1); + _webbster.animate(ANIM_MODE_1, NULL); _actor6.postInit(); _actor6.setup(3400, 1, 6); @@ -2741,7 +2785,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS.clearFlag(71); _sceneMode = 3400; - setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } void Scene3400::remove() { @@ -2755,30 +2799,30 @@ void Scene3400::signal() { case 3305: { warning("STUB: sub_1D227()"); _tealSpeaker._object1.hide(); - _actor4.show(); - _actor4.setStrip(1); + _teal.show(); + _teal.setStrip(1); Common::Point pt(158, 190); NpcMover *mover = new NpcMover(); - _actor4.addMover(mover, &pt, this); + _teal.addMover(mover, &pt, this); _sceneMode = 3402; - setAction(&_sequenceManager, this, 3402, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3402, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } break; case 3306: R2_GLOBALS._sound2.play(318); - _actor1.setStrip(2); + _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); - _actor2.setStrip(6); - _actor3.setStrip(3); - _actor4.setStrip(1); + _companion2.setStrip(6); + _webbster.setStrip(3); + _teal.setStrip(1); R2_INVENTORY.setObjectScene(R2_SAPPHIRE_BLUE, 0); _stripManager.start(3307, this); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _sceneMode = 3400; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_actor4, &_actor8, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL); } else { _sceneMode = 3408; - _actor1.setAction(&_sequenceManager, this, 3408, &_actor1, &_actor4, &_actor8, NULL); + _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_actor8, NULL); } break; case 3307: @@ -2794,63 +2838,63 @@ void Scene3400::signal() { break; case 3308: warning("STUB: sub_1D227()"); - _actor1.setStrip(2); + _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); - _actor2.setStrip(6); - _actor3.setStrip(3); - _actor4.setStrip(1); + _companion2.setStrip(6); + _webbster.setStrip(3); + _teal.setStrip(1); _sceneMode = 3403; - if (R2_GLOBALS._player._characterIndex == 2) - setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_actor3, &_actor7, NULL); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_webbster, &_actor7, NULL); else - setAction(&_sequenceManager, this, 3403, &_actor1, &_actor3, &_actor7, NULL); + setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_actor7, NULL); break; case 3309: warning("STUB: sub_1D227()"); - _actor4.setStrip(1); + _teal.setStrip(1); _sceneMode = 3405; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) setAction(&_sequenceManager, this, 3405, &R2_GLOBALS._player, &_actor7, NULL); else - setAction(&_sequenceManager, this, 3405, &_actor2, &_actor7, NULL); + setAction(&_sequenceManager, this, 3405, &_companion2, &_actor7, NULL); break; case 3310: warning("STUB: sub_1D227()"); - _actor4.setStrip(1); + _teal.setStrip(1); _sceneMode = 3406; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_actor7, NULL); - else if (R2_GLOBALS._player._characterIndex == 2) - setAction(&_sequenceManager, this, 3406, &_actor1, &_actor7, NULL); - else if (R2_GLOBALS._player._characterIndex == 3) - setAction(&_sequenceManager, this, 3406, &_actor2, &_actor7, NULL); + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + setAction(&_sequenceManager, this, 3406, &_companion1, &_actor7, NULL); + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) + setAction(&_sequenceManager, this, 3406, &_companion2, &_actor7, NULL); break; case 3311: warning("STUB: sub_1D227()"); _tealSpeaker._object1.hide(); - _actor4.show(); - _actor4.setStrip(1); + _teal.show(); + _teal.setStrip(1); _sceneMode = 3407; - setAction(&_sequenceManager, this, 3407, &_actor4, &_actor7, NULL); + setAction(&_sequenceManager, this, 3407, &_teal, &_actor7, NULL); break; case 3400: { _actor8.postInit(); _actor8.hide(); - _actor4.postInit(); - _actor4._numFrames = 7; - _actor4._moveDiff = Common::Point(3, 2); - _actor4.changeZoom(-1); - _actor4._effect = 1; - _actor4.setPosition(Common::Point(-15, 90)); - _actor4.setup(3402, 1, 1); - _actor4.animate(ANIM_MODE_1, NULL); + _teal.postInit(); + _teal._numFrames = 7; + _teal._moveDiff = Common::Point(3, 2); + _teal.changeZoom(-1); + _teal._effect = 1; + _teal.setPosition(Common::Point(-15, 90)); + _teal.setup(3402, 1, 1); + _teal.animate(ANIM_MODE_1, NULL); Common::Point pt1(115, 90); NpcMover *mover1 = new NpcMover(); - _actor4.addMover(mover1, &pt1, this); - R2_GLOBALS._scrollFollower = &_actor4; + _teal.addMover(mover1, &pt1, this); + R2_GLOBALS._scrollFollower = &_teal; Common::Point pt2(203, 76); NpcMover *mover2 = new NpcMover(); - _actor3.addMover(mover2, &pt2, NULL); + _webbster.addMover(mover2, &pt2, NULL); _sceneMode = 3401; } break; @@ -3574,12 +3618,14 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { loadScene(1050); R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = 200; + R2_GLOBALS._v5589E.set(0, 0, 320, 200); R2_GLOBALS._sound1.play(305); R2_GLOBALS._player._characterIndex = R2_QUINN; R2_GLOBALS._player._characterScene[R2_QUINN] = 3500; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500; - R2_GLOBALS._player._characterScene[3] = 3500; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500; _field1284 = 0; _field1282 = 0; _field1278 = 0; @@ -4183,15 +4229,16 @@ void Scene3500::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 3600 - + * Scene 3600 - Cutscene - walking at gunpoint * *--------------------------------------------------------------------------*/ + Scene3600::Scene3600() { _field2548 = 0; _field254A = 0; _field254C = 0; _field254E = 0; - _field2550 = false; + _ghoulTeleported = false; } void Scene3600::synchronize(Serializer &s) { SceneExt::synchronize(s); @@ -4200,7 +4247,7 @@ void Scene3600::synchronize(Serializer &s) { s.syncAsSint16LE(_field254A); s.syncAsSint16LE(_field254C); s.syncAsSint16LE(_field254E); - s.syncAsSint16LE(_field2550); + s.syncAsSint16LE(_ghoulTeleported); } Scene3600::Action3600::Action3600() { @@ -4230,8 +4277,8 @@ void Scene3600::Action3600::signal() { R2_GLOBALS._sound2.play(330, NULL, 0); R2_GLOBALS._sound2.fade(127, 5, 10, false, NULL); } + setDelay(1); - warning("TODO: Palette fader using parameter 2 = 256"); R2_GLOBALS._scenePalette.fade((const byte *)&scene->_palette1._palette, true, _field20); if (_field20 > 0) _field20 -= 2; @@ -4259,14 +4306,14 @@ void Scene3600::Action2::signal() { R2_GLOBALS._events.proc1(); R2_GLOBALS._player.enableControl(); _actionIndex = 3619; - scene->_actor13._state = 0; + scene->_protector._state = 0; // No break on purpose case 3619: { ++_actionIndex; - scene->_actor13.setup(3127, 2, 1); - scene->_actor13.animate(ANIM_MODE_1, NULL); + scene->_protector.setup(3127, 2, 1); + scene->_protector.animate(ANIM_MODE_1, NULL); NpcMover *mover = new NpcMover(); - scene->_actor13.addMover(mover, &scene->_actor13._field8A, scene); + scene->_protector.addMover(mover, &scene->_protector._field8A, scene); } break; default: @@ -4282,8 +4329,8 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (scene->_action1._field1E == 0)) return SceneItem::startAction(action, event); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3624; @@ -4292,9 +4339,9 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { scene->_actor12.setStrip2(-1); scene->_actor4.setStrip2(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setAction(&scene->_sequenceManager3, scene, 3611, &R2_GLOBALS._player, NULL); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setAction(&scene->_sequenceManager4, scene, 3612, &R2_GLOBALS._player, NULL); else R2_GLOBALS._player.setAction(&scene->_sequenceManager2, scene, 3610, &R2_GLOBALS._player, NULL); @@ -4302,12 +4349,12 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { return true; } -bool Scene3600::Actor13::startAction(CursorType action, Event &event) { +bool Scene3600::Protector::startAction(CursorType action, Event &event) { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; switch(action) { case CURSOR_TALK: - if (!_action) + if (_action) return SceneActor::startAction(action, event); scene->_protectorSpeaker._displayMode = 1; @@ -4334,6 +4381,7 @@ bool Scene3600::Actor13::startAction(CursorType action, Event &event) { R2_GLOBALS._sound3.play(43); else R2_GLOBALS._sound3.play(99); + if (_state != 0) { _state = 1; setup(3128, 1, 1); @@ -4360,7 +4408,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._v558B6.set(60, 0, 260, 200); } else { R2_GLOBALS._scrollFollower = &_actor2; - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, 200); R2_GLOBALS._v558B6.set(25, 0, 260, 200); } @@ -4379,7 +4427,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { setZoomPercents(142, 80, 167, 105); R2_GLOBALS._player._characterScene[R2_QUINN] = 3600; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3600; - R2_GLOBALS._player._characterScene[3] = 3600; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3600; _item2.setDetails(33, 3600, 6, -1, -1); _item3.setDetails(Rect(3, 3, 22, 45), 3600, 9, -1, -1, 1, NULL); @@ -4438,11 +4486,11 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _field254A = 1; _field2548 = 1; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(14); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(16); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(16); _actor10.setup(10, 5, 11); _actor10.animate(ANIM_MODE_1, NULL); @@ -4453,7 +4501,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor12.setup(30, 5, 11); _actor12.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _actor10.setPosition(Common::Point(76, 148)); _actor11.setPosition(Common::Point(134, 148)); _actor12.setPosition(Common::Point(100, 148)); @@ -4461,7 +4509,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setup(20, _actor11._strip, 1); R2_GLOBALS._player.setPosition(_actor11._position); _actor11.hide(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _actor10.setPosition(Common::Point(110, 148)); _actor11.setPosition(Common::Point(76, 148)); _actor12.setPosition(Common::Point(134, 148)); @@ -4486,14 +4534,14 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor5.setup(3601, 7, 5); if (!R2_GLOBALS.getFlag(71)) { - _actor13.postInit(); - _actor13._state = 0; - _actor13._field8A = Common::Point(226, 152); - _actor13._moveDiff = Common::Point(3, 2); - _actor13.setPosition(Common::Point(284, 152)); - _actor13.setup(3127, 2, 1); - _actor13.changeZoom(-1); - _actor13.setDetails(3600, 15, -1, 17, 1, (SceneItem *) NULL); + _protector.postInit(); + _protector._state = 0; + _protector._field8A = Common::Point(226, 152); + _protector._moveDiff = Common::Point(3, 2); + _protector.setPosition(Common::Point(284, 152)); + _protector.setup(3127, 2, 1); + _protector.changeZoom(-1); + _protector.setDetails(3600, 15, -1, 17, 1, (SceneItem *) NULL); } R2_GLOBALS._sound2.play(330); @@ -4511,13 +4559,13 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _sceneMode = 3623; g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { _field254A = 0; _field2548 = 0; - R2_GLOBALS._walkRegions.enableRegion(17); - R2_GLOBALS._walkRegions.enableRegion(18); + R2_GLOBALS._walkRegions.disableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(18); _actor10.setPosition(Common::Point(393, 148)); _actor11.setPosition(Common::Point(364, 153)); @@ -4530,9 +4578,8 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor5.setup(3403, 8, 11); _actor5.setPosition(Common::Point(403, 155)); - _actor12.setup(3403, 7, 1); - - _actor13.setPosition(Common::Point(405, 155)); + _protector.setup(3403, 7, 1); + _protector.setPosition(Common::Point(405, 155)); _actor2.postInit(); _actor2.setup(3600, 2, 1); @@ -4548,7 +4595,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _field254E = 0; } _field254E = 0; - _field2550 = R2_GLOBALS.getFlag(71); + _ghoulTeleported = R2_GLOBALS.getFlag(71); R2_GLOBALS._sound1.play(326); _item1.setDetails(Rect(0, 0, 480, 200), 3600, 0, -1, -1, 1, NULL); @@ -4566,15 +4613,15 @@ void Scene3600::remove() { void Scene3600::signal() { switch (_sceneMode) { case 3320: - warning("STUB: sub_1D227()"); - R2_GLOBALS._walkRegions.enableRegion(14); + // TODO: warning("STUB: sub_1D227()"); + R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_actor11; _tealSpeaker._object1.hide(); _actor5.show(); _actor5.setStrip(2); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _sceneMode = 3602; - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _sceneMode = 3603; else _sceneMode = 3601; @@ -4598,7 +4645,7 @@ void Scene3600::signal() { _tealSpeaker._displayMode = 7; R2_GLOBALS._scrollFollower = &_actor5; _sceneMode = 3605; - setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_actor13, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_protector, &_actor2, NULL); break; case 3323: if (_field254A == 0) @@ -4606,45 +4653,50 @@ void Scene3600::signal() { else { warning("STUB: sub_1D227()"); _protectorSpeaker.proc16(); - _actor13.show(); - _actor13.setup(3258, 6, 1); + _protector.show(); + _protector.setup(3258, 6, 1); + _sceneMode = 3607; - _actor13.setAction(&_sequenceManager1, this, _sceneMode, &_actor13, NULL); + _protector.setAction(&_sequenceManager1, this, _sceneMode, &_protector, NULL); + R2_GLOBALS._v558C2 = 1; _protectorSpeaker.proc16(); _protectorSpeaker._displayMode = 1; _quinnSpeaker._displayMode = 1; - _actor13.show(); + _protector.show(); + R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - R2_GLOBALS._walkRegions.disableRegion(17); - R2_GLOBALS._walkRegions.disableRegion(18); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(14); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(16); - _actor13.setAction(&_action1); + R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.enableRegion(18); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(16); + + _actor3.setAction(&_action1); } break; case 3324: // No break on purpose case 3607: g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); - _actor13.fixPriority(-1); + R2_GLOBALS._player.enableControl(CURSOR_WALK); + _protector.fixPriority(-1); _sceneMode = 3623; _field2548 = 1; break; case 3327: g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); _sceneMode = 3623; break; case 3450: R2_GLOBALS._sound1.stop(); _actor1.hide(); _actor6.hide(); - g_globals->gfxManager()._bounds.moveTo(Common::Point(40, 0)); + + _sceneBounds = Rect(40, 0, SCREEN_WIDTH + 40, SCREEN_HEIGHT); setZoomPercents(142, 80, 167, 105); loadScene(3600); R2_GLOBALS._uiElements.show(); @@ -4660,17 +4712,17 @@ void Scene3600::signal() { _actor5.setPosition(Common::Point(298, 151)); - _actor13.postInit(); - _actor13._state = 0; - _actor13._field8A = Common::Point(226, 152); - _actor13._moveDiff = Common::Point(5, 3); - _actor13.setup(3403, 7, 1); - _actor13.setPosition(Common::Point(405, 155)); - _actor13.changeZoom(-1); - _actor13.addMover(NULL); - _actor13.animate(ANIM_MODE_NONE); - _actor13.hide(); - _actor13.setDetails(3600, 15, -1, 17, 5, &_item5); + _protector.postInit(); + _protector._state = 0; + _protector._field8A = Common::Point(226, 152); + _protector._moveDiff = Common::Point(5, 3); + _protector.setup(3403, 7, 1); + _protector.setPosition(Common::Point(405, 155)); + _protector.changeZoom(-1); + _protector.addMover(NULL); + _protector.animate(ANIM_MODE_NONE); + _protector.hide(); + _protector.setDetails(3600, 15, -1, 17, 5, &_item5); _actor2.setup(3600, 2, 1); _actor2.setPosition(Common::Point(403, 161)); @@ -4681,12 +4733,12 @@ void Scene3600::signal() { _quinnSpeaker._displayMode = 2; _tealSpeaker._displayMode = 2; - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); R2_GLOBALS._player.setup(20, _actor11._strip, 1); R2_GLOBALS._player.setPosition(_actor11._position); _actor11.hide(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.setup(30, _actor12._strip, 1); R2_GLOBALS._player.setPosition(_actor12._position); @@ -4712,8 +4764,8 @@ void Scene3600::signal() { case 3602: // No break on purpose case 3603: - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); R2_GLOBALS._v558B6.set(60, 0, 260, 200); _tealSpeaker._displayMode = 1; _sceneMode = 3321; @@ -4722,8 +4774,8 @@ void Scene3600::signal() { case 3604: R2_GLOBALS._sound2.fadeOut2(NULL); R2_GLOBALS._sound1.stop(); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); _actor2.hide(); _actor3.hide(); @@ -4734,7 +4786,7 @@ void Scene3600::signal() { _actor4.hide(); _actor5.hide(); - g_globals->gfxManager()._bounds.moveTo(Common::Point(60, 0)); + _sceneBounds = Rect(60, 0, SCREEN_WIDTH + 60, SCREEN_HEIGHT); setZoomPercents(51, 46, 180, 200); loadScene(3400); @@ -4757,8 +4809,8 @@ void Scene3600::signal() { setAction(&_sequenceManager1, this, 3450, &_actor1, &_actor6, NULL); break; case 3605: - _actor13.setup(3258, 4, 1); - _actor13.setAction(&_sequenceManager1, this, 3606, &_actor5, &_actor13, &_actor2, NULL); + _protector.setup(3258, 4, 1); + _protector.setAction(&_sequenceManager1, this, 3606, &_actor5, &_protector, &_actor2, NULL); _sceneMode = 3323; _stripManager.start(3323, this); @@ -4766,12 +4818,13 @@ void Scene3600::signal() { case 3620: // No break on purpose case 3623: - if ((_actor13._position.x == 226) && (_actor13._position.y == 152) && (_action1._field1E != 0) && (_actor13._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { + if ((_protector._position.x == 226) && (_protector._position.y == 152) + && (_action1._field1E != 0) && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); R2_GLOBALS.setFlag(71); _sceneMode = 3626; - setAction(&_sequenceManager1, this, 3626, &_actor13, NULL); + setAction(&_sequenceManager1, this, 3626, &_protector, NULL); } break; case 3624: @@ -4788,7 +4841,7 @@ void Scene3600::signal() { R2_GLOBALS._sceneManager.changeScene(3700); break; case 3626: - _actor13.setPosition(Common::Point(0, 0)); + _protector.setPosition(Common::Point(0, 0)); _action1.setActionIndex(2); if (R2_GLOBALS._events.getCursor() > R2_LAST_INVENT) { R2_GLOBALS._events.setCursor(CURSOR_USE); @@ -4813,10 +4866,12 @@ void Scene3600::process(Event &event) { } void Scene3600::dispatch() { - if ((R2_GLOBALS._player.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)){ + if ((R2_GLOBALS._player.getRegionIndex() == 200) && (_action1._field1E != 0) + && (_field254E == 0)) { R2_GLOBALS._sound2.fadeOut2(NULL); - if (_actor13._mover) - _actor13.addMover(NULL); + if (_protector._mover) + _protector.addMover(NULL); + if (R2_GLOBALS._player._action) R2_GLOBALS._player.setAction(NULL); if (R2_GLOBALS._player._mover) @@ -4825,8 +4880,8 @@ void Scene3600::dispatch() { _field254C = 0; _field254E = 1; - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); R2_GLOBALS._player.disableControl(); _sceneMode = 3624; @@ -4838,10 +4893,10 @@ void Scene3600::dispatch() { R2_GLOBALS._player.hide(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _actor11.setPosition(R2_GLOBALS._player._position); _actor11.show(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _actor12.setPosition(R2_GLOBALS._player._position); _actor12.show(); } else { @@ -4854,10 +4909,10 @@ void Scene3600::dispatch() { _actor4.setAction(&_sequenceManager1, this, 3613, &_actor4, NULL); } - if ((_actor13.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)){ + if ((_protector.getRegionIndex() == 200) && (_action1._field1E != 0) && !_ghoulTeleported) { R2_GLOBALS._sound2.fadeOut2(NULL); _sceneMode = 3620; - _field2550 = 1; + _ghoulTeleported = true; R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._mover) @@ -4871,6 +4926,7 @@ void Scene3600::dispatch() { if (_actor4._mover) _actor4.addMover(NULL); } + Scene::dispatch(); } @@ -4878,10 +4934,12 @@ void Scene3600::dispatch() { * Scene 3700 - Cutscene - Teleport outside * *--------------------------------------------------------------------------*/ + void Scene3700::postInit(SceneObjectList *OwnerList) { loadScene(3700); - R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -4889,30 +4947,31 @@ void Scene3700::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_seekerSpeaker); _stripManager.addSpeaker(&_mirandaSpeaker); - _actor1.postInit(); - _actor1._moveDiff = Common::Point(3, 2); + _quinn.postInit(); + _quinn._moveDiff = Common::Point(3, 2); - _actor2.postInit(); - _actor2._numFrames = 7; - _actor2._moveDiff = Common::Point(5, 3); - _actor2.hide(); + _seeker.postInit(); + _seeker._numFrames = 7; + _seeker._moveDiff = Common::Point(5, 3); + _seeker.hide(); - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.hide(); + _miranda.postInit(); + _miranda._moveDiff = Common::Point(3, 2); + _miranda.hide(); - _actor4.postInit(); - _actor4._numFrames = 7; - _actor4._moveDiff = Common::Point(5, 3); - _actor4.hide(); + _webbster.postInit(); + _webbster._numFrames = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.hide(); _actor5.postInit(); - R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.disableControl(); R2_GLOBALS._sound1.play(332); _sceneMode = 3700; - setAction(&_sequenceManager, this, 3700, &_actor1, &_actor2, &_actor3, &_actor4, &_actor5, NULL); + setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, + &_webbster, &_actor5, NULL); } void Scene3700::remove() { @@ -4927,11 +4986,11 @@ void Scene3700::signal() { case 3329: warning("STUB: sub_1D227()"); _sceneMode = 3701; - setAction(&_sequenceManager, this, 3701, &_actor2, &_actor3, &_actor4, NULL); + setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL); break; case 3700: - _actor1.setup(10, 6, 1); - _actor2.setup(20, 5, 1); + _quinn.setup(10, 6, 1); + _seeker.setup(20, 5, 1); if (R2_GLOBALS.getFlag(71)) { _sceneMode = 3329; _stripManager.start(3329, this); @@ -5188,7 +5247,7 @@ void Scene3800::enterArea() { break; } default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } break; @@ -5344,7 +5403,7 @@ void Scene3800::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 3900 - + * Scene 3900 - Forest Entrance * *--------------------------------------------------------------------------*/ @@ -5554,7 +5613,7 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.addMover(mover, &pt, this); } else { R2_GLOBALS._player.setPosition(Common::Point(160, 145)); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } } @@ -5585,7 +5644,7 @@ void Scene3900::signal() { _eastExit._enabled = true; _southExit._enabled = true; _westExit._enabled = true; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; default: break; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 14600ff6df..6c7a594b12 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -45,7 +45,6 @@ class Scene3100 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; SpeakerGuard _guardSpeaker; NamedHotspot _item1; @@ -68,33 +67,32 @@ public: }; class Scene3125 : public SceneExt { - class Item1 : public NamedHotspot { + class Background : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item2 : public Item1 { + class Table : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item3 : public Item1 { + class Computer : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; - Item1 _item1; - Actor1 _actor1; - Item2 _item2; - Item3 _item3; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + Background _background; + Door _door; + Table _table; + Computer _computer; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; + SceneActor _ghoul4; SequenceManager _sequenceManager1; // Second sequence manager... Unused? SequenceManager _sequenceManager2; @@ -107,52 +105,51 @@ public: }; class Scene3150 : public SceneExt { - class Item5 : public NamedHotspot { + class LightFixture : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item6 : public NamedHotspot { + class Toilet : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Water : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor5 : public SceneActor { + class FoodTray : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; class Actor6 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor7 : public SceneActor { + class AirVent : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class DoorExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class VentExit : public SceneExit { public: virtual void changeScene(); }; public: - - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - Item5 _item5; - Item6 _item6; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - Actor4 _actor4; - Actor5 _actor5; - Actor6 _actor6; - Actor7 _actor7; - Exit1 _exit1; - Exit2 _exit2; + NamedHotspot _background; + NamedHotspot _bed; + NamedHotspot _lightFixture2; + NamedHotspot _bars; + LightFixture _lightFixture; + Toilet _toilet; + SceneActor _guard; + SceneActor _doorBars; + SceneActor _bulbOrWire; + Water _water; + FoodTray _foodTray; + Actor6 _toiletFlush; + AirVent _airVent; + DoorExit _doorExit; + VentExit _ventExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -166,20 +163,19 @@ class Scene3175 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public Actor3 { + class Corpse : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - - Item1 _item1; + Item1 _background; Item1 _item2; Item1 _item3; - Actor1 _actor1; + Door _door; SceneActor _actor2; - Actor3 _actor3; + Corpse _corpse; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -268,22 +264,21 @@ class Scene3250 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - - Item _item1; - Item _item2; - Item _item3; - Item _item4; - Actor _actor1; - Actor _actor2; - Actor _actor3; - Actor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; + Item _background; + Item _tnuctipunShip; + Item _floodLights; + Item _negator; + Door _leftDoor; + Door _topDoor; + Door _rightDoor; + Door _actor4; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -293,13 +288,13 @@ public: class Scene3255 : public SceneExt { public: - SceneActor _actor1; - SceneActor _actor2; + SceneActor _teal; + SceneActor _guard; SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; + SceneActor _quinn; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; SpeakerQuinn3255 _quinnSpeaker; SpeakerMiranda3255 _mirandaSpeaker; SequenceManager _sequenceManager; @@ -310,10 +305,10 @@ public: }; class Scene3260 : public SceneExt { - class Actor13 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor14 : public SceneActor { + class Toolbox : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -322,22 +317,21 @@ class Scene3260 : public SceneExt { void signal(); }; public: - NamedHotspot _item1; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; + SceneActor _sceeen1; + SceneActor _screen2; + SceneActor _screen3; + SceneActor _screen4; + SceneActor _screen5; + SceneActor _screen6; SceneActor _actor7; SceneActor _actor8; SceneActor _actor9; - SceneActor _actor10; - SceneActor _actor11; - SceneActor _actor12; - Actor13 _actor13; - Actor14 _actor14; + SceneActor _securityConsole; + SceneActor _computerConsole; + SceneActor _lightingConsole; + Door _door; + Toolbox _toolbox; Action1 _action1; Action1 _action2; Action1 _action3; @@ -358,23 +352,23 @@ public: }; class Scene3275 : public SceneExt { - class Actor2 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class CellExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; + NamedHotspot _background; + NamedHotspot _emptyCell1; + NamedHotspot _emptyCell2; + NamedHotspot _securityBeams1; + NamedHotspot _securityBeams2; SceneActor _actor1; - Actor2 _actor2; - Exit1 _exit1; + Door _door; + CellExit _cellExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -401,52 +395,52 @@ public: }; class Scene3375 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class LeftExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class DownExit : public SceneExit { public: virtual void changeScene(); }; - class Exit3 : public SceneExit { + class RightExit : public SceneExit { public: virtual void changeScene(); }; void signalCase3379(); - void subFC696(int sceneMode); + void enterArea(int sceneMode); public: SpeakerQuinn3375 _quinnSpeaker; SpeakerSeeker3375 _seekerSpeaker; SpeakerMiranda3375 _mirandaSpeaker; SpeakerWebbster3375 _webbsterSpeaker; - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _itemArray[13]; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; - Exit1 _exit1; - Exit2 _exit2; - Exit3 _exit3; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; + Door _door; + LeftExit _leftExit; + DownExit _downExit; + RightExit _rightExit; SequenceManager _sequenceManager; int _field1488; - int _field148A[4]; + int _sceneAreas[4]; int _field1492; Scene3375(); @@ -458,16 +452,16 @@ public: }; class Scene3385 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -486,11 +480,11 @@ public: SpeakerSeeker3385 _seekerSpeaker; SpeakerMiranda3385 _mirandaSpeaker; SpeakerWebbster3385 _webbsterSpeaker; - NamedHotspot _item1; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; + NamedHotspot _background; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; + Door _door; Exit1 _exit1; Action1 _action1; SequenceManager _sequenceManager; @@ -505,16 +499,16 @@ public: }; class Scene3395 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -528,12 +522,12 @@ public: SpeakerSeeker3395 _seekerSpeaker; SpeakerMiranda3395 _mirandaSpeaker; SpeakerWebbster3395 _webbsterSpeaker; - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _itemArray[13]; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; + Door _door; Action1 _action1; SequenceManager _sequenceManager; @@ -553,10 +547,10 @@ public: SpeakerMiranda3400 _mirandaSpeaker; SpeakerWebbster3400 _webbsterSpeaker; SpeakerTeal3400 _tealSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _companion1; + SceneActor _companion2; + SceneActor _webbster; + SceneActor _teal; SceneActor _actor5; SceneActor _actor6; SceneActor _actor7; @@ -710,7 +704,7 @@ class Scene3600 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor13 : public SceneActorExt { + class Protector : public SceneActorExt { virtual bool startAction(CursorType action, Event &event); }; public: @@ -738,7 +732,7 @@ public: SceneActor _actor10; SceneActor _actor11; SceneActor _actor12; - Actor13 _actor13; + Protector _protector; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; SequenceManager _sequenceManager3; @@ -749,7 +743,7 @@ public: int _field254A; int _field254C; int _field254E; - bool _field2550; + bool _ghoulTeleported; Scene3600(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -765,10 +759,10 @@ public: SpeakerQuinn3700 _quinnSpeaker; SpeakerSeeker3700 _seekerSpeaker; SpeakerMiranda3700 _mirandaSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _quinn; + SceneActor _seeker; + SceneActor _miranda; + SceneActor _webbster; SceneActor _actor5; SequenceManager _sequenceManager; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index e908fb4412..3091086980 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -414,10 +414,10 @@ SpeakerGuard::SpeakerGuard() { void SpeakerGuard2800::proc15() { int v = _speakerMode; - Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_guard; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -541,7 +541,7 @@ void SpeakerMiranda300::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _object2 = &R2_GLOBALS._player; } else { Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; @@ -627,10 +627,10 @@ void SpeakerMiranda3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -639,7 +639,7 @@ void SpeakerMiranda3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -677,10 +677,10 @@ void SpeakerMiranda3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -726,10 +726,10 @@ void SpeakerMiranda3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -776,10 +776,10 @@ void SpeakerMiranda3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -801,12 +801,12 @@ void SpeakerMiranda3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4051, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4050, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -820,7 +820,7 @@ void SpeakerMiranda3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor12; @@ -866,7 +866,7 @@ void SpeakerMiranda3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_miranda; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -886,25 +886,25 @@ void SpeakerMiranda3700::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 6, 1); - scene->_actor2.setup(20, 5, 1); + scene->_quinn.setup(10, 6, 1); + scene->_seeker.setup(20, 5, 1); _object2->setup(30, 1, 1); - scene->_actor4.setup(40, 1, 1); + scene->_webbster.setup(40, 1, 1); _object1.setup(4050, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor3.setup(30, 8, 1); + scene->_miranda.setup(30, 8, 1); _object1.setup(4052, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4051, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -933,7 +933,7 @@ void SpeakerNej2700::proc15() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_nej; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -968,7 +968,7 @@ void SpeakerNej2750::proc15() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_nej; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1116,7 +1116,7 @@ void SpeakerProtector3600::proc15() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor13; + _object2 = &scene->_protector; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1176,7 +1176,7 @@ void SpeakerQuinn300::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 300); @@ -1272,7 +1272,7 @@ void SpeakerQuinn1100::proc15() { if (v == 0) return; - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); @@ -1318,7 +1318,7 @@ void SpeakerQuinn2435::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -1345,7 +1345,7 @@ void SpeakerQuinn2450::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -1477,7 +1477,7 @@ void SpeakerQuinn3255::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor4; + _object2 = &scene->_quinn; _object2->hide(); _object1.postInit(); _object1._effect = _object2->_effect; @@ -1500,12 +1500,12 @@ void SpeakerQuinn3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1514,7 +1514,7 @@ void SpeakerQuinn3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -1551,12 +1551,12 @@ void SpeakerQuinn3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1587,7 +1587,7 @@ void SpeakerQuinn3385::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else _object1.setup(4010, 5, 1); @@ -1606,12 +1606,12 @@ void SpeakerQuinn3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1642,7 +1642,7 @@ void SpeakerQuinn3395::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else _object1.setup(4010, 5, 1); @@ -1661,12 +1661,12 @@ void SpeakerQuinn3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1691,12 +1691,12 @@ void SpeakerQuinn3400::proc15() { case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4010, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4012, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -1710,7 +1710,7 @@ void SpeakerQuinn3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor10; @@ -1757,14 +1757,14 @@ void SpeakerQuinn3700::setText(const Common::String &msg) { switch (_speakerMode) { case 2: - scene->_actor3.setup(30, 1, 1); + scene->_miranda.setup(30, 1, 1); R2_GLOBALS._sound2.play(44); break; case 3: - scene->_actor3.setup(30, 1, 1); + scene->_miranda.setup(30, 1, 1); break; default: - scene->_actor3.setup(30, 7, 1); + scene->_miranda.setup(30, 7, 1); break; } VisualSpeaker::setText(msg); @@ -1776,7 +1776,7 @@ void SpeakerQuinn3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_quinn; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1797,24 +1797,24 @@ void SpeakerQuinn3700::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; R2_GLOBALS._sound2.stop(); - scene->_actor1.setup(10, 4, 1); - scene->_actor3.setup(30, 7, 1); + scene->_quinn.setup(10, 4, 1); + scene->_miranda.setup(30, 7, 1); _object1.setup(3701, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); - _object1.setup(3701, 2, 1); - _object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); + _object1.setup(3702, 1, 1); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 2, 1); - scene->_actor3.setup(30, 1, 1); + scene->_quinn.setup(10, 2, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4011, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2072,7 +2072,7 @@ void SpeakerSeeker1100::proc15() { if (v == 0) return; - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); @@ -2129,7 +2129,7 @@ void SpeakerSeeker1900::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1900); @@ -2160,7 +2160,7 @@ void SpeakerSeeker2435::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -2187,7 +2187,7 @@ void SpeakerSeeker2450::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2450); @@ -2215,10 +2215,10 @@ void SpeakerSeeker3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2227,7 +2227,7 @@ void SpeakerSeeker3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -2264,10 +2264,10 @@ void SpeakerSeeker3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2313,10 +2313,10 @@ void SpeakerSeeker3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2362,10 +2362,10 @@ void SpeakerSeeker3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2387,27 +2387,27 @@ void SpeakerSeeker3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4030, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 4: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 5: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4033, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2421,7 +2421,7 @@ void SpeakerSeeker3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor11; @@ -2467,10 +2467,11 @@ void SpeakerSeeker3700::setText(const Common::String &msg) { if (_speakerMode == 1) { R2_GLOBALS._sound2.play(44); - scene->_actor3.setup(30, 8, 1); + scene->_miranda.setup(30, 8, 1); } else { - scene->_actor3.setup(30, 2, 1); + scene->_miranda.setup(30, 2, 1); } + VisualSpeaker::setText(msg); } @@ -2480,7 +2481,7 @@ void SpeakerSeeker3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_seeker; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2501,19 +2502,19 @@ void SpeakerSeeker3700::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; R2_GLOBALS._sound2.stop(); - scene->_actor1.setup(10, 8, 1); - scene->_actor2.setup(20, 7, 1); - scene->_actor3.setup(30, 8, 1); + scene->_quinn.setup(10, 8, 1); + scene->_seeker.setup(20, 7, 1); + scene->_miranda.setup(30, 8, 1); _object1.setup(3701, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 2, 1); - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); + scene->_quinn.setup(10, 2, 1); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4031, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2637,6 +2638,41 @@ SpeakerTealMode7::SpeakerTealMode7(): SpeakerTeal() { _displayMode = 7; } +void SpeakerTeal180::proc15() { + int v = _speakerMode; + + if (!_object2) { + Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_teal; + _object2->hide(); + + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 5, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(77, 1, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerTeal300::proc15() { int v = _speakerMode; @@ -2714,7 +2750,7 @@ void SpeakerTeal3400::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor4; + _object2 = &scene->_teal; _object2->hide(); _object1.postInit(); _object1._numFrames = 7; @@ -2731,8 +2767,8 @@ void SpeakerTeal3400::proc15() { if (scene ->_sceneMode == 3305) { R2_GLOBALS._player.setStrip(6); - scene->_actor1.setStrip(6); - scene->_actor2.setStrip(6); + scene->_companion1.setStrip(6); + scene->_companion2.setStrip(6); } switch (v) { @@ -2742,22 +2778,22 @@ void SpeakerTeal3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 4: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2889,6 +2925,47 @@ SpeakerWebbster::SpeakerWebbster(int color) { _numFrames = 0; } +void SpeakerWebbster180::proc15() { + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + + int v = _speakerMode; + + if (!_object2) { + _object2 = &scene->_webbster; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 6; + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 7, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(76, 4, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 3: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 6, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerWebbster3240::proc15() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; @@ -2918,7 +2995,7 @@ void SpeakerWebbster3375::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2926,7 +3003,7 @@ void SpeakerWebbster3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -2962,7 +3039,7 @@ void SpeakerWebbster3385::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -3006,7 +3083,7 @@ void SpeakerWebbster3395::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -3050,7 +3127,7 @@ void SpeakerWebbster3400::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -3071,17 +3148,17 @@ void SpeakerWebbster3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -3091,7 +3168,7 @@ void SpeakerWebbster3400::proc15() { //---------------------------------------------------------------------------- -SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { +SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() { _speakerName = "DUTYOFFICER"; _color1 = 5; _color2 = 0; @@ -3103,13 +3180,13 @@ SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { _numFrames = 0; } -void SpeakerDutyOfficer::proc15() { +void SpeakerDutyOfficer180::proc15() { Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; if (!_object2) { - _object2 = &scene->_object2; + _object2 = &scene->_dutyOfficer; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 4dfb500f2d..1b87606381 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -547,6 +547,12 @@ public: virtual Common::String getClassName() { return "SpeakerTealMode7"; } }; +class SpeakerTeal180 : public SpeakerTeal { +public: + virtual Common::String getClassName() { return "SpeakerTeal180"; } + virtual void proc15(); +}; + class SpeakerTeal300 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal300"; } @@ -595,6 +601,13 @@ public: virtual Common::String getClassName() { return "SpeakerWebbster"; } }; +class SpeakerWebbster180 : public SpeakerWebbster { +public: + SpeakerWebbster180() : SpeakerWebbster(27) {} + virtual Common::String getClassName() { return "SpeakerWebbster180"; } + virtual void proc15(); +}; + class SpeakerWebbster2500 : public SpeakerWebbster { public: SpeakerWebbster2500() : SpeakerWebbster(27) {} @@ -641,9 +654,9 @@ public: virtual void proc15(); }; -class SpeakerDutyOfficer: public VisualSpeaker { +class SpeakerDutyOfficer180: public VisualSpeaker { public: - SpeakerDutyOfficer(); + SpeakerDutyOfficer180(); virtual Common::String getClassName() { return "SpeakerDutyOfficer"; } virtual void proc15(); diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 774a5277dc..58bb8c4a44 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -56,8 +56,13 @@ void SceneManager::setNewScene(int sceneNumber) { void SceneManager::checkScene() { if (_nextSceneNumber != -1) { + int nextSceneNumber = _nextSceneNumber; + sceneChange(); - _nextSceneNumber = -1; + + // Unless we've already switched to yet another scene, reset + if (_nextSceneNumber == nextSceneNumber) + _nextSceneNumber = -1; } g_globals->dispatchSounds(); @@ -247,6 +252,14 @@ void SceneManager::listenerSynchronize(Serializer &s) { } } + // Walk regions loading + if (g_vm->getGameID() == GType_Ringworld2) { + int walkRegionsId = GLOBALS._walkRegions._resNum; + s.syncAsSint16LE(walkRegionsId); + if (s.isLoading()) + GLOBALS._walkRegions.load(walkRegionsId); + } + g_globals->_sceneManager._scrollerRect.synchronize(s); SYNC_POINTER(g_globals->_scrollFollower); s.syncAsSint16LE(_loadMode); diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 2c5e8e57a0..662efa19b4 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -229,6 +229,7 @@ char const *const RESTORE_GAME = "Restore game"; char const *const SHOW_CREDITS = "Show credits"; char const *const PAUSE_GAME = "Pause game"; char const *const RESUME_PLAY = " Resume play "; +char const *const R2_RESTART_MSG = "Go to the beginning of game?"; char const *const F2 = "F2"; char const *const F3 = "F3"; char const *const F4 = "F4"; diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index b6c5d5e72a..7d97f2824d 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -182,6 +182,7 @@ extern char const *const RESTORE_GAME; extern char const *const SHOW_CREDITS; extern char const *const PAUSE_GAME; extern char const *const RESUME_PLAY; +extern char const *const R2_RESTART_MSG; extern char const *const F2; extern char const *const F3; extern char const *const F4; |