aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/ai
diff options
context:
space:
mode:
authorThanasis Antoniou2019-03-27 15:11:31 +0200
committerThanasis Antoniou2019-03-27 15:11:31 +0200
commit5959d01a675e14452f533f5098d266c774565a0e (patch)
treed8a913709d0bdcf3edc636e45046d8131f466deb /engines/bladerunner/script/ai
parentbb719ba87c5d370c3a62a660118b6cb58576b61b (diff)
downloadscummvm-rg350-5959d01a675e14452f533f5098d266c774565a0e.tar.gz
scummvm-rg350-5959d01a675e14452f533f5098d266c774565a0e.tar.bz2
scummvm-rg350-5959d01a675e14452f533f5098d266c774565a0e.zip
BLADERUNNER: Fixes for moonbus combat
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r--engines/bladerunner/script/ai/clovis.cpp26
-rw-r--r--engines/bladerunner/script/ai/dektora.cpp5
-rw-r--r--engines/bladerunner/script/ai/gordo.cpp8
-rw-r--r--engines/bladerunner/script/ai/izo.cpp6
-rw-r--r--engines/bladerunner/script/ai/lucy.cpp22
-rw-r--r--engines/bladerunner/script/ai/luther.cpp20
-rw-r--r--engines/bladerunner/script/ai/sadik.cpp4
-rw-r--r--engines/bladerunner/script/ai/zuben.cpp24
8 files changed, 95 insertions, 20 deletions
diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp
index a9917810fb..beb90edf15 100644
--- a/engines/bladerunner/script/ai/clovis.cpp
+++ b/engines/bladerunner/script/ai/clovis.cpp
@@ -188,10 +188,10 @@ bool AIScriptClovis::ShotAtAndHit() {
void AIScriptClovis::Retired(int byActorId) {
if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
if (Actor_Query_In_Set(kActorClovis, kSetKP07)) {
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_Goal_Number(kActorClovis, kGoalClovisGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
Player_Set_Combat_Mode(false);
@@ -201,9 +201,11 @@ void AIScriptClovis::Retired(int byActorId) {
Game_Flag_Set(kFlagKP07toKP06);
Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
Set_Enter(kSetKP05_KP06, kSceneKP06);
+ return; //true;
}
}
}
+ return; //false;
}
int AIScriptClovis::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
@@ -388,8 +390,8 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Put_In_Set(kActorClovis, kSetKP07);
Actor_Set_Targetable(kActorClovis, true);
if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
- Global_Variable_Set(kVariableReplicants, 0);
- Global_Variable_Increment(kVariableReplicants, 1);
+ Global_Variable_Set(kVariableReplicantsSurvivorsAtMoobus, 0);
+ Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_At_XYZ(kActorClovis, 45.0f, -41.52f, -85.0f, 750);
} else {
Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800);
@@ -455,15 +457,27 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) {
if (Global_Variable_Query(kVariableChapter) == 5
&& Actor_Query_In_Set(kActorLucy, kSetKP07)
) {
+#if BLADERUNNER_ORIGINAL_BUGS
+ // Lucy's retirement on the moonbus should be handled in her ai script AIScriptLucy::Retired()
+ // like the others - even if she won't attack McCoy, she should be retired immediately (with this shot)
Actor_Set_Goal_Number(kActorLucy, kGoalLucyGone);
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
+#else
+ // This is her code if she's attacked when escaping with McCoy
+ // will this work?
+ Non_Player_Actor_Combat_Mode_On(kActorLucy, kActorCombatStateIdle, false, kActorMcCoy, 4, kAnimationModeIdle, kAnimationModeWalk, kAnimationModeRun, -1, 0, 0, 10, 300, false);
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
if (Global_Variable_Query(kVariableChapter) == 5
&& Actor_Query_In_Set(kActorLuther, kSetKP07)
) {
+#if BLADERUNNER_ORIGINAL_BUGS
+ // Luther's retirement on the moonbus should be handled in her ai script AIScriptLucy::Retired()
+ // like the others - even if she won't attack McCoy, she should be retired immediately (with this shot)
Actor_Set_Goal_Number(kActorLuther, kGoalLutherGone);
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
if (Global_Variable_Query(kVariableChapter) == 5
diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp
index 9d721e31cc..01d769b935 100644
--- a/engines/bladerunner/script/ai/dektora.cpp
+++ b/engines/bladerunner/script/ai/dektora.cpp
@@ -294,10 +294,10 @@ void AIScriptDektora::Retired(int byActorId) {
}
if (Actor_Query_In_Set(kActorDektora, kSetKP07)) {
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_Goal_Number(kActorDektora, kGoalDektoraGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
Player_Set_Combat_Mode(false);
@@ -307,7 +307,6 @@ void AIScriptDektora::Retired(int byActorId) {
Game_Flag_Set(kFlagKP07toKP06);
Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
Set_Enter(kSetKP05_KP06, kSceneKP06);
-
return; //true;
}
}
diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp
index bb8e62ecde..3d2dcd2a7a 100644
--- a/engines/bladerunner/script/ai/gordo.cpp
+++ b/engines/bladerunner/script/ai/gordo.cpp
@@ -288,20 +288,22 @@ void AIScriptGordo::Retired(int byActorId) {
}
if (Actor_Query_In_Set(kActorGordo, kSetKP07)) {
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_Goal_Number(kActorGordo, kGoalGordoGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
Player_Set_Combat_Mode(false);
+#if BLADERUNNER_ORIGINAL_BUGS
Player_Gains_Control();
+#endif // BLADERUNNER_ORIGINAL_BUGS
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(kFlagKP07toKP06);
Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
Set_Enter(kSetKP05_KP06, kSceneKP06);
- return;// true;
+ return; //true;
}
}
diff --git a/engines/bladerunner/script/ai/izo.cpp b/engines/bladerunner/script/ai/izo.cpp
index ce1c15c208..92d2587328 100644
--- a/engines/bladerunner/script/ai/izo.cpp
+++ b/engines/bladerunner/script/ai/izo.cpp
@@ -238,13 +238,13 @@ void AIScriptIzo::Retired(int byActorId) {
return; //false;
}
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_Goal_Number(kActorIzo, kGoalIzoGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
- Player_Set_Combat_Mode(0);
+ Player_Set_Combat_Mode(false);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 3b37bd6008..928a425db1 100644
--- a/engines/bladerunner/script/ai/lucy.cpp
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -249,6 +249,28 @@ void AIScriptLucy::Retired(int byActorId) {
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -6);
}
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ if (Actor_Query_In_Set(kActorLucy, kSetKP07)) {
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGone);
+
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
+ Player_Loses_Control();
+ Delay(2000);
+ Player_Set_Combat_Mode(false);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0);
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
+ Ambient_Sounds_Remove_All_Looping_Sounds(1);
+ Game_Flag_Set(kFlagKP07toKP06);
+ Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
+ Set_Enter(kSetKP05_KP06, kSceneKP06);
+
+ return; //true;
+ }
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
if ((byActorId == kActorSteele
|| byActorId == kActorMcCoy
)
diff --git a/engines/bladerunner/script/ai/luther.cpp b/engines/bladerunner/script/ai/luther.cpp
index 696bfc078d..791bb97a4d 100644
--- a/engines/bladerunner/script/ai/luther.cpp
+++ b/engines/bladerunner/script/ai/luther.cpp
@@ -181,6 +181,26 @@ bool AIScriptLuther::ShotAtAndHit() {
void AIScriptLuther::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorLuther, kGoalLutherGone);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ if (Actor_Query_In_Set(kActorLuther, kSetKP07)) {
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
+ Actor_Set_Goal_Number(kActorLuther, kGoalLutherGone);
+
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
+ Player_Loses_Control();
+ Delay(2000);
+ Player_Set_Combat_Mode(false);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0);
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
+ Ambient_Sounds_Remove_All_Looping_Sounds(1);
+ Game_Flag_Set(kFlagKP07toKP06);
+ Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
+ Set_Enter(kSetKP05_KP06, kSceneKP06);
+ return; //true;
+ }
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
int AIScriptLuther::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp
index 9bddf382d6..2b223649a1 100644
--- a/engines/bladerunner/script/ai/sadik.cpp
+++ b/engines/bladerunner/script/ai/sadik.cpp
@@ -234,10 +234,10 @@ void AIScriptSadik::Retired(int byActorId) {
}
if (Actor_Query_In_Set(kActorSadik, kSetKP07)) {
- Global_Variable_Decrement(kVariableReplicants, 1); // can't Sadik still be human (Rep-sympathiser here? A bug?
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1); // can't Sadik still be human (Rep-sympathiser here? A bug?
Actor_Set_Goal_Number(kActorSadik, kGoalSadikGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
Player_Set_Combat_Mode(false);
diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp
index a24a0b631c..777433fe41 100644
--- a/engines/bladerunner/script/ai/zuben.cpp
+++ b/engines/bladerunner/script/ai/zuben.cpp
@@ -288,12 +288,16 @@ bool AIScriptZuben::ShotAtAndHit() {
void AIScriptZuben::Retired(int byActorId) {
if (!Actor_Query_In_Set(kActorZuben, kSetKP07)) {
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Set_Goal_Number(kActorZuben, kGoalZubenDiesInChapter1);
+#endif // BLADERUNNER_ORIGINAL_BUGS
// return false;
return;
}
- Global_Variable_Decrement(kVariableReplicants, 1);
+ Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoobus, 1);
Actor_Set_Goal_Number(kActorZuben, kGoalZubenGone);
- if (Global_Variable_Query(kVariableReplicants) == 0) {
+ if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoobus) == 0) {
Player_Loses_Control();
Delay(2000);
Player_Set_Combat_Mode(false);
@@ -447,10 +451,16 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorZuben);
return false;
- case 99:
+ case kGoalZubenDiesInChapter1:
+#if BLADERUNNER_ORIGINAL_BUGS
AI_Movement_Track_Flush(kActorZuben);
+#endif // BLADERUNNER_ORIGINAL_BUGS
Scene_Exits_Enable();
Music_Stop(2);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Set_Goal_Number(kActorZuben, kGoalZubenDie);
+#endif // BLADERUNNER_ORIGINAL_BUGS
return false;
case 100:
@@ -865,7 +875,9 @@ bool AIScriptZuben::UpdateAnimation(int *animation, int *frame) {
Sound_Play(207, 30, 0, 0, 50);
}
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorZuben, kGoalZubenDie);
+#endif // BLADERUNNER_ORIGINAL_BUGS
_animationState = 15;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
Actor_Set_Targetable(kActorZuben, false);
@@ -879,7 +891,9 @@ bool AIScriptZuben::UpdateAnimation(int *animation, int *frame) {
Sound_Play(207, 30, 0, 0, 50);
}
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorZuben, kGoalZubenDie);
+#endif // BLADERUNNER_ORIGINAL_BUGS
_animationState = 16;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
Actor_Set_Targetable(kActorZuben, false);
@@ -889,7 +903,11 @@ bool AIScriptZuben::UpdateAnimation(int *animation, int *frame) {
case 15:
*animation = 405;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+#if BLADERUNNER_ORIGINAL_BUGS
+ // This enables exits when it should not at the moonbus massacre
+ // but it was also used to enable the exits when Zuben is retired at McCoy's roof top.
Scene_Exits_Enable();
+#endif // BLADERUNNER_ORIGINAL_BUGS
break;
case 16: