aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/nebular_scenes3.cpp
diff options
context:
space:
mode:
authorStrangerke2014-04-19 00:57:18 +0200
committerStrangerke2014-04-19 00:57:18 +0200
commit3fa488db3a9174607d066c017a3f923e1919fd51 (patch)
treef9d643a460f60218679ad150ba6bd63d537fc231 /engines/mads/nebular/nebular_scenes3.cpp
parent66f2a8572155caea28c0ff803d0028710cc7c4ff (diff)
downloadscummvm-rg350-3fa488db3a9174607d066c017a3f923e1919fd51.tar.gz
scummvm-rg350-3fa488db3a9174607d066c017a3f923e1919fd51.tar.bz2
scummvm-rg350-3fa488db3a9174607d066c017a3f923e1919fd51.zip
MADS: Implement scene 311
Diffstat (limited to 'engines/mads/nebular/nebular_scenes3.cpp')
-rw-r--r--engines/mads/nebular/nebular_scenes3.cpp294
1 files changed, 291 insertions, 3 deletions
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp
index b6f5142165..59167cc088 100644
--- a/engines/mads/nebular/nebular_scenes3.cpp
+++ b/engines/mads/nebular/nebular_scenes3.cpp
@@ -1179,8 +1179,8 @@ void Scene308::step() {
}
break;
- case 71: {
- int seqIdx = _globals._sequenceIndexes[3];
+ 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);
@@ -1218,7 +1218,7 @@ void Scene308::step() {
}
break;
- case 75: {
+ 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);
@@ -1463,6 +1463,294 @@ void Scene310::step() {
_scene->_nextSceneId = 309;
}
+/*------------------------------------------------------------------------*/
+
+void Scene311::setup() {
+ if (_scene->_currentSceneId == 391)
+ _globals[kSexOfRex] = REX_MALE;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_scene->_currentSceneId == 304)
+ _game._player._spritesPrefix = "";
+}
+
+void Scene311::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(Resources::formatName(307, 'X', 0, EXT_SS, ""));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*RXCL_8");
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RXCL_2");
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 15);
+
+ _checkGuardFl = false;
+ _game.loadQuoteSet(0xFA, 0);
+
+ if (_scene->_priorSceneId == 391) {
+ _globals[kSexOfRex] = REX_MALE;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _game._player._facing = FACING_SOUTH;
+ _game._player._playerPos = Common::Point(166, 101);
+ _scene->_sequences.addTimer(120, 71);
+ } else if (_scene->_priorSceneId == 310)
+ _game._player._playerPos = Common::Point(302, 145);
+ else if (_scene->_priorSceneId == 320) {
+ _game._player._playerPos = Common::Point(129, 113);
+ _game._player._facing = FACING_SOUTH;
+ } else if (_scene->_priorSceneId != -2) {
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _scene->loadAnimation(formAnimName('a', -1), 70);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene311::step() {
+ if (_game._trigger == 70)
+ _scene->_nextSceneId = 310;
+
+ if (_game._trigger >= 71) {
+ switch (_game._trigger) {
+ case 71:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 2);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 72);
+ break;
+
+ case 72:
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 2);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 73);
+ break;
+
+ case 73:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 3);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 3);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 74);
+ break;
+
+ case 74:
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 4, 5);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 75);
+ break;
+
+ case 75: {
+ int oldIdx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 6);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx);
+ _scene->_sequences.addTimer(15, 76);
+ }
+ break;
+
+ case 76:
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 7);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 77);
+ break;
+
+ case 77:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 2);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 8);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 78);
+ break;
+
+ case 78:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 15);
+
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 9);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addTimer(15, 79);
+ break;
+
+ case 79:
+ _scene->_sequences.setDone(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 10, -2);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 80);
+ break;
+
+ case 80:
+ _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[3]);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._player._moving && (_scene->_rails.getNext() > 0)) {
+ int x = _game._player._prepareWalkPos.x;
+ if (x < 75)
+ x = 75;
+ if (x > 207)
+ x = 207;
+
+ _checkGuardFl = true;
+ _game._player.startWalking(Common::Point(x, 122), FACING_SOUTH);
+ _scene->_rails.resetNext();
+ }
+}
+
+void Scene311::actions() {
+ if (_action._lookFlag)
+ _vm->_dialogs->show(0x798F);
+ else if (_checkGuardFl) {
+ _checkGuardFl = false;
+ _scene->_kernelMessages.reset();
+ _scene->_kernelMessages.addQuote(0xFA, 120, 0);
+ } else if (_action.isAction(0x21F, 0x1E4))
+ _scene->_nextSceneId = 320;
+ else if (_action.isAction(0x2F7, 0x11)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 50, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 3, -2);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 15);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 15, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, 4);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1: {
+ int oldIdx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, -2);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 15);
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[1], oldIdx);
+ }
+ break;
+
+ case 2: {
+ int oldIdx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 12, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 4, 10);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[2], oldIdx);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ }
+ break;
+
+ case 3: {
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 3);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ int oldIdx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 11);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], Common::Point(167, 100));
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[2], oldIdx);
+ _scene->_sequences.addTimer(15, 4);
+ }
+ break;
+
+ case 4:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 2);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 12, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 12, 14);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], Common::Point(167, 100));
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 5);
+ break;
+
+ case 5: {
+ int oldIdx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 15);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], Common::Point(167, 100));
+ _scene->_sequences.updateTimeout(_globals._sequenceIndexes[2], oldIdx);
+ _scene->_sequences.addTimer(15, 6);
+ }
+ break;
+
+ case 6:
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[1], Common::Point(165, 76));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.addTimer(15, 7);
+ break;
+
+ case 7:
+ _scene->_nextSceneId = 313;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_action.isAction(VERB_LOOK, 0x1E4))
+ _vm->_dialogs->show(0x7986);
+ else if (_action.isAction(VERB_LOOK, 0x18D))
+ _vm->_dialogs->show(0x7987);
+ else if (_action.isAction(VERB_LOOK, 0x220) || _action.isAction(0x155, 0x220))
+ _vm->_dialogs->show(0x7988);
+ else if (_action.isAction(VERB_LOOK, 0x208) || _action.isAction(0x155, 0x208))
+ _vm->_dialogs->show(0x7989);
+ else if (_action.isAction(VERB_TAKE, 0x208))
+ _vm->_dialogs->show(0x798A);
+ else if (_action.isAction(VERB_LOOK, 0xCD) || _action.isAction(0x155, 0xCD))
+ _vm->_dialogs->show(0x798B);
+ else if (_action.isAction(VERB_TAKE, 0xCD))
+ _vm->_dialogs->show(0x798C);
+ else if (_action.isAction(VERB_LOOK, 0x2BA))
+ _vm->_dialogs->show(0x798D);
+ else if (_action.isAction(VERB_LOOK, 0x2B9))
+ _vm->_dialogs->show(0x798E);
+ else if (_action.isAction(VERB_LOOK, 0x11))
+ _vm->_dialogs->show(0x7990);
+ else
+ return;
+
+ _action._inProgress = false;
+}
/*------------------------------------------------------------------------*/