diff options
author | Paul Gilbert | 2014-03-25 23:59:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-25 23:59:57 -0400 |
commit | 04cbbb5f0a5cc761c71ead882187c02a0000ec0b (patch) | |
tree | 7e9ddccaa8fa5602b424b3b3d4f2be6058a5ae64 | |
parent | 407021d245f1e0446867824c6306337f18fe8eb3 (diff) | |
download | scummvm-rg350-04cbbb5f0a5cc761c71ead882187c02a0000ec0b.tar.gz scummvm-rg350-04cbbb5f0a5cc761c71ead882187c02a0000ec0b.tar.bz2 scummvm-rg350-04cbbb5f0a5cc761c71ead882187c02a0000ec0b.zip |
MADS: Added enums for copy protection result and globals
-rw-r--r-- | engines/mads/game.cpp | 10 | ||||
-rw-r--r-- | engines/mads/game.h | 10 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 4 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.h | 2 | ||||
-rw-r--r-- | engines/mads/nebular/globals_nebular.h | 206 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes8.cpp | 4 |
6 files changed, 224 insertions, 12 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 6e7c530934..631ce20a32 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -59,7 +59,7 @@ Game::Game(MADSEngine *vm): _vm(vm), _surface(nullptr), _objects(vm), _abortTimersMode = ABORTMODE_0; _abortTimersMode2 = ABORTMODE_0; _ticksExpiry = 0; - _exitFlag = 0; + _winStatus = 0; // Load the inventory object list _objects.load(); @@ -82,15 +82,17 @@ void Game::run() { _statusFlag = true; int protectionResult = checkCopyProtection(); switch (protectionResult) { - case 1: + case PROTECTION_FAIL: // Copy protection failed _scene._nextSceneId = 804; _saveSlot = -1; break; - case 2: - _statusFlag = 0; + case PROTECTION_ESCAPE: + // User escaped out of copy protection dialog + _vm->quitGame(); break; default: + // Copy protection check succeeded _scene._nextSceneId = 103; _scene._priorSceneId = 102; break; diff --git a/engines/mads/game.h b/engines/mads/game.h index c5a3dd3be0..0abb70bb9f 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -43,6 +43,10 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; +enum ProtectionResult { + PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 +}; + class Game { private: /** @@ -88,7 +92,7 @@ protected: /** * Perform any copy protection check */ - virtual int checkCopyProtection() = 0; + virtual ProtectionResult checkCopyProtection() = 0; /** * Initialises global variables for a new game @@ -132,12 +136,12 @@ public: uint32 _priorFrameTimer; Common::String _aaName; uint32 _ticksExpiry; - int _exitFlag; + int _winStatus; public: virtual ~Game(); /** - * Run the game + * Main outer loop for the game */ void run(); diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index f452746360..9b48bde9da 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -39,7 +39,7 @@ GameNebular::GameNebular(MADSEngine *vm): Game(vm) { _storyMode = STORYMODE_NAUGHTY; } -int GameNebular::checkCopyProtection() { +ProtectionResult GameNebular::checkCopyProtection() { /* // DEBUG: Flag copy protection failure _globals[5] = -1; @@ -54,7 +54,7 @@ int GameNebular::checkCopyProtection() { */ // DEBUG: Return that copy protection failed - return -2; + return PROTECTION_SUCCEED; } void GameNebular::initialiseGlobals() { diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h index 98ecb0a41e..d3d908d153 100644 --- a/engines/mads/nebular/game_nebular.h +++ b/engines/mads/nebular/game_nebular.h @@ -54,7 +54,7 @@ class GameNebular: public Game { protected: GameNebular(MADSEngine *vm); - virtual int checkCopyProtection(); + virtual ProtectionResult checkCopyProtection(); virtual void initialiseGlobals(); diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index 95117a3389..f83c0fa1b7 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -31,6 +31,212 @@ namespace MADS { namespace Nebular { +enum GlobalId { + KSexOfRex = 0, + kOldSexOfRex = 1, + kWalkerTiming = 2, + kWalkerTiming0 = 3, + + kTalkInanimateCount = 4, + + kCopyProtectFailed = 5, + + /* Section #1 variables */ + kNeedToStandUp = 10, + + kTurkeyExploded = 11, + kMedicineCabinetOpen = 12, + kMedicineCabinetVirgin = 13, + kWatchedViewScreen = 14, + + kHoovicAlive = 15, + kHoovicSated = 16, + kHoovicFishEaten = 17, + + kWaterInAPuddle = 18, + + kFishIn105 = 19, + kFishIn107 = 20, + kFishIn108 = 21, + + + /* Section #2 variables */ + kCurtainOpen = 30, + kLadderBroken = 31, + kBone202Status = 32, + + kMeteorologistStatus = 33, + + kRhotundaStatus = 34, + kLeavesStatus = 35, + + kMonkeyStatus = 36, + + kMeteorologistEverSeen = 37, + kMeteorologistWatch = 38, + + kTeleporterCommand = 39, + kTeleporterDestination = 40, + kTeleporterUnderstood = 41, + + kConv205 = 42, + kChickenPpermitted = 43, + + kTwinklesStatus = 44, + kTwinklesApproached = 45, + + kConvTwinkles1 = 46, + kConvTwinkles2 = 47, + kConvTwinkles3 = 48, + kConvTwinkles5 = 49, + kConvTwinkles6 = 50, + kConvTwinkles7 = 51, + kConvTwinkles8 = 52, + + kBlowgunStatus = 53, + + + /* Section #3 Variables */ + kAfterHavoc = 60, + kHaveYourStuff = 61, + + kRightView320 = 62, + + kConvBuddy1 = 63, + kConvBuddy2 = 64, + kMetBuddyBeast = 65, + kKnowsBuddyBeast = 66, + + kConvSlache1 = 67, + kConvSlache2 = 68, + kConvSlache3 = 69, + + kRexHasMetSlache = 70, + + kConvIntern = 71, + kHasSeenProfPyro = 72, + + kKickedIn391Grate = 73, + + + /* Section #4 Variables */ + kArmoryDoorOpen = 80, + kStorageDoorOpen = 81, + + kNextIngredient = 82, + + kIngredientList = 83, + kIngredientList1 = 84, + kIngredientList2 = 85, + kIngredientList3 = 86, + + kIngredientQuantity = 87, + kIngredientQuantity1 = 88, + kIngredientQuantity2 = 89, + kIngredientQuantity3 = 90, + + + conv_pyro_1 = 91, + conv_pyro_2 = 92, + conv_pyro_3 = 93, + conv_pyro_4 = 94, + bad_first_ingredient = 95, + + kConvBartender1 = 96, + kConvBartender2 = 97, + kConvBartender3 = 98, + kConvBartender4 = 99, + kHasPurchased = 100, + kBeenThruHelgaScene = 101, + kHasSaidBinocs = 102, + kHasSaidTimer = 103, + kBottleDisplayed = 104, + kHasBeenScanned = 105, + kSomeoneHasExploded = 106, + + + /* Section #5 Variables */ + kBoatRaised = 110, + + kCarStatus = 111, + + kCityFlooded = 112, + kLaserOn = 113, + kLaserHoleIsThere = 114, + kCarIsGone = 115, + kRegisterOpen = 116, + kSafeStatus = 117, + kDogStatus = 118, + kLineStatus = 119, + + kHoverCarLocation = 120, + kHoverCarDestination = 121, + + + /* Section #6 Variables */ + kConvHermit1 = 130, + kconvHermit2 = 131, + kHasTalkedToHermit = 132, + kExecuted_1_11 = 133, + kHandsetCellStatus = 134, + kBeenInVideoStore = 135, + kDurafailRecharged = 136, + kPenlightCellStatus = 137, + kTimebombStatus = 138, + kCheckDaemonTimebomb = 140, + kResurrectRoom = 141, + + + /* Section #6 Time-Bomb Variables */ + kTimebombClock = 142, + kTimebombClock0 = 143, + + kTimebombTimer = 144, + kTimebombTimer0 = 145, + + kWarnedFloodCity = 146, + + /* Section #7 Variables */ + kBottleStatus = 150, + kMonsterAlive = 151, + + kConvBottleFillNode = 152, + kBoatStatus = 153, + + + /* Section #8 Variables */ + kAntigravClock = 160, + kAntigravClock0 = 161, + + kAntigravTiming = 162, + kAntigravTiming0 = 163, + + kWindowFixed = 164, + kinSpace = 165, + kReturnFromCut = 166, + kBeamIsUp = 167, + kForceBeamDown = 168, + kCameFromCut = 169, + kCutX = 170, + kCutY = 171, + kCutFacing = 172, + kDontRepeat = 173, + kHoppyDead = 174, + kHasWatchedAntigrav = 175, + kRemoteSequenceRan = 176, + kRemoteOnGround = 177, + kFromCockpit = 178, + kExitShip = 179, + kBetweenRooms = 180, + kTopButtonPushed = 181, + kTargetModInstalled = 182, + kShieldModInstalled = 183, + kUpBecauseOfRemote = 184, + + kTeleporterRoom = 190, + kTeleporterCode = 200 +}; + class Globals { private: Common::Array<int16> _flags; diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 2a28edee1d..920467f610 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -194,7 +194,7 @@ void Scene804::step() { _globals[165] = 0; _globals[167] = -1; assert(!_globals[5]); - _game._exitFlag = 4; + _game._winStatus = 4; _vm->quitGame(); } break; @@ -206,7 +206,7 @@ void Scene804::step() { _globals[165] = 0; _globals[167] = -1; assert(!_globals[5]); - _game._exitFlag = 4; + _game._winStatus = 4; _vm->quitGame(); } break; |