[Scummvm-git-logs] scummvm master -> d14c6976da1f1bfa5e66ae23b512ab9129eba6a1
peterkohaut
peterkohaut at users.noreply.github.com
Tue Jan 8 19:27:03 CET 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d14c6976da BLADERUNNER: Player death
Commit: d14c6976da1f1bfa5e66ae23b512ab9129eba6a1
https://github.com/scummvm/scummvm/commit/d14c6976da1f1bfa5e66ae23b512ab9129eba6a1
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-08T19:25:27+01:00
Commit Message:
BLADERUNNER: Player death
Added original game behavior when player died, 5 second wait and then
load screen.
Changed paths:
engines/bladerunner/bladerunner.cpp
engines/bladerunner/bladerunner.h
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index bd7379e..08de967 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -832,7 +832,10 @@ bool BladeRunnerEngine::isMouseButtonDown() const {
void BladeRunnerEngine::gameLoop() {
_gameIsRunning = true;
do {
- /* TODO: check player death */
+ if (_playerDead) {
+ playerDied();
+ _playerDead = false;
+ }
gameTick();
} while (_gameIsRunning);
}
@@ -1759,6 +1762,24 @@ void BladeRunnerEngine::playerGainsControl() {
}
}
+void BladeRunnerEngine::playerDied() {
+ playerLosesControl();
+
+ int timeWaitEnd = _time->current() + 5000;
+ while (_time->current() < timeWaitEnd) {
+ gameTick();
+ }
+
+ _actorDialogueQueue->flush(1, false);
+
+ while (_playerLosesControlCounter > 0) {
+ playerGainsControl();
+ }
+
+ _kia->_forceOpen = true;
+ _kia->open(kKIASectionLoad);
+}
+
bool BladeRunnerEngine::saveGame(Common::WriteStream &stream, const Graphics::Surface &thumbnail) {
if (!playerHasControl() || _sceneScript->isInsideScript() || _aiScripts->isInsideScript()) {
return false;
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 75ff0c8..780c32b 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -281,6 +281,7 @@ public:
bool playerHasControl();
void playerLosesControl();
void playerGainsControl();
+ void playerDied();
bool saveGame(Common::WriteStream &stream, const Graphics::Surface &thumbnail);
bool loadGame(Common::SeekableReadStream &stream);
More information about the Scummvm-git-logs
mailing list