diff options
| -rw-r--r-- | engines/bladerunner/game_constants.h | 4 | ||||
| -rw-r--r-- | engines/bladerunner/script/ai/sadik.cpp | 49 | ||||
| -rw-r--r-- | engines/bladerunner/script/scene/kp06.cpp | 2 | ||||
| -rw-r--r-- | engines/bladerunner/script/scene/kp07.cpp | 2 | ||||
| -rw-r--r-- | engines/bladerunner/script/scene/ma04.cpp | 4 | 
5 files changed, 49 insertions, 12 deletions
| diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index e2196588f9..3e64e0db37 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 7a86c1d389..9bddf382d6 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 466b957b3f..0828b4d005 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 c087e4fb9d..3b5fd09e0a 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 b99cfcb8ff..0325f27ad7 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); | 
