diff options
author | Strangerke | 2014-05-01 15:29:43 +0200 |
---|---|---|
committer | Strangerke | 2014-05-01 15:29:43 +0200 |
commit | 1ed814259972ac5ea75087e62f8bf9289f2d9f35 (patch) | |
tree | 66fe25b0e6b7c8b2957653415544776540d733c1 /engines | |
parent | 88cf2c7caab3ce74460a980640b9fe832f4fba5f (diff) | |
download | scummvm-rg350-1ed814259972ac5ea75087e62f8bf9289f2d9f35.tar.gz scummvm-rg350-1ed814259972ac5ea75087e62f8bf9289f2d9f35.tar.bz2 scummvm-rg350-1ed814259972ac5ea75087e62f8bf9289f2d9f35.zip |
MADS: Add scene 406
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes4.cpp | 209 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes4.h | 15 |
3 files changed, 224 insertions, 2 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 6422b6f9e8..edee1d9d8e 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -175,7 +175,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 405: return new Scene405(vm); case 406: - // TODO + return new Scene406(vm); case 407: // TODO case 408: diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index d1c5acac2c..f6f3b418bb 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -2346,7 +2346,7 @@ void Scene405::enter() { void Scene405::step() { if (_game._trigger == 80) { - _scene->_sequences.addTimer (20, 81); + _scene->_sequences.addTimer(20, 81); _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; _game._player._visible = true; } @@ -2470,5 +2470,212 @@ void Scene405::actions() { _action._inProgress = false; } +/*------------------------------------------------------------------------*/ + +void Scene406::setup() { + setPlayerSpritesPrefix(); + setAAName(); +} + +void Scene406::enter() { + _game._player._visible = true; + if (_scene->_priorSceneId == 405) { + _game._player._playerPos = Common::Point(15, 129); + _game._player._facing = FACING_EAST; + } else if (_scene->_priorSceneId == 407) { + _game._player._playerPos = Common::Point(270, 127); + _game._player._facing = FACING_WEST; + } else if (_scene->_priorSceneId == 410) { + _game._player._playerPos = Common::Point(30, 108); + _game._player._facing = FACING_SOUTH; + } else if (_scene->_priorSceneId == 411) { + _game._player._playerPos = Common::Point(153, 108); + _game._player._facing = FACING_SOUTH; + } else if (_scene->_priorSceneId != -2) { + _game._player._playerPos = Common::Point(15, 129); + _game._player._facing = FACING_EAST; + } + + _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*ROXCL_8"); + _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 0)); + _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 1)); + + if (_scene->_roomChanged) { + _globals[kStorageDoorOpen] = false; + _game._objects.addToInventory(OBJ_SECURITY_CARD); + } + + if (!_globals[kStorageDoorOpen]) + _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1); + + if (_scene->_priorSceneId != 411) + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); + else { + _game._player._stepEnabled = false; + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 3, 1, 0, 0); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 90); + _vm->_sound->command(19); + } + + _game.loadQuoteSet(0x24F, 0); + _hitStorageDoor = false; + sceneEntrySound(); +} + +void Scene406::step() { + if (_game._trigger == 90) { + _game._player._stepEnabled = true; + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); + } + + if (_game._trigger == 80) + _scene->_nextSceneId = 411; + + if (_game._trigger == 100) { + _vm->_dialogs->show(40622); + _hitStorageDoor = true; + } + + if (_game._trigger == 110) { + _scene->_sequences.addTimer(20, 111); + _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; + _game._player._visible = true; + } + + if (_game._trigger == 111) { + _game._player._stepEnabled = true; + _vm->_dialogs->show(40613); + } + + if (_game._trigger == 70) { + _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; + _game._player._visible = true; + _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 4, 1, 0, 0); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); + _vm->_sound->command(19); + } + + if (_game._trigger == 71) { + _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1); + _globals[kStorageDoorOpen] = false; + _game._player._stepEnabled = true; + } + + if (_game._trigger == 75) { + _scene->_sequences.remove(_globals._sequenceIndexes[1]); + _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle (_globals._spriteIndexes[1], false, 4, 1, 0, 0); + _globals[kStorageDoorOpen] = true; + _game._player._stepEnabled = true; + _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; + _game._player._visible = true; + _vm->_sound->command(19); + } +} + +void Scene406::preActions() { + if (_action.isAction(0x1AD, 0x2BA)) + _game._player._walkOffScreenSceneId = 405; + + if (_action.isAction(0x1AD, 0x2B9)) + _game._player._walkOffScreenSceneId = 407; + + if (_action.isAction(VERB_TAKE)) + _game._player._needToWalk = false; + + if (_action.isAction(VERB_LOOK, 0x244) || _action.isAction(VERB_LOOK, 0x25C)) + _game._player._needToWalk = true; +} + +void Scene406::actions() { + if (_action.isAction(0x18B, 0x6E) && (_game._player._targetPos.x> 100)) { + _game._player._stepEnabled = false; + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle (_globals._spriteIndexes[3], false, 3, 1, 0, 0); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 80); + _vm->_sound->command(19); + } else if (_action.isAction(0x18B, 0x6E) && _globals[kStorageDoorOpen] && (_game._player._targetPos.x < 100)) + _scene->_nextSceneId = 410; + else if (_action.isAction(0x18B, 0x6E) && !_globals[kStorageDoorOpen] && (_game._player._targetPos.x < 100)) { + _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 60, _game.getQuote(0x24F)); + if (!_hitStorageDoor) { + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _scene->_sequences.addTimer(80, 100); + } + } else if (_action.isAction(VERB_PUT, 0x131, 0x251) && !_globals[kStorageDoorOpen]) { + _game._player._stepEnabled = false; + _game._player._visible = false; + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 75); + Common::Point msgPos = Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1); + _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], msgPos); + _scene->_sequences.setScale(_globals._sequenceIndexes[2], 87); + } else if (_action.isAction(VERB_PUT, 0x131, 0x251) && _globals[kStorageDoorOpen]) { + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 70); + Common::Point msgPos = Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1); + _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], msgPos); + _scene->_sequences.setScale(_globals._sequenceIndexes[2], 87); + } else if (_action.isAction(VERB_PUT, 0x251)) { + _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 110); + _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], _game._player._playerPos); + _scene->_sequences.setScale(_globals._sequenceIndexes[2], 87); + } else if (_action.isAction(VERB_LOOK, 0x25C)) + _vm->_dialogs->show(40610); + else if (_action.isAction(VERB_TAKE, 0x25C)) + _vm->_dialogs->show(40611); + else if (_action.isAction(VERB_LOOK, 0x251)) + _vm->_dialogs->show(40612); + else if (_action.isAction(VERB_LOOK, 0x25B)) + _vm->_dialogs->show(40614); + else if (_action.isAction(VERB_TAKE, 0x25B)) + _vm->_dialogs->show(40615); + else if (_action.isAction(VERB_LOOK, 0x2B9)) + _vm->_dialogs->show(40616); + else if (_action.isAction(VERB_LOOK, 0x2BA)) + _vm->_dialogs->show(40617); + else if (_action.isAction(VERB_LOOK, 0x204) || _action._lookFlag) + _vm->_dialogs->show(40618); + else if (_action.isAction(VERB_LOOK, 0x18D)) + _vm->_dialogs->show(40619); + else if (_action.isAction(VERB_LOOK, 0x6E)) { + if (_globals[kStorageDoorOpen]) + _vm->_dialogs->show(40621); + else + _vm->_dialogs->show(40620); + } else if (_action.isAction(VERB_LOOK, 0xE2)) + _vm->_dialogs->show(40623); + else if (_action.isAction(VERB_LOOK, 0x47A)) + _vm->_dialogs->show(40624); + else if (_action.isAction(VERB_TAKE, 0x47A)) + _vm->_dialogs->show(40625); + else if (_action.isAction(VERB_LOOK, 0x2F)) + _vm->_dialogs->show(40626); + else if (_action.isAction(VERB_TAKE, 0x2F)) + _vm->_dialogs->show(40627); + else if (_action.isAction(VERB_LOOK, 0x244)) + _vm->_dialogs->show(40628); + else if (_action.isAction(VERB_TAKE, 0x244)) + _vm->_dialogs->show(40629); + else + return; + + _action._inProgress = false; +} + +/*------------------------------------------------------------------------*/ + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/nebular_scenes4.h b/engines/mads/nebular/nebular_scenes4.h index 38803fe00f..02115d7d81 100644 --- a/engines/mads/nebular/nebular_scenes4.h +++ b/engines/mads/nebular/nebular_scenes4.h @@ -140,6 +140,21 @@ public: virtual void postActions() {}; }; +class Scene406: public Scene4xx { +private: + bool _hitStorageDoor; + +public: + Scene406(MADSEngine *vm) : Scene4xx(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 |