[Scummvm-git-logs] scummvm master -> 24bc52c277e8ae7b206c786d023d81ae9b15a6d7
peterkohaut
peterkohaut at users.noreply.github.com
Sun Jan 27 11:49:26 CET 2019
This automated email contains information about 11 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8b849d282f BLADERUNNER: Cleanup of Gaff script for chapter 1 & 2
f4c5a557ac BLADERUNNER: Hawker's circle script cleanup
783f0554ed BLADERUNNER: Cleanup of Steele scripts for chapter 1
ace4904d39 BLADERUNNER: Cleanup of Guzza script for chapter 2
1ca97137ad BLADERUNNER: Fixed wrongly clickable news in DR02
bc7713e040 BLADERUNNER: Cleanup of Police station scripts for chapter 1 & 2
2cf1d2e3f1 BLADERUNNER: Initial cleanup of HF01 & related actors
2bea230711 BLADERUNNER: Initial cleanup of HF02 & HF03
de1dabd072 BLADERUNNER: Cleanup & fix of Lucy chase scripts
d3f456a328 BLADERUNNER: Implement CD switching in outtake player
24bc52c277 BLADERUNNER: Cleanup of Steele scripts for Lucy chase
Commit: 8b849d282f05d5ae3264a7f5bad4cb8f865499a8
https://github.com/scummvm/scummvm/commit/8b849d282f05d5ae3264a7f5bad4cb8f865499a8
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Cleanup of Gaff script for chapter 1 & 2
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/gaff.cpp
engines/bladerunner/script/ai/zuben.cpp
engines/bladerunner/script/scene/ct05.cpp
engines/bladerunner/script/scene/ct12.cpp
engines/bladerunner/script/scene/ma01.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index b2c5beb..55c5e44 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -843,6 +843,7 @@ enum Flags {
kFlagUnused406 = 406, // is never checked
kFlagUnused407 = 407, // is never checked
+ kFlagMA01GaffApproachMcCoy = 409,
kFlagBB06AndroidDestroyed = 410,
kFlagUG09toCT12 = 432,
@@ -866,6 +867,7 @@ enum Flags {
kFlagBB10Shelf3Available = 468,
kFlagBB10Shelf4Available = 469,
kFlagBB10Shelf5Available = 470,
+ kFlagGaffChapter2Started = 471,
kFlagUG10GateOpen = 474,
kFlagMcCoyAtPS03 = 478, // has no use
kFlagMcCoyInHawkersCircle = 479,
@@ -1636,6 +1638,19 @@ enum GoalMoraji {
kGoalMorajiPerished = 99
};
+enum GoalGaff {
+ kGoalGaffDefault = 0,
+ kGoalGaffCT12WaitForMcCoy = 1,
+ kGoalGaffCT12GoToSpinner = 2,
+ kGoalGaffMA01ApproachMcCoy = 3,
+ kGoalGaffMA01Leave = 4,
+ kGoalGaffCT12Leave = 5,
+ kGoalGaffCT12FlyAway = 10,
+ kGoalGaffStartWalkingAround = 100,
+ kGoalGaffWalkAround = 101,
+ kGoalGaffRepeatWalkingAround = 102
+};
+
enum GoalLeon {
kGoalLeonDefault = 0,
kGoalLeonHoldingDeskClerk = 1,
diff --git a/engines/bladerunner/script/ai/gaff.cpp b/engines/bladerunner/script/ai/gaff.cpp
index 1706062..43d9e9b 100644
--- a/engines/bladerunner/script/ai/gaff.cpp
+++ b/engines/bladerunner/script/ai/gaff.cpp
@@ -33,19 +33,25 @@ void AIScriptGaff::Initialize() {
_animationStateNext = 0;
_animationNext = 0;
Actor_Put_In_Set(kActorGaff, kSetFreeSlotC);
- Actor_Set_Goal_Number(kActorGaff, 0);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffDefault);
//return false;
}
bool AIScriptGaff::Update() {
- if (Global_Variable_Query(kVariableChapter) == 2 && !Game_Flag_Query(471)) {
- Actor_Set_Goal_Number(kActorGaff, 100);
- Game_Flag_Set(471);
+ if ( Global_Variable_Query(kVariableChapter) == 2
+ && !Game_Flag_Query(kFlagGaffChapter2Started)
+ ) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffStartWalkingAround);
+ Game_Flag_Set(kFlagGaffChapter2Started);
return true;
}
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorGaff) < 299) {
+
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorGaff) < 299
+ ) {
Actor_Set_Goal_Number(kActorGaff, 299);
}
+
return false;
}
@@ -59,7 +65,7 @@ void AIScriptGaff::TimerExpired(int timer) {
}
void AIScriptGaff::CompletedMovementTrack() {
- if (Actor_Query_Goal_Number(kActorGaff) == 3) {
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffMA01ApproachMcCoy) {
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
Actor_Says(kActorGaff, 0, kAnimationModeTalk);
Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorGaff, 36, false, true);
@@ -92,21 +98,25 @@ void AIScriptGaff::CompletedMovementTrack() {
Actor_Clue_Acquire(kActorGaff, kClueMcCoyRetiredZuben, true, -1);
Game_Flag_Set(kFlagGaffApproachedMcCoyAboutZuben);
Player_Gains_Control();
- Actor_Set_Goal_Number(kActorGaff, 4);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01Leave);
}
- if (Actor_Query_Goal_Number(kActorGaff) == 2) {
- Actor_Set_Goal_Number(kActorGaff, 10);
+
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12GoToSpinner) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12FlyAway);
}
- if (Actor_Query_Goal_Number(kActorGaff) == 100) {
- Actor_Set_Goal_Number(kActorGaff, 101);
+
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffStartWalkingAround) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffWalkAround);
return;// true;
}
- if (Actor_Query_Goal_Number(kActorGaff) == 101) {
- Actor_Set_Goal_Number(kActorGaff, 102);
+
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffWalkAround) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffRepeatWalkingAround);
return;// true;
}
- if (Actor_Query_Goal_Number(kActorGaff) == 102) {
- Actor_Set_Goal_Number(kActorGaff, 101);
+
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffRepeatWalkingAround) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffWalkAround);
return;// true;
}
// return false;
@@ -120,7 +130,7 @@ void AIScriptGaff::ClickedByPlayer() {
if ((Global_Variable_Query(kVariableChapter) == 2
|| Global_Variable_Query(kVariableChapter) == 3
)
- && Game_Flag_Query(471)
+ && Game_Flag_Query(kFlagGaffChapter2Started)
) {
AI_Movement_Track_Pause(kActorGaff);
Actor_Face_Actor(kActorMcCoy, kActorGaff, true);
@@ -128,7 +138,6 @@ void AIScriptGaff::ClickedByPlayer() {
if (Random_Query(1, 3) == 1) {
Actor_Says(kActorMcCoy, 3970, 14);
Actor_Says(kActorGaff, 100, 13);
- AI_Movement_Track_Unpause(kActorGaff);
} else if (Random_Query(1, 3) == 2) {
Actor_Says(kActorMcCoy, 3970, 14);
Actor_Says(kActorGaff, 110, 13);
@@ -159,7 +168,8 @@ void AIScriptGaff::OtherAgentEnteredCombatMode(int otherActorId, int combatMode)
&& combatMode == 1
&& Global_Variable_Query(kVariableChapter) == 4
&& Actor_Query_In_Set(kActorMcCoy, kSetMA07)
- && Actor_Query_Goal_Number(kActorGaff) == 300) {
+ && Actor_Query_Goal_Number(kActorGaff) == 300
+ ) {
AI_Countdown_Timer_Reset(kActorGaff, 0);
Actor_Set_Goal_Number(kActorGaff, 303);
}
@@ -184,43 +194,50 @@ int AIScriptGaff::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId
bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
switch (newGoalNumber) {
- case 1:
+ case kGoalGaffCT12WaitForMcCoy:
Actor_Put_In_Set(kActorGaff, kSetCT01_CT12);
Actor_Set_At_Waypoint(kActorGaff, 43, 0);
return true;
- case 2:
+
+ case kGoalGaffCT12GoToSpinner:
AI_Movement_Track_Append(kActorGaff, 123, 1);
AI_Movement_Track_Repeat(kActorGaff);
return true;
- case 3:
+
+ case kGoalGaffMA01ApproachMcCoy:
Player_Loses_Control();
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 124, 0);
AI_Movement_Track_Append(kActorGaff, 126, 0);
AI_Movement_Track_Repeat(kActorGaff);
return true;
- case 4:
+
+ case kGoalGaffMA01Leave:
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 124, 0);
AI_Movement_Track_Append(kActorGaff, 35, 0);
AI_Movement_Track_Repeat(kActorGaff);
return true;
- case 5:
+
+ case kGoalGaffCT12Leave:
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 35, 90);
AI_Movement_Track_Repeat(kActorGaff);
return true;
- case 10:
+
+ case kGoalGaffCT12FlyAway:
Game_Flag_Reset(kFlagCT12GaffSpinner);
Scene_Loop_Set_Default(2);
- Scene_Loop_Start_Special(2, 6, true);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, 6, true);
return true;
- case 100:
+
+ case kGoalGaffStartWalkingAround:
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 35, 300);
AI_Movement_Track_Repeat(kActorGaff);
return true;
- case 101:
+
+ case kGoalGaffWalkAround:
{
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 82, 1);
@@ -244,22 +261,26 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGaff);
}
return true;
- case 102:
+
+ case kGoalGaffRepeatWalkingAround:
AI_Movement_Track_Flush(kActorGaff);
AI_Movement_Track_Append(kActorGaff, 35, 90);
AI_Movement_Track_Repeat(kActorGaff);
return true;
+
case 299:
AI_Movement_Track_Flush(kActorGaff);
Actor_Put_In_Set(kActorGaff, kSetFreeSlotC);
Actor_Set_At_Waypoint(kActorGaff, 35, 0);
return true;
+
case 300:
Player_Loses_Control();
Actor_Put_In_Set(kActorGaff, kSetMA07);
Actor_Set_At_XYZ(kActorGaff, -102.54f, -172.43f, 463.18f, 1015);
Actor_Set_Goal_Number(kActorGaff, 301);
return true;
+
case 301:
Game_Flag_Set(648);
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
@@ -287,8 +308,10 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Start_Speech_Sample(kActorGaff, 210);
Actor_Set_Goal_Number(kActorGaff, 302);
return true;
+
case 302:
return true;
+
case 303:
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatAttack);
@@ -296,6 +319,7 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
return true;
+
case 499:
AI_Movement_Track_Flush(kActorGaff);
Actor_Put_In_Set(kActorGaff, kSetKP05_KP06);
@@ -314,6 +338,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 1:
*animation = 788;
_animationFrame++;
@@ -321,6 +346,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 2:
*animation = 798;
_animationFrame++;
@@ -328,6 +354,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 3:
*animation = 799;
_animationFrame++;
@@ -337,6 +364,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 798;
}
break;
+
case 4:
*animation = 800;
_animationFrame++;
@@ -346,6 +374,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 798;
}
break;
+
case 5:
*animation = 801;
_animationFrame++;
@@ -355,6 +384,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 798;
}
break;
+
case 6:
*animation = 800;
_animationFrame++;
@@ -364,6 +394,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 798;
}
break;
+
case 7:
*animation = 801;
_animationFrame++;
@@ -373,6 +404,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 798;
}
break;
+
case 8:
*animation = 802;
_animationFrame++;
@@ -381,9 +413,10 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
*animation = 794;
_animationFrame = 0;
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); // TODO: check this, it was set directly by calling actor script
- Actor_Set_Goal_Number(kActorGaff, 5);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12Leave);
}
break;
+
default:
*animation = 399;
break;
@@ -398,37 +431,45 @@ bool AIScriptGaff::ChangeAnimationMode(int mode) {
_animationState = 0;
_animationFrame = 0;
break;
+
case kAnimationModeWalk:
if (_animationState != 1) {
_animationState = 1;
_animationFrame = 0;
}
break;
+
case kAnimationModeTalk:
_animationState = 2;
_animationFrame = 0;
break;
+
case 12:
_animationState = 3;
_animationFrame = 0;
break;
+
case 13:
_animationState = 4;
_animationFrame = 0;
break;
+
case 14:
_animationState = 5;
_animationFrame = 0;
break;
+
case 15:
_animationState = 6;
_animationFrame = 0;
break;
+
case 16:
_animationState = 7;
_animationFrame = 0;
break;
- case 41:
+
+ case kAnimationModeSpinnerGetIn:
_animationState = 8;
_animationFrame = 0;
break;
diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp
index af1d64c..6155a27 100644
--- a/engines/bladerunner/script/ai/zuben.cpp
+++ b/engines/bladerunner/script/ai/zuben.cpp
@@ -178,7 +178,7 @@ void AIScriptZuben::CompletedMovementTrack() {
Game_Flag_Set(kFlagZubenSpared);
Game_Flag_Set(kFlagCT01ZubenGone);
Actor_Set_Goal_Number(kActorZuben, kGoalZubenSpared);
- Actor_Set_Goal_Number(kActorGaff, 1);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12WaitForMcCoy);
Set_Enter(kSetCT06, kSceneCT06);
}
if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenMA01AttackMcCoy) {
@@ -366,11 +366,11 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Game_Flag_Set(kFlagCT01ZubenGone);
if (Actor_Query_In_Set(kActorZuben, kSetCT07)) {
Game_Flag_Set(kFlagCT07toCT06);
- Actor_Set_Goal_Number(kActorGaff, 1);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12WaitForMcCoy);
Set_Enter(kSetCT06, kSceneCT06);
} else if (Actor_Query_In_Set(kActorZuben, kSetMA01)) {
Player_Set_Combat_Mode(false);
- Actor_Set_Goal_Number(kActorGaff, 3);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01ApproachMcCoy);
}
Actor_Set_Goal_Number(kActorZuben, kGoalZubenDead);
return false;
diff --git a/engines/bladerunner/script/scene/ct05.cpp b/engines/bladerunner/script/scene/ct05.cpp
index a398d45..2c5c908 100644
--- a/engines/bladerunner/script/scene/ct05.cpp
+++ b/engines/bladerunner/script/scene/ct05.cpp
@@ -25,32 +25,35 @@
namespace BladeRunner {
void SceneScriptCT05::InitializeScene() {
- if (Game_Flag_Query(90)) {
- Game_Flag_Reset(90);
+ if (Game_Flag_Query(kFlagCT12toCT05)) {
+ Game_Flag_Reset(kFlagCT12toCT05);
Setup_Scene_Information(-128.42f, -109.91f, 112.83f, 516);
} else if (Game_Flag_Query(kFlagCT06toCT05)) {
- Setup_Scene_Information(192.35f, 43.09f, 128.97f, 768);
+ Setup_Scene_Information( 192.35f, 43.09f, 128.97f, 768);
} else {
- Setup_Scene_Information(-375.0f, -109.91f, 750.0f, 600);
+ Setup_Scene_Information( -375.0f, -109.91f, 750.0f, 600);
}
+
if (Game_Flag_Query(kFlagCT05WarehouseOpen)) {
Scene_Exit_Add_2D_Exit(0, 228, 205, 293, 300, 0);
}
Scene_Exit_Add_2D_Exit(1, 320, 458, 639, 479, 2);
Scene_Exit_Add_2D_Exit(2, 380, 110, 542, 300, 0);
+
Ambient_Sounds_Add_Looping_Sound(106, 15, -100, 1);
Ambient_Sounds_Add_Looping_Sound(107, 15, 100, 1);
Ambient_Sounds_Add_Looping_Sound( 56, 13, -100, 1);
- Ambient_Sounds_Add_Sound( 90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound( 91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(205, 5, 30, 18, 30, -100, 100, -101, -101, 0, 0);
+
if (Game_Flag_Query(kFlagCT05WarehouseOpen)) {
Scene_Loop_Set_Default(2);
} else {
Scene_Loop_Set_Default(0);
}
- if (Actor_Query_Goal_Number(kActorGaff) == 1) {
- Overlay_Play("ct05over", 0, 1, 0, 0);
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) {
+ Overlay_Play("ct05over", 0, true, false, 0);
}
}
@@ -139,25 +142,27 @@ bool SceneScriptCT05::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -128.42f, -109.91f, 112.83f, 0, true, false, 0)) {
Game_Flag_Set(kFlagCT05toCT12);
- if (Actor_Query_Goal_Number(kActorGaff) == 1) {
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) {
Overlay_Remove("ct05over");
}
Set_Enter(kSetCT01_CT12, kSceneCT12);
}
return true;
}
+
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -308.18f, -109.91f, 674.77f, 0, true, false, 0)) {
Game_Flag_Set(kFlagCT05toCT04);
- if (Actor_Query_Goal_Number(kActorGaff) == 1) {
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) {
Overlay_Remove("ct05over");
- Actor_Set_Goal_Number(kActorGaff, 5);
- Game_Flag_Set(409);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12Leave);
+ Game_Flag_Set(kFlagMA01GaffApproachMcCoy);
}
Set_Enter(kSetCT03_CT04, kSceneCT04);
}
return true;
}
+
if (exitId == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 71.99f, -109.91f, 288.79f, 0, true, false, 0)) {
Footstep_Sound_Override_On(2);
@@ -167,7 +172,7 @@ bool SceneScriptCT05::ClickedOnExit(int exitId) {
Loop_Actor_Travel_Stairs(kActorMcCoy, 5, true, kAnimationModeIdle);
Footstep_Sound_Override_Off();
Game_Flag_Set(kFlagCT05toCT06);
- if (Actor_Query_Goal_Number(kActorGaff) == 1) {
+ if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) {
Overlay_Remove("ct05over");
}
Set_Enter(kSetCT06, kSceneCT06);
@@ -182,7 +187,10 @@ bool SceneScriptCT05::ClickedOn2DRegion(int region) {
}
void SceneScriptCT05::SceneFrameAdvanced(int frame) {
- if (frame == 7 || frame == 15 || frame == 29) {
+ if (frame == 7
+ || frame == 15
+ || frame == 29
+ ) {
switch (Random_Query(0, 4)) {
case 4:
Sound_Play(40, Random_Query(25, 50), -70, -70, 50);
diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp
index c90473d..5bd35d8 100644
--- a/engines/bladerunner/script/scene/ct12.cpp
+++ b/engines/bladerunner/script/scene/ct12.cpp
@@ -38,41 +38,45 @@ void SceneScriptCT12::InitializeScene() {
} else {
Setup_Scene_Information(-386.13f, -6.5f, 1132.72f, 783);
}
- Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3);
- Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0);
+
+ Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3);
+ Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0);
Scene_Exit_Add_2D_Exit(2, 500, 180, 619, 346, 0);
if (Global_Variable_Query(kVariableChapter) > 2) {
- Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1);
+ Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1);
}
if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(4, 324, 150, 435, 340, 0);
}
- Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1);
+
+ Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1);
Ambient_Sounds_Add_Looping_Sound(55, 20, -100, 1);
Ambient_Sounds_Add_Looping_Sound(56, 20, -100, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
+ Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Sound(68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Global_Variable_Query(kVariableChapter) < 2
- && Actor_Query_Goal_Number(kActorGaff) == 1
+ && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy
) {
Actor_Put_In_Set(kActorGaff, kSetCT01_CT12);
Actor_Set_At_XYZ(kActorGaff, -534.0f, -6.5f, 952.0f, 367);
Game_Flag_Set(kFlagCT12GaffSpinner);
}
+
if (Game_Flag_Query(kFlagCT01toCT12)
&& Game_Flag_Query(kFlagSpinnerAtCT01)
) {
if (Global_Variable_Query(kVariableChapter) != 2
&& Global_Variable_Query(kVariableChapter) != 3
) {
- Scene_Loop_Start_Special(0, 1, 0);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 1, false);
}
Scene_Loop_Set_Default(2);
Game_Flag_Reset(kFlagCT01toCT12);
@@ -82,7 +86,7 @@ void SceneScriptCT12::InitializeScene() {
if (Global_Variable_Query(kVariableChapter) != 2
&& Global_Variable_Query(kVariableChapter) != 3
) {
- Scene_Loop_Start_Special(0, 0, 0);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
}
Scene_Loop_Set_Default(2);
Game_Flag_Reset(kFlagCT01toCT12);
@@ -163,6 +167,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -182.69f, -6.5f, 696.94f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
@@ -172,6 +177,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -386.13f, -6.5f, 1132.72f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
@@ -181,6 +187,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 3) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -493.0f, -6.5f, 1174.0f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
@@ -190,6 +197,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 4) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -292.0f, -6.5f, 990.0f, 0, true, false, 0)) {
if (Global_Variable_Query(kVariableChapter) == 4) {
@@ -213,18 +221,23 @@ void SceneScriptCT12::SceneFrameAdvanced(int frame) {
if (((frame - 1) % 10) == 0) {
Sound_Play(Random_Query(59, 60), 10, -80, -80, 50);
}
+
if (frame == 160) {
Actor_Change_Animation_Mode(kActorGaff, 41);
}
+
if (frame == 152) {
Sound_Play(116, 100, 40, 0, 50);
}
+
if (frame == 203) {
Sound_Play(119, 100, 40, 0, 50);
}
+
if (frame == 212) {
Sound_Play(117, 40, 0, 0, 50);
}
+
if (frame == 269) {
Player_Gains_Control();
Player_Set_Combat_Mode(false);
@@ -238,7 +251,7 @@ void SceneScriptCT12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptCT12::PlayerWalkedIn() {
if ( Global_Variable_Query(kVariableChapter) < 2
&& !Game_Flag_Query(kFlagGaffApproachedMcCoyAboutZuben)
- && Actor_Query_Goal_Number(kActorGaff) == 1
+ && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy
) {
Player_Loses_Control();
Loop_Actor_Walk_To_Actor(kActorGaff, kActorMcCoy, 48, false, false);
@@ -277,8 +290,9 @@ void SceneScriptCT12::PlayerWalkedIn() {
Actor_Clue_Acquire(kActorGaff, kClueMcCoyLetZubenEscape, true, -1);
}
- Actor_Set_Goal_Number(kActorGaff, 2);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12GoToSpinner);
}
+
if (Game_Flag_Query(kFlagCT11toCT12)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -520.0f, -6.5f, 1103.0f, 0, false, false, 0);
Game_Flag_Reset(kFlagCT11toCT12);
diff --git a/engines/bladerunner/script/scene/ma01.cpp b/engines/bladerunner/script/scene/ma01.cpp
index 566edeb..4d0ac55 100644
--- a/engines/bladerunner/script/scene/ma01.cpp
+++ b/engines/bladerunner/script/scene/ma01.cpp
@@ -39,23 +39,26 @@ enum kMA01Exits {
void SceneScriptMA01::InitializeScene() {
Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992);
if (Game_Flag_Query(kFlagSpinnerAtMA01)) {
- Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992);
+ Setup_Scene_Information( 381.0f, 0.0f, 54.0f, 992);
}
if (Game_Flag_Query(kFlagMA06toMA01)) {
Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660);
}
+
Scene_Exit_Add_2D_Exit(kMA01ExitMA06, 328, 132, 426, 190, 0);
if (Game_Flag_Query(kFlagSpinnerAtMA01)) {
Scene_Exit_Add_2D_Exit(kMA01ExitSpinner, 234, 240, 398, 328, 2);
}
- Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1);
- Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1);
- Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0);
+
+ Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1);
+ Ambient_Sounds_Add_Looping_Sound( 99, 40, -100, 1);
+ Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1);
+ Ambient_Sounds_Add_Sound( 68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Game_Flag_Query(kFlagMA06toMA01)) {
Scene_Loop_Set_Default(kMA01LoopMain);
Game_Flag_Reset(kFlagMA06toMA01);
@@ -65,9 +68,10 @@ void SceneScriptMA01::InitializeScene() {
Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA01LoopInshotRoof, false);
Scene_Loop_Set_Default(kMA01LoopMain);
}
- if (Game_Flag_Query(409)) {
- Actor_Set_Goal_Number(kActorGaff, 3);
- Game_Flag_Reset(409);
+
+ if (Game_Flag_Query(kFlagMA01GaffApproachMcCoy)) {
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01ApproachMcCoy);
+ Game_Flag_Reset(kFlagMA01GaffApproachMcCoy);
}
}
@@ -100,13 +104,14 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) {
if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenMA01AttackMcCoy) {
return true;
}
+
if (exitId == kMA01ExitMA06) {
if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenFled) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 72, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 72, true, false, 0)) {
Actor_Set_Goal_Number(kActorZuben, kGoalZubenMA01AttackMcCoy);
Scene_Exits_Disable();
}
- } else if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 12, 1, false, 0)) {
+ } else if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 12, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(kFlagMA01toMA06);
@@ -114,8 +119,9 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == kMA01ExitSpinner) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 381.0f, 0.0f, 54.0f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 381.0f, 0.0f, 54.0f, 0, true, false, 0)) {
Player_Loses_Control();
Actor_Face_Heading(kActorMcCoy, 736, false);
Game_Flag_Reset(kFlagMcCoyInChinaTown);
@@ -211,34 +217,44 @@ void SceneScriptMA01::SceneFrameAdvanced(int frame) {
if (frame == 15) {
Ambient_Sounds_Play_Sound(102, 70, -100, 100, 0);
}
- if (frame == 61 || frame == 183) {
+
+ if (frame == 61
+ || frame == 183
+ ) {
Ambient_Sounds_Play_Sound(116, 100, 40, 0, 99);
}
- if (frame == 107 || frame == 227) {
+
+ if (frame == 107
+ || frame == 227
+ ) {
Ambient_Sounds_Play_Sound(119, 100, 40, 0, 99);
}
+
if (frame == 1) {
Ambient_Sounds_Play_Sound(118, 40, -60, 20, 99);
}
+
if (frame == 241) {
Ambient_Sounds_Play_Sound(117, 40, 0, 0, 99);
}
+
if (frame == 58) {
Sound_Play(122, 17, 20, 20, 50);
}
+
if ((frame == 75
|| frame == 196
)
&& Game_Flag_Query(kFlagArrivedFromSpinner2)
) {
Actor_Face_Heading(kActorMcCoy, 736, false);
- Actor_Change_Animation_Mode(kActorMcCoy, 42);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut);
Game_Flag_Reset(kFlagArrivedFromSpinner2);
} else {
if ( frame == 196
&& !Game_Flag_Query(kFlagArrivedFromSpinner2)
) {
- Actor_Change_Animation_Mode(kActorMcCoy, 41);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetIn);
//return true;
return;
}
@@ -259,7 +275,9 @@ void SceneScriptMA01::PlayerWalkedOut() {
Actor_Set_Invisible(kActorMcCoy, false);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(kFlagMA01toMA06) && Global_Variable_Query(kVariableChapter) == 1) {
+ if (!Game_Flag_Query(kFlagMA01toMA06)
+ && Global_Variable_Query(kVariableChapter) == 1
+ ) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards2, true, -1);
Commit: f4c5a557ac516335619c6f1bf03208dc83826afa
https://github.com/scummvm/scummvm/commit/f4c5a557ac516335619c6f1bf03208dc83826afa
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Hawker's circle script cleanup
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/guzza.cpp
engines/bladerunner/script/scene/ar01.cpp
engines/bladerunner/script/scene/bb04.cpp
engines/bladerunner/script/scene/hc03.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 55c5e44..3a518cd 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -861,6 +861,8 @@ enum Flags {
kFlagSteeleWalkingAround = 460,
kFlagMaggieIsHurt = 461,
kFlagPS04GuzzaLeft = 462,
+ kFlagHC01GuzzaWalk = 463,
+ kFlagHC01GuzzaPrepare= 464,
kFlagMcCoyArrested = 465,
kFlagBB10Shelf1Available = 466,
kFlagBB10Shelf2Available = 467,
@@ -894,6 +896,7 @@ enum Flags {
kFlagCT07ZubenAttack = 516,
kFlagTB06DogCollarTaken = 519,
kFlagTB06KitchenBoxTaken = 520,
+ kFlagHC03TrapDoorOpened = 521,
kFlagCT10Entered = 525,
kFlagCT11toDR01 = 531,
kFlagCT09Entered = 538,
diff --git a/engines/bladerunner/script/ai/guzza.cpp b/engines/bladerunner/script/ai/guzza.cpp
index 62267be..9d41d3a 100644
--- a/engines/bladerunner/script/ai/guzza.cpp
+++ b/engines/bladerunner/script/ai/guzza.cpp
@@ -53,10 +53,10 @@ bool AIScriptGuzza::Update() {
}
if ( Actor_Query_Goal_Number(kActorGuzza) != kGoalGuzzaGoToHawkersCircle
- && !Game_Flag_Query(463)
- && Game_Flag_Query(464)
+ && !Game_Flag_Query(kFlagHC01GuzzaWalk)
+ && Game_Flag_Query(kFlagHC01GuzzaPrepare)
) {
- Game_Flag_Set(463);
+ Game_Flag_Set(kFlagHC01GuzzaWalk);
Actor_Set_Goal_Number(kActorGuzza, 103);
return true;
}
diff --git a/engines/bladerunner/script/scene/ar01.cpp b/engines/bladerunner/script/scene/ar01.cpp
index 9cd104c..1213f47 100644
--- a/engines/bladerunner/script/scene/ar01.cpp
+++ b/engines/bladerunner/script/scene/ar01.cpp
@@ -201,7 +201,7 @@ bool SceneScriptAR01::ClickedOnExit(int exitId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -358.0, 0.0, -149.0, 0, true, false, 0)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -477.0, 0.0, -149.0, 0, false, false, 0);
Game_Flag_Set(kFlagAR01toHC01);
- Game_Flag_Set(464);
+ Game_Flag_Set(kFlagHC01GuzzaPrepare);
Game_Flag_Reset(kFlagMcCoyInAnimoidRow);
Game_Flag_Set(kFlagMcCoyInHawkersCircle);
Set_Enter(kSetHC01_HC02_HC03_HC04, kSceneHC01);
diff --git a/engines/bladerunner/script/scene/bb04.cpp b/engines/bladerunner/script/scene/bb04.cpp
index 6ac7a7e..55445c1 100644
--- a/engines/bladerunner/script/scene/bb04.cpp
+++ b/engines/bladerunner/script/scene/bb04.cpp
@@ -88,7 +88,7 @@ bool SceneScriptBB04::ClickedOnExit(int exitId) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(kFlagBB04toBB02);
- Game_Flag_Set(493);
+ Game_Flag_Set(kFlagBB02ElevatorDown);
Set_Enter(kSetBB02_BB04_BB06_BB51, kSceneBB02);
}
return true;
diff --git a/engines/bladerunner/script/scene/hc03.cpp b/engines/bladerunner/script/scene/hc03.cpp
index c0d08c5..3d93906 100644
--- a/engines/bladerunner/script/scene/hc03.cpp
+++ b/engines/bladerunner/script/scene/hc03.cpp
@@ -197,13 +197,13 @@ void SceneScriptHC03::SceneFrameAdvanced(int frame) {
Sound_Play(281, Random_Query(33, 50), 50, 50, 50);
}
- if (!Game_Flag_Query(521)
+ if (!Game_Flag_Query(kFlagHC03TrapDoorOpened)
&& frame == 66
) {
Ambient_Sounds_Play_Sound(328, 90, 0, -40, 99);
Sound_Play(201, Random_Query(47, 47), 0, -40, 50);
Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2);
- Game_Flag_Set(521);
+ Game_Flag_Set(kFlagHC03TrapDoorOpened);
}
}
Commit: 783f0554edd107b7df3057da7338d96d9d8cee7d
https://github.com/scummvm/scummvm/commit/783f0554edd107b7df3057da7338d96d9d8cee7d
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Cleanup of Steele scripts for chapter 1
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/steele.cpp
engines/bladerunner/script/scene/kp02.cpp
engines/bladerunner/script/scene/kp03.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 3a518cd..51e8f7a 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -622,9 +622,9 @@ enum Flags {
kFlagMcCoyInAnimoidRow = 180,
kFlagMcCoyInNightclubRow = 181,
kFlagMcCoyInRunciters = 182,
-
-
-
+ kFlagSteeleInRunciters = 183,
+ kFlagSteeleInChinaTown = 184,
+ kFlagSteeleInPoliceStation = 185,
kFlagRC01PoliceDone = 186,
kFlagRC02TalkedToRunciter = 187,
// 188 is never used
@@ -961,7 +961,6 @@ enum Variables {
kVariableGenericWalkerAModel = 32,
kVariableGenericWalkerBModel = 33,
kVariableGenericWalkerCModel = 34,
-
kVariableBB10ShelvesAvailable = 36,
kVariableWalkLoopActor = 37,
kVariableWalkLoopRun = 38,
@@ -1484,6 +1483,17 @@ enum GoalMcCoy {
enum GoalSteele {
kGoalSteeleDefault = 0,
+ kGoalSteeleGoToRC01 = 1,
+ kGoalSteeleGoToRC02 = 2,
+ kGoalSteeleGoToFreeSlotC1 = 3,
+ kGoalSteeleGoToFreeSlotG1 = 4,
+ kGoalSteeleGoToCT01 = 5,
+ kGoalSteeleGoToFreeSlotC2 = 6,
+ kGoalSteeleGoToFreeSlotG2 = 7,
+ kGoalSteeleGoToPoliceShootingRange = 8,
+ kGoalSteeleGoToPS02 = 9,
+ kGoalSteeleGoToFreeSlotG3 = 10,
+ kGoalSteeleInterviewGrigorian = 11,
kGoalSteeleApprehendIzo = 100,
kGoalSteeleGoToTB02 = 110,
kGoalSteeleLeaveTB02 = 111,
diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp
index ddc50ad..4a4489d 100644
--- a/engines/bladerunner/script/ai/steele.cpp
+++ b/engines/bladerunner/script/ai/steele.cpp
@@ -57,36 +57,36 @@ bool AIScriptSteele::Update() {
switch (Global_Variable_Query(kVariableChapter)) {
case 1:
if (Game_Flag_Query(kFlagMcCoyInRunciters)
- && Game_Flag_Query(183)
+ && Game_Flag_Query(kFlagSteeleInRunciters)
) {
- Actor_Set_Goal_Number(kActorSteele, 3);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotC1);
return true;
}
if (Game_Flag_Query(kFlagMcCoyInChinaTown)
- && Game_Flag_Query(184)
+ && Game_Flag_Query(kFlagSteeleInChinaTown)
) {
- Actor_Set_Goal_Number(kActorSteele, 6);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotC2);
return true;
}
if (Game_Flag_Query(kFlagMcCoyInPoliceStation)
- && Game_Flag_Query(185)
+ && Game_Flag_Query(kFlagSteeleInPoliceStation)
) {
- Actor_Set_Goal_Number(kActorSteele, 10);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotG3);
return true;
}
- if ( Actor_Query_Goal_Number(kActorSteele) == 0
+ if ( Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleDefault
&& !Game_Flag_Query(kFlagMcCoyInRunciters)
&& Player_Query_Current_Scene() != kSceneRC01
) {
- Actor_Set_Goal_Number(kActorSteele, 1);
- Game_Flag_Set(183);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToRC01);
+ Game_Flag_Set(kFlagSteeleInRunciters);
return true;
}
- if (Actor_Query_Goal_Number(kActorSteele) == 11) {
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleInterviewGrigorian) {
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault);
return true;
}
@@ -220,15 +220,15 @@ void AIScriptSteele::TimerExpired(int timer) {
void AIScriptSteele::CompletedMovementTrack() {
switch (Actor_Query_Goal_Number(kActorSteele)) {
- case 1:
- Actor_Set_Goal_Number(kActorSteele, 2);
+ case kGoalSteeleGoToRC01:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToRC02);
break;
- case 2:
- Actor_Set_Goal_Number(kActorSteele, 3);
+ case kGoalSteeleGoToRC02:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotC1);
break;
- case 3:
+ case kGoalSteeleGoToFreeSlotC1:
if (Random_Query(1, 3) == 1) {
Actor_Clues_Transfer_New_To_Mainframe(kActorSteele);
Actor_Clues_Transfer_New_From_Mainframe(kActorSteele);
@@ -240,43 +240,46 @@ void AIScriptSteele::CompletedMovementTrack() {
Set_Score(kActorSteele, Random_Query(2, 5) + Query_Score(kActorMcCoy));
}
- Actor_Set_Goal_Number(kActorSteele, 4);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotG1);
break;
- case 4:
- Actor_Set_Goal_Number(kActorSteele, 5);
+ case kGoalSteeleGoToFreeSlotG1:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToCT01);
break;
- case 5:
- Actor_Set_Goal_Number(kActorSteele, 6);
+ case kGoalSteeleGoToCT01:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotC2);
break;
- case 6:
+ case kGoalSteeleGoToFreeSlotC2:
if (Random_Query(1, 3) == 1) {
Actor_Clues_Transfer_New_To_Mainframe(kActorSteele);
Actor_Clues_Transfer_New_From_Mainframe(kActorSteele);
}
- if (Query_Score(kActorMcCoy) > Query_Score(kActorSteele) && Query_Score(kActorMcCoy) < 75)
+ if (Query_Score(kActorMcCoy) > Query_Score(kActorSteele)
+ && Query_Score(kActorMcCoy) < 75
+ ) {
Set_Score(kActorSteele, Random_Query(2, 5) + Query_Score(kActorMcCoy));
+ }
- Actor_Set_Goal_Number(kActorSteele, 7);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotG2);
break;
- case 7:
- Actor_Set_Goal_Number(kActorSteele, 8);
+ case kGoalSteeleGoToFreeSlotG2:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToPoliceShootingRange);
break;
- case 8:
- Actor_Set_Goal_Number(kActorSteele, 9);
+ case kGoalSteeleGoToPoliceShootingRange:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToPS02);
break;
- case 9:
- Actor_Set_Goal_Number(kActorSteele, 10);
+ case kGoalSteeleGoToPS02:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToFreeSlotG3);
break;
- case 10:
- Actor_Set_Goal_Number(kActorSteele, 11);
+ case kGoalSteeleGoToFreeSlotG3:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleInterviewGrigorian);
break;
case kGoalSteeleApprehendIzo:
@@ -321,7 +324,7 @@ void AIScriptSteele::CompletedMovementTrack() {
case 432:
Player_Set_Combat_Mode(kActorMcCoy);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 2265, 11);
Actor_Says(kActorSteele, 640, 58);
Actor_Says(kActorMcCoy, 2270, 12);
@@ -353,12 +356,14 @@ void AIScriptSteele::ClickedByPlayer() {
int goal = Actor_Query_Goal_Number(kActorSteele);
if (goal == 599) {
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 8630, 14);
return; //true;
}
- if (goal > 399 || Global_Variable_Query(kVariableChapter) > 2) {
+ if (goal > 399
+ || Global_Variable_Query(kVariableChapter) > 2
+ ) {
return; //true;
}
@@ -374,8 +379,8 @@ void AIScriptSteele::ClickedByPlayer() {
}
AI_Movement_Track_Pause(1);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
switch (Random_Query(1, 3)) {
case 1:
@@ -399,7 +404,7 @@ void AIScriptSteele::ClickedByPlayer() {
}
void AIScriptSteele::EnteredScene(int sceneId) {
- if (Actor_Query_Goal_Number(kActorSteele) == 2) {
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleGoToRC02) {
if (!Game_Flag_Query(kFlagRC51ChopstickWrapperTaken)
&& Random_Query(1, 3) == 1
) {
@@ -555,33 +560,33 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return false;
switch (newGoalNumber) {
- case 1:
+ case kGoalSteeleGoToRC01:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 12, 5);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 2:
+ case kGoalSteeleGoToRC02:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 61, 30);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 3:
+ case kGoalSteeleGoToFreeSlotC1:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 35, 45);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 4:
+ case kGoalSteeleGoToFreeSlotG1:
AI_Movement_Track_Flush(kActorSteele);
- Game_Flag_Set(184);
- Game_Flag_Reset(183);
+ Game_Flag_Set(kFlagSteeleInChinaTown);
+ Game_Flag_Reset(kFlagSteeleInRunciters);
AI_Movement_Track_Append(kActorSteele, 39, 45);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 5:
+ case kGoalSteeleGoToCT01:
AI_Movement_Track_Flush(kActorSteele);
if (Random_Query(1, 10) == 1) {
AI_Movement_Track_Append(kActorSteele, 63, 20);
@@ -591,21 +596,21 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 6:
+ case kGoalSteeleGoToFreeSlotC2:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 35, 45);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 7:
+ case kGoalSteeleGoToFreeSlotG2:
AI_Movement_Track_Flush(kActorSteele);
Game_Flag_Set(185);
- Game_Flag_Reset(184);
+ Game_Flag_Reset(kFlagSteeleInChinaTown);
AI_Movement_Track_Append(kActorSteele, 39, 45);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 8:
+ case kGoalSteeleGoToPoliceShootingRange:
AI_Movement_Track_Flush(kActorSteele);
if (Random_Query(1, 2) == 1) {
AI_Movement_Track_Append(kActorSteele, 19, 10);
@@ -615,13 +620,13 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 9:
+ case kGoalSteeleGoToPS02:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 62, 1);
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 10:
+ case kGoalSteeleGoToFreeSlotG3:
AI_Movement_Track_Flush(kActorSteele);
Game_Flag_Reset(185);
AI_Movement_Track_Append(kActorSteele, 39, 30);
diff --git a/engines/bladerunner/script/scene/kp02.cpp b/engines/bladerunner/script/scene/kp02.cpp
index e249420..2233b3d 100644
--- a/engines/bladerunner/script/scene/kp02.cpp
+++ b/engines/bladerunner/script/scene/kp02.cpp
@@ -132,7 +132,9 @@ void SceneScriptKP02::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -884.0f, -615.49f, 3035.0f, 0, 0, false, 0);
Game_Flag_Reset(414);
}
- if (Game_Flag_Query(653) && Actor_Query_Goal_Number(kActorSteele) != 599) {
+ if (Game_Flag_Query(653)
+ && Actor_Query_Goal_Number(kActorSteele) != 599
+ ) {
Actor_Set_Goal_Number(kActorSteele, 450);
}
//return false;
diff --git a/engines/bladerunner/script/scene/kp03.cpp b/engines/bladerunner/script/scene/kp03.cpp
index 370927b..ca4e665 100644
--- a/engines/bladerunner/script/scene/kp03.cpp
+++ b/engines/bladerunner/script/scene/kp03.cpp
@@ -26,18 +26,20 @@ namespace BladeRunner {
void SceneScriptKP03::InitializeScene() {
if (Game_Flag_Query(420)) {
- Setup_Scene_Information(1.0f, -36.55f, 111.0f, 200);
+ Setup_Scene_Information( 1.0f, -36.55f, 111.0f, 200);
} else {
- Setup_Scene_Information(-321.0f, -36.55f, 26.0f, 350);
+ Setup_Scene_Information(-321.0f, -36.55f, 26.0f, 350);
}
- Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
+ Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
Scene_Exit_Add_2D_Exit(1, 287, 104, 367, 255, 0);
+
Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1);
- Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Game_Flag_Query(422)) {
Scene_Loop_Set_Default(5);
} else if (Game_Flag_Query(484)) {
@@ -46,7 +48,18 @@ void SceneScriptKP03::InitializeScene() {
Scene_Loop_Set_Default(2);
Game_Flag_Set(421);
}
- if ((Actor_Query_Goal_Number(kActorSteele) != 599 && !Game_Flag_Query(422) && !Game_Flag_Query(484)) && ((Game_Flag_Query(653) && Game_Flag_Query(420)) || (!Game_Flag_Query(653) && Game_Flag_Query(417)))) {
+ if (( Actor_Query_Goal_Number(kActorSteele) != 599
+ && !Game_Flag_Query(422)
+ && !Game_Flag_Query(484)
+ )
+ && ((Game_Flag_Query(653)
+ && Game_Flag_Query(420)
+ )
+ || (!Game_Flag_Query(653)
+ && Game_Flag_Query(417)
+ )
+ )
+ ) {
Actor_Put_In_Set(kActorSteele, kSetKP03);
Actor_Set_At_XYZ(kActorSteele, -300.0f, -36.55f, 26.0f, 350);
}
@@ -104,7 +117,9 @@ bool SceneScriptKP03::ClickedOn3DObject(const char *objectName, bool combatMode)
}
bool SceneScriptKP03::ClickedOnActor(int actorId) {
- if (actorId == kActorSteele && Actor_Query_Goal_Number(kActorSteele) == 411) {
+ if (actorId == kActorSteele
+ && Actor_Query_Goal_Number(kActorSteele) == 411
+ ) {
Actor_Face_Object(kActorSteele, "BRACK MID", true);
sub_401E54();
}
Commit: ace4904d398a0ed8df7c36bc94c2b79e694610d3
https://github.com/scummvm/scummvm/commit/ace4904d398a0ed8df7c36bc94c2b79e694610d3
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Cleanup of Guzza script for chapter 2
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/guzza.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 51e8f7a..a1eb110 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -1536,8 +1536,11 @@ enum GoalGordo {
enum GoalGuzza {
kGoalGuzzaLeaveOffice = 100,
- kGoalGuzzaGoToHawkersCircle = 101,
- kGoalGuzzaGoToOffice = 102
+ kGoalGuzzaGoToHawkersCircle1 = 101,
+ kGoalGuzzaGoToOffice = 102,
+ kGoalGuzzaGoToHawkersCircle2 = 103,
+ kGoalGuzzaGoToFreeSlotB = 104,
+ kGoalGuzzaGoToFreeSlotG = 105
};
enum GoalClovis {
diff --git a/engines/bladerunner/script/ai/guzza.cpp b/engines/bladerunner/script/ai/guzza.cpp
index 9d41d3a..f715c0b 100644
--- a/engines/bladerunner/script/ai/guzza.cpp
+++ b/engines/bladerunner/script/ai/guzza.cpp
@@ -52,12 +52,12 @@ bool AIScriptGuzza::Update() {
return true;
}
- if ( Actor_Query_Goal_Number(kActorGuzza) != kGoalGuzzaGoToHawkersCircle
+ if ( Actor_Query_Goal_Number(kActorGuzza) != kGoalGuzzaGoToHawkersCircle1
&& !Game_Flag_Query(kFlagHC01GuzzaWalk)
&& Game_Flag_Query(kFlagHC01GuzzaPrepare)
) {
Game_Flag_Set(kFlagHC01GuzzaWalk);
- Actor_Set_Goal_Number(kActorGuzza, 103);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGoToHawkersCircle2);
return true;
}
}
@@ -77,19 +77,19 @@ void AIScriptGuzza::CompletedMovementTrack() {
case kGoalGuzzaGoToOffice:
if (Random_Query(1, 2) == 1) {
- Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGoToHawkersCircle);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGoToHawkersCircle1);
} else {
- Actor_Set_Goal_Number(kActorGuzza, 104);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGoToFreeSlotB);
}
// return true;
break;
- case 103:
+ case kGoalGuzzaGoToHawkersCircle2:
Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaLeaveOffice);
// return true;
break;
- case 105:
+ case kGoalGuzzaGoToFreeSlotG:
Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaLeaveOffice);
// return true;
break;
@@ -149,7 +149,7 @@ void AIScriptGuzza::OtherAgentEnteredCombatMode(int otherActorId, int combatMode
void AIScriptGuzza::ShotAtAndMissed() {
if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Actor_Set_Goal_Number(kActorGuzza, 304);
}
// return false;
@@ -157,7 +157,7 @@ void AIScriptGuzza::ShotAtAndMissed() {
bool AIScriptGuzza::ShotAtAndHit() {
if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Actor_Set_Goal_Number(kActorGuzza, 303);
}
return false;
@@ -182,7 +182,7 @@ bool AIScriptGuzza::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case kGoalGuzzaGoToHawkersCircle:
+ case kGoalGuzzaGoToHawkersCircle1:
AI_Movement_Track_Flush(kActorGuzza);
AI_Movement_Track_Append(kActorGuzza, 258, 0);
AI_Movement_Track_Append(kActorGuzza, 260, 8);
@@ -198,7 +198,7 @@ bool AIScriptGuzza::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case 103:
+ case kGoalGuzzaGoToHawkersCircle2:
AI_Movement_Track_Flush(kActorGuzza);
AI_Movement_Track_Append(kActorGuzza, 258, 0);
AI_Movement_Track_Append(kActorGuzza, 259, 1);
@@ -206,13 +206,13 @@ bool AIScriptGuzza::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case 104:
+ case kGoalGuzzaGoToFreeSlotB:
AI_Movement_Track_Flush(kActorGuzza);
AI_Movement_Track_Append(kActorGuzza, 34, 60);
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case 105:
+ case kGoalGuzzaGoToFreeSlotG:
AI_Movement_Track_Flush(kActorGuzza);
AI_Movement_Track_Append(kActorGuzza, 39, 120);
AI_Movement_Track_Repeat(kActorGuzza);
@@ -285,6 +285,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
break;
}
break;
+
case 1:
switch (_state) {
case 0:
@@ -340,6 +341,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
break;
}
break;
+
case 2:
if (_state == 0) {
*animation = _animationNext;
@@ -359,6 +361,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 3:
switch (_state) {
case 0:
@@ -378,6 +381,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = _animationStateNext;
}
break;
+
case 4:
*animation = 185;
_animationFrame++;
@@ -385,6 +389,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 5:
*animation = 186;
_animationFrame++;
@@ -392,6 +397,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 6:
*animation = 176;
_animationFrame++;
@@ -399,6 +405,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 7:
*animation = 177;
_animationFrame++;
@@ -406,6 +413,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 8:
*animation = 181;
_animationFrame++;
@@ -413,6 +421,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 9:
*animation = 187;
_animationFrame++;
@@ -420,6 +429,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 10:
*animation = 188;
_animationFrame++;
@@ -427,6 +437,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 11:
if (_animationFrame == 0 && _flag) {
*animation = 197;
@@ -443,6 +454,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 12:
*animation = 202;
_animationFrame++;
@@ -452,6 +464,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 11;
}
break;
+
case 13:
*animation = 203;
_animationFrame++;
@@ -461,6 +474,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 11;
}
break;
+
case 14:
*animation = 204;
_animationFrame++;
@@ -470,6 +484,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 11;
}
break;
+
case 15:
*animation = 205;
_animationFrame++;
@@ -479,6 +494,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 11;
}
break;
+
case 16:
*animation = 206;
_animationFrame++;
@@ -488,6 +504,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 11;
}
break;
+
case 17:
if (_animationFrame == 0 && _flag) {
*animation = 189;
@@ -505,6 +522,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 18:
*animation = 193;
_animationFrame++;
@@ -514,6 +532,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 17;
}
break;
+
case 19:
*animation = 194;
_animationFrame++;
@@ -523,6 +542,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 20:
*animation = 195;
_animationFrame++;
@@ -532,6 +552,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 17;
}
break;
+
case 21:
*animation = 196;
_animationFrame++;
@@ -541,6 +562,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 17;
}
break;
+
case 22:
if (_animationFrame == 0 && _flag) {
*animation = 172;
@@ -558,6 +580,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 23:
if (_animationFrame == 0 && _flag) {
*animation = 172;
@@ -575,12 +598,14 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 24:
*animation = 172;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(172)) {
_animationFrame = 0;
}
break;
+
case 25:
*animation = 173;
_animationFrame++;
@@ -588,6 +613,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
+
case 26:
*animation = 174;
_animationFrame++;
@@ -598,6 +624,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatIdle);
}
break;
+
case 27:
*animation = 175;
_animationFrame++;
@@ -608,6 +635,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatIdle);
}
break;
+
case 29:
*animation = 182;
_animationFrame++;
@@ -617,6 +645,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 24;
}
break;
+
case 30:
*animation = 183;
_animationFrame++;
@@ -626,6 +655,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
_animationState = 0;
}
break;
+
case 31:
*animation = 184;
_animationFrame++;
@@ -636,6 +666,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatIdle);
}
break;
+
case 32:
*animation = 200;
_animationFrame++;
@@ -646,6 +677,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeIdle);
}
break;
+
case 33:
*animation = 207;
_animationFrame++;
@@ -664,10 +696,12 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
}
}
break;
+
case 34:
*animation = 207;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(207) - 1;
break;
+
default:
*animation = 399;
break;
@@ -719,14 +753,17 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
break;
}
break;
+
case kAnimationModeWalk:
_animationState = 4;
_animationFrame = 0;
break;
+
case kAnimationModeRun:
_animationState = 5;
_animationFrame = 0;
break;
+
case kAnimationModeTalk:
if (_animationState) {
_animationState = 11;
@@ -739,27 +776,34 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 201;
}
break;
+
case kAnimationModeCombatIdle:
if (_animationState == 0) {
_animationState = 29;
_animationFrame = 0;
- } else if (_animationState != 24 && _animationState != 29) {
+ } else if (_animationState != 24
+ && _animationState != 29
+ ) {
_animationState = 24;
_animationFrame = 0;
}
break;
+
case kAnimationModeCombatAttack:
_animationState = 31;
_animationFrame = 0;
break;
+
case kAnimationModeCombatWalk:
_animationState = 6;
_animationFrame = 0;
break;
+
case kAnimationModeCombatRun:
_animationState = 7;
_animationFrame = 0;
break;
+
case 12:
if (_animationState) {
_animationState = 12;
@@ -772,6 +816,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 202;
}
break;
+
case 13:
if (_animationState) {
_animationState = 13;
@@ -784,6 +829,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 203;
}
break;
+
case 14:
if (_animationState) {
_animationState = 14;
@@ -796,6 +842,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 204;
}
break;
+
case 15:
if (_animationState) {
_animationState = 15;
@@ -808,6 +855,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 205;
}
break;
+
case 16:
if (_animationState) {
_animationState = 16;
@@ -820,7 +868,8 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationNext = 206;
}
break;
- case 22:
+
+ case kAnimationModeCombatHit:
if (Random_Query(0, 1)) {
_animationState = 26;
} else {
@@ -828,10 +877,12 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
}
_animationFrame = 0;
break;
+
case 23:
_animationState = 32;
_animationFrame = 0;
break;
+
case 30:
if (_animationState == 1) {
_animationState = 3;
Commit: 1ca97137ad232d2fadfcc881f769b791d8f7705f
https://github.com/scummvm/scummvm/commit/1ca97137ad232d2fadfcc881f769b791d8f7705f
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Fixed wrongly clickable news in DR02
They are not supposed to be clickable
Changed paths:
engines/bladerunner/script/scene/dr02.cpp
diff --git a/engines/bladerunner/script/scene/dr02.cpp b/engines/bladerunner/script/scene/dr02.cpp
index 731ed16..4011cf5 100644
--- a/engines/bladerunner/script/scene/dr02.cpp
+++ b/engines/bladerunner/script/scene/dr02.cpp
@@ -78,7 +78,7 @@ void SceneScriptDR02::SceneLoaded() {
Clickable_Object("U2 EYE");
Clickable_Object("U2 E");
Clickable_Object("MMNEWSP01");
- Clickable_Object("MMNEWSP01");
+ Clickable_Object("MMNEWSP02");
Clickable_Object("MMNEWSP04");
Clickable_Object("MMNEWSP05");
Clickable_Object("MMNEWSP07");
@@ -94,7 +94,7 @@ void SceneScriptDR02::SceneLoaded() {
Unclickable_Object("MMNEWSP01");
Unclickable_Object("MMNEWSP02");
Unclickable_Object("MMNEWSP04");
- Unclickable_Object("MMNEWSP06");
+ Unclickable_Object("MMNEWSP05");
Unclickable_Object("MMNEWSP07");
Unclickable_Object("PARKMETR02");
Unclickable_Object("TRANSFORMER 01");
Commit: bc7713e04036247ec08feed6ce67b39d486bdeb8
https://github.com/scummvm/scummvm/commit/bc7713e04036247ec08feed6ce67b39d486bdeb8
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Cleanup of Police station scripts for chapter 1 & 2
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/scene/ps01.cpp
engines/bladerunner/script/scene/ps02.cpp
engines/bladerunner/script/scene/ps04.cpp
engines/bladerunner/script/scene/tb02.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index a1eb110..fc22ea4 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -910,6 +910,7 @@ enum Flags {
kFlagKIAPrivacyAddonIntro = 599,
kFlagTB07toTB02 = 608,
kFlagTB07RachaelTalk = 612,
+ kFlagTB07TyrellMeeting = 625,
kFlagCT11DogWrapperTaken = 645,
kFlagMA04McCoySleeping = 647,
kFlagMA04PhoneMessageFromClovis = 649,
@@ -938,6 +939,7 @@ enum Flags {
kFlagMcCoyShotAtZuben = 712,
kFlagDR04McCoyShotMoraji = 713,
kFlagRC04BobTalk3 = 717,
+ kflagPS01toPS02 = 718,
kFlagCT02McCoyFell = 719,
kFlagCT02McCoyCombatReady = 720,
kFlagZubenBountyPaid = 723,
diff --git a/engines/bladerunner/script/scene/ps01.cpp b/engines/bladerunner/script/scene/ps01.cpp
index bafa4a5..c80562f 100644
--- a/engines/bladerunner/script/scene/ps01.cpp
+++ b/engines/bladerunner/script/scene/ps01.cpp
@@ -24,6 +24,14 @@
namespace BladeRunner {
+enum kPS01Loops {
+ kPS01LoopInshoot = 0,
+ kPS01LoopMainLoop = 1,
+ kPS01LoopDoorAnim = 3,
+ kPS01LoopOutshoot = 4,
+ kPS01LoopNoSpinner = 5
+};
+
void SceneScriptPS01::InitializeScene() {
Setup_Scene_Information(1872.0f, 16592.0f, -2975.0f, 200);
Scene_Exit_Add_2D_Exit(0, 36, 194, 138, 326, 0);
@@ -31,22 +39,23 @@ void SceneScriptPS01::InitializeScene() {
Scene_Exit_Add_2D_Exit(1, 344, 288, 584, 384, 2);
}
Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1);
- Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Game_Flag_Query(kFlagPS02toPS01)) {
if (Game_Flag_Query(kFlagSpinnerAtPS01)) {
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kPS01LoopMainLoop);
} else {
- Scene_Loop_Set_Default(5);
+ Scene_Loop_Set_Default(kPS01LoopNoSpinner);
}
} else {
Actor_Set_Invisible(kActorMcCoy, true);
Game_Flag_Set(kFlagArrivedFromSpinner2);
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kPS01LoopInshoot, false);
+ Scene_Loop_Set_Default(kPS01LoopMainLoop);
Player_Loses_Control();
}
}
@@ -78,12 +87,13 @@ bool SceneScriptPS01::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptPS01::ClickedOnExit(int exitId) {
if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1920.0f, 16581.0f, -2653.0f, 12, 1, false, 0)) {
- Game_Flag_Set(718);
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1920.0f, 16581.0f, -2653.0f, 12, true, false, 0)) {
+ Game_Flag_Set(kflagPS01toPS02);
Set_Enter(kSetPS02, kScenePS02);
}
return true;
}
+
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1877.9f, 16592.0f, -2975.0f, 0, true, false, 0)) {
Actor_Set_At_XYZ(kActorMcCoy, 1872.0f, 16592.0f, -2975.0f, 870);
@@ -95,77 +105,77 @@ bool SceneScriptPS01::ClickedOnExit(int exitId) {
Game_Flag_Reset(kFlagMcCoyInTyrellBuilding);
Game_Flag_Reset(kFlagMcCoyInDNARow);
Game_Flag_Reset(kFlagMcCoyInBradburyBuilding);
- int spinnerDest = Spinner_Interface_Choose_Dest(3, true);
+ int spinnerDest = Spinner_Interface_Choose_Dest(kPS01LoopDoorAnim, true);
switch (spinnerDest) {
case kSpinnerDestinationMcCoysApartment:
Game_Flag_Set(kFlagMcCoyInMcCoyApartment);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtMA01);
Set_Enter(kSetMA01, kSceneMA01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationRuncitersAnimals:
Game_Flag_Set(kFlagMcCoyInRunciters);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtRC01);
Set_Enter(kSetRC01, kSceneRC01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationChinatown:
Game_Flag_Set(kFlagMcCoyInChinaTown);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtCT01);
Set_Enter(kSetCT01_CT12, kSceneCT01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationAnimoidRow:
Game_Flag_Set(kFlagMcCoyInAnimoidRow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtAR01);
Set_Enter(kSetAR01_AR02, kSceneAR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationTyrellBuilding:
Game_Flag_Set(kFlagMcCoyInTyrellBuilding);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtTB02);
Set_Enter(kSetTB02_TB03, kSceneTB02);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationDNARow:
Game_Flag_Set(kFlagMcCoyInDNARow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtDR01);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationBradburyBuilding:
Game_Flag_Set(kFlagMcCoyInBradburyBuilding);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtBB01);
Set_Enter(kSetBB01, kSceneBB01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationNightclubRow:
Game_Flag_Set(kFlagMcCoyInNightclubRow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtNR01);
Set_Enter(kSetNR01, kSceneNR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationHysteriaHall:
Game_Flag_Set(kFlagMcCoyInHysteriaHall);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
default:
Actor_Face_Heading(kActorMcCoy, 870, false);
Game_Flag_Set(kFlagMcCoyInPoliceStation);
Game_Flag_Set(kFlagArrivedFromSpinner2);
Player_Loses_Control();
- Scene_Loop_Start_Special(2, 3, 1);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kPS01LoopDoorAnim, true);
break;
}
}
@@ -179,74 +189,87 @@ bool SceneScriptPS01::ClickedOn2DRegion(int region) {
}
void SceneScriptPS01::SceneFrameAdvanced(int frame) {
- if (frame == 71 || frame == 188) {
+ if (frame == 71
+ || frame == 188
+ ) {
Sound_Play(116, 100, 40, 0, 50);
}
- if (frame == 108 || frame == 228) {
+
+ if (frame == 108
+ || frame == 228
+ ) {
Sound_Play(119, 100, 40, 0, 50);
}
+
if (frame == 1) {
Sound_Play(118, 40, 0, 0, 50);
}
+
if (frame == 76) {
Sound_Play(121, 50, 0, 0, 50);
}
+
if (frame == 192) {
Sound_Play(120, 50, 0, 0, 50);
}
+
if (frame == 59) {
Sound_Play(122, 15, 0, 0, 50);
}
+
if (frame == 275) {
Sound_Play(117, 40, 0, 0, 50);
}
+
if (!Game_Flag_Query(kFlagArrivedFromSpinner2)) {
switch (frame) {
case 196:
Actor_Face_Heading(kActorMcCoy, 870, false);
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -1);
- Actor_Change_Animation_Mode(kActorMcCoy, 41);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetIn);
break;
+
case 220:
Actor_Set_Frame_Rate_FPS(kActorMcCoy, 0);
break;
+
case 240:
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -2);
break;
}
- //return true;
- return;
+ return; // true;
}
+
if (frame == 75) {
Actor_Face_Heading(kActorMcCoy, 870, false);
- Actor_Change_Animation_Mode(kActorMcCoy, 42);
- //return true;
- return;
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut);
+ return; // true;
}
+
if (frame == 119) {
Game_Flag_Reset(kFlagArrivedFromSpinner2);
Player_Gains_Control();
- //return true;
- return;
+ return; // true;
}
+
if (frame > 195) {
if (frame == 239) {
Game_Flag_Reset(kFlagArrivedFromSpinner2);
Player_Gains_Control();
}
- //return true;
- return;
+ return; // true;
}
+
if (frame == 181) {
Actor_Face_Heading(kActorMcCoy, 870, false);
- Actor_Change_Animation_Mode(kActorMcCoy, 42);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut);
} else if (frame == 182) {
Actor_Set_Frame_Rate_FPS(kActorMcCoy, 0);
} else if (frame == 195) {
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -2);
}
- //return true;
- return;
+
+ return; // true;
}
void SceneScriptPS01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
@@ -264,7 +287,10 @@ void SceneScriptPS01::PlayerWalkedOut() {
Actor_Set_Invisible(kActorMcCoy, false);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(718) && Global_Variable_Query(kVariableChapter) == 1) {
+
+ if (!Game_Flag_Query(kflagPS01toPS02)
+ && Global_Variable_Query(kVariableChapter) == 1
+ ) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards3, true, -1);
diff --git a/engines/bladerunner/script/scene/ps02.cpp b/engines/bladerunner/script/scene/ps02.cpp
index a358321..d655b96 100644
--- a/engines/bladerunner/script/scene/ps02.cpp
+++ b/engines/bladerunner/script/scene/ps02.cpp
@@ -27,12 +27,15 @@ namespace BladeRunner {
void SceneScriptPS02::InitializeScene() {
Player_Loses_Control();
Setup_Scene_Information(-13.31f, -40.28f, -48.12f, 30);
+
Scene_Exit_Add_2D_Exit(0, 0, 0, 240, 479, 3);
+
Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
Ambient_Sounds_Add_Looping_Sound(386, 20, 1, 1);
Ambient_Sounds_Add_Looping_Sound(210, 20, 1, 1);
Ambient_Sounds_Add_Sound(0, 3, 20, 12, 16, 0, 0, -101, -101, 0, 0);
- Scene_Loop_Start_Special(0, 0, 0);
+
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
Scene_Loop_Set_Default(1);
}
@@ -48,7 +51,9 @@ bool SceneScriptPS02::MouseClick(int x, int y) {
}
bool SceneScriptPS02::ClickedOn3DObject(const char *objectName, bool a2) {
- if (Object_Query_Click("E.DOOR01", objectName) || Object_Query_Click("E.D00R02", objectName)) {
+ if (Object_Query_Click("E.DOOR01", objectName)
+ || Object_Query_Click("E.D00R02", objectName)
+ ) {
if (Game_Flag_Query(kFlagPS02toPS01)) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -5.0f, -40.0f, -15.0f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
@@ -109,6 +114,7 @@ void SceneScriptPS02::SceneFrameAdvanced(int frame) {
if (frame == 1) {
Ambient_Sounds_Play_Sound(208, 45, 0, 0, 0);
}
+
if (frame == 91) {
Ambient_Sounds_Play_Sound(209, 45, 0, 0, 0);
}
@@ -119,7 +125,7 @@ void SceneScriptPS02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptPS02::PlayerWalkedIn() {
- Game_Flag_Reset(718);
+ Game_Flag_Reset(kflagPS01toPS02);
Actor_Face_XYZ(kActorMcCoy, 0.0f, 0.0f, 450.0f, true);
Player_Gains_Control();
activateElevator();
@@ -155,22 +161,20 @@ void SceneScriptPS02::DialogueQueueFlushed(int a1) {
void SceneScriptPS02::activateElevator() {
Scene_Exits_Disable();
switch (Elevator_Activate(kElevatorPS)) {
- case 7:
- Game_Flag_Set(kFlagPS02toPS09);
+ case 3:
+ Game_Flag_Set(kFlagPS02toPS07);
break;
- case 6:
- Game_Flag_Set(kFlagPS02toPS03);
+ case 4:
+ Game_Flag_Set(kFlagPS02toPS01);
break;
case 5:
Game_Flag_Set(kFlagPS02toPS05);
break;
- case 4:
- Game_Flag_Set(kFlagPS02toPS01);
- break;
- case 3:
- Game_Flag_Set(kFlagPS02toPS07);
+ case 6:
+ Game_Flag_Set(kFlagPS02toPS03);
break;
- default:
+ case 7:
+ Game_Flag_Set(kFlagPS02toPS09);
break;
}
Scene_Exits_Enable();
diff --git a/engines/bladerunner/script/scene/ps04.cpp b/engines/bladerunner/script/scene/ps04.cpp
index bab6ce5..d5eda1f 100644
--- a/engines/bladerunner/script/scene/ps04.cpp
+++ b/engines/bladerunner/script/scene/ps04.cpp
@@ -171,7 +171,7 @@ void SceneScriptPS04::dialogueWithGuzza() {
Actor_Says(kActorGuzza, 450, 34);
Actor_Says(kActorGuzza, 460, 33);
Actor_Says(kActorMcCoy, 4040, 17);
- Game_Flag_Set(625);
+ Game_Flag_Set(kFlagTB07TyrellMeeting);
break;
case 120: // MONEY
diff --git a/engines/bladerunner/script/scene/tb02.cpp b/engines/bladerunner/script/scene/tb02.cpp
index d82ef22..7a68812 100644
--- a/engines/bladerunner/script/scene/tb02.cpp
+++ b/engines/bladerunner/script/scene/tb02.cpp
@@ -279,8 +279,8 @@ void SceneScriptTB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptTB02::PlayerWalkedIn() {
- if (Game_Flag_Query(625)) {
- Game_Flag_Reset(625);
+ if (Game_Flag_Query(kFlagTB07TyrellMeeting)) {
+ Game_Flag_Reset(kFlagTB07TyrellMeeting);
if (Global_Variable_Query(kVariableChapter) == 2
|| Global_Variable_Query(kVariableChapter) == 3
) {
Commit: 2cf1d2e3f1d2e2e6f3f5364af6b3a383a71891c3
https://github.com/scummvm/scummvm/commit/2cf1d2e3f1d2e2e6f3f5364af6b3a383a71891c3
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:48:59+01:00
Commit Message:
BLADERUNNER: Initial cleanup of HF01 & related actors
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/mia.cpp
engines/bladerunner/script/ai/murray.cpp
engines/bladerunner/script/scene/hf01.cpp
engines/bladerunner/script/scene/nr01.cpp
engines/bladerunner/script/scene_script.h
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index fc22ea4..59e6383 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -809,14 +809,18 @@ enum Flags {
kFlagAR02StungByScorpion = 367,
kFlagNotUsed370 = 370, // is never checked
+ // 371 is never used
+ // 372 is never used
kFlagAR02DektoraBoughtScorpions = 374,
kFlagBB11SadikPunchedMcCoy = 375,
-
+ // 376 is never used
+ kFlagHF01MurrayMiaIntro = 377,
kFlagDirectorsCut = 378,
kFlagCT08toCT51 = 379, // is never checked
kFlagCT51toCT08 = 380,
-
+ // 381 is never used
+ kFlagHF01MurrayMiaTalk = 382,
kFlagNotUsed383 = 383,
kFlagHC01toHC02 = 384,
kFlagHC02toHC01 = 385,
@@ -842,7 +846,7 @@ enum Flags {
kFlagHC02HawkersBarkeepBraceletTalk = 405,
kFlagUnused406 = 406, // is never checked
kFlagUnused407 = 407, // is never checked
-
+ // 408 is never used
kFlagMA01GaffApproachMcCoy = 409,
kFlagBB06AndroidDestroyed = 410,
@@ -850,7 +854,6 @@ enum Flags {
kFlagCT12ToUG09 = 433,
kFlagGenericWalkerWaiting = 443,
kFlagIzoShot = 444,
-
kFlagUG02WeaponsChecked = 449,
kFlagTB02ElevatorToTB05 = 450,
kFlagTB05Entered = 451,
@@ -1093,7 +1096,7 @@ enum Scenes {
kSceneHC01 = 31, // Hawker's Circle - Green pawn - Outside
kSceneHC02 = 32, // Hawker's Circle - China bar
kSceneHC03 = 33, // Hawker's Circle - Green pawn - Inside
- kSceneHF01 = 34,
+ kSceneHF01 = 34, // Hysteria Hall - Iutside
kSceneHF02 = 35,
kSceneHF03 = 36,
kSceneHF04 = 37,
diff --git a/engines/bladerunner/script/ai/mia.cpp b/engines/bladerunner/script/ai/mia.cpp
index 103b6c4..1655a8c 100644
--- a/engines/bladerunner/script/ai/mia.cpp
+++ b/engines/bladerunner/script/ai/mia.cpp
@@ -41,8 +41,11 @@ void AIScriptMia::Initialize() {
}
bool AIScriptMia::Update() {
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorMia) != 300)
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorMia) != 300
+ ) {
Actor_Set_Goal_Number(kActorMia, 300);
+ }
return false;
}
@@ -163,9 +166,6 @@ bool AIScriptMia::UpdateAnimation(int *animation, int *frame) {
_animationState = 2;
}
break;
-
- default:
- break;
}
*frame = _animationFrame;
@@ -176,28 +176,34 @@ bool AIScriptMia::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMia::ChangeAnimationMode(int mode) {
switch (mode) {
case kAnimationModeIdle:
- if (_animationState >= 2 && _animationState <= 4) {
+ if (_animationState >= 2
+ && _animationState <= 4
+ ) {
_flag1 = false;
} else {
_animationFrame = 0;
_animationState = 0;
}
break;
+
case kAnimationModeTalk:
_animationFrame = 0;
_flag1 = false;
_animationState = 2;
break;
+
case 12:
_animationFrame = 0;
_flag1 = false;
_animationState = 3;
break;
+
case 13:
_animationFrame = 0;
_flag1 = false;
_animationState = 4;
break;
+
case 23:
_animationFrame = 0;
_animationState = 1;
diff --git a/engines/bladerunner/script/ai/murray.cpp b/engines/bladerunner/script/ai/murray.cpp
index f187cad..f7fdcaf 100644
--- a/engines/bladerunner/script/ai/murray.cpp
+++ b/engines/bladerunner/script/ai/murray.cpp
@@ -41,21 +41,26 @@ void AIScriptMurray::Initialize() {
}
bool AIScriptMurray::Update() {
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorMurray) != 300)
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorMurray) != 300
+ ) {
Actor_Set_Goal_Number(kActorMurray, 300);
+ }
- if (Player_Query_Current_Set() == kSetHF01) {
- if (!Actor_Query_In_Set(kActorMcCoy, kSetHF01)
- || !Actor_Query_In_Set(kActorMurray, kSetHF01)
- || Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMurray) >= 48
- || Game_Flag_Query(377)) {
- return false;
- }
+ if (Player_Query_Current_Set() != kSetHF01) {
+ return true;
+ }
+ if ( Actor_Query_In_Set(kActorMcCoy, kSetHF01)
+ && Actor_Query_In_Set(kActorMurray, kSetHF01)
+ && Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMurray) < 48
+ && !Game_Flag_Query(kFlagHF01MurrayMiaIntro)
+ ) {
Actor_Set_Goal_Number(kActorMurray, 1);
+ return true;
}
- return true;
+ return false;
}
void AIScriptMurray::TimerExpired(int timer) {
@@ -196,7 +201,7 @@ bool AIScriptMurray::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMurray::ChangeAnimationMode(int mode) {
switch (mode) {
- case 0:
+ case kAnimationModeIdle:
if (_animationState > 0 && _animationState <= 5) {
_flag = true;
} else {
@@ -205,7 +210,7 @@ bool AIScriptMurray::ChangeAnimationMode(int mode) {
}
break;
- case 3:
+ case kAnimationModeTalk:
_animationState = 1;
_animationFrame = 0;
_flag = false;
@@ -234,9 +239,6 @@ bool AIScriptMurray::ChangeAnimationMode(int mode) {
_animationFrame = 0;
_flag = false;
break;
-
- default:
- break;
}
return true;
diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp
index 5bb9dce..9e0c0fa 100644
--- a/engines/bladerunner/script/scene/hf01.cpp
+++ b/engines/bladerunner/script/scene/hf01.cpp
@@ -24,18 +24,27 @@
namespace BladeRunner {
+enum kHF01Loops {
+ kHF01LoopInshot = 0,
+ kHF01LoopMainLoopSpinner = 1,
+ kHF01LoopDoorAnim = 3,
+ kHF01LoopOutshoot = 4,
+ kHF01LoopMainLoopNoSpinner = 5
+};
+
void SceneScriptHF01::InitializeScene() {
if (Game_Flag_Query(617)) {
Setup_Scene_Information(243.94f, 8.0f, -341.9f, 342);
} else if (Game_Flag_Query(kFlagHF05toHF01)) {
Setup_Scene_Information(-202.0f, 0.0f, -619.0f, 407);
} else if (Game_Flag_Query(kFlagHF03toHF01)) {
- Setup_Scene_Information(124.0f, 8.0f, -880.0f, 455);
+ Setup_Scene_Information( 124.0f, 8.0f, -880.0f, 455);
} else if (Game_Flag_Query(kFlagHF02toHF01)) {
- Setup_Scene_Information(406.0f, 8.0f, -813.0f, 455);
+ Setup_Scene_Information( 406.0f, 8.0f, -813.0f, 455);
} else {
- Setup_Scene_Information(100.0f, 0.0f, -260.0f, 0);
+ Setup_Scene_Information( 100.0f, 0.0f, -260.0f, 0);
}
+
Scene_Exit_Add_2D_Exit(0, 81, 226, 169, 321, 0);
if (!Game_Flag_Query(663)) {
Scene_Exit_Add_2D_Exit(1, 304, 239, 492, 339, 0);
@@ -44,35 +53,37 @@ void SceneScriptHF01::InitializeScene() {
Scene_Exit_Add_2D_Exit(3, 0, 311, 66, 417, 2);
}
}
- Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(340, 25, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1);
- Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- 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);
- Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
+ Ambient_Sounds_Add_Looping_Sound( 54, 50, 0, 1);
+ Ambient_Sounds_Add_Looping_Sound(340, 25, 0, 1);
+ Ambient_Sounds_Add_Looping_Sound( 81, 60, 100, 1);
+ Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
+ 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);
+ Ambient_Sounds_Add_Sound( 68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Game_Flag_Query(kFlagSpinnerAtHF01)) {
if (!Game_Flag_Query(kFlagHF02toHF01)
&& !Game_Flag_Query(kFlagHF03toHF01)
&& !Game_Flag_Query(kFlagHF05toHF01)
) {
- Scene_Loop_Start_Special(0, 0, 0);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kHF01LoopInshot, false);
}
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kHF01LoopMainLoopSpinner);
} else if (Game_Flag_Query(663)) {
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kHF01LoopMainLoopSpinner);
} else {
- Scene_Loop_Set_Default(5);
+ Scene_Loop_Set_Default(kHF01LoopMainLoopNoSpinner);
}
}
@@ -100,13 +111,14 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) {
} else {
affectionTowardsActor = -1;
}
- if (actorId == kActorMia || actorId == kActorMurray) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 504.04f, 8.0f, -242.17f, 12, 1, false, 0)) {
+
+ if (actorId == kActorMia
+ || actorId == kActorMurray
+ ) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 504.04f, 8.0f, -242.17f, 12, true, false, 0)) {
ADQ_Flush();
Actor_Face_Actor(kActorMcCoy, kActorMurray, true);
- if (Game_Flag_Query(382)) {
- sub_4026B4();
- } else {
+ if (!Game_Flag_Query(kFlagHF01MurrayMiaTalk)) {
Actor_Says(kActorMcCoy, 1455, 15);
Actor_Says(kActorMurray, 40, 13);
Actor_Says(kActorMcCoy, 1460, 13);
@@ -118,22 +130,28 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) {
Actor_Face_Actor(kActorMurray, kActorMcCoy, true);
Actor_Says(kActorMurray, 70, 13);
Actor_Says(kActorMcCoy, 1470, 14);
- Actor_Says(kActorMia, 30, 3);
+ Actor_Says(kActorMia, 30, kAnimationModeTalk);
Actor_Says(kActorMurray, 80, 15);
- Actor_Says(kActorMia, 50, 3);
+ Actor_Says(kActorMia, 50, kAnimationModeTalk);
Actor_Says(kActorMurray, 110, 14);
- Game_Flag_Set(382);
+ Game_Flag_Set(kFlagHF01MurrayMiaTalk);
+ } else {
+ dialogueWithMiaAndMurray();
}
return true;
}
return false;
}
- if (affectionTowardsActor != -1 && actorId == affectionTowardsActor) {
- if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, actorId, 28, 1, false)) {
+
+ if (affectionTowardsActor != -1
+ && actorId == affectionTowardsActor
+ ) {
+ if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, actorId, 28, true, false)) {
if (Actor_Query_Goal_Number(affectionTowardsActor) == 599) {
Actor_Says(kActorMcCoy, 8630, 13);
return true;
}
+
if (Global_Variable_Query(kVariableChapter) == 5
&& (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1)
|| Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)
@@ -147,12 +165,12 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) {
Actor_Face_Actor(kActorMcCoy, affectionTowardsActor, true);
Actor_Face_Actor(affectionTowardsActor, kActorMcCoy, true);
if (affectionTowardsActor == kActorDektora) {
- sub_4032DC();
+ talkWithDektora();
} else if (affectionTowardsActor == kActorLucy) {
- sub_403484();
+ talkWithLucy();
}
Async_Actor_Walk_To_XYZ(affectionTowardsActor, -175.0f, 8.0f, -617.0f, 0, false);
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -137.0f, 8.0f, -577.0f, 0, 0, false, 1);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -137.0f, 8.0f, -577.0f, 0, false, false, 1);
Game_Flag_Set(kFlagHF01toHF05);
Set_Enter(kSetHF05, kSceneHF05);
}
@@ -173,6 +191,7 @@ bool SceneScriptHF01::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 8.0f, -724.0f, 0, true, false, 0)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 8.0f, -880.0f, 0, false, false, 0);
@@ -181,6 +200,7 @@ bool SceneScriptHF01::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 406.0f, 8.0f, -717.0f, 0, true, false, 0)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 406.0f, 8.0f, -813.0f, 0, false, false, 0);
@@ -189,6 +209,7 @@ bool SceneScriptHF01::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 3) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 100.0f, 0.0f, -260.0f, 0, true, false, 0)) {
Game_Flag_Reset(kFlagMcCoyInChinaTown);
@@ -197,70 +218,70 @@ bool SceneScriptHF01::ClickedOnExit(int exitId) {
Game_Flag_Reset(kFlagMcCoyInPoliceStation);
Game_Flag_Reset(kFlagMcCoyInBradburyBuilding);
Game_Flag_Reset(kFlagMcCoyInHysteriaHall);
- int spinnerDest = Spinner_Interface_Choose_Dest(3, false);
+ int spinnerDest = Spinner_Interface_Choose_Dest(kHF01LoopDoorAnim, false);
switch (spinnerDest) {
case kSpinnerDestinationPoliceStation:
Game_Flag_Set(kFlagMcCoyInPoliceStation);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtPS01);
Set_Enter(kSetPS01, kScenePS01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationMcCoysApartment:
Game_Flag_Set(kFlagMcCoyInMcCoyApartment);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtMA01);
Set_Enter(kSetMA01, kSceneMA01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationRuncitersAnimals:
Game_Flag_Set(kFlagMcCoyInRunciters);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtRC01);
Set_Enter(kSetRC01, kSceneRC01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationChinatown:
Game_Flag_Set(kFlagMcCoyInChinaTown);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtCT01);
Set_Enter(kSetCT01_CT12, kSceneCT01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationAnimoidRow:
Game_Flag_Set(kFlagMcCoyInTyrellBuilding);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtTB02);
Set_Enter(kSetTB02_TB03, kSceneTB02);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationTyrellBuilding:
Game_Flag_Set(kFlagMcCoyInAnimoidRow);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtAR01);
Set_Enter(kSetAR01_AR02, kSceneAR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationDNARow:
Game_Flag_Set(kFlagMcCoyInDNARow);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtDR01);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationBradburyBuilding:
Game_Flag_Set(kFlagMcCoyInBradburyBuilding);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtBB01);
Set_Enter(kSetBB01, kSceneBB01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
case kSpinnerDestinationNightclubRow:
Game_Flag_Set(kFlagMcCoyInNightclubRow);
Game_Flag_Reset(kFlagSpinnerAtHF01);
Game_Flag_Set(kFlagSpinnerAtNR01);
Set_Enter(kSetNR01, kSceneNR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kHF01LoopOutshoot, true);
break;
default:
Game_Flag_Set(kFlagMcCoyInHysteriaHall);
@@ -281,15 +302,23 @@ void SceneScriptHF01::SceneFrameAdvanced(int frame) {
if (frame == 10) {
Sound_Play(118, 40, 0, 0, 50);
}
- if (frame == 72 || frame == 193) {
+
+ if (frame == 72
+ || frame == 193
+ ) {
Sound_Play(116, 100, -50, -50, 50);
}
- if (frame == 88 || frame == 214) {
+
+ if (frame == 88
+ || frame == 214
+ ) {
Sound_Play(119, 100, -50, -50, 50);
}
+
if (frame == 242) {
Sound_Play(117, 40, -50, 80, 50);
}
+
if (Actor_Query_Goal_Number(kActorMurray) == 1) {
Actor_Set_Goal_Number(kActorMurray, 0);
}
@@ -301,7 +330,7 @@ void SceneScriptHF01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptHF01::PlayerWalkedIn() {
if (Game_Flag_Query(663)) {
ADQ_Flush();
- ADQ_Add(kActorOfficerGrayford, 280, 3);
+ ADQ_Add(kActorOfficerGrayford, 280, kAnimationModeTalk);
Actor_Put_In_Set(kActorOfficerLeary, kSetHF01);
Actor_Set_At_XYZ(kActorOfficerLeary, 8.2f, 8.0f, -346.67f, 1021);
Actor_Put_In_Set(kActorOfficerGrayford, kSetHF01);
@@ -309,7 +338,10 @@ void SceneScriptHF01::PlayerWalkedIn() {
Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 0, 100, 300, false);
Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 0, 100, 300, false);
}
- if (!Game_Flag_Query(kFlagCrazylegsArrested) && Actor_Query_Goal_Number(kActorCrazylegs) != 2) {
+
+ if (!Game_Flag_Query(kFlagCrazylegsArrested)
+ && Actor_Query_Goal_Number(kActorCrazylegs) != 2
+ ) {
if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)
&& Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy
&& Actor_Query_Goal_Number(kActorLucy) != 599
@@ -326,38 +358,44 @@ void SceneScriptHF01::PlayerWalkedIn() {
Actor_Set_Targetable(kActorDektora, true);
}
}
+
if (Game_Flag_Query(617)) {
Actor_Set_Goal_Number(kActorSteele, 280);
Game_Flag_Reset(617);
//return true;
return;
}
+
if (Game_Flag_Query(652)) {
Game_Flag_Reset(652);
Actor_Voice_Over(950, kActorVoiceOver);
Actor_Voice_Over(960, kActorVoiceOver);
Actor_Voice_Over(970, kActorVoiceOver);
Actor_Voice_Over(980, kActorVoiceOver);
- } else if (!Game_Flag_Query(377) && Global_Variable_Query(kVariableChapter) < 4) {
+ } else if (!Game_Flag_Query(kFlagHF01MurrayMiaIntro)
+ && Global_Variable_Query(kVariableChapter) < 4
+ ) {
ADQ_Flush();
ADQ_Add(kActorMurray, 0, 14);
- ADQ_Add(kActorMurray, 10, 3);
- ADQ_Add(kActorMia, 0, 3);
+ ADQ_Add(kActorMurray, 10, kAnimationModeTalk);
+ ADQ_Add(kActorMia, 0, kAnimationModeTalk);
Actor_Face_Actor(kActorMurray, kActorMia, true);
ADQ_Add(kActorMurray, 20, 13);
- ADQ_Add(kActorMia, 10, 3);
- ADQ_Add(kActorMurray, 30, 3);
- ADQ_Add(kActorMia, 20, 3);
+ ADQ_Add(kActorMia, 10, kAnimationModeTalk);
+ ADQ_Add(kActorMurray, 30, kAnimationModeTalk);
+ ADQ_Add(kActorMia, 20, kAnimationModeTalk);
Actor_Face_Heading(kActorMurray, 271, false);
- Game_Flag_Set(377);
+ Game_Flag_Set(kFlagHF01MurrayMiaIntro);
}
+
if (Game_Flag_Query(kFlagHF03toHF01)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 8.0f, -724.0f, 0, 1, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 8.0f, -724.0f, 0, true, false, 0);
} else if (Game_Flag_Query(kFlagHF02toHF01)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 406.0f, 8.0f, -717.0f, 0, 1, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 406.0f, 8.0f, -717.0f, 0, true, false, 0);
} else if (!Game_Flag_Query(kFlagHF05toHF01)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 100.0f, 0.0f, -300.0f, 0, 1, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 100.0f, 0.0f, -300.0f, 0, true, false, 0);
}
+
Game_Flag_Reset(kFlagHF03toHF01);
Game_Flag_Reset(kFlagHF02toHF01);
Game_Flag_Reset(kFlagHF05toHF01);
@@ -367,6 +405,7 @@ void SceneScriptHF01::PlayerWalkedIn() {
void SceneScriptHF01::PlayerWalkedOut() {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
+
if (!Game_Flag_Query(kFlagHF01toHF05)
&& !Game_Flag_Query(kFlagHF01toHF02)
&& !Game_Flag_Query(kFlagHF01toHF03)
@@ -378,11 +417,13 @@ void SceneScriptHF01::PlayerWalkedOut() {
Outtake_Play(kOuttakeTowards3, true, -1);
}
Game_Flag_Reset(722);
+
if (Actor_Query_Goal_Number(kActorLucy) == 450) {
Actor_Put_In_Set(kActorLucy, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorLucy, 39, 0);
Actor_Set_Goal_Number(kActorLucy, 599);
}
+
if (Actor_Query_Goal_Number(kActorDektora) == 450) {
Actor_Put_In_Set(kActorDektora, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorDektora, 39, 0);
@@ -393,46 +434,50 @@ void SceneScriptHF01::PlayerWalkedOut() {
void SceneScriptHF01::DialogueQueueFlushed(int a1) {
}
-void SceneScriptHF01::sub_4026B4() {
+void SceneScriptHF01::dialogueWithMiaAndMurray() {
Dialogue_Menu_Clear_List();
if (Actor_Clue_Query(kActorMcCoy, kClueLucy)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(440, 8, 6, 3);
+ DM_Add_To_List_Never_Repeat_Once_Selected(440, 8, 6, 3); // LUCY PHOTO
}
if (!Actor_Clue_Query(kActorMcCoy, kClueLucy)
&& Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA)
) {
- DM_Add_To_List_Never_Repeat_Once_Selected(450, 7, 6, 3);
+ DM_Add_To_List_Never_Repeat_Once_Selected(450, 7, 6, 3); // LUCY
}
if (Actor_Clue_Query(kActorMcCoy, kClueCheese)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(460, 3, 5, 6);
+ DM_Add_To_List_Never_Repeat_Once_Selected(460, 3, 5, 6); // CHEESE
}
if (Actor_Clue_Query(kActorMcCoy, kClueLichenDogWrapper)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(470, -1, 3, 8);
+ DM_Add_To_List_Never_Repeat_Once_Selected(470, -1, 3, 8); // LICHEN DOG WRAPPER
}
- Dialogue_Menu_Add_DONE_To_List(480);
+ Dialogue_Menu_Add_DONE_To_List(480); // DONE
+
Dialogue_Menu_Appear(320, 240);
int answer = Dialogue_Menu_Query_Input();
Dialogue_Menu_Disappear();
+
switch (answer) {
- case 440:
+ case 440: // LUCY PHOTO
Actor_Says(kActorMcCoy, 1480, 15);
- Actor_Says(kActorMia, 70, 3);
- Actor_Says(kActorMurray, 120, 3);
+ Actor_Says(kActorMia, 70, kAnimationModeTalk);
+ Actor_Says(kActorMurray, 120, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 1505, 14);
- Actor_Says(kActorMia, 80, 3);
- Actor_Says(kActorMurray, 130, 3);
- Actor_Says(kActorMia, 90, 3);
+ Actor_Says(kActorMia, 80, kAnimationModeTalk);
+ Actor_Says(kActorMurray, 130, kAnimationModeTalk);
+ Actor_Says(kActorMia, 90, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 1510, 12);
break;
- case 450:
+
+ case 450: // LUCY
Actor_Says(kActorMcCoy, 1485, 16);
- Actor_Says(kActorMia, 100, 3);
+ Actor_Says(kActorMia, 100, kAnimationModeTalk);
Actor_Says(kActorMurray, 140, 12);
- Actor_Says(kActorMia, 110, 3);
- Actor_Says(kActorMia, 120, 3);
+ Actor_Says(kActorMia, 110, kAnimationModeTalk);
+ Actor_Says(kActorMia, 120, kAnimationModeTalk);
Actor_Says(kActorMurray, 150, 14);
break;
- case 460:
+
+ case 460: // CHEESE
Actor_Says(kActorMcCoy, 1490, 13);
Actor_Says(kActorMurray, 160, 15);
Actor_Says(kActorMia, 130, 13);
@@ -440,7 +485,7 @@ void SceneScriptHF01::sub_4026B4() {
Actor_Says(kActorMurray, 180, 13);
Actor_Says(kActorMurray, 190, 14);
Actor_Says(kActorMcCoy, 1515, 15);
- Actor_Says(kActorMurray, 200, 3);
+ Actor_Says(kActorMurray, 200, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 1520, 15);
Actor_Says(kActorMurray, 210, 13);
Actor_Says(kActorMurray, 220, 13);
@@ -448,51 +493,53 @@ void SceneScriptHF01::sub_4026B4() {
Actor_Says(kActorMurray, 230, 13);
Actor_Clue_Acquire(kActorMcCoy, kClueSpecialIngredient, false, kActorMurray);
break;
- case 470:
+
+ case 470: // LICHEN DOG WRAPPER
Actor_Says(kActorMcCoy, 1495, 14);
Actor_Face_Actor(kActorMurray, kActorMcCoy, true);
Actor_Says(kActorMurray, 240, 13);
Actor_Face_Actor(kActorMurray, kActorMia, true);
break;
- case 480:
+
+ case 480: // DONE
Actor_Says(kActorMcCoy, 1500, 16);
break;
}
}
-void SceneScriptHF01::sub_4032DC() {
- Actor_Says(kActorDektora, 0, 3);
- Actor_Says(kActorMcCoy, 1400, 3);
- Actor_Says(kActorDektora, 10, 3);
- Actor_Says(kActorMcCoy, 1405, 3);
- Actor_Says(kActorDektora, 20, 3);
- Actor_Says(kActorMcCoy, 1410, 3);
- Actor_Says(kActorDektora, 30, 3);
- Actor_Says(kActorMcCoy, 1415, 3);
- Actor_Says(kActorDektora, 40, 3);
- Actor_Says(kActorDektora, 50, 3);
- Actor_Says(kActorDektora, 60, 3);
- Actor_Says(kActorDektora, 70, 3);
- Actor_Says(kActorMcCoy, 1420, 3);
- Actor_Says(kActorDektora, 80, 3);
+void SceneScriptHF01::talkWithDektora() {
+ Actor_Says(kActorDektora, 0, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1400, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 10, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1405, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 20, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1410, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 30, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1415, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 40, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 50, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 60, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 70, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1420, kAnimationModeTalk);
+ Actor_Says(kActorDektora, 80, kAnimationModeTalk);
}
-void SceneScriptHF01::sub_403484() {
- Actor_Says(kActorLucy, 0, 3);
- Actor_Says(kActorMcCoy, 1425, 3);
- Actor_Says(kActorLucy, 10, 3);
- Actor_Says(kActorLucy, 20, 3);
- Actor_Says(kActorMcCoy, 1430, 3);
- Actor_Says(kActorLucy, 30, 3);
- Actor_Says(kActorMcCoy, 1435, 3);
- Actor_Says(kActorLucy, 40, 3);
- Actor_Says(kActorLucy, 50, 3);
- Actor_Says(kActorMcCoy, 1440, 3);
- Actor_Says(kActorLucy, 60, 3);
- Actor_Says(kActorLucy, 70, 3);
- Actor_Says(kActorMcCoy, 1445, 3);
- Actor_Says(kActorLucy, 80, 3);
- Actor_Says(kActorLucy, 3030, 3);
+void SceneScriptHF01::talkWithLucy() {
+ Actor_Says(kActorLucy, 0, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1425, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 10, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 20, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1430, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 30, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1435, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 40, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 50, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1440, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 60, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 70, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 1445, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 80, kAnimationModeTalk);
+ Actor_Says(kActorLucy, 3030, kAnimationModeTalk);
}
} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index 8823c12..31486c1 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -300,6 +300,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
ADQ_Add(kActorSteele, 1040, 3);
ADQ_Add(kActorGordo, 120, 82);
}
+
if (Game_Flag_Query(604)) {
if (Game_Flag_Query(622)) {
ADQ_Add(kActorHanoi, 150, 3);
@@ -310,12 +311,14 @@ void SceneScriptNR01::PlayerWalkedIn() {
//return true;
return;
}
+
if (Game_Flag_Query(632)) {
Delay(3500);
Set_Enter(kSetNR11, kSceneNR11);
//return true;
return;
}
+
if (Game_Flag_Query(534)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -380.0f, 31.73f, -841.0f, 0, false, false, 0);
Game_Flag_Reset(534);
@@ -406,6 +409,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 48.0f, 23.88f, -189.0f, 0, 0, false, 0);
}
}
+
if (Game_Flag_Query(652)) {
Game_Flag_Reset(652);
Actor_Voice_Over(950, kActorVoiceOver);
@@ -413,6 +417,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
Actor_Voice_Over(970, kActorVoiceOver);
Actor_Voice_Over(980, kActorVoiceOver);
}
+
if (Actor_Query_Goal_Number(kActorGordo) == 240) {
Scene_Exits_Disable();
Actor_Set_Goal_Number(kActorGordo, 241);
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index b565351..f5bd9dc 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -197,9 +197,9 @@ DECLARE_SCRIPT(HC04)
END_SCRIPT
DECLARE_SCRIPT(HF01)
- void sub_4026B4();
- void sub_4032DC();
- void sub_403484();
+ void dialogueWithMiaAndMurray();
+ void talkWithDektora();
+ void talkWithLucy();
END_SCRIPT
DECLARE_SCRIPT(HF02)
Commit: 2bea2307111c8ab1f072b899cbc4780f31ffd162
https://github.com/scummvm/scummvm/commit/2bea2307111c8ab1f072b899cbc4780f31ffd162
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:49:00+01:00
Commit Message:
BLADERUNNER: Initial cleanup of HF02 & HF03
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/init_script.cpp
engines/bladerunner/script/scene/hf02.cpp
engines/bladerunner/script/scene/hf03.cpp
engines/bladerunner/script/scene/hf04.cpp
engines/bladerunner/script/scene_script.h
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 59e6383..6ab99e7 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -901,6 +901,8 @@ enum Flags {
kFlagTB06KitchenBoxTaken = 520,
kFlagHC03TrapDoorOpened = 521,
kFlagCT10Entered = 525,
+ kFlagHF02toHF03 = 527,
+ kFlagHF03toHF02 = 528,
kFlagCT11toDR01 = 531,
kFlagCT09Entered = 538,
kFlagCT09LeonInterrupted = 539,
@@ -910,9 +912,12 @@ enum Flags {
kFlagDR06MannequinHeadOpen = 548,
kFlagMcCoyTiedDown = 550,
kFlagDR01toCT11 = 558,
+ kFlagHF03toHF04 = 566, // is never checked
+ kFlagHF04toHF03 = 567,
kFlagKIAPrivacyAddonIntro = 599,
kFlagTB07toTB02 = 608,
kFlagTB07RachaelTalk = 612,
+ kFlagHF03LucyTalk = 613,
kFlagTB07TyrellMeeting = 625,
kFlagCT11DogWrapperTaken = 645,
kFlagMA04McCoySleeping = 647,
@@ -1096,10 +1101,10 @@ enum Scenes {
kSceneHC01 = 31, // Hawker's Circle - Green pawn - Outside
kSceneHC02 = 32, // Hawker's Circle - China bar
kSceneHC03 = 33, // Hawker's Circle - Green pawn - Inside
- kSceneHF01 = 34, // Hysteria Hall - Iutside
- kSceneHF02 = 35,
- kSceneHF03 = 36,
- kSceneHF04 = 37,
+ kSceneHF01 = 34, // Hysteria Hall - Outside
+ kSceneHF02 = 35, // Hysteria Hall - Hall of Mirrors - Outside
+ kSceneHF03 = 36, // Hysteria Hall - Arcade
+ kSceneHF04 = 37, // Hysteria Hall - Hall of Mirrors - Inside
kSceneHF05 = 38,
kSceneHF06 = 39,
kSceneHF07 = 40,
diff --git a/engines/bladerunner/script/init_script.cpp b/engines/bladerunner/script/init_script.cpp
index aa3f007..9244c77 100644
--- a/engines/bladerunner/script/init_script.cpp
+++ b/engines/bladerunner/script/init_script.cpp
@@ -79,30 +79,43 @@ void InitScript::Init_Game_Flags() {
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(kFlagIzoIsReplicant);
}
+
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(kFlagGordoIsReplicant);
}
+
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(kFlagLucyIsReplicant);
}
+
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(kFlagDektoraIsReplicant);
}
+
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(kFlagSadikIsReplicant);
}
+
if (Random_Query(1, 2) == 1) {
Game_Flag_Set(560);
}
- if (!Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant) && !Game_Flag_Query(kFlagDektoraIsReplicant)) {
+
+ if (!Game_Flag_Query(kFlagGordoIsReplicant)
+ && !Game_Flag_Query(kFlagLucyIsReplicant)
+ && !Game_Flag_Query(kFlagDektoraIsReplicant)
+ ) {
Game_Flag_Set(kFlagDektoraIsReplicant);
}
if (Game_Flag_Query(kFlagDektoraIsReplicant)) {
Global_Variable_Set(40, 1);
- } else if (Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant)) {
+ } else if ( Game_Flag_Query(kFlagGordoIsReplicant)
+ && !Game_Flag_Query(kFlagLucyIsReplicant)
+ ) {
Global_Variable_Set(40, 2);
- } else if (!Game_Flag_Query(kFlagGordoIsReplicant) && Game_Flag_Query(kFlagLucyIsReplicant)) {
+ } else if (!Game_Flag_Query(kFlagGordoIsReplicant)
+ && Game_Flag_Query(kFlagLucyIsReplicant)
+ ) {
Global_Variable_Set(40, 3);
} else if (Random_Query(1, 2) == 1) {
Global_Variable_Set(40, 2);
diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp
index c7a1795..936b11f 100644
--- a/engines/bladerunner/script/scene/hf02.cpp
+++ b/engines/bladerunner/script/scene/hf02.cpp
@@ -25,18 +25,20 @@
namespace BladeRunner {
void SceneScriptHF02::InitializeScene() {
- if (Game_Flag_Query(567)) {
+ if (Game_Flag_Query(kFlagHF04toHF03)) {
Setup_Scene_Information(874.0f, 47.76f, -252.0f, 775);
- Game_Flag_Reset(567);
- } else if (Game_Flag_Query(528)) {
+ Game_Flag_Reset(kFlagHF04toHF03);
+ } else if (Game_Flag_Query(kFlagHF03toHF02)) {
Setup_Scene_Information(470.0f, 47.76f, -500.0f, 560);
} else {
Setup_Scene_Information(-18.0f, 47.76f, -288.0f, 275);
}
- Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
+
+ Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
Scene_Exit_Add_2D_Exit(1, 207, 66, 272, 207, 3);
+
Ambient_Sounds_Add_Looping_Sound(340, 28, -100, 1);
- Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1);
+ Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1);
Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
@@ -84,7 +86,7 @@ bool SceneScriptHF02::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptHF02::ClickedOnExit(int exitId) {
if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(kFlagHF02toHF01);
@@ -92,11 +94,12 @@ bool SceneScriptHF02::ClickedOnExit(int exitId) {
}
return true;
}
+
if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Game_Flag_Set(527);
+ Game_Flag_Set(kFlagHF02toHF03);
Set_Enter(kSetHF03, kSceneHF03);
}
return true;
@@ -119,13 +122,15 @@ void SceneScriptHF02::PlayerWalkedIn() {
if (Actor_Query_Goal_Number(kActorSteele) == 240) {
Actor_Set_Goal_Number(kActorSteele, 241);
}
- if (Game_Flag_Query(528)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, 0, false, 0);
- Game_Flag_Reset(528);
+
+ if (Game_Flag_Query(kFlagHF03toHF02)) {
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, false, false, 0);
+ Game_Flag_Reset(kFlagHF03toHF02);
} else if (Game_Flag_Query(kFlagHF01toHF02)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, false, false, 0);
Game_Flag_Reset(kFlagHF01toHF02);
}
+
if (Actor_Query_Goal_Number(kActorSteele) == 243) {
if (Actor_Query_Goal_Number(kActorLucy) == 599) {
Actor_Set_Goal_Number(kActorSteele, 244);
diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp
index c0bdf23..591861c 100644
--- a/engines/bladerunner/script/scene/hf03.cpp
+++ b/engines/bladerunner/script/scene/hf03.cpp
@@ -25,14 +25,16 @@
namespace BladeRunner {
void SceneScriptHF03::InitializeScene() {
- if (Game_Flag_Query(527)) {
- Setup_Scene_Information(479.0f, 47.76f, -496.0f, 600);
+ if (Game_Flag_Query(kFlagHF02toHF03)) {
+ Setup_Scene_Information( 479.0f, 47.76f, -496.0f, 600);
} else {
Setup_Scene_Information(185.62f, 47.76f, -867.42f, 300);
}
- Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
- Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1);
+
+ Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
+ Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1);
Scene_Exit_Add_2D_Exit(2, 323, 110, 380, 166, 0);
+
Ambient_Sounds_Add_Looping_Sound(340, 50, 0, 1);
Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
@@ -61,18 +63,20 @@ bool SceneScriptHF03::ClickedOn3DObject(const char *objectName, bool a2) {
return false;
}
-void SceneScriptHF03::sub_401C80() {
+void SceneScriptHF03::dialogueWithLucy() {
Dialogue_Menu_Clear_List();
- DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8);
- DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2);
- DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1);
- DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6);
- Dialogue_Menu_Add_DONE_To_List(880);
+ DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8); // VOIGT-KAMPFF
+ DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2); // FATHER
+ DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1); // CRYSTAL
+ DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6); // RUNCITER
+ Dialogue_Menu_Add_DONE_To_List(880); // DONE
+
Dialogue_Menu_Appear(320, 240);
int answer = Dialogue_Menu_Query_Input();
Dialogue_Menu_Disappear();
+
switch (answer) {
- case 840:
+ case 840: // VOIGT-KAMPFF
Actor_Says(kActorMcCoy, 1630, 15);
if (Global_Variable_Query(40) == 3) {
Actor_Set_Goal_Number(kActorLucy, 214);
@@ -83,12 +87,14 @@ void SceneScriptHF03::sub_401C80() {
Game_Flag_Set(593);
}
break;
- case 850:
+
+ case 850: // FATHER
Actor_Says(kActorMcCoy, 1635, 15);
Actor_Says(kActorLucy, 200, 13);
Actor_Modify_Friendliness_To_Other(kActorLucy, kActorMcCoy, 3);
break;
- case 860:
+
+ case 860: // CRYSTAL
Actor_Says(kActorMcCoy, 1640, 12);
if (Global_Variable_Query(40) == 3) {
Actor_Set_Goal_Number(kActorLucy, 214);
@@ -129,7 +135,8 @@ void SceneScriptHF03::sub_401C80() {
}
}
break;
- case 870:
+
+ case 870: // RUNCITER
Actor_Says(kActorMcCoy, 1645, 18);
Actor_Says(kActorLucy, 240, 14);
Actor_Says(kActorLucy, 250, 12);
@@ -144,18 +151,24 @@ void SceneScriptHF03::sub_401C80() {
Actor_Says(kActorLucy, 310, 13);
Actor_Clue_Acquire(kActorMcCoy, kClueLucyInterview, false, kActorLucy);
break;
- case 880:
+
+ case 880: // DONE
Actor_Says(kActorMcCoy, 1650, 14);
break;
}
}
bool SceneScriptHF03::ClickedOnActor(int actorId) {
- if (actorId == kActorLucy && Actor_Query_Goal_Number(kActorLucy) == 205) {
- if (Game_Flag_Query(kFlagLucyIsReplicant) ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, 1, false)) {
+ if (actorId == kActorLucy
+ && Actor_Query_Goal_Number(kActorLucy) == 205
+ ) {
+ if (Game_Flag_Query(kFlagLucyIsReplicant)
+ ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, true, false)
+ : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, true, false)
+ ) {
Actor_Face_Actor(kActorMcCoy, kActorLucy, true);
- if (!Game_Flag_Query(613)) {
- Game_Flag_Set(613);
+ if (!Game_Flag_Query(kFlagHF03LucyTalk)) {
+ Game_Flag_Set(kFlagHF03LucyTalk);
if (Game_Flag_Query(kFlagLucyIsReplicant)) {
Actor_Says(kActorMcCoy, 1605, 15);
Actor_Says(kActorLucy, 100, 12);
@@ -178,7 +191,8 @@ bool SceneScriptHF03::ClickedOnActor(int actorId) {
Actor_Says(kActorLucy, 190, 15);
}
}
- sub_401C80();
+
+ dialogueWithLucy();
}
}
return false;
@@ -190,22 +204,24 @@ bool SceneScriptHF03::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptHF03::ClickedOnExit(int exitId) {
if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 46.76f, -824.0f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 46.76f, -824.0f, 0, true, false, 0)) {
Game_Flag_Set(kFlagHF03toHF01);
Set_Enter(kSetHF01, kSceneHF01);
}
return true;
}
+
if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, 1, false, 0)) {
- Game_Flag_Set(528);
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, true, false, 0)) {
+ Game_Flag_Set(kFlagHF03toHF02);
Set_Enter(kSetHF02, kSceneHF02);
}
return true;
}
+
if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 942.0f, 47.76f, -847.0f, 0, 1, false, 0)) {
- Game_Flag_Set(566);
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 942.0f, 47.76f, -847.0f, 0, true, false, 0)) {
+ Game_Flag_Set(kFlagHF03toHF04);
Set_Enter(kSetHF04, kSceneHF04);
}
return true;
@@ -224,13 +240,14 @@ void SceneScriptHF03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptHF03::PlayerWalkedIn() {
- if (Game_Flag_Query(527)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, 0, false, 0);
- Game_Flag_Reset(527);
+ if (Game_Flag_Query(kFlagHF02toHF03)) {
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, false, false, 0);
+ Game_Flag_Reset(kFlagHF02toHF03);
} else {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 47.76f, -824.0f, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 47.76f, -824.0f, 0, false, false, 0);
Game_Flag_Reset(kFlagHF01toHF03);
}
+
if (Actor_Query_Goal_Number(kActorLucy) == 250) {
Actor_Set_Goal_Number(kActorLucy, 212);
Actor_Says(kActorSteele, 210, 13);
diff --git a/engines/bladerunner/script/scene/hf04.cpp b/engines/bladerunner/script/scene/hf04.cpp
index c03157f..9dde7ac 100644
--- a/engines/bladerunner/script/scene/hf04.cpp
+++ b/engines/bladerunner/script/scene/hf04.cpp
@@ -26,16 +26,19 @@ namespace BladeRunner {
void SceneScriptHF04::InitializeScene() {
Setup_Scene_Information(-33.85f, -0.31f, 395.0f, 0);
- Game_Flag_Reset(566);
+ Game_Flag_Reset(kFlagHF03toHF04);
+
Scene_Exit_Add_2D_Exit(0, 602, 104, 639, 177, 1);
- Ambient_Sounds_Add_Looping_Sound(70, 35, 0, 1);
+
+ Ambient_Sounds_Add_Looping_Sound( 70, 35, 0, 1);
Ambient_Sounds_Add_Looping_Sound(109, 40, 0, 1);
- Ambient_Sounds_Add_Sound(72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(303, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(304, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(305, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0);
+
if (Game_Flag_Query(584)) {
Scene_Loop_Set_Default(3);
} else {
@@ -82,10 +85,10 @@ bool SceneScriptHF04::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptHF04::ClickedOnExit(int exitId) {
if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1132.27f, -0.31f, -113.46f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1132.27f, -0.31f, -113.46f, 0, true, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Game_Flag_Set(567);
+ Game_Flag_Set(kFlagHF04toHF03);
Set_Enter(kSetHF02, kSceneHF02);
}
return true;
@@ -101,12 +104,17 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
if (frame == 62) {
Sound_Play(359, Random_Query(43, 43), 0, 0, 50);
}
+
if (frame == 154) {
Sound_Play(360, Random_Query(43, 43), 0, 0, 50);
}
- if (frame == 179 && Actor_Query_Goal_Number(kActorLucy) == 235) {
+
+ if (frame == 179
+ && Actor_Query_Goal_Number(kActorLucy) == 235
+ ) {
Actor_Set_Goal_Number(kActorLucy, 236);
}
+
if (Game_Flag_Query(585)) {
Game_Flag_Reset(585);
Scene_Loop_Set_Default(3);
@@ -114,13 +122,14 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
//return true;
return;
}
+
if (Game_Flag_Query(586)) {
Game_Flag_Reset(586);
Scene_Loop_Set_Default(0);
Scene_Loop_Start_Special(kSceneLoopModeOnce, 5, true);
- //return true;
- return;
+ return; // true;
}
+
if (frame == 89) {
Game_Flag_Set(584);
Obstacle_Object("HIDE_WALL_A", false);
@@ -128,9 +137,9 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
Unobstacle_Object("PIVOT_WALL#1", false);
Unobstacle_Object("PIVOT_WALL#02", false);
Unobstacle_Object("PIVOT_WALL#03", true);
- //return true;
- return;
+ return; // true;
}
+
if (frame == 180) {
Unobstacle_Object("HIDE_WALL_A", false);
Unobstacle_Object("HIDE_WALL_B", false);
@@ -141,8 +150,7 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
if (Actor_Query_Goal_Number(kActorLucy) == 234) {
Actor_Set_Goal_Number(kActorLucy, 235);
}
- //return true;
- return;
+ return; // true;
}
//return false;
}
@@ -151,11 +159,13 @@ void SceneScriptHF04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptHF04::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorLucy) == 230 || Actor_Query_Goal_Number(kActorLucy) == 233) {
+ if (Actor_Query_Goal_Number(kActorLucy) == 230
+ || Actor_Query_Goal_Number(kActorLucy) == 233
+ ) {
Player_Set_Combat_Mode(true);
Music_Play(1, 60, 0, 2, -1, 0, 0);
}
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -45.0f, -0.31f, 307.0f, 0, 0, true, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -45.0f, -0.31f, 307.0f, 0, false, true, 0);
Delay(2500);
}
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index f5bd9dc..84f7099 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -206,7 +206,7 @@ DECLARE_SCRIPT(HF02)
END_SCRIPT
DECLARE_SCRIPT(HF03)
- void sub_401C80();
+ void dialogueWithLucy();
END_SCRIPT
DECLARE_SCRIPT(HF04)
Commit: de1dabd072d0b24d0d2a847a290d7eefc84b7e6e
https://github.com/scummvm/scummvm/commit/de1dabd072d0b24d0d2a847a290d7eefc84b7e6e
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:49:00+01:00
Commit Message:
BLADERUNNER: Cleanup & fix of Lucy chase scripts
First wait-point in Hystersia Maze was incorrectly triggered
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/early_q.cpp
engines/bladerunner/script/ai/gordo.cpp
engines/bladerunner/script/ai/holloway.cpp
engines/bladerunner/script/ai/lucy.cpp
engines/bladerunner/script/ai/steele.cpp
engines/bladerunner/script/ai_script.h
engines/bladerunner/script/init_script.cpp
engines/bladerunner/script/scene/hf02.cpp
engines/bladerunner/script/scene/hf03.cpp
engines/bladerunner/script/scene/hf04.cpp
engines/bladerunner/script/scene/nr01.cpp
engines/bladerunner/script/scene/nr11.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 6ab99e7..be77941 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -914,6 +914,10 @@ enum Flags {
kFlagDR01toCT11 = 558,
kFlagHF03toHF04 = 566, // is never checked
kFlagHF04toHF03 = 567,
+ kFlagHF04DoorsClosed = 584,
+ kFlagHF04CloseDoors = 585,
+ kFlagHF04OpenDoors = 586,
+ kFlagLucyRanAway = 593,
kFlagKIAPrivacyAddonIntro = 599,
kFlagTB07toTB02 = 608,
kFlagTB07RachaelTalk = 612,
@@ -975,6 +979,7 @@ enum Variables {
kVariableWalkLoopActor = 37,
kVariableWalkLoopRun = 38,
kVariableDR06MannequinHeadOpened = 39,
+ kVariableBehavior = 40, // 1 dektora is replicant, 2 - ?, 3 - get caught by Baker
kVariableMcCoyDrinks = 42, // is never checked
kVariableAffectionTowards = 45, // 0 none, 1 steele, 2 dektora, 3 lucy
kVariableGunPulledInFrontOfSebastian = 46,
@@ -1102,9 +1107,9 @@ enum Scenes {
kSceneHC02 = 32, // Hawker's Circle - China bar
kSceneHC03 = 33, // Hawker's Circle - Green pawn - Inside
kSceneHF01 = 34, // Hysteria Hall - Outside
- kSceneHF02 = 35, // Hysteria Hall - Hall of Mirrors - Outside
+ kSceneHF02 = 35, // Hysteria Hall - Hall of Mirrors - Exit
kSceneHF03 = 36, // Hysteria Hall - Arcade
- kSceneHF04 = 37, // Hysteria Hall - Hall of Mirrors - Inside
+ kSceneHF04 = 37, // Hysteria Hall - Hall of Mirrors
kSceneHF05 = 38,
kSceneHF06 = 39,
kSceneHF07 = 40,
@@ -1562,6 +1567,33 @@ enum GoalClovis {
kGoalClovisBB11TalkToMcCoy = 105 // ends Chapter 2
};
+enum GoalLucy {
+ kGoalLucyDefault = 0,
+ kGoalLucyMoveAround = 200,
+ kGoalLucyWillReturnToHF03 = 201,
+ kGoalLucyGoToHF03 = 205,
+ kGoalLucyRunOutPhase1 = 210,
+ kGoalLucyRunOutPhase2 = 211,
+ kGoalLucyRunToHF041 = 212,
+ kGoalLucyRunToHF042 = 213,
+ kGoalLucyRunAwayWithHelp1 = 214,
+ kGoalLucyRunAwayWithHelp2 = 215,
+ kGoalLucyGoToFreeSlotGAG = 220,
+ kGoalLucyGoToFreeSlotGAHJ = 225,
+ kGoalLucyHF04Start = 230,
+ kGoalLucyHF04TalkToMcCoy = 232,
+ kGoalLucyHF04Run1 = 233,
+ kGoalLucyHF04Run2 = 234,
+ kGoalLucyHF04WaitForMcCoy1 = 235,
+ kGoalLucyHF04Run3 = 236,
+ kGoalLucyHF04WaitForMcCoy2 = 237,
+ kGoalLucyHF04Run4 = 238,
+ kGoalLucyHF04WalkAway = 239,
+ kGoalLucyReturnToHF03 = 250,
+ kGoalLucyGoneChapter3 = 299,
+ kGoalLucyDead = 599
+};
+
enum GoalIzo {
kGoalIzoDefault = 0,
kGoalIzoPrepareCamera = 1,
diff --git a/engines/bladerunner/script/ai/early_q.cpp b/engines/bladerunner/script/ai/early_q.cpp
index 40cd1b2..826a339 100644
--- a/engines/bladerunner/script/ai/early_q.cpp
+++ b/engines/bladerunner/script/ai/early_q.cpp
@@ -281,7 +281,10 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Flush(kActorEarlyQ);
Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH);
Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0);
- if (Game_Flag_Query(47) == 1 && Game_Flag_Query(592) && Game_Flag_Query(593)) {
+ if (Game_Flag_Query(47) == 1
+ && Game_Flag_Query(592)
+ && Game_Flag_Query(kFlagLucyRanAway)
+ ) {
Actor_Set_Goal_Number(kActorEarlyQ, 220);
} else if (Game_Flag_Query(47)) {
Actor_Set_Goal_Number(kActorEarlyQ, 230);
diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp
index e5fcebb..5508512 100644
--- a/engines/bladerunner/script/ai/gordo.cpp
+++ b/engines/bladerunner/script/ai/gordo.cpp
@@ -176,7 +176,7 @@ void AIScriptGordo::CompletedMovementTrack() {
}
if (Actor_Query_Goal_Number(kActorGordo) == 222) {
if (Game_Flag_Query(kFlagGordoIsReplicant)) {
- if (Global_Variable_Query(40) == 2) {
+ if (Global_Variable_Query(kVariableBehavior) == 2) {
Actor_Set_Goal_Number(kActorGordo, 250);
} else {
Actor_Set_Goal_Number(kActorGordo, 230);
@@ -431,8 +431,8 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGordo);
break;
case 200:
- if (Global_Variable_Query(40) == 2) {
- if (Game_Flag_Query(593)
+ if (Global_Variable_Query(kVariableBehavior) == 2) {
+ if (Game_Flag_Query(kFlagLucyRanAway)
&& Game_Flag_Query(591)
&& Player_Query_Current_Scene() != kSceneNR02
) {
@@ -513,7 +513,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorGordo, 850, 12);
Actor_Says(kActorGordo, 860, 15);
Actor_Says(0, 3910, 16);
- if (Global_Variable_Query(40) == 2) {
+ if (Global_Variable_Query(kVariableBehavior) == 2) {
Actor_Says(kActorGordo, 870, 16);
Sound_Play(576, 50, 0, 0, 50);
Sound_Play(319, 50, 0, 0, 50);
diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp
index dc52107..9167064 100644
--- a/engines/bladerunner/script/ai/holloway.cpp
+++ b/engines/bladerunner/script/ai/holloway.cpp
@@ -49,7 +49,7 @@ bool AIScriptHolloway::Update() {
void AIScriptHolloway::TimerExpired(int timer) {
if (!timer) {
AI_Countdown_Timer_Reset(kActorHolloway, 0);
- if (Global_Variable_Query(40) == 1) {
+ if (Global_Variable_Query(kVariableBehavior) == 1) {
Player_Gains_Control();
}
Actor_Set_Goal_Number(kActorHolloway, 251);
@@ -169,7 +169,7 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Player_Gains_Control();
Outtake_Play(kOuttakeInterrogation, 0, 1);
- if (Global_Variable_Query(40) == 1) {
+ if (Global_Variable_Query(kVariableBehavior) == 1) {
Actor_Set_Goal_Number(kActorDektora, 245);
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
@@ -180,7 +180,7 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Put_In_Set(kActorHolloway, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorHolloway, 41, 0);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle);
- if (Global_Variable_Query(40) != 1) {
+ if (Global_Variable_Query(kVariableBehavior) != 1) {
Player_Gains_Control();
}
Game_Flag_Set(kFlagUG03toUG04);
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 0f53758..087e432 100644
--- a/engines/bladerunner/script/ai/lucy.cpp
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -36,57 +36,74 @@ void AIScriptLucy::Initialize() {
_flag = 0;
- Actor_Set_Goal_Number(kActorLucy, 0);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyDefault);
}
bool AIScriptLucy::Update() {
float x, y, z;
- if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorLucy) < 200) {
- Actor_Set_Goal_Number(kActorLucy, 200);
+ if (Global_Variable_Query(kVariableChapter) == 3
+ && Actor_Query_Goal_Number(kActorLucy) < kGoalLucyMoveAround
+ ) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyMoveAround);
}
- if (Actor_Query_Goal_Number(kActorLucy) == 230 && Player_Query_Current_Scene() == 37) {
- Actor_Set_Goal_Number(kActorLucy, 233);
+
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04Start
+ && Player_Query_Current_Scene() == kSceneHF04
+ ) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Run1);
}
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorLucy) < 300) {
+
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorLucy) < 300
+ ) {
Actor_Set_Goal_Number(kActorLucy, 300);
}
+
if (Global_Variable_Query(kVariableChapter) == 4
- && Actor_Query_Goal_Number(kActorLucy) == 599
- && Actor_Query_Which_Set_In(kActorLucy) != 99) {
+ && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyDead
+ && Actor_Query_Which_Set_In(kActorLucy) != 99
+ ) {
if (Actor_Query_Which_Set_In(kActorLucy) != Player_Query_Current_Set()) {
Actor_Put_In_Set(kActorLucy, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorLucy, 41, 0);
}
}
- if (Game_Flag_Query(616) && Actor_Query_Goal_Number(kActorLucy) == 201) {
+
+ if (Game_Flag_Query(616)
+ && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyWillReturnToHF03
+ ) {
Actor_Put_In_Set(kActorLucy, kSetHF03);
Actor_Set_At_Waypoint(kActorLucy, 371, 156);
- Actor_Set_Goal_Number(kActorLucy, 250);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyReturnToHF03);
}
- if (Actor_Query_Goal_Number(kActorLucy) > 229
- && Actor_Query_Goal_Number(kActorLucy) < 239
- && Actor_Query_Goal_Number(kActorLucy) != 232
- && Player_Query_Current_Scene() == 37
- && Actor_Query_Which_Set_In(kActorLucy) == 40
- && !Game_Flag_Query(701)
- && Actor_Query_Inch_Distance_From_Actor(kActorLucy, kActorMcCoy) < 84
- && !Player_Query_Combat_Mode()
- && Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 40) {
- Actor_Set_Goal_Number(kActorLucy, 232);
+
+ if ( Actor_Query_Goal_Number(kActorLucy) > 229
+ && Actor_Query_Goal_Number(kActorLucy) < 239
+ && Actor_Query_Goal_Number(kActorLucy) != kGoalLucyHF04TalkToMcCoy
+ && Player_Query_Current_Scene() == kSceneHF04
+ && Actor_Query_Which_Set_In(kActorLucy) == kSetHF04
+ && !Game_Flag_Query(701)
+ && Actor_Query_Inch_Distance_From_Actor(kActorLucy, kActorMcCoy) < 84
+ && !Player_Query_Combat_Mode()
+ && Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 40
+ ) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04TalkToMcCoy); // how can this be triggered?
}
- if (Actor_Query_Goal_Number(kActorLucy) == 235) {
+
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04WaitForMcCoy1) {
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
- if (z > -875.0f) {
- Game_Flag_Set(586);
- Actor_Set_Goal_Number(kActorLucy, 236);
+ if (z < -875.0f) {
+ Game_Flag_Set(kFlagHF04OpenDoors);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Run3);
}
}
- if (Actor_Query_Goal_Number(kActorLucy) == 237) {
+
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04WaitForMcCoy2) {
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
if (x > 350.0f) {
- Game_Flag_Set(585);
- Actor_Set_Goal_Number(kActorLucy, 238);
+ Game_Flag_Set(kFlagHF04CloseDoors);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Run4);
}
}
@@ -95,86 +112,93 @@ bool AIScriptLucy::Update() {
void AIScriptLucy::TimerExpired(int timer) {
AI_Countdown_Timer_Reset(kActorLucy, 0);
- if (!timer && Actor_Query_Goal_Number(kActorLucy) == 205) {
- if (Player_Query_Current_Scene() == 36) {
+ if (timer == 0
+ && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03
+ ) {
+ if (Player_Query_Current_Scene() == kSceneHF03) {
AI_Countdown_Timer_Start(kActorLucy, 0, 20);
} else {
- Actor_Set_Goal_Number(kActorLucy, 200);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyMoveAround);
}
}
}
void AIScriptLucy::CompletedMovementTrack() {
switch (Actor_Query_Goal_Number(kActorLucy)) {
- case 205:
- if (!Game_Flag_Query(616) || Global_Variable_Query(40) != 3) {
- AI_Countdown_Timer_Reset(kActorLucy, 0);
- AI_Countdown_Timer_Start(kActorLucy, 0, 30);
- return; //false;
+ case kGoalLucyGoToHF03:
+ if (Game_Flag_Query(616)
+ && Global_Variable_Query(kVariableBehavior) == 3
+ ) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyReturnToHF03);
+ return; //true;
}
- Actor_Set_Goal_Number(kActorLucy, 250);
- return; //true;
+ AI_Countdown_Timer_Reset(kActorLucy, 0);
+ AI_Countdown_Timer_Start(kActorLucy, 0, 30);
+ break;
- case 210:
- Actor_Set_Goal_Number(kActorLucy, 211);
+ case kGoalLucyRunOutPhase1:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase2);
break;
- case 211:
- Game_Flag_Set(593);
- Actor_Set_Goal_Number(kActorLucy, 299);
+ case kGoalLucyRunOutPhase2:
+ Game_Flag_Set(kFlagLucyRanAway);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoneChapter3);
break;
- case 212:
- Actor_Set_Goal_Number(kActorLucy, 213);
+ case kGoalLucyRunToHF041:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF042);
break;
- case 213:
- if (Actor_Clue_Query(kActorLucy, 219) && Global_Variable_Query(40) != 3) {
- Game_Flag_Set(593);
+ case kGoalLucyRunToHF042:
+ if (Actor_Clue_Query(kActorLucy, kClueMcCoyHelpedLucy)
+ && Global_Variable_Query(kVariableBehavior) != 3
+ ) {
+ Game_Flag_Set(kFlagLucyRanAway);
} else {
- Actor_Set_Goal_Number(kActorLucy, 230);
- Game_Flag_Reset(584);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Start);
+ Game_Flag_Reset(kFlagHF04DoorsClosed);
}
break;
- case 214:
- Actor_Set_Goal_Number(kActorLucy, 215);
+ case kGoalLucyRunAwayWithHelp1:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp2);
break;
- case 215:
- Actor_Set_Goal_Number(kActorLucy, 201);
+ case kGoalLucyRunAwayWithHelp2:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyWillReturnToHF03);
break;
- case 220:
- case 225:
- Actor_Set_Goal_Number(kActorLucy, 200);
+ case kGoalLucyGoToFreeSlotGAG:
+ case kGoalLucyGoToFreeSlotGAHJ:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyMoveAround);
break;
- case 233:
- Game_Flag_Set(585);
- Actor_Set_Goal_Number(kActorLucy, 234);
+ case kGoalLucyHF04Run1:
+ Game_Flag_Set(kFlagHF04CloseDoors);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Run2);
break;
- case 234:
- Actor_Set_Goal_Number(kActorLucy, 235);
+ case kGoalLucyHF04Run2:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WaitForMcCoy1);
break;
- case 236:
- Actor_Set_Goal_Number(kActorLucy, 237);
+ case kGoalLucyHF04Run3:
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WaitForMcCoy2);
break;
- case 238:
- Game_Flag_Set(593);
+ case kGoalLucyHF04Run4:
+ Game_Flag_Set(kFlagLucyRanAway);
Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
Actor_Set_At_Waypoint(kActorLucy, 33, 0);
Actor_Set_Health(kActorLucy, 30, 30);
- if (Global_Variable_Query(40) == 3) {
+
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
Actor_Set_Goal_Number(kActorSteele, 240);
}
break;
- case 239:
- Game_Flag_Set(593);
+ case kGoalLucyHF04WalkAway:
+ Game_Flag_Set(kFlagLucyRanAway);
break;
default:
@@ -188,9 +212,9 @@ void AIScriptLucy::ReceivedClue(int clueId, int fromActorId) {
}
void AIScriptLucy::ClickedByPlayer() {
- if (Actor_Query_Goal_Number(kActorLucy) == 599) {
- Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
- Actor_Says(kActorMcCoy, 8630, 3);
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyDead) {
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, true);
+ Actor_Says(kActorMcCoy, 8630, kAnimationModeTalk);
}
}
@@ -224,15 +248,24 @@ void AIScriptLucy::Retired(int byActorId) {
if (byActorId == kActorMcCoy) {
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -6);
}
- if ((byActorId == kActorSteele || byActorId == kActorMcCoy)
- && Actor_Query_In_Set(kActorSteele, kSetHF06)
- && Actor_Query_In_Set(kActorMcCoy, kSetHF06)) {
+
+ if ((byActorId == kActorSteele
+ || byActorId == kActorMcCoy
+ )
+ && Actor_Query_In_Set(kActorSteele, kSetHF06)
+ && Actor_Query_In_Set(kActorMcCoy, kSetHF06)
+ ) {
Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorMcCoy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false);
}
- if (Query_Difficulty_Level() && byActorId == kActorMcCoy && Game_Flag_Query(46)) {
- Global_Variable_Increment(2, 200);
+
+ if (Query_Difficulty_Level() != 0
+ && byActorId == kActorMcCoy
+ && Game_Flag_Query(kFlagLucyIsReplicant)
+ ) {
+ Global_Variable_Increment(kVariableChinyen, 200);
}
- Actor_Set_Goal_Number(kActorLucy, 599);
+
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyDead);
}
int AIScriptLucy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
@@ -240,94 +273,95 @@ int AIScriptLucy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId
}
bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
- if (!newGoalNumber) {
+ if (newGoalNumber == kGoalLucyDefault) {
Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
return false;
}
switch (newGoalNumber) {
- case 200:
- if (Global_Variable_Query(40) == 3) {
- if (Game_Flag_Query(591) && Game_Flag_Query(592) && Player_Query_Current_Scene() != 36) {
- Actor_Set_Goal_Number(kActorLucy, 205);
+ case kGoalLucyMoveAround:
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
+ if (Game_Flag_Query(591)
+ && Game_Flag_Query(592)
+ && Player_Query_Current_Scene() != kSceneHF03
+ ) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToHF03);
} else {
- if (Random_Query(1, 2) - 1) {
- Actor_Set_Goal_Number(kActorLucy, 225);
+ if (Random_Query(0, 1) == 1) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToFreeSlotGAHJ);
} else {
- Actor_Set_Goal_Number(kActorLucy, 220);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToFreeSlotGAG);
}
}
} else {
- int rnd = Random_Query(1, 4) - 1;
-
- if (rnd) {
- if (rnd == 1) {
- Actor_Set_Goal_Number(kActorLucy, 225);
- } else if (Player_Query_Current_Scene() == 36) {
- Actor_Set_Goal_Number(kActorLucy, 220);
- } else {
- Actor_Set_Goal_Number(kActorLucy, 205);
- }
+ int rnd = Random_Query(0, 3);
+
+ if (rnd == 0) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToFreeSlotGAG);
+ } else if (rnd == 1) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToFreeSlotGAHJ);
+ } else if (Player_Query_Current_Scene() == kSceneHF03) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToFreeSlotGAG);
} else {
- Actor_Set_Goal_Number(kActorLucy, 220);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToHF03);
}
}
break;
- case 205:
+ case kGoalLucyGoToHF03:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 210:
- Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
+ case kGoalLucyRunOutPhase1:
+ 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 211:
- Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ case kGoalLucyRunOutPhase2:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 372, 0);
AI_Movement_Track_Append(kActorLucy, 33, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 212:
- Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
+ case kGoalLucyRunToHF041:
+ 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 213:
- Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ case kGoalLucyRunToHF042:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
AI_Movement_Track_Append(kActorLucy, 33, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 214:
+ case kGoalLucyRunAwayWithHelp1:
Actor_Says(kActorLucy, 320, 16);
Actor_Set_Goal_Number(kActorHolloway, 242);
- Actor_Set_Immunity_To_Obstacles(6, 1);
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, true);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append(kActorLucy, 378, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 215:
- Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ case kGoalLucyRunAwayWithHelp2:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, false);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
AI_Movement_Track_Append(kActorLucy, 33, 30);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 220:
+ case kGoalLucyGoToFreeSlotGAG:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 10));
AI_Movement_Track_Append(kActorLucy, 33, Random_Query(5, 10));
@@ -335,7 +369,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 225:
+ case kGoalLucyGoToFreeSlotGAHJ:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 15));
AI_Movement_Track_Append(kActorLucy, 33, Random_Query(10, 30));
@@ -344,26 +378,26 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 230:
+ case kGoalLucyHF04Start:
AI_Movement_Track_Flush(kActorLucy);
Actor_Put_In_Set(kActorLucy, kSetHF04);
Actor_Set_At_Waypoint(kActorLucy, 518, 0);
- Actor_Set_Targetable(kActorLucy, 1);
+ Actor_Set_Targetable(kActorLucy, true);
Actor_Set_Health(kActorLucy, 5, 5);
break;
- case 232:
+ case kGoalLucyHF04TalkToMcCoy:
Player_Loses_Control();
Actor_Says(kActorMcCoy, 1700, 16);
AI_Movement_Track_Flush(kActorLucy);
- Actor_Face_Actor(kActorLucy, 0, 1);
- Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
+ Actor_Face_Actor(kActorLucy, kActorMcCoy, true);
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, true);
Actor_Says(kActorLucy, 350, 13);
Actor_Says(kActorMcCoy, 1705, 13);
Actor_Says(kActorLucy, 360, 13);
Actor_Says(kActorMcCoy, 1710, 13);
- if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) {
+ if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) { // how to trigger this?
Actor_Says(kActorLucy, 940, 13);
Actor_Says(kActorMcCoy, 6780, 12);
Actor_Says(kActorLucy, 950, 12);
@@ -390,40 +424,42 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorLucy, 1050, 12);
}
Actor_Says(kActorLucy, 370, 14);
- Actor_Set_Goal_Number(kActorLucy, 239);
- if (Global_Variable_Query(40) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WalkAway);
+
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
Actor_Set_Goal_Number(kActorSteele, 243);
- Game_Flag_Set(593);
+ Game_Flag_Set(kFlagLucyRanAway);
}
+
Player_Gains_Control();
break;
- case 233:
+ case kGoalLucyHF04Run1:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 519, 0);
AI_Movement_Track_Repeat(kActorLucy);
Actor_Set_Health(kActorLucy, 5, 5);
break;
- case 234:
+ case kGoalLucyHF04Run2:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 520, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 236:
+ case kGoalLucyHF04Run3:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 521, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 238:
+ case kGoalLucyHF04Run4:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 522, 0);
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 239:
+ case kGoalLucyHF04WalkAway:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append_Run(kActorLucy, 523, 0);
AI_Movement_Track_Append(kActorLucy, 33, 0);
@@ -432,17 +468,17 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Health(kActorLucy, 30, 30);
break;
- case 240:
- if (Global_Variable_Query(40) == 3) {
- Actor_Set_Goal_Number(kActorLucy, 599);
+ case 240: // not used anywhere
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyDead);
Actor_Set_Goal_Number(kActorSteele, 240);
} else {
- Actor_Set_Goal_Number(kActorLucy, 299);
- Game_Flag_Set(593);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoneChapter3);
+ Game_Flag_Set(kFlagLucyRanAway);
}
break;
- case 250:
+ case kGoalLucyReturnToHF03:
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append(kActorLucy, 372, 0);
AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
@@ -463,7 +499,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;
case 311:
- voightKempTest();
+ voightKampffTest();
break;
case 312:
@@ -473,8 +509,8 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorLucy);
break;
- case 599:
- Game_Flag_Set(593);
+ case kGoalLucyDead:
+ Game_Flag_Set(kFlagLucyRanAway);
break;
}
@@ -787,27 +823,29 @@ bool AIScriptLucy::ReachedMovementTrackWaypoint(int waypointId) {
}
void AIScriptLucy::FledCombat() {
- if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorLucy) == 450) {
+ if (Global_Variable_Query(kVariableChapter) == 5
+ && Actor_Query_Goal_Number(kActorLucy) == 450
+ ) {
Actor_Put_In_Set(kActorLucy, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorLucy, 39, 0);
- Actor_Set_Goal_Number(kActorLucy, 599);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyDead);
}
return; //true;
}
-void AIScriptLucy::voightKempTest() {
+void AIScriptLucy::voightKampffTest() {
Player_Loses_Control();
- Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, true);
Actor_Says(kActorMcCoy, 6815, 11);
- Actor_Face_Actor(kActorLucy, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorLucy, kActorMcCoy, true);
Actor_Says(kActorLucy, 1060, 16);
Actor_Says(kActorLucy, 1070, 17);
Delay(1000);
Actor_Says(kActorLucy, 1080, 14);
Actor_Says(kActorMcCoy, 6820, 16);
Actor_Says(kActorLucy, 1090, 13);
- if (!Game_Flag_Query(378)) {
+ if (!Game_Flag_Query(kFlagDirectorsCut)) {
Actor_Says(kActorMcCoy, 6825, 13);
}
Actor_Says(kActorMcCoy, 6830, 12);
@@ -825,7 +863,9 @@ void AIScriptLucy::voightKempTest() {
Actor_Says(kActorLucy, 1130, 14);
Music_Stop(2);
Player_Gains_Control();
- Voight_Kampff_Activate(6, 40);
+
+ Voight_Kampff_Activate(kActorLucy, 40);
+
Player_Loses_Control();
if (Actor_Clue_Query(kActorMcCoy, 271)) {
Actor_Says(kActorMcCoy, 6865, 13);
diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp
index 4a4489d..ff50d04 100644
--- a/engines/bladerunner/script/ai/steele.cpp
+++ b/engines/bladerunner/script/ai/steele.cpp
@@ -815,7 +815,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Scene_Exits_Enable();
return true;
- case 126:
+ case 126: // not used anywhere
return true;
case kGoalSteeleLeaveRC03:
@@ -943,6 +943,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_XYZ(kActorSteele, 291.0f, 47.76f, -892.0f, 453);
Set_Enter(kSetHF03, kSceneHF03);
return true;
+
case 234:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append_Run(kActorSteele, 372, 0);
@@ -972,17 +973,17 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case 241:
- Actor_Change_Animation_Mode(kActorSteele, 6);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Delay(500);
- Actor_Change_Animation_Mode(kActorLucy, 48);
- Actor_Set_Targetable(kActorLucy, 0);
+ Actor_Change_Animation_Mode(kActorLucy, kAnimationModeDie);
+ Actor_Set_Targetable(kActorLucy, false);
Actor_Retired_Here(kActorLucy, 36, 18, 1, -1);
Delay(1000);
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append_Run(kActorSteele, 380, 0);
AI_Movement_Track_Repeat(kActorSteele);
Delay(500);
- ADQ_Add(6, 340, 48);
+ ADQ_Add(kActorLucy, 340, 48);
return true;
case 242:
@@ -990,36 +991,36 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Player_Loses_Control();
Delay(500);
Actor_Says(kActorSteele, 0, 14);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 1540, 16);
Actor_Says(kActorSteele, 10, 13);
Actor_Says(kActorSteele, 20, 18);
Actor_Says(kActorMcCoy, 1545, 13);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 30, 18);
Actor_Says(kActorSteele, 40, 18);
Actor_Says(kActorMcCoy, 1550, 13);
- Actor_Face_Actor(kActorSteele, kActorLucy, 1);
+ Actor_Face_Actor(kActorSteele, kActorLucy, true);
Actor_Says(kActorSteele, 50, 12);
Actor_Says(kActorMcCoy, 1555, 13);
Actor_Says(kActorSteele, 60, 12);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 80, 16);
Actor_Says(kActorMcCoy, 1560, 13);
Delay(500);
Game_Flag_Set(617);
Player_Gains_Control();
- if (Game_Flag_Query(255)) {
+ if (Game_Flag_Query(kFlagSpinnerAtNR01)) {
Actor_Put_In_Set(kActorSteele, kSetNR01);
Actor_Set_At_XYZ(kActorSteele, 12.17f, 23.88f, -533.37f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetNR01, kSceneNR01);
} else {
Actor_Put_In_Set(kActorSteele, kSetHF01);
Actor_Set_At_XYZ(kActorSteele, 324.32f, 8.0f, -465.87f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF04);
}
return true;
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 691a9cf..ac16b70 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -174,7 +174,7 @@ END_SCRIPT
DECLARE_SCRIPT(Lucy)
bool _flag;
- void voightKempTest();
+ void voightKampffTest();
void checkCombat();
END_SCRIPT
diff --git a/engines/bladerunner/script/init_script.cpp b/engines/bladerunner/script/init_script.cpp
index 9244c77..9364df8 100644
--- a/engines/bladerunner/script/init_script.cpp
+++ b/engines/bladerunner/script/init_script.cpp
@@ -108,19 +108,19 @@ void InitScript::Init_Game_Flags() {
}
if (Game_Flag_Query(kFlagDektoraIsReplicant)) {
- Global_Variable_Set(40, 1);
+ Global_Variable_Set(kVariableBehavior, 1);
} else if ( Game_Flag_Query(kFlagGordoIsReplicant)
&& !Game_Flag_Query(kFlagLucyIsReplicant)
) {
- Global_Variable_Set(40, 2);
+ Global_Variable_Set(kVariableBehavior, 2);
} else if (!Game_Flag_Query(kFlagGordoIsReplicant)
&& Game_Flag_Query(kFlagLucyIsReplicant)
) {
- Global_Variable_Set(40, 3);
+ Global_Variable_Set(kVariableBehavior, 3);
} else if (Random_Query(1, 2) == 1) {
- Global_Variable_Set(40, 2);
+ Global_Variable_Set(kVariableBehavior, 2);
} else {
- Global_Variable_Set(40, 3);
+ Global_Variable_Set(kVariableBehavior, 3);
}
Game_Flag_Set(kFlagMcCoyInRunciters);
diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp
index 936b11f..1178517 100644
--- a/engines/bladerunner/script/scene/hf02.cpp
+++ b/engines/bladerunner/script/scene/hf02.cpp
@@ -59,7 +59,7 @@ void SceneScriptHF02::SceneLoaded() {
Obstacle_Object("BARD_NEON", true);
Unclickable_Object("BARD_NEON");
if (Actor_Query_Goal_Number(kActorSteele) == 234) {
- if (Game_Flag_Query(593)) {
+ if (Game_Flag_Query(kFlagLucyRanAway)) {
Actor_Set_Goal_Number(kActorSteele, 243);
} else {
Actor_Set_Goal_Number(kActorSteele, 240);
@@ -132,7 +132,7 @@ void SceneScriptHF02::PlayerWalkedIn() {
}
if (Actor_Query_Goal_Number(kActorSteele) == 243) {
- if (Actor_Query_Goal_Number(kActorLucy) == 599) {
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyDead) {
Actor_Set_Goal_Number(kActorSteele, 244);
} else {
Actor_Set_Goal_Number(kActorSteele, 245);
diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp
index 591861c..f54f8ba 100644
--- a/engines/bladerunner/script/scene/hf03.cpp
+++ b/engines/bladerunner/script/scene/hf03.cpp
@@ -78,13 +78,13 @@ void SceneScriptHF03::dialogueWithLucy() {
switch (answer) {
case 840: // VOIGT-KAMPFF
Actor_Says(kActorMcCoy, 1630, 15);
- if (Global_Variable_Query(40) == 3) {
- Actor_Set_Goal_Number(kActorLucy, 214);
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp1);
} else if (Game_Flag_Query(kFlagLucyIsReplicant)) {
- Actor_Set_Goal_Number(kActorLucy, 212);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
} else {
- Actor_Set_Goal_Number(kActorLucy, 210);
- Game_Flag_Set(593);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase1);
+ Game_Flag_Set(kFlagLucyRanAway);
}
break;
@@ -96,8 +96,8 @@ void SceneScriptHF03::dialogueWithLucy() {
case 860: // CRYSTAL
Actor_Says(kActorMcCoy, 1640, 12);
- if (Global_Variable_Query(40) == 3) {
- Actor_Set_Goal_Number(kActorLucy, 214);
+ if (Global_Variable_Query(kVariableBehavior) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunAwayWithHelp1);
} else {
Actor_Says(kActorLucy, 210, 13);
Actor_Says(kActorMcCoy, 1655, 15);
@@ -128,10 +128,11 @@ void SceneScriptHF03::dialogueWithLucy() {
Actor_Says(kActorMcCoy, 1660, 15);
Actor_Says(kActorLucy, 230, 14);
Actor_Clue_Acquire(kActorLucy, kClueMcCoyHelpedLucy, true, kActorMcCoy);
+
if (Game_Flag_Query(kFlagLucyIsReplicant)) {
- Actor_Set_Goal_Number(kActorLucy, 212);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
} else {
- Actor_Set_Goal_Number(kActorLucy, 210);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunOutPhase1);
}
}
break;
@@ -160,7 +161,7 @@ void SceneScriptHF03::dialogueWithLucy() {
bool SceneScriptHF03::ClickedOnActor(int actorId) {
if (actorId == kActorLucy
- && Actor_Query_Goal_Number(kActorLucy) == 205
+ && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03
) {
if (Game_Flag_Query(kFlagLucyIsReplicant)
? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, true, false)
@@ -248,8 +249,8 @@ void SceneScriptHF03::PlayerWalkedIn() {
Game_Flag_Reset(kFlagHF01toHF03);
}
- if (Actor_Query_Goal_Number(kActorLucy) == 250) {
- Actor_Set_Goal_Number(kActorLucy, 212);
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyReturnToHF03) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyRunToHF041);
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 9dde7ac..14cad2f 100644
--- a/engines/bladerunner/script/scene/hf04.cpp
+++ b/engines/bladerunner/script/scene/hf04.cpp
@@ -24,6 +24,13 @@
namespace BladeRunner {
+enum kHF04Loops {
+ kHF04LoopMain = 0,
+ kHF04LoopDoorsClosing = 2,
+ kHF04LoopMainDoorsClosed = 3,
+ kHF04LoopDoorsOpening = 5
+};
+
void SceneScriptHF04::InitializeScene() {
Setup_Scene_Information(-33.85f, -0.31f, 395.0f, 0);
Game_Flag_Reset(kFlagHF03toHF04);
@@ -39,15 +46,15 @@ void SceneScriptHF04::InitializeScene() {
Ambient_Sounds_Add_Sound(304, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(305, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0);
- if (Game_Flag_Query(584)) {
- Scene_Loop_Set_Default(3);
+ if (Game_Flag_Query(kFlagHF04DoorsClosed)) {
+ Scene_Loop_Set_Default(kHF04LoopMainDoorsClosed);
} else {
- Scene_Loop_Set_Default(0);
+ Scene_Loop_Set_Default(kHF04LoopMain);
}
}
void SceneScriptHF04::SceneLoaded() {
- if (Game_Flag_Query(584)) {
+ if (Game_Flag_Query(kFlagHF04DoorsClosed)) {
Unobstacle_Object("PIVOT_WALL#1", true);
Unobstacle_Object("PIVOT_WALL#02", true);
Unobstacle_Object("PIVOT_WALL#03", true);
@@ -55,14 +62,15 @@ void SceneScriptHF04::SceneLoaded() {
Unobstacle_Object("HIDE_WALL_A", true);
Unobstacle_Object("HIDE_WALL_B", true);
}
- if (Actor_Query_Goal_Number(kActorLucy) == 213) {
+
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyRunToHF042) {
if (Actor_Clue_Query(kActorLucy, kClueMcCoyHelpedLucy)
- && Global_Variable_Query(40) != 3
+ && Global_Variable_Query(kVariableBehavior) != 3
) {
- Game_Flag_Set(593);
+ Game_Flag_Set(kFlagLucyRanAway);
} else {
- Actor_Set_Goal_Number(kActorLucy, 230);
- Game_Flag_Reset(584);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Start);
+ Game_Flag_Reset(kFlagHF04DoorsClosed);
}
}
}
@@ -110,28 +118,28 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
}
if (frame == 179
- && Actor_Query_Goal_Number(kActorLucy) == 235
+ && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04WaitForMcCoy1
) {
- Actor_Set_Goal_Number(kActorLucy, 236);
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04Run3);
}
- if (Game_Flag_Query(585)) {
- Game_Flag_Reset(585);
- Scene_Loop_Set_Default(3);
- Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, true);
+ if (Game_Flag_Query(kFlagHF04CloseDoors)) {
+ Game_Flag_Reset(kFlagHF04CloseDoors);
+ Scene_Loop_Set_Default(kHF04LoopMainDoorsClosed);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kHF04LoopDoorsClosing, true);
//return true;
return;
}
- if (Game_Flag_Query(586)) {
- Game_Flag_Reset(586);
- Scene_Loop_Set_Default(0);
- Scene_Loop_Start_Special(kSceneLoopModeOnce, 5, true);
+ if (Game_Flag_Query(kFlagHF04OpenDoors)) {
+ Game_Flag_Reset(kFlagHF04OpenDoors);
+ Scene_Loop_Set_Default(kHF04LoopMain);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kHF04LoopDoorsOpening, true);
return; // true;
}
if (frame == 89) {
- Game_Flag_Set(584);
+ Game_Flag_Set(kFlagHF04DoorsClosed);
Obstacle_Object("HIDE_WALL_A", false);
Obstacle_Object("HIDE_WALL_B", false);
Unobstacle_Object("PIVOT_WALL#1", false);
@@ -146,9 +154,9 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) {
Obstacle_Object("PIVOT_WALL#1", false);
Obstacle_Object("PIVOT_WALL#02", false);
Obstacle_Object("PIVOT_WALL#03", true);
- Game_Flag_Reset(584);
- if (Actor_Query_Goal_Number(kActorLucy) == 234) {
- Actor_Set_Goal_Number(kActorLucy, 235);
+ Game_Flag_Reset(kFlagHF04DoorsClosed);
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04Run2) {
+ Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WaitForMcCoy1);
}
return; // true;
}
@@ -159,8 +167,8 @@ void SceneScriptHF04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptHF04::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorLucy) == 230
- || Actor_Query_Goal_Number(kActorLucy) == 233
+ if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04Start
+ || Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04Run1
) {
Player_Set_Combat_Mode(true);
Music_Play(1, 60, 0, 2, -1, 0, 0);
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index 31486c1..5bc76d9 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -331,7 +331,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
Actor_Says(kActorSteele, 1440, 13);
Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorSteele, 48, false, true);
Actor_Says(kActorMcCoy, 3145, 13);
- if (Global_Variable_Query(40) != 3) {
+ if (Global_Variable_Query(kVariableBehavior) != 3) {
Actor_Says(kActorSteele, 1450, 12);
Actor_Says(kActorSteele, 1460, 13);
}
@@ -360,14 +360,14 @@ void SceneScriptNR01::PlayerWalkedIn() {
Actor_Says(kActorSteele, 1430, 12);
Actor_Set_Goal_Number(kActorSteele, 285);
} else {
- int v0 = Global_Variable_Query(40) - 1;
- if (!v0) {
+ int v0 = Global_Variable_Query(kVariableBehavior);
+ if (v0 == 1) {
Actor_Says(kActorSteele, 1510, 15);
Actor_Says(kActorSteele, 1520, 14);
Actor_Says(kActorSteele, 1530, 13);
Actor_Says(kActorMcCoy, 3170, 13);
Actor_Set_Goal_Number(kActorSteele, 231);
- } else if (v0 == 1) {
+ } else if (v0 == 2) {
Actor_Says(kActorSteele, 1590, 15);
Actor_Says(kActorMcCoy, 3195, 14);
Actor_Says(kActorSteele, 1600, 16);
@@ -377,7 +377,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
Actor_Says(kActorSteele, 1630, 14);
Actor_Says(kActorMcCoy, 3205, 12);
Actor_Set_Goal_Number(kActorSteele, 232);
- } else if (v0 == 2) {
+ } else if (v0 == 3) {
Actor_Says(kActorSteele, 1540, 15);
Actor_Says(kActorMcCoy, 3175, 13);
Actor_Says(kActorSteele, 1550, 13);
diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp
index f97cc4c..cf8143e 100644
--- a/engines/bladerunner/script/scene/nr11.cpp
+++ b/engines/bladerunner/script/scene/nr11.cpp
@@ -180,7 +180,7 @@ bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool combatMode)
Actor_Says(kActorDektora, 1090, 17);
Music_Stop(4);
Actor_Set_Goal_Number(kActorDektora, 260);
- if (Global_Variable_Query(40) == 1) {
+ if (Global_Variable_Query(kVariableBehavior) == 1) {
Actor_Set_Goal_Number(kActorSteele, 236);
}
Game_Flag_Set(591);
Commit: d3f456a328fbde0787f4f15494e235b91c4ec73e
https://github.com/scummvm/scummvm/commit/d3f456a328fbde0787f4f15494e235b91c4ec73e
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:49:00+01:00
Commit Message:
BLADERUNNER: Implement CD switching in outtake player
Changed paths:
engines/bladerunner/outtake.cpp
diff --git a/engines/bladerunner/outtake.cpp b/engines/bladerunner/outtake.cpp
index fc610b2..8d7b92a 100644
--- a/engines/bladerunner/outtake.cpp
+++ b/engines/bladerunner/outtake.cpp
@@ -23,6 +23,7 @@
#include "bladerunner/outtake.h"
#include "bladerunner/bladerunner.h"
+#include "bladerunner/chapters.h"
#include "bladerunner/subtitles.h"
#include "bladerunner/vqa_player.h"
@@ -42,11 +43,19 @@ OuttakePlayer::~OuttakePlayer() {
}
void OuttakePlayer::play(const Common::String &name, bool noLocalization, int container) {
+ Common::String oldOuttakeFile = Common::String::format("OUTTAKE%d.MIX", _vm->_chapters->currentResourceId());
+ Common::String newOuttakeFile = Common::String::format("OUTTAKE%d.MIX", container);
+
if (container > 0) {
- debug("OuttakePlayer::play TODO");
- return;
+ if (_vm->isArchiveOpen(oldOuttakeFile)) {
+ _vm->closeArchive(oldOuttakeFile);
+ }
+
+ _vm->openArchive(newOuttakeFile);
}
+ _vm->playerLosesControl();
+
Common::String resName = name;
if (!noLocalization) {
resName = resName + "_" + _vm->_languageCode;
@@ -54,18 +63,18 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co
Common::String resNameNoVQASuffix = resName;
resName = resName + ".VQA";
- VQAPlayer vqa_player(_vm, &_surfaceVideo, resName); // in original game _surfaceFront is used here, but for proper subtitles rendering we need separate surface
+ _vm->_mixer->stopAll();
- vqa_player.open();
+ VQAPlayer vqaPlayer(_vm, &_surfaceVideo, resName); // in original game _surfaceFront is used here, but for proper subtitles rendering we need separate surface
+ vqaPlayer.open();
- _vm->_mixer->stopAll();
- while (!_vm->shouldQuit()) {
- Common::Event event;
- while (_vm->_system->getEventManager()->pollEvent(event))
- if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE)
- return;
+ _vm->_vqaIsPlaying = true;
+ _vm->_vqaStopIsRequested = false;
+
+ while (!_vm->_vqaStopIsRequested && !_vm->shouldQuit()) {
+ _vm->handleEvents();
- int frame = vqa_player.update();
+ int frame = vqaPlayer.update();
blit(_surfaceVideo, _vm->_surfaceFront); // This helps to make subtitles disappear properly, if the video is rendered in separate surface and then pushed to the front surface
if (frame == -3) { // end of video
break;
@@ -80,7 +89,21 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co
_vm->_system->delayMillis(10);
}
- // TODO: scene video is played fast after end of outtake, fix it (visible in tb07)
+ _vm->_vqaIsPlaying = false;
+ _vm->_vqaStopIsRequested = false;
+ vqaPlayer.close();
+
+ // TODO: scene video is played fast after end of outtake - visible in tb07
+
+ _vm->playerGainsControl();
+
+ if (container > 0) {
+ if (_vm->isArchiveOpen(newOuttakeFile)) {
+ _vm->closeArchive(newOuttakeFile);
+ }
+
+ _vm->openArchive(oldOuttakeFile);
+ }
}
} // End of namespace BladeRunner
Commit: 24bc52c277e8ae7b206c786d023d81ae9b15a6d7
https://github.com/scummvm/scummvm/commit/24bc52c277e8ae7b206c786d023d81ae9b15a6d7
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-01-27T11:49:00+01:00
Commit Message:
BLADERUNNER: Cleanup of Steele scripts for Lucy chase
Changed paths:
engines/bladerunner/game_constants.h
engines/bladerunner/script/ai/holloway.cpp
engines/bladerunner/script/ai/lucy.cpp
engines/bladerunner/script/ai/steele.cpp
engines/bladerunner/script/scene/hf01.cpp
engines/bladerunner/script/scene/hf02.cpp
engines/bladerunner/script/scene/hf03.cpp
engines/bladerunner/script/scene/nr01.cpp
engines/bladerunner/script/scene/ug06.cpp
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index be77941..2096a62 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -922,6 +922,8 @@ enum Flags {
kFlagTB07toTB02 = 608,
kFlagTB07RachaelTalk = 612,
kFlagHF03LucyTalk = 613,
+ kFlagMcCoyCapturedByBaker = 616,
+ kFlagSpinnerMissing = 617,
kFlagTB07TyrellMeeting = 625,
kFlagCT11DogWrapperTaken = 645,
kFlagMA04McCoySleeping = 647,
@@ -934,6 +936,7 @@ enum Flags {
kFlagPS14toMA07 = 673,
kFlagChapter2Intro = 678,
kFlagChapter3Intro = 679,
+ kFlagChapter4Intro = 680,
kFlagNotUsed686 = 686,
kFlagPS05TV0 = 688,
kFlagPS05TV1 = 689,
@@ -979,7 +982,7 @@ enum Variables {
kVariableWalkLoopActor = 37,
kVariableWalkLoopRun = 38,
kVariableDR06MannequinHeadOpened = 39,
- kVariableBehavior = 40, // 1 dektora is replicant, 2 - ?, 3 - get caught by Baker
+ kVariableBehavior = 40, // 1 dektora is replicant, 2 - ?, 3 - get caught by Holloway & Baker at HF03
kVariableMcCoyDrinks = 42, // is never checked
kVariableAffectionTowards = 45, // 0 none, 1 steele, 2 dektora, 3 lucy
kVariableGunPulledInFrontOfSebastian = 46,
@@ -1108,7 +1111,7 @@ enum Scenes {
kSceneHC03 = 33, // Hawker's Circle - Green pawn - Inside
kSceneHF01 = 34, // Hysteria Hall - Outside
kSceneHF02 = 35, // Hysteria Hall - Hall of Mirrors - Exit
- kSceneHF03 = 36, // Hysteria Hall - Arcade
+ kSceneHF03 = 36, // Hysteria Hall - Hysteria Arcade
kSceneHF04 = 37, // Hysteria Hall - Hall of Mirrors
kSceneHF05 = 38,
kSceneHF06 = 39,
@@ -1497,6 +1500,7 @@ enum GoalMcCoy {
};
enum GoalSteele {
+ // chapter 1
kGoalSteeleDefault = 0,
kGoalSteeleGoToRC01 = 1,
kGoalSteeleGoToRC02 = 2,
@@ -1509,6 +1513,7 @@ enum GoalSteele {
kGoalSteeleGoToPS02 = 9,
kGoalSteeleGoToFreeSlotG3 = 10,
kGoalSteeleInterviewGrigorian = 11,
+ // chapter 2
kGoalSteeleApprehendIzo = 100,
kGoalSteeleGoToTB02 = 110,
kGoalSteeleLeaveTB02 = 111,
@@ -1518,7 +1523,20 @@ enum GoalSteele {
kGoalSteeleArrestIzo = 121,
kGoalSteeleIzoBlockedByMcCoy = 125,
kGoalSteeleLeaveRC03 = 130,
- kGoalSteeleWalkAroundRestart = 190
+ kGoalSteeleWalkAroundRestart = 190,
+ // chapter 3
+ kGoalSteeleHF03ApproachLucy = 233,
+ kGoalSteeleHF03McCoyChasingLucy = 234,
+ kGoalSteeleHF02ConfrontLucy = 240,
+ kGoalSteeleHF02ShootLucy = 241,
+ kGoalSteeleHF02LucyShotBySteele = 242,
+ kGoalSteeleHF02LucyRanAway = 243,
+ kGoalSteeleHF02LucyShotByMcCoy = 244,
+ kGoalSteeleHF02LucyLostByMcCoy = 245,
+ kGoalSteeleGoToMcCoysSpinner = 246,
+ kGoalSteeleTalkAboutMissingSpinner = 280,
+ kGoalSteeleNR01StartChapter4 = 290,
+ kGoalSteeleHF01StartChapter4 = 291
};
enum GoalDektora {
diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp
index 9167064..e9f162e 100644
--- a/engines/bladerunner/script/ai/holloway.cpp
+++ b/engines/bladerunner/script/ai/holloway.cpp
@@ -174,7 +174,7 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
Player_Gains_Control();
- Game_Flag_Set(616);
+ Game_Flag_Set(kFlagMcCoyCapturedByBaker);
Scene_Exits_Enable();
Actor_Set_Goal_Number(kActorSteele, 230);
Actor_Put_In_Set(kActorHolloway, kSetFreeSlotI);
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 087e432..8b16f11 100644
--- a/engines/bladerunner/script/ai/lucy.cpp
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -70,7 +70,7 @@ bool AIScriptLucy::Update() {
}
}
- if (Game_Flag_Query(616)
+ if (Game_Flag_Query(kFlagMcCoyCapturedByBaker)
&& Actor_Query_Goal_Number(kActorLucy) == kGoalLucyWillReturnToHF03
) {
Actor_Put_In_Set(kActorLucy, kSetHF03);
@@ -126,7 +126,7 @@ void AIScriptLucy::TimerExpired(int timer) {
void AIScriptLucy::CompletedMovementTrack() {
switch (Actor_Query_Goal_Number(kActorLucy)) {
case kGoalLucyGoToHF03:
- if (Game_Flag_Query(616)
+ if (Game_Flag_Query(kFlagMcCoyCapturedByBaker)
&& Global_Variable_Query(kVariableBehavior) == 3
) {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyReturnToHF03);
@@ -193,7 +193,7 @@ void AIScriptLucy::CompletedMovementTrack() {
Actor_Set_Health(kActorLucy, 30, 30);
if (Global_Variable_Query(kVariableBehavior) == 3) {
- Actor_Set_Goal_Number(kActorSteele, 240);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02ConfrontLucy);
}
break;
@@ -427,7 +427,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WalkAway);
if (Global_Variable_Query(kVariableBehavior) == 3) {
- Actor_Set_Goal_Number(kActorSteele, 243);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyRanAway);
Game_Flag_Set(kFlagLucyRanAway);
}
@@ -471,7 +471,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case 240: // not used anywhere
if (Global_Variable_Query(kVariableBehavior) == 3) {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyDead);
- Actor_Set_Goal_Number(kActorSteele, 240);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02ConfrontLucy);
} else {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoneChapter3);
Game_Flag_Set(kFlagLucyRanAway);
diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp
index ff50d04..c03927d 100644
--- a/engines/bladerunner/script/ai/steele.cpp
+++ b/engines/bladerunner/script/ai/steele.cpp
@@ -306,8 +306,8 @@ void AIScriptSteele::CompletedMovementTrack() {
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleWalkAroundRestart);
break;
- case 241:
- Actor_Set_Goal_Number(kActorSteele, 242);
+ case kGoalSteeleHF02ShootLucy:
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyShotBySteele);
break;
case 423:
@@ -368,8 +368,8 @@ void AIScriptSteele::ClickedByPlayer() {
}
if (goal - 241 <= 9) {
- if (goal == 241) {
- Actor_Set_Goal_Number(kActorSteele, 242);
+ if (goal == kGoalSteeleHF02ShootLucy) {
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyShotBySteele);
return; //true;
}
@@ -560,6 +560,8 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return false;
switch (newGoalNumber) {
+ // Chapter 1
+
case kGoalSteeleGoToRC01:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append(kActorSteele, 12, 5);
@@ -633,7 +635,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSteele);
return true;
- case 11:
+ case kGoalSteeleInterviewGrigorian:
Actor_Clue_Acquire(kActorSteele, kClueGrigorianInterviewA, true, kActorGrigorian);
if (Game_Flag_Query(kFlagIzoIsReplicant)) {
Actor_Clue_Acquire(kActorSteele, kClueGrigorianInterviewB1, true, kActorGrigorian);
@@ -643,6 +645,8 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault);
return true;
+ // Chapter 2
+
case kGoalSteeleApprehendIzo:
AI_Movement_Track_Flush(kActorSteele);
if (Game_Flag_Query(kFlagIzoIsReplicant)) {
@@ -825,17 +829,23 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSteele);
return true;
+ // Chapter 3
+
case 200:
AI_Movement_Track_Flush(kActorSteele);
return true;
case 205:
- if (Query_Score(kActorMcCoy) > Query_Score(kActorSteele) && Query_Score(kActorMcCoy) < 75) {
+ if (Query_Score(kActorMcCoy) > Query_Score(kActorSteele)
+ && Query_Score(kActorMcCoy) < 75
+ ) {
Set_Score(kActorSteele, Random_Query(2, 5) + Query_Score(kActorMcCoy));
}
+
if (Game_Flag_Query(kFlagRC04Locked)) {
Game_Flag_Set(643);
}
+
AI_Movement_Track_Flush(kActorSteele);
Actor_Put_In_Set(kActorSteele, kSetFreeSlotC);
Actor_Set_At_Waypoint(kActorSteele, 35, 0);
@@ -935,7 +945,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Set_Enter(kSetNR02, kSceneNR02);
return true;
- case 233:
+ case kGoalSteeleHF03ApproachLucy:
Game_Flag_Set(kFlagHF01toHF03);
Game_Flag_Reset(kFlagMcCoyInNightclubRow);
Game_Flag_Set(kFlagMcCoyInHysteriaHall);
@@ -944,7 +954,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Set_Enter(kSetHF03, kSceneHF03);
return true;
- case 234:
+ case kGoalSteeleHF03McCoyChasingLucy:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append_Run(kActorSteele, 372, 0);
AI_Movement_Track_Append(kActorSteele, 35, 0);
@@ -963,7 +973,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_XYZ(kActorSteele, -118.13f, 2.84f, -197.90f, 305);
return true;
- case 240:
+ case kGoalSteeleHF02ConfrontLucy:
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Flush(kActorLucy);
Actor_Put_In_Set(kActorSteele, kSetHF02);
@@ -972,21 +982,21 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_XYZ(kActorLucy, 596.49f, 47.76f, -260.04f, 731);
return true;
- case 241:
+ case kGoalSteeleHF02ShootLucy:
Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Delay(500);
Actor_Change_Animation_Mode(kActorLucy, kAnimationModeDie);
Actor_Set_Targetable(kActorLucy, false);
- Actor_Retired_Here(kActorLucy, 36, 18, 1, -1);
+ Actor_Retired_Here(kActorLucy, 36, 18, true, -1);
Delay(1000);
AI_Movement_Track_Flush(kActorSteele);
AI_Movement_Track_Append_Run(kActorSteele, 380, 0);
AI_Movement_Track_Repeat(kActorSteele);
Delay(500);
- ADQ_Add(kActorLucy, 340, 48);
+ ADQ_Add(kActorLucy, 340, kAnimationModeDie);
return true;
- case 242:
+ case kGoalSteeleHF02LucyShotBySteele:
AI_Movement_Track_Flush(kActorSteele);
Player_Loses_Control();
Delay(500);
@@ -1007,8 +1017,9 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 80, 16);
Actor_Says(kActorMcCoy, 1560, 13);
+
Delay(500);
- Game_Flag_Set(617);
+ Game_Flag_Set(kFlagSpinnerMissing);
Player_Gains_Control();
if (Game_Flag_Query(kFlagSpinnerAtNR01)) {
Actor_Put_In_Set(kActorSteele, kSetNR01);
@@ -1025,27 +1036,27 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
return true;
- case 243:
+ case kGoalSteeleHF02LucyRanAway:
Player_Loses_Control();
Delay(500);
Actor_Put_In_Set(kActorSteele, kSetHF02);
Actor_Set_At_XYZ(kActorSteele, 254.94f, 47.76f, -262.58f, 210);
return true;
- case 244:
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ case kGoalSteeleHF02LucyShotByMcCoy:
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 1560, 14);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 100, 13);
Actor_Says(kActorMcCoy, 1575, 13);
Actor_Says(kActorSteele, 120, 15);
- Actor_Set_Goal_Number(kActorSteele, 246);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToMcCoysSpinner);
return true;
- case 245:
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ case kGoalSteeleHF02LucyLostByMcCoy:
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 150, 13);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 1580, 13);
Actor_Says(kActorSteele, 160, 14);
Actor_Says(kActorMcCoy, 1585, 16);
@@ -1053,26 +1064,27 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorSteele, 180, 17);
Actor_Says(kActorMcCoy, 1590, 17);
Actor_Says(kActorSteele, 200, 15);
- Actor_Set_Goal_Number(kActorSteele, 246);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToMcCoysSpinner);
return true;
- case 246:
+ case kGoalSteeleGoToMcCoysSpinner:
Actor_Says(kActorSteele, 130, 13);
Actor_Says(kActorSteele, 140, 13);
+
Delay(500);
- Game_Flag_Set(617);
+ Game_Flag_Set(kFlagSpinnerMissing);
Player_Gains_Control();
- if (Game_Flag_Query(255)) {
+ if (Game_Flag_Query(kFlagSpinnerAtNR01)) {
Actor_Put_In_Set(kActorSteele, kSetNR01);
Actor_Set_At_XYZ(kActorSteele, 12.17f, 23.88f, -533.37f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetNR01, kSceneNR01);
} else {
Actor_Put_In_Set(kActorSteele, kSetHF01);
Actor_Set_At_XYZ(kActorSteele, 324.32f, 8.0f, -465.87f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF01);
}
return true;
@@ -1081,107 +1093,107 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Flush(kActorSteele);
Actor_Put_In_Set(kActorSteele, kSetNR01);
Actor_Set_At_XYZ(kActorSteele, 94.03f, 23.88f, -794.46f, 685);
- if (Game_Flag_Query(255)) {
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ if (Game_Flag_Query(kFlagSpinnerAtNR01)) {
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
}
Game_Flag_Set(603);
- Actor_Change_Animation_Mode(kActorSteele, 0);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeIdle);
_var1 = 3;
return true;
case 251:
- Actor_Set_Targetable(kActorSteele, 1);
+ Actor_Set_Targetable(kActorSteele, true);
return true;
case 252:
Player_Loses_Control();
- Actor_Change_Animation_Mode(kActorSteele, 6);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Sound_Play(27, 100, 0, 0, 50);
Game_Flag_Reset(603);
- Actor_Set_Targetable(kActorSteele, 0);
+ Actor_Set_Targetable(kActorSteele, false);
Actor_Set_Goal_Number(kActorGordo, 299);
Delay(1500);
- Player_Set_Combat_Mode(0);
+ Player_Set_Combat_Mode(false);
Actor_Says(kActorSteele, 1070, 14);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 1260, 16);
Actor_Says(kActorSteele, 1270, 13);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 3065, 18);
Actor_Says(kActorSteele, 1280, 13);
Actor_Says(kActorSteele, 1290, 13);
Game_Flag_Set(592);
Player_Gains_Control();
- if (Game_Flag_Query(256)) {
+ if (Game_Flag_Query(kFlagSpinnerAtHF01)) {
Actor_Put_In_Set(kActorSteele, kSetHF01);
Actor_Set_At_XYZ(kActorSteele, 324.32f, 8.0f, -465.87f, 674);
- Game_Flag_Set(617);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Set(kFlagSpinnerMissing);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF01);
} else {
- Actor_Set_Goal_Number(kActorSteele, 280);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleTalkAboutMissingSpinner);
}
return true;
case 255:
ADQ_Flush();
- Actor_Change_Animation_Mode(kActorSteele, 6);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatAttack);
Sound_Play(27, 100, 0, 0, 50);
Actor_Force_Stop_Walking(kActorMcCoy);
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
Actor_Set_Goal_Number(kActorGordo, 251);
- Actor_Says(kActorSteele, 1250, 3);
+ Actor_Says(kActorSteele, 1250, kAnimationModeTalk);
return true;
case 258:
Game_Flag_Reset(603);
ADQ_Flush();
Game_Flag_Set(592);
- Actor_Set_Targetable(kActorSteele, 0);
+ Actor_Set_Targetable(kActorSteele, false);
Delay(1000);
- Player_Set_Combat_Mode(0);
+ Player_Set_Combat_Mode(false);
Player_Loses_Control();
_animationState = 40;
_animationFrame = 0;
Delay(2000);
- Actor_Change_Animation_Mode(kActorSteele, 0);
- Actor_Change_Animation_Mode(kActorMcCoy, 0);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeIdle);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 1080, 17);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 3025, 14);
Actor_Says(kActorSteele, 1090, 16);
- Actor_Face_Actor(kActorSteele, kActorGordo, 1);
+ Actor_Face_Actor(kActorSteele, kActorGordo, true);
Actor_Says(kActorSteele, 1100, 13);
Actor_Says(kActorSteele, 1110, 17);
Actor_Says(kActorMcCoy, 3030, 19);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 1130, 15);
Actor_Says(kActorSteele, 1140, 12);
Player_Gains_Control();
- Actor_Set_Goal_Number(kActorSteele, 280);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleTalkAboutMissingSpinner);
return true;
case 260:
ADQ_Flush();
- Actor_Change_Animation_Mode(kActorMcCoy, 6);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(27, 100, 0, 0, 50);
_animationState = 38;
_animationFrame = 0;
Actor_Set_Goal_Number(kActorGordo, 251);
Game_Flag_Reset(603);
Game_Flag_Set(592);
- Actor_Set_Targetable(kActorSteele, 0);
+ Actor_Set_Targetable(kActorSteele, false);
Player_Loses_Control();
return true;
case 262:
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 1160, 15);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 3035, 14);
Actor_Says(kActorSteele, 1170, 16);
Actor_Says(kActorMcCoy, 3040, 15);
@@ -1194,10 +1206,10 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorSteele, 1210, 14);
Actor_Modify_Friendliness_To_Other(kActorSteele, kActorMcCoy, -5);
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 2);
- Player_Set_Combat_Mode(0);
+ Player_Set_Combat_Mode(false);
Music_Stop(2);
Player_Gains_Control();
- Actor_Set_Goal_Number(kActorSteele, 280);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleTalkAboutMissingSpinner);
return true;
case 270:
@@ -1214,32 +1226,32 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case 275:
Delay(500);
- Game_Flag_Set(617);
+ Game_Flag_Set(kFlagSpinnerMissing);
Player_Gains_Control();
- if (Game_Flag_Query(255)) {
+ if (Game_Flag_Query(kFlagSpinnerAtNR01)) {
Actor_Put_In_Set(kActorSteele, kSetNR01);
Actor_Set_At_XYZ(kActorSteele, 12.17f, 23.88f, -533.37f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetNR01, kSceneNR01);
} else {
Actor_Put_In_Set(kActorSteele, kSetHF01);
Actor_Set_At_XYZ(kActorSteele, 324.32f, 8.0f, -465.87f, 674);
- Game_Flag_Reset(255);
- Game_Flag_Reset(256);
+ Game_Flag_Reset(kFlagSpinnerAtNR01);
+ Game_Flag_Reset(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF01);
}
return true;
- case 280:
+ case kGoalSteeleTalkAboutMissingSpinner:
Actor_Says(kActorMcCoy, 2970, 15);
- Actor_Face_Actor(kActorSteele, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 840, 16);
Actor_Says(kActorMcCoy, 2975, 15);
Actor_Says(kActorSteele, 850, 16);
- Actor_Says(kActorDispatcher, 0, 3);
- Actor_Says(kActorDispatcher, 10, 3);
- Actor_Face_Actor(kActorMcCoy, kActorSteele, 1);
+ Actor_Says(kActorDispatcher, 0, kAnimationModeTalk);
+ Actor_Says(kActorDispatcher, 10, kAnimationModeTalk);
+ Actor_Face_Actor(kActorMcCoy, kActorSteele, true);
Actor_Says(kActorMcCoy, 2980, 12);
Actor_Says(kActorSteele, 860, 14);
Actor_Says(kActorMcCoy, 2985, 13);
@@ -1251,7 +1263,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorSteele, 900, 13);
Actor_Says(kActorMcCoy, 3000, 13);
Actor_Says(kActorSteele, 920, 12);
- Actor_Says(kActorDispatcher, 30, 3);
+ Actor_Says(kActorDispatcher, 30, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 3005, 14);
Actor_Says(kActorSteele, 930, 16);
Actor_Says(kActorSteele, 950, 13);
@@ -1260,36 +1272,36 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorSteele, 970, 13);
Actor_Says(kActorMcCoy, 3015, 12);
Actor_Says(kActorSteele, 980, 17);
- if (Player_Query_Current_Scene() == 54) {
- Actor_Set_Goal_Number(kActorSteele, 290);
+ if (Player_Query_Current_Scene() == kSceneNR01) {
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleNR01StartChapter4);
} else {
- Actor_Set_Goal_Number(kActorSteele, 291);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF01StartChapter4);
}
return true;
case 285:
- Actor_Set_Goal_Number(kActorSteele, 290);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleNR01StartChapter4);
return true;
- case 290:
+ case kGoalSteeleNR01StartChapter4:
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -281.0f, 31.93f, -1061.0f, 0, false, true, 0);
Actor_Face_Heading(kActorMcCoy, 45, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 3, false, kAnimationModeIdle);
- Global_Variable_Set(1, 4);
+ Global_Variable_Set(kVariableChapter, 4);
Scene_Exits_Enable();
Actor_Set_Health(kActorMcCoy, 50, 50);
Game_Flag_Set(523);
Game_Flag_Set(kFlagNR01toUG06);
- Game_Flag_Set(680);
+ Game_Flag_Set(kFlagChapter4Intro);
Chapter_Enter(4, kSetUG06, kSceneUG06);
return true;
- case 291:
+ case kGoalSteeleHF01StartChapter4:
Game_Flag_Set(722);
Global_Variable_Set(kVariableChapter, 4);
Scene_Exits_Enable();
Game_Flag_Set(523);
- Game_Flag_Set(680);
+ Game_Flag_Set(kFlagChapter4Intro);
Chapter_Enter(4, kSetUG06, kSceneUG06);
return true;
diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp
index 9e0c0fa..200d82b 100644
--- a/engines/bladerunner/script/scene/hf01.cpp
+++ b/engines/bladerunner/script/scene/hf01.cpp
@@ -33,7 +33,7 @@ enum kHF01Loops {
};
void SceneScriptHF01::InitializeScene() {
- if (Game_Flag_Query(617)) {
+ if (Game_Flag_Query(kFlagSpinnerMissing)) {
Setup_Scene_Information(243.94f, 8.0f, -341.9f, 342);
} else if (Game_Flag_Query(kFlagHF05toHF01)) {
Setup_Scene_Information(-202.0f, 0.0f, -619.0f, 407);
@@ -359,9 +359,9 @@ void SceneScriptHF01::PlayerWalkedIn() {
}
}
- if (Game_Flag_Query(617)) {
+ if (Game_Flag_Query(kFlagSpinnerMissing)) {
Actor_Set_Goal_Number(kActorSteele, 280);
- Game_Flag_Reset(617);
+ Game_Flag_Reset(kFlagSpinnerMissing);
//return true;
return;
}
diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp
index 1178517..c3d3b5a 100644
--- a/engines/bladerunner/script/scene/hf02.cpp
+++ b/engines/bladerunner/script/scene/hf02.cpp
@@ -58,11 +58,11 @@ void SceneScriptHF02::InitializeScene() {
void SceneScriptHF02::SceneLoaded() {
Obstacle_Object("BARD_NEON", true);
Unclickable_Object("BARD_NEON");
- if (Actor_Query_Goal_Number(kActorSteele) == 234) {
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleHF03McCoyChasingLucy) {
if (Game_Flag_Query(kFlagLucyRanAway)) {
- Actor_Set_Goal_Number(kActorSteele, 243);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyRanAway);
} else {
- Actor_Set_Goal_Number(kActorSteele, 240);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02ConfrontLucy);
}
}
}
@@ -119,8 +119,8 @@ void SceneScriptHF02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptHF02::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorSteele) == 240) {
- Actor_Set_Goal_Number(kActorSteele, 241);
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleHF02ConfrontLucy) {
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02ShootLucy);
}
if (Game_Flag_Query(kFlagHF03toHF02)) {
@@ -131,11 +131,11 @@ void SceneScriptHF02::PlayerWalkedIn() {
Game_Flag_Reset(kFlagHF01toHF02);
}
- if (Actor_Query_Goal_Number(kActorSteele) == 243) {
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleHF02LucyRanAway) {
if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyDead) {
- Actor_Set_Goal_Number(kActorSteele, 244);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyShotByMcCoy);
} else {
- Actor_Set_Goal_Number(kActorSteele, 245);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyLostByMcCoy);
}
}
}
diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp
index f54f8ba..849f75f 100644
--- a/engines/bladerunner/script/scene/hf03.cpp
+++ b/engines/bladerunner/script/scene/hf03.cpp
@@ -259,7 +259,7 @@ void SceneScriptHF03::PlayerWalkedIn() {
Actor_Says(kActorSteele, 230, 16);
Actor_Says(kActorMcCoy, 1690, 12);
Actor_Says(kActorSteele, 240, 13);
- Actor_Set_Goal_Number(kActorSteele, 234);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF03McCoyChasingLucy);
}
}
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index 5bc76d9..496d277 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -25,7 +25,7 @@
namespace BladeRunner {
void SceneScriptNR01::InitializeScene() {
- if (Game_Flag_Query(617)) {
+ if (Game_Flag_Query(kFlagSpinnerMissing)) {
Setup_Scene_Information(-153.86f, 23.88f, -570.21f, 402);
} else if (Game_Flag_Query(632)) {
Setup_Scene_Information( -416.0f, 31.93f, -841.0f, 200);
@@ -276,9 +276,9 @@ void SceneScriptNR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptNR01::PlayerWalkedIn() {
- if (Game_Flag_Query(617)) {
+ if (Game_Flag_Query(kFlagSpinnerMissing)) {
Actor_Set_Goal_Number(kActorSteele, 280);
- Game_Flag_Reset(617);
+ Game_Flag_Reset(kFlagSpinnerMissing);
//return true;
return;
}
@@ -386,7 +386,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
Actor_Says(kActorSteele, 1570, 12);
Actor_Says(kActorSteele, 1580, 14);
Actor_Says(kActorMcCoy, 3190, 12);
- Actor_Set_Goal_Number(kActorSteele, 233);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF03ApproachLucy);
}
}
}
diff --git a/engines/bladerunner/script/scene/ug06.cpp b/engines/bladerunner/script/scene/ug06.cpp
index a979c9d..174ba75 100644
--- a/engines/bladerunner/script/scene/ug06.cpp
+++ b/engines/bladerunner/script/scene/ug06.cpp
@@ -25,7 +25,7 @@
namespace BladeRunner {
void SceneScriptUG06::InitializeScene() {
- if (Game_Flag_Query(680)) {
+ if (Game_Flag_Query(kFlagChapter4Intro)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeMovieC1, false, -1);
@@ -34,7 +34,7 @@ void SceneScriptUG06::InitializeScene() {
} else {
Outtake_Play(kOuttakeMovieC2, false, -1);
}
- Game_Flag_Reset(680);
+ Game_Flag_Reset(kFlagChapter4Intro);
}
if (Game_Flag_Query(kFlagUG04toUG06)) {
More information about the Scummvm-git-logs
mailing list