aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThanasis Antoniou2019-06-26 13:25:15 +0300
committerThanasis Antoniou2019-06-26 13:25:15 +0300
commitd1a2a2ff918cbb47926082c6199d16845d8972d5 (patch)
tree4316ebe3394deb24c3c0ec746307abd1062f0914 /engines
parent9fe95b9603b13f63323c54c55bf1c1d679c17b8e (diff)
downloadscummvm-rg350-d1a2a2ff918cbb47926082c6199d16845d8972d5.tar.gz
scummvm-rg350-d1a2a2ff918cbb47926082c6199d16845d8972d5.tar.bz2
scummvm-rg350-d1a2a2ff918cbb47926082c6199d16845d8972d5.zip
BLADERUNNER: Fix UG04 train disable control and Police AI
Diffstat (limited to 'engines')
-rw-r--r--engines/bladerunner/script/ai/officer_grayford.cpp19
-rw-r--r--engines/bladerunner/script/ai/officer_leary.cpp20
-rw-r--r--engines/bladerunner/script/scene/ug04.cpp28
3 files changed, 60 insertions, 7 deletions
diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp
index 9e4f0b8602..ae84933e09 100644
--- a/engines/bladerunner/script/ai/officer_grayford.cpp
+++ b/engines/bladerunner/script/ai/officer_grayford.cpp
@@ -760,8 +760,9 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb
break;
case 5:
+#if BLADERUNNER_ORIGINAL_BUGS
// kSetUG06 -> kSetFreeSlotC
-// debug("gray 8-5 kSetUG06 -> kSetFreeSlotC");
+ // debug("gray 8-5 kSetUG06 -> kSetFreeSlotC");
AI_Movement_Track_Append(kActorOfficerGrayford, 413, 10);
AI_Movement_Track_Append(kActorOfficerGrayford, 414, 0);
AI_Movement_Track_Append_With_Facing(kActorOfficerGrayford, 431, 0, 1017);
@@ -769,6 +770,22 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb
AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); // kSetFreeSlotC
AI_Movement_Track_Repeat(kActorOfficerGrayford);
break;
+#else
+ // Don't allow police officers to shoot McCoy while he is
+ // disabled reciting his monologue at start of Act 4
+ if (Game_Flag_Query(kFlagUG06Chapter4Started)) {
+ // kSetUG06 -> kSetFreeSlotC
+ // debug("gray 8-5 kSetUG06 -> kSetFreeSlotC");
+ AI_Movement_Track_Append(kActorOfficerGrayford, 413, 10);
+ AI_Movement_Track_Append(kActorOfficerGrayford, 414, 0);
+ AI_Movement_Track_Append_With_Facing(kActorOfficerGrayford, 431, 0, 1017);
+ AI_Movement_Track_Append(kActorOfficerGrayford, 432, 10);
+ AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); // kSetFreeSlotC
+ AI_Movement_Track_Repeat(kActorOfficerGrayford);
+ break;
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
+ // fall through
case 6:
// kSetUG07 -> kSetFreeSlotC
diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp
index 6bbfb1809f..8b3f7cf87e 100644
--- a/engines/bladerunner/script/ai/officer_leary.cpp
+++ b/engines/bladerunner/script/ai/officer_leary.cpp
@@ -163,7 +163,9 @@ bool AIScriptOfficerLeary::Update() {
}
break;
case kSetUG04:
+ // fall through
case kSetUG05:
+ // fall through
case kSetUG06:
if (Actor_Query_Which_Set_In(kActorOfficerLeary) == Player_Query_Current_Set()) {
Actor_Set_Goal_Number(kActorOfficerLeary, kGoalOfficerLearyAttackMcCoyAct4);
@@ -509,6 +511,7 @@ bool AIScriptOfficerLeary::GoalChanged(int currentGoalNumber, int newGoalNumber)
AI_Movement_Track_Repeat(kActorOfficerLeary);
break;
case 5:
+#if BLADERUNNER_ORIGINAL_BUGS
// kSetUG06 -> kSetFreeSlotC
// debug("leary 8-5 kSetUG06 -> kSetFreeSlotC");
AI_Movement_Track_Append(kActorOfficerLeary, 413, 10);
@@ -518,6 +521,23 @@ bool AIScriptOfficerLeary::GoalChanged(int currentGoalNumber, int newGoalNumber)
AI_Movement_Track_Append(kActorOfficerLeary, 35, 30); // kSetFreeSlotC
AI_Movement_Track_Repeat(kActorOfficerLeary);
break;
+#else
+ // Don't allow police officers to shoot McCoy while he is
+ // disabled reciting his monologue at start of Act 4
+ if (Game_Flag_Query(kFlagUG06Chapter4Started)) {
+ // kSetUG06 -> kSetFreeSlotC
+ // debug("leary 8-5 kSetUG06 -> kSetFreeSlotC");
+ AI_Movement_Track_Append(kActorOfficerLeary, 413, 10);
+ AI_Movement_Track_Append(kActorOfficerLeary, 414, 0);
+ AI_Movement_Track_Append_With_Facing(kActorOfficerLeary, 431, 0, 1017);
+ AI_Movement_Track_Append(kActorOfficerLeary, 432, 10);
+ AI_Movement_Track_Append(kActorOfficerLeary, 35, 30); // kSetFreeSlotC
+ AI_Movement_Track_Repeat(kActorOfficerLeary);
+ break;
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
+ // fall through
+
case 6:
// kSetUG07 -> kSetFreeSlotC
// debug("leary 8-6 kSetUG07 -> kSetFreeSlotC");
diff --git a/engines/bladerunner/script/scene/ug04.cpp b/engines/bladerunner/script/scene/ug04.cpp
index a0db3143fb..8ff6b4842d 100644
--- a/engines/bladerunner/script/scene/ug04.cpp
+++ b/engines/bladerunner/script/scene/ug04.cpp
@@ -64,12 +64,9 @@ void SceneScriptUG04::InitializeScene() {
Ambient_Sounds_Add_Sound(kSfxBBGRN2, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(kSfxBBGRN3, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0);
- if ((Global_Variable_Query(kVariableChapter) == 3)
- || (Global_Variable_Query(kVariableChapter) > 3 && Random_Query(1, 5) == 1)
- ){
- // enhancement: don't always play the bikers after chapter 3
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kUG04LoopTrainLoop, false);
- }
+#if BLADERUNNER_ORIGINAL_BUGS
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kUG04LoopTrainLoop, false);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Scene_Loop_Set_Default(kUG04LoopMainLoop);
}
@@ -83,6 +80,21 @@ void SceneScriptUG04::SceneLoaded() {
Unobstacle_Object("FLOOR DEBRIS WADS", true);
Unobstacle_Object("FLOOR DEBRIS WADS01", true);
Unobstacle_Object("FLOOR DEBRIS WADS02", true);
+
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ if ((Global_Variable_Query(kVariableChapter) == 3)
+ || (Global_Variable_Query(kVariableChapter) > 3 && Random_Query(1, 4) == 1)
+ ){
+ // Enhancement: don't always play the overground train after chapter 3
+ // Bug fix: don't remove control from player. There is no chance to glitch into the scenery
+ // while the video is playing and rats may attack!
+ // Moved in SceneLoaded because the same code in InitializeScene
+ // resulted in a infinite loop of the special loop, when mode is set to kSceneLoopModeOnce instead of kSceneLoopModeLoseControl
+ Scene_Loop_Set_Default(kUG04LoopMainLoop);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kUG04LoopTrainLoop, false);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
bool SceneScriptUG04::MouseClick(int x, int y) {
@@ -143,7 +155,11 @@ void SceneScriptUG04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptUG04::PlayerWalkedIn() {
if (Game_Flag_Query(kFlagUG06toUG04)) {
+#if BLADERUNNER_ORIGINAL_BUGS
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 60.0f, -1.74f, -976.0f, 6, false, false, false);
+#else
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 60.0f, -1.74f, -976.0f, 6, true, false, false);
+#endif
Game_Flag_Reset(kFlagUG06toUG04);
}
}