aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/police_maze.cpp
diff options
context:
space:
mode:
authorThanasis Antoniou2019-03-18 17:04:03 +0200
committerThanasis Antoniou2019-03-18 17:07:10 +0200
commit717705f7c947285773b12d055b4014a79453551c (patch)
tree6800a88cd82f6a8a401dd760e883f35fedca9691 /engines/bladerunner/script/police_maze.cpp
parentf73584f0e5b43f24db4b66cdd07acc7f5c9f617b (diff)
downloadscummvm-rg350-717705f7c947285773b12d055b4014a79453551c.tar.gz
scummvm-rg350-717705f7c947285773b12d055b4014a79453551c.tar.bz2
scummvm-rg350-717705f7c947285773b12d055b4014a79453551c.zip
BLADERUNNER: Fixes and cleanup for Police Maze A
Only fixes for rooms PS10, PS11. A few cases may need revising. There are a few cases that a target may reset after being shot and they seem buggy but they could also be intended. So, that's for a second pass to decide.
Diffstat (limited to 'engines/bladerunner/script/police_maze.cpp')
-rw-r--r--engines/bladerunner/script/police_maze.cpp67
1 files changed, 64 insertions, 3 deletions
diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp
index a032c898d6..cd91eb4c54 100644
--- a/engines/bladerunner/script/police_maze.cpp
+++ b/engines/bladerunner/script/police_maze.cpp
@@ -30,6 +30,8 @@
#include "bladerunner/script/police_maze.h"
#include "bladerunner/script/scene_script.h"
#include "bladerunner/time.h"
+#include "bladerunner/subtitles.h" // TODO Remove if no longer need to display score and debug info on-screen
+
namespace BladeRunner {
@@ -95,14 +97,71 @@ void PoliceMaze::tick() {
_tracks[i]->tick();
}
+// int remainingActiveTargets = 0; // TODO Un-comment this line while debugging the maze
+// int targetIdsActive[kNumMazeTracks] = {0}; // TODO Un-comment this line while debugging the maze
+// int j = 0; // TODO Un-comment this line while debugging the maze
bool notFound = true;
for (int i = 0; i < kNumMazeTracks; i++) {
if (!_tracks[i]->isPaused()) {
notFound = false;
- break;
+// targetIdsActive[j++] = i; // TODO Un-comment this line while debugging the maze
+// remainingActiveTargets++; // TODO Un-comment this line while debugging the maze
+ break; // TODO Comment-out this break while debugging the maze (debug messages on screen about all active targets)
}
}
+ Common::String scoreString;
+// TODO un-comment this segment of updating activeTargetsString while debugging the maze
+// Common::String activeTargetsString;
+// for (int i = 0; i < kNumMazeTracks; ++i) {
+// if (_vm->_items->isTarget(i)) {
+// activeTargetsString += Common::String::format(" %d", (i+1));
+// }
+// }
+// activeTargetsString += Common::String::format("] \n");
+// for (int i = 0; i < remainingActiveTargets; ++i) {
+// j = targetIdsActive[i];
+// activeTargetsString += Common::String::format(" %d{%s:%s:%s:%s:%s}",
+// (j+1),
+// _tracks[j]->_isPaused?"P":"X",
+// _tracks[j]->_isWaiting?"W":"X",
+// _vm->_items->isSpinning(j)?"S":"X",
+// _vm->_items->isTarget(j)?"T":"X",
+// _vm->_items->isVisible(j)?"V":"X" );
+// }
+// int allTargetsNum = SceneScriptPS10::getPoliceMazePS10TargetCount()
+// + SceneScriptPS11::getPoliceMazePS11TargetCount()
+// + SceneScriptPS12::getPoliceMazePS12TargetCount()
+// + SceneScriptPS13::getPoliceMazePS13TargetCount();
+ int totalTargetsNumInScene = 0;
+ int currTargetsCounUpForRoom = 0;
+// const int initActivatedTargetsPS10 = 4;
+// const int initActivatedTargetsPS11 = 4;
+// const int initActivatedTargetsPS12 = 5;
+// const int initActivatedTargetsPS13 = 4;
+
+ int currMazeScore = Global_Variable_Query(kVariablePoliceMazeScore);
+ if (_vm->_scene->getSceneId() == kScenePS10) {
+ totalTargetsNumInScene = SceneScriptPS10::getPoliceMazePS10TargetCount();
+ currTargetsCounUpForRoom = Global_Variable_Query(kVariablePoliceMazePS10TargetCounter);
+ } else if (_vm->_scene->getSceneId() == kScenePS11) {
+ totalTargetsNumInScene = SceneScriptPS11::getPoliceMazePS11TargetCount();
+ currTargetsCounUpForRoom = Global_Variable_Query(kVariablePoliceMazePS11TargetCounter);
+ } else if (_vm->_scene->getSceneId() == kScenePS12) {
+ totalTargetsNumInScene = SceneScriptPS12::getPoliceMazePS12TargetCount();
+ currTargetsCounUpForRoom = Global_Variable_Query(kVariablePoliceMazePS12TargetCounter);
+ } else if (_vm->_scene->getSceneId() == kScenePS13) {
+ totalTargetsNumInScene = SceneScriptPS13::getPoliceMazePS13TargetCount();
+ currTargetsCounUpForRoom = Global_Variable_Query(kVariablePoliceMazePS13TargetCounter);
+ }
+// scoreString = Common::String::format("Score: %02d (%02d), [%s]",
+// currMazeScore - (totalTargetsNumInScene - currTargetsCounUpForRoom),
+// totalTargetsNumInScene - currTargetsCounUpForRoom,
+// activeTargetsString.c_str());
+ scoreString = Common::String::format("Score: %02d", currMazeScore - (totalTargetsNumInScene - currTargetsCounUpForRoom));
+ _vm->_subtitles->setGameSubsText(scoreString, true);
+ _vm->_subtitles->show();
+
if (notFound && _isActive && !_isEnding) {
_isActive = false;
_isEnding = true;
@@ -113,6 +172,7 @@ void PoliceMaze::tick() {
Actor_Voice_Over(310, kActorAnsweringMachine);
}
}
+
}
void PoliceMaze::save(SaveFileWriteStream &f) {
@@ -247,8 +307,9 @@ bool PoliceMazeTargetTrack::tick() {
_vm->_items->setFacing(_itemId, angle);
- if (_isRotating)
- return false;
+ if (_isRotating) {
+ return true;
+ }
}
bool advancePoint = false;