[Scummvm-git-logs] scummvm master -> 4642d1697dd7d99893ed7f4e94eca9505e0e05af

antoniou79 antoniou at cti.gr
Fri Mar 1 10:04:24 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:
4642d1697d BLADERUNNER: Sadik dead end fix (BB09 kill)


Commit: 4642d1697dd7d99893ed7f4e94eca9505e0e05af
    https://github.com/scummvm/scummvm/commit/4642d1697dd7d99893ed7f4e94eca9505e0e05af
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-03-01T11:04:07+02:00

Commit Message:
BLADERUNNER: Sadik dead end fix (BB09 kill)

Also fixed an flag constistency for kFlagZubenBountyPaid

It is no longer possible to kill Sadik at BB09, but shooting him will lower his health (from initial to a fixed HP), and if McCoy also shoots him at UG18 his health will be further lowered (again to a fixed HP).

Changed paths:
    engines/bladerunner/game_constants.h
    engines/bladerunner/script/ai/sadik.cpp
    engines/bladerunner/script/scene/kp06.cpp
    engines/bladerunner/script/scene/kp07.cpp
    engines/bladerunner/script/scene/ma04.cpp


diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index e219658..3e64e0d 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -2089,7 +2089,9 @@ enum GoalSadik {
 	kGoalSadikUG18WillShootMcCoy = 306,
 	kGoalSadikUG18PrepareShootMcCoy = 307,
 	kGoalSadikUG18ShootMcCoy = 308,
-	kGoalSadikUG18Leave = 310
+	kGoalSadikUG18Leave = 310,
+	kGoalSadikUG18NeedsReactorCoreFromMcCoy = 416,
+	kGoalSadikGone = 599
 };
 
 enum GoalLuther {
diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp
index 7a86c1d..9bddf38 100644
--- a/engines/bladerunner/script/ai/sadik.cpp
+++ b/engines/bladerunner/script/ai/sadik.cpp
@@ -137,7 +137,7 @@ void AIScriptSadik::ReceivedClue(int clueId, int fromActorId) {
 }
 
 void AIScriptSadik::ClickedByPlayer() {
-	if (Actor_Query_Goal_Number(kActorSadik) == 599) {
+	if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikGone) {
 		Actor_Face_Actor(kActorMcCoy, kActorSadik, true);
 		Actor_Says(kActorMcCoy, 8580, 16);
 	}
@@ -161,7 +161,7 @@ void AIScriptSadik::OtherAgentEnteredCombatMode(int otherActorId, int combatMode
 
 void AIScriptSadik::ShotAtAndMissed() {
 	if (Actor_Query_Goal_Number(kActorSadik) == 414
-	 || Actor_Query_Goal_Number(kActorSadik) == 416
+	 || Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18NeedsReactorCoreFromMcCoy
 	) {
 		Game_Flag_Set(kFlagMcCoyAttackedReplicants);
 		if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) {
@@ -172,17 +172,48 @@ void AIScriptSadik::ShotAtAndMissed() {
 }
 
 bool AIScriptSadik::ShotAtAndHit() {
+#if BLADERUNNER_ORIGINAL_BUGS // Sadik killed in BB09 dead end bug fix
+#else
+	if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikRunFromBB09) {
+		// Like Izo's ShotAtAndHit() and the code below for kGoalSadikUG18Move
+		// this will keep resetting Sadik's health to avoid killing him
+		// Still, this is lowering Sadik's health from 80 (when Replicant) and 50 (when Human)
+		if (Game_Flag_Query(kFlagSadikIsReplicant)) {
+			Actor_Set_Health(kActorSadik, 60, 60);
+		} else {
+			Actor_Set_Health(kActorSadik, 40, 40);
+		}
+		return true;
+	}
+#endif // BLADERUNNER_ORIGINAL_BUGS
 	if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18Move) {
+		// this lowers Sadik's original health but makes it impossible to kill him here (UG18)
 		if (Game_Flag_Query(kFlagSadikIsReplicant)) {
+#if BLADERUNNER_ORIGINAL_BUGS // Sadik killed in BB09 dead end bug fix
 			Actor_Set_Health(kActorSadik, 60, 60);
+#else
+			if (Actor_Query_Current_HP(kActorSadik) == 60) { // shot also at Bradburry, so lower his health further
+				Actor_Set_Health(kActorSadik, 50, 50);
+			} else {
+				Actor_Set_Health(kActorSadik, 60, 60);
+			}
+#endif
 		} else {
+#if BLADERUNNER_ORIGINAL_BUGS // Sadik killed in BB09 dead end bug fix
 			Actor_Set_Health(kActorSadik, 40, 40);
+#else
+			if (Actor_Query_Current_HP(kActorSadik) == 40) { // shot also at Bradburry, so lower his health further
+				Actor_Set_Health(kActorSadik, 30, 30);
+			} else {
+				Actor_Set_Health(kActorSadik, 40, 40);
+			}
+#endif
 		}
 		return true;
 	}
 
 	if (Actor_Query_Goal_Number(kActorSadik) == 414
-	 || Actor_Query_Goal_Number(kActorSadik) == 416
+	 || Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18NeedsReactorCoreFromMcCoy
 	) {
 		Game_Flag_Set(kFlagMcCoyAttackedReplicants);
 		if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) {
@@ -203,8 +234,8 @@ void AIScriptSadik::Retired(int byActorId) {
 	}
 
 	if (Actor_Query_In_Set(kActorSadik, kSetKP07)) {
-		Global_Variable_Decrement(kVariableReplicants, 1);
-		Actor_Set_Goal_Number(kActorSadik, 599);
+		Global_Variable_Decrement(kVariableReplicants, 1); // can't Sadik still be human (Rep-sympathiser here? A bug?
+		Actor_Set_Goal_Number(kActorSadik, kGoalSadikGone);
 
 		if (Global_Variable_Query(kVariableReplicants) == 0) {
 			Player_Loses_Control();
@@ -220,7 +251,7 @@ void AIScriptSadik::Retired(int byActorId) {
 		}
 	}
 
-	Actor_Set_Goal_Number(kActorSadik, 599);
+	Actor_Set_Goal_Number(kActorSadik, kGoalSadikGone);
 
 	return; //false;
 }
@@ -410,10 +441,10 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
 		Actor_Says(kActorSadik, 240, kAnimationModeTalk);
 		Actor_Says(kActorSadik, 250, kAnimationModeTalk);
 		Actor_Says(kActorSadik, 260, kAnimationModeTalk);
-		Actor_Set_Goal_Number(kActorSadik, 416);
+		Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
 		return true;
 
-	case 416:
+	case kGoalSadikUG18NeedsReactorCoreFromMcCoy:
 		Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, false, false, 0);
 		Actor_Face_Heading(kActorSadik, 150, false);
 		return true;
@@ -426,7 +457,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
 		Actor_Says(kActorSadik, 330, kAnimationModeTalk);
 		Actor_Says(kActorMcCoy, 2335, kAnimationModeTalk);
 		Actor_Says(kActorSadik, 340, kAnimationModeTalk);
-		Actor_Set_Goal_Number(kActorSadik, 416);
+		Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
 		return true;
 
 	case 418:
diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp
index 466b957..0828b4d 100644
--- a/engines/bladerunner/script/scene/kp06.cpp
+++ b/engines/bladerunner/script/scene/kp06.cpp
@@ -113,7 +113,7 @@ bool SceneScriptKP06::ClickedOnExit(int exitId) {
 
 	if (exitId == 1) {
 		if (Actor_Clue_Query(kActorSadik, kCluePowerSource)
-		 || Actor_Query_Goal_Number(kActorSadik) != 416
+		 || Actor_Query_Goal_Number(kActorSadik) != kGoalSadikUG18NeedsReactorCoreFromMcCoy
 		) {
 			if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, true, false, 0)) {
 				if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp
index c087e4f..3b5fd09 100644
--- a/engines/bladerunner/script/scene/kp07.cpp
+++ b/engines/bladerunner/script/scene/kp07.cpp
@@ -170,7 +170,7 @@ void SceneScriptKP07::PlayerWalkedIn() {
 			Actor_Says(kActorClovis, 1240, 3);
 			Actor_Says(kActorMcCoy, 8500, 3);
 			Actor_Says(kActorClovis, 1250, 3);
-			if (Actor_Query_Goal_Number(kActorSadik) == 416) {
+			if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18NeedsReactorCoreFromMcCoy) {
 				Actor_Put_In_Set(kActorSadik, kSetKP07);
 				Global_Variable_Increment(kVariableReplicants, 1);
 				Actor_Set_At_XYZ(kActorSadik, -12.0f, -41.58f, 72.0f, 0);
diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp
index b99cfcb..0325f27 100644
--- a/engines/bladerunner/script/scene/ma04.cpp
+++ b/engines/bladerunner/script/scene/ma04.cpp
@@ -579,6 +579,10 @@ void SceneScriptMA04::sleep() {
 				if (!Game_Flag_Query(kFlagZubenBountyPaid)) {
 					Global_Variable_Increment(kVariableChinyen, 200);
 				}
+#if BLADERUNNER_ORIGINAL_BUGS // ensure valid kFlagZubenBountyPaid flag state
+#else
+				Game_Flag_Set(kFlagZubenBountyPaid); // not a proper bug, but was missing from original code, so the flag would remain in non-consistent state in this case
+#endif // BLADERUNNER_ORIGINAL_BUGS
 			}
 		} else {
 			Set_Enter(kSetMA02_MA04, kSceneMA04);





More information about the Scummvm-git-logs mailing list