aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-01-31 00:19:38 +0100
committerPeter Kohaut2019-01-31 21:27:31 +0100
commit3fc1fbb8daae93e02985379aed4b8a6feab5cb24 (patch)
tree07e2247045ce2e34c8379b8fcc36d82e6bf51d3a
parentb16b26ac722a381c4ab43e66886b3012962556ed (diff)
downloadscummvm-rg350-3fc1fbb8daae93e02985379aed4b8a6feab5cb24.tar.gz
scummvm-rg350-3fc1fbb8daae93e02985379aed4b8a6feab5cb24.tar.bz2
scummvm-rg350-3fc1fbb8daae93e02985379aed4b8a6feab5cb24.zip
BLADERUNNER: Clean up of Dektora script
-rw-r--r--engines/bladerunner/game_constants.h63
-rw-r--r--engines/bladerunner/script/ai/dektora.cpp188
-rw-r--r--engines/bladerunner/script/ai/early_q.cpp2
-rw-r--r--engines/bladerunner/script/ai/holloway.cpp3
-rw-r--r--engines/bladerunner/script/ai/lucy.cpp34
-rw-r--r--engines/bladerunner/script/ai/mccoy.cpp36
-rw-r--r--engines/bladerunner/script/ai/steele.cpp10
-rw-r--r--engines/bladerunner/script/scene/hf01.cpp8
-rw-r--r--engines/bladerunner/script/scene/hf03.cpp14
-rw-r--r--engines/bladerunner/script/scene/hf04.cpp2
-rw-r--r--engines/bladerunner/script/scene/hf05.cpp4
-rw-r--r--engines/bladerunner/script/scene/hf06.cpp8
-rw-r--r--engines/bladerunner/script/scene/hf07.cpp2
-rw-r--r--engines/bladerunner/script/scene/kp07.cpp2
-rw-r--r--engines/bladerunner/script/scene/nr01.cpp10
-rw-r--r--engines/bladerunner/script/scene/nr04.cpp2
-rw-r--r--engines/bladerunner/script/scene/nr07.cpp4
-rw-r--r--engines/bladerunner/script/scene/nr08.cpp40
-rw-r--r--engines/bladerunner/script/scene/nr09.cpp4
-rw-r--r--engines/bladerunner/script/scene/nr10.cpp30
-rw-r--r--engines/bladerunner/script/scene/nr11.cpp82
-rw-r--r--engines/bladerunner/script/scene/ug05.cpp2
-rw-r--r--engines/bladerunner/script/scene_script.h2
23 files changed, 325 insertions, 227 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 54923ab1bb..44a62af133 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -949,7 +949,13 @@ enum Flags {
kFlagHF03toHF04 = 566, // is never checked
kFlagHF04toHF03 = 567,
kFlagNR04EarlyQWalkedIn = 569,
+ // 570 is never used
+ // 571 is never used
+ // 572 is never used
kFlagNR03Entered = 573,
+ // 580 is never used
+ // 581 is never used
+ // 583 is never used
kFlagHF04DoorsClosed = 584,
kFlagHF04CloseDoors = 585,
kFlagHF04OpenDoors = 586,
@@ -961,6 +967,7 @@ enum Flags {
kFlagLucyRanAway = 593,
kFlagNR02GordoJumpDown = 594,
kFlagKIAPrivacyAddonIntro = 599,
+ // 602 is never used
kFlagSteeleAimingAtGordo = 603,
kFlagNR03McCoyThrownOut = 604,
kFlagNR04DiscFound = 605,
@@ -974,20 +981,33 @@ enum Flags {
kFlagNR09toNR08 = 615,
kFlagMcCoyCapturedByHolloway = 616,
kFlagSpinnerMissing = 617,
+ // 618 is never used
+ // 619 is never used
kFlagNR08Available = 620,
+ // 621 is never used
kFlagNR08TouchedDektora = 622,
kFlagTB07TyrellMeeting = 625,
kFlagNR01McCoyIsDrugged = 627,
+ kFlagNR01DektoraFall = 632,
+ kFlagNR11BurnedUp = 634,
+ kFlagNR11SteeleShoot = 635,
+ kFlagNR08Faded = 636,
+ // 637 is never used
kFlagNR07McCoyIsCop = 638,
+ // 639 is never used
+ kFlagNR10CameraDestroyed = 640,
kFlagNR10toNR11 = 641, // is never checked
+ kFlagNR10McCoyBlinded = 642,
kFlagSteeleKnowsBulletBobIsDead = 643,
kFlagCT11DogWrapperTaken = 645,
kFlagSteeleDead = 646, // is never checked
kFlagMA04McCoySleeping = 647,
kFlagMA04PhoneMessageFromClovis = 649,
kFlagMA04PhoneMessageFromLucy = 650,
+ kFlagNR08McCoyWatchingShow = 651,
kFlagCrazylegsArrestedTalk = 652,
kFlagUG02RagiationGooglesTaken = 656,
+ kFlagNR11BreakWindow = 659,
kFlagDNARowAvailableTalk = 660,
kFlagTB07ShadeDown = 661, // is never set
kFlagMA07toPS14 = 672,
@@ -1015,6 +1035,7 @@ enum Flags {
kflagPS01toPS02 = 718,
kFlagCT02McCoyFell = 719,
kFlagCT02McCoyCombatReady = 720,
+ kFlagChapter4Starting = 722,
kFlagZubenBountyPaid = 723,
kFlagCT11DogWrapperAvailable = 725,
kFlagAR02Entered = 726,
@@ -1205,7 +1226,7 @@ enum Scenes {
kSceneNR08 = 61, // Nightclub Row - Early Q's - Stage
kSceneNR09 = 62, // Nightclub Row - Early Q's - Upstairs
kSceneNR10 = 63, // Nightclub Row - Early Q's - Projector room
- kSceneNR11 = 64,
+ kSceneNR11 = 64, // Nightclub Row - Early Q's - Loft
kScenePS01 = 65, // Police Station - Roof
kScenePS02 = 66, // Police Station - Elevator
kScenePS03 = 67, // Police Station - Ground floor
@@ -1249,7 +1270,7 @@ enum Scenes {
kSceneCT51 = 105, // Chinatown - Yukon Hotel - Backroom - back
kSceneHC04 = 106, // Hawker's Circle - Kingston kitchen
kSceneRC51 = 107, // Runciter - Lucy's desk
- kSceneTB07 = 108,
+ kSceneTB07 = 108, // Tyrell Building - Tyrell's office
kScenePS15 = 119, // Police Station - Armory
kSceneBB12 = 120 // Bradbury Building - Monkey room
};
@@ -1633,10 +1654,32 @@ enum GoalSteele {
enum GoalDektora {
kGoalDektoraDefault = 0,
+ // chapter 1
kGoalDektoraStartWalkingAround = 100,
kGoalDektoraWalkAroundAsReplicant = 101,
kGoalDektoraWalkAroundAsHuman = 102,
- kGoalDektoraStopWalkingAround = 103
+ kGoalDektoraStopWalkingAround = 103,
+ // chapter 2
+ kGoalDektoraStartChapter3 = 199,
+ kGoalDektoraNR07Sit = 200,
+ kGoalDektoraNR08Dance = 210,
+ kGoalDektoraNR08Leave = 211,
+ kGoalDektoraNR08ReadyToRun = 245,
+ kGoalDektoraNR08GoToNR10 = 246,
+ kGoalDektoraNR10AttackMcCoy = 247,
+ kGoalDektoraNR11Hiding = 250,
+ kGoalDektoraNR11WalkAway = 260,
+ kGoalDektoraNR11PrepareBurning = 269,
+ kGoalDektoraNR11Burning = 270,
+ kGoalDektoraNR11BurningGoToMcCoy = 271,
+ kGoalDektoraNR11BurningGoToWindow = 272,
+ kGoalDektoraNR11PrepareFallThroughWindow = 273,
+ kGoalDektoraNR11FallThroughWindow = 274,
+ kGoalDektoraNR11BurningFallToNR10 = 279,
+ kGoalDektoraNR11RanAway = 290,
+ kGoalDektoraNR07RanAway = 295,
+
+ kGoalDektoraDead = 599
};
enum GoalGordo {
@@ -1714,12 +1757,12 @@ enum GoalLucy {
kGoalLucyMoveAround = 200,
kGoalLucyWillReturnToHF03 = 201,
kGoalLucyGoToHF03 = 205,
- kGoalLucyRunOutPhase1 = 210,
- kGoalLucyRunOutPhase2 = 211,
- kGoalLucyRunToHF041 = 212,
- kGoalLucyRunToHF042 = 213,
- kGoalLucyRunAwayWithHelp1 = 214,
- kGoalLucyRunAwayWithHelp2 = 215,
+ kGoalLucyHF03RunOutPhase1 = 210,
+ kGoalLucyHF03RunOutPhase2 = 211,
+ kGoalLucyHF03RunToHF041 = 212,
+ kGoalLucyHF03RunToHF042 = 213,
+ kGoalLucyHF03RunAwayWithHelp1 = 214,
+ kGoalLucyHF03RunAwayWithHelp2 = 215,
kGoalLucyGoToFreeSlotGAG = 220,
kGoalLucyGoToFreeSlotGAHJ = 225,
kGoalLucyHF04Start = 230,
@@ -1732,7 +1775,7 @@ enum GoalLucy {
kGoalLucyHF04Run4 = 238,
kGoalLucyHF04WalkAway = 239,
kGoalLucyReturnToHF03 = 250,
- kGoalLucyGoneChapter3 = 299,
+ kGoalLucyHF03RanAway = 299,
kGoalLucyDead = 599
};
diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp
index cb5f1db9b8..cb07d7bea9 100644
--- a/engines/bladerunner/script/ai/dektora.cpp
+++ b/engines/bladerunner/script/ai/dektora.cpp
@@ -66,17 +66,17 @@ bool AIScriptDektora::Update() {
}
if (chapter == 3) {
- if (Actor_Query_Goal_Number(kActorDektora) < 199) {
- Actor_Set_Goal_Number(kActorDektora, 199);
+ if (Actor_Query_Goal_Number(kActorDektora) < kGoalDektoraStartChapter3) {
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraStartChapter3);
} else {
switch (Actor_Query_Goal_Number(kActorDektora)) {
- case 269:
- Actor_Set_Goal_Number(kActorDektora, 270);
+ case kGoalDektoraNR11PrepareBurning:
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11Burning);
break;
- case 271:
+ case kGoalDektoraNR11BurningGoToMcCoy:
if (Actor_Query_Inch_Distance_From_Actor(kActorDektora, kActorMcCoy) <= 48) {
- Actor_Set_Goal_Number(kActorDektora, 279);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningFallToNR10);
break;
}
@@ -86,10 +86,11 @@ bool AIScriptDektora::Update() {
}
break;
- case 273:
- Actor_Set_Goal_Number(kActorDektora, 274);
+ case kGoalDektoraNR11PrepareFallThroughWindow:
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11FallThroughWindow);
break;
+ // this is unused and goal 275 never set
case 275:
Actor_Set_Goal_Number(kActorDektora, 276);
break;
@@ -110,20 +111,20 @@ bool AIScriptDektora::Update() {
void AIScriptDektora::TimerExpired(int timer) {
if (timer == 0) {
- if (Actor_Query_Goal_Number(kActorDektora) == 210) {
- if (Player_Query_Current_Scene() == 61) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) {
+ if (Player_Query_Current_Scene() == kSceneNR08) {
AI_Countdown_Timer_Reset(kActorDektora, 0);
AI_Countdown_Timer_Start(kActorDektora, 0, 10);
} else {
- Actor_Set_Goal_Number(kActorDektora, 211);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08Leave);
AI_Countdown_Timer_Reset(kActorDektora, 0);
}
return; //true;
}
- if (Actor_Query_Goal_Number(kActorDektora) == 270) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Burning) {
AI_Countdown_Timer_Reset(kActorDektora, 0);
- Actor_Set_Goal_Number(kActorDektora, 271);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningGoToMcCoy);
return; //true;
}
}
@@ -165,8 +166,8 @@ void AIScriptDektora::CompletedMovementTrack() {
}
break;
- case 260:
- Actor_Set_Goal_Number(kActorDektora, 290);
+ case kGoalDektoraNR11WalkAway:
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11RanAway);
break;
case 272:
@@ -191,19 +192,19 @@ void AIScriptDektora::ReceivedClue(int clueId, int fromActorId) {
}
void AIScriptDektora::ClickedByPlayer() {
- if (Actor_Query_Goal_Number(kActorDektora) == 599) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraDead) {
Actor_Face_Actor(0, kActorDektora, true);
Actor_Says(kActorMcCoy, 8630, 12);
return; //true;
}
- if (Actor_Query_Goal_Number(kActorDektora) < 199) {
+ if (Actor_Query_Goal_Number(kActorDektora) < kGoalDektoraStartChapter3) {
Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
Actor_Says(kActorMcCoy, 8590, 13);
}
- if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) {
Game_Flag_Set(kFlagNR08TouchedDektora);
AI_Movement_Track_Flush(kActorHanoi);
Actor_Force_Stop_Walking(kActorMcCoy);
@@ -222,7 +223,7 @@ void AIScriptDektora::EnteredScene(int sceneId) {
void AIScriptDektora::OtherAgentEnteredThisScene(int otherActorId) {
if (otherActorId == kActorMcCoy
- && Actor_Query_Goal_Number(kActorDektora) == 246
+ && Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08GoToNR10
) {
Scene_Exits_Disable();
Actor_Change_Animation_Mode(kActorDektora, 23);
@@ -245,29 +246,29 @@ void AIScriptDektora::ShotAtAndMissed() {
}
bool AIScriptDektora::ShotAtAndHit() {
- if (Actor_Query_Goal_Number(kActorDektora) == 270
- || Actor_Query_Goal_Number(kActorDektora) == 271
- || Actor_Query_Goal_Number(kActorDektora) == 272
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Burning
+ || Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11BurningGoToMcCoy
+ || Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11BurningGoToWindow
) {
Actor_Set_Health(kActorDektora, 100, 100);
- if (Actor_Query_Goal_Number(kActorDektora) != 272) {
- Actor_Set_Goal_Number(kActorDektora, 272);
+ if (Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraNR11BurningGoToWindow) {
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningGoToWindow);
}
return true;
}
- if (Actor_Query_Goal_Number(kActorDektora) == 260) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11WalkAway) {
AI_Movement_Track_Flush(kActorDektora);
Actor_Set_Health(kActorDektora, 0, 100);
- if (Game_Flag_Query(47)) {
- Actor_Change_Animation_Mode(kActorDektora, 48);
+ if (Game_Flag_Query(kFlagDektoraIsReplicant)) {
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeDie);
Actor_Start_Speech_Sample(kActorDektora, 980);
Delay(2000);
Actor_Set_Goal_Number(kActorSteele, 212);
} else {
- Actor_Change_Animation_Mode(kActorDektora, 48);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeDie);
Delay(2000);
Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested);
}
@@ -294,7 +295,7 @@ void AIScriptDektora::Retired(int byActorId) {
if (Actor_Query_In_Set(kActorDektora, kSetKP07)) {
Global_Variable_Decrement(kVariableReplicants, 1);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
if (Global_Variable_Query(kVariableReplicants) == 0) {
Player_Loses_Control();
@@ -311,8 +312,8 @@ void AIScriptDektora::Retired(int byActorId) {
}
}
- if (Actor_Query_Goal_Number(kActorDektora) != 274) {
- Actor_Set_Goal_Number(kActorDektora, 599);
+ if (Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraNR11FallThroughWindow) {
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
}
return; //false;
@@ -402,18 +403,18 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorDektora);
break;
- case 199:
+ case kGoalDektoraStartChapter3:
AI_Movement_Track_Flush(kActorDektora);
- Actor_Set_Goal_Number(kActorDektora, 200);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR07Sit);
break;
- case 200:
+ case kGoalDektoraNR07Sit:
Actor_Put_In_Set(kActorDektora, kSetNR07);
Actor_Set_At_XYZ(kActorDektora, -136.0f, -75.0f, 14.0f, 300);
- Actor_Change_Animation_Mode(kActorDektora, 53);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeSit);
break;
- case 210:
+ case kGoalDektoraNR08Dance:
AI_Movement_Track_Flush(kActorDektora);
Actor_Put_In_Set(kActorDektora, kSetNR05_NR08);
Actor_Set_At_XYZ(kActorDektora, -923.93f, 127.85f, 413.46f, 30);
@@ -421,41 +422,42 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Countdown_Timer_Start(kActorDektora, 0, 45);
break;
- case 211:
+ case kGoalDektoraNR08Leave:
if (Player_Query_Current_Scene() == kSceneNR08) {
- Game_Flag_Set(651);
+ Game_Flag_Set(kFlagNR08McCoyWatchingShow);
} else {
- Game_Flag_Set(636);
+ Game_Flag_Set(kFlagNR08Faded);
Actor_Put_In_Set(kActorDektora, kSetFreeSlotA);
Actor_Set_At_Waypoint(kActorDektora, 33, 0);
Actor_Change_Animation_Mode(kActorDektora, 0);
- Actor_Set_Goal_Number(kActorDektora, 200);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR07Sit);
}
+
if (Player_Query_Current_Scene() == kSceneNR08) {
Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR08Leave);
} else {
- Game_Flag_Reset(651);
+ Game_Flag_Reset(kFlagNR08McCoyWatchingShow);
}
break;
- case 245:
+ case kGoalDektoraNR08ReadyToRun:
Actor_Put_In_Set(kActorDektora, kSetNR05_NR08);
Actor_Set_At_XYZ(kActorDektora, -1558.41f, 0.32f, 319.48f, 264);
break;
- case 246:
+ case kGoalDektoraNR08GoToNR10:
Actor_Put_In_Set(kActorDektora, kSetNR10);
Actor_Set_At_XYZ(kActorDektora, 19.22f, 2.84f, -122.43f, 768);
break;
- case 247:
+ case kGoalDektoraNR10AttackMcCoy:
Actor_Set_At_XYZ(kActorDektora, -99.0f, 2.88f, -202.0f, 911);
- Actor_Set_Invisible(kActorDektora, 0);
+ Actor_Set_Invisible(kActorDektora, false);
Actor_Change_Animation_Mode(kActorDektora, 70);
- Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
+ Actor_Retired_Here(kActorMcCoy, 12, 12, true, -1);
break;
- case 250:
+ case kGoalDektoraNR11Hiding:
AI_Movement_Track_Flush(kActorDektora);
AI_Countdown_Timer_Reset(kActorDektora, 0);
AI_Countdown_Timer_Reset(kActorDektora, 1);
@@ -464,46 +466,46 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_XYZ(kActorDektora, -184.0f, 0.33f, -268.0f, 256);
break;
- case 260:
- Actor_Set_Targetable(kActorDektora, 1);
+ case kGoalDektoraNR11WalkAway:
+ Actor_Set_Targetable(kActorDektora, true);
Actor_Force_Stop_Walking(kActorDektora);
AI_Movement_Track_Flush(kActorDektora);
AI_Movement_Track_Append(kActorDektora, 462, 0);
AI_Movement_Track_Repeat(kActorDektora);
break;
- case 269:
- case 271:
- case 599:
+ case kGoalDektoraNR11PrepareBurning:
+ case kGoalDektoraNR11BurningGoToMcCoy:
+ case kGoalDektoraDead:
break; // return true
- case 270:
+ case kGoalDektoraNR11Burning:
Game_Flag_Set(633);
- Actor_Set_Targetable(kActorDektora, 1);
+ Actor_Set_Targetable(kActorDektora, true);
Loop_Actor_Walk_To_XYZ(kActorDektora, -135.0f, 0.33f, -267.0f, 0, 0, 0, 0);
- Actor_Face_Actor(kActorMcCoy, kActorDektora, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
if (Actor_Query_Goal_Number(kActorSteele) == 216) {
- Actor_Face_Actor(kActorSteele, kActorDektora, 1);
- Actor_Change_Animation_Mode(kActorSteele, 6);
+ Actor_Face_Actor(kActorSteele, kActorDektora, true);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Delay(250);
Sound_Play(3, 100, 0, 0, 50);
- Actor_Set_Goal_Number(kActorDektora, 272);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningGoToWindow);
} else {
- Actor_Set_Goal_Number(kActorDektora, 271);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningGoToMcCoy);
}
break;
- case 272:
+ case kGoalDektoraNR11BurningGoToWindow:
Actor_Force_Stop_Walking(kActorDektora);
AI_Movement_Track_Flush(kActorDektora);
AI_Movement_Track_Append(kActorDektora, 456, 0);
AI_Movement_Track_Repeat(kActorDektora);
break;
- case 274:
+ case kGoalDektoraNR11FallThroughWindow:
Player_Loses_Control();
Scene_Exits_Enable();
- Game_Flag_Set(632);
+ Game_Flag_Set(kFlagNR01DektoraFall);
Actor_Put_In_Set(kActorDektora, kSetNR01);
Actor_Set_At_XYZ(kActorDektora, -177.0f, 23.88f, -373.0f, 300);
_animationState = 36;
@@ -511,7 +513,7 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Set_Enter(kSetNR01, kSceneNR01);
break;
- case 279:
+ case kGoalDektoraNR11BurningFallToNR10:
Actor_Force_Stop_Walking(kActorDektora);
Actor_Put_In_Set(kActorDektora, kSetNR10);
Actor_Set_At_XYZ(kActorDektora, 14.0f, 2.84f, -300.0f, 926);
@@ -520,14 +522,14 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
_animationFrame = 0;
break;
- case 290:
+ case kGoalDektoraNR11RanAway:
Game_Flag_Set(kFlagDektoraRanAway);
break;
case 299:
Actor_Put_In_Set(kActorDektora, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorDektora, 41, 0);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
break;
case 300:
@@ -549,7 +551,7 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 0:
*animation = 156;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(156) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(156)) {
_animationFrame = 0;
}
break;
@@ -561,7 +563,9 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 2:
*animation = 158;
- if (!_animationFrame && _flag) {
+ if (_animationFrame == 0
+ && _flag
+ ) {
*animation = 156;
_animationState = 0;
} else {
@@ -717,23 +721,28 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
}
Sound_Play_Speech_Line(kActorDektora, speech, 75, 0, 99);
}
+
if (_animationFrame == 5) {
Actor_Combat_AI_Hit_Attempt(3);
}
+
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(141)) {
_animationFrame = 0;
_animationState = 9;
*animation = 134;
- Actor_Change_Animation_Mode(kActorDektora, 4);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeCombatIdle);
}
break;
case 17:
*animation = 142;
_animationFrame++;
- if (_animationFrame == 6 && Actor_Query_Goal_Number(kActorDektora) == 247) {
- Actor_Change_Animation_Mode(0, 48);
+ if (_animationFrame == 6
+ && Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR10AttackMcCoy
+ ) {
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
}
+
if (_animationFrame == 3) {
int speech;
@@ -744,14 +753,16 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
}
Sound_Play_Speech_Line(3, speech, 75, 0, 99);
}
+
if (_animationFrame == 6) {
Actor_Combat_AI_Hit_Attempt(3);
}
+
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(142)) {
_animationFrame = 0;
_animationState = 9;
*animation = 134;
- Actor_Change_Animation_Mode(kActorDektora, 4);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeCombatIdle);
}
break;
@@ -762,7 +773,7 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
*animation = 156;
_animationFrame = 0;
_animationState = 0;
- Actor_Change_Animation_Mode(kActorDektora, 0);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
break;
@@ -773,7 +784,7 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
*animation = 156;
_animationFrame = 0;
_animationState = 0;
- Actor_Change_Animation_Mode(kActorDektora, 0);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
break;
@@ -915,13 +926,14 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
*animation = 165;
_animationFrame++;
if (_animationFrame == 2) {
- Game_Flag_Set(659);
+ Game_Flag_Set(kFlagNR11BreakWindow);
}
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
_animationState = 36;
*animation = 167;
- Actor_Set_Goal_Number(kActorDektora, 273);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11PrepareFallThroughWindow);
}
break;
@@ -930,6 +942,7 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(167) - 1) {
_animationFrame++;
}
+
if (_animationFrame == 11) {
Ambient_Sounds_Play_Sound(206, 80, -20, -20, 20);
}
@@ -950,11 +963,9 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 2:
Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
break;
-
- default:
- break;
}
}
+
_animationFrame++;
if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(168) - 1) {
_animationFrame = 0;
@@ -979,11 +990,9 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 2:
Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
break;
-
- default:
- break;
}
}
+
if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
_animationFrame = 0;
_animationState = 39;
@@ -1007,11 +1016,9 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 2:
Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
break;
-
- default:
- break;
}
}
+
if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
_animationFrame = 0;
_animationState = 40;
@@ -1034,15 +1041,13 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 2:
Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
break;
-
- default:
- break;
}
}
+
if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(171) - 1) {
_animationFrame++;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(171) - 1) {
- Actor_Set_Goal_Number(kActorDektora, 211);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08Leave);
}
}
break;
@@ -1050,9 +1055,12 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
case 41:
*animation = 157;
_animationFrame++;
- if (_animationFrame == 8 && Actor_Query_In_Set(kActorDektora, kSetNR10)) {
+ if (_animationFrame == 8
+ && Actor_Query_In_Set(kActorDektora, kSetNR10)
+ ) {
Scene_Loop_Start_Special(2, 4, 1);
}
+
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(157)) {
*animation = 156;
_animationFrame = 0;
diff --git a/engines/bladerunner/script/ai/early_q.cpp b/engines/bladerunner/script/ai/early_q.cpp
index 093c51d7ac..39fbb9fa36 100644
--- a/engines/bladerunner/script/ai/early_q.cpp
+++ b/engines/bladerunner/script/ai/early_q.cpp
@@ -446,7 +446,7 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) {
if (Player_Query_Current_Scene() == kSceneNR05) {
Actor_Says(kActorEarlyQ, 670, kAnimationModeTalk);
Actor_Says(kActorEarlyQ, 690, kAnimationModeTalk);
- Actor_Set_Goal_Number(kActorDektora, 210);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08Dance);
Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR05UnlockNR08);
Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR08WatchShow);
} else {
diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp
index 3b3724492c..425100338f 100644
--- a/engines/bladerunner/script/ai/holloway.cpp
+++ b/engines/bladerunner/script/ai/holloway.cpp
@@ -177,9 +177,10 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Outtake_Play(kOuttakeInterrogation, 0, 1);
if (Global_Variable_Query(kVariableHollowayArrest) == 1) {
- Actor_Set_Goal_Number(kActorDektora, 245);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08ReadyToRun);
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
+
Player_Gains_Control();
Game_Flag_Set(kFlagMcCoyCapturedByHolloway);
Scene_Exits_Enable();
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 0a44af7ccd..04ac251e61 100644
--- a/engines/bladerunner/script/ai/lucy.cpp
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -136,20 +136,20 @@ void AIScriptLucy::CompletedMovementTrack() {
AI_Countdown_Timer_Start(kActorLucy, 0, 30);
break;
- case kGoalLucyRunOutPhase1:
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase2);
+ case kGoalLucyHF03RunOutPhase1:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunOutPhase2);
break;
- case kGoalLucyRunOutPhase2:
+ case kGoalLucyHF03RunOutPhase2:
Game_Flag_Set(kFlagLucyRanAway);
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoneChapter3);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RanAway);
break;
- case kGoalLucyRunToHF041:
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF042);
+ case kGoalLucyHF03RunToHF041:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunToHF042);
break;
- case kGoalLucyRunToHF042:
+ case kGoalLucyHF03RunToHF042:
if (Actor_Clue_Query(kActorLucy, kClueMcCoyHelpedLucy)
&& Global_Variable_Query(kVariableHollowayArrest) != 3
) {
@@ -160,11 +160,11 @@ void AIScriptLucy::CompletedMovementTrack() {
}
break;
- case kGoalLucyRunAwayWithHelp1:
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp2);
+ case kGoalLucyHF03RunAwayWithHelp1:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunAwayWithHelp2);
break;
- case kGoalLucyRunAwayWithHelp2:
+ case kGoalLucyHF03RunAwayWithHelp2:
Actor_Set_Goal_Number(kActorLucy, kGoalLucyWillReturnToHF03);
break;
@@ -314,14 +314,14 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunOutPhase1:
+ case kGoalLucyHF03RunOutPhase1:
Actor_Set_Immunity_To_Obstacles(kActorLucy, true);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 377, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunOutPhase2:
+ case kGoalLucyHF03RunOutPhase2:
Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 372, 0);
@@ -329,14 +329,14 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunToHF041:
+ case kGoalLucyHF03RunToHF041:
Actor_Set_Immunity_To_Obstacles(kActorLucy, true);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 378, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunToHF042:
+ case kGoalLucyHF03RunToHF042:
Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
@@ -344,7 +344,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunAwayWithHelp1:
+ case kGoalLucyHF03RunAwayWithHelp1:
Actor_Says(kActorLucy, 320, 16);
Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayGoToHF03);
Actor_Set_Immunity_To_Obstacles(kActorLucy, true);
@@ -353,7 +353,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case kGoalLucyRunAwayWithHelp2:
+ case kGoalLucyHF03RunAwayWithHelp2:
Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
@@ -473,7 +473,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyDead);
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02ConfrontLucy);
} else {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoneChapter3);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RanAway);
Game_Flag_Set(kFlagLucyRanAway);
}
break;
diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp
index a0a122e116..a6277e9ef4 100644
--- a/engines/bladerunner/script/ai/mccoy.cpp
+++ b/engines/bladerunner/script/ai/mccoy.cpp
@@ -269,26 +269,45 @@ bool AIScriptMcCoy::ShotAtAndHit() {
void AIScriptMcCoy::Retired(int byActorId) {
if (byActorId == kActorSteele && Actor_Query_In_Set(kActorSteele, kSetHF06)) {
- if (Actor_Query_In_Set(kActorDektora, kSetHF06) && Actor_Query_Goal_Number(kActorDektora) != 599) {
+ if (Actor_Query_In_Set(kActorDektora, kSetHF06)
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead) {
Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorDektora, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
- } else if (Actor_Query_In_Set(kActorLucy, kSetHF06) && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead) {
+ } else if (Actor_Query_In_Set(kActorLucy, kSetHF06)
+ && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorLucy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
}
- if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) {
+ if (Actor_Query_In_Set(kActorMcCoy, kSetHF05)
+ && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05)
+ && Actor_Query_In_Set(kActorDektora, kSetHF05)
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
- if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) {
+ if (Actor_Query_In_Set(kActorMcCoy, kSetHF05)
+ && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05)
+ && Actor_Query_In_Set(kActorDektora, kSetHF05)
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
- if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead) {
+ if (Actor_Query_In_Set(kActorMcCoy, kSetHF05)
+ && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05)
+ && Actor_Query_In_Set(kActorLucy, kSetHF05)
+ && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
- if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead) {
+ if (Actor_Query_In_Set(kActorMcCoy, kSetHF05)
+ && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05)
+ && Actor_Query_In_Set(kActorLucy, kSetHF05)
+ && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyDead
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
}
@@ -1048,7 +1067,10 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
case 21:
*animation = 12;
_animationFrame++;
- if (_animationFrame == 1 && Actor_Query_Goal_Number(kActorMcCoy) == 230 && dword_45A0FC == 1) {
+ if (_animationFrame == 1
+ && Actor_Query_Goal_Number(kActorMcCoy) == 230
+ && dword_45A0FC == 1
+ ) {
dword_45A0F8 = 27;
}
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(12)) {
diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp
index 302ba9371b..1bcede6dc9 100644
--- a/engines/bladerunner/script/ai/steele.cpp
+++ b/engines/bladerunner/script/ai/steele.cpp
@@ -903,7 +903,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorMcCoy, 3835, 18);
Actor_Says(kActorSteele, 1810, 16);
Game_Flag_Set(kFlagDektoraRanAway);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
Actor_Set_Goal_Number(kActorSteele, 275);
break;
case 274:
@@ -916,13 +916,13 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorSteele, 1780, 15);
Actor_Says(kActorMcCoy, 3825, 14);
Game_Flag_Set(kFlagDektoraRanAway);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
Actor_Set_Goal_Number(kActorSteele, 275);
}
return true;
case 215:
- Game_Flag_Set(635);
+ Game_Flag_Set(kFlagNR11SteeleShoot);
Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Scene_Exits_Disable();
return true;
@@ -937,7 +937,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Flush(kActorSteele);
Actor_Put_In_Set(kActorSteele, kSetNR05_NR08);
Actor_Set_At_XYZ(kActorSteele, -1034.09f, 0.32f, 224.77f, 440);
- Game_Flag_Set(722);
+ Game_Flag_Set(kFlagChapter4Starting);
Set_Enter(kSetNR05_NR08, kSceneNR08);
return true;
@@ -1298,7 +1298,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case kGoalSteeleHF01StartChapter4:
- Game_Flag_Set(722);
+ Game_Flag_Set(kFlagChapter4Starting);
Global_Variable_Set(kVariableChapter, 4);
Scene_Exits_Enable();
Game_Flag_Set(523);
diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp
index a91f55b7ec..b466794b20 100644
--- a/engines/bladerunner/script/scene/hf01.cpp
+++ b/engines/bladerunner/script/scene/hf01.cpp
@@ -351,7 +351,7 @@ void SceneScriptHF01::PlayerWalkedIn() {
Actor_Set_Targetable(kActorLucy, true);
} else if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1)
&& Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
Actor_Put_In_Set(kActorDektora, kSetHF01);
Actor_Set_At_XYZ(kActorDektora, -5.0f, 8.0f, -622.0f, 419);
@@ -409,14 +409,14 @@ void SceneScriptHF01::PlayerWalkedOut() {
if (!Game_Flag_Query(kFlagHF01toHF05)
&& !Game_Flag_Query(kFlagHF01toHF02)
&& !Game_Flag_Query(kFlagHF01toHF03)
- && !Game_Flag_Query(722)
+ && !Game_Flag_Query(kFlagChapter4Starting)
) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeInside2, true, -1);
Outtake_Play(kOuttakeTowards3, true, -1);
}
- Game_Flag_Reset(722);
+ Game_Flag_Reset(kFlagChapter4Starting);
if (Actor_Query_Goal_Number(kActorLucy) == 450) {
Actor_Put_In_Set(kActorLucy, kSetFreeSlotG);
@@ -427,7 +427,7 @@ void SceneScriptHF01::PlayerWalkedOut() {
if (Actor_Query_Goal_Number(kActorDektora) == 450) {
Actor_Put_In_Set(kActorDektora, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorDektora, 39, 0);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
}
}
diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp
index 4e1177ffd1..2201bbafa3 100644
--- a/engines/bladerunner/script/scene/hf03.cpp
+++ b/engines/bladerunner/script/scene/hf03.cpp
@@ -79,11 +79,11 @@ void SceneScriptHF03::dialogueWithLucy() {
case 840: // VOIGT-KAMPFF
Actor_Says(kActorMcCoy, 1630, 15);
if (Global_Variable_Query(kVariableHollowayArrest) == 3) {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp1);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunAwayWithHelp1);
} else if (Game_Flag_Query(kFlagLucyIsReplicant)) {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunToHF041);
} else {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase1);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunOutPhase1);
Game_Flag_Set(kFlagLucyRanAway);
}
break;
@@ -97,7 +97,7 @@ void SceneScriptHF03::dialogueWithLucy() {
case 860: // CRYSTAL
Actor_Says(kActorMcCoy, 1640, 12);
if (Global_Variable_Query(kVariableHollowayArrest) == 3) {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp1);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunAwayWithHelp1);
} else {
Actor_Says(kActorLucy, 210, 13);
Actor_Says(kActorMcCoy, 1655, 15);
@@ -130,9 +130,9 @@ void SceneScriptHF03::dialogueWithLucy() {
Actor_Clue_Acquire(kActorLucy, kClueMcCoyHelpedLucy, true, kActorMcCoy);
if (Game_Flag_Query(kFlagLucyIsReplicant)) {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunToHF041);
} else {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase1);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunOutPhase1);
}
}
break;
@@ -250,7 +250,7 @@ void SceneScriptHF03::PlayerWalkedIn() {
}
if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyReturnToHF03) {
- Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF03RunToHF041);
Actor_Says(kActorSteele, 210, 13);
Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 1680, 15);
diff --git a/engines/bladerunner/script/scene/hf04.cpp b/engines/bladerunner/script/scene/hf04.cpp
index 6d30563cc2..4fb4432b0d 100644
--- a/engines/bladerunner/script/scene/hf04.cpp
+++ b/engines/bladerunner/script/scene/hf04.cpp
@@ -63,7 +63,7 @@ void SceneScriptHF04::SceneLoaded() {
Unobstacle_Object("HIDE_WALL_B", true);
}
- if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyRunToHF042) {
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF03RunToHF042) {
if (Actor_Clue_Query(kActorLucy, kClueMcCoyHelpedLucy)
&& Global_Variable_Query(kVariableHollowayArrest) != 3
) {
diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp
index c78bf71ab2..3f94212b59 100644
--- a/engines/bladerunner/script/scene/hf05.cpp
+++ b/engines/bladerunner/script/scene/hf05.cpp
@@ -560,7 +560,7 @@ void SceneScriptHF05::dialogueWithCrazylegs2() { // cut feature? it is impossibl
int SceneScriptHF05::getAffectionTowardsActor() {
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
return kActorDektora;
}
@@ -744,7 +744,7 @@ void SceneScriptHF05::addAmbientSounds() {
int SceneScriptHF05::sub_4048C0() {
if (Actor_Query_In_Set(kActorDektora, kSetHF05)
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
return kActorDektora;
}
diff --git a/engines/bladerunner/script/scene/hf06.cpp b/engines/bladerunner/script/scene/hf06.cpp
index 7b5fd44b4a..c89d82bcd7 100644
--- a/engines/bladerunner/script/scene/hf06.cpp
+++ b/engines/bladerunner/script/scene/hf06.cpp
@@ -71,7 +71,7 @@ bool SceneScriptHF06::ClickedOn3DObject(const char *objectName, bool a2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 14.33f, 367.93f, 399.0f, 0, true, false, 0)) {
Actor_Face_Heading(kActorMcCoy, 486, true);
if (Actor_Query_In_Set(kActorDektora, kSetHF06)
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
Actor_Face_Actor(kActorDektora, kActorMcCoy, true);
Actor_Says(kActorDektora, 210, 12);
@@ -120,7 +120,7 @@ bool SceneScriptHF06::ClickedOnActor(int actorId) {
Actor_Says(kActorMcCoy, 2115, 17);
}
} else if (actorId == kActorDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
Actor_Face_Actor(kActorDektora, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
@@ -171,7 +171,7 @@ void SceneScriptHF06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
int otherActorId = -1;
if (Actor_Query_In_Set(kActorDektora, kSetHF06)
- && Actor_Query_Goal_Number(kActorDektora) == 599
+ && Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraDead
) {
otherActorId = kActorDektora;
} else if (Actor_Query_In_Set(kActorLucy, kSetHF06)
@@ -215,7 +215,7 @@ void SceneScriptHF06::PlayerWalkedIn() {
) {
actorId = kActorLucy;
} else if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
actorId = kActorDektora;
}
diff --git a/engines/bladerunner/script/scene/hf07.cpp b/engines/bladerunner/script/scene/hf07.cpp
index 8a8f4eb19a..12593ed4ba 100644
--- a/engines/bladerunner/script/scene/hf07.cpp
+++ b/engines/bladerunner/script/scene/hf07.cpp
@@ -143,7 +143,7 @@ void SceneScriptHF07::DialogueQueueFlushed(int a1) {
int SceneScriptHF07::getAffectionTowardsActor() {
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
return kActorDektora;
}
diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp
index 56b9a91b4e..972a18b7d4 100644
--- a/engines/bladerunner/script/scene/kp07.cpp
+++ b/engines/bladerunner/script/scene/kp07.cpp
@@ -30,7 +30,7 @@ void SceneScriptKP07::InitializeScene() {
Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0);
if (Game_Flag_Query(653)) {
if (Game_Flag_Query(kFlagDektoraIsReplicant)
- && Actor_Query_Goal_Number(kActorDektora) < 599
+ && Actor_Query_Goal_Number(kActorDektora) < kGoalDektoraDead
) {
Actor_Set_Targetable(kActorDektora, true);
Global_Variable_Increment(kVariableReplicants, 1);
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index a14c9e75db..6c619aca3e 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -34,7 +34,7 @@ enum kNR01Loops {
void SceneScriptNR01::InitializeScene() {
if (Game_Flag_Query(kFlagSpinnerMissing)) {
Setup_Scene_Information(-153.86f, 23.88f, -570.21f, 402);
- } else if (Game_Flag_Query(632)) {
+ } else if (Game_Flag_Query(kFlagNR01DektoraFall)) {
Setup_Scene_Information( -416.0f, 31.93f, -841.0f, 200);
Actor_Set_Invisible(kActorMcCoy, true);
Preload(167);
@@ -330,7 +330,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
return;
}
- if (Game_Flag_Query(632)) {
+ if (Game_Flag_Query(kFlagNR01DektoraFall)) {
Delay(3500);
Set_Enter(kSetNR11, kSceneNR11);
//return true;
@@ -451,15 +451,15 @@ void SceneScriptNR01::PlayerWalkedOut() {
if (!Game_Flag_Query(kFlagNR01toUG06)
&& !Game_Flag_Query(kFlagNR01toNR02)
&& !Game_Flag_Query(kFlagNR01toNR03)
- && !Game_Flag_Query(632)
- && !Game_Flag_Query(722)
+ && !Game_Flag_Query(kFlagNR01DektoraFall)
+ && !Game_Flag_Query(kFlagChapter4Starting)
) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeAway1, true, -1);
Outtake_Play(kOuttakeInside2, true, -1);
}
- Game_Flag_Reset(722);
+ Game_Flag_Reset(kFlagChapter4Starting);
}
void SceneScriptNR01::DialogueQueueFlushed(int a1) {
diff --git a/engines/bladerunner/script/scene/nr04.cpp b/engines/bladerunner/script/scene/nr04.cpp
index 0d90781597..03809d9d47 100644
--- a/engines/bladerunner/script/scene/nr04.cpp
+++ b/engines/bladerunner/script/scene/nr04.cpp
@@ -60,7 +60,7 @@ void SceneScriptNR04::SceneLoaded() {
Clickable_Object("B.TV03");
Clickable_Object("B.TV05");
Clickable_Object("DESK");
- if (!Game_Flag_Query(605)) {
+ if (!Game_Flag_Query(kFlagNR04DiscFound)) {
Clickable_Object("TORUS01");
}
Clickable_Object("BOX12");
diff --git a/engines/bladerunner/script/scene/nr07.cpp b/engines/bladerunner/script/scene/nr07.cpp
index 0b23d61b02..6fbebd22ff 100644
--- a/engines/bladerunner/script/scene/nr07.cpp
+++ b/engines/bladerunner/script/scene/nr07.cpp
@@ -198,9 +198,9 @@ void SceneScriptNR07::dektoraRunAway() {
Loop_Actor_Walk_To_XYZ(kActorDektora, -102.0f, -73.5f, -233.0f, 0, false, true, 0);
if (Game_Flag_Query(kFlagDektoraIsReplicant)) {
- Actor_Set_Goal_Number(kActorDektora, 245);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08ReadyToRun);
} else {
- Actor_Set_Goal_Number(kActorDektora, 295);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR07RanAway);
Game_Flag_Set(kFlagDektoraRanAway);
Actor_Put_In_Set(kActorDektora, kSetFreeSlotA);
Actor_Set_At_Waypoint(kActorDektora, 33, 0);
diff --git a/engines/bladerunner/script/scene/nr08.cpp b/engines/bladerunner/script/scene/nr08.cpp
index dd4c0e9f13..7070e4d190 100644
--- a/engines/bladerunner/script/scene/nr08.cpp
+++ b/engines/bladerunner/script/scene/nr08.cpp
@@ -24,14 +24,20 @@
namespace BladeRunner {
+enum kNR08Loops {
+ kNR08LoopPanFromNR05 = 0,
+ kNR08LoopMainLoop = 1,
+ kNR08LoopFadeLoop = 3
+};
+
void SceneScriptNR08::InitializeScene() {
if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01GoToNR08) {
Setup_Scene_Information(-1174.1f, 0.32f, 303.9f, 435);
} else if (Game_Flag_Query(kFlagNR05toNR08)) {
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR08LoopPanFromNR05, false);
+ Scene_Loop_Set_Default(kNR08LoopMainLoop);
Setup_Scene_Information(-1102.88f, 0.0f, 107.43f, 0);
- if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) {
Music_Stop(1);
}
} else if (Game_Flag_Query(kFlagNR06toNR08)) {
@@ -43,7 +49,7 @@ void SceneScriptNR08::InitializeScene() {
}
Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1);
- if (Actor_Query_Goal_Number(kActorDektora) != 210) {
+ if (Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraNR08Dance) {
Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3);
Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0);
}
@@ -69,13 +75,13 @@ void SceneScriptNR08::InitializeScene() {
Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kNR08LoopMainLoop);
}
void SceneScriptNR08::SceneLoaded() {
Obstacle_Object("BOX283", true);
Unobstacle_Object("BOX283", true);
- if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) {
Actor_Change_Animation_Mode(kActorDektora, 79);
}
}
@@ -160,18 +166,20 @@ void SceneScriptNR08::SceneFrameAdvanced(int frame) {
Set_Fade_Density(0.0f);
}
- if (Game_Flag_Query(651) && !Game_Flag_Query(636)) {
- Game_Flag_Set(636);
+ if ( Game_Flag_Query(kFlagNR08McCoyWatchingShow)
+ && !Game_Flag_Query(kFlagNR08Faded)
+ ) {
+ Game_Flag_Set(kFlagNR08Faded);
Scene_Exits_Disable();
- Scene_Loop_Set_Default(1);
- Scene_Loop_Start_Special(kSceneLoopModeOnce, 3, true);
+ Scene_Loop_Set_Default(kNR08LoopMainLoop);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kNR08LoopFadeLoop, true);
}
if (frame == 95) {
Actor_Put_In_Set(kActorDektora, kSetFreeSlotA);
Actor_Set_At_Waypoint(kActorDektora, 33, 0);
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
- Actor_Set_Goal_Number(kActorDektora, 200);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR07Sit);
Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3);
Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0);
}
@@ -186,7 +194,7 @@ void SceneScriptNR08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptNR08::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorDektora) == 210
+ if ( Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance
&& !Game_Flag_Query(kFlagNR08DektoraShow)
) {
Game_Flag_Set(kFlagNR08DektoraShow);
@@ -196,10 +204,10 @@ void SceneScriptNR08::PlayerWalkedIn() {
Music_Adjust(51, 0, 2);
}
- if (Actor_Query_Goal_Number(kActorDektora) == 245) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08ReadyToRun) {
Actor_Face_Heading(kActorDektora, 790, false);
- Loop_Actor_Travel_Stairs(kActorDektora, 8, 1, kAnimationModeIdle);
- Actor_Set_Goal_Number(kActorDektora, 246);
+ Loop_Actor_Travel_Stairs(kActorDektora, 8, true, kAnimationModeIdle);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08GoToNR10);
}
if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01GoToNR08) {
@@ -238,7 +246,7 @@ void SceneScriptNR08::DialogueQueueFlushed(int a1) {
void SceneScriptNR08::playNextMusic() {
if (Music_Is_Playing()) {
Music_Adjust(51, 0, 2);
- } else if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+ } else if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) {
Music_Play(6, 61, 0, 1, -1, 0, 0);
} else {
int track = Global_Variable_Query(kVariableEarlyQBackMusic);
diff --git a/engines/bladerunner/script/scene/nr09.cpp b/engines/bladerunner/script/scene/nr09.cpp
index 233f58b262..df816c1901 100644
--- a/engines/bladerunner/script/scene/nr09.cpp
+++ b/engines/bladerunner/script/scene/nr09.cpp
@@ -26,13 +26,13 @@ namespace BladeRunner {
void SceneScriptNR09::InitializeScene() {
if (Game_Flag_Query(kFlagNR10toNR09)) {
- if (!Game_Flag_Query(640)) {
+ if (!Game_Flag_Query(kFlagNR10CameraDestroyed)) {
Ambient_Sounds_Adjust_Looping_Sound(452, 22, 100, 2);
}
Game_Flag_Reset(kFlagNR10toNR09);
Setup_Scene_Information(-556.07f, 0.35f, 399.04f, 440);
} else {
- if (!Game_Flag_Query(640)) {
+ if (!Game_Flag_Query(kFlagNR10CameraDestroyed)) {
Ambient_Sounds_Add_Looping_Sound(452, 22, 100, 1);
}
Setup_Scene_Information(-704.07f, 0.35f, 663.04f, 0);
diff --git a/engines/bladerunner/script/scene/nr10.cpp b/engines/bladerunner/script/scene/nr10.cpp
index e2a1df8773..3f745bbe8c 100644
--- a/engines/bladerunner/script/scene/nr10.cpp
+++ b/engines/bladerunner/script/scene/nr10.cpp
@@ -22,6 +22,8 @@
#include "bladerunner/script/scene_script.h"
+#include "common/debug.h"
+
namespace BladeRunner {
void SceneScriptNR10::InitializeScene() {
@@ -34,10 +36,10 @@ void SceneScriptNR10::InitializeScene() {
}
Scene_Exit_Add_2D_Exit(0, 144, 163, 194, 318, 3);
- Scene_Exit_Add_2D_Exit(1, 475, 95, 568, 230, 0);
+ Scene_Exit_Add_2D_Exit(1, 475, 95, 568, 230, 0);
Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1);
+ Ambient_Sounds_Add_Looping_Sound( 71, 33, 0, 1);
Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
@@ -45,7 +47,7 @@ void SceneScriptNR10::InitializeScene() {
Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
- if (Game_Flag_Query(640)) {
+ if (Game_Flag_Query(kFlagNR10CameraDestroyed)) {
Scene_Loop_Set_Default(0);
} else {
Ambient_Sounds_Adjust_Looping_Sound(452, 31, 0, 1);
@@ -61,17 +63,17 @@ void SceneScriptNR10::SceneLoaded() {
}
bool SceneScriptNR10::MouseClick(int x, int y) {
- return Game_Flag_Query(642);
+ return Game_Flag_Query(kFlagNR10McCoyBlinded);
}
bool SceneScriptNR10::ClickedOn3DObject(const char *objectName, bool combatMode) {
if (Object_Query_Click("BOX18", objectName)
&& combatMode
- && Game_Flag_Query(642)
+ && Game_Flag_Query(kFlagNR10McCoyBlinded)
) {
- Actor_Set_Goal_Number(kActorDektora, 250);
- Game_Flag_Set(640);
- Game_Flag_Reset(642);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11Hiding);
+ Game_Flag_Set(kFlagNR10CameraDestroyed);
+ Game_Flag_Reset(kFlagNR10McCoyBlinded);
Actor_Set_Invisible(kActorMcCoy, false);
Actor_Set_Invisible(kActorDektora, false);
Ambient_Sounds_Remove_Looping_Sound(452, true);
@@ -119,8 +121,10 @@ bool SceneScriptNR10::ClickedOn2DRegion(int region) {
}
void SceneScriptNR10::SceneFrameAdvanced(int frame) {
+ debug("%i", frame);
+
if (frame == 122) {
- Game_Flag_Set(642);
+ Game_Flag_Set(kFlagNR10McCoyBlinded);
Actor_Set_Invisible(kActorMcCoy, true);
Actor_Set_Invisible(kActorDektora, true);
Combat_Target_Object("BOX18");
@@ -129,12 +133,12 @@ void SceneScriptNR10::SceneFrameAdvanced(int frame) {
}
if (frame == 61
- && Game_Flag_Query(642)
+ && Game_Flag_Query(kFlagNR10McCoyBlinded)
) {
- Game_Flag_Reset(642);
+ Game_Flag_Reset(kFlagNR10McCoyBlinded);
Player_Set_Combat_Mode(false);
Actor_Set_Invisible(kActorMcCoy, false);
- Actor_Set_Goal_Number(kActorDektora, 247);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR10AttackMcCoy);
//return true;
return;
}
@@ -145,7 +149,7 @@ void SceneScriptNR10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptNR10::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorDektora) == 246) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08GoToNR10) {
Player_Set_Combat_Mode(true);
//return true;
return;
diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp
index fca1d661ed..d0d3ff1867 100644
--- a/engines/bladerunner/script/scene/nr11.cpp
+++ b/engines/bladerunner/script/scene/nr11.cpp
@@ -24,12 +24,19 @@
namespace BladeRunner {
+enum kNR11Loops {
+ kNR11LoopMainLoop = 0,
+ kNR11LoopGunshots = 2,
+ kNR11LoopMainLoopFires = 3,
+ kNR11LoopMainLoopBurnedUp = 5
+};
+
void SceneScriptNR11::InitializeScene() {
Setup_Scene_Information(100.0f, 1.75f, -4.0f, 0);
Scene_Exit_Add_2D_Exit(0, 450, 305, 565, 345, 2);
- if (!Game_Flag_Query(640)) {
+ if (!Game_Flag_Query(kFlagNR10CameraDestroyed)) {
Ambient_Sounds_Adjust_Looping_Sound(452, 22, 0, 1);
}
@@ -42,14 +49,14 @@ void SceneScriptNR11::InitializeScene() {
Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0);
- if (Game_Flag_Query(632)) {
- Scene_Loop_Set_Default(3);
+ if (Game_Flag_Query(kFlagNR01DektoraFall)) {
+ Scene_Loop_Set_Default(kNR11LoopMainLoopFires);
Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1);
- } else if (Game_Flag_Query(634)) {
- Scene_Loop_Set_Default(5);
+ } else if (Game_Flag_Query(kFlagNR11BurnedUp)) {
+ Scene_Loop_Set_Default(kNR11LoopMainLoopBurnedUp);
Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1);
} else {
- Scene_Loop_Set_Default(0);
+ Scene_Loop_Set_Default(kNR11LoopMainLoop);
Overlay_Play("NR11OVER", 0, true, false, 0);
}
}
@@ -59,7 +66,7 @@ void SceneScriptNR11::SceneLoaded() {
Unobstacle_Object("BOX13", true);
Clickable_Object("LOFT04");
Unclickable_Object("LOFT04");
- if (Actor_Query_Goal_Number(kActorDektora) == 250) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Hiding) {
Clickable_Object("CLOTHING02");
Clickable_Object("BOX27");
Clickable_Object("BOX39");
@@ -140,35 +147,37 @@ bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool combatMode)
Player_Set_Combat_Mode(true);
}
Actor_Set_Goal_Number(kActorMcCoy, 230);
- Scene_Loop_Set_Default(3);
- Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, true);
- } else if (Actor_Query_Goal_Number(kActorDektora) == 250) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 24.0f, 0.33f, 0.0f, 0, 1, false, 0)) {
+ Scene_Loop_Set_Default(kNR11LoopMainLoopFires);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kNR11LoopGunshots, true);
+ } else if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Hiding) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 24.0f, 0.33f, 0.0f, 0, true, false, 0)) {
Actor_Face_XYZ(kActorMcCoy, -180.0f, 0.0f, -170.0f, true);
untargetEverything();
Actor_Set_Goal_Number(kActorSteele, 211);
if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) < 30) {
Actor_Set_At_XYZ(kActorDektora, 0.5f, 0.33f, -162.0f, 0);
- Loop_Actor_Walk_To_XYZ(kActorDektora, -24.0f, 0.33f, -35.4f, 0, 0, true, 0);
+ Loop_Actor_Walk_To_XYZ(kActorDektora, -24.0f, 0.33f, -35.4f, 0, false, true, 0);
Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
Actor_Change_Animation_Mode(kActorDektora, 71);
Delay(500);
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Delay(2000);
Actor_Set_Goal_Number(kActorMcCoy, 231);
} else {
Actor_Says(kActorMcCoy, 3840, 18);
Delay(1000);
- if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 59 && Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsNone) {
+ if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 59
+ && Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsNone
+ ) {
Music_Play(21, 35, 0, 3, -1, 0, 0);
}
- Loop_Actor_Walk_To_XYZ(kActorDektora, -135.0f, 0.33f, -267.0f, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorDektora, -135.0f, 0.33f, -267.0f, 0, false, false, 0);
Actor_Face_Actor(kActorDektora, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
Actor_Clue_Acquire(kActorMcCoy, kClueDektoraInterview4, true, kActorDektora);
Actor_Says(kActorDektora, 990, 13);
Actor_Says(kActorDektora, 1000, 14);
- Loop_Actor_Walk_To_Actor(kActorDektora, kActorMcCoy, 108, 0, false);
+ Loop_Actor_Walk_To_Actor(kActorDektora, kActorMcCoy, 108, false, false);
Actor_Says(kActorMcCoy, 3845, 13);
Actor_Says(kActorMcCoy, 3850, 15);
Actor_Says(kActorDektora, 1010, 14);
@@ -198,7 +207,7 @@ bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool combatMode)
Actor_Says(kActorMcCoy, 3875, 14);
Actor_Says(kActorDektora, 1090, 17);
Music_Stop(4);
- Actor_Set_Goal_Number(kActorDektora, 260);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11WalkAway);
if (Global_Variable_Query(kVariableHollowayArrest) == 1) {
Actor_Set_Goal_Number(kActorSteele, 236);
}
@@ -277,38 +286,40 @@ void SceneScriptNR11::SceneFrameAdvanced(int frame) {
Ambient_Sounds_Play_Sound(122, 80, 100, 100, 15);
}
- if (Game_Flag_Query(659)) {
- Game_Flag_Reset(659);
+ if (Game_Flag_Query(kFlagNR11BreakWindow)) {
+ Game_Flag_Reset(kFlagNR11BreakWindow);
Overlay_Remove("NR11OVER");
- Overlay_Play("NR11OVER", 1, 0, 1, 0);
+ Overlay_Play("NR11OVER", 1, false, true, 0);
}
- if (Game_Flag_Query(635)) {
+ if (Game_Flag_Query(kFlagNR11SteeleShoot)) {
untargetEverything();
Player_Loses_Control();
if (!Player_Query_Combat_Mode()) {
Player_Set_Combat_Mode(true);
}
Actor_Set_Goal_Number(kActorMcCoy, 230);
- Scene_Loop_Set_Default(3);
- Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, true);
- Game_Flag_Reset(635);
+ Scene_Loop_Set_Default(kNR11LoopMainLoopFires);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kNR11LoopGunshots, true);
+ Game_Flag_Reset(kFlagNR11SteeleShoot);
} else {
- if (frame < 61 || frame > 120) {
+ if (frame < 61
+ || frame > 120
+ ) {
//return false;
return;
}
- sub_4027D0(0, frame);
+ actorSweepArea(kActorMcCoy, frame);
if (Actor_Query_Goal_Number(kActorSteele) == 215) {
- sub_4027D0(1, frame);
+ actorSweepArea(kActorSteele, frame);
}
if (frame == 120) {
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
Player_Gains_Control();
if (Actor_Query_Goal_Number(kActorSteele) == 215) {
Actor_Set_Goal_Number(kActorSteele, 216);
}
- Actor_Set_Goal_Number(kActorDektora, 269);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11PrepareBurning);
}
}
//return true;
@@ -318,15 +329,16 @@ void SceneScriptNR11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptNR11::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorDektora) == 250) {
+ if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Hiding) {
Player_Set_Combat_Mode(true);
if (Game_Flag_Query(kFlagDektoraIsReplicant)) {
Actor_Set_Goal_Number(kActorSteele, 210);
}
}
- if (Game_Flag_Query(632)) {
- Game_Flag_Reset(632);
- Game_Flag_Set(634);
+
+ if (Game_Flag_Query(kFlagNR01DektoraFall)) {
+ Game_Flag_Reset(kFlagNR01DektoraFall);
+ Game_Flag_Set(kFlagNR11BurnedUp);
Actor_Put_In_Set(kActorDektora, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorDektora, 41, 0);
Actor_Set_Invisible(kActorMcCoy, false);
@@ -353,7 +365,7 @@ void SceneScriptNR11::PlayerWalkedIn() {
Actor_Says(kActorMcCoy, 3810, 16);
Actor_Says_With_Pause(kActorSteele, 1730, 0.2f, 14);
Actor_Says(kActorSteele, 1740, 15);
- Actor_Set_Goal_Number(kActorDektora, 599);
+ Actor_Set_Goal_Number(kActorDektora, kGoalDektoraDead);
Actor_Put_In_Set(kActorDektora, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorDektora, 41, 0);
Actor_Set_Goal_Number(kActorSteele, 275);
@@ -372,7 +384,7 @@ void SceneScriptNR11::PlayerWalkedOut() {
void SceneScriptNR11::DialogueQueueFlushed(int a1) {
}
-void SceneScriptNR11::sub_4027D0(int actorId, signed int frame) {
+void SceneScriptNR11::actorSweepArea(int actorId, signed int frame) {
float x;
float y;
float z;
diff --git a/engines/bladerunner/script/scene/ug05.cpp b/engines/bladerunner/script/scene/ug05.cpp
index 8bcb839681..f107699940 100644
--- a/engines/bladerunner/script/scene/ug05.cpp
+++ b/engines/bladerunner/script/scene/ug05.cpp
@@ -227,7 +227,7 @@ void SceneScriptUG05::DialogueQueueFlushed(int a1) {
int SceneScriptUG05::getAffectionTowardsActor() {
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora
- && Actor_Query_Goal_Number(kActorDektora) != 599
+ && Actor_Query_Goal_Number(kActorDektora) != kGoalDektoraDead
) {
return kActorDektora;
}
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index 0767fee704..f866935823 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -349,7 +349,7 @@ DECLARE_SCRIPT(NR10)
END_SCRIPT
DECLARE_SCRIPT(NR11)
- void sub_4027D0(int actorId, signed int frame);
+ void actorSweepArea(int actorId, signed int frame);
void untargetEverything();
END_SCRIPT