aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/nebular_scenes4.cpp
diff options
context:
space:
mode:
authorStrangerke2014-05-01 23:58:02 +0200
committerStrangerke2014-05-01 23:58:02 +0200
commitc5aa86f9651e9518a56e7714561e4569f1be785d (patch)
tree850def84b01477e957e4d4ffd3d3b921ad6faf0e /engines/mads/nebular/nebular_scenes4.cpp
parentb9a1b5376188c2e75d6aa2dba0fceba17fe3b2a6 (diff)
downloadscummvm-rg350-c5aa86f9651e9518a56e7714561e4569f1be785d.tar.gz
scummvm-rg350-c5aa86f9651e9518a56e7714561e4569f1be785d.tar.bz2
scummvm-rg350-c5aa86f9651e9518a56e7714561e4569f1be785d.zip
MADS: Implement scene 410
Diffstat (limited to 'engines/mads/nebular/nebular_scenes4.cpp')
-rw-r--r--engines/mads/nebular/nebular_scenes4.cpp162
1 files changed, 162 insertions, 0 deletions
diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp
index 9b0c5affbb..93ab7dd4d3 100644
--- a/engines/mads/nebular/nebular_scenes4.cpp
+++ b/engines/mads/nebular/nebular_scenes4.cpp
@@ -2939,5 +2939,167 @@ void Scene408::actions() {
/*------------------------------------------------------------------------*/
+void Scene410::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene410::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('y', -1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*ROXRC_7");
+
+ if (_game._objects.isInRoom(OBJ_CHARGE_CASES))
+ _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1);
+ else
+ _scene->_hotspots.activate(0x48, false);
+
+ if (_scene->_priorSceneId != -2) {
+ _game._player._playerPos = Common::Point(155, 150);
+ _game._player._facing = FACING_NORTH;
+ }
+
+ sceneEntrySound();
+
+ _scene->loadAnimation(Resources::formatName(410, 'r', -1, EXT_AA, ""));
+ _scene->_activeAnimation->_resetFlag = true;
+}
+
+void Scene410::step() {
+ if (_scene->_activeAnimation->getCurrentFrame() == 1) {
+ if (_vm->getRandomNumber(1, 30) == 1)
+ _scene->_activeAnimation->setCurrentFrame(2);
+ else
+ _scene->_activeAnimation->setCurrentFrame(0);
+ }
+
+ if (_scene->_activeAnimation->getCurrentFrame() == 9) {
+ if (_vm->getRandomNumber(1, 30) == 1)
+ _scene->_activeAnimation->setCurrentFrame(10);
+ else
+ _scene->_activeAnimation->setCurrentFrame(8);
+ }
+
+ if (_scene->_activeAnimation->getCurrentFrame() == 5) {
+ if (_vm->getRandomNumber(1, 30) == 1)
+ _scene->_activeAnimation->setCurrentFrame(6);
+ else
+ _scene->_activeAnimation->setCurrentFrame(4);
+ }
+
+ if (_scene->_activeAnimation->getCurrentFrame() == 3) {
+ if (_vm->getRandomNumber(1, 2) == 1)
+ _scene->_activeAnimation->setCurrentFrame(4);
+ else // == 2
+ _scene->_activeAnimation->setCurrentFrame(8);
+ }
+}
+
+void Scene410::preActions() {
+ if (_action.isAction(VERB_TAKE) && !_action.isAction(0x48))
+ _game._player._needToWalk = false;
+
+ if (_action.isAction(VERB_LOOK, 0x48) && _game._objects.isInRoom(OBJ_CHARGE_CASES))
+ _game._player._needToWalk = true;
+
+ if (_action.isAction(VERB_OPEN, 0x278) || _action.isAction(VERB_OPEN, 0x214))
+ _game._player._needToWalk = false;
+
+ if (_action.isAction(VERB_LOOK, 0x272))
+ _game._player._needToWalk = true;
+}
+
+void Scene410::actions() {
+ if (_action.isAction(0x242, 0x2B3))
+ _scene->_nextSceneId = 406;
+ else if (_action.isAction(VERB_TAKE, 0x48) && (_game._objects.isInRoom(OBJ_CHARGE_CASES) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _vm->_sound->command(57);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 3);
+ _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 3, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->_sequences.remove(_globals._sequenceIndexes[1]);
+ _scene->_hotspots.activate(0x48, false);
+ _game._objects.addToInventory(OBJ_CHARGE_CASES);
+ _vm->_dialogs->showItem(OBJ_CHARGE_CASES, 41032);
+ break;
+
+ case 2:
+ _game._player._priorTimer = _game._player._ticksAmount + _scene->_frameStartTime;
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_action.isAction(VERB_LOOK, 0x276))
+ _vm->_dialogs->show(41010);
+ else if (_action.isAction(VERB_TAKE, 0x276))
+ _vm->_dialogs->show(41011);
+ else if (_action.isAction(VERB_OPEN, 0x276))
+ _vm->_dialogs->show(41012);
+ else if (_action.isAction(VERB_LOOK, 0x270))
+ _vm->_dialogs->show(41013);
+ else if (_action.isAction(VERB_TAKE, 0x270))
+ _vm->_dialogs->show(41014);
+ else if (_action.isAction(VERB_LOOK, 0x265) || _action.isAction(VERB_OPEN, 0x265)) {
+ if (_game._objects.isInRoom(OBJ_CHARGE_CASES))
+ _vm->_dialogs->show(41015);
+ else
+ _vm->_dialogs->show(41016);
+ } else if (_action.isAction(VERB_LOOK, 0x26E))
+ _vm->_dialogs->show(41017);
+ else if (_action.isAction(VERB_TAKE, 0x26E))
+ _vm->_dialogs->show(41018);
+ else if (_action.isAction(VERB_LOOK, 0x278))
+ _vm->_dialogs->show(41019);
+ else if (_action.isAction(VERB_LOOK, 0x214))
+ _vm->_dialogs->show(41019);
+ else if (_action.isAction(VERB_OPEN, 0x278))
+ _vm->_dialogs->show(41020);
+ else if (_action.isAction(VERB_OPEN, 0x214))
+ _vm->_dialogs->show(41020);
+ else if (_action.isAction(VERB_LOOK, 0x277))
+ _vm->_dialogs->show(41021);
+ else if (_action.isAction(VERB_TAKE, 0x277))
+ _vm->_dialogs->show(41022);
+ else if (_action.isAction(VERB_LOOK, 0x272))
+ _vm->_dialogs->show(41023);
+ else if (_action.isAction(VERB_TAKE, 0x272))
+ _vm->_dialogs->show(41024);
+ else if (_action.isAction(VERB_LOOK, 0x48) && _game._objects.isInRoom(OBJ_CHARGE_CASES))
+ _vm->_dialogs->show(41025);
+ else if (_action.isAction(VERB_LOOK, 0x2C3))
+ _vm->_dialogs->show(41027);
+ else if (_action.isAction(VERB_LOOK, 0x47D))
+ _vm->_dialogs->show(41028);
+ else if (_action.isAction(VERB_LOOK, 0x275))
+ _vm->_dialogs->show(41029);
+ else if (_action.isAction(VERB_TAKE, 0x275))
+ _vm->_dialogs->show(41030);
+ else if (_action.isAction(VERB_THROW, 0x275))
+ _vm->_dialogs->show(41031);
+ else if (_action._lookFlag)
+ _vm->_dialogs->show(41033);
+ else
+ return;
+
+ _action._inProgress = false;
+}
+
+/*------------------------------------------------------------------------*/
+
} // End of namespace Nebular
} // End of namespace MADS