aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-25 03:39:17 +0300
committerThanasis Antoniou2019-05-25 03:39:57 +0300
commit9bfca34497786bcaa05d01f13e8f97f500a3ef45 (patch)
tree91784fa272bd03a721e9a5f0d64c81e867002ca4 /engines/bladerunner/script
parentcde63356f11d6b7a7bc744e0ee98e139ad06a4ad (diff)
downloadscummvm-rg350-9bfca34497786bcaa05d01f13e8f97f500a3ef45.tar.gz
scummvm-rg350-9bfca34497786bcaa05d01f13e8f97f500a3ef45.tar.bz2
scummvm-rg350-9bfca34497786bcaa05d01f13e8f97f500a3ef45.zip
BLADERUNNER: Fixes for UG18 Guzza scene cases
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/ai/sadik.cpp20
-rw-r--r--engines/bladerunner/script/scene/kp06.cpp2
-rw-r--r--engines/bladerunner/script/scene/kp07.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug18.cpp56
4 files changed, 66 insertions, 14 deletions
diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp
index 0523e9f5b5..a6de93a337 100644
--- a/engines/bladerunner/script/ai/sadik.cpp
+++ b/engines/bladerunner/script/ai/sadik.cpp
@@ -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) == kGoalSadikUG18NeedsReactorCoreFromMcCoy
+ || Actor_Query_Goal_Number(kActorSadik) == kGoalSadikKP06NeedsReactorCoreFromMcCoy
) {
Game_Flag_Set(kFlagMcCoyAttackedReplicants);
if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) {
@@ -215,7 +215,7 @@ bool AIScriptSadik::ShotAtAndHit() {
}
if (Actor_Query_Goal_Number(kActorSadik) == 414
- || Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18NeedsReactorCoreFromMcCoy
+ || Actor_Query_Goal_Number(kActorSadik) == kGoalSadikKP06NeedsReactorCoreFromMcCoy
) {
Game_Flag_Set(kFlagMcCoyAttackedReplicants);
if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) {
@@ -337,6 +337,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case kGoalSadikUG18Decide:
+ // This is called first and then the scene script SceneScriptUG18::ActorChangedGoal
Actor_Set_Targetable(kActorSadik, false);
return true;
@@ -363,11 +364,20 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case kGoalSadikUG18ShootMcCoy:
if (Player_Query_Current_Scene() == kSceneUG18) {
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Force_Stop_Walking(kActorMcCoy);
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Actor_Retired_Here(kActorMcCoy, 6, 6, true, -1);
+#else
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
+ Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
+ Player_Loses_Control();
+ Actor_Force_Stop_Walking(kActorMcCoy);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
+ Actor_Retired_Here(kActorMcCoy, 6, 6, true, kActorSadik);
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
return true;
@@ -443,10 +453,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, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikKP06NeedsReactorCoreFromMcCoy);
return true;
- case kGoalSadikUG18NeedsReactorCoreFromMcCoy:
+ case kGoalSadikKP06NeedsReactorCoreFromMcCoy:
Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, false, false, false);
Actor_Face_Heading(kActorSadik, 150, false);
return true;
@@ -459,7 +469,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, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikKP06NeedsReactorCoreFromMcCoy);
return true;
case 418:
diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp
index 0ec9d88170..d8e7299350 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) != kGoalSadikUG18NeedsReactorCoreFromMcCoy
+ || Actor_Query_Goal_Number(kActorSadik) != kGoalSadikKP06NeedsReactorCoreFromMcCoy
) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, true, false, false)) {
if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp
index fc7e6080e0..4d3ed450ec 100644
--- a/engines/bladerunner/script/scene/kp07.cpp
+++ b/engines/bladerunner/script/scene/kp07.cpp
@@ -178,7 +178,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) == kGoalSadikUG18NeedsReactorCoreFromMcCoy) {
+ if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikKP06NeedsReactorCoreFromMcCoy) {
Actor_Put_In_Set(kActorSadik, kSetKP07);
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Set_At_XYZ(kActorSadik, -12.0f, -41.58f, 72.0f, 0);
diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp
index 1c14c06e27..8b6c1da281 100644
--- a/engines/bladerunner/script/scene/ug18.cpp
+++ b/engines/bladerunner/script/scene/ug18.cpp
@@ -21,7 +21,6 @@
*/
#include "bladerunner/script/scene_script.h"
-
namespace BladeRunner {
enum kUG18Loops {
@@ -291,7 +290,7 @@ void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
if (Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy) > 55
&& Game_Flag_Query(kFlagMcCoyRetiredHuman)
) {
- Actor_Says(kActorClovis, 660, 13);
+ Actor_Says(kActorClovis, 660, 13); // Brother, you killed a human...
Actor_Says(kActorMcCoy, 5995, 13);
Actor_Says(kActorClovis, 670, 13);
Actor_Says(kActorMcCoy, 6000, 13);
@@ -314,6 +313,7 @@ void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
break;
case 305:
+ // never triggered
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
Actor_Force_Stop_Walking(kActorMcCoy);
@@ -376,24 +376,40 @@ void SceneScriptUG18::DialogueQueueFlushed(int a1) {
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL3, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
- ADQ_Add(kActorClovis, 630, 13);
+ ADQ_Add(kActorClovis, 630, 13); // "Whatever is born of mortal birth, must be consumed with the earth."
Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18SadikWillShootGuzza);
break;
case kGoalGuzzaUG18ShotByMcCoy:
// Bug in the game, shot animation is not reset so McCoy looks still while he is shooting
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAim);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL2, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(900);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAim);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL3, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(1100);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAim);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(900);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAim);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL3, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, 61);
@@ -408,11 +424,15 @@ void SceneScriptUG18::DialogueQueueFlushed(int a1) {
Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18FallDown);
Player_Gains_Control();
ADQ_Add_Pause(2000);
- ADQ_Add(kActorSadik, 360, -1);
+ ADQ_Add(kActorSadik, 360, -1); // The Hunter, he do us a favor...
ADQ_Add_Pause(2000);
- ADQ_Add(kActorClovis, 650, 14);
+ ADQ_Add(kActorClovis, 650, 14); // So, what should we do with this detective.
ADQ_Add(kActorSadik, 370, 14);
- ADQ_Add(kActorClovis, 1320, 14);
+ ADQ_Add(kActorClovis, 1320, 14); // Perhaps you're right
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Retired_Here(kActorGuzza, 72, 32, true, kActorMcCoy);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18GuzzaDied);
break;
@@ -441,6 +461,19 @@ void SceneScriptUG18::DialogueQueueFlushed(int a1) {
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(kSfxLGCAL3, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, 61);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ // don't allow code to reach the overlay animation if the dialogue queue is not flushed
+ // otherwise this animation is stored and if the player saves the game during the queued dialogue
+ // then upon re-load it would play immediately (before Guzza falls)
+ ADQ_Wait_For_All_Queued_Dialogue();
+#endif // BLADERUNNER_ORIGINAL_BUGS
+ if (_vm->_cutContent) {
+ // same logic as using the BB06OVER for doll explosion case in BB06
+ Overlay_Play("UG18OVER", 1, true, true, 0);
+ Overlay_Play("UG18OVER", 2, true, false, 0);
+ Global_Variable_Set(kVariableUG18StateOfGuzzaCorpse, kUG18GuzzaCorpseFloatsDown);
+ }
ADQ_Add_Pause(2000);
ADQ_Add(kActorClovis, 650, 14);
ADQ_Add(kActorSadik, 370, 14);
@@ -452,11 +485,20 @@ void SceneScriptUG18::DialogueQueueFlushed(int a1) {
break;
case kGoalClovisUG18GuzzaDied:
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Move);
+#else
+ // otherwise this gets repeated whenever dialogue queue re-empties
+ if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18Wait) {
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Move);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
break;
}
if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18WillShootMcCoy) {
+ // Bug in the original game - Why is Sadik set to die animation here?
+ // never triggered
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeDie);
Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18PrepareShootMcCoy);
Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18Leave);
@@ -574,7 +616,7 @@ void SceneScriptUG18::talkWithClovis() {
ADQ_Add(kActorGuzza, 1180, 58);
ADQ_Add(kActorClovis, 610, 13);
ADQ_Add(kActorGuzza, 1190, 60);
- ADQ_Add(kActorClovis, 620, 13);
+ ADQ_Add(kActorClovis, 620, 13); // Lieutenant, we have everything we need...
ADQ_Add(kActorGuzza, 1200, 59);
}