Permalink
Browse files

BLADERUNNER: Cleanup for drive away endings scripts

All ending are achievable
  • Loading branch information...
peterkohaut committed Feb 7, 2019
1 parent b3b6f6e commit 7061f7cb173871e84d26010b9742fcec8a0ece1a
@@ -807,7 +807,8 @@ enum Flags {
kFlagBB12toBB07 = 365,
kFlagAR02InsectDealerTalk = 366,
kFlagAR02StungByScorpion = 367,

kFlagHF07Hole = 368,
kFlagHF05Hole = 369,
kFlagNotUsed370 = 370, // is never checked
// 371 is never used
// 372 is never used
@@ -960,6 +961,7 @@ enum Flags {
kFlagTB06DogCollarTaken = 519,
kFlagTB06KitchenBoxTaken = 520,
kFlagHC03TrapDoorOpened = 521,
kFlagUG05TalkAboutTunnel = 522,
kFlagMutantsActive = 523,
kFlagUG06Chapter4Started = 524,
kFlagCT10Entered = 525,
@@ -996,7 +998,7 @@ enum Flags {
kFlagUG16LutherLanceTalk1 = 556,
kFlagNotUsed557, // is never checked
kFlagDR01toCT11 = 558,

kFlagHF06SteelInterruption = 559,
kFlagLutherLanceIsReplicant = 560,
kFlagNR02GordoLeaveLighter = 561,
kFlagHF05CrazyLegsTalk1 = 562,
@@ -1099,7 +1101,9 @@ enum Flags {
kFlagNR11BreakWindow = 659,
kFlagDNARowAvailableTalk = 660,
kFlagTB07ShadeDown = 661, // is never set

kFlagHF01TalkToLovedOne = 662,
kFlagHF05PoliceArrived = 663,
kFlagUG07PoliceLeave = 664,
kFlagUG19Available = 665,
kFlagMcCoyFreedOfAccusations = 666,
// 667 is never used
@@ -1118,6 +1122,8 @@ enum Flags {
kFlagChapter4Intro = 680,
// 681 is never used
kFlagUG15BridgeBroken = 682,
kFlagUG05TalkToPolice = 683,
kFlagHF05PoliceAttacked = 684,
kFlagClovisLyingDown = 685,
kFlagNotUsed686 = 686,
// 687 is never used
@@ -1132,9 +1138,9 @@ enum Flags {
kFlagKP07ReplicantsAttackMcCoy = 696,
kFlagKP07McCoyPulledGun = 697,
kFlagUG15LanceLuthorTrade = 698,

kFlagTalkToZuben = 699,
// 700 is never used

kFlagMcCoyAttackedLucy = 701,
kFlagBulletBobDead = 702,
kFlagUG18BriefcaseTaken = 703,
kFlagRC02EnteredChapter4 = 704,
@@ -1149,7 +1155,7 @@ enum Flags {
kFlagDR04McCoyShotMoraji = 713,
kFlagMcCoyAttackedReplicants = 714,
kFlagDR06UnlockedToUG16 = 715,

kFlagUG13HomelessLayingdown = 716,
kFlagRC04BobTalk3 = 717,
kflagPS01toPS02 = 718,
kFlagCT02McCoyFell = 719,
@@ -1187,7 +1193,7 @@ enum Variables {
kVariableGenericWalkerAModel = 32,
kVariableGenericWalkerBModel = 33,
kVariableGenericWalkerCModel = 34,

kVariableGenericWalkerConfig = 35, // has no use
kVariableBB10ShelvesAvailable = 36,
kVariableWalkLoopActor = 37,
kVariableWalkLoopRun = 38,
@@ -1356,7 +1362,7 @@ enum Scenes {
kSceneNR06 = 59, // Nightclub Row - Early Q's - Empty dressing room
kSceneNR07 = 60, // Nightclub Row - Early Q's - Dektora's dressing room
kSceneNR08 = 61, // Nightclub Row - Early Q's - Stage
kSceneNR09 = 62, // Nightclub Row - Early Q's - Upstairs
kSceneNR09 = 62, // Nightclub Row - Early Q's - Balcony
kSceneNR10 = 63, // Nightclub Row - Early Q's - Projector room
kSceneNR11 = 64, // Nightclub Row - Early Q's - Loft
kScenePS01 = 65, // Police Station - Roof
@@ -1820,6 +1826,7 @@ enum GoalSteele {
kGoalSteeleStartChapter4 = 300,
// chapter 5
kGoalSteeleStartChapter5 = 400,
kGoalSteeleHF06Attack = 402, // has no use
// kGoalSteeleKP03WillShootMcCoy = 410,
kGoalSteeleKP03Walk = 411,
kGoalSteeleKP03StopWalking = 412,
@@ -1974,6 +1981,7 @@ enum GoalClovis {

enum GoalLucy {
kGoalLucyDefault = 0,
// chapter 3
kGoalLucyMoveAround = 200,
kGoalLucyWillReturnToHF03 = 201,
kGoalLucyGoToHF03 = 205,
@@ -1996,6 +2004,12 @@ enum GoalLucy {
kGoalLucyHF04WalkAway = 239,
kGoalLucyReturnToHF03 = 250,
kGoalLucyHF03RanAway = 299,
// chapter 4
kGoalLucyStartChapter4 = 300,
kGoalLucyUG01Wait = 310,
kGoalLucyUG01VoightKampff = 311,
kGoalLucyUG01RunAway = 312,

kGoalLucyGone = 599
};

@@ -343,7 +343,7 @@ void AIScriptGenericWalkerA::movingUpdate() {
}

bool AIScriptGenericWalkerA::prepareWalker() {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(35) < 0 || !preparePath()) {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(kVariableGenericWalkerConfig) < 0 || !preparePath()) {
return false;
}

@@ -319,7 +319,7 @@ void AIScriptGenericWalkerB::movingUpdate() {
}

bool AIScriptGenericWalkerB::prepareWalker() {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(35) < 0 || !preparePath()) {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(kVariableGenericWalkerConfig) < 0 || !preparePath()) {
return false;
}

@@ -320,7 +320,7 @@ void AIScriptGenericWalkerC::movingUpdate() {
}

bool AIScriptGenericWalkerC::prepareWalker() {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(35) < 2 || !preparePath()) {
if (Game_Flag_Query(kFlagGenericWalkerWaiting) || Global_Variable_Query(kVariableGenericWalkerConfig) < 2 || !preparePath()) {
return false;
}

@@ -55,9 +55,9 @@ bool AIScriptLucy::Update() {
}

if (Global_Variable_Query(kVariableChapter) == 4
&& Actor_Query_Goal_Number(kActorLucy) < 300
&& Actor_Query_Goal_Number(kActorLucy) < kGoalLucyStartChapter4
) {
Actor_Set_Goal_Number(kActorLucy, 300);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyStartChapter4);
}

if (Global_Variable_Query(kVariableChapter) == 4
@@ -83,7 +83,7 @@ bool AIScriptLucy::Update() {
&& Actor_Query_Goal_Number(kActorLucy) != kGoalLucyHF04TalkToMcCoy
&& Player_Query_Current_Scene() == kSceneHF04
&& Actor_Query_Which_Set_In(kActorLucy) == kSetHF04
&& !Game_Flag_Query(701)
&& !Game_Flag_Query(kFlagMcCoyAttackedLucy)
&& Actor_Query_Inch_Distance_From_Actor(kActorLucy, kActorMcCoy) < 84
&& !Player_Query_Combat_Mode()
&& Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 40
@@ -485,24 +485,24 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;

case 300:
case kGoalLucyStartChapter4:
Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
Actor_Set_At_Waypoint(kActorLucy, 33, 0);
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) {
Actor_Set_Goal_Number(kActorLucy, 310);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyUG01Wait);
}
break;

case 310:
case kGoalLucyUG01Wait:
Actor_Put_In_Set(kActorLucy, kSetUG01);
Actor_Set_At_Waypoint(kActorLucy, 544, 651);
break;

case 311:
case kGoalLucyUG01VoightKampff:
voightKampffTest();
break;

case 312:
case kGoalLucyUG01RunAway:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 545, 0);
AI_Movement_Track_Append(kActorLucy, 33, 0);
@@ -867,7 +867,7 @@ void AIScriptLucy::voightKampffTest() {
Voight_Kampff_Activate(kActorLucy, 40);

Player_Loses_Control();
if (Actor_Clue_Query(kActorMcCoy, 271)) {
if (Actor_Clue_Query(kActorMcCoy, kClueVKLucyReplicant)) {
Actor_Says(kActorMcCoy, 6865, 13);
Actor_Says(kActorLucy, 1140, 14);
Actor_Says(kActorMcCoy, 6865, 14);
@@ -894,11 +894,12 @@ void AIScriptLucy::voightKampffTest() {
Actor_Says(kActorMcCoy, 6910, 13);
Delay(2000);
Player_Gains_Control();
Actor_Set_Goal_Number(kActorLucy, 312);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyUG01RunAway);
}

void AIScriptLucy::checkCombat() {
Game_Flag_Set(701);
Game_Flag_Set(kFlagMcCoyAttackedLucy);

if (Actor_Query_In_Set(kActorLucy, kSetHF01)
&& Global_Variable_Query(kVariableChapter) == 5
&& Actor_Query_Goal_Number(kActorLucy) != 450
@@ -92,9 +92,9 @@ bool AIScriptOfficerLeary::Update() {
}

if ( Game_Flag_Query(kFlagUG07Empty)
&& !Game_Flag_Query(664)
&& !Game_Flag_Query(kFlagUG07PoliceLeave)
) {
Game_Flag_Set(664);
Game_Flag_Set(kFlagUG07PoliceLeave);
Actor_Set_Goal_Number(kActorOfficerLeary, 305);
return false;
}
@@ -203,7 +203,7 @@ void AIScriptOfficerLeary::TimerExpired(int timer) {
Actor_Set_Goal_Number(kActorOfficerLeary, 430);
Actor_Set_Goal_Number(kActorOfficerGrayford, 430);
} else {
Game_Flag_Set(684);
Game_Flag_Set(kFlagHF05PoliceAttacked);
}
} else if (timer == 2) {
AI_Countdown_Timer_Reset(kActorOfficerLeary, 2);
@@ -148,7 +148,7 @@ void AIScriptTransient::ShotAtAndMissed() {

bool AIScriptTransient::ShotAtAndHit() {
Actor_Set_Frame_Rate_FPS(kActorTransient, 8);
if (Game_Flag_Query(716)) {
if (Game_Flag_Query(kFlagUG13HomelessLayingdown)) {
_animationState = 11;
} else {
_animationState = 14;
@@ -203,7 +203,7 @@ bool AIScriptTransient::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_XYZ(kActorTransient, -310.0, 55.0, -350.0, 400);
Actor_Change_Animation_Mode(kActorTransient, 53);
Actor_Set_Targetable(kActorTransient, true);
Game_Flag_Set(716);
Game_Flag_Set(kFlagUG13HomelessLayingdown);
return true;
case 391:
Actor_Change_Animation_Mode(kActorTransient, 53);
@@ -461,7 +461,7 @@ bool AIScriptTransient::ChangeAnimationMode(int mode) {
_animationFrame = 0;
break;
case 21:
if (Game_Flag_Query(716)) {
if (Game_Flag_Query(kFlagUG13HomelessLayingdown)) {
_animationState = 11;
} else {
_animationState = 14;
@@ -211,14 +211,14 @@ void AIScriptZuben::ClickedByPlayer() {
Actor_Face_Actor(kActorMcCoy, kActorZuben, true);
Actor_Says(kActorMcCoy, 8529, 13);
}
if (Global_Variable_Query(kVariableChapter) > 1 && Global_Variable_Query(kVariableChapter) < 5) {

if (Global_Variable_Query(kVariableChapter) > 1
&& Global_Variable_Query(kVariableChapter) < 5
) {
if (Actor_Query_Friendliness_To_Other(kActorZuben, kActorMcCoy) <= 20) {
Actor_Face_Actor(kActorMcCoy, kActorZuben, true);
Actor_Says(kActorMcCoy, 8910, 11);
} else if (Game_Flag_Query(699)) {
Actor_Face_Actor(kActorMcCoy, kActorZuben, true);
Actor_Says(kActorMcCoy, 8910, 11);
} else {
} else if (!Game_Flag_Query(kFlagTalkToZuben)) {
AI_Movement_Track_Pause(kActorZuben);
Actor_Face_Actor(kActorZuben, kActorMcCoy, true);
Actor_Says(kActorZuben, 140, 14);
@@ -227,8 +227,11 @@ void AIScriptZuben::ClickedByPlayer() {
Actor_Says(kActorZuben, 150, 15);
Actor_Says(kActorMcCoy, 7285, 12);
dialogue();
Game_Flag_Set(699);
Game_Flag_Set(kFlagTalkToZuben);
AI_Movement_Track_Unpause(kActorZuben);
} else {
Actor_Face_Actor(kActorMcCoy, kActorZuben, true);
Actor_Says(kActorMcCoy, 8910, 11);
}
// return true;
}
@@ -58,7 +58,7 @@ void InitScript::Init_Globals() {
for (int i = 0; i != 55; ++i)
Global_Variable_Set(i, 0);

Global_Variable_Set(35, 2);
Global_Variable_Set(kVariableGenericWalkerConfig, 2);
Global_Variable_Set(kVariableChapter, 1);
Global_Variable_Set(kVariableChinyen, 100);

@@ -46,7 +46,7 @@ void SceneScriptHF01::InitializeScene() {
}

Scene_Exit_Add_2D_Exit(0, 81, 226, 169, 321, 0);
if (!Game_Flag_Query(663)) {
if (!Game_Flag_Query(kFlagHF05PoliceArrived)) {
Scene_Exit_Add_2D_Exit(1, 304, 239, 492, 339, 0);
Scene_Exit_Add_2D_Exit(2, 560, 231, 639, 360, 0);
if (Game_Flag_Query(kFlagSpinnerAtHF01)) {
@@ -80,7 +80,7 @@ void SceneScriptHF01::InitializeScene() {
Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kHF01LoopInshot, false);
}
Scene_Loop_Set_Default(kHF01LoopMainLoopSpinner);
} else if (Game_Flag_Query(663)) {
} else if (Game_Flag_Query(kFlagHF05PoliceArrived)) {
Scene_Loop_Set_Default(kHF01LoopMainLoopSpinner);
} else {
Scene_Loop_Set_Default(kHF01LoopMainLoopNoSpinner);
@@ -159,9 +159,9 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) {
&& !Game_Flag_Query(kFlagCrazylegsArrested)
&& Actor_Query_Goal_Number(kActorCrazylegs) != 2
&& Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)
&& !Game_Flag_Query(662)
&& !Game_Flag_Query(kFlagHF01TalkToLovedOne)
) {
Game_Flag_Set(662);
Game_Flag_Set(kFlagHF01TalkToLovedOne);
Actor_Face_Actor(kActorMcCoy, affectionTowardsActor, true);
Actor_Face_Actor(affectionTowardsActor, kActorMcCoy, true);
if (affectionTowardsActor == kActorDektora) {
@@ -328,7 +328,7 @@ void SceneScriptHF01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}

void SceneScriptHF01::PlayerWalkedIn() {
if (Game_Flag_Query(663)) {
if (Game_Flag_Query(kFlagHF05PoliceArrived)) {
ADQ_Flush();
ADQ_Add(kActorOfficerGrayford, 280, kAnimationModeTalk);
Actor_Put_In_Set(kActorOfficerLeary, kSetHF01);
@@ -340,7 +340,7 @@ void SceneScriptHF01::PlayerWalkedIn() {
}

if (!Game_Flag_Query(kFlagCrazylegsArrested)
&& Actor_Query_Goal_Number(kActorCrazylegs) != 2
&& Actor_Query_Goal_Number(kActorCrazylegs) != 2
) {
if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)
&& Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy
Oops, something went wrong.

0 comments on commit 7061f7c

Please sign in to comment.