diff options
author | Paul Gilbert | 2011-10-01 16:05:08 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-10-01 16:05:08 +1000 |
commit | aa57e797042bffaa2d754d10f78acda95b541504 (patch) | |
tree | 6d742aa086c8ed81cf5999f6e1854f4372173100 | |
parent | 622e8d9da60d06894f979ddafbcd568710098ac3 (diff) | |
download | scummvm-rg350-aa57e797042bffaa2d754d10f78acda95b541504.tar.gz scummvm-rg350-aa57e797042bffaa2d754d10f78acda95b541504.tar.bz2 scummvm-rg350-aa57e797042bffaa2d754d10f78acda95b541504.zip |
TSAGE: Implemented Blue Force scene 560
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes5.cpp | 662 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes5.h | 100 | ||||
-rw-r--r-- | engines/tsage/events.h | 1 | ||||
-rw-r--r-- | engines/tsage/globals.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/globals.h | 1 |
6 files changed, 766 insertions, 2 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 2e520e2bbc..9e57586c09 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -145,6 +145,8 @@ Scene *BlueForceGame::createScene(int sceneNumber) { // Outside Bikini Hut (Drunk Stop) return new Scene551(); case 560: + // Study + return new Scene560(); case 570: case 580: case 590: diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp index 4e7a39cdec..fcf0a377eb 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.cpp +++ b/engines/tsage/blue_force/blueforce_scenes5.cpp @@ -411,7 +411,7 @@ bool Scene551::Drunk::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 5505, &BF_GLOBALS._player, &scene->_object15, NULL); break; case 1: - SceneItem::display(550, 11); + SceneItem::display2(550, 11); break; case 2: SceneItem::display2(550, 12); @@ -893,6 +893,666 @@ void Scene551::dispatch() { _harrison.updateAngle(BF_GLOBALS._player._position); } +/*-------------------------------------------------------------------------- + * Scene 550 - Study + * + *--------------------------------------------------------------------------*/ + +void Scene560::Action1::signal() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(10); + break; + case 1: + ADD_MOVER(BF_GLOBALS._player, 105, 140); + break; + case 2: + scene->_deskChair.hide(); + + BF_GLOBALS._player.changeZoom(81); + BF_GLOBALS._player.setVisage(561); + BF_GLOBALS._player.setStrip(2); + BF_GLOBALS._player.setFrame(1); + BF_GLOBALS._player.setPosition(Common::Point(96, 138)); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 3: + scene->_deskChair.setVisage(561); + scene->_deskChair.setFrame(BF_GLOBALS._player._frame); + scene->_deskChair.setStrip(BF_GLOBALS._player._strip); + scene->_deskChair.setPosition(BF_GLOBALS._player._position); + + scene->_field380 = 1; + BF_GLOBALS._player.enableControl(); + remove(); + break; + default: + break; + } +} + +void Scene560::Action2::signal() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + BF_GLOBALS._player.disableControl(); + setDelay(10); + break; + case 1: + scene->_deskChair.hide(); + + BF_GLOBALS._player.setVisage(561); + BF_GLOBALS._player.setStrip(2); + BF_GLOBALS._player.setFrame(BF_GLOBALS._player.getFrameCount()); + BF_GLOBALS._player.animate(ANIM_MODE_6, this); + break; + case 2: + scene->_field380 = 0; + scene->_deskChair.setPosition(Common::Point(81, 149)); + scene->_deskChair.setVisage(561); + scene->_deskChair.setStrip(3); + scene->_deskChair.setFrame(1); + scene->_deskChair.fixPriority(151); + scene->_deskChair.show(); + + BF_GLOBALS._player.setVisage(563); + BF_GLOBALS._player.setPosition(Common::Point(105, 140)); + BF_GLOBALS._player.fixPriority(-1); + BF_GLOBALS._player.changeZoom(-1); + BF_GLOBALS._player.animate(ANIM_MODE_1, this); + BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + BF_GLOBALS._player.enableControl(); + ADD_PLAYER_MOVER(scene->_destPosition.x, scene->_destPosition.y); + remove(); + break; + default: + break; + } +} + +void Scene560::Action3::signal() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + BF_GLOBALS._player.disableControl(); + setDelay(10); + break; + case 1: + if (scene->_field380) { + setDelay(10); + } else { + setAction(&scene->_action1, this); + } + break; + case 2: + BF_GLOBALS._sceneManager.changeScene(570); + break; + default: + break; + } +} + +/*--------------------------------------------------------------------------*/ + +bool Scene560::PicturePart::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + if (scene->_field380) { + SceneItem::display2(560, 54); + } else if ((scene->_sceneMode != 4) && (scene->_sceneMode != 3)) { + scene->_sceneMode = _flag + 4; + PlayerMover *mover = new PlayerMover(); + Common::Point destPos(139, 106); + BF_GLOBALS._player.addMover(mover, &destPos, scene); + } + return true; + default: + return NamedHotspotExt::startAction(action, event); + } +} + +/*--------------------------------------------------------------------------*/ + +bool Scene560::DeskChair::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + if ((action == CURSOR_USE) && !scene->_field380) { + scene->setAction(&scene->_action1); + return true; + } else { + return NamedObject::startAction(action, event); + } +} + +bool Scene560::Object2::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if (scene->_field380) { + SceneItem::display2(560, 54); + } else { + ADD_PLAYER_MOVER(289, 108); + } + return true; + default: + return NamedObjectExt::startAction(action, event); + } +} + +void Scene560::SafeInset::postInit(SceneObjectList *OwnerList) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + FocusObject::postInit(); + + _cursorVisage.setVisage(1, 5); + + if (BF_GLOBALS._safeCombination == 172) { + setFrame(2); + if (BF_INVENTORY.getObjectScene(INV_NICKEL) == 560) { + scene->_nickel.postInit(); + scene->_nickel.setVisage(560); + scene->_nickel.setStrip(2); + scene->_nickel.setFrame(3); + scene->_nickel.fixPriority(252); + scene->_nickel.setPosition(Common::Point(181, 140)); + scene->_nickel.setDetails(560, 47, 48, -1, 1, NULL); + BF_GLOBALS._sceneItems.remove(&scene->_nickel); + BF_GLOBALS._sceneItems.push_front(&scene->_nickel); + } + } else { + setFrame(1); + _item1.setDetails(Rect(143, 68, 159, 85), 560, 49, 50, -1, 1, NULL); + _item2.setDetails(Rect(159, 68, 175, 85), 560, 49, 50, -1, 1, NULL); + _item3.setDetails(Rect(175, 68, 191, 85), 560, 49, 50, -1, 1, NULL); + _item4.setDetails(Rect(143, 86, 159, 102), 560, 49, 50, -1, 1, NULL); + _item5.setDetails(Rect(159, 86, 175, 102), 560, 49, 50, -1, 1, NULL); + _item6.setDetails(Rect(175, 86, 191, 102), 560, 49, 50, -1, 1, NULL); + + BF_GLOBALS._sceneItems.remove(&_item1); + BF_GLOBALS._sceneItems.remove(&_item2); + BF_GLOBALS._sceneItems.remove(&_item3); + BF_GLOBALS._sceneItems.remove(&_item4); + BF_GLOBALS._sceneItems.remove(&_item5); + BF_GLOBALS._sceneItems.remove(&_item6); + BF_GLOBALS._sceneItems.push_front(&_item6); + BF_GLOBALS._sceneItems.push_front(&_item5); + BF_GLOBALS._sceneItems.push_front(&_item4); + BF_GLOBALS._sceneItems.push_front(&_item3); + BF_GLOBALS._sceneItems.push_front(&_item2); + BF_GLOBALS._sceneItems.push_front(&_item1); + + _item1._flag = 1; + _item2._flag = 2; + _item3._flag = 3; + _item4._flag = 4; + _item5._flag = 5; + _item6._flag = 6; + + _digit2.postInit(); + _digit2.setVisage(560); + _digit2.setStrip(3); + _digit2.setPosition(Common::Point(151, 94)); + _digit2.fixPriority(252); + + _digit1.postInit(); + _digit1.setVisage(560); + _digit1.setStrip(3); + _digit1.setPosition(Common::Point(167, 94)); + _digit1.fixPriority(252); + + _digit0.postInit(); + _digit0.setVisage(560); + _digit0.setStrip(3); + _digit0.setPosition(Common::Point(183, 94)); + _digit0.fixPriority(252); + + int amount = (BF_GLOBALS._safeCombination != 0) ? BF_GLOBALS._safeCombination : 1000; + + // Get digit 0 portion + int remainder = amount % 10; + amount /= 10; + _digit0.setFrame(!remainder ? 10 : remainder); + + // Get digit 1 portion + remainder = amount % 10; + amount /= 10; + _digit1.setFrame(!remainder ? 10 : remainder); + + // Get digit 2 portion + remainder = amount % 10; + _digit2.setFrame(!remainder ? 10 : remainder); + } +} + +void Scene560::SafeInset::remove() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + _item1.remove(); + _item2.remove(); + _item3.remove(); + _item4.remove(); + _item5.remove(); + _item6.remove(); + _digit2.remove(); + _digit1.remove(); + _digit0.remove(); + + scene->_nickel.remove(); + + if (BF_GLOBALS._events.getCursor() == CURSOR_USE) { + GfxSurface cursor = surfaceFromRes(1, 1, 2); + BF_GLOBALS._events.setCursor(cursor); + } + + FocusObject::remove(); +} + +void Scene560::SafeInset::signal() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + // Recalculate the new total + int total = 0; + if (_digit2._frame < 10) + total = _digit2._frame * 100; + if (_digit1._frame < 10) + total += _digit1._frame * 10; + if (_digit0._frame < 10) + total += _digit0._frame; + + BF_GLOBALS._safeCombination = !total ? 1000 : total; + + // Check if the combination is correct + if (total == 172) { + BF_GLOBALS._sceneObjects->draw(); + + if (!BF_GLOBALS.getFlag(fGotPointsForBank)) { + BF_GLOBALS._uiElements.addScore(50); + BF_GLOBALS.setFlag(fGotPointsForBank); + } + + GfxSurface cursor = surfaceFromRes(1, 1, 2); + BF_GLOBALS._events.setCursor(cursor); + + _item1.remove(); + _item2.remove(); + _item3.remove(); + _item4.remove(); + _item5.remove(); + _item6.remove(); + _digit2.remove(); + _digit1.remove(); + _digit0.remove(); + + if (BF_INVENTORY.getObjectScene(INV_NICKEL) == 560) { + // Nickel is still in the safe, show it + scene->_nickel.postInit(); + scene->_nickel.setVisage(560); + scene->_nickel.setStrip(2); + scene->_nickel.setFrame(3); + scene->_nickel.fixPriority(252); + scene->_nickel.setPosition(Common::Point(181, 140)); + scene->_nickel.setDetails(560, 47, 48, -1, 1, NULL); + BF_GLOBALS._sceneItems.remove(&scene->_nickel); + BF_GLOBALS._sceneItems.push_front(&scene->_nickel); + } + } +} +void Scene560::SafeInset::process(Event &event) { + if (_bounds.contains(event.mousePos)) { + if (BF_GLOBALS._events.getCursor() == CURSOR_USE) { + GfxSurface cursor = _cursorVisage.getFrame(6); + BF_GLOBALS._events.setCursor(cursor); + } else { + BF_GLOBALS._events.proc1(); + } + + if ((event.eventType == EVENT_BUTTON_DOWN) && (BF_GLOBALS._events.getCursor() == CURSOR_WALK) && + (event.btnState == 3)) { + BF_GLOBALS._events.setCursor(CURSOR_USE); + event.handled = true; + } + } else { + GfxSurface cursor = _cursorVisage.getFrame(7); + BF_GLOBALS._events.setCursor(cursor); + + if ((event.mousePos.y < BF_INTERFACE_Y) && (event.eventType == EVENT_BUTTON_DOWN)) { + // Leave the safe view + event.handled = true; + remove(); + } + } +} + +bool Scene560::SafeInset::Item::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + switch (_flag) { + case 0: { + int newFrame = scene->_safeInset._digit2._frame + 1; + if (newFrame == 11) + newFrame = 1; + + scene->_safeInset._digit2.setFrame(newFrame); + break; + } + case 1: { + int newFrame = scene->_safeInset._digit1._frame + 1; + if (newFrame == 11) + newFrame = 1; + + scene->_safeInset._digit1.setFrame(newFrame); + break; + } + case 2: { + int newFrame = scene->_safeInset._digit0._frame + 1; + if (newFrame == 11) + newFrame = 1; + + scene->_safeInset._digit0.setFrame(newFrame); + break; + } + case 3: { + int newFrame = scene->_safeInset._digit2._frame - 1; + if (newFrame == 0) + newFrame = 10; + + scene->_safeInset._digit2.setFrame(newFrame); + break; + } + case 4: { + int newFrame = scene->_safeInset._digit1._frame - 1; + if (newFrame == 0) + newFrame = 10; + + scene->_safeInset._digit1.setFrame(newFrame); + break; + } + case 5: { + int newFrame = scene->_safeInset._digit0._frame - 1; + if (newFrame == 0) + newFrame = 10; + + scene->_safeInset._digit0.setFrame(newFrame); + break; + } + default: + break; + } + + scene->_safeInset.signal(); + scene->_sound1.play(75); + return true; + default: + return NamedHotspotExt::startAction(action, event); + } +} + +bool Scene560::Nickel::startAction(CursorType action, Event &event) { + if (action == CURSOR_USE) { + BF_INVENTORY.setObjectScene(INV_NICKEL, 1); + BF_GLOBALS._uiElements.addScore(10); + remove(); + return true; + } else { + return NamedObject::startAction(action, event); + } +} + +void Scene560::Object5::postInit(SceneObjectList *OwnerList) { + FocusObject::postInit(); + _item1.setDetails(Rect(110, 48, 189, 102), 560, 43, 44, -1, 1, NULL); + BF_GLOBALS._sceneItems.remove(&_item1); + BF_GLOBALS._sceneItems.push_front(&_item1); +} + +void Scene560::Object5::remove() { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + if (scene->_sceneMode != 3) + scene->_sceneMode = 0; + + _item1.remove(); + FocusObject::remove(); +} + +bool Scene560::Object5::Item1::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + if (!BF_GLOBALS.getFlag(fGotPointsForBox)) { + BF_GLOBALS._uiElements.addScore(10); + BF_GLOBALS.setFlag(fGotPointsForBox); + } + + scene->_safeInset.postInit(); + scene->_safeInset.setVisage(560); + scene->_safeInset.setStrip(2); + scene->_safeInset.setPosition(Common::Point(160, 141)); + scene->_safeInset.fixPriority(251); + scene->_safeInset.setDetails(560, 45, 46, -1); + + scene->_sceneMode = 3; + scene->_object5.remove(); + + GfxSurface cursor = surfaceFromRes(1, 5, 6); + BF_GLOBALS._events.setCursor(cursor); + return true; + } else { + return NamedHotspot::startAction(action, event); + } +} + +/*--------------------------------------------------------------------------*/ + +bool Scene560::Computer::startAction(CursorType action, Event &event) { + Scene560 *scene = (Scene560 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if (BF_GLOBALS._bookmark < bTalkedToGrannyAboutSkipsCard) { + SceneItem::display2(666, 24); + } else { + scene->setAction(&scene->_action3); + } + return true; + default: + return NamedHotspot::startAction(action, event); + } +} + +/*--------------------------------------------------------------------------*/ + +Scene560::Scene560(): SceneExt() { + _field380 = _field11EA = 0; +} + +void Scene560::postInit(SceneObjectList *OwnerList) { + SceneExt::postInit(); + loadScene(560); + setZoomPercents(100, 60, 168, 90); + _stripManager.addSpeaker(&_gameTextSpeaker); + + _picture1.setDetails(Rect(121, 16, 139, 35), 560, -1, -1, -1, 1, NULL); + _picture2.setDetails(Rect(139, 16, 157, 35), 560, -1, -1, -1, 1, NULL); + _picture3.setDetails(Rect(121, 35, 139, 54), 560, -1, -1, -1, 1, NULL); + _picture4.setDetails(Rect(139, 35, 157, 54), 560, -1, -1, -1, 1, NULL); + _picture1._flag = 3; + _picture2._flag = 4; + _picture3._flag = 2; + _picture4._flag = 1; + + if (BF_GLOBALS._dayNumber == 0) + BF_GLOBALS._dayNumber = 3; + + if (BF_GLOBALS._bookmark >= bTalkedToGrannyAboutSkipsCard) { + _object2.postInit(); + _object2.setVisage(560); + _object2.setStrip(4); + _object2.setFrame(1); + _object2.setPosition(Common::Point(295, 37)); + _object2.setDetails(560, 41, 42, -1, 1, NULL); + } + + _deskChair.postInit(); + _deskChair.setVisage(561); + _deskChair.setStrip(3); + _deskChair.setPosition(Common::Point(81, 149)); + _deskChair.fixPriority(151); + _deskChair.changeZoom(81); + + if (BF_GLOBALS._sceneManager._previousScene == 570) { + // Returning from using computer + BF_GLOBALS._events.setCursor(CURSOR_USE); + + _deskChair.hide(); + + BF_GLOBALS._player.postInit(); + BF_GLOBALS._player.setVisage(561); + BF_GLOBALS._player.setStrip(2); + BF_GLOBALS._player.setFrame(BF_GLOBALS._player.getFrameCount()); + BF_GLOBALS._player._moveDiff.x = 11; + BF_GLOBALS._player.setPosition(Common::Point(96, 138)); + BF_GLOBALS._player.changeZoom(81); + + _deskChair.setFrame(BF_GLOBALS._player._frame); + _deskChair.setStrip(BF_GLOBALS._player._strip); + _deskChair.setPosition(BF_GLOBALS._player._position); + + _field11EA = 0; + _field380 = 1; + } else { + // Entering study through doorway + _field11EA = 0; + _field380 = 0; + + BF_GLOBALS._player.postInit(); + BF_GLOBALS._player.setVisage(563); + BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); + BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + BF_GLOBALS._player.setPosition(Common::Point(79, 110)); + BF_GLOBALS._player._moveDiff.x = 11; + BF_GLOBALS._player.changeZoom(-1); + BF_GLOBALS._player.disableControl(); + + _sceneMode = 10; + ADD_MOVER(BF_GLOBALS._player, 85, 115); + } + + _computer.setDetails(Rect(16, 77, 58, 107), 560, 2, -1, -1, 1, NULL); + _deskChair.setDetails(560, 3, -1, -1, 1, NULL); + _chair.setDetails(Rect(163, 64, 196, 102), 560, 13, 25, 36, 1, NULL); + _lamp.setDetails(Rect(197, 43, 214, 56), 560, 7, 19, 30, 1, NULL); + _item4.setDetails(Rect(121, 18, 156, 54), 560, 8, 20, 31, 1, NULL); + _trophy.setDetails(Rect(259, 52, 275, 63), 560, 10, 22, 33, 1, NULL); + _watercolours.setDetails(Rect(214, 48, 239, 64), 560, 12, 24, 35, 1, NULL); + _fileCabinets.setDetails(Rect(0, 47, 49, 100), 560, 14, 26, 37, 1, NULL); + _certificate.setDetails(Rect(280, 51, 292, 62), 560, 11, 23, 34, 1, NULL); + _bookcase.setDetails(Rect(176, 0, 319, 103), 560, 9, 21, 32, 1, NULL); + _desk.setDetails(1, 560, 6, 10, 29, 1); + _item12.setDetails(Rect(62, 16, 96, 101), 560, 51, 52, 53, 1, NULL); + _carpet.setDetails(Rect(0, 103, 319, 167), 560, 5, 16, 28, 1, NULL); + _office.setDetails(Rect(0, 0, 320, 168), 560, 4, -1, -1, 1, NULL); + + BF_GLOBALS._player.enableControl(); +} + +void Scene560::signal() { + switch (_sceneMode) { + case 1: + _object6.hide(); + _object6.remove(); + BF_GLOBALS._player.enableControl(); + break; + case 5: + case 6: + case 7: + case 8: + BF_GLOBALS._player._strip = 4; + BF_GLOBALS._player._frame = 1; + BF_GLOBALS._player.disableControl(); + + _object6.postInit(); + _object6.setVisage(560); + _object6.setStrip(1); + _object6.setFrame(_sceneMode - 4); + _object6.setPosition(Common::Point(160, 141)); + _object6.fixPriority(250); + _stripManager.start(_sceneMode + 5595, this); + _sceneMode = 1; + break; + case 9: + _object6._strip = 4; + _object6._frame = 1; + + if (BF_GLOBALS._safeCombination == 172) { + if (_sceneMode != 3) { + _safeInset.postInit(); + _safeInset.setVisage(560); + _safeInset.setStrip(2); + _safeInset.setPosition(Common::Point(160, 141)); + _safeInset.fixPriority(251); + _safeInset.setDetails(560, 45, 46, -1); + + _sceneMode = 3; + } + } else if ((_sceneMode != 3) && (_sceneMode != 4)) { + if (!BF_GLOBALS.getFlag(fGotPointsForPunch)) { + BF_GLOBALS._uiElements.addScore(10); + BF_GLOBALS.setFlag(fGotPointsForPunch); + } + + _object5.postInit(); + _object5.setVisage(560); + _object5.setStrip(2); + _object5.setFrame(4); + _object5.setPosition(Common::Point(160, 141)); + _object5.fixPriority(251); + _object5.setDetails(560, 43, 44, -1); + + _sceneMode = 4; + } + break; + case 10: + _field11EA = 0; + BF_GLOBALS._player.enableControl(); + break; + case 11: + BF_GLOBALS._sceneManager.changeScene(270); + break; + } +} + +void Scene560::process(Event &event) { + if ((event.eventType == EVENT_BUTTON_DOWN) && (BF_GLOBALS._events.getCursor() == CURSOR_WALK) && + (_field380 == 1) && !_action) { + _destPosition = event.mousePos; + BF_GLOBALS._player.disableControl(); + setAction(&_action2); + + event.handled = true; + } + + SceneExt::process(event); +} + +void Scene560::dispatch() { + if (!_field11EA && (BF_GLOBALS._player._position.y < 105)) { + _field11EA = 1; + BF_GLOBALS._player.disableControl(); + BF_GLOBALS._sceneManager.changeScene(270); + } + + SceneExt::dispatch(); +} + } // End of namespace BlueForce } // End of namespace TsAGE diff --git a/engines/tsage/blue_force/blueforce_scenes5.h b/engines/tsage/blue_force/blueforce_scenes5.h index 94594f9594..d30289a4d4 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.h +++ b/engines/tsage/blue_force/blueforce_scenes5.h @@ -136,11 +136,109 @@ public: Scene551(); virtual void synchronize(Serializer &s); - void postInit(SceneObjectList *OwnerList); + void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); virtual void dispatch(); }; +class Scene560: public SceneExt { + /* Objects */ + class DeskChair: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Object2: public NamedObjectExt { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class SafeInset: public FocusObject { + /* Items */ + class Item: public NamedHotspotExt { + public: + virtual bool startAction(CursorType action, Event &event); + }; + public: + NamedObject _digit0, _digit1, _digit2; + Item _item1, _item2, _item3, _item4, _item5, _item6; + Visage _cursorVisage; + + virtual Common::String getClassName() { return "Scene560_SafeInset"; } + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void process(Event &event); + }; + class Nickel: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Object5: public FocusObject { + /* Items */ + class Item1: public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + public: + Item1 _item1; + + virtual Common::String getClassName() { return "Scene560_Object5"; } + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + }; + + /* Item groups */ + class PicturePart: public NamedHotspotExt { + public: + virtual Common::String getClassName() { return "Scene560_Group1"; } + virtual bool startAction(CursorType action, Event &event); + }; + + /* Items */ + class Computer: public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + }; + class Action3: public Action { + public: + virtual void signal(); + }; +public: + Action1 _action1; + Action2 _action2; + Action3 _action3; + SpeakerGameText _gameTextSpeaker; + DeskChair _deskChair; + Object2 _object2; + SafeInset _safeInset; + Nickel _nickel; + Object5 _object5; + NamedObject _object6; + PicturePart _picture1, _picture2, _picture3, _picture4;; + Computer _computer; + NamedHotspot _chair, _lamp, _item4, _trophy, _watercolours, _fileCabinets; + NamedHotspot _certificate, _bookcase, _desk, _carpet, _item12, _office; + ASound _sound1; + int _field380, _field11EA; + Common::Point _destPosition; + + Scene560(); + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void process(Event &event); + virtual void dispatch(); + +}; + } // End of namespace BlueForce } // End of namespace TsAGE diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 78ae893a81..5025b4d5cf 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -123,6 +123,7 @@ public: uint32 getFrameNumber() const { return _frameNumber; } void delay(int numFrames); bool isInventoryIcon() const { return _currentCursor < 256; } + void proc1() { warning("TODO: EventsClass::proc1"); } virtual void listenerSynchronize(Serializer &s); static void loadNotifierProc(bool postFlag); diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index ef0e7fdc14..808dfd5739 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -193,6 +193,7 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsSint16LE(_v4CEA4); s.syncAsSint16LE(_marinaWomanCtr); s.syncAsSint16LE(_v4CEB6); + s.syncAsSint16LE(_safeCombination); s.syncAsSint16LE(_v4CEC0); s.syncAsSint16LE(_v4CEC2); s.syncAsSint16LE(_v4CEC8); @@ -238,6 +239,7 @@ void BlueForceGlobals::reset() { _v4CEA4 = 0; _marinaWomanCtr = 0; _v4CEB6 = 0; + _safeCombination = 0; _v4CEC0 = 0; _v4CEC2 = 0; _v4CEC8 = 1; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 8fba716878..86ad025339 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -171,6 +171,7 @@ public: int _v4CEA4; int _marinaWomanCtr; int _v4CEB6; + int _safeCombination; int _v4CEC0; int _v4CEC2; int _v4CEC8; |