diff options
author | Strangerke | 2014-04-18 07:53:25 +0200 |
---|---|---|
committer | Strangerke | 2014-04-18 07:53:55 +0200 |
commit | 15c64dd9725a9799878d80e978120d06b7b7074a (patch) | |
tree | b9f3839e89e56b0f9c8b43da08e19fd2dc9288e4 /engines/mads/nebular/nebular_scenes3.cpp | |
parent | 8c9b65c34ae264686efb3f4bb276506eb6d727c3 (diff) | |
download | scummvm-rg350-15c64dd9725a9799878d80e978120d06b7b7074a.tar.gz scummvm-rg350-15c64dd9725a9799878d80e978120d06b7b7074a.tar.bz2 scummvm-rg350-15c64dd9725a9799878d80e978120d06b7b7074a.zip |
MADS: Implement scene 308
Diffstat (limited to 'engines/mads/nebular/nebular_scenes3.cpp')
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 68c2783f7e..e107c67121 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -1122,6 +1122,128 @@ void Scene307::actions() { _action._inProgress = false; } +/*------------------------------------------------------------------------*/ + +void Scene308::setup() { + setPlayerSpritesPrefix(); + setAAName(); +} + +void Scene308::enter() { + _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*SC003x0"); + _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*SC003x1"); + _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*SC003x2"); + + initForceField(&_forceField, true); + + _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('b', 0)); + _globals._spriteIndexes[4] = _scene->_sprites.addSprites(Resources::formatName(307, 'X', 0, EXT_SS, "")); + + _vm->_palette->setEntry(252, 63, 30, 20); + _vm->_palette->setEntry(253, 45, 15, 12); + + _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, 1); + _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[4], Common::Point(127, 78)); + _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 15); + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_sequences.addTimer(48, 70); + + _game._player._visible = false; + _game._player._stepEnabled = false; + _scene->loadAnimation(formAnimName('a', -1), 60); + + sceneEntrySound(); + _game.loadQuoteSet(0xF4, 0xF5, 0xF6, 0); +} + +void Scene308::step() { + handleForceField(&_forceField, &_globals._spriteIndexes[0]); + + if (_game._trigger == 60) + _scene->_nextSceneId = 307; + + if (_game._trigger < 70) + return; + + switch (_game._trigger) { + case 70: { + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 18, 9, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_kernelMessages.reset(); + int idx = _scene->_kernelMessages.add(Common::Point(171, 21), 0xFDFC, 0, 0, 120, _game.getQuote(244)); + _scene->_kernelMessages.setQuoted(idx, 2, true); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); + } + break; + + case 71: { + int seqIdx = _globals._sequenceIndexes[3]; + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 4); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], seqIdx); + _scene->_sequences.addTimer(48, 72); + } + break; + + case 72: + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 5, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 3, 4); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_kernelMessages.reset(); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 73); + break; + + case 73: { + int seqIdx = _globals._sequenceIndexes[3]; + _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 5); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], seqIdx); + _scene->_sequences.addTimer(48, 74); + } + break; + + case 74: { + _scene->_sequences.remove(_globals._sequenceIndexes[3]); + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 8, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 6, 7); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_kernelMessages.reset(); + int idx = _scene->_kernelMessages.add(Common::Point(171, 21), 0xFDFC, 0, 0, 120, _game.getQuote(245)); + _scene->_kernelMessages.setQuoted(idx, 2, true); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 75); + } + break; + + case 75: { + int seqIdx = _globals._sequenceIndexes[3]; + _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 23, 5, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 8, 10); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], seqIdx); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 76); + } + break; + + case 76: { + int seqIdx = _globals._sequenceIndexes[3]; + _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 26, 0, 0, 0); + _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); + _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); + _scene->_kernelMessages.reset(); + int idx = _scene->_kernelMessages.add(Common::Point(171, 21), 0xFDFC, 0, 0, 120, _game.getQuote(246)); + _scene->_kernelMessages.setQuoted(idx, 2, true); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], seqIdx); + } + break; + + default: + break; + } +} /*------------------------------------------------------------------------*/ |