aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/nebular_scenes8.cpp
diff options
context:
space:
mode:
authorStrangerke2014-05-17 09:52:21 +0200
committerStrangerke2014-05-17 09:52:21 +0200
commitdc1d78e8ad86bc608064cc4c3daf54247a1ccee2 (patch)
treef91f8b231925f38c1175a725c690ebe7c77460e6 /engines/mads/nebular/nebular_scenes8.cpp
parent622f97244df3f6bf80c86c4452f064bee8871e3d (diff)
downloadscummvm-rg350-dc1d78e8ad86bc608064cc4c3daf54247a1ccee2.tar.gz
scummvm-rg350-dc1d78e8ad86bc608064cc4c3daf54247a1ccee2.tar.bz2
scummvm-rg350-dc1d78e8ad86bc608064cc4c3daf54247a1ccee2.zip
MADS: Implement scene 801
Diffstat (limited to 'engines/mads/nebular/nebular_scenes8.cpp')
-rw-r--r--engines/mads/nebular/nebular_scenes8.cpp228
1 files changed, 226 insertions, 2 deletions
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index 296fd74c34..13ab001bae 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -11,7 +11,7 @@
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
@@ -76,6 +76,230 @@ void Scene8xx::sceneEntrySound() {
/*------------------------------------------------------------------------*/
+void Scene801::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene801::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('a', -1));
+
+ if (_scene->_priorSceneId != 802) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ }
+
+ if ((_globals[kCameFromCut]) && (_globals[kCutX] != 0)) {
+ _game._player._playerPos = Common::Point(_globals[kCutX], _globals[kCutY]);
+ _game._player._facing = (Facing)_globals[kCutFacing];
+ _globals[kCutX] = 0;
+ _globals[kCameFromCut] = false;
+ _globals[kReturnFromCut] = false;
+ _globals[kBeamIsUp] = false;
+ _globals[kForceBeamDown] = false;
+ _globals[kDontRepeat] = false;
+ } else if (_scene->_priorSceneId == 808) {
+ _game._player._playerPos = Common::Point(148, 110);
+ _game._player._facing = FACING_NORTH;
+ } else if (_scene->_priorSceneId == 802) {
+ _game._player._playerPos = Common::Point(307, 111);
+ _game._player.walk(Common::Point(270, 118), FACING_WEST);
+ _game._player._visible = true;
+ } else if ((_scene->_priorSceneId != -2) && !_globals[kTeleporterCommand]) {
+ _game._player._playerPos = Common::Point(8, 117);
+ _game._player.walk(Common::Point(41, 115), FACING_EAST);
+ _game._player._visible = true;
+ }
+
+ _globals[kBetweenRooms] = false;
+
+ if (_globals[kTeleporterCommand]) {
+ _game._player._stepEnabled = false;
+ switch (_globals[kTeleporterCommand]) {
+ case 1:
+ _game._player._playerPos = Common::Point(8, 117);
+ _globals[kTeleporterUnderstood] = true;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 13);
+ _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 75);
+ _vm->_sound->command(30);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(8, 117);
+ _globals[kTeleporterUnderstood] = true;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 13);
+ _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 8090);
+ _vm->_sound->command(30);
+ break;
+
+ case 3:
+ case 4:
+ _game._player._playerPos = Common::Point(8, 117);
+ _game._player.walk(Common::Point(41, 115), FACING_EAST);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _globals[kTeleporterCommand] = 0;
+ }
+
+ _walkThroughDoor = false;
+ if (_scene->_priorSceneId == 802) {
+ _game._player._stepEnabled = false;
+ _walkThroughDoor = true;
+ }
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 11, 0, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 9, 0, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ sceneEntrySound();
+}
+
+void Scene801::step() {
+ if (_game._trigger == 75) {
+ if (_globals[kSexOfRex] == REX_FEMALE) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 8, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 140);
+ } else {
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(8, 117);
+ _game._player.walk(Common::Point(41, 115), FACING_EAST);
+ }
+ }
+
+ if (_game._trigger == 140) {
+ _vm->_sound->command(27);
+ _globals._sequenceIndexes[5] = _scene->_sequences.startCycle(_globals._spriteIndexes[5], false, 8);
+ _scene->_sequences.addTimer(100, 141);
+ }
+
+ if (_game._trigger == 141) {
+ _scene->_reloadSceneFlag = true;
+ _scene->_nextSceneId = _scene->_priorSceneId;
+ _globals[kTeleporterCommand] = 0;
+ }
+
+ if (_game._trigger == 80) {
+ _globals[kTeleporterCommand] = 1;
+ _scene->_nextSceneId = _globals[kTeleporterDestination];
+ _scene->_reloadSceneFlag = true;
+ }
+
+ if (_walkThroughDoor && (_game._player._playerPos == Common::Point(270, 118))) {
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _walkThroughDoor = false;
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 120);
+ }
+
+ if (_game._trigger == 120) {
+ _vm->_sound->command(12);
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _game._player._stepEnabled = true;
+ }
+
+ if (_game._trigger == 90) {
+ _game._player.walk(Common::Point(307, 111), FACING_EAST);
+ _scene->_sequences.addTimer(80, 130);
+ }
+
+ if (_game._trigger == 130) {
+ _vm->_sound->command(12);
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 110);
+ }
+
+ if (_game._trigger == 110) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _scene->_nextSceneId = 802;
+ }
+}
+
+void Scene801::preActions() {
+ if (_action.isAction(VERB_LOOK, 0x59)) {
+ _game._player.walk(Common::Point(148, 110), FACING_NORTH);
+ _game._player._needToWalk = true;
+ _game._player._readyToWalk = true;
+ }
+
+ if (_action.isAction(0x188, 0x16C) && _globals[kBeamIsUp]) {
+ _globals[kCutX] = _game._player._playerPos.x;
+ _globals[kCutY] = _game._player._playerPos.y;
+ _globals[kCutFacing] = _game._player._facing;
+ _globals[kForceBeamDown] = true;
+ _globals[kDontRepeat] = true;
+ _scene->_nextSceneId = 803;
+ }
+}
+
+void Scene801::actions() {
+ if (_action.isAction(VERB_LOOK, 0x59))
+ _scene->_nextSceneId = 808;
+ else if (_action.isAction(0x188, 0x16C)) {
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _scene->_nextSceneId = 807;
+ } else if (_action.isAction(0x18B, 0x6E) && (_game._player._playerPos == Common::Point(270, 118))) {
+ _game._player._stepEnabled = false;
+ _game._player._facing = FACING_EAST;
+ _game._player.selectSeries();
+ _globals[kBetweenRooms] = true;
+ _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
+ _scene->_sequences.remove(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 90);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ _vm->_sound->command(11);
+ } else if (_action.isAction(VERB_LOOK, 0x46))
+ _vm->_dialogs->show(80110);
+ else if (_action.isAction(VERB_LOOK, 0xE2))
+ _vm->_dialogs->show(80111);
+ else if (_action.isAction(VERB_LOOK, 0x16C))
+ _vm->_dialogs->show(80112);
+ else if (_action.isAction(VERB_LOOK, 0x2C7) || _action._lookFlag)
+ _vm->_dialogs->show(80113);
+ else if (_action.isAction(VERB_LOOK, 0x390))
+ _vm->_dialogs->show(80114);
+ else if (_action.isAction(VERB_LOOK, 0x391))
+ _vm->_dialogs->show(80115);
+ else if (_action.isAction(VERB_LOOK, 0x18D))
+ _vm->_dialogs->show(80116);
+ else if (_action.isAction(VERB_LOOK, 0x6E))
+ _vm->_dialogs->show(80117);
+ else
+ return;
+
+ _action._inProgress = false;
+}
+
+/*------------------------------------------------------------------------*/
+
void Scene804::setup() {
Scene8xx::setPlayerSpritesPrefix();
Scene8xx::setAAName();
@@ -297,7 +521,7 @@ void Scene804::step() {
_scene->_nextSceneId = 803;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 72) && !_alreadyPop) {
+ if ((_scene->_activeAnimation->getCurrentFrame() == 72) && !_alreadyPop) {
_vm->_sound->command(21);
_alreadyPop = true;
}