Permalink
Browse files

BLADERUNNER: Player death

Added original game behavior when player died, 5 second wait and then
load screen.
  • Loading branch information...
peterkohaut committed Jan 8, 2019
1 parent 25d3b2b commit d14c6976da1f1bfa5e66ae23b512ab9129eba6a1
Showing with 23 additions and 1 deletion.
  1. +22 −1 engines/bladerunner/bladerunner.cpp
  2. +1 −0 engines/bladerunner/bladerunner.h
@@ -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;
@@ -281,6 +281,7 @@ class BladeRunnerEngine : public Engine {
bool playerHasControl();
void playerLosesControl();
void playerGainsControl();
void playerDied();

bool saveGame(Common::WriteStream &stream, const Graphics::Surface &thumbnail);
bool loadGame(Common::SeekableReadStream &stream);

0 comments on commit d14c697

Please sign in to comment.