diff options
author | Strangerke | 2014-05-07 07:03:14 +0200 |
---|---|---|
committer | Strangerke | 2014-05-07 07:03:52 +0200 |
commit | b3cc8db37012aaf035a58adf5a3232ea056f5d95 (patch) | |
tree | 6589896ee8cd7f4b27e4daed59826673e5d4d472 | |
parent | 0c079f4d6958e295a2c4d666d106c66505d55380 (diff) | |
download | scummvm-rg350-b3cc8db37012aaf035a58adf5a3232ea056f5d95.tar.gz scummvm-rg350-b3cc8db37012aaf035a58adf5a3232ea056f5d95.tar.bz2 scummvm-rg350-b3cc8db37012aaf035a58adf5a3232ea056f5d95.zip |
MADS: Rename difficulty constants to match IDB, implement scene 504
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 6 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.h | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes1.cpp | 6 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes5.cpp | 207 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes5.h | 15 |
8 files changed, 227 insertions, 15 deletions
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 546fdbea7c..9d6bf894cc 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -38,7 +38,7 @@ namespace Nebular { GameNebular::GameNebular(MADSEngine *vm): Game(vm) { _surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); _storyMode = STORYMODE_NAUGHTY; - _difficulty = DIFFICULTY_IMPOSSIBLE; + _difficulty = DIFFICULTY_EASY; } ProtectionResult GameNebular::checkCopyProtection() { @@ -212,7 +212,7 @@ void GameNebular::initialiseGlobals() { _globals[kLeavesStatus] = LEAVES_ON_TRAP; break; - case DIFFICULTY_REALLY_HARD: + case DIFFICULTY_MEDIUM: _objects.setRoom(OBJ_PLANT_STALK, NOWHERE); _globals[kLeavesStatus] = LEAVES_ON_GROUND; @@ -220,7 +220,7 @@ void GameNebular::initialiseGlobals() { _globals[kPenlightCellStatus] = FIRST_TIME_CHARGED_DURAFAIL; break; - case DIFFICULTY_IMPOSSIBLE: + case DIFFICULTY_EASY: _objects.setRoom(OBJ_BLOWGUN, NOWHERE); _objects.setRoom(OBJ_NOTE, NOWHERE); diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h index 0c859fadff..e754a11245 100644 --- a/engines/mads/nebular/game_nebular.h +++ b/engines/mads/nebular/game_nebular.h @@ -35,7 +35,7 @@ namespace Nebular { enum StoryMode { STORYMODE_NAUGHTY = 1, STORYMODE_NICE = 2 }; enum Difficulty { - DIFFICULTY_HARD = 1, DIFFICULTY_REALLY_HARD = 2, DIFFICULTY_IMPOSSIBLE = 3 + DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; enum InventoryObject { diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 19c98246ac..e7da6cfa4d 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -203,7 +203,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 503: // guard tower return new Scene503(vm); case 504: // inside car - return new DummyScene(vm); // TODO + return new Scene504(vm); case 505: // car view screen return new DummyScene(vm); // TODO case 506: // shopping street diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index f68a613d5b..08c5b08129 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -977,7 +977,7 @@ void Scene102::actions() { _action._inProgress = false; return; } - } else if (_action.isAction(VERB_LOOK) || (_game._difficulty != DIFFICULTY_IMPOSSIBLE)) { + } else if (_action.isAction(VERB_LOOK) || (_game._difficulty != DIFFICULTY_EASY)) { _vm->_dialogs->show(0x27EE); _action._inProgress = false; return; @@ -2519,7 +2519,7 @@ void Scene109::actions() { break; case OBJ_BURGER: - _hoovicDifficultFl = (_game._difficulty == DIFFICULTY_IMPOSSIBLE); + _hoovicDifficultFl = (_game._difficulty == DIFFICULTY_EASY); _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('H', (_hoovicDifficultFl ? 3 : 1))); break; } @@ -2592,7 +2592,7 @@ void Scene109::actions() { case DIFFICULTY_HARD: threshold = 1; break; - case DIFFICULTY_REALLY_HARD: + case DIFFICULTY_MEDIUM: threshold = 3; break; default: diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index c4f5fe3c57..46a2a7875c 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1673,7 +1673,7 @@ void Scene208::actions() { } else if (_action.isAction(VERB_LOOK, NOUN_PILE_OF_LEAVES)) { _vm->_dialogs->show(0x5149); } else if (_action.isAction(VERB_LOOK, NOUN_LEAF_COVERED_PIT)) { - if (_game._difficulty == DIFFICULTY_IMPOSSIBLE) + if (_game._difficulty == DIFFICULTY_EASY) _vm->_dialogs->show(0x514A); else _vm->_dialogs->show(0x514B); diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index b8d07d9f06..17c310db73 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -2271,7 +2271,7 @@ void Scene316::actions() { _vm->_dialogs->show(0x7B82); else if (_action.isAction(VERB_LOOK, 0x2B9)) { if (!_globals[kAfterHavoc]) { - if (_game._difficulty != DIFFICULTY_IMPOSSIBLE) + if (_game._difficulty != DIFFICULTY_EASY) _vm->_dialogs->show(0x7B84); else _vm->_dialogs->show(0x7B83); diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index da8faa03d0..3e888acb7b 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -550,8 +550,8 @@ void Scene503::actions() { if ( _game._trigger || !_game._objects.isInInventory(OBJ_DETONATORS)) { switch (_game._trigger) { case 0: - _game._player._stepEnabled = false; - _game._player._visible = false; + _game._player._stepEnabled = false; + _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 3); @@ -569,7 +569,7 @@ void Scene503::actions() { case 1: _vm->_sound->command(9); - _scene->_sequences.remove(_globals._sequenceIndexes[1]); + _scene->_sequences.remove(_globals._sequenceIndexes[1]); _scene->_dynamicHotspots.remove(_detonatorHotspotId); _game._objects.addToInventory(OBJ_DETONATORS); _vm->_dialogs->showItem(OBJ_DETONATORS, 50326); @@ -581,13 +581,13 @@ void Scene503::actions() { else _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[3]); - _game._player._visible = true; + _game._player._visible = true; _game._player._stepEnabled = true; break; default: break; - } + } } } else if (_action._lookFlag) _vm->_dialogs->show(50328); @@ -636,5 +636,202 @@ void Scene503::actions() { /*------------------------------------------------------------------------*/ +void Scene504::setup() { + _game._player._spritesPrefix = ""; + setAAName(); +} + +void Scene504::enter() { + _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('a', 2)); + + for (int i = 0; i < 4; i++) + _globals._spriteIndexes[5 + i] = _scene->_sprites.addSprites(formAnimName('m', i)); + + if (_globals[kSexOfRex] == REX_MALE) + _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('a', 0)); + else { + _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('a', 1)); + _scene->changeVariant(1); + } + + _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 6, 0, 0, 0); + _carFrame = -1; + + if ((_scene->_priorSceneId == 505) && (_globals[kHoverCarDestination] != _globals[kHoverCarLocation])){ + _carAnimationMode = 1; + _scene->loadAnimation(formAnimName('A', -1)); + _vm->_sound->command(14); + _scene->_sequences.addTimer(1, 70); + _game._player._stepEnabled = false; + } else { + _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 3)); + _carAnimationMode = 1; + _scene->loadAnimation(formAnimName('A', -1)); + if ((_scene->_priorSceneId != -2) && (_scene->_priorSceneId != 505)) + _globals[kHoverCarLocation] = _scene->_priorSceneId; + + _globals._sequenceIndexes[7] = _scene->_sequences.startCycle(_globals._spriteIndexes[7], false, 1); + } + + if (_globals[kTimebombTimer] > 10500) + _globals[kTimebombTimer] = 10500; + + sceneEntrySound(); +} + +void Scene504::step() { + if ((_carAnimationMode == 1) && (_scene->_activeAnimation != nullptr)) { + if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_activeAnimation->getCurrentFrame(); + int nextFrame; + + if (_carFrame == 1) + nextFrame = 0; + else + nextFrame = -1; + + if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { + _scene->_activeAnimation->setCurrentFrame(nextFrame); + _carFrame = nextFrame; + } + } + } + + + if (_game._trigger >= 70) { + switch (_game._trigger) { + case 70: + if (_globals[kHoverCarDestination] != -1) { + _game._player._stepEnabled = false; + _scene->freeAnimation(); + _carAnimationMode = 2; + if (((_globals[kHoverCarLocation] >= 500 && _globals[kHoverCarLocation] <= 599) && + (_globals[kHoverCarDestination] >= 500 && _globals[kHoverCarDestination] <= 599)) || + ((_globals[kHoverCarLocation] >= 600 && _globals[kHoverCarLocation] <= 699) && + (_globals[kHoverCarDestination] >= 600 && _globals[kHoverCarDestination] <= 699))) { + _scene->loadAnimation(formAnimName('A', -1), 71); + } else if (_globals[kHoverCarLocation] > _globals[kHoverCarDestination]) + _scene->loadAnimation(formAnimName('C', -1), 71); + else + _scene->loadAnimation(formAnimName('B', -1), 71); + } + break; + + case 71: + _vm->_sound->command(15); + _scene->_nextSceneId = _globals[kHoverCarDestination]; + break; + + default: + break; + } + } + + if ((_globals[kTimebombTimer] >= 10800) && (_globals[kTimebombStatus] == 1) && (_game._difficulty != 3)) { + _globals[kTimebombStatus] = TIMEBOMB_DEAD; + _globals[kTimebombTimer] = 0; + _globals[kCheckDaemonTimebomb] = false; + _scene->_nextSceneId = 620; + } +} + +void Scene504::preActions() { + _game._player._needToWalk = false; +} + +void Scene504::actions() { + if (_action.isAction(0x1CE, 0x324)) { + _vm->_sound->command(15); + _scene->_nextSceneId = _globals[kHoverCarLocation]; + } else if (_action.isAction(0xE, 0x380)) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _vm->_sound->command(39); + _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1); + _scene->_sequences.remove(_globals._sequenceIndexes[7]); + _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 18, 0, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14); + break; + + case 1: { + int syncIdx = _globals._sequenceIndexes[3]; + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 6); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], syncIdx); + } + break; + + case 2: + _scene->_sequences.addTimer(10, 3); + break; + + case 3: + _scene->_sequences.remove(_globals._sequenceIndexes[5]); + if (_globals[kSexOfRex] == REX_MALE) { + _vm->_sound->command(34); + _scene->_sequences.addTimer(60, 4); + _globals._sequenceIndexes[6] = _scene->_sequences.startCycle(_globals._spriteIndexes[6], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14); + } else { + _vm->_sound->command(40); + _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 18, 0, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 14); + _scene->_sequences.addTimer(120, 5); + } + break; + + case 4: + _game._player._stepEnabled = true; + _globals[kHoverCarDestination] = _globals[kHoverCarLocation]; + _scene->_nextSceneId = 505; + break; + + case 5: + _game._player._stepEnabled = true; + _scene->_sequences.remove(_globals._sequenceIndexes[8]); + _globals._sequenceIndexes[7] = _scene->_sequences.startCycle(_globals._spriteIndexes[7], false, 1); + _vm->_dialogs->show(50421); + break; + + default: + break; + } + } else if ((_action._lookFlag) || _action.isAction(VERB_LOOK, 0x388)) + _vm->_dialogs->show(50412); + else if (_action.isAction(VERB_LOOK, 0x383)) + _vm->_dialogs->show(50410); + else if (_action.isAction(VERB_LOOK, 0x380) || _action.isAction(VERB_LOOK, 0x387)) + _vm->_dialogs->show(50411); + else if (_action.isAction(VERB_LOOK, 0x381)) + _vm->_dialogs->show(50413); + else if (_action.isAction(VERB_LOOK, 0x385)) + _vm->_dialogs->show(50414); + else if (_action.isAction(VERB_LOOK, 0x382)) + _vm->_dialogs->show(50415); + else if (_action.isAction(VERB_LOOK, 0x386) || _action.isAction(0xD3, 0x386)) + _vm->_dialogs->show(50416); + else if (_action.isAction(VERB_LOOK, 0x120)) + _vm->_dialogs->show(50417); + else if (_action.isAction(VERB_TAKE, 0x120)) + _vm->_dialogs->show(50418); + else if (_action.isAction(VERB_LOOK, 0x384)) + _vm->_dialogs->show(50419); + else if (_action.isAction(VERB_TAKE, 0x384)) + _vm->_dialogs->show(50420); + else + return; + + _action._inProgress = false; +} + +/*------------------------------------------------------------------------*/ + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/nebular_scenes5.h b/engines/mads/nebular/nebular_scenes5.h index 0b29c92645..5336ceee94 100644 --- a/engines/mads/nebular/nebular_scenes5.h +++ b/engines/mads/nebular/nebular_scenes5.h @@ -97,6 +97,21 @@ public: virtual void postActions() {}; }; +class Scene504: public Scene5xx{ +private: + int _carAnimationMode; + int _carFrame; + +public: + Scene504(MADSEngine *vm) : Scene5xx(vm) {} + + virtual void setup(); + virtual void enter(); + virtual void step(); + virtual void preActions(); + virtual void actions(); + virtual void postActions() {}; +}; } // End of namespace Nebular } // End of namespace MADS |