From 90e7f030c34a880ddc2000ad9fb9828abc58559a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 28 Oct 2015 12:51:34 +0100 Subject: MADS: Phantom: Implement scene 306 --- engines/mads/phantom/phantom_scenes.cpp | 2 +- engines/mads/phantom/phantom_scenes3.cpp | 59 ++++++++++++++++++++++++++++++++ engines/mads/phantom/phantom_scenes3.h | 14 ++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) (limited to 'engines/mads/phantom') diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp index 43478e2726..9c95798ad1 100644 --- a/engines/mads/phantom/phantom_scenes.cpp +++ b/engines/mads/phantom/phantom_scenes.cpp @@ -107,7 +107,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 305: // chandelier fight, phantom closeup return new Scene305(vm); case 306: // chandelier #2 - return new DummyScene(vm); // TODO + return new Scene306(vm); case 307: // catwalk #3 above stage return new DummyScene(vm); // TODO case 308: // hidden staircase behind balcony box diff --git a/engines/mads/phantom/phantom_scenes3.cpp b/engines/mads/phantom/phantom_scenes3.cpp index c82e31ff55..4193babe7b 100644 --- a/engines/mads/phantom/phantom_scenes3.cpp +++ b/engines/mads/phantom/phantom_scenes3.cpp @@ -1527,5 +1527,64 @@ void Scene305::handle_animation_unmask() { /*------------------------------------------------------------------------*/ +Scene306::Scene306(MADSEngine *vm) : Scene3xx(vm) { + _speechDoneFl = false; +} + +void Scene306::synchronize(Common::Serializer &s) { + Scene3xx::synchronize(s); + + s.syncAsByte(_speechDoneFl); +} + +void Scene306::setup() { + setPlayerSpritesPrefix(); + setAAName(); +} + +void Scene306::enter() { + _scene->loadSpeech(6); + _speechDoneFl = false; + + warning("TODO: Switch to letter box view. See definition of MADS_MENU_Y"); + + _game._player._visible = false; + _game._player._stepEnabled = false; + _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('a', 1), 60); + + sceneEntrySound(); +} + +void Scene306::step() { + if (_game._trigger == 60) { + if (_vm->_sound->_preferRoland) + _scene->_sequences.setTimingTrigger(120, 61); + else + _scene->_sequences.setTimingTrigger(300, 61); + } + + if (!_speechDoneFl && (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 3)) { + _scene->playSpeech(6); + _speechDoneFl = true; + } + + if (_game._trigger == 61) { + _vm->_sound->command(1); + _vm->_sound->command(66); + _scene->_sequences.setTimingTrigger(120, 62); + } + + if (_game._trigger == 62) + _scene->_nextSceneId = 150; +} + +void Scene306::actions() { +} + +void Scene306::preActions() { +} + +/*------------------------------------------------------------------------*/ + } // End of namespace Phantom } // End of namespace MADS diff --git a/engines/mads/phantom/phantom_scenes3.h b/engines/mads/phantom/phantom_scenes3.h index 8b69900bb0..4e0d2d068e 100644 --- a/engines/mads/phantom/phantom_scenes3.h +++ b/engines/mads/phantom/phantom_scenes3.h @@ -153,6 +153,20 @@ public: virtual void actions(); }; +class Scene306 : public Scene3xx { +private: + bool _speechDoneFl; + +public: + Scene306(MADSEngine *vm); + virtual void synchronize(Common::Serializer &s); + + virtual void setup(); + virtual void enter(); + virtual void step(); + virtual void preActions(); + virtual void actions(); +}; } // End of namespace Phantom } // End of namespace MADS -- cgit v1.2.3