diff options
author | Strangerke | 2014-05-11 11:06:06 +0200 |
---|---|---|
committer | Strangerke | 2014-05-11 11:06:45 +0200 |
commit | 1655a0aa90077296b70d03d61157950bee1cc390 (patch) | |
tree | d28d6fe4f18b4cecbcd6d8c87799466da4fdc9a1 /engines/mads/nebular | |
parent | 3f3040063ac0b874a275a3bf44b48a6283b2404b (diff) | |
download | scummvm-rg350-1655a0aa90077296b70d03d61157950bee1cc390.tar.gz scummvm-rg350-1655a0aa90077296b70d03d61157950bee1cc390.tar.bz2 scummvm-rg350-1655a0aa90077296b70d03d61157950bee1cc390.zip |
MADS: Implement scene 603
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes6.cpp | 142 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes6.h | 16 |
3 files changed, 159 insertions, 1 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 5b1ad6b037..5d937e9a09 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -229,7 +229,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 602: // Bruce's house, living room return new Scene602(vm); case 603: // Bruce's house, bedroom - return new DummyScene(vm); // TODO + return new Scene603(vm); case 604: // viewport return new DummyScene(vm); // TODO case 605: // viewport closeup diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 5e78db60ba..49246fbf31 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -530,5 +530,147 @@ void Scene602::actions() { /*------------------------------------------------------------------------*/ +void Scene603::setup() { + setPlayerSpritesPrefix(); + setAAName(); + _scene->addActiveVocab(0xD); + _scene->addActiveVocab(0x57); + _scene->addActiveVocab(0x3A8); +} + +void Scene603::enter() { + if (_game._objects[OBJ_COMPACT_CASE]._roomNumber == _scene->_currentSceneId) { + _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RXMRD_3"); + _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', -1)); + _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); + _compactCaseHotspotId = _scene->_dynamicHotspots.add(0x57, VERB_WALKTO, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0)); + _scene->_dynamicHotspots.setPosition(_compactCaseHotspotId, Common::Point(250, 152), FACING_SOUTHEAST); + } + + if ((_game._difficulty != DIFFICULTY_HARD) && (_game._objects[OBJ_NOTE]._roomNumber == _scene->_currentSceneId)) { + _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RXMRC_9"); + _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', -1)); + _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14); + _noteHotspotId = _scene->_dynamicHotspots.add(0x3A8, VERB_WALKTO, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0)); + _scene->_dynamicHotspots.setPosition(_noteHotspotId, Common::Point(242, 118), FACING_NORTHEAST); + } + + if (_scene->_priorSceneId != -2) + _game._player._playerPos = Common::Point(113, 134); + + sceneEntrySound(); +} + +void Scene603::actions() { + if (_action.isAction(0x18C, 0x3F1)) + _scene->_nextSceneId = 602; + else if (_action.isAction(VERB_TAKE, 0x57)) { + if ( _game._trigger || !_game._objects.isInInventory(OBJ_COMPACT_CASE)) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 8, 1, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 5); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 5, 1); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + break; + + case 1: + _vm->_sound->command(9); + _scene->_sequences.remove(_globals._sequenceIndexes[1]); + _scene->_dynamicHotspots.remove(_compactCaseHotspotId); + _game._objects.addToInventory(OBJ_COMPACT_CASE); + _vm->_dialogs->showItem(OBJ_COMPACT_CASE, 60330); + break; + + case 2: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[4]); + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } + } else if (_action.isAction(VERB_TAKE, 0x3A8)) { + if ( _game._trigger || !_game._objects.isInInventory(OBJ_NOTE)) { + if (_game._trigger == 0) { + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); + _scene->_sequences.addTimer (15, 1); + } else if (_game._trigger == 1) { + _vm->_sound->command(9); + _scene->_sequences.remove(_globals._sequenceIndexes[2]); + _scene->_dynamicHotspots.remove(_noteHotspotId); + _game._objects.addToInventory(OBJ_NOTE); + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount; + _game._player._visible = true; + _game._player._stepEnabled = true; + } + } + } else if (_action._lookFlag) + _vm->_dialogs->show(60310); + else if (_action.isAction(VERB_LOOK, 0x1CB)) + _vm->_dialogs->show(60311); + else if (_action.isAction(VERB_LOOK, 0x3E5)) + _vm->_dialogs->show(60312); + else if (_action.isAction(VERB_TAKE, 0x3E5)) + _vm->_dialogs->show(60313); + else if (_action.isAction(VERB_LOOK, 0x3EE)) + _vm->_dialogs->show(60314); + else if (_action.isAction(VERB_LOOK, 0x3ED)) + _vm->_dialogs->show(60315); + else if (_action.isAction(VERB_LOOK, 0x49D)) + _vm->_dialogs->show(60316); + else if (_action.isAction(VERB_LOOK, 0x2F6)) + _vm->_dialogs->show(60317); + else if (_action.isAction(VERB_LOOK, 0x49E) || _action.isAction(VERB_LOOK, 0x49F) || _action.isAction(VERB_LOOK, 0x3E7)) + _vm->_dialogs->show(60318); + else if (_action.isAction(VERB_LOOK, 0x3DE)) + _vm->_dialogs->show(60319); + else if (_action.isAction(VERB_TAKE, 0x3DE)) + _vm->_dialogs->show(60320); + else if (_action.isAction(VERB_LOOK, 0x3DF)) + _vm->_dialogs->show(60321); + else if (_action.isAction(VERB_TAKE, 0x3DF)) + _vm->_dialogs->show(60322); + else if (_action.isAction(VERB_TAKE, 0x3A8)) + _vm->_dialogs->show(60323); + else if (_action.isAction(VERB_LOOK, 0x3A8)) { + if (_game._objects[OBJ_NOTE]._roomNumber == _scene->_currentSceneId) + _vm->_dialogs->show(60324); + } else if (_action.isAction(VERB_LOOK, 0x3E3)) { + if (_game._objects[OBJ_NOTE]._roomNumber == _scene->_currentSceneId) + _vm->_dialogs->show(60326); + else + _vm->_dialogs->show(60325); + } else if (_action.isAction(VERB_LOOK, 0x3EA)) { + if (_game._objects[OBJ_COMPACT_CASE]._roomNumber == _scene->_currentSceneId) + _vm->_dialogs->show(60327); + else + _vm->_dialogs->show(60328); + } else if (_action.isAction(VERB_LOOK, 0x57) && (_action._mainObjectSource == 4)) + _vm->_dialogs->show(60329); + // For the next two checks, the second part of the check wasn't surrounded par parenthesis, which was obviously wrong + else if (_action.isAction(VERB_LOOK) && (_action.isAction(0x31) || _action.isAction(0x3EA) || _action.isAction(0x3E8))) + _vm->_dialogs->show(60331); + else if (_action.isAction(VERB_TAKE) && (_action.isAction(0x31) || _action.isAction(0x3EA) || _action.isAction(0x3E8))) + _vm->_dialogs->show(60332); + else + return; + + _action._inProgress = false; +} + +/*------------------------------------------------------------------------*/ + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/nebular_scenes6.h b/engines/mads/nebular/nebular_scenes6.h index cbf384d2c8..cf69f59e6e 100644 --- a/engines/mads/nebular/nebular_scenes6.h +++ b/engines/mads/nebular/nebular_scenes6.h @@ -82,6 +82,22 @@ public: virtual void postActions() {}; }; +class Scene603: public Scene6xx{ +private: + int _compactCaseHotspotId; + int _noteHotspotId; + +public: + Scene603(MADSEngine *vm) : Scene6xx(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 |