Skip to content

Commit

Permalink
BLADERUNNER: Prevent Replicants from despawning from the moonbus
Browse files Browse the repository at this point in the history
All Replicants get a new goal now inside the moonbus, and movement flush

This is to prevent earlier scripts that had them "walking around" from kicking in (this was mainly a bug for the twins) but is applied to everyone (except Clovis and Sadik) for conformance
  • Loading branch information
antoniou79 committed Aug 13, 2019
1 parent e609d02 commit 67fd0ca
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
9 changes: 6 additions & 3 deletions engines/bladerunner/game_constants.h
Expand Up @@ -2121,7 +2121,7 @@ enum GoalDektora {
kGoalDektoraNR11BurningFallToNR10 = 279,
kGoalDektoraNR11RanAway = 290,
kGoalDektoraNR07RanAway = 295,

kGoalDektoraKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalDektoraGone = 599
};

Expand Down Expand Up @@ -2172,7 +2172,7 @@ enum GoalGordo {
kGoalGordoNR01Arrested = 260,
kGoalGordoNR01RanAway = 280,
kGoalGordoNR01Die = 299,

kGoalGordoKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalGordoGone = 599
};

Expand Down Expand Up @@ -2260,7 +2260,7 @@ enum GoalLucy {
kGoalLucyUG01Wait = 310,
kGoalLucyUG01VoightKampff = 311,
kGoalLucyUG01RunAway = 312,

kGoalLucyKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalLucyGone = 599
};

Expand All @@ -2283,6 +2283,7 @@ enum GoalIzo {
kGoalIzoGoToHC03 = 155,
kGoalIzoDieHidden = 198,
kGoalIzoDie = 199,
kGoalIzoKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalIzoGone = 599
};

Expand Down Expand Up @@ -2318,6 +2319,7 @@ enum GoalLuther {
kGoalLutherDyingCheck = 497,
kGoalLutherDie = 498,
kGoalLutherDead = 499,
kGoalLutherKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalLutherGone = 599
};

Expand Down Expand Up @@ -2439,6 +2441,7 @@ enum GoalZuben {
kGoalZubenFled = 20,
kGoalZubenMA01AttackMcCoy = 21,
kGoalZubenDiesInChapter1 = 99,
kGoalZubenKP07Wait = 513, // new goal when in moonbus, Act 5
kGoalZubenGone = 599
};

Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/ai/luther.cpp
Expand Up @@ -57,7 +57,7 @@ bool AIScriptLuther::Update() {
}

if (Actor_Query_Goal_Number(kActorLuther) == kGoalLutherDefault
&& Actor_Query_Goal_Number(kActorLuther) != kGoalLutherDead
&& Actor_Query_Goal_Number(kActorLuther) != kGoalLutherDead // A bug? this is redundant
) {
Actor_Set_Goal_Number(kActorLuther, kGoalLutherMoveAround);
return false;
Expand Down
35 changes: 35 additions & 0 deletions engines/bladerunner/script/scene/kp07.cpp
Expand Up @@ -35,13 +35,28 @@ void SceneScriptKP07::InitializeScene() {
if (Game_Flag_Query(kFlagDektoraIsReplicant)
&& Actor_Query_Goal_Number(kActorDektora) < kGoalDektoraGone
) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
if (Game_Flag_Query(kFlagNR11DektoraBurning)) {
Game_Flag_Reset(kFlagNR11DektoraBurning); // resolves a bug of an original game, where Dektora would default to burning state
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeTalk); // dummy animation change to ensure that the next will trigger the mode change case
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
AI_Movement_Track_Flush(kActorDektora);
Actor_Set_Goal_Number(kActorDektora, kGoalDektoraKP07Wait); // new clear goal
#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Set_Targetable(kActorDektora, true);
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Put_In_Set(kActorDektora, kSetKP07);
Actor_Set_At_XYZ(kActorDektora, -52.0f, -41.52f, -5.0f, 289);
}

if (Actor_Query_Goal_Number(kActorZuben) < kGoalZubenGone) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
AI_Movement_Track_Flush(kActorZuben);
Actor_Set_Goal_Number(kActorZuben, kGoalZubenKP07Wait); // new clear goal
#endif // BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Set_Targetable(kActorZuben, true);
Actor_Put_In_Set(kActorZuben, kSetKP07);
Expand All @@ -51,6 +66,11 @@ void SceneScriptKP07::InitializeScene() {
if (Game_Flag_Query(kFlagIzoIsReplicant)
&& Actor_Query_Goal_Number(kActorIzo) < 599
) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
AI_Movement_Track_Flush(kActorIzo);
Actor_Set_Goal_Number(kActorIzo, kGoalIzoKP07Wait); // new clear goal
#endif // BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Set_Targetable(kActorIzo, true);
Actor_Put_In_Set(kActorIzo, kSetKP07);
Expand All @@ -60,6 +80,11 @@ void SceneScriptKP07::InitializeScene() {
if (Game_Flag_Query(kFlagGordoIsReplicant)
&& Actor_Query_Goal_Number(kActorGordo) < kGoalGordoGone
) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
AI_Movement_Track_Flush(kActorGordo);
Actor_Set_Goal_Number(kActorGordo, kGoalGordoKP07Wait); // new clear goal
#endif // BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Set_Targetable(kActorGordo, true);
Actor_Put_In_Set(kActorGordo, kSetKP07);
Expand All @@ -69,12 +94,22 @@ void SceneScriptKP07::InitializeScene() {
if (Game_Flag_Query(kFlagLucyIsReplicant)
&& Actor_Query_Goal_Number(kActorLucy) < kGoalLucyGone
) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
AI_Movement_Track_Flush(kActorLucy);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyKP07Wait); // new clear goal
#endif // BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Put_In_Set(kActorLucy, kSetKP07);
Actor_Set_At_XYZ(kActorLucy, 78.0f, -41.52f, -119.0f, 659);
}

if (Actor_Query_Goal_Number(kActorLuther) < kGoalLutherGone) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
AI_Movement_Track_Flush(kActorLuther);
Actor_Set_Goal_Number(kActorLuther, kGoalLutherKP07Wait); // new goal to avoid resuming his walking around routine
#endif // BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableReplicantsSurvivorsAtMoonbus, 1);
Actor_Put_In_Set(kActorLuther, kSetKP07);
Actor_Set_At_XYZ(kActorLuther, -47.0f, 0.0f, 151.0f, 531);
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/script/scene/ug01.cpp
Expand Up @@ -199,7 +199,7 @@ void SceneScriptUG01::PlayerWalkedIn() {

if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyUG01Wait) {
Music_Play(kMusicLoveSong, 35, 0, 3, -1, 0, 0);
Actor_Set_Goal_Number(kActorLucy, 311);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyUG01VoightKampff);
}
//return false;
}
Expand Down

0 comments on commit 67fd0ca

Please sign in to comment.