aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2014-05-10 10:46:48 +0200
committerStrangerke2014-05-10 10:46:48 +0200
commitbe6cedef02abed65fc7e2643d3dc989afee0f488 (patch)
tree67b4c47719edeadb5dba657874404f2c370c62ba /engines
parent5edc13bf78a9bc447c83359bd762b7157f0ca8fa (diff)
downloadscummvm-rg350-be6cedef02abed65fc7e2643d3dc989afee0f488.tar.gz
scummvm-rg350-be6cedef02abed65fc7e2643d3dc989afee0f488.tar.bz2
scummvm-rg350-be6cedef02abed65fc7e2643d3dc989afee0f488.zip
MADS: Implement scene 513
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/nebular/nebular_scenes.cpp2
-rw-r--r--engines/mads/nebular/nebular_scenes5.cpp223
-rw-r--r--engines/mads/nebular/nebular_scenes5.h12
3 files changed, 236 insertions, 1 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index 17debd5bb1..7d91d7f2b4 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -217,7 +217,7 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
case 512: // inside pleasure dome
return new Scene512(vm);
case 513: // outside mall
- return new DummyScene(vm); // TODO
+ return new Scene513(vm);
case 515: // overview
return new DummyScene(vm); // TODO
case 551: // outside teleporter (with skeleton)
diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp
index 9d3bbffa20..cd96e82cf5 100644
--- a/engines/mads/nebular/nebular_scenes5.cpp
+++ b/engines/mads/nebular/nebular_scenes5.cpp
@@ -2335,5 +2335,228 @@ void Scene512::actions() {
/*------------------------------------------------------------------------*/
+void Scene513::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+ _scene->addActiveVocab(0x367);
+ _scene->addActiveVocab(0xD);
+}
+
+void Scene513::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RXCD_9");
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RXMRC_9");
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ if ((_scene->_priorSceneId == 751) || (_scene->_priorSceneId == 701)) {
+ _game._player._playerPos = Common::Point(296, 147);
+ _game._player._facing = FACING_WEST;
+ _game._player._stepEnabled = false;
+ _scene->_sequences.addTimer(15, 80);
+ } else if (_scene->_priorSceneId != -2) {
+ _game._player._playerPos = Common::Point(63, 149);
+ _game._player._facing = FACING_NORTHEAST;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->loadAnimation(formAnimName('R', 1), 70);
+ }
+
+ sceneEntrySound();
+
+ if (_scene->_roomChanged)
+ _game._objects.addToInventory(OBJ_SECURITY_CARD);
+
+ _game.loadQuoteSet(0x278, 0);
+}
+
+void Scene513::step() {
+ switch (_game._trigger) {
+ case 80:
+ _game._player._stepEnabled = false;
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _vm->_sound->command(24);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 81);
+ break;
+
+ case 81:
+ _game._player.walk(Common::Point(265, 152), FACING_WEST);
+ _scene->_sequences.addTimer(120, 82);
+ break;
+
+ case 82:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _vm->_sound->command(25);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 83);
+ break;
+
+ case 83:
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 70:
+ _game._player._visible = true;
+ _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _scene->_sequences.addTimer(6, 71);
+ break;
+
+ case 71:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 72);
+ break;
+
+ case 72:
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene513::actions() {
+ if (_action.isAction(0x36A, 0x324)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int syncIdx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[1], syncIdx);
+ _scene->_sequences.addTimer(6, 2);
+ }
+ break;
+
+ case 2:
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 10, 1, 0, 0);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3: {
+ int syncIdx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, -2);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], syncIdx);
+ _scene->_nextSceneId = 504;
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else if (_action.isAction(VERB_PUT, 0xB3, 0x251) || _action.isAction(VERB_PUT, 0x305, 0x251)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 7, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 2);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1:
+ _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[4]);
+ _game._player._visible = true;
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _vm->_sound->command(24);
+ _scene->_kernelMessages.reset();
+ _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(0x278));
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ _game._player.walk(Common::Point(296, 147), FACING_WEST);
+ _scene->_sequences.addTimer(120, 3);
+ break;
+
+ case 3:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _vm->_sound->command(25);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ break;
+
+ case 4:
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _game._player._stepEnabled = true;
+ if (_globals[kCityFlooded])
+ _scene->_nextSceneId = 701;
+ else
+ _scene->_nextSceneId = 751;
+
+ break;
+
+ default:
+ break;
+ }
+ } else if ((_action._lookFlag) || _action.isAction(VERB_LOOK, 0x31E))
+ _vm->_dialogs->show(51318);
+ else if (_action.isAction(VERB_LOOK, 0x317))
+ _vm->_dialogs->show(51310);
+ else if (_action.isAction(VERB_LOOK, 0x367))
+ _vm->_dialogs->show(51311);
+ else if (_action.isAction(VERB_LOOK, 0x251))
+ _vm->_dialogs->show(51312);
+ else if (_action.isAction(VERB_LOOK, 0x355))
+ _vm->_dialogs->show(51313);
+ else if (_action.isAction(VERB_LOOK, 0x358))
+ _vm->_dialogs->show(51314);
+ else if (_action.isAction(VERB_LOOK, 0x323))
+ _vm->_dialogs->show(51315);
+ else if (_action.isAction(VERB_LOOK, 0x244))
+ _vm->_dialogs->show(51316);
+ else if (_action.isAction(VERB_LOOK, 0x360) || _action.isAction(0x1AD, 0x360))
+ _vm->_dialogs->show(51317);
+ else if (_action.isAction(VERB_OPEN, 0x367) || _action.isAction(VERB_OPEN, 0x317))
+ _vm->_dialogs->show(51319);
+ else if (_action.isAction(VERB_LOOK, 0x324))
+ _vm->_dialogs->show(51321);
+ else if (_action.isAction(VERB_LOOK, 0x357))
+ _vm->_dialogs->show(51322);
+ else if (_action.isAction(VERB_PUT, 0x131, 0x251))
+ _vm->_dialogs->show(51320);
+ else
+ return;
+
+ _action._inProgress = false;
+}
+
+/*------------------------------------------------------------------------*/
+
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/nebular_scenes5.h b/engines/mads/nebular/nebular_scenes5.h
index 0d1614fccc..3bd8a20df8 100644
--- a/engines/mads/nebular/nebular_scenes5.h
+++ b/engines/mads/nebular/nebular_scenes5.h
@@ -214,6 +214,18 @@ public:
virtual void postActions() {};
};
+class Scene513: public Scene5xx{
+public:
+ Scene513(MADSEngine *vm) : Scene5xx(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