aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-04-16 19:29:42 +0200
committerStrangerke2014-04-16 19:29:42 +0200
commit5f44b97d089f6e2db89838b50c685d9307997647 (patch)
tree0528c561b140d85a5563d073fb64f5657e2fee36
parent301ca80915d4b9ad6fa61f732c9e736f81ea1997 (diff)
downloadscummvm-rg350-5f44b97d089f6e2db89838b50c685d9307997647.tar.gz
scummvm-rg350-5f44b97d089f6e2db89838b50c685d9307997647.tar.bz2
scummvm-rg350-5f44b97d089f6e2db89838b50c685d9307997647.zip
MADS: Implement scene 303 and 304
-rw-r--r--engines/mads/nebular/nebular_scenes.cpp4
-rw-r--r--engines/mads/nebular/nebular_scenes3.cpp155
-rw-r--r--engines/mads/nebular/nebular_scenes3.h30
3 files changed, 187 insertions, 2 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index c0a1552597..67c32fdaa1 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -107,6 +107,10 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
return new Scene301(vm);
case 302:
return new Scene302(vm);
+ case 303:
+ return new Scene303(vm);
+ case 304:
+ return new Scene304(vm);
// Scene group #8
case 804:
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp
index 8a305b8835..6d60395c86 100644
--- a/engines/mads/nebular/nebular_scenes3.cpp
+++ b/engines/mads/nebular/nebular_scenes3.cpp
@@ -164,7 +164,7 @@ void Scene302::setup() {
void Scene302::enter() {
_game._player._stepEnabled = false;
- _game._player._visible = false;
+ _game._player._visible = false;
_scene->loadAnimation(formAnimName('a',-1), 71);
sceneEntrySound();
@@ -195,5 +195,158 @@ void Scene302::step() {
/*------------------------------------------------------------------------*/
+void Scene303::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene303::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('b', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('b', 1));
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 10, 0, 50, 120);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 10, 0, 0, 0);
+
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _scene->loadAnimation(formAnimName('a', -1), 60);
+
+ sceneEntrySound();
+}
+
+void Scene303::step() {
+ if (_game._trigger == 60)
+ _scene->_nextSceneId = 304;
+}
+
+/*------------------------------------------------------------------------*/
+
+void Scene304::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene304::enter() {
+ if (_scene->_priorSceneId == 303) {
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _scene->loadAnimation(formAnimName('a',-1), 60);
+ } else {
+ if (_globals[kSexOfRex] == REX_MALE)
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ else
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('a', 2));
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('b', 0));
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 150, 0, 3, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 2);
+ _vm->_palette->setEntry(252, 45, 63, 45);
+ _vm->_palette->setEntry(253, 20, 45, 20);
+
+ if (_globals[kSexOfRex] == REX_MALE)
+ _game._player._playerPos = Common::Point(111, 117);
+ else
+ _game._player._playerPos = Common::Point(113, 116);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 11, 0, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -1);
+ _scene->_sequences.addTimer(48, 70);
+ }
+
+ sceneEntrySound();
+ _game.loadQuoteSet(0xEB, 0xEC, 0);
+}
+
+void Scene304::step() {
+ if (_game._trigger == 60)
+ _scene->_nextSceneId = 311;
+
+ if (_game._trigger >= 70) {
+ switch (_game._trigger) {
+ case 70: {
+ _game._player._visible = false;
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, 4);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ if (_globals[kSexOfRex] == REX_MALE)
+ _explosionSpriteId = _globals._spriteIndexes[1];
+ else
+ _explosionSpriteId = _globals._spriteIndexes[4];
+
+ int sprIdx = _scene->_sequences.addSpriteCycle(_explosionSpriteId, false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(sprIdx, -1, 4);
+ _scene->_sequences.setDepth(sprIdx, 1);
+ _scene->_sequences.addSubEntry(sprIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 74);
+ }
+ break;
+
+ case 71:
+ _scene->_kernelMessages.reset();
+ _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 60, _game.getQuote(0xEB));
+ _scene->_sequences.addTimer(1, 72);
+ break;
+
+ case 72: {
+ _vm->_sound->command(43);
+ int sprIdx = _scene->_sequences.addSpriteCycle(_explosionSpriteId, false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(sprIdx, 5, -2);
+ _scene->_sequences.setDepth(sprIdx, 1);
+ _scene->_sequences.addSubEntry(sprIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 73);
+ if (_game._storyMode == STORYMODE_NICE)
+ _scene->_sequences.addSubEntry(sprIdx, SEQUENCE_TRIGGER_SPRITE, 8, 78);
+ }
+ break;
+
+ case 73: {
+ int sprIdx = _scene->_sequences.addSpriteCycle(_explosionSpriteId, false, 8, 0, 0, 0);
+ _scene->_sequences.setAnimRange(sprIdx, -2, -2);
+ _scene->_sequences.setDepth(sprIdx, 1);
+ }
+ break;
+
+ case 74:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 5, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 75);
+ break;
+
+ case 75:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 76);
+ break;
+
+ case 76:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 0, 0, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, 2);
+ _scene->_sequences.addTimer(48, 77);
+ break;
+
+ case 77:
+ _scene->_kernelMessages.reset();
+ _scene->_kernelMessages.add(Common::Point(211, 45), 0xFDFC, 32, 0, 180, _game.getQuote(0xEC));
+ _scene->_sequences.addTimer(120, 78);
+ break;
+
+ case 78:
+ _scene->_nextSceneId = 316;
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h
index fad60cf118..74611a61f9 100644
--- a/engines/mads/nebular/nebular_scenes3.h
+++ b/engines/mads/nebular/nebular_scenes3.h
@@ -66,7 +66,7 @@ private:
int _oldFrame;
public:
- Scene302(MADSEngine *vm) : Scene3xx(vm) {}
+ Scene302(MADSEngine *vm) : Scene3xx(vm), _oldFrame(0) {}
virtual void setup();
virtual void enter();
@@ -75,6 +75,34 @@ public:
virtual void actions() {};
virtual void postActions() {};
};
+
+class Scene303: public Scene3xx {
+public:
+ Scene303(MADSEngine *vm) : Scene3xx(vm) {}
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions() {};
+ virtual void actions() {};
+ virtual void postActions() {};
+};
+
+class Scene304: public Scene3xx {
+private:
+ int _explosionSpriteId;
+
+public:
+ Scene304(MADSEngine *vm) : Scene3xx(vm), _explosionSpriteId(-1) {}
+
+ 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