aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanasis Antoniou2019-06-26 15:21:55 +0300
committerThanasis Antoniou2019-06-26 15:21:55 +0300
commite60aac53b1d2d19a1f3a33a2581a514e8b571981 (patch)
treec8d8ae63873f404d701aa70567909cc8c9ecff26
parent2e1a84694b5293b36de77468acf075bb97a12578 (diff)
downloadscummvm-rg350-e60aac53b1d2d19a1f3a33a2581a514e8b571981.tar.gz
scummvm-rg350-e60aac53b1d2d19a1f3a33a2581a514e8b571981.tar.bz2
scummvm-rg350-e60aac53b1d2d19a1f3a33a2581a514e8b571981.zip
BLADERUNNER: Fix waiting time for targets in Maze
Applies only for normal and hard mode. Easy mode keeps the original more relaxed behavior.
-rw-r--r--engines/bladerunner/actor_combat.cpp8
-rw-r--r--engines/bladerunner/mouse.cpp12
-rw-r--r--engines/bladerunner/script/police_maze.cpp12
-rw-r--r--engines/bladerunner/ui/kia.cpp6
4 files changed, 24 insertions, 14 deletions
diff --git a/engines/bladerunner/actor_combat.cpp b/engines/bladerunner/actor_combat.cpp
index 869ccdfd86..bc2e9a26cb 100644
--- a/engines/bladerunner/actor_combat.cpp
+++ b/engines/bladerunner/actor_combat.cpp
@@ -574,20 +574,20 @@ int ActorCombat::getCoefficientRangedAttack() const {
}
int ActorCombat::getDamageCloseAttack(int min, int max) const {
- if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == 0) {
+ if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == kGameDifficultyEasy) {
return _damage / 2;
}
- if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == 2) {
+ if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == kGameDifficultyHard) {
return _damage;
}
return ((MIN(max - min, 30) * 100.0f / 60.0f) + 50) * _damage / 100;
}
int ActorCombat::getDamageRangedAttack(int min, int max) const {
- if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == 0) {
+ if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == kGameDifficultyEasy) {
return _damage / 2;
}
- if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == 2) {
+ if (_enemyId == kActorMcCoy && _vm->_settings->getDifficulty() == kGameDifficultyHard) {
return _damage;
}
return ((MIN(max - min, 30) * 100.0f / 60.0f) + 50) * _damage / 100;
diff --git a/engines/bladerunner/mouse.cpp b/engines/bladerunner/mouse.cpp
index fcaafe00bc..b519fbd1f0 100644
--- a/engines/bladerunner/mouse.cpp
+++ b/engines/bladerunner/mouse.cpp
@@ -169,19 +169,19 @@ void Mouse::getXY(int *x, int *y) const {
void Mouse::setMouseJitterUp() {
switch (_vm->_settings->getDifficulty()) {
- case 0:
+ case kGameDifficultyEasy:
_randomCountdownX = 2;
_randomX = _vm->_rnd.getRandomNumberRng(0, 6) - 3;
_randomY = _vm->_rnd.getRandomNumberRng(0, 10) - 20;
break;
- case 1:
+ case kGameDifficultyMedium:
_randomCountdownX = 3;
_randomX = _vm->_rnd.getRandomNumberRng(0, 8) - 4;
_randomY = _vm->_rnd.getRandomNumberRng(0, 10) - 25;
break;
- case 2:
+ case kGameDifficultyHard:
_randomCountdownX = 4;
_randomX = _vm->_rnd.getRandomNumberRng(0, 10) - 5;
_randomY = _vm->_rnd.getRandomNumberRng(0, 10) - 30;
@@ -191,19 +191,19 @@ void Mouse::setMouseJitterUp() {
void Mouse::setMouseJitterDown() {
switch (_vm->_settings->getDifficulty()) {
- case 0:
+ case kGameDifficultyEasy:
_randomCountdownY = 2;
_randomX = _vm->_rnd.getRandomNumberRng(0, 6) - 3;
_randomY = _vm->_rnd.getRandomNumberRng(10, 20);
break;
- case 1:
+ case kGameDifficultyMedium:
_randomCountdownY = 3;
_randomX = _vm->_rnd.getRandomNumberRng(0, 8) - 4;
_randomY = _vm->_rnd.getRandomNumberRng(15, 25);
break;
- case 2:
+ case kGameDifficultyHard:
_randomCountdownY = 4;
_randomX = _vm->_rnd.getRandomNumberRng(0, 10) - 5;
_randomY = _vm->_rnd.getRandomNumberRng(20, 30);
diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp
index f5b9a1daa2..f3f20b2354 100644
--- a/engines/bladerunner/script/police_maze.cpp
+++ b/engines/bladerunner/script/police_maze.cpp
@@ -32,6 +32,7 @@
#include "bladerunner/time.h"
#include "bladerunner/subtitles.h"
#include "bladerunner/debugger.h"
+#include "bladerunner/settings.h"
// ----------------------
// Maze point system info
// ----------------------
@@ -259,6 +260,13 @@ bool PoliceMazeTargetTrack::tick() {
_timeLeftUpdate -= timeDiff;
if (_timeLeftUpdate > 0) {
+#if !BLADERUNNER_ORIGINAL_BUGS
+ // this fix makes the targets appear according to their wait time
+ // but it might be too fast for easy or normal mode, so only do this for normal and hard modes
+ if (_vm->_settings->getDifficulty() > kGameDifficultyEasy) {
+ _time = oldTime;
+ }
+#endif // !BLADERUNNER_ORIGINAL_BUGS
return false;
}
@@ -270,7 +278,6 @@ bool PoliceMazeTargetTrack::tick() {
if (_isWaiting) {
_timeLeftWait -= timeDiff;
-
if (_timeLeftWait > 0) {
return true;
}
@@ -589,6 +596,9 @@ bool PoliceMazeTargetTrack::tick() {
debug("ItemId: %3i, Wait random, Min: %i, Max: %i", _itemId, randomMin, randomMax);
#endif
_timeLeftWait = Random_Query(randomMin, randomMax);
+#if BLADERUNNER_DEBUG_CONSOLE
+ debug("ItemId: %3i, Wait for = %i", _itemId, _timeLeftWait);
+#endif
_isWaiting = true;
cont = false;
diff --git a/engines/bladerunner/ui/kia.cpp b/engines/bladerunner/ui/kia.cpp
index b5b04415de..70a6d4eff5 100644
--- a/engines/bladerunner/ui/kia.cpp
+++ b/engines/bladerunner/ui/kia.cpp
@@ -309,7 +309,7 @@ void KIA::tick() {
_shapes->get(41)->draw(_vm->_surfaceFront, 211, 447);
}
if (_currentSectionId != kKIASectionQuit && _transitionId != 14) {
- if (_vm->_settings->getDifficulty() > 0) {
+ if (_vm->_settings->getDifficulty() > kGameDifficultyEasy) {
_vm->_mainFont->drawColor(Common::String::format("%04d", _vm->_gameVars[kVariableChinyen]), _vm->_surfaceFront, 580, 341, _vm->_surfaceFront.format.RGBToColor(80, 96, 136));
} else {
_shapes->get(39)->draw(_vm->_surfaceFront, 583, 342);
@@ -873,7 +873,7 @@ void KIA::createButtons(int sectionId) {
}
Common::String tooltip;
if (_vm->_settings->getAmmo(1) > 0) {
- if (_vm->_settings->getDifficulty() > 0) {
+ if (_vm->_settings->getDifficulty() > kGameDifficultyEasy) {
tooltip = Common::String::format("%d", _vm->_settings->getAmmo(1));
} else {
tooltip = _vm->_textKIA->getText(50);
@@ -881,7 +881,7 @@ void KIA::createButtons(int sectionId) {
_buttons->defineImage(17, kiaButton17, nullptr, nullptr, nullptr, tooltip.c_str());
}
if (_vm->_settings->getAmmo(2) > 0) {
- if (_vm->_settings->getDifficulty() > 0) {
+ if (_vm->_settings->getDifficulty() > kGameDifficultyEasy) {
tooltip = Common::String::format("%d", _vm->_settings->getAmmo(2));
} else {
tooltip = _vm->_textKIA->getText(50);