diff options
Diffstat (limited to 'engines/tsage/blue_force')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 8 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.h | 2 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes0.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes3.cpp | 8 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes6.cpp | 168 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes6.h | 70 |
6 files changed, 255 insertions, 7 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 5cdd102a3b..0a64e90304 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -25,6 +25,7 @@ #include "tsage/blue_force/blueforce_scenes0.h" #include "tsage/blue_force/blueforce_scenes1.h" #include "tsage/blue_force/blueforce_scenes3.h" +#include "tsage/blue_force/blueforce_scenes6.h" #include "tsage/scenes.h" #include "tsage/tsage.h" #include "tsage/graphics.h" @@ -117,6 +118,8 @@ Scene *BlueForceGame::createScene(int sceneNumber) { case 600: case 620: case 666: + // Death scene + return new Scene666(); case 690: error("Scene group 6 not implemented"); case 710: @@ -597,6 +600,11 @@ bool SceneExt::display(CursorType action) { return true; } +void SceneExt::fadeOut() { + uint32 black = 0; + BF_GLOBALS._scenePalette.fade((const byte *)&black, false, 100); +} + void SceneExt::gunDisplay() { if (!BF_GLOBALS.getFlag(gunDrawn)) { // Gun not drawn diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 0850854bcf..8a827a3214 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -170,7 +170,7 @@ public: void addTimer(Timer *timer) { _timerList.add(timer); } void removeTimer(Timer *timer) { _timerList.remove(timer); } bool display(CursorType action); - void fadeOut() {} + void fadeOut(); }; class GroupedScene: public SceneExt { diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp index c623fc53bc..9ba1db8688 100644 --- a/engines/tsage/blue_force/blueforce_scenes0.cpp +++ b/engines/tsage/blue_force/blueforce_scenes0.cpp @@ -294,7 +294,7 @@ void Scene50::Tooltip::highlight(bool btnDown) { BF_GLOBALS._player.disableControl(); scene->_sceneNumber = _newSceneNumber; } else { - BF_GLOBALS._v4CEA8 = 4; + BF_GLOBALS._deathReason = 4; BF_GLOBALS._sceneManager.changeScene(666); return; } @@ -450,7 +450,7 @@ void Scene50::signal() { if (BF_GLOBALS._bookmark >= bStoppedFrankie) BF_GLOBALS.setFlag(131); if (BF_GLOBALS._bookmark == bArrestedGreen) { - BF_GLOBALS._v4CEA8 = 19; + BF_GLOBALS._deathReason = 19; _sceneNumber = 666; } } @@ -570,7 +570,7 @@ bool Scene60::Item2::check1() { BF_GLOBALS._v5098C = (BF_GLOBALS._v5098C & 0xC3) | (v << 2); if ((v != 1) && (v != 2)) { - BF_GLOBALS._v4CEA8 = 19; + BF_GLOBALS._deathReason = 19; BF_GLOBALS._sceneManager.changeScene(666); return true; } diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index f75b698794..cfed3fab11 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -961,6 +961,8 @@ Scene315::Scene315() { } void Scene315::synchronize(Serializer &s) { + SceneExt::synchronize(s); + s.syncAsSint16LE(_field1390); s.syncAsSint16LE(_stripNumber); s.syncAsSint16LE(_field1398); @@ -1146,7 +1148,7 @@ void Scene315::signal() { } if (ctr) { - BF_GLOBALS._v4CEA8 = 20; + BF_GLOBALS._deathReason = 20; BF_GLOBALS._sceneManager.changeScene(666); } else { BF_GLOBALS._sceneManager.changeScene(300); @@ -1171,7 +1173,7 @@ void Scene315::signal() { } if (ctr == 1) { - BF_GLOBALS._v4CEA8 = 20; + BF_GLOBALS._deathReason = 20; BF_GLOBALS._sound1.fadeOut2(NULL); } else if ((BF_GLOBALS._bookmark != bBookedFrankie) || !BF_GLOBALS.getFlag(onDuty)) { BF_GLOBALS._sound1.fadeOut2(NULL); @@ -1264,7 +1266,7 @@ void Scene315::signal() { BF_GLOBALS._player.enableControl(); break; case 3161: - BF_GLOBALS._v4CEA8 = 21; + BF_GLOBALS._deathReason = 21; BF_GLOBALS._sound1.fadeOut2(NULL); BF_GLOBALS._sceneManager.changeScene(666); break; diff --git a/engines/tsage/blue_force/blueforce_scenes6.cpp b/engines/tsage/blue_force/blueforce_scenes6.cpp new file mode 100644 index 0000000000..e150a6e5b7 --- /dev/null +++ b/engines/tsage/blue_force/blueforce_scenes6.cpp @@ -0,0 +1,168 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "tsage/blue_force/blueforce_scenes6.h" +#include "tsage/blue_force/blueforce_dialogs.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" + +namespace TsAGE { + +namespace BlueForce { + +/*-------------------------------------------------------------------------- + * Scene 666 - Death Scene + * + *--------------------------------------------------------------------------*/ + +void Scene666::Action1::signal() { + switch (_actionIndex++) { + case 0: + BF_GLOBALS._player.hide(); + setDelay(6); + break; + case 1: + BF_GLOBALS._game->restartGame(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +bool Scene666::Item1::startAction(CursorType action, Event &event) { + return true; +} + +/*--------------------------------------------------------------------------*/ + +void Scene666::postInit(SceneObjectList *OwnerList) { + BF_GLOBALS._sound1.play(27); + SceneExt::postInit(); + BF_GLOBALS._interfaceY = 200; + loadScene(999); + BF_GLOBALS._screenSurface.fillRect(BF_GLOBALS._screenSurface.getBounds(), 0); + + if (BF_GLOBALS._dayNumber == 0) { + BF_GLOBALS._dayNumber = 1; + BF_GLOBALS._deathReason = BF_GLOBALS._randomSource.getRandomNumber(23); + } + + BF_GLOBALS._scenePalette.loadPalette(BF_GLOBALS._sceneManager._previousScene); + BF_GLOBALS._uiElements._active = false; + + _item1.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 666, -1, -1, -1, 1, NULL); + BF_GLOBALS._player.postInit(); + BF_GLOBALS._events.setCursor(CURSOR_WALK); + + if (BF_GLOBALS._sceneManager._previousScene == 271) { + setAction(&_action1); + } else { + switch (BF_GLOBALS._deathReason) { + case 4: + case 18: + case 19: + case 20: + BF_GLOBALS._scenePalette.loadPalette(668); + BF_GLOBALS._player.setVisage(668); + BF_GLOBALS._player.setStrip2(1); + BF_GLOBALS._player.setPosition(Common::Point(77, 155)); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 5: + BF_GLOBALS._scenePalette.loadPalette(900); + BF_GLOBALS._scenePalette.refresh(); + BF_GLOBALS._player.setVisage(666); + BF_GLOBALS._player.setPosition(Common::Point(60, 160)); + signal(); + break; + case 7: + case 11: + case 12: + case 22: + BF_GLOBALS._scenePalette.loadPalette(667); + BF_GLOBALS._scenePalette.refresh(); + + _object1.postInit(); + _object2.postInit(); + _object3.postInit(); + setAction(&_sequenceManager, this, 6660, &BF_GLOBALS._player, &_object1, &_object2, + &_object3, NULL); + break; + case 13: + case 14: + BF_GLOBALS._scenePalette.loadPalette(665); + BF_GLOBALS._scenePalette.refresh(); + BF_GLOBALS._player.setVisage(665); + BF_GLOBALS._player.setPosition(Common::Point(80, 140)); + signal(); + break; + case 24: + BF_GLOBALS._player.setVisage(664); + BF_GLOBALS._player.setPosition(Common::Point(70, 160)); + signal(); + break; + default: + BF_GLOBALS._scenePalette.loadPalette(669); + BF_GLOBALS._scenePalette.refresh(); + BF_GLOBALS._player.setVisage(669); + BF_GLOBALS._player.setStrip(1); + BF_GLOBALS._player.setPosition(Common::Point(27, 27)); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + } + } +} + +void Scene666::remove() { + BF_GLOBALS._sound1.fadeOut2(NULL); + BF_GLOBALS._scrollFollower = &BF_GLOBALS._player; + SceneExt::remove(); + BF_GLOBALS._uiElements._active = true; +} + +void Scene666::signal() { + BF_GLOBALS._player.enableControl(); + Rect textRect, sceneBounds; + + _text._color1 = 19; + _text._color2 = 9; + _text._color3 = 13; + _text._fontNumber = 4; + _text._width = 150; + + Common::String msg = _resourceManager->getMessage(666, BF_GLOBALS._deathReason); + sceneBounds = BF_GLOBALS._sceneManager._scene->_sceneBounds; + sceneBounds.collapse(4, 2); + BF_GLOBALS.gfxManager()._font.getStringBounds(msg.c_str(), textRect, _text._width); + textRect.moveTo(160, 10); + textRect.contain(sceneBounds); + + _text.setup(msg); + _text.setPosition(Common::Point(textRect.left, textRect.top)); + _text.setPriority(255); + _text.show(); +} + +} // End of namespace BlueForce + +} // End of namespace TsAGE diff --git a/engines/tsage/blue_force/blueforce_scenes6.h b/engines/tsage/blue_force/blueforce_scenes6.h new file mode 100644 index 0000000000..b7449c5e30 --- /dev/null +++ b/engines/tsage/blue_force/blueforce_scenes6.h @@ -0,0 +1,70 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TSAGE_BLUEFORCE_SCENES6_H +#define TSAGE_BLUEFORCE_SCENES6_H + +#include "common/scummsys.h" +#include "tsage/blue_force/blueforce_logic.h" +#include "tsage/blue_force/blueforce_speakers.h" +#include "tsage/converse.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" +#include "tsage/sound.h" + +namespace TsAGE { + +namespace BlueForce { + +using namespace TsAGE; + +class Scene666 : public SceneExt { + /* Actions */ + class Action1 : public Action { + public: + virtual void signal(); + }; + + /* Items */ + class Item1: public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; +public: + Action1 _action1; + SequenceManager _sequenceManager; + NamedObject _object1, _object2, _object3; + Item1 _item1; + SceneText _text; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); +}; + +} // End of namespace BlueForce + +} // End of namespace TsAGE + +#endif |