diff options
author | Filippos Karapetis | 2015-07-04 01:20:40 +0300 |
---|---|---|
committer | Filippos Karapetis | 2015-07-04 01:51:46 +0300 |
commit | ca6612e1512ae46f543dbd308db7b6849bb050ab (patch) | |
tree | 6e944abff56571a0136a5f28838d97767af25013 /engines/mads/phantom | |
parent | d7e0f8f4c19c57bf856b852c997ef49acbe26adb (diff) | |
download | scummvm-rg350-ca6612e1512ae46f543dbd308db7b6849bb050ab.tar.gz scummvm-rg350-ca6612e1512ae46f543dbd308db7b6849bb050ab.tar.bz2 scummvm-rg350-ca6612e1512ae46f543dbd308db7b6849bb050ab.zip |
MADS: Phantom: Initial work on game globals
Diffstat (limited to 'engines/mads/phantom')
-rw-r--r-- | engines/mads/phantom/game_phantom.cpp | 90 | ||||
-rw-r--r-- | engines/mads/phantom/game_phantom.h | 11 | ||||
-rw-r--r-- | engines/mads/phantom/globals_phantom.cpp | 49 | ||||
-rw-r--r-- | engines/mads/phantom/globals_phantom.h | 143 |
4 files changed, 263 insertions, 30 deletions
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp index cbeb6b0d26..592a108aea 100644 --- a/engines/mads/phantom/game_phantom.cpp +++ b/engines/mads/phantom/game_phantom.cpp @@ -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 5504054bcf..44b2321f42 100644 --- a/engines/mads/phantom/game_phantom.h +++ b/engines/mads/phantom/game_phantom.h @@ -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 */ |