diff options
author | Strangerke | 2014-03-24 01:14:16 +0100 |
---|---|---|
committer | Strangerke | 2014-03-24 01:14:16 +0100 |
commit | c57acfb154999b3976c07d6512657c02cc4ef468 (patch) | |
tree | 8831a09b0428aacf08b7c85746fff6d0a84b36f4 | |
parent | 7f4dbf7d48b6db8d82d33b569c22f104fc153dd3 (diff) | |
download | scummvm-rg350-c57acfb154999b3976c07d6512657c02cc4ef468.tar.gz scummvm-rg350-c57acfb154999b3976c07d6512657c02cc4ef468.tar.bz2 scummvm-rg350-c57acfb154999b3976c07d6512657c02cc4ef468.zip |
MADS: Implement scene 203
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 4 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.cpp | 112 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.h | 11 | ||||
-rw-r--r-- | engines/mads/palette.cpp | 13 | ||||
-rw-r--r-- | engines/mads/palette.h | 2 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 6 | ||||
-rw-r--r-- | engines/mads/scene.h | 1 |
7 files changed, 148 insertions, 1 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 42a44a2b51..6f799475cb 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -53,6 +53,10 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { // Scene group #2 case 201: return new Scene201(vm); + case 202: + return new Scene202(vm); + case 203: + return new Scene203(vm); // Scene group #8 case 804: diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 0e297e10ba..65a285860a 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -975,5 +975,117 @@ void Scene202::actions() { action->_inProgress = false; } +/*****************************************************************************/ + +void Scene203::setup() { + setPlayerSpritesPrefix(); + setAAName(); + _scene->addActiveVocab(477); +} + +void Scene203::enter() { + if (_scene->_priorSceneId == 202) { + _game._player._playerPos = Common::Point(187, 99); + _game._player._direction = 2; + } else if (_scene->_priorSceneId == 209) { + _game._player._playerPos = Common::Point(308, 117); + _game._player._direction = 4; + } else if (_scene->_priorSceneId == -2) { + _game._player._playerPos = Common::Point(155, 152); + _game._player._direction = 8; + } + + _globals._v0 = 0; + _globals._frameTime = 0; + + if ((_globals[34] == 0) && (_scene->_roomChanged == 0)) { + _globals._v0 = -1; + _game._player.startWalking(Common::Point(158, 135), 2); + int idx = _scene->_dynamicHotspots.add(131, 396, 0, Common::Rect(0, 0, 320, 156)); + _scene->_dynamicHotspots.setPosition(idx, 155, 152, 2); + _scene->_dynamicHotspots.setCursor(idx, CURSOR_GO_DOWN); + } + + if (_globals._v0 == 0) { + _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('b', -1), 0); + if (_vm->getRandomNumber(1, 3) == 2) { + _globals._spriteIndexes[15] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 9, 1, 0, 0); + int idx = _scene->_dynamicHotspots.add(477, 209, _globals._spriteIndexes[15], Common::Rect(0, 0, 0, 0)); + _scene->_dynamicHotspots.setPosition(idx, -2, 0, 0); + _vm->_sound->command(14); + } + } + + _game.loadQuoteSet(0x67, 0x68, 0x69, 0x6A, 0x5A, 0); + + if (_globals._v0 != 0) { + _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(_vm->getRandomNumber(103, 106))); + } + + sceneEntrySound(); +} + +void Scene203::step() { + if (_globals._v0 == 0) + return; + + if ((_game._abortTimers == 0) && (_globals._frameTime != 0)) + return; + + if ((_game._player._playerPos != Common::Point(158, 136)) || (_game._player._direction != 2)) + return; + + _globals._frameTime = 0xFFFF; + + if (_game._abortTimers == 0) { + _game._player._visible = false; + _game._player._stepEnabled = false; + _vm->_palette->sub7BBF8(); + _scene->_kernelMessages.reset(); + _scene->resetScene(); + _vm->_events->setCursor2(CURSOR_WAIT); + _scene->loadAnimation(Resources::formatName(203, 'a', -1, EXT_AA, ""), 81); + } else if (_game._abortTimers == 81) { + _scene->_nextSceneId = 208; + _scene->_reloadSceneFlag = true; + } +} + +void Scene203::preActions() { + if (_globals._v0 && !_action.isAction(0x18C, 0x83, 0)) { + _game._player.startWalking(Common::Point(158, 136), 2); + _action._inProgress = false; + return; + } + + if (_action.isAction(0xD, 0xF3, 0)) + _game._player._v844BE = 209; +} + +void Scene203::actions() { + if (_action._savedFields._lookFlag) { + Dialog::show(0x4F53); + } else if (_action.isAction(0x18C, 0x83, 0)) { + _scene->_nextSceneId = 208; + } else if (_action.isAction(0x18C, 0x82, 0)) { + _scene->_nextSceneId = 202; + } else if (_action.isAction(0x3, 0x142, 0)) { + Dialog::show(0x4F4D); + } else if (_action.isAction(0x3, 0x4D, 0)) { + Dialog::show(0x4F4E); + } else if (_action.isAction(0x3, 0x100, 0)) { + Dialog::show(0x4F4F); + } else if (_action.isAction(0x3, 0x82, 0)) { + Dialog::show(0x4F50); + } else if (_action.isAction(0x3, 0x1A6, 0)) { + Dialog::show(0x4F51); + } else if (_action.isAction(0x3, 0x30, 0)) { + Dialog::show(0x4F51); + } else + return; + + _action._inProgress = false; +} + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/nebular_scenes2.h b/engines/mads/nebular/nebular_scenes2.h index a1faf53055..b49cf96809 100644 --- a/engines/mads/nebular/nebular_scenes2.h +++ b/engines/mads/nebular/nebular_scenes2.h @@ -78,6 +78,17 @@ public: void setRandomKernelMessage(); }; + +class Scene203: public Scene2xx { +public: + Scene203(MADSEngine *vm) : Scene2xx(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 diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index bd467aa16b..4a62cca5bc 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -517,8 +517,19 @@ void Palette::setLowRange() { } void Palette::fadeOut(byte palette[PALETTE_SIZE], int v1, int v2, int v3, int v4, int v5, int v6) { - } +void Palette::sub7BBF8() { + if ((_rgbList[31] != 0) && (_v1 == 0)) + error("Palette - Unexpected values"); + + _v1 = -1; + _rgbList[31] = -1; + + for (int i = 0; i < 256; i++) { + if (_palFlags[i]) + _palFlags[i] |= 0x80000000; + } +} } // End of namespace MADS diff --git a/engines/mads/palette.h b/engines/mads/palette.h index e9549fd0bd..2fdb38662c 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -229,6 +229,8 @@ public: } void fadeOut(byte palette[PALETTE_SIZE], int v1, int v2, int v3, int v4, int v5, int v6); + + void sub7BBF8(); }; } // End of namespace MADS diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 565ef47395..00460a9d70 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -569,4 +569,10 @@ void Scene::changeDepthSurface(int arg1) { _spriteSlots.fullRefresh(); } +void Scene::resetScene() { + _vm->_game->clearQuotes(); + _spriteSlots.fullRefresh(true); + _sequences.clear(); +} + } // End of namespace MADS diff --git a/engines/mads/scene.h b/engines/mads/scene.h index a51d820d1c..f7d0e56a78 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -204,6 +204,7 @@ public: void changeDepthSurface(int arg1); + void resetScene(); }; } // End of namespace MADS |