[Scummvm-git-logs] scummvm master -> e60aac53b1d2d19a1f3a33a2581a514e8b571981

antoniou79 antoniou at cti.gr
Wed Jun 26 14:23:18 CEST 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:
e60aac53b1 BLADERUNNER: Fix waiting time for targets in Maze


Commit: e60aac53b1d2d19a1f3a33a2581a514e8b571981
    https://github.com/scummvm/scummvm/commit/e60aac53b1d2d19a1f3a33a2581a514e8b571981
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-06-26T15:21:55+03:00

Commit Message:
BLADERUNNER: Fix waiting time for targets in Maze

Applies only for normal and hard mode. Easy mode keeps the original more relaxed behavior.

Changed paths:
    engines/bladerunner/actor_combat.cpp
    engines/bladerunner/mouse.cpp
    engines/bladerunner/script/police_maze.cpp
    engines/bladerunner/ui/kia.cpp


diff --git a/engines/bladerunner/actor_combat.cpp b/engines/bladerunner/actor_combat.cpp
index 869ccdf..bc2e9a2 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 fcaafe0..b519fbd 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 f5b9a1d..f3f20b2 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 b5b0441..70a6d4e 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);





More information about the Scummvm-git-logs mailing list