diff options
Diffstat (limited to 'engines/mads/nebular/nebular_scenes3.cpp')
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 141 |
1 files changed, 77 insertions, 64 deletions
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index bcedf95a27..5a6edbf995 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * 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 * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -370,7 +370,7 @@ void Scene304::enter() { _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); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_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); @@ -521,11 +521,11 @@ void Scene307::setup() { setPlayerSpritesPrefix(); setAAName(); _scene->addActiveVocab(NOUN_AIR_VENT); - _scene->addActiveVocab(NOUN_CLIMB_INTO); + _scene->addActiveVocab(VERB_CLIMB_INTO); } void Scene307::handleRexDialog(int quote) { - Common::String curQuote = _game.getQuote(_action._activeAction._verbId); + Common::String curQuote = _game.getQuote(quote); if (_vm->_font->getWidth(curQuote, _scene->_textSpacing) > 200) { Common::String subQuote1; _game.splitQuote(curQuote, subQuote1, _subQuote2); @@ -769,7 +769,7 @@ void Scene307::enter() { _dialog2.write(0x11E, true); - if (_scene->_priorSceneId == -2) { + if (_scene->_priorSceneId == RETURNING_FROM_DIALOG) { if (_grateOpenedFl) _vm->_sound->command(10); else @@ -953,7 +953,7 @@ void Scene307::actions() { case 2: { int oldIdx = _globals._sequenceIndexes[5]; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 12, 6, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 12, 6, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 2, 3); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[5], oldIdx); @@ -992,7 +992,7 @@ void Scene307::actions() { _scene->_sequences.remove(_globals._sequenceIndexes[5]); _grateOpenedFl = true; _scene->_hotspots.activate(17, false); - int idx = _scene->_dynamicHotspots.add(17, NOUN_CLIMB_INTO, -1, Common::Rect(117, 67, 117 + 19, 67 + 13)); + int idx = _scene->_dynamicHotspots.add(17, VERB_CLIMB_INTO, -1, Common::Rect(117, 67, 117 + 19, 67 + 13)); int hotspotId = _scene->_dynamicHotspots.setPosition(idx, Common::Point(129, 104), FACING_NORTH); _scene->_dynamicHotspots.setCursor(hotspotId, CURSOR_GO_UP); _game._objects.removeFromInventory(OBJ_SCALPEL, NOWHERE); @@ -1245,7 +1245,7 @@ void Scene308::step() { switch (_game._trigger) { case 70: { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 18, 9, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 18, 9, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1266,7 +1266,7 @@ void Scene308::step() { case 72: _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 5, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 20, 5, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 3, 4); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1284,7 +1284,7 @@ void Scene308::step() { case 74: { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 8, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 20, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 6, 7); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1306,7 +1306,7 @@ void Scene308::step() { case 76: { int seqIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 26, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 26, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1441,7 +1441,7 @@ void Scene309::step() { case 70: { int idx = _scene->_dynamicHotspots.add(689, 690, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(142, 146), FACING_NORTHEAST); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 4, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); @@ -1462,7 +1462,7 @@ void Scene309::step() { case 72: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 8, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 8, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); @@ -1484,7 +1484,7 @@ void Scene309::step() { case 74: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 6, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 21, 23); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); @@ -1494,7 +1494,7 @@ void Scene309::step() { case 75: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 6, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 24, 25); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); @@ -1513,7 +1513,7 @@ void Scene309::step() { break; case 77: { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 90, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 90, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 29, 30); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); int idx = _scene->_kernelMessages.add(Common::Point(15, 46), 0xFDFC, 0, 0, 120, _game.getQuote(247)); @@ -1618,7 +1618,7 @@ void Scene311::enter() { else if (_scene->_priorSceneId == 320) { _game._player._playerPos = Common::Point(129, 113); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._visible = false; _game._player._stepEnabled = false; _scene->loadAnimation(formAnimName('a', -1), 70); @@ -1749,7 +1749,7 @@ void Scene311::actions() { else if (_checkGuardFl) { _checkGuardFl = false; _scene->_kernelMessages.reset(); - _scene->_kernelMessages.addQuote(0xFA, 120, 0); + _scene->_kernelMessages.addQuote(250, 0, 240); } else if (_action.isAction(VERB_SIT_AT, NOUN_DESK)) _scene->_nextSceneId = 320; else if (_action.isAction(VERB_CLIMB_INTO, NOUN_AIR_VENT)) { @@ -1896,7 +1896,7 @@ void Scene313::enter() { } else if (_scene->_priorSceneId == 388) { _game._player._playerPos = Common::Point(199, 70); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(234, 70); _game._player._facing = FACING_WEST; } @@ -1965,7 +1965,7 @@ void Scene316::handleRexInGrate() { case 1: _scene->_sequences.setDone(_globals._sequenceIndexes[4]); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 12, 3, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 12, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 2, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2085,7 +2085,7 @@ void Scene316::handleRoxInGrate() { case 1: _scene->_sequences.setDone(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 17, 3, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 17, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 2, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2215,7 +2215,7 @@ void Scene316::enter() { _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[spriteIdx], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 60); - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(291, 126); sceneEntrySound(); @@ -2523,7 +2523,7 @@ void Scene318::handleDialog() { case 0x19C: case 0x19D: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], Common::Point(142, 121)); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 6, 8); @@ -2581,6 +2581,12 @@ void Scene318::handleInternDialog(int quoteId, int quoteNum, uint32 timeout) { _scene->_kernelMessages.reset(); _internTalkingFl = true; + // WORKAROUND: In case the player launches multiple talk selections with the + // intern before previous ones have finished, take care of removing any + int seqIndex; + while ((seqIndex = _scene->_sequences.findByTrigger(63)) != -1) + _scene->_sequences.remove(seqIndex); + for (int i = 0; i < quoteNum; i++) { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_sequences.addTimer(180, 63); @@ -2611,7 +2617,7 @@ void Scene318::enter() { if (_scene->_priorSceneId == 357) _game._player._playerPos = Common::Point(15, 110); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(214, 152); _dialog1.setup(0x47, 0x191, 0x192, 0x193, 0x194, 0x195, 0x196, 0x197, 0x198, 0x199, 0x19A, 0x19B, 0x19C, 0x19D, 0); @@ -2632,7 +2638,7 @@ void Scene318::enter() { _lastFrame = 0; _scene->_hotspots.activate(NOUN_INTERN, false); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _dialogFl = false; _internWalkingFl = false; _counter= 0; @@ -2649,7 +2655,8 @@ void Scene318::enter() { 0x1C8, 0x1C9, 0x1CA, 0x1CB, 0x1CC, 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x190, 0x19D, 0); - if ((_scene->_priorSceneId== -2) || (((_scene->_priorSceneId == 318) || (_scene->_priorSceneId == -1)) && (!_globals[kAfterHavoc]))) { + if ((_scene->_priorSceneId == RETURNING_FROM_DIALOG) || (((_scene->_priorSceneId == 318) || + (_scene->_priorSceneId == RETURNING_FROM_LOADING)) && (!_globals[kAfterHavoc]))) { if (!_globals[kAfterHavoc]) { _game._player._visible = false; _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('g', -1)); @@ -2883,7 +2890,7 @@ void Scene318::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 2, 0, 80); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 2, 0, 80); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], Common::Point(142, 121)); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, 5); @@ -3113,7 +3120,7 @@ void Scene319::enter() { _dialog2.setup(0x44, 0x171, 0x172, 0x173, 0x174, 0x175, 0x176, 0); _dialog3.setup(0x45, 0x17D, 0x17E, 0x17F, 0x180, 0x181, 0x182, 0x183, 0); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _dialog1.set(0x165, 0x166, 0x167, 0x168, 0); _dialog2.set(0x171, 0x172, 0x173, 0x174, 0); _dialog3.set(0x17D, 0x17E, 0x17F, 0x180, 0); @@ -3136,7 +3143,7 @@ void Scene319::enter() { _scene->loadAnimation(formAnimName('b', 0)); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _animMode = 1; _nextAction1 = 2; _nextAction2 = 2; @@ -3306,7 +3313,7 @@ void Scene319::step() { switch (_game._trigger) { case 70: - case 71: + case 71: { _animMode = 1; _nextAction1 = _nextAction2; _animFrame = 0; @@ -3329,7 +3336,14 @@ void Scene319::step() { _scene->_sequences.updateTimeout(_globals._sequenceIndexes[i], oldIdx); } _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 74); + + // WORKAROUND: This fixes the game sometimes going into an endless waiting + // loop even after the doctor has finished hitting Rex. Note sure if it's due + // to a bug in room script or in the engine, but this at least fixes it + int seqIndex = _scene->_sequences.findByTrigger(2); + _scene->_sequences[seqIndex]._doneFlag = false; break; + } case 72: _vm->_palette->setColorFlags(0xFF, 0, 0); @@ -3588,7 +3602,7 @@ void Scene320::setLeftView(int view) { _scene->_sequences.remove(_globals._sequenceIndexes[0]); if (view != 10) { - _globals._sequenceIndexes[0] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); + _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 0); if (!_blinkFl) _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 2, 2); @@ -3752,7 +3766,7 @@ void Scene320::actions() { case 0: _game._player._stepEnabled = false; handleButtons(); - _globals._sequenceIndexes[18] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[18], _flippedFl, 4, 2, 0, 0); + _globals._sequenceIndexes[18] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[18], _flippedFl, 4, 2, 0, 0); _scene->_sequences.setScale(_globals._sequenceIndexes[18], 60); _scene->_sequences.setPosition(_globals._sequenceIndexes[18], Common::Point(_posX, 170)); _scene->_sequences.setDepth(_globals._sequenceIndexes[18], 0); @@ -3825,7 +3839,7 @@ void Scene320::actions() { else if (_action.isAction(VERB_LOOK, NOUN_DOUGHNUT)) _vm->_dialogs->show(32006); else if (_action.isAction(VERB_LOOK, NOUN_MAGAZINE)) - _vm->_dialogs->show(32006); + _vm->_dialogs->show(32007); else if (_action.isAction(VERB_LOOK, NOUN_PAPER_FOOTBALL)) _vm->_dialogs->show(32008); else if (_action.isAction(VERB_LOOK, NOUN_NEWSPAPER)) @@ -3975,7 +3989,7 @@ void Scene351::enter() { if (_scene->_priorSceneId == 352) _game._player._playerPos = Common::Point(148, 152); - else if (_scene->_priorSceneId != -2) { + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(207, 81); _game._player._facing = FACING_NORTH; } @@ -4053,12 +4067,12 @@ void Scene351::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 5, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 5, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4152,7 +4166,7 @@ void Scene352::setup() { void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { switch (_game._trigger) { case 0: - _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 60, _game.getQuote(0xFF)); + _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(0xFF)); _scene->_sequences.addTimer(48, 1); break; @@ -4160,12 +4174,12 @@ void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 5, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 3); @@ -4197,7 +4211,6 @@ void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { case 4: _game._player.walk(Common::Point(116, 107), FACING_NORTH); - _game._player._stepEnabled = true; _mustPutArmDownFl = false; _scene->_sequences.addTimer(180, 5); _leaveRoomFl = true; @@ -4261,7 +4274,7 @@ void Scene352::enter() { _vaultOpenFl = false; - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _mustPutArmDownFl = false; if (!_game._visitedScenes._sceneRevisited) _globals[kHaveYourStuff] = false; @@ -4276,7 +4289,7 @@ void Scene352::enter() { if (_scene->_priorSceneId == 353) _game._player._playerPos = Common::Point(171, 155); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(116, 107); sceneEntrySound(); @@ -4305,7 +4318,7 @@ void Scene352::preActions() { _game._player._stepEnabled = false; _scene->_sequences.remove(_commonSequenceIdx); _vm->_sound->command(20); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 6, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.addReverseSpriteCycle(_commonSpriteIndex, false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 1); _scene->_sequences.setDepth(_commonSequenceIdx, 15); } @@ -4364,7 +4377,7 @@ void Scene352::actions() { case 1: { _vm->_sound->command(21); - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[12], FACING_NORTH); int oldIdx = _commonSequenceIdx; _commonSequenceIdx = _scene->_sequences.startCycle(_commonSpriteIndex, false, -2); @@ -4376,7 +4389,7 @@ void Scene352::actions() { case 2: _vm->_sound->command(22); _scene->_sequences.remove(_commonSequenceIdx); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 8, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_commonSequenceIdx, 1, 3); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 3); break; @@ -4431,12 +4444,12 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 5, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4478,7 +4491,7 @@ void Scene352::actions() { case 1: { _vm->_sound->command(21); - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8); int oldIdx = _commonSequenceIdx; _commonSequenceIdx = _scene->_sequences.startCycle(_commonSpriteIndex, false, -2); @@ -4490,7 +4503,7 @@ void Scene352::actions() { case 2: _vm->_sound->command(23); _scene->_sequences.remove(_commonSequenceIdx); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 8, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.addReverseSpriteCycle(_commonSpriteIndex, false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_commonSequenceIdx, 1, 4); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 3); break; @@ -4545,13 +4558,13 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[14] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[14], false, 8, 1, 0, 0); + _globals._sequenceIndexes[14] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[14], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[14], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[14]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_SPRITE, 2, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[15] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[15], false, 8, 1, 0, 0); + _globals._sequenceIndexes[15] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[15], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[15], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[15]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[15], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -4592,12 +4605,12 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], true, 6, 2, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], true, 6, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[6]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[7] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[7], true, 6, 2, 0, 0); + _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], true, 6, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[7]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4745,7 +4758,7 @@ void Scene354::enter() { _game._player._facing = FACING_NORTH; } else if (_scene->_priorSceneId == 316) _game._player._playerPos = Common::Point(71, 107); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(167, 57); sceneEntrySound(); @@ -4812,7 +4825,7 @@ void Scene357::enter() { _game._player._playerPos = Common::Point(298, 142); else if (_scene->_priorSceneId == 313) _game._player._playerPos = Common::Point(127, 101); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(15, 148); sceneEntrySound(); @@ -4876,7 +4889,7 @@ void Scene358::enter() { if (_scene->_priorSceneId == 357) _game._player._playerPos = Common::Point(305, 142); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(12, 141); sceneEntrySound(); @@ -4952,7 +4965,7 @@ void Scene359::enter() { if (_scene->_priorSceneId == 358) _game._player._playerPos = Common::Point(301, 141); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(15, 148); sceneEntrySound(); @@ -4980,12 +4993,12 @@ void Scene359::actions() { _game._player._visible = false; _vm->_dialogs->show(35920); if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 4, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 4, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], true, 7, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], true, 7, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(106, 110)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 1); @@ -5075,7 +5088,7 @@ void Scene360::enter() { if (_scene->_priorSceneId == 359) _game._player._playerPos = Common::Point(304, 143); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(13, 141); sceneEntrySound(); @@ -5341,7 +5354,7 @@ void Scene361::enter() { else if (_scene->_priorSceneId == 320) { _game._player._playerPos = Common::Point(129, 113); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(13, 145); _game.loadQuoteSet(0xFB, 0xFC, 0); @@ -5466,7 +5479,7 @@ void Scene361::actions() { _vm->_dialogs->show(36119); else if (_action.isAction(VERB_SIT_AT, NOUN_DESK)) { _scene->_kernelMessages.reset(); - _scene->_kernelMessages.addQuote(0xFC, 120, 0); + _scene->_kernelMessages.addQuote(252, 0, 120); } else if (_action.isAction(VERB_CLIMB_INTO, NOUN_AIR_VENT)) { if (_globals[kSexOfRex] == REX_FEMALE) handleRoxAction(); |