From e0da90cdb8640461a2b0518cbe6834c4bdee446c Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Thu, 11 Jul 2019 15:35:58 +0300 Subject: BLADERUNNER: No rats when Lucy is in UG01 --- engines/bladerunner/script/ai/free_slot_a.cpp | 28 +++++++++++++++++++++++++-- engines/bladerunner/script/ai/free_slot_b.cpp | 28 +++++++++++++++++++++++++-- engines/bladerunner/script/ai/lucy.cpp | 2 +- 3 files changed, 53 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/bladerunner/script/ai/free_slot_a.cpp b/engines/bladerunner/script/ai/free_slot_a.cpp index f7c4849ca6..d87663a4a1 100644 --- a/engines/bladerunner/script/ai/free_slot_a.cpp +++ b/engines/bladerunner/script/ai/free_slot_a.cpp @@ -610,13 +610,24 @@ void AIScriptFreeSlotA::goToRandomUGxx() { switch (Random_Query(1, 14)) { case 1: // kSetUG01 +#if BLADERUNNER_ORIGINAL_BUGS AI_Movement_Track_Append(kActorFreeSlotA, 450, 1); AI_Movement_Track_Append(kActorFreeSlotA, 451, 5); AI_Movement_Track_Append(kActorFreeSlotA, 450, 0); break; - +#else + // Don't put rats in UG01 when Lucy is also here + if (!Actor_Query_In_Set(kActorLucy, kSetUG01)) { + AI_Movement_Track_Append(kActorFreeSlotA, 450, 1); + AI_Movement_Track_Append(kActorFreeSlotA, 451, 5); + AI_Movement_Track_Append(kActorFreeSlotA, 450, 0); + break; + } +#endif // BLADERUNNER_ORIGINAL_BUGS + // fall through case 2: // kSetUG01 +#if BLADERUNNER_ORIGINAL_BUGS World_Waypoint_Set(463, kSetUG01, 144.98f, -50.13f, -175.75f); World_Waypoint_Set(464, kSetUG01, 105.6f, -50.13f, -578.46f); World_Waypoint_Set(465, kSetUG01, 62.0f, -50.13f, -574.0f); @@ -625,7 +636,20 @@ void AIScriptFreeSlotA::goToRandomUGxx() { AI_Movement_Track_Append(kActorFreeSlotA, 465, 5); AI_Movement_Track_Append(kActorFreeSlotA, 463, 5); break; - +#else + // Don't put rats in UG01 when Lucy is also here + if (!Actor_Query_In_Set(kActorLucy, kSetUG01)) { + World_Waypoint_Set(463, kSetUG01, 144.98f, -50.13f, -175.75f); + World_Waypoint_Set(464, kSetUG01, 105.6f, -50.13f, -578.46f); + World_Waypoint_Set(465, kSetUG01, 62.0f, -50.13f, -574.0f); + AI_Movement_Track_Append(kActorFreeSlotA, 463, 1); + AI_Movement_Track_Append(kActorFreeSlotA, 464, 1); + AI_Movement_Track_Append(kActorFreeSlotA, 465, 5); + AI_Movement_Track_Append(kActorFreeSlotA, 463, 5); + break; + } +#endif // BLADERUNNER_ORIGINAL_BUGS + // fall through case 3: // kSetUG04 AI_Movement_Track_Append(kActorFreeSlotA, 446, 15); diff --git a/engines/bladerunner/script/ai/free_slot_b.cpp b/engines/bladerunner/script/ai/free_slot_b.cpp index f945021254..ddb7f047ff 100644 --- a/engines/bladerunner/script/ai/free_slot_b.cpp +++ b/engines/bladerunner/script/ai/free_slot_b.cpp @@ -460,13 +460,24 @@ void AIScriptFreeSlotB::goToRandomUGxx() { switch (Random_Query(1, 14)) { case 1: // kSetUG01 +#if BLADERUNNER_ORIGINAL_BUGS AI_Movement_Track_Append(kActorFreeSlotB, 450, 1); AI_Movement_Track_Append(kActorFreeSlotB, 451, 5); AI_Movement_Track_Append(kActorFreeSlotB, 450, 0); break; - +#else + // Don't put rats in UG01 when Lucy is also here + if (!Actor_Query_In_Set(kActorLucy, kSetUG01)) { + AI_Movement_Track_Append(kActorFreeSlotB, 450, 1); + AI_Movement_Track_Append(kActorFreeSlotB, 451, 5); + AI_Movement_Track_Append(kActorFreeSlotB, 450, 0); + break; + } +#endif // BLADERUNNER_ORIGINAL_BUGS + // fall through case 2: // kSetUG01 +#if BLADERUNNER_ORIGINAL_BUGS World_Waypoint_Set(466, kSetUG01, 144.98f, -50.13f, -175.75f); World_Waypoint_Set(547, kSetUG01, 105.6f, -50.13f, -578.46f); World_Waypoint_Set(548, kSetUG01, 62.0f, -50.13f, -574.0f); @@ -475,7 +486,20 @@ void AIScriptFreeSlotB::goToRandomUGxx() { AI_Movement_Track_Append(kActorFreeSlotB, 548, 5); AI_Movement_Track_Append(kActorFreeSlotB, 466, 5); break; - +#else + // Don't put rats in UG01 when Lucy is also here + if (!Actor_Query_In_Set(kActorLucy, kSetUG01)) { + World_Waypoint_Set(466, kSetUG01, 144.98f, -50.13f, -175.75f); + World_Waypoint_Set(547, kSetUG01, 105.6f, -50.13f, -578.46f); + World_Waypoint_Set(548, kSetUG01, 62.0f, -50.13f, -574.0f); + AI_Movement_Track_Append(kActorFreeSlotB, 466, 1); + AI_Movement_Track_Append(kActorFreeSlotB, 547, 1); + AI_Movement_Track_Append(kActorFreeSlotB, 548, 5); + AI_Movement_Track_Append(kActorFreeSlotB, 466, 5); + break; + } +#endif // BLADERUNNER_ORIGINAL_BUGS + // fall through case 3: // kSetUG04 AI_Movement_Track_Append(kActorFreeSlotB, 446, 15); diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp index 5b1b2d3a64..786d41012d 100644 --- a/engines/bladerunner/script/ai/lucy.cpp +++ b/engines/bladerunner/script/ai/lucy.cpp @@ -527,7 +527,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalLucyUG01RunAway: AI_Movement_Track_Flush(kActorLucy); AI_Movement_Track_Append_Run(kActorLucy, 545, 0); - AI_Movement_Track_Append(kActorLucy, 33, 0); + AI_Movement_Track_Append(kActorLucy, 33, 0); // kSetFreeSlotA AI_Movement_Track_Repeat(kActorLucy); break; -- cgit v1.2.3