diff options
author | Filippos Karapetis | 2014-05-07 13:25:15 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-05-07 13:25:15 +0300 |
commit | 8dfddac863cb039f405fac6b1236c0c0e0004354 (patch) | |
tree | 77cb315f6397c875e11fc7858c7bf362cb56b962 /engines | |
parent | b3cc8db37012aaf035a58adf5a3232ea056f5d95 (diff) | |
download | scummvm-rg350-8dfddac863cb039f405fac6b1236c0c0e0004354.tar.gz scummvm-rg350-8dfddac863cb039f405fac6b1236c0c0e0004354.tar.bz2 scummvm-rg350-8dfddac863cb039f405fac6b1236c0c0e0004354.zip |
MADS: Implement Rex Nebular scene 702 and add some nouns
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/nebular/nebular_scenes.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes.h | 20 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes7.cpp | 159 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes7.h | 12 |
4 files changed, 169 insertions, 24 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index e7da6cfa4d..5f107881a8 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -253,7 +253,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { case 701: // outside elevator (after city is submerged) return new DummyScene(vm); // TODO case 702: // outside teleporter (after city is submerged) - return new DummyScene(vm); // TODO + return new Scene702(vm); case 703: // water return new DummyScene(vm); // TODO case 704: // water, building in the distance diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index e1fcf1e48d..0db8b93d8b 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -40,12 +40,13 @@ enum { enum Noun { NOUN_BIG_LEAVES = 0x23, - NOUN_BLOWGUN = 0x29, + NOUN_BLOWGUN = 0x29, NOUN_BOMB = 0x2A, NOUN_BOMBS = 0x2B, NOUN_BONE = 0x2C, - NOUN_BURGER = 0x35, - NOUN_CHAIR = 0x47, + NOUN_BONES = 0x2D, + NOUN_BURGER = 0x35, + NOUN_CHAIR = 0x47, NOUN_CHICKEN = 0x49, NOUN_CHICKEN_BOMB = 0x4A, NOUN_DEAD_FISH = 0x65, @@ -58,6 +59,7 @@ enum Noun { NOUN_HOTPANTS = 0x0A7, NOUN_HULL = 0x0A8, NOUN_HURL = 0x0A9, + NOUN_ID_CARD = 0x0B3, NOUN_IGNITE = 0x0B4, NOUN_INFLATE = 0x0B5, NOUN_INSERT = 0x0B6, @@ -78,11 +80,13 @@ enum Noun { NOUN_READ = 0x11F, NOUN_REFRIDGERATOR = 0x122, NOUN_ROBO_KITCHEN = 0x127, + NOUN_ROCK = 0x128, NOUN_SHIELD_ACCESS_PANEL = 0x135, NOUN_SHIELD_MODULATOR = 0x137, NOUN_SHOOT = 0x13A, NOUN_SIT_IN = 0x13F, NOUN_SKULL = 0x140, + NOUN_TELEPORTER = 0x16C, NOUN_BROKEN_LADDER = 0x1C9, NOUN_SMELL = 0x147, NOUN_STUFFED_FISH = 0x157, @@ -97,12 +101,18 @@ enum Noun { NOUN_PILE_OF_LEAVES = 0x1AA, NOUN_CAPTIVE_CREATURE = 0x1C3, NOUN_NATIVE_WOMAN = 0x1DC, - NOUN_ALCOHOL = 0x310, + NOUN_PLATFORM = 0x22C, + NOUN_ALCOHOL = 0x310, + NOUN_SUBMERGED_CITY = 0x313, + NOUN_LASER_BEAM = 0x343, + NOUN_CEMENT_BLOCK = 0x38E, + NOUN_CITY = 0x38F, NOUN_DOLLOP = 0x3AC, NOUN_DROP = 0x3AD, NOUN_DASH = 0x3AE, NOUN_SPLASH = 0x3AF, - NOUN_BIRDS = 0x487 + NOUN_BIRDS = 0x487, + NOUN_WEST_END_OF_PLATFORM = 0x4A9 }; class SceneFactory { diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 54acabf755..4ae2925c72 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -30,6 +30,13 @@ namespace MADS { namespace Nebular { +// Scene 7xx verbs +enum { + VERB_LOOK_AT = 0xD1, + VERB_WALK_ALONG = 0x312, + VERB_STEP_INTO = 0x2F9 +}; + void Scene7xx::setAAName() { _game._aaName = Resources::formatAAName(5); } @@ -90,6 +97,122 @@ void Scene7xx::sceneEntrySound() { /*------------------------------------------------------------------------*/ +void Scene702::setup() { + setPlayerSpritesPrefix(); + setAAName(); +} + +void Scene702::enter() { + _globals._spriteIndexes[12] = _scene->_sprites.addSprites("*RXMBD_8"); + + if (_scene->_priorSceneId == 701) { + _game._player._playerPos = Common::Point(13, 145); + _game._player._facing = FACING_EAST; + } else if (_scene->_priorSceneId != -2 && _scene->_priorSceneId != 620) { + _game._player._playerPos = Common::Point(289, 138); + _game._player.walk(Common::Point(262, 148), FACING_WEST); + _game._player._facing = FACING_WEST; + _game._player._visible = true; + } + + if (_game._globals[kTeleporterCommand]) { + switch(_game._globals[kTeleporterCommand]) { + case TELEPORTER_BEAM_OUT: + case TELEPORTER_WRONG: + case TELEPORTER_STEP_OUT: + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + default: + break; + } + + _game._globals[kTeleporterCommand] = TELEPORTER_NONE; + } + + sceneEntrySound(); +} + +void Scene702::preActions() { + if (_action.isAction(VERB_WALKTO, NOUN_WEST_END_OF_PLATFORM)) { + _game._player._walkOffScreenSceneId = 701; + } +} + +void Scene702::actions() { + if (_action.isAction(VERB_WALK_ALONG, NOUN_PLATFORM)) { + _action._inProgress = false; + } else if (_action.isAction(VERB_STEP_INTO, NOUN_TELEPORTER)) { + _game._player._stepEnabled = false; + _game._player._visible = false; + _scene->_nextSceneId = 711; + _action._inProgress = false; + } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && _action._mainObjectSource == 4) { + // Take bones + if (!_game._objects.isInInventory(OBJ_BONES) || _game._trigger) { + switch (_game._trigger) { + case 0: + _game._player._stepEnabled = false; + _game._player._visible = false; + _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); + _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 4, 1); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2); + break; + case 1: + _vm->_sound->command(0xF); + if (_game._objects.isInInventory(OBJ_BONE)) + _game._objects.setRoom(OBJ_BONE, NOWHERE); + _game._objects.addToInventory(OBJ_BONES); + _vm->_dialogs->show(OBJ_BONES, 70218); + break; + case 2: + _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[12]); + _game._player._visible = true; + _game._player._stepEnabled = true; + break; + default: + break; + } + + _action._inProgress = false; + } + } else if (_action._lookFlag) { + _vm->_dialogs->show(70210); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_PLATFORM)) { + _vm->_dialogs->show(70211); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_CEMENT_BLOCK)) { + _vm->_dialogs->show(70212); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_ROCK)) { + _vm->_dialogs->show(70213); + _action._inProgress = false; + } else if (_action.isAction(VERB_TAKE, NOUN_ROCK)) { + _vm->_dialogs->show(70214); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_WEST_END_OF_PLATFORM)) { + _vm->_dialogs->show(70215); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_TELEPORTER)) { + _vm->_dialogs->show(70216); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_BONES) && _action._mainObjectSource == 4) { + _vm->_dialogs->show(70217); + _action._inProgress = false; + } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && _action._mainObjectSource == 4) { + if (_game._objects.isInInventory(OBJ_BONES)) + _vm->_dialogs->show(70219); + _action._inProgress = false; + } else if (_action.isAction(VERB_LOOK, NOUN_SUBMERGED_CITY)) { + _vm->_dialogs->show(70220); + _action._inProgress = false; + } +} + +/*------------------------------------------------------------------------*/ + void Scene707::setup() { _game._player._spritesPrefix = ""; // The original calls Scene7xx::setAAName() @@ -233,10 +356,10 @@ void Scene752::setup() { setPlayerSpritesPrefix(); setAAName(); - _scene->addActiveVocab(0xB3); + _scene->addActiveVocab(NOUN_ID_CARD); _scene->addActiveVocab(VERB_WALKTO); - _scene->addActiveVocab(0xD1); - _scene->addActiveVocab(0x343); + _scene->addActiveVocab(VERB_LOOK_AT); + _scene->addActiveVocab(NOUN_LASER_BEAM); } void Scene752::enter() { @@ -264,7 +387,7 @@ void Scene752::enter() { if (_game._globals[kLaserHoleIsThere]) { _globals._sequenceIndexes[14] = _scene->_sequences.startCycle(_globals._spriteIndexes[14], false, 1); _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 13); - int idx = _scene->_dynamicHotspots.add(0x343, 0xD1, _globals._sequenceIndexes[14], Common::Rect(0, 0, 0, 0)); + int idx = _scene->_dynamicHotspots.add(NOUN_LASER_BEAM, VERB_LOOK_AT, _globals._sequenceIndexes[14], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(215, 130), FACING_NORTHWEST); } @@ -299,20 +422,20 @@ void Scene752::step() { } void Scene752::preActions() { - if (_action.isAction(VERB_WALKTO, 0x4A9)) { + if (_action.isAction(VERB_WALKTO, NOUN_WEST_END_OF_PLATFORM)) { _game._player._walkOffScreenSceneId = 751; } } void Scene752::actions() { - if (_action.isAction(0x312, 0x22C)) { + if (_action.isAction(VERB_WALK_ALONG, NOUN_PLATFORM)) { _action._inProgress = false; - } else if (_action.isAction(0x2F9, 0x16C)) { + } else if (_action.isAction(VERB_STEP_INTO, NOUN_TELEPORTER)) { _game._player._stepEnabled = false; _game._player._visible = false; _scene->_nextSceneId = 711; _action._inProgress = false; - } else if (_action.isAction(VERB_TAKE, 0xB3)) { + } else if (_action.isAction(VERB_TAKE, NOUN_ID_CARD)) { // Take ID card if (!_game._objects.isInInventory(OBJ_ID_CARD) || _game._trigger) { switch (_game._trigger) { @@ -341,7 +464,7 @@ void Scene752::actions() { _action._inProgress = false; } - } else if (_action.isAction(VERB_TAKE, 0x2D) && _action._mainObjectSource == 4) { + } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && _action._mainObjectSource == 4) { // Take bones if (!_game._objects.isInInventory(OBJ_BONES) || _game._trigger) { switch (_game._trigger) { @@ -371,38 +494,38 @@ void Scene752::actions() { _action._inProgress = false; } - } else if (_action.isAction(VERB_LOOK, 0x38F)) { + } else if (_action._lookFlag || _action.isAction(VERB_LOOK, NOUN_CITY)) { if (_globals[kLaserHoleIsThere]) _vm->_dialogs->show(75212); else _vm->_dialogs->show(75210); _action._inProgress = false; - } else if (_action.isAction(VERB_LOOK, 0x22C)) { + } else if (_action.isAction(VERB_LOOK, NOUN_PLATFORM)) { _vm->_dialogs->show(75213); _action._inProgress = false; - } else if (_action.isAction(VERB_LOOK, 0x38E)) { + } else if (_action.isAction(VERB_LOOK, NOUN_CEMENT_BLOCK)) { _vm->_dialogs->show(75214); _action._inProgress = false; - } else if (_action.isAction(VERB_LOOK, 0x128)) { + } else if (_action.isAction(VERB_LOOK, NOUN_ROCK)) { _vm->_dialogs->show(75215); _action._inProgress = false; - } else if (_action.isAction(VERB_TAKE, 0x128)) { + } else if (_action.isAction(VERB_TAKE, NOUN_ROCK)) { _vm->_dialogs->show(75216); _action._inProgress = false; - } else if (_action.isAction(VERB_LOOK, 0x4A9)) { + } else if (_action.isAction(VERB_LOOK, NOUN_WEST_END_OF_PLATFORM)) { _vm->_dialogs->show(75217); _action._inProgress = false; - } else if (_action.isAction(VERB_LOOK, 0x16C)) { + } else if (_action.isAction(VERB_LOOK, NOUN_TELEPORTER)) { _vm->_dialogs->show(75218); _action._inProgress = false; - } else if ((_action.isAction(VERB_LOOK, 0x2D) || _action.isAction(VERB_LOOK, 0xB3)) && _action._mainObjectSource == 4) { + } else if ((_action.isAction(VERB_LOOK, NOUN_BONES) || _action.isAction(VERB_LOOK, NOUN_ID_CARD)) && _action._mainObjectSource == 4) { if (_game._objects[OBJ_ID_CARD]._roomNumber == 752) _vm->_dialogs->show(75219); else _vm->_dialogs->show(75220); _action._inProgress = false; - } else if (_action.isAction(VERB_TAKE, 0x2D) && _action._mainObjectSource == 4) { + } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && _action._mainObjectSource == 4) { if (_game._objects.isInInventory(OBJ_BONES)) _vm->_dialogs->show(75222); _action._inProgress = false; diff --git a/engines/mads/nebular/nebular_scenes7.h b/engines/mads/nebular/nebular_scenes7.h index 546f024deb..66a42de87d 100644 --- a/engines/mads/nebular/nebular_scenes7.h +++ b/engines/mads/nebular/nebular_scenes7.h @@ -50,6 +50,18 @@ public: Scene7xx(MADSEngine *vm) : NebularScene(vm) {} }; +class Scene702: public Scene7xx { +public: + Scene702(MADSEngine *vm) : Scene7xx(vm) {} + + virtual void setup(); + virtual void enter(); + virtual void step() {} + virtual void preActions(); + virtual void actions(); + virtual void postActions() {}; +}; + class Scene707: public SceneTeleporter { public: Scene707(MADSEngine *vm) : SceneTeleporter(vm) {} |