aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
authorantoniou792019-08-17 21:49:39 +0300
committerantoniou792019-08-17 21:58:21 +0300
commit7bcd8af890c1746b51b243d79c8a76cffe871f12 (patch)
tree88db374cc8661b070330506d31b9415dde1dd439 /engines/bladerunner
parent0aa82a099f68151d128b3442e695f0737a630cbd (diff)
downloadscummvm-rg350-7bcd8af890c1746b51b243d79c8a76cffe871f12.tar.gz
scummvm-rg350-7bcd8af890c1746b51b243d79c8a76cffe871f12.tar.bz2
scummvm-rg350-7bcd8af890c1746b51b243d79c8a76cffe871f12.zip
BLADERUNNER: Complete Klein's annoyed behavior
Also restored him being at the lab past day 1 (Act 1 up to and including Act 3)
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/game_constants.h20
-rw-r--r--engines/bladerunner/script/ai/klein.cpp118
-rw-r--r--engines/bladerunner/script/scene/ps07.cpp5
3 files changed, 119 insertions, 24 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index ea64fdf49e..5711b0e562 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -2583,15 +2583,17 @@ enum GoalDeskClerk {
};
enum GoalKlein {
- kGoalKleinDefault = 0,
- kGoalKleinMovingInLab01 = 1,
- kGoalKleinMovingInLab02 = 2,
- kGoalKleinGotoLabSpeaker = 3,
- kGoalKleinIsAnnoyedByMcCoyInit = 4,
- kGoalKleinIsAnnoyedByMcCoy01 = 5,
- kGoalKleinIsAnnoyedByMcCoy02 = 6,
- kGoalKleinIsAnnoyedByMcCoyFinal = 7,
- kGoalKleinAwayAtEndOfActOne = 100
+ kGoalKleinDefault = 0,
+ kGoalKleinMovingInLab01 = 1,
+ kGoalKleinMovingInLab02 = 2,
+ kGoalKleinGotoLabSpeaker = 3,
+ kGoalKleinIsAnnoyedByMcCoyInit = 4,
+ kGoalKleinIsAnnoyedByMcCoy01 = 5,
+ kGoalKleinIsAnnoyedByMcCoy02 = 6,
+ kGoalKleinIsAnnoyedByMcCoyFinal = 7,
+ kGoalKleinIsAnnoyedByMcCoyPreInit = 8, // new goal
+ kGoalKleinAwayAtEndOfActOne = 100,
+ kGoalKleinAwayAtEndOfActThree = 299 // new goal for restored content purposes
};
enum GoalHolloway {
diff --git a/engines/bladerunner/script/ai/klein.cpp b/engines/bladerunner/script/ai/klein.cpp
index 943995726a..fbb2cdbd79 100644
--- a/engines/bladerunner/script/ai/klein.cpp
+++ b/engines/bladerunner/script/ai/klein.cpp
@@ -37,23 +37,34 @@ void AIScriptKlein::Initialize() {
}
bool AIScriptKlein::Update() {
- if (Global_Variable_Query(kVariableChapter) > 1 && Actor_Query_Goal_Number(kActorKlein) < kGoalKleinAwayAtEndOfActOne) {
- Actor_Set_Goal_Number(kActorKlein, kGoalKleinAwayAtEndOfActOne);
- return true;
+ if (_vm->_cutContent) {
+ if (Global_Variable_Query(kVariableChapter) > 3 && Actor_Query_Goal_Number(kActorKlein) < kGoalKleinAwayAtEndOfActThree) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinAwayAtEndOfActThree);
+ return true;
+ }
+ } else {
+ // original behavior - Klein disappears after Act 1
+ if (Global_Variable_Query(kVariableChapter) > 1 && Actor_Query_Goal_Number(kActorKlein) < kGoalKleinAwayAtEndOfActOne) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinAwayAtEndOfActOne);
+ return true;
+ }
}
+
if (Actor_Query_Goal_Number(kActorKlein) < kGoalKleinIsAnnoyedByMcCoyInit
&& Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 40
) {
Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
}
+
if (Player_Query_Current_Scene() == kScenePS07 && Actor_Query_Goal_Number(kActorKlein) == kGoalKleinDefault) {
Actor_Set_Goal_Number(kActorKlein, kGoalKleinMovingInLab01);
return true;
}
- // The following if-clauses and flags circumvent the manual's explicit instruction that McCoy should upload his clues
- // on the Mainframe, so that Dino Klein can acquire them.
if (!_vm->_cutContent) {
+ // Original behavior:
+ // The following if-clauses and flags circumvent the manual's explicit instruction
+ // that McCoy should upload his clues on the Mainframe, so that Dino Klein can acquire them.
if (Actor_Clue_Query(kActorMcCoy, kClueOfficersStatement)
&& !Game_Flag_Query(kFlagMcCoyHasOfficersStatement)
) {
@@ -76,26 +87,57 @@ bool AIScriptKlein::Update() {
}
}
- // The following deals with the case that Klein gets annoyed by McCoy and how he recovers from that
+ // The following deals with the case that Klein gets annoyed by McCoy
if (Player_Query_Current_Scene() == kScenePS07
- && Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 35
+ && ((_vm->_cutContent && Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 40)
+ || (!_vm->_cutContent && Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 35) )
&& !Game_Flag_Query(kFlagPS07KleinInsulted)
) {
- // kActorTimerAIScriptCustomTask2 causes the "Klein is annoyed dialogue" to occur after 5 seconds
+ // kActorTimerAIScriptCustomTask2 causes the "Klein is annoyed dialogue" to occur after a few seconds
AI_Countdown_Timer_Reset(kActorKlein, kActorTimerAIScriptCustomTask2);
- AI_Countdown_Timer_Start(kActorKlein, kActorTimerAIScriptCustomTask2, 5);
+ if (_vm->_cutContent) {
+ // original's 5 seconds is too slow. Reduce it to 2 seconds
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyPreInit);
+ AI_Countdown_Timer_Start(kActorKlein, kActorTimerAIScriptCustomTask2, 2);
+ } else {
+ AI_Countdown_Timer_Start(kActorKlein, kActorTimerAIScriptCustomTask2, 5);
+ }
Game_Flag_Set(kFlagPS07KleinInsulted);
return true;
}
+
+ // The following deals with how Klein recovers from being annoyed at McCoy
if (Actor_Query_Goal_Number(kActorKlein) == kGoalKleinIsAnnoyedByMcCoyFinal) {
if (Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) > 20
&& Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 40
) {
// when insulted, slowly increase friendliness again, until it's at 40 or greater
Actor_Modify_Friendliness_To_Other(kActorKlein, kActorMcCoy, 2);
+#if !BLADERUNNER_ORIGINAL_BUGS
+ if (Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 40) {
+ // if after the increase (+2) it is still lower than 40 then keep being annoyed
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+ return true;
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
+
+#if BLADERUNNER_ORIGINAL_BUGS
AI_Movement_Track_Flush(kActorKlein);
Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
+#else
+ // don't go to Default if Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) <= 20
+ // and also reset kFlagPS07KleinInsulted if the friendliness is now above 40
+ if (Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) >= 40)
+ {
+ if (Game_Flag_Query(kFlagPS07KleinInsulted)) {
+ Game_Flag_Reset(kFlagPS07KleinInsulted);
+ // don't reset the kFlagPS07KleinInsultedTalk
+ }
+ AI_Movement_Track_Flush(kActorKlein);
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
return true;
}
return false;
@@ -103,9 +145,29 @@ bool AIScriptKlein::Update() {
void AIScriptKlein::TimerExpired(int timer) {
if (timer == kActorTimerAIScriptCustomTask2) {
- if (Game_Flag_Query(kFlagPS07KleinInsulted)
- && !Game_Flag_Query(kFlagPS07KleinInsultedTalk)
+#if !BLADERUNNER_ORIGINAL_BUGS
+ // This timer expiration was buggy; it would play the short dialogue version
+ // even when the timer expires even if McCoy has left the room and is somewhere else
+ // The fix is to return when the player is somewhere else
+ if (Player_Query_Current_Set() != kSetPS07
+ || !Actor_Query_Is_In_Current_Set(kActorKlein)
+ || !Game_Flag_Query(kFlagPS07KleinInsulted)
+ ) {
+ if (Actor_Query_Goal_Number(kActorKlein) == kGoalKleinIsAnnoyedByMcCoyPreInit) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
+ }
+ return;
+ }
+ AI_Movement_Track_Flush(kActorKlein);
+#endif
+ if (!Game_Flag_Query(kFlagPS07KleinInsultedTalk)
+#if BLADERUNNER_ORIGINAL_BUGS
+ // this is redundant now because we return in the added code above if Klein is not insulted
+ // (and the flag now gets reset when Klein calms down)
+ && Game_Flag_Query(kFlagPS07KleinInsulted)
+ // this is redundant now because we return in the added code above if Klein is not in the current set
&& Actor_Query_Is_In_Current_Set(kActorKlein)
+#endif
) {
// Klein is annoyed - full dialogue
Actor_Face_Actor(kActorKlein, kActorMcCoy, true);
@@ -114,11 +176,23 @@ void AIScriptKlein::TimerExpired(int timer) {
Actor_Says(kActorKlein, 20, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 4125, kAnimationModeTalk);
Game_Flag_Set(kFlagPS07KleinInsultedTalk);
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+#else
+ if (Actor_Query_Goal_Number(kActorKlein) != kGoalKleinIsAnnoyedByMcCoyInit) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
} else {
// Klein is annoyed - short dialogue
Actor_Says(kActorKlein, 10, kAnimationModeTalk);
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+#else
+ if (Actor_Query_Goal_Number(kActorKlein) != kGoalKleinIsAnnoyedByMcCoyInit) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
}
// return true;
}
@@ -156,8 +230,19 @@ void AIScriptKlein::CompletedMovementTrack() {
return; // true;
}
if (Actor_Query_Goal_Number(kActorKlein) == kGoalKleinIsAnnoyedByMcCoyFinal) {
+#if BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
- // On the next Update() the goal will be set to kGoalKleinIsAnnoyedByMcCoyInit, if friendliness still < 40
+#else
+ if (Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 40) {
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinIsAnnoyedByMcCoyInit);
+ } else {
+ if (Game_Flag_Query(kFlagPS07KleinInsulted)) {
+ Game_Flag_Reset(kFlagPS07KleinInsulted);
+ // don't reset the kFlagPS07KleinInsultedTalk
+ }
+ Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
return; // true;
}
// return false;
@@ -220,6 +305,9 @@ bool AIScriptKlein::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Append(kActorKlein, 31, 3); // kSetPS07
AI_Movement_Track_Repeat(kActorKlein);
break;
+ case kGoalKleinIsAnnoyedByMcCoyPreInit:
+ // aux goal (added)
+ break;
case kGoalKleinIsAnnoyedByMcCoyInit:
AI_Movement_Track_Flush(kActorKlein);
AI_Movement_Track_Append(kActorKlein, 32, 5); // kSetPS07 (hidden spot)
@@ -228,7 +316,7 @@ bool AIScriptKlein::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case kGoalKleinIsAnnoyedByMcCoy01:
AI_Movement_Track_Flush(kActorKlein);
if (_vm->_cutContent) {
- AI_Movement_Track_Append(kActorKlein, 35, Random_Query(8, 18)); // kSetFreeSlotC
+ AI_Movement_Track_Append(kActorKlein, 35, Random_Query(8, 24)); // kSetFreeSlotC
} else {
// this never really gets triggered in the original game
AI_Movement_Track_Append(kActorKlein, 35, 60); // kSetFreeSlotC
@@ -249,10 +337,12 @@ bool AIScriptKlein::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorKlein);
}
break;
+ case kGoalKleinAwayAtEndOfActThree:
+ // fall-through
case kGoalKleinAwayAtEndOfActOne:
AI_Movement_Track_Flush(kActorKlein);
Actor_Put_In_Set(kActorKlein, kSetFreeSlotC);
- Actor_Set_At_Waypoint(kActorKlein, 35, 0); // kSetPS07
+ Actor_Set_At_Waypoint(kActorKlein, 35, 0); // kSetFreeSlotC
break;
}
return false;
diff --git a/engines/bladerunner/script/scene/ps07.cpp b/engines/bladerunner/script/scene/ps07.cpp
index 5baaf3f69c..d88806a137 100644
--- a/engines/bladerunner/script/scene/ps07.cpp
+++ b/engines/bladerunner/script/scene/ps07.cpp
@@ -241,7 +241,10 @@ void SceneScriptPS07::PlayerWalkedIn() {
}
void SceneScriptPS07::PlayerWalkedOut() {
- if (!Game_Flag_Query(kFlagPS07KleinInsulted) && Global_Variable_Query(kVariableChapter) == 1) {
+ if (!Game_Flag_Query(kFlagPS07KleinInsulted)
+ && ((_vm->_cutContent && Global_Variable_Query(kVariableChapter) < 4)
+ || (!_vm->_cutContent && Global_Variable_Query(kVariableChapter) == 1))
+ ){
Actor_Set_Goal_Number(kActorKlein, kGoalKleinDefault);
}
}