aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/blue_force/blueforce_scenes1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tsage/blue_force/blueforce_scenes1.cpp')
-rw-r--r--engines/tsage/blue_force/blueforce_scenes1.cpp217
1 files changed, 217 insertions, 0 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp
index 0f0ab6c1c3..8e744a4ee3 100644
--- a/engines/tsage/blue_force/blueforce_scenes1.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes1.cpp
@@ -192,4 +192,221 @@ void BF_Scene100::signal() {
}
}
+/*--------------------------------------------------------------------------
+ * Scene 109 - Introduction Bar Room
+ *
+ *--------------------------------------------------------------------------*/
+
+void BF_Scene109::Action1::signal() {
+ BF_Scene109 *scene = (BF_Scene109 *)BF_GLOBALS._sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ setDelay(30);
+ break;
+ case 1:
+ BF_GLOBALS._sound1.play(12);
+ BF_GLOBALS._sceneObjects->draw();
+ BF_GLOBALS._scenePalette.loadPalette(2);
+ BF_GLOBALS._scenePalette.refresh();
+ setDelay(10);
+ break;
+ case 2:
+ scene->_text.setup(BF_19840515, this);
+ break;
+ case 3:
+ BF_GLOBALS._v51C44 = 1;
+ scene->loadScene(115);
+
+ scene->_protaginist2.show();
+ scene->_protaginist2.setPriority(133);
+ scene->_protaginist1.show();
+ scene->_bartender.show();
+ scene->_object1.show();
+ scene->_object6.show();
+ scene->_object6.setAction(&scene->_action3);
+ scene->_object2.show();
+ scene->_object9.show();
+ scene->_object9.setAction(&scene->_action2);
+
+ BF_GLOBALS._v501FC = 170;
+ setDelay(60);
+ break;
+ case 4:
+ scene->_bartender.setAction(&scene->_sequenceManager4, NULL, 109, &scene->_bartender, &scene->_object2, NULL);
+ scene->_protaginist1.setAction(&scene->_sequenceManager5, NULL, 107, &scene->_protaginist1, NULL);
+ scene->_protaginist2.setAction(&scene->_sequenceManager6, this, 106, &scene->_protaginist2, NULL);
+ break;
+ case 5:
+ scene->setAction(&scene->_sequenceManager6, this, 105, &scene->_object10, NULL);
+ break;
+ case 6:
+ scene->_object10.remove();
+ scene->setAction(&scene->_sequenceManager6, this, 100, &scene->_object10, NULL);
+ break;
+ case 7:
+ scene->_object7.setAction(&scene->_sequenceManager7, NULL, 103, &scene->_object7, NULL);
+ scene->_object5.setAction(&scene->_sequenceManager8, this, 102, &scene->_object5, NULL);
+ scene->_protaginist2.setAction(&scene->_sequenceManager6, NULL, 104, &scene->_protaginist2, &scene->_bartender, NULL);
+ break;
+ case 8:
+ scene->setAction(&scene->_sequenceManager8, this, 101, &scene->_object5, &scene->_protaginist1, NULL);
+ break;
+ case 9:
+ scene->_protaginist1.setAction(&scene->_sequenceManager5, this, 98, &scene->_protaginist1, NULL);
+ scene->_object7.setAction(&scene->_sequenceManager7, NULL, 99, &scene->_object7, NULL);
+ break;
+ case 10:
+ scene->_sceneMode = 1;
+ remove();
+ break;
+ }
+}
+
+void BF_Scene109::Action2::signal() {
+ BF_Scene109 *scene = (BF_Scene109 *)BF_GLOBALS._sceneManager._scene;
+ scene->setAction(&scene->_sequenceManager2, this, 3117, &scene->_object9, NULL);
+}
+
+void BF_Scene109::Action3::signal() {
+ BF_Scene109 *scene = (BF_Scene109 *)BF_GLOBALS._sceneManager._scene;
+ scene->setAction(&scene->_sequenceManager3, this, 108, &scene->_object6, NULL);
+}
+
+/*--------------------------------------------------------------------------*/
+
+BF_Scene109::Text::Text(): SceneText() {
+ _action = NULL;
+ _frameNumber = 0;
+ _diff = 0;
+}
+
+void BF_Scene109::Text::setup(const Common::String &msg, Action *action) {
+ _frameNumber = BF_GLOBALS._events.getFrameNumber();
+ _diff = 180;
+ _action = action;
+ _fontNumber = 4;
+ _width = 300;
+ _textMode = ALIGN_CENTER;
+ _color1 = BF_GLOBALS._scenePalette._colors.background;
+ _color2 = _color3 = 0;
+
+ SceneText::setup(msg);
+
+ // Center the text on-screen
+ reposition();
+ _bounds.center(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2);
+
+ // Set the new position
+ _position.x = _bounds.left;
+ _position.y = _bounds.top;
+}
+
+void BF_Scene109::Text::synchronize(Serializer &s) {
+ SceneText::synchronize(s);
+ SYNC_POINTER(_action);
+ s.syncAsUint32LE(_frameNumber);
+ s.syncAsSint16LE(_diff);
+}
+
+void BF_Scene109::Text::dispatch() {
+ if (_diff) {
+ uint32 frameNumber = BF_GLOBALS._events.getFrameNumber();
+ if (_frameNumber < frameNumber) {
+ _diff -= frameNumber - _frameNumber;
+ _frameNumber = frameNumber;
+
+ if (_diff <= 0) {
+ // Time has expired, so remove the text and signal the designated action
+ remove();
+ if (_action)
+ _action->signal();
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+BF_Scene109::BF_Scene109(): GameScene() {
+}
+
+void BF_Scene109::postInit(SceneObjectList *OwnerList) {
+ GameScene::postInit(OwnerList);
+ loadScene(999);
+
+ _protaginist2.postInit();
+ _protaginist2.setVisage(119);
+ _protaginist2.setFrame(11);
+ _protaginist2.setFrame2(133);
+ _protaginist2.setPosition(Common::Point(165, 124));
+ _protaginist2.hide();
+
+ _protaginist1.postInit();
+ _protaginist1.setVisage(118);
+ _protaginist1.setStrip(1);
+ _protaginist1.setFrame(8);
+ _protaginist1.setFrame2(132);
+ _protaginist1.setPosition(Common::Point(143, 125));
+ _protaginist1.hide();
+
+ _bartender.postInit();
+ _bartender.setVisage(121);
+ _bartender.setStrip(2);
+ _bartender.setFrame(1);
+ _bartender.setPriority(-1);
+ _bartender.setPosition(Common::Point(92, 64));
+ _bartender.hide();
+
+ _object1.postInit();
+ _object1.setVisage(121);
+ _object1.setStrip(6);
+ _object1.setFrame(1);
+ _object1.setPriority(-1);
+ _object1.setPosition(Common::Point(110, 64));
+ _object1.hide();
+
+ _object6.postInit();
+ _object6.setVisage(120);
+ _object6.setStrip(2);
+ _object6.setFrame(5);
+ _object6.setPriority(-1);
+ _object6.setPosition(Common::Point(127, 97));
+ _object6.hide();
+
+ _object2.postInit();
+ _object2.setVisage(121);
+ _object2.setStrip(5);
+ _object2.setFrame(1);
+ _object2.setPriority(-1);
+ _object2.setPosition(Common::Point(104, 64));
+ _object2.hide();
+
+ _object9.postInit();
+ _object9.setVisage(115);
+ _object9.setStrip(4);
+ _object9.setFrame(1);
+ _object9.setPosition(Common::Point(262, 29));
+ _object9.hide();
+
+ _object5.postInit();
+ _object5.hide();
+
+ _object7.postInit();
+ _object7.hide();
+
+ _object10.postInit();
+ _object10.hide();
+
+ BF_GLOBALS._player.disableControl();
+ setAction(&_action1);
+}
+
+void BF_Scene109::signal() {
+ if (_sceneMode == 1) {
+ BF_GLOBALS._scenePalette.clearListeners();
+ BF_GLOBALS._sceneManager.changeScene(110);
+ }
+}
+
} // End of namespace tSage