aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-09-11 21:50:39 +1000
committerPaul Gilbert2011-09-11 21:50:39 +1000
commit3e453675e04a99043e0244d9c092cb0359f0585b (patch)
treec205cb5b5d26519a551982e9328fb3ca3aef60bd
parent406a8ca10e000fcad82f9349f944ecf51adbc0cd (diff)
downloadscummvm-rg350-3e453675e04a99043e0244d9c092cb0359f0585b.tar.gz
scummvm-rg350-3e453675e04a99043e0244d9c092cb0359f0585b.tar.bz2
scummvm-rg350-3e453675e04a99043e0244d9c092cb0359f0585b.zip
TSAGE: Implemented Scene 666 - Death Scene
-rw-r--r--engines/tsage/blue_force/blueforce_logic.cpp8
-rw-r--r--engines/tsage/blue_force/blueforce_logic.h2
-rw-r--r--engines/tsage/blue_force/blueforce_scenes0.cpp6
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.cpp8
-rw-r--r--engines/tsage/blue_force/blueforce_scenes6.cpp168
-rw-r--r--engines/tsage/blue_force/blueforce_scenes6.h70
-rw-r--r--engines/tsage/core.cpp7
-rw-r--r--engines/tsage/globals.cpp4
-rw-r--r--engines/tsage/globals.h2
-rw-r--r--engines/tsage/module.mk1
-rw-r--r--engines/tsage/staticres.cpp1
-rw-r--r--engines/tsage/staticres.h1
12 files changed, 266 insertions, 12 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
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index ea6278c9b7..0de400fe5d 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2996,6 +2996,9 @@ void Player::process(Event &event) {
(_globals->_events.getCursor() == CURSOR_WALK) && _globals->_player._canWalk &&
(_position != event.mousePos) && _globals->_sceneObjects->contains(this)) {
+ if ((_vm->getGameID() == GType_BlueForce) && !BF_GLOBALS._player._enabled)
+ return;
+
PlayerMover *newMover = new PlayerMover();
Common::Point destPos(event.mousePos.x + _globals->_sceneManager._scene->_sceneBounds.left,
event.mousePos.y + _globals->_sceneManager._scene->_sceneBounds.top);
@@ -3824,6 +3827,7 @@ void SceneHandler::process(Event &event) {
if (i != _globals->_sceneItems.end()) {
// Pass the action to the item
(*i)->startAction(_globals->_events.getCursor(), event);
+
event.handled = _globals->_events.getCursor() != CURSOR_WALK;
if (_globals->_player._uiEnabled && _globals->_player._canWalk &&
@@ -3834,6 +3838,9 @@ void SceneHandler::process(Event &event) {
} else if (_globals->_player._uiEnabled && (_globals->_events.getCursor() != CURSOR_LOOK)) {
_globals->_events.setCursor(CURSOR_USE);
}
+
+ if (_vm->getGameID() == GType_BlueForce)
+ event.handled = true;
}
// Handle any fallback text display
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 89704de7e1..1895fbc2d2 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -191,7 +191,7 @@ void BlueForceGlobals::synchronize(Serializer &s) {
s.syncAsSint16LE(_dayNumber);
s.syncAsSint16LE(_v4CEA4);
- s.syncAsSint16LE(_v4CEA8);
+ s.syncAsSint16LE(_deathReason);
s.syncAsSint16LE(_driveFromScene);
s.syncAsSint16LE(_driveToScene);
s.syncAsSint16LE(_v4CF9E);
@@ -228,7 +228,7 @@ void BlueForceGlobals::reset() {
_v51C44 = 1;
_dayNumber = 0;
_v4CEA4 = 0;
- _v4CEA8 = 0;
+ _deathReason = 0;
_v4CF9E = 0;
_v4E238 = 0;
_v50696 = 0;
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 9d33ea7076..651a0c8893 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -169,7 +169,7 @@ public:
StripProxy _stripProxy;
int _dayNumber;
int _v4CEA4;
- int _v4CEA8;
+ int _deathReason;
int _driveFromScene;
int _driveToScene;
int _v4CF9E;
diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk
index cd42b5b1d8..b0279c0260 100644
--- a/engines/tsage/module.mk
+++ b/engines/tsage/module.mk
@@ -6,6 +6,7 @@ MODULE_OBJS := \
blue_force/blueforce_scenes0.o \
blue_force/blueforce_scenes1.o \
blue_force/blueforce_scenes3.o \
+ blue_force/blueforce_scenes6.o \
blue_force/blueforce_speakers.o \
blue_force/blueforce_ui.o \
converse.o \
diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp
index aff05285c1..6c0499cfb2 100644
--- a/engines/tsage/staticres.cpp
+++ b/engines/tsage/staticres.cpp
@@ -72,7 +72,6 @@ const char *DEFAULT_SCENE_HOTSPOT = "That accomplishes nothing.";
const char *SAVE_ERROR_MSG = "Error occurred saving game. Please do not try to restore this game!";
const char *SAVING_NOT_ALLOWED_MSG = "Saving is not allowed at this time.";
const char *RESTORING_NOT_ALLOWED_MSG = "Restoring is not allowed at this time.";
-const char *RESTART_CONFIRM_MSG = "Do you want to restart your game?";
const char *INV_EMPTY_MSG = "You have nothing in your possesion.";
const char *QUIT_CONFIRM_MSG = "Do you want to quit playing this game?";
diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h
index 53f671a8b2..172adc218e 100644
--- a/engines/tsage/staticres.h
+++ b/engines/tsage/staticres.h
@@ -39,7 +39,6 @@ extern const char *DEFAULT_SCENE_HOTSPOT;
extern const char *SAVE_ERROR_MSG;
extern const char *SAVING_NOT_ALLOWED_MSG;
extern const char *RESTORING_NOT_ALLOWED_MSG;
-extern const char *RESTART_CONFIRM_MSG;
// Dialogs
extern const char *QUIT_CONFIRM_MSG;