diff options
author | Strangerke | 2014-05-10 09:17:58 +0200 |
---|---|---|
committer | Strangerke | 2014-05-10 09:18:53 +0200 |
commit | 5edc13bf78a9bc447c83359bd762b7157f0ca8fa (patch) | |
tree | 1b9f4417ce581b39c05bd78799832bbaba96b589 /engines | |
parent | 88ac15d69e550209f1a82d3090e370d2fa7d3153 (diff) | |
download | scummvm-rg350-5edc13bf78a9bc447c83359bd762b7157f0ca8fa.tar.gz scummvm-rg350-5edc13bf78a9bc447c83359bd762b7157f0ca8fa.tar.bz2 scummvm-rg350-5edc13bf78a9bc447c83359bd762b7157f0ca8fa.zip |
MADS: Implement scene 512
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes5.cpp | 294 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes5.h | 16 |
3 files changed, 311 insertions, 1 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index b406468e35..17debd5bb1 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -215,7 +215,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 511: // outside pleasure dome return new Scene511(vm); case 512: // inside pleasure dome - return new DummyScene(vm); // TODO + return new Scene512(vm); case 513: // outside mall return new DummyScene(vm); // TODO case 515: // overview diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 109923a1b5..9d3bbffa20 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2041,5 +2041,299 @@ void Scene511::actions() { /*------------------------------------------------------------------------*/ +void Scene512::setup() { + setPlayerSpritesPrefix(); + setAAName(); + _scene->addActiveVocab(0x88); + _scene->addActiveVocab(0xD); + _scene->addActiveVocab(0xFF); + _scene->addActiveVocab(0x366); +} + +void Scene512::enter() { + _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('r', -1)); + _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*RXMRC_9"); + _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RXMRC_8"); + _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 0)); + _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 1)); + _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 2)); + _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 3)); + + if (_game._objects[OBJ_FISHING_ROD]._roomNumber == _scene->_currentSceneId) { + _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 9, 0, 0, 0); + _fishingRodHotspotId = _scene->_dynamicHotspots.add(0x88, VERB_WALKTO, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0)); + _scene->_dynamicHotspots.setPosition(_fishingRodHotspotId, Common::Point(199, 101), FACING_NORTHEAST); + } + + if (!_game._visitedScenes._sceneRevisited) + _globals[kRegisterOpen] = false; + + _scene->_hotspots.activate(0xFF, false); + if (_game._difficulty == DIFFICULTY_EASY) { + if (_game._objects[OBJ_PADLOCK_KEY]._roomNumber == _scene->_currentSceneId) { + _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 10, 0, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 3); + _keyHotspotId = _scene->_dynamicHotspots.add(0xFF, VERB_WALKTO, _globals._sequenceIndexes[6], Common::Rect(0, 0, 0, 0)); + _scene->_dynamicHotspots.setPosition(_keyHotspotId, Common::Point(218, 152), FACING_NORTHEAST); + } + if (_globals[kRegisterOpen]) { + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + _scene->_hotspots.activate(0xFF, false); + } + } else if (_globals[kRegisterOpen]) { + if (_game._objects[OBJ_PADLOCK_KEY]._roomNumber == _scene->_currentSceneId) { + _scene->_hotspots.activate(0xFF, true); + _globals._sequenceIndexes[5] = _scene->_sequences.startCycle(_globals._spriteIndexes[5], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 3); + } else { + _scene->_hotspots.activate(0xFF, false); + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + } + } else + _scene->_hotspots.activate(0xFF, false); + + if (_scene->_priorSceneId != -2) { + _game._player._playerPos = Common::Point(144, 152); + _game._player._facing = FACING_NORTHEAST; + } + + sceneEntrySound(); +} + +void Scene512::actions() { + if (_action.isAction(0x32F, 0xF9)) + _scene->_nextSceneId = 511; + else if (_action.isAction(VERB_TAKE, 0x88)) { + if (_game._trigger || !_game._objects.isInInventory(OBJ_FISHING_ROD)) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 5, 1); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + break; + + case 1: + _vm->_sound->command(9); + _scene->_sequences.remove(_globals._sequenceIndexes[1]); + _scene->_dynamicHotspots.remove(_fishingRodHotspotId); + _game._objects.addToInventory(OBJ_FISHING_ROD); + _vm->_dialogs->showItem(OBJ_FISHING_ROD, 51217); + break; + + case 2: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[2]); + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } + } else if (_action.isAction(VERB_OPEN, 0x377)) { + if (!_globals[kRegisterOpen]) { + switch (_game._trigger) { + case 0: + _vm->_dialogs->show(51236); + _game._player._stepEnabled = false; + _game._player._facing = FACING_NORTH; + _scene->_sequences.addTimer(15, 1); + break; + + case 1: + _game._player._visible = false; + _globals._sequenceIndexes[8] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[8], false, 9, 1, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 3); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[8]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + break; + + case 2: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[8]); + _game._player._visible = true; + _scene->_sequences.addTimer(30, 3); + break; + + case 3: + _game._player._facing = FACING_NORTHEAST; + if (!_game._objects.isInRoom(OBJ_PADLOCK_KEY) || (_game._difficulty == DIFFICULTY_EASY)) { + _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 4); + } else { + _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 12, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 3); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 5); + } + _vm->_sound->command(23); + break; + + case 4: + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + _scene->_sequences.addTimer(60, 6); + break; + + case 5: + _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 14, 0, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 3); + _scene->_hotspots.activate(0xFF, true); + _scene->_sequences.addTimer(60, 6); + break; + + case 6: + _globals[kRegisterOpen] = true; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } else + _vm->_dialogs->show(51239); + } else if (_action.isAction(VERB_CLOSE, 0x377) && _globals[kRegisterOpen]) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); + break; + + case 1: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[2]); + _game._player._visible = true; + if (!_game._objects.isInRoom(OBJ_PADLOCK_KEY) || _game._difficulty == DIFFICULTY_EASY) { + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + } else { + _scene->_sequences.remove(_globals._sequenceIndexes[5]); + _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 12, 1, 0, 0); + _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 3); + _scene->_hotspots.activate(0xFF, false); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + } + break; + + case 2: + _globals[kRegisterOpen] = false; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } else if (_action.isAction(VERB_TAKE, 0xFF)) { + if (_game._trigger || !_game._objects.isInInventory(OBJ_PADLOCK_KEY)) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _game._player._visible = false; + + int endVal; + if (_game._player._playerPos == Common::Point(218, 152)) + endVal = 3; + else + endVal = 2; + + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, endVal); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, endVal, 1); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + break; + + case 1: + if (_game._player._playerPos == Common::Point(218, 152)) { + _scene->_sequences.remove(_globals._sequenceIndexes[6]); + _scene->_dynamicHotspots.remove(_keyHotspotId); + } else { + _scene->_sequences.remove(_globals._sequenceIndexes[5]); + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, -2); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); + _scene->_hotspots.activate(0xFF, false); + } + _vm->_sound->command(9); + _game._objects.addToInventory(OBJ_PADLOCK_KEY); + _vm->_dialogs->showItem(OBJ_PADLOCK_KEY, 51226); + break; + + case 2: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[2]); + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + + default: + break; + } + } + } else if (_action._lookFlag) + _vm->_dialogs->show(51225); + else if (_action.isAction(VERB_LOOK, 0xFF) && _game._objects.isInRoom(OBJ_PADLOCK_KEY)) + _vm->_dialogs->show(51215); + else if (_action.isAction(VERB_LOOK, 0x88) && (_scene->_activeAnimation->getCurrentFrame() == 4)) + _vm->_dialogs->show(51216); + else if (_action.isAction(VERB_LOOK, 0x354)) + _vm->_dialogs->show(51218); + else if (_action.isAction(VERB_TAKE, 0x354)) + _vm->_dialogs->show(51219); + else if (_action.isAction(VERB_LOOK, 0x349) || _action.isAction(0x103, 0x349)) + _vm->_dialogs->show(51220); + else if (_action.isAction(VERB_LOOK, 0x160)) + _vm->_dialogs->show(51221); + else if (_action.isAction(VERB_LOOK, 0x34E)) + _vm->_dialogs->show(51222); + else if (_action.isAction(VERB_TAKE, 0x34E)) + _vm->_dialogs->show(51223); + else if (_action.isAction(VERB_LOOK, 0xF9)) + _vm->_dialogs->show(51224); + else if (_action.isAction(VERB_LOOK, 0x117)) + _vm->_dialogs->show(51227); + else if (_action.isAction(VERB_TAKE, 0x117)) + _vm->_dialogs->show(51228); + else if (_action.isAction(VERB_LOOK, 0x1BB)) { + if (_game._visitedScenes.exists(604)) + _vm->_dialogs->show(51229); + else + _vm->_dialogs->show(51230); + } if (_action.isAction(VERB_LOOK, 0x47)) + _vm->_dialogs->show(51231); + else if (_action.isAction(VERB_LOOK, 0x347)) + _vm->_dialogs->show(51232); + else if (_action.isAction(VERB_TAKE, 0x347)) + _vm->_dialogs->show(51233); + else if (_action.isAction(VERB_LOOK, 0x2F6)) + _vm->_dialogs->show(51234); + else if (_action.isAction(VERB_LOOK, 0x29F)) + _vm->_dialogs->show(51235); + else if (_action.isAction(VERB_LOOK, 0x486)) + _vm->_dialogs->show(51237); + else if (_action.isAction(VERB_OPEN, 0x486)) + _vm->_dialogs->show(51238); + else if (_action.isAction(VERB_LOOK, 0x377)) { + if (!_globals[kRegisterOpen]) + _vm->_dialogs->show(51212); + else if (_game._objects.isInRoom(OBJ_PADLOCK_KEY)) + _vm->_dialogs->show(51214); + else + _vm->_dialogs->show(51213); + } 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 f46e8eeb09..0d1614fccc 100644 --- a/engines/mads/nebular/nebular_scenes5.h +++ b/engines/mads/nebular/nebular_scenes5.h @@ -198,6 +198,22 @@ public: virtual void postActions() {}; }; +class Scene512: public Scene5xx{ +private: + int _fishingRodHotspotId; + int _keyHotspotId; + +public: + Scene512(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 |