diff options
author | Paul Gilbert | 2011-09-15 23:16:57 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-09-15 23:16:57 +1000 |
commit | 559d40a643fd69c0befdcb494c6a61872cf74248 (patch) | |
tree | 2451d3f7a84ab4b1b99378faf3ae13c00ed46373 /engines/tsage/blue_force | |
parent | b24f9b4d4b5fec7d9c4aaca5035dd82a06210573 (diff) | |
download | scummvm-rg350-559d40a643fd69c0befdcb494c6a61872cf74248.tar.gz scummvm-rg350-559d40a643fd69c0befdcb494c6a61872cf74248.tar.bz2 scummvm-rg350-559d40a643fd69c0befdcb494c6a61872cf74248.zip |
TSAGE: Implemented Blue Force scene 830 - Outside Boat Rentals
Diffstat (limited to 'engines/tsage/blue_force')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 7 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.h | 1 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes8.cpp | 439 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes8.h | 55 |
4 files changed, 502 insertions, 0 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index f5dd664826..51e0551071 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -137,6 +137,8 @@ Scene *BlueForceGame::createScene(int sceneNumber) { case 810: case 820: case 830: + // Outside Boat Rentals + return new Scene830(); case 840: case 850: case 860: @@ -688,6 +690,11 @@ void PalettedScene::remove() { BF_GLOBALS._scenePalette._field412 = 0; } +PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action *action) { + _field794 = 1; + return BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, step, action); +} + /*--------------------------------------------------------------------------*/ void SceneHandlerExt::postInit(SceneObjectList *OwnerList) { diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index f7d647d0c8..373a81e0fa 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -182,6 +182,7 @@ public: virtual void synchronize(Serializer &s); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); + PaletteFader *addFader(const byte *arrBufferRGB, int step, Action *action); }; class SceneHandlerExt: public SceneHandler { diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index c34c6526ef..55ea403874 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -356,6 +356,445 @@ void Scene800::dispatch() { } } +/*-------------------------------------------------------------------------- + * Scene 830 - Outside Boat Rentals + * + *--------------------------------------------------------------------------*/ + +bool Scene830::Lyle::startAction(CursorType action, Event &event) { + Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_TALK: + if (scene->_field18AA) { + scene->_stripManager.start(8304, &BF_GLOBALS._stripProxy); + } else { + scene->_stripManager.start(8303, &BF_GLOBALS._stripProxy); + ++scene->_field18AA; + } + return true; + default: + return NamedObject::startAction(action, event); + } +} + +bool Scene830::Door::startAction(CursorType action, Event &event) { + Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + if (BF_GLOBALS._dayNumber == 2) { + scene->_sceneMode = 14; + Common::Point pt(186, 102); + PlayerMover *mover = new PlayerMover(); + BF_GLOBALS._player.addMover(mover, &pt, NULL); + return true; + } + break; + case CURSOR_USE: + if (BF_GLOBALS._dayNumber == 2) { + scene->_sceneMode = 14; + Common::Point pt(186, 102); + PlayerMover *mover = new PlayerMover(); + BF_GLOBALS._player.addMover(mover, &pt, NULL); + } else if (scene->_field18A4) { + BF_GLOBALS._player.disableControl(); + scene->_sceneMode = 832; + + if (BF_GLOBALS.getFlag(onDuty)) { + scene->setAction(&scene->_sequenceManager, scene, 8302, &BF_GLOBALS._player, &scene->_door, NULL); + } else if (BF_GLOBALS.getFlag(fWithLyle)) { + scene->_sceneMode = 11; + scene->setAction(&scene->_sequenceManager, scene, 8308, &BF_GLOBALS._player, &scene->_door, &scene->_lyle, NULL); + } else { + scene->setAction(&scene->_sequenceManager, scene, 832, &BF_GLOBALS._player, &scene->_door, NULL); + } + } else { + scene->_stripManager.start(8305, &BF_GLOBALS._stripProxy); + ADD_PLAYER_MOVER_NULL(BF_GLOBALS._player, 192, 145); + } + return true; + default: + break; + } + + return NamedObject::startAction(action, event); +} + +bool Scene830::Object4::startAction(CursorType action, Event &event) { + Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; + + if (action == INV_RENTAL_KEYS) { + BF_GLOBALS._player.disableControl(); + if (BF_GLOBALS.getFlag(fWithLyle)) { + scene->_sceneMode = 8300; + scene->setAction(&scene->_sequenceManager, scene, 8300, &BF_GLOBALS._player, &scene->_lyle, NULL); + } else { + scene->_sceneMode = 834; + scene->setAction(&scene->_sequenceManager, scene, 8300, &BF_GLOBALS._player, &scene->_object4, NULL); + } + return true; + } else { + return NamedObject::startAction(action, event); + } +} + +bool Scene830::Object5::startAction(CursorType action, Event &event) { + Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + BF_GLOBALS._player.disableControl(); + scene->_sceneMode = 8307; + scene->setAction(&scene->_sequenceManager, scene, 8307, &BF_GLOBALS._player, &scene->_object5, NULL); + return true; + } else { + return NamedObject::startAction(action, event); + } +} + +/*--------------------------------------------------------------------------*/ + +bool Scene830::SouthEastExit::startAction(CursorType action, Event &event) { + ADD_PLAYER_MOVER(BF_GLOBALS._player._position.x + 80, BF_GLOBALS._player._position.y + 100); + return true; +} + +bool Scene830::NoteBoard::startAction(CursorType action, Event &event) { + Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_LOOK: + if (BF_GLOBALS._sceneObjects->contains(&scene->_object6)) { + BF_GLOBALS._player.disableControl(); + scene->_sceneMode = 8309; + scene->setAction(&scene->_sequenceManager, scene, 8309, &BF_GLOBALS._player, NULL); + return true; + } + break; + case CURSOR_USE: + if (BF_GLOBALS._sceneObjects->contains(&scene->_object6)) { + BF_GLOBALS._player.disableControl(); + scene->_sceneMode = 8305; + scene->setAction(&scene->_sequenceManager, scene, 8305, &BF_GLOBALS._player, &scene->_object6, NULL); + return true; + } + break; + default: + break; + } + + return NamedHotspot::startAction(action, event); +} + +/*--------------------------------------------------------------------------*/ + +Scene830::Scene830(): PalettedScene() { + _field18A4 = _field18A6 = _field18A8 = _field18AA = _field18AC = 0; +} + +void Scene830::synchronize(Serializer &s) { + PalettedScene::synchronize(s); + s.syncAsByte(_field18A4); + s.syncAsByte(_field18A6); + s.syncAsByte(_field18A8); + s.syncAsByte(_field18AA); + s.syncAsByte(_field18AC); +} + +void Scene830::postInit(SceneObjectList *OwnerList) { + PalettedScene::postInit(); + loadScene(830); + _sound1.fadeSound(35); + + _stripManager.addSpeaker(&_gameTextSpeaker); + _stripManager.addSpeaker(&_jakeJacketSpeaker); + _stripManager.addSpeaker(&_lyleHatSpeaker); + + if (BF_GLOBALS._dayNumber == 0) { + BF_GLOBALS._sceneManager._previousScene = 340; + BF_GLOBALS._dayNumber = 1; + BF_GLOBALS.setFlag(fWithLyle); + } + + _field18A8 = (BF_GLOBALS._dayNumber <= 3) ? 0 : 1; + _field18AC = 0; + BF_GLOBALS.clearFlag(fCanDrawGun); + + _seExit.setDetails(Rect(183, 161, 320, 167), 830, -1, -1, -1, 1, NULL); + + PaletteRotation *rot = BF_GLOBALS._scenePalette.addRotation(184, 189, 1); + rot->setDelay(30); + + BF_GLOBALS._player.postInit(); + BF_GLOBALS._player.disableControl(); + + if (_field18A8) { + _object4.postInit(); + _object4.setVisage(830); + _object4.setStrip(1); + _object4.setPosition(Common::Point(271, 146)); + _object4.fixPriority(90); + _object4.setDetails(830, 0, 1, 2, 1, NULL); + } + + _door.postInit(); + _door.setVisage(830); + _door.setDetails(830, 3, 4, -1, 1, NULL); + _door.setStrip((BF_GLOBALS._dayNumber == 2) ? 4 : 3); + _door.setPosition(Common::Point(182, 97)); + + _field18A4 = 1; + _noteBoard.setDetails(1, 830, 30, 31, 32, 1); + + switch (BF_GLOBALS._dayNumber) { + case 1: + if ((BF_GLOBALS._bookmark >= bEndOfWorkDayOne) && (BF_INVENTORY.getObjectScene(INV_CARTER_NOTE) != 1) && + (BF_INVENTORY.getObjectScene(INV_CARTER_NOTE) != 3)) { + _object6.postInit(); + _object6.setVisage(830); + _object6.setStrip(4); + _object6.setFrame(2); + _object6.setPosition(Common::Point(302, 124)); + } + break; + case 4: + if (BF_INVENTORY.getObjectScene(INV_FISHING_NET) == 830) { + _object5.postInit(); + _object5.setVisage(830); + _object5.setStrip(2); + _object5.setFrame(2); + _object5.setPosition(Common::Point(126, 133)); + _object5.setDetails(830, 7, 8, -1, 1, NULL); + } + break; + case 5: + if ((BF_GLOBALS._sceneManager._previousScene == 840) && (BF_INVENTORY.getObjectScene(INV_RENTAL_KEYS) == 1) && + !BF_GLOBALS.getFlag(fWithLyle)) { + _field18A4 = 0; + + _lyle.postInit(); + _lyle._flags = OBJFLAG_CHECK_REGION; + _lyle.setVisage(835); + _lyle.setObjectWrapper(new SceneObjectWrapper()); + _lyle.animate(ANIM_MODE_1, NULL); + _lyle.setStrip(4); + _lyle.setPosition(Common::Point(180, 154)); + _lyle._moveDiff = Common::Point(2, 0); + _lyle.setDetails(830, 28, -1, 29, 1, NULL); + + _field18AC = 1; + } + break; + } + + _item2.setDetails(7, 830, 9, 10, 11, 1); + _item4.setDetails(2, 830, 12, 13, 14, 1); + _item5.setDetails(3, 830, 15, 16, 17, 1); + _item6.setDetails(4, 830, 18, 19, 20, 1); + _item7.setDetails(5, 830, 21, 22, 23, 1); + _item8.setDetails(6, 830, 24, 25, 26, 1); + + switch (BF_GLOBALS._sceneManager._previousScene) { + case 840: + _sceneMode = 833; + if (BF_GLOBALS.getFlag(onDuty)) { + setAction(&_sequenceManager, this, 8304, &BF_GLOBALS._player, &_door, NULL); + } else if (BF_GLOBALS.getFlag(fWithLyle)) { + _lyle.postInit(); + _lyle._moveDiff = Common::Point(2, 0); + _sceneMode = 837; + setAction(&_sequenceManager, this, 837, &_lyle, &_door, &BF_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager, this, 833, &BF_GLOBALS._player, &_door, NULL); + } + break; + case 850: + BF_GLOBALS._player.setVisage(831); + BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); + BF_GLOBALS._player.setStrip(3); + BF_GLOBALS._player._moveDiff = Common::Point(2, 0); + BF_GLOBALS._player.setPosition(Common::Point(220, 122)); + BF_GLOBALS._player.enableControl(); + + if (BF_GLOBALS.getFlag(fWithLyle)) { + _lyle.postInit(); + _lyle.setVisage(835); + _lyle.setObjectWrapper(new SceneObjectWrapper()); + _lyle.animate(ANIM_MODE_1, NULL); + _lyle.setStrip(3); + _lyle._moveDiff = Common::Point(2, 0); + _lyle.setPosition(Common::Point(224, 126)); + } + + if ((BF_GLOBALS._bookmark == bEndDayThree) && (BF_INVENTORY.getObjectScene(INV_FISHING_NET) == 1)) { + BF_INVENTORY.setObjectScene(INV_FISHING_NET, 0); + BF_INVENTORY.setObjectScene(INV_HOOK, 0); + } + break; + case 340: + case 830: + default: + _sceneMode = 830; + setAction(&_sequenceManager, this, BF_GLOBALS.getFlag(onDuty) ? 8303 : 830, &BF_GLOBALS._player, NULL); + + if (BF_GLOBALS.getFlag(fWithLyle)) { + _lyle.postInit(); + _lyle.setVisage(835); + _lyle.setObjectWrapper(new SceneObjectWrapper()); + _lyle.animate(ANIM_MODE_1, NULL); + _lyle.setPosition(Common::Point(SCREEN_WIDTH, SCREEN_HEIGHT)); + _lyle._moveDiff = Common::Point(2, 0); + ADD_MOVER(_lyle, 280, 160); + } + break; + } + + _field18A6 = 1; +} + +void Scene830::remove() { + BF_GLOBALS._scenePalette.clearListeners(); + PalettedScene::remove(); +} + +void Scene830::signal() { + static uint32 black = 0; + + switch (_sceneMode) { + case 11: + _sceneMode = 832; + BF_GLOBALS._scenePalette.clearListeners(); + addFader((const byte *)&black, 5, this); + BF_GLOBALS._v51C44 = 0; + break; + case 12: + _sceneMode = 831; + BF_GLOBALS._scenePalette.clearListeners(); + addFader((const byte *)&black, 5, this); + BF_GLOBALS._v51C44 = 0; + break; + case 13: + BF_GLOBALS._sceneManager.changeScene(850); + break; + case 14: + BF_GLOBALS._player.disableControl(); + _sceneMode = 8312; + + _object1.postInit(); + setAction(&_sequenceManager, this, 8312, &_object1, NULL); + break; + case 830: + _field18A6 = 1; + BF_GLOBALS._player.enableControl(); + break; + case 831: + case 8306: + BF_GLOBALS._sceneManager.changeScene((BF_GLOBALS._bookmark < bStartOfGame) || + (BF_GLOBALS._bookmark >= bCalledToDomesticViolence) ? 342 : 340); + break; + case 832: + BF_GLOBALS._sceneManager.changeScene(840); + break; + case 833: + if (_field18AC) { + BF_GLOBALS.setFlag(fWithLyle); + _sceneMode = 8311; + setAction(&_sequenceManager, this, 8311, &BF_GLOBALS._player, &_lyle, NULL); + } else { + BF_GLOBALS._player.enableControl(); + BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); + BF_GLOBALS._player._strip = 3; + BF_GLOBALS._player._frame = 1; + } + break; + case 834: + BF_GLOBALS._sceneManager.changeScene(850); + break; + case 837: + BF_GLOBALS._player.enableControl(); + break; + case 8300: + _sceneMode = 13; + BF_GLOBALS._scenePalette.clearListeners(); + addFader((const byte *)&black, 5, this); + break; + case 8305: + _object6.remove(); + BF_GLOBALS._player.enableControl(); + BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); + BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); + BF_GLOBALS._player._strip = 7; + + BF_GLOBALS._uiElements.addScore(30); + BF_INVENTORY.setObjectScene(INV_CARTER_NOTE, 1); + break; + case 8307: + BF_GLOBALS._player.enableControl(); + _object5.remove(); + BF_GLOBALS._uiElements.addScore(30); + BF_INVENTORY.setObjectScene(INV_FISHING_NET, 1); + break; + case 8309: + case 8311: + BF_GLOBALS._player.enableControl(); + break; + case 8312: + _object1.remove(); + BF_GLOBALS._player.enableControl(); + break; + } +} + +void Scene830::process(Event &event) { + if (BF_GLOBALS._player._enabled && (event.eventType == EVENT_BUTTON_DOWN) && + (BF_GLOBALS._events.getCursor() == CURSOR_WALK) && !_field18A4) { + _stripManager.start(8306, &BF_GLOBALS._stripProxy); + event.handled = true; + } + + if (BF_GLOBALS._player._enabled && (event.mousePos.y < (BF_INTERFACE_Y - 1))) { + // Check if the cursor is on an exit + if (_seExit.contains(event.mousePos)) { + GfxSurface surface = _cursorVisage.getFrame(EXITFRAME_SE); + BF_GLOBALS._events.setCursor(surface); + } else { + // In case an exit cursor was being shown, restore the previously selected cursor + CursorType cursorId = BF_GLOBALS._events.getCursor(); + BF_GLOBALS._events.setCursor(cursorId); + } + } +} + +void Scene830::dispatch() { + SceneExt::dispatch(); + + if (!_action && _field18A6 && (BF_GLOBALS._player._position.y > 160)) { + if (!_field18A4) { + _stripManager.start(8305, &BF_GLOBALS._player); + ADD_PLAYER_MOVER_NULL(BF_GLOBALS._player, 192, 145); + } else if ((BF_INVENTORY.getObjectScene(INV_RENTAL_KEYS) == 1) && (BF_GLOBALS._bookmark == bEndDayThree)) { + BF_GLOBALS._player.disableControl(); + SceneItem::display2(830, 27); + _field18A6 = 0; + _sceneMode = 830; + ADD_PLAYER_MOVER(BF_GLOBALS._player._position.x - 10, BF_GLOBALS._player._position.y - 10); + } else { + BF_GLOBALS._player.disableControl(); + _field18A6 = 0; + _sceneMode = 831; + ADD_PLAYER_MOVER(BF_GLOBALS._player._position.x + 40, BF_GLOBALS._player._position.y + 40); + + if (BF_GLOBALS.getFlag(fWithLyle)) { + ADD_MOVER_NULL(_lyle, SCREEN_WIDTH, SCREEN_HEIGHT); + if (_lyle._position.y < 160) + _sceneMode = 12; + } + } + } +} + } // End of namespace BlueForce } // End of namespace TsAGE diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index 5d87094cf5..05e2173a9b 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -99,6 +99,61 @@ public: virtual void dispatch(); }; +class Scene830: public PalettedScene { + /* Items */ + class SouthEastExit: public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class NoteBoard: public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + /* Objects */ + class Lyle: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Door: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Object4: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Object5: public NamedObject { + public: + virtual bool startAction(CursorType action, Event &event); + }; + +public: + SequenceManager _sequenceManager; + SpeakerGameText _gameTextSpeaker; + SpeakerJakeJacket _jakeJacketSpeaker; + SpeakerLyleHat _lyleHatSpeaker; + NamedObject _object1, _lyle, _object6; + Door _door; + Object4 _object4; + Object5 _object5; + SouthEastExit _seExit; + NoteBoard _noteBoard; + NamedHotspot _item2, _item4, _item5; + NamedHotspot _item6, _item7, _item8; + ASoundExt _sound1; + int _field18A4, _field18A6, _field18A8, _field18AA, _field18AC; + + Scene830(); + virtual void synchronize(Serializer &s); + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void process(Event &event); + virtual void dispatch(); +}; + + } // End of namespace BlueForce } // End of namespace TsAGE |