diff options
author | Jaromir Wysoglad | 2019-07-01 10:45:20 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | a4ca2a838f739a53894e05100acf468788eca21b (patch) | |
tree | 455ef1ce7715287ee4dc3a8a3948bf8f858f331a /engines/supernova | |
parent | b0e386b0147129017e8a0ed531332585f086aa11 (diff) | |
download | scummvm-rg350-a4ca2a838f739a53894e05100acf468788eca21b.tar.gz scummvm-rg350-a4ca2a838f739a53894e05100acf468788eca21b.tar.bz2 scummvm-rg350-a4ca2a838f739a53894e05100acf468788eca21b.zip |
SUPERNOVA: When dead return back to main loop ASAP
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/game-manager.cpp | 1 | ||||
-rw-r--r-- | engines/supernova/game-manager.h | 1 | ||||
-rw-r--r-- | engines/supernova/supernova1/rooms.cpp | 16 | ||||
-rw-r--r-- | engines/supernova/supernova1/state.cpp | 5 | ||||
-rw-r--r-- | engines/supernova/supernova2/rooms.cpp | 14 | ||||
-rw-r--r-- | engines/supernova/supernova2/state.cpp | 14 |
6 files changed, 43 insertions, 8 deletions
diff --git a/engines/supernova/game-manager.cpp b/engines/supernova/game-manager.cpp index e6a6943acf..2d003741b2 100644 --- a/engines/supernova/game-manager.cpp +++ b/engines/supernova/game-manager.cpp @@ -922,6 +922,7 @@ void GameManager::dead(int messageId) { _vm->paletteFadeIn(); _guiEnabled = true; + _dead = true; } int GameManager::invertSection(int section) { diff --git a/engines/supernova/game-manager.h b/engines/supernova/game-manager.h index 5ee747f934..1700ab84d0 100644 --- a/engines/supernova/game-manager.h +++ b/engines/supernova/game-manager.h @@ -152,6 +152,7 @@ public: byte _rows[6]; byte _rowsStart[6]; int32 _time; + bool _dead; void takeObject(Object &obj); void setObjectNull(Object *&obj); diff --git a/engines/supernova/supernova1/rooms.cpp b/engines/supernova/supernova1/rooms.cpp index 41b2338172..77d0eac244 100644 --- a/engines/supernova/supernova1/rooms.cpp +++ b/engines/supernova/supernova1/rooms.cpp @@ -3499,8 +3499,10 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { else { _vm->renderImage(1); _vm->playSound(kAudioDoorOpen); - if (getObject(4)->hasProperty(CAUGHT)) + if (getObject(4)->hasProperty(CAUGHT)) { _gm->busted(11); + return true; + } getObject(4)->resetProperty(EXIT | OPENABLE | OPENED); } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR2) && !getObject(5)->hasProperty(OPENED)) { @@ -3509,8 +3511,10 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { else { _vm->renderImage(2); _vm->playSound(kAudioDoorOpen); - if (getObject(5)->hasProperty(CAUGHT)) + if (getObject(5)->hasProperty(CAUGHT)) { _gm->busted(16); + return true; + } getObject(5)->resetProperty(EXIT | OPENABLE | OPENED); } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR3) && !getObject(6)->hasProperty(OPENED)) { @@ -3519,8 +3523,10 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { else { _vm->renderImage(3); _vm->playSound(kAudioDoorOpen); - if (getObject(6)->hasProperty(CAUGHT)) + if (getObject(6)->hasProperty(CAUGHT)) { _gm->busted(15); + return true; + } getObject(6)->resetProperty(EXIT | OPENABLE | OPENED); } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR4) && !getObject(7)->hasProperty(OPENED)) { @@ -3529,8 +3535,10 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { } else { _vm->renderImage(4); _vm->playSound(kAudioDoorOpen); - if (getObject(7)->hasProperty(CAUGHT)) + if (getObject(7)->hasProperty(CAUGHT)) { _gm->busted(20); + return true; + } getObject(7)->resetProperty(EXIT | OPENABLE | OPENED); } } else if ((verb == ACTION_LOOK) && (obj1._id >= DOOR1) && (obj1._id <= DOOR4)) { diff --git a/engines/supernova/supernova1/state.cpp b/engines/supernova/supernova1/state.cpp index 1f9c81b864..2dd2a1d08e 100644 --- a/engines/supernova/supernova1/state.cpp +++ b/engines/supernova/supernova1/state.cpp @@ -296,6 +296,7 @@ void GameManager1::initState() { _state._dream = false; _prevImgId = 0; + _dead = false; } void GameManager1::initRooms() { @@ -1502,6 +1503,10 @@ void GameManager1::handleInput() { void GameManager1::executeRoom() { if (_processInput && !_vm->_screen->isMessageShown() && _guiEnabled) { handleInput(); + if (_dead) { + _dead = false; + return; + } if (_mouseClicked) { Common::Event event; event.type = Common::EVENT_MOUSEMOVE; diff --git a/engines/supernova/supernova2/rooms.cpp b/engines/supernova/supernova2/rooms.cpp index 1ff643f653..6feebefe84 100644 --- a/engines/supernova/supernova2/rooms.cpp +++ b/engines/supernova/supernova2/rooms.cpp @@ -1977,8 +1977,10 @@ bool Ship::interact(Action verb, Object &obj1, Object &obj2) { else if (isSectionVisible(9)) { _vm->renderImage(9 + 128); _vm->renderImage(11); - if (!_shown[kMaxSection - 1]) + if (!_shown[kMaxSection - 1]) { kill(); + return true; + } _objectState[6]._click = 8; _gm->wait(2); _vm->renderImage(4); @@ -1989,8 +1991,10 @@ bool Ship::interact(Action verb, Object &obj1, Object &obj2) { _objectState[2]._description = kStringDefaultDescription; } else { _vm->renderImage(10); - if (!_shown[kMaxSection - 1]) + if (!_shown[kMaxSection - 1]) { kill(); + return true; + } _objectState[6]._click = 7; } } else if (verb == ACTION_USE && Object::combine(obj1, obj2, CABLE, DOOR_SWITCH) && isSectionVisible(7)) { @@ -2004,8 +2008,10 @@ bool Ship::interact(Action verb, Object &obj1, Object &obj2) { else if (isSectionVisible(10)) { _vm->renderImage(10 + 128); _vm->renderImage(11); - if (!_shown[kMaxSection - 1]) + if (!_shown[kMaxSection - 1]) { kill(); + return true; + } _objectState[6]._click = 8; _gm->wait(2); _vm->renderImage(4); @@ -4742,6 +4748,8 @@ bool Mus22::interact(Action verb, Object &obj1, Object &obj2) { else { _vm->renderMessage(kStringMuseum21); _gm->crack(20); + if (_gm->_dead) + return true; if (!_gm->_state._alarmOn) { _vm->renderMessage(kStringMuseum22); _vm->playSound(kAudioSuccess2); diff --git a/engines/supernova/supernova2/state.cpp b/engines/supernova/supernova2/state.cpp index 1b2d28a234..01f425d3ee 100644 --- a/engines/supernova/supernova2/state.cpp +++ b/engines/supernova/supernova2/state.cpp @@ -296,6 +296,7 @@ void GameManager2::initState() { int16 startPuzzleTab[15] = {12, 3, 14, 1, 11, 0, 2, 13, 9, 5, 4, 10, 7, 6, 8}; for (int i = 0; i < 15; i++) _state._puzzleTab[i] = startPuzzleTab[i]; + _dead = false; } void GameManager2::initRooms() { @@ -728,6 +729,10 @@ void GameManager2::executeRoom() { _vm->_sound->playSiren(); if (_processInput && !_vm->_screen->isMessageShown() && _guiEnabled) { handleInput(); + if (_dead) { + _dead = false; + return; + } if (_mouseClicked) { Common::Event event; event.type = Common::EVENT_MOUSEMOVE; @@ -750,6 +755,10 @@ void GameManager2::executeRoom() { drawMapExits(); else drawClock(); + if (_dead) { + _dead = false; + return; + } drawInventory(); drawStatus(); drawCommandBox(); @@ -1331,6 +1340,7 @@ void GameManager2::drawClock() { //arrow(); _state._alarmCracked = false; caught(); + return; } for (int i = 0; i < 3; i++) { Object *o = r->getObject(i); @@ -1363,7 +1373,7 @@ void GameManager2::crack(int time) { zv = z; drawClock(); t++; - } while (t < time && _state._alarmOn == _alarmBefore); + } while (t < time && _state._alarmOn == _alarmBefore && !_dead); _cracking = false; _vm->_screen->changeCursor(ResourceManager::kCursorNormal); if (_state._alarmOn == _alarmBefore) @@ -1373,6 +1383,8 @@ void GameManager2::crack(int time) { bool GameManager2::crackDoor(int time) { _vm->renderMessage(kStringMuseum15); crack(time); + if (_dead) + return false; if (_state._alarmOn != _alarmBefore) { waitOnInput(_messageDuration); _vm->removeMessage(); |