aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
authorPeter Kohaut2019-01-26 17:43:24 +0100
committerPeter Kohaut2019-01-27 11:48:59 +0100
commit783f0554edd107b7df3057da7338d96d9d8cee7d (patch)
tree9c453a0564bc02a4a740371cb22f7f839c763a0f /engines/bladerunner
parentf4c5a557ac516335619c6f1bf03208dc83826afa (diff)
downloadscummvm-rg350-783f0554edd107b7df3057da7338d96d9d8cee7d.tar.gz
scummvm-rg350-783f0554edd107b7df3057da7338d96d9d8cee7d.tar.bz2
scummvm-rg350-783f0554edd107b7df3057da7338d96d9d8cee7d.zip
BLADERUNNER: Cleanup of Steele scripts for chapter 1
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/game_constants.h18
-rw-r--r--engines/bladerunner/script/ai/steele.cpp105
-rw-r--r--engines/bladerunner/script/scene/kp02.cpp4
-rw-r--r--engines/bladerunner/script/scene/kp03.cpp29
4 files changed, 94 insertions, 62 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 3a518cdf24..51e8f7aec1 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 ddc50ad568..4a4489dbe4 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 e249420a8e..2233b3d2f5 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 370927b877..ca4e665b54 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();
}