aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/phantom
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/phantom')
-rw-r--r--engines/mads/phantom/game_phantom.cpp94
-rw-r--r--engines/mads/phantom/game_phantom.h15
-rw-r--r--engines/mads/phantom/globals_phantom.cpp49
-rw-r--r--engines/mads/phantom/globals_phantom.h143
-rw-r--r--engines/mads/phantom/phantom_scenes.cpp13
-rw-r--r--engines/mads/phantom/phantom_scenes.h84
-rw-r--r--engines/mads/phantom/phantom_scenes1.cpp282
-rw-r--r--engines/mads/phantom/phantom_scenes1.h89
8 files changed, 680 insertions, 89 deletions
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp
index 0b2531ef65..592a108aea 100644
--- a/engines/mads/phantom/game_phantom.cpp
+++ b/engines/mads/phantom/game_phantom.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -28,7 +28,7 @@
#include "mads/msurface.h"
#include "mads/phantom/game_phantom.h"
//#include "mads/nebular/dialogs_nebular.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/phantom/globals_phantom.h"
#include "mads/phantom/phantom_scenes.h"
namespace MADS {
@@ -52,29 +52,74 @@ void GamePhantom::startGame() {
void GamePhantom::initializeGlobals() {
_globals.reset();
- warning("TODO: sub_316DA()");
+ // TODO: Catacombs setup
_player._facing = FACING_NORTH;
_player._turnToFacing = FACING_NORTH;
- /* Section #1 variables */
- // TODO
-
- /* Section #2 variables */
- // TODO
-
- /* Section #3 variables */
- // TODO
-
- /* Section #4 variables */
- // TODO
-
- /* Section #5 variables */
- // TODO
-
- /* Section #9 variables */
- // TODO
-
+ _globals[kTempVar] = false;
+ _globals[kRoom103104Transition] = 1; // new room
+ _globals[kCurrentYear] = 1993;
+ _globals[kTrapDoorStatus] = 0; // open
+ _globals[kChristineDoorStatus] = 0; // Christine is in her room
+ _globals[kSandbagStatus] = 0; // sandbag is secure
+ _globals[kJacquesStatus] = 0; // alive
+ _globals[kChrisFStatus] = 1; // Christine F. is alive in 1993
+ _globals[kBrieTalkStatus] = 0; // before Brie motions
+ _globals[kPanelIn206] = 0; // not discovered
+ _globals[kFightStatus] = 0;
+ _globals[kJuliesDoor] = 1; // cracked open
+ _globals[kPrompterStandStatus] = 0;
+ _globals[kChrisDStatus] = 0; // before love
+ _globals[kJulieNameIsKnown] = 0;
+ _globals[kDoorsIn205] = 0; // both locked
+ _globals[kMadameGiryLocation] = 1; // middle
+ _globals[kTicketPeoplePresent] = 0;
+ _globals[kCoffinStatus] = 0; // closed and locked
+ _globals[kDoneBrieConv203] = 0;
+ _globals[kFlorentNameIsKnown] = 0;
+ _globals[kDegasNameIsKnown] = 0;
+ _globals[kMadameGiryShowsUp] = false;
+ _globals[kJacquesNameIsKnown] = 0;
+ _globals[kCharlesNameIsKnown] = false;
+ _globals[kTopFloorLocked] = true;
+ _globals[kMadameNameIsKnown] = 0;
+ _globals[kChrisKickedRaoulOut] = false;
+ _globals[kLookedAtCase] = false;
+ _globals[kRingIsOnFinger] = false;
+ _globals[kHeListened] = false;
+ _globals[kKnockedOverHead] = false;
+ _globals[kObservedPhan104] = false;
+ _globals[kReadBook] = false;
+ _globals[kCanFindBookInLibrary] = false;
+ _globals[kLookedAtSkullFace] = false;
+ _globals[kScannedBookcase] = false;
+ _globals[kRanConvIn205] = false;
+ _globals[kDoneRichConv203] = false;
+ _globals[kHintThatDaaeIsHome1] = false;
+ _globals[kHintThatDaaeIsHome2] = false;
+ _globals[kMakeBrieLeave203] = false;
+ _globals[kMakeRichLeave203] = false;
+ _globals[kCameFromFade] = false;
+ _globals[kChristineToldEnvelope] = false;
+ _globals[kLeaveAngelMusicOn] = false;
+ _globals[kDoorIn409IsOpen] = false;
+ _globals[kUnknown] = false;
+ _globals[kCobwebIsCut] = false;
+ _globals[kChristineIsInBoat] = false;
+ _globals[kRightDoorIsOpen504] = false;
+ _globals[kChrisLeft505] = false;
+ _globals[kChrisWillTakeSeat] = true;
+ _globals[kFlickedLever1] = 0;
+ _globals[kFlickedLever2] = 0;
+ _globals[kFlickedLever3] = 0;
+ _globals[kFlickedLever4] = 0;
+ _globals[kPlayerScore] = 0;
+ _globals[kPlayerScoreFlags] = 0;
+
+ _globals[kMusicSelected] = _vm->getRandomNumber(1, 4);
+
+ _player._spritesPrefix = "RAL"; // Fixed prefix
Player::preloadSequences("RAL", 1);
}
@@ -106,6 +151,11 @@ void GamePhantom::checkShowDialog() {
// TODO: Copied from Nebular
if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[5]) {
_player.releasePlayerSprites();
+
+ // HACK: Skip the main menu (since it'll then try to show Rex's main menu)
+ if (_vm->_dialogs->_pendingDialog == DIALOG_MAIN_MENU)
+ _vm->_dialogs->_pendingDialog = DIALOG_NONE;
+
_vm->_dialogs->showDialog();
_vm->_dialogs->_pendingDialog = DIALOG_NONE;
}
diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h
index 99cc2c1230..44b2321f42 100644
--- a/engines/mads/phantom/game_phantom.h
+++ b/engines/mads/phantom/game_phantom.h
@@ -8,12 +8,12 @@
* 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.
@@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "mads/game.h"
#include "mads/globals.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/phantom/globals_phantom.h"
namespace MADS {
@@ -64,15 +64,6 @@ enum InventoryObject {
OBJ_OAR = 24
};
-// HACK: A stub for now, remove from here once it's implemented properly
-class PhantomGlobals : public Globals {
-public:
- PhantomGlobals() {
- resize(210); // Rex has 210 globals
- }
- virtual ~PhantomGlobals() {}
-};
-
class GamePhantom : public Game {
friend class Game;
protected:
diff --git a/engines/mads/phantom/globals_phantom.cpp b/engines/mads/phantom/globals_phantom.cpp
new file mode 100644
index 0000000000..e0db0a1bb0
--- /dev/null
+++ b/engines/mads/phantom/globals_phantom.cpp
@@ -0,0 +1,49 @@
+/* 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 "common/scummsys.h"
+#include "common/config-manager.h"
+#include "mads/phantom/globals_phantom.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+PhantomGlobals::PhantomGlobals()
+ : Globals() {
+ // Initialize lists
+ resize(210);
+ _spriteIndexes.resize(30);
+ _sequenceIndexes.resize(30);
+}
+
+void PhantomGlobals::synchronize(Common::Serializer &s) {
+ Globals::synchronize(s);
+
+ _spriteIndexes.synchronize(s);
+ _sequenceIndexes.synchronize(s);
+}
+
+
+} // End of namespace Phantom
+
+} // End of namespace MADS
diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h
new file mode 100644
index 0000000000..c23b53cdf5
--- /dev/null
+++ b/engines/mads/phantom/globals_phantom.h
@@ -0,0 +1,143 @@
+/* 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 MADS_GLOBALS_PHANTOM_H
+#define MADS_GLOBALS_PHANTOM_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "mads/game.h"
+#include "mads/resources.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+enum GlobalId {
+ // Global variables
+
+ kWalkerTiming = 0,
+ kWalkerTiming2 = 1,
+ kStopWalkerDisabled = 2, // disable walker idle animations
+ kTempInterface = 3,
+ kWalkerConverse = 4, // conversation started with an NPC
+ kWalkerConverseState = 5,
+ kWalkerConverseNow = 6,
+
+ kCurrentYear = 10, // current year (1881 or 1993)
+ kMusicSelected = 11,
+ kPlayerScore = 12,
+ kPlayerScoreFlags = 13,
+ kDoneBrieConv203 = 14,
+ kLanternStatus = 15,
+
+ // Section #1 variables
+ kLeaveAngelMusicOn = 19,
+ kTrapDoorStatus = 20,
+ kChristineDoorStatus = 21,
+ kSandbagStatus = 22,
+ kChrisFStatus = 23,
+ kBrieTalkStatus = 24,
+ kJuliesDoor = 25,
+ kPrompterStandStatus = 26,
+ kChrisDStatus = 27,
+ kJulieNameIsKnown = 28,
+ kChrisKickedRaoulOut = 29,
+ kJacquesNameIsKnown = 30,
+ kJacquesStatus = 31,
+ kFlorentNameIsKnown = 32,
+ kCharlesNameIsKnown = 33,
+ kRoom103104Transition = 34,
+ kObservedPhan104 = 35,
+ kDeathLocation = 36,
+ kMakeBrieLeave203 = 37,
+ kHintThatDaaeIsHome1 = 38,
+ kHintThatDaaeIsHome2 = 39,
+
+ // Section #2 variables
+ kChristineToldEnvelope = 40,
+ kReadBook = 41,
+ kScannedBookcase = 42,
+ kRanConvIn205 = 43,
+ kDoorsIn205 = 44,
+ kPanelIn206 = 45,
+ kMadameNameIsKnown = 46,
+ kMadameGiryLocation = 47,
+ kLookedAtCase = 48,
+ kMadameGiryShowsUp = 49,
+ kDoneRichConv203 = 50,
+ kCameFromFade = 51,
+ kTicketPeoplePresent = 52,
+ kDegasNameIsKnown = 53,
+ kTempVar = 54,
+ kFlickedLever1 = 55,
+ kFlickedLever2 = 56,
+ kFlickedLever3 = 57,
+ kFlickedLever4 = 58,
+
+ // Section #3 Variables
+ kTopFloorLocked = 60,
+
+ // Section #4 Variables
+ kCatacombsRoom = 80,
+ // TODO
+ kDoorIn409IsOpen = 93,
+ kUnknown = 94, // TODO
+ kCobwebIsCut = 95,
+
+ // Section #5 Variables
+ kChristineIsInBoat = 100,
+ kChrisWillTakeSeat = 101,
+ kRightDoorIsOpen504 = 102,
+ kCoffinStatus = 103,
+ kChrisLeft505 = 104,
+ kKnockedOverHead = 105,
+ kFightStatus = 106,
+ kHeListened = 107,
+ kCanFindBookInLibrary = 108,
+ kRingIsOnFinger = 109,
+ kLookedAtSkullFace = 110,
+ kCableHookWasSeparate = 111,
+ kMakeRichLeave203 = 112
+};
+
+class PhantomGlobals : public Globals {
+public:
+ SynchronizedList _spriteIndexes;
+ SynchronizedList _sequenceIndexes;
+public:
+ /**
+ * Constructor
+ */
+ PhantomGlobals();
+
+ /**
+ * Synchronize the globals data
+ */
+ virtual void synchronize(Common::Serializer &s);
+};
+
+} // End of namespace Phantom
+
+} // End of namespace MADS
+
+#endif /* MADS_GLOBALS_PHANTOM_H */
diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp
index 7fd7ce642d..f7f4d154df 100644
--- a/engines/mads/phantom/phantom_scenes.cpp
+++ b/engines/mads/phantom/phantom_scenes.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -28,6 +28,7 @@
#include "mads/scene.h"
#include "mads/phantom/game_phantom.h"
#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes1.h"
namespace MADS {
@@ -42,9 +43,9 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
switch (scene._nextSceneId) {
// Scene group #1 (theater, stage and dressing rooms)
case 101: // seats
- return new DummyScene(vm); // TODO
+ return new Scene101(vm);
case 102: // music stands
- return new DummyScene(vm); // TODO
+ return new Scene102(vm);
case 103: // below stage
return new DummyScene(vm); // TODO
case 104: // stage
@@ -169,6 +170,10 @@ Common::String PhantomScene::formAnimName(char sepChar, int suffixNum) {
/*------------------------------------------------------------------------*/
void SceneInfoPhantom::loadCodes(MSurface &depthSurface, int variant) {
+ // The intro scenes do not have any codes
+ if (_sceneId >= 900)
+ return;
+
Common::String ext = Common::String::format(".WW%d", variant);
File f(Resources::formatName(RESPREFIX_RM, _sceneId, ext));
MadsPack codesPack(&f);
diff --git a/engines/mads/phantom/phantom_scenes.h b/engines/mads/phantom/phantom_scenes.h
index cd295a28b6..c0a823ae06 100644
--- a/engines/mads/phantom/phantom_scenes.h
+++ b/engines/mads/phantom/phantom_scenes.h
@@ -8,12 +8,12 @@
* 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.
@@ -34,20 +34,40 @@ namespace MADS {
namespace Phantom {
+enum Verb {
+ VERB_LOOK = 0x3,
+ VERB_TAKE = 0x4,
+ VERB_PUSH = 0x5,
+ VERB_OPEN = 0x6,
+ VERB_PUT = 0x7,
+ VERB_TALK_TO = 0x8,
+ VERB_GIVE = 0x9,
+ VERB_PULL = 0xA,
+ VERB_CLOSE = 0xB,
+ VERB_THROW = 0xC,
+ VERB_WALK_TO = 0xD,
+ VERB_CLIMB_DOWN = 0x21,
+ VERB_CLIMB_INTO = 0x22,
+ VERB_CLIMB_THROUGH = 0x23,
+ VERB_EXIT_TO = 0x37,
+ VERB_JUMP_INTO = 0x53,
+ VERB_LOOK_AT = 0x60,
+ VERB_LOOK_THROUGH = 0x61,
+ VERB_TURN_OFF = 0x95,
+ VERB_TURN_ON = 0x96,
+ VERB_UNLOCK = 0x97,
+ VERB_WALK_ACROSS = 0x99,
+ VERB_WALK_DOWN = 0x9A,
+ VERB_WALK_THROUGH = 0x9B,
+ VERB_WALK_UP = 0x9C,
+ VERB_CLIMB_UP = 0xA5,
+ VERB_WALK_ONTO = 0xA6,
+ VERB_WALK = 0xA7
+};
+
enum Noun {
NOUN_GAME = 0x1,
NOUN_QSAVE = 0x2,
- NOUN_LOOK = 0x3,
- NOUN_TAKE = 0x4,
- NOUN_PUSH = 0x5,
- NOUN_OPEN = 0x6,
- NOUN_PUT = 0x7,
- NOUN_TALK_TO = 0x8,
- NOUN_GIVE = 0x9,
- NOUN_PULL = 0xA,
- NOUN_CLOSE = 0xB,
- NOUN_THROW = 0xC,
- NOUN_WALK_TO = 0xD,
NOUN_ = 0xE,
NOUN_IN_ONE = 0xF,
NOUN_IN_TWO = 0x10,
@@ -67,9 +87,6 @@ enum Noun {
NOUN_CEILING = 0x1E,
NOUN_CHAIR = 0x1F,
NOUN_CIRCULAR_STAIRCASE = 0x20,
- NOUN_CLIMB_DOWN = 0x21,
- NOUN_CLIMB_INTO = 0x22,
- NOUN_CLIMB_THROUGH = 0x23,
NOUN_COLUMN_PROP = 0x24,
NOUN_CONDUCTORS_STAND = 0x25,
NOUN_CORRIDOR = 0x26,
@@ -89,7 +106,6 @@ enum Noun {
NOUN_EXIT = 0x34,
NOUN_EXIT_DOWN = 0x35,
NOUN_EXIT_SIGN = 0x36,
- NOUN_EXIT_TO = 0x37,
NOUN_EXIT_TO_BACKSTAGE = 0x38,
NOUN_EXIT_TO_CELLAR = 0x39,
NOUN_EXIT_TO_CORRIDOR = 0x3A,
@@ -117,7 +133,6 @@ enum Noun {
NOUN_HOUSE = 0x50,
NOUN_IN_ONE2 = 0x51,
NOUN_IN_TWO2 = 0x52,
- NOUN_JUMP_INTO = 0x53,
NOUN_JUNK = 0x54,
NOUN_KEY = 0x55,
NOUN_LAMP = 0x56,
@@ -130,8 +145,6 @@ enum Noun {
NOUN_LOCK = 0x5D,
NOUN_LOCKING_RAIL = 0x5E,
NOUN_LOCKRAIL = 0x5F,
- NOUN_LOOK_AT = 0x60,
- NOUN_LOOK_THROUGH = 0x61,
NOUN_MANNEQUINS = 0x62,
NOUN_MIRROR = 0x63,
NOUN_MUMMY_PROP = 0x64,
@@ -183,14 +196,7 @@ enum Noun {
NOUN_TICKET = 0x92,
NOUN_TRAP_CEILING = 0x93,
NOUN_TRAP_DOOR = 0x94,
- NOUN_TURN_OFF = 0x95,
- NOUN_TURN_ON = 0x96,
- NOUN_UNLOCK = 0x97,
NOUN_URN = 0x98,
- NOUN_WALK_ACROSS = 0x99,
- NOUN_WALK_DOWN = 0x9A,
- NOUN_WALK_THROUGH = 0x9B,
- NOUN_WALK_UP = 0x9C,
NOUN_WALL = 0x9D,
NOUN_WARDROBE = 0x9E,
NOUN_WASTE_BASKET = 0x9F,
@@ -199,9 +205,6 @@ enum Noun {
NOUN_WEDDING_RING = 0xA2,
NOUN_YELLOW_FRAME = 0xA3,
NOUN_PROP = 0xA4,
- NOUN_CLIMB_UP = 0xA5,
- NOUN_WALK_ONTO = 0xA6,
- NOUN_WALK = 0xA7,
NOUN_LEFT_DOOR = 0xA8,
NOUN_RIGHT_DOOR = 0xA9,
NOUN_DOOR_TO_PIT = 0xAA,
@@ -482,27 +485,6 @@ protected:
};
// TODO: Temporary, remove once implemented properly
-class Scene1xx : public PhantomScene {
-protected:
- /**
- * Plays an appropriate sound when entering a scene
- */
- void sceneEntrySound() {}
-
- /**
- *Sets the AA file to use for the scene
- */
- void setAAName() {}
-
- /**
- * Updates the prefix used for getting player sprites for the scene
- */
- void setPlayerSpritesPrefix() {}
-public:
- Scene1xx(MADSEngine *vm) : PhantomScene(vm) {}
-};
-
-// TODO: Temporary, remove once implemented properly
class DummyScene : public PhantomScene {
public:
DummyScene(MADSEngine *vm) : PhantomScene(vm) {
diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp
new file mode 100644
index 0000000000..2d991fd3bc
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes1.cpp
@@ -0,0 +1,282 @@
+/* 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 "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes1.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+void Scene1xx::setAAName() {
+ // TODO
+ //int idx = 0;
+ //_game._aaName = Resources::formatAAName(idx);
+}
+
+void Scene1xx::sceneEntrySound() {
+ // TODO
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene101::Scene101(MADSEngine *vm) : Scene1xx(vm) {
+
+}
+
+void Scene101::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+}
+
+void Scene101::setup() {
+ //setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene101::enter() {
+ // TODO
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ // TODO
+ //_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else {
+ // TODO
+ }
+
+ // TODO
+}
+
+void Scene101::step() {
+ // TODO
+}
+
+void Scene101::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_ORCHESTRA_PIT)) {
+ // TODO: Handle Brie
+ _game._player._walkOffScreenSceneId = 102;
+ } else if (_action.isAction(VERB_EXIT_TO, NOUN_GRAND_FOYER)) {
+ // TODO: Handle Brie
+ _game._player._walkOffScreenSceneId = 202;
+ } else if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE)) {
+ _vm->_dialogs->show(10121);
+ } else if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE)) {
+ if (_globals[kBrieTalkStatus] == 2)
+ _game._player._needToWalk = false;
+ }
+
+ // TODO
+}
+
+void Scene101::actions() {
+ // TODO: Brie conversation
+
+ // TODO: Look around
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_AISLE)) {
+ _vm->_dialogs->show(10112);
+ } else if (_action.isObject(NOUN_CHANDELIER)) {
+ _vm->_dialogs->show(10113);
+ } else if (_action.isObject(NOUN_BACK_WALL)) {
+ _vm->_dialogs->show(10114);
+ } else if (_action.isObject(NOUN_SIDE_WALL)) {
+ _vm->_dialogs->show(10115);
+ } else if (_action.isObject(NOUN_SEATS)) {
+ // TODO: Finish this
+ _vm->_dialogs->show(10116);
+ } else if (_action.isObject(NOUN_GRAND_FOYER)) {
+ _vm->_dialogs->show(10117);
+ } else if (_action.isObject(NOUN_ORCHESTRA_PIT)) {
+ _vm->_dialogs->show(10118);
+ } else if (_action.isObject(NOUN_MONSIEUR_BRIE)) {
+ _vm->_dialogs->show(10120);
+ }
+
+ _game._player._stepEnabled = true;
+ } else if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE)) {
+ if (_globals[kBrieTalkStatus] == 2)
+ _vm->_dialogs->show(10122);
+ _game._player._stepEnabled = true;
+ } else if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE)) {
+ _game._player._stepEnabled = true;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene102::Scene102(MADSEngine *vm) : Scene1xx(vm) {
+ _animRunningFl = false;
+}
+
+void Scene102::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_animRunningFl);
+}
+
+void Scene102::setup() {
+ //setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene102::enter() {
+ _animRunningFl = false;
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RAL86");
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ // TODO
+ //_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else {
+ // TODO
+ }
+
+ if (_scene->_priorSceneId == 101) {
+ _game._player._playerPos = Common::Point(97, 79);
+ _game._player._facing = FACING_SOUTHEAST;
+ // TODO
+ _game._player.walk(Common::Point(83, 87), FACING_SOUTHEAST);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if (_scene->_priorSceneId == 104) {
+ // Player fell from pit -> death
+ // TODO
+ } else if (_scene->_priorSceneId == 103 || _scene->_priorSceneId != -1) {
+ _game._player._playerPos = Common::Point(282, 145);
+ _game._player._facing = FACING_WEST;
+ _animRunningFl = true;
+ // TODO: Door closing animation
+ } else if (_scene->_priorSceneId == -1) {
+ // TODO
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene102::step() {
+ if (_game._trigger == 60) { // Door closes
+ // TODO
+ _animRunningFl = false;
+ } else if (_game._trigger == 65) { // Death
+ // TODO
+ _scene->_currentSceneId = 104;
+ }
+}
+
+void Scene102::preActions() {
+ if (_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR) || _action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR)) {
+ _game._player.walk(Common::Point(282, 145), FACING_EAST);
+ }
+}
+
+void Scene102::actions() {
+ if (_action.isAction(VERB_WALK_DOWN, NOUN_AISLE)) {
+ _scene->_nextSceneId = 101;
+ _game._player._stepEnabled = true;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ORCHESTRA_DOOR) ||
+ _action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR) ||
+ _action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR)) {
+ if (_animRunningFl) {
+ // TODO
+ } else {
+ _scene->_nextSceneId = 103; // FIXME: temporary HACK - remove!
+
+ switch (_game._trigger) {
+ case 70: // try again
+ case 0:
+ // TODO
+ break;
+ case 1:
+ _scene->_nextSceneId = 103;
+ break;
+ }
+ }
+
+ _game._player._stepEnabled = true;
+ }
+
+ // TODO: Look around
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_PIT))
+ _vm->_dialogs->show(10211);
+ else if (_action.isObject(NOUN_SEATS))
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(10212);
+ else
+ _vm->_dialogs->show(10230);
+ else if (_action.isObject(NOUN_ORCHESTRA_DOOR))
+ _vm->_dialogs->show(10213);
+ else if (_action.isObject(NOUN_CONDUCTORS_STAND))
+ _vm->_dialogs->show(10214);
+ else if (_action.isObject(NOUN_MUSIC_STAND) || _action.isObject(NOUN_MUSIC_STANDS))
+ _vm->_dialogs->show(10215);
+ else if (_action.isObject(NOUN_PROMPTERS_BOX))
+ _vm->_dialogs->show(10217);
+ else if (_action.isObject(NOUN_STAGE))
+ _vm->_dialogs->show(10218);
+ else if (_action.isObject(NOUN_APRON))
+ _vm->_dialogs->show(10219);
+ else if (_action.isObject(NOUN_SIDE_WALL))
+ _vm->_dialogs->show(10220);
+ else if (_action.isObject(NOUN_FOLDING_CHAIRS))
+ _vm->_dialogs->show(10221);
+ else if (_action.isObject(NOUN_AISLE))
+ _vm->_dialogs->show(10222);
+ else if (_action.isObject(NOUN_PROSCENIUM_ARCH))
+ _vm->_dialogs->show(10223);
+ else if (_action.isObject(NOUN_ACT_CURTAIN))
+ _vm->_dialogs->show(10224);
+ else if (_action.isObject(NOUN_IN_ONE))
+ _vm->_dialogs->show(10225);
+ else if (_action.isObject(NOUN_IN_TWO))
+ _vm->_dialogs->show(10226);
+ else if (_action.isObject(NOUN_LEG))
+ _vm->_dialogs->show(10227);
+ else if (_action.isObject(NOUN_CHANDELIER))
+ _vm->_dialogs->show(10231);
+ else
+ return;
+
+ _game._player._stepEnabled = true;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_ORCHESTRA_DOOR)) {
+ _vm->_dialogs->show(10228);
+ _game._player._stepEnabled = true;
+ }
+}
+
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Phantom
+} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes1.h b/engines/mads/phantom/phantom_scenes1.h
new file mode 100644
index 0000000000..0f5f56a4cf
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes1.h
@@ -0,0 +1,89 @@
+/* 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 MADS_PHANTOM_SCENES1_H
+#define MADS_PHANTOM_SCENES1_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+class Scene1xx : public PhantomScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene1xx(MADSEngine *vm) : PhantomScene(vm) {}
+};
+
+class Scene101 : public Scene1xx {
+private:
+ // TODO
+
+public:
+ Scene101(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene102 : public Scene1xx {
+private:
+ bool _animRunningFl;
+
+public:
+ Scene102(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+} // End of namespace Phantom
+} // End of namespace MADS
+
+#endif /* MADS_PHANTOM_SCENES1_H */