aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-01-27 12:28:22 +0100
committerPeter Kohaut2019-01-27 20:27:45 +0100
commit702d8a4d370f7290389a8afb500f9aeeeb5608c8 (patch)
tree618f008888bd17217fec74bbafe3fde384439909
parentccb2dab9d0a0a1b35fb8465e5e6ced8b1c17f8be (diff)
downloadscummvm-rg350-702d8a4d370f7290389a8afb500f9aeeeb5608c8.tar.gz
scummvm-rg350-702d8a4d370f7290389a8afb500f9aeeeb5608c8.tar.bz2
scummvm-rg350-702d8a4d370f7290389a8afb500f9aeeeb5608c8.zip
BLADERUNNER: Holloway script cleanup
-rw-r--r--engines/bladerunner/game_constants.h16
-rw-r--r--engines/bladerunner/script/ai/gordo.cpp2
-rw-r--r--engines/bladerunner/script/ai/hanoi.cpp2
-rw-r--r--engines/bladerunner/script/ai/holloway.cpp125
-rw-r--r--engines/bladerunner/script/ai/lucy.cpp6
-rw-r--r--engines/bladerunner/script/scene/nr01.cpp4
-rw-r--r--engines/bladerunner/script/scene/nr07.cpp2
7 files changed, 91 insertions, 66 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index 2096a6261c..73d0a9d2aa 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -922,7 +922,7 @@ enum Flags {
kFlagTB07toTB02 = 608,
kFlagTB07RachaelTalk = 612,
kFlagHF03LucyTalk = 613,
- kFlagMcCoyCapturedByBaker = 616,
+ kFlagMcCoyCapturedByHolloway = 616,
kFlagSpinnerMissing = 617,
kFlagTB07TyrellMeeting = 625,
kFlagCT11DogWrapperTaken = 645,
@@ -1525,6 +1525,7 @@ enum GoalSteele {
kGoalSteeleLeaveRC03 = 130,
kGoalSteeleWalkAroundRestart = 190,
// chapter 3
+ kGoalSteeleNR01WaitForMcCoy = 230,
kGoalSteeleHF03ApproachLucy = 233,
kGoalSteeleHF03McCoyChasingLucy = 234,
kGoalSteeleHF02ConfrontLucy = 240,
@@ -1630,7 +1631,6 @@ enum GoalIzo {
kGoalIzoGoToHC03 = 155,
kGoalIzoDieHidden = 198,
kGoalIzoDie = 199,
-
kGoalIzoDead = 599
};
@@ -1699,6 +1699,18 @@ enum GoalDeskClerk {
kGoalDeskClerkGone = 400
};
+enum GoalHolloway {
+ kGoalHollowayDefault = 0,
+ kGoalHollowayGoToNR07 = 240,
+ kGoalHollowayGoToNR02 = 241,
+ kGoalHollowayGoToHF03 = 242,
+ kGoalHollowayApproachMcCoy = 250,
+ kGoalHollowayTalkToMcCoy = 251,
+ kGoalHollowayKnockOutMcCoy = 255,
+ kGoalHollowayPrepareCaptureMcCoy = 256,
+ kGoalHollowayCaptureMcCoy = 257
+};
+
enum GoalMoraji {
kGoalMorajiDefault = 0,
kGoalMorajiShot = 5,
diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp
index 5508512546..8bc03eaa30 100644
--- a/engines/bladerunner/script/ai/gordo.cpp
+++ b/engines/bladerunner/script/ai/gordo.cpp
@@ -517,7 +517,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorGordo, 870, 16);
Sound_Play(576, 50, 0, 0, 50);
Sound_Play(319, 50, 0, 0, 50);
- Actor_Set_Goal_Number(33, 241);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayGoToNR02);
Actor_Says(kActorGordo, 880, 17);
Actor_Set_Goal_Number(kActorGordo, 211);
Player_Loses_Control();
diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp
index f735694b9f..91be365379 100644
--- a/engines/bladerunner/script/ai/hanoi.cpp
+++ b/engines/bladerunner/script/ai/hanoi.cpp
@@ -46,7 +46,7 @@ void AIScriptHanoi::Initialize() {
}
bool AIScriptHanoi::Update() {
- if (Actor_Query_Goal_Number(kActorHolloway) == 240) {
+ if (Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayGoToNR07) {
AI_Countdown_Timer_Reset(kActorHanoi, 0);
}
if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorHanoi) < 200) {
diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp
index e9f162e906..a64183b7c1 100644
--- a/engines/bladerunner/script/ai/holloway.cpp
+++ b/engines/bladerunner/script/ai/holloway.cpp
@@ -25,7 +25,7 @@
namespace BladeRunner {
AIScriptHolloway::AIScriptHolloway(BladeRunnerEngine *vm) : AIScriptBase(vm) {
- _flag = 0;
+ _flag = false;
}
void AIScriptHolloway::Initialize() {
@@ -34,32 +34,35 @@ void AIScriptHolloway::Initialize() {
_animationStateNext = 0;
_animationNext = 0;
- _flag = 0;
+ _flag = false;
- Actor_Set_Goal_Number(kActorHolloway, 0);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayDefault);
}
bool AIScriptHolloway::Update() {
- if (Actor_Query_Goal_Number(kActorHolloway) == 256)
- Actor_Set_Goal_Number(kActorHolloway, 257);
+ if (Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayPrepareCaptureMcCoy) {
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayCaptureMcCoy);
+ }
return false;
}
void AIScriptHolloway::TimerExpired(int timer) {
- if (!timer) {
+ if (timer == 0) {
AI_Countdown_Timer_Reset(kActorHolloway, 0);
if (Global_Variable_Query(kVariableBehavior) == 1) {
Player_Gains_Control();
}
- Actor_Set_Goal_Number(kActorHolloway, 251);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayTalkToMcCoy);
}
}
void AIScriptHolloway::CompletedMovementTrack() {
- if (Actor_Query_Goal_Number(kActorHolloway) < 245 && Actor_Query_Goal_Number(kActorHolloway) > 239) {
- Loop_Actor_Walk_To_Actor(kActorHolloway, 0, 24, 0, 0);
- Actor_Set_Goal_Number(kActorHolloway, 250);
+ if (Actor_Query_Goal_Number(kActorHolloway) < 245
+ && Actor_Query_Goal_Number(kActorHolloway) > 239
+ ) {
+ Loop_Actor_Walk_To_Actor(kActorHolloway, kActorMcCoy, 24, false, false);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayApproachMcCoy);
}
}
@@ -84,9 +87,11 @@ void AIScriptHolloway::OtherAgentExitedThisScene(int otherActorId) {
}
void AIScriptHolloway::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
- if (otherActorId == kActorMcCoy && Actor_Query_Goal_Number(kActorHolloway) == 250) {
+ if (otherActorId == kActorMcCoy
+ && Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayApproachMcCoy
+ ) {
AI_Countdown_Timer_Reset(kActorHolloway, 0);
- Actor_Set_Goal_Number(kActorHolloway, 255);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayKnockOutMcCoy);
}
}
@@ -108,7 +113,7 @@ int AIScriptHolloway::GetFriendlinessModifierIfGetsClue(int otherActorId, int cl
bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
switch (newGoalNumber) {
- case 240:
+ case kGoalHollowayGoToNR07:
Actor_Put_In_Set(kActorHolloway, kSetNR07);
Actor_Set_At_XYZ(kActorHolloway, -102.0f, -73.5f, -233.0f, 0);
Player_Loses_Control();
@@ -117,7 +122,7 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorHolloway);
break;
- case 241:
+ case kGoalHollowayGoToNR02:
Player_Loses_Control();
AI_Movement_Track_Flush(kActorHolloway);
AI_Movement_Track_Append(kActorHolloway, 375, 0);
@@ -125,64 +130,67 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorHolloway);
break;
- case 242:
+ case kGoalHollowayGoToHF03:
Player_Loses_Control();
AI_Movement_Track_Flush(kActorHolloway);
AI_Movement_Track_Append(kActorHolloway, 372, 0);
AI_Movement_Track_Repeat(kActorHolloway);
break;
- case 250:
+ case kGoalHollowayApproachMcCoy:
Scene_Exits_Disable();
- Actor_Says(kActorHolloway, 20, 3);
- Actor_Face_Actor(kActorHolloway, 0, 1);
- if (Player_Query_Combat_Mode() == 1) {
- Actor_Set_Goal_Number(kActorHolloway, 255);
+ Actor_Says(kActorHolloway, 20, kAnimationModeTalk);
+ Actor_Face_Actor(kActorHolloway, kActorMcCoy, true);
+ if (Player_Query_Combat_Mode()) {
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayKnockOutMcCoy);
} else {
- Actor_Says(kActorHolloway, 30, 3);
- Actor_Face_Actor(kActorMcCoy, kActorHolloway, 1);
+ Actor_Says(kActorHolloway, 30, kAnimationModeTalk);
+ Actor_Face_Actor(kActorMcCoy, kActorHolloway, true);
AI_Countdown_Timer_Reset(kActorHolloway, 0);
AI_Countdown_Timer_Start(kActorHolloway, 0, 1);
}
break;
- case 251:
- Actor_Face_Actor(kActorMcCoy, kActorHolloway, 1);
+ case kGoalHollowayTalkToMcCoy:
+ Actor_Face_Actor(kActorMcCoy, kActorHolloway, true);
Actor_Says(kActorMcCoy, 6130, 15);
- Actor_Says(kActorHolloway, 40, 3);
+ Actor_Says(kActorHolloway, 40, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 6135, 13);
- Actor_Says(kActorHolloway, 50, 3);
+ Actor_Says(kActorHolloway, 50, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 6140, 16);
- Actor_Says(kActorHolloway, 60, 3);
+ Actor_Says(kActorHolloway, 60, kAnimationModeTalk);
Actor_Says(kActorMcCoy, 6145, 12);
- Actor_Says(kActorHolloway, 70, 3);
- Actor_Set_Goal_Number(kActorHolloway, 255);
+ Actor_Says(kActorHolloway, 70, kAnimationModeTalk);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayKnockOutMcCoy);
break;
- case 255:
+ case kGoalHollowayKnockOutMcCoy:
Player_Loses_Control();
- Actor_Change_Animation_Mode(kActorHolloway, 6);
+ Actor_Change_Animation_Mode(kActorHolloway, kAnimationModeCombatAttack);
break;
- case 257:
+ case kGoalHollowayCaptureMcCoy:
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Player_Gains_Control();
+
Outtake_Play(kOuttakeInterrogation, 0, 1);
+
if (Global_Variable_Query(kVariableBehavior) == 1) {
Actor_Set_Goal_Number(kActorDektora, 245);
Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle);
}
Player_Gains_Control();
- Game_Flag_Set(kFlagMcCoyCapturedByBaker);
+ Game_Flag_Set(kFlagMcCoyCapturedByHolloway);
Scene_Exits_Enable();
- Actor_Set_Goal_Number(kActorSteele, 230);
+ Actor_Set_Goal_Number(kActorSteele, kGoalSteeleNR01WaitForMcCoy);
Actor_Put_In_Set(kActorHolloway, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorHolloway, 41, 0);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle);
if (Global_Variable_Query(kVariableBehavior) != 1) {
Player_Gains_Control();
}
+
Game_Flag_Set(kFlagUG03toUG04);
Set_Enter(kSetUG04, kSceneUG04);
break;
@@ -199,7 +207,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 0:
*animation = 717;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(717) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(717)) {
_animationFrame = 0;
}
break;
@@ -207,29 +215,34 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 1:
*animation = 719;
_animationFrame++;
+
if (_animationFrame == 9) {
Ambient_Sounds_Play_Sound(222, 90, 99, 0, 0);
}
+
if (_animationFrame == 10) {
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
}
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(719) - 1) {
- Actor_Change_Animation_Mode(kActorHolloway, 0);
+
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(719)) {
+ Actor_Change_Animation_Mode(kActorHolloway, kAnimationModeIdle);
_animationFrame = 0;
_animationState = 0;
*animation = 717;
- Actor_Set_Goal_Number(kActorHolloway, 256);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayPrepareCaptureMcCoy);
}
break;
case 2:
- if (!_animationFrame && _flag) {
+ if (_animationFrame == 0
+ && _flag
+ ) {
*animation = 717;
_animationState = 0;
} else {
*animation = 720;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(720) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(720)) {
_animationFrame = 0;
}
}
@@ -238,7 +251,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 3:
*animation = 721;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(721) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(721)) {
_animationFrame = 0;
_animationState = 2;
*animation = 720;
@@ -248,7 +261,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 4:
*animation = 721;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(721) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(721)) {
_animationFrame = 0;
_animationState = 2;
*animation = 720;
@@ -258,7 +271,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 5:
*animation = 721;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(721) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(721)) {
_animationFrame = 0;
_animationState = 2;
*animation = 720;
@@ -268,7 +281,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 6:
*animation = 721;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(721) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(721)) {
_animationFrame = 0;
_animationState = 2;
*animation = 720;
@@ -278,7 +291,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
case 7:
*animation = 716;
_animationFrame++;
- if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(716) - 1) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(716)) {
_animationFrame = 0;
}
break;
@@ -293,27 +306,27 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
bool AIScriptHolloway::ChangeAnimationMode(int mode) {
switch (mode) {
- case 0:
+ case kAnimationModeIdle:
if (_animationState > 6) {
_animationState = 0;
_animationFrame = 0;
} else {
- _flag = 1;
+ _flag = true;
}
break;
- case 1:
+ case kAnimationModeWalk:
_animationState = 7;
_animationFrame = 0;
break;
- case 3:
+ case kAnimationModeTalk:
_animationState = 2;
_animationFrame = 0;
- _flag = 0;
+ _flag = false;
break;
- case 6:
+ case kAnimationModeCombatAttack:
_animationState = 1;
_animationFrame = 0;
break;
@@ -321,25 +334,25 @@ bool AIScriptHolloway::ChangeAnimationMode(int mode) {
case 12:
_animationState = 3;
_animationFrame = 0;
- _flag = 0;
+ _flag = false;
break;
case 13:
_animationState = 4;
_animationFrame = 0;
- _flag = 0;
+ _flag = false;
break;
case 14:
_animationState = 5;
_animationFrame = 0;
- _flag = 0;
+ _flag = false;
break;
case 15:
_animationState = 6;
_animationFrame = 0;
- _flag = 0;
+ _flag = false;
break;
default:
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 8b16f11136..c35510299a 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(kFlagMcCoyCapturedByBaker)
+ if (Game_Flag_Query(kFlagMcCoyCapturedByHolloway)
&& 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(kFlagMcCoyCapturedByBaker)
+ if (Game_Flag_Query(kFlagMcCoyCapturedByHolloway)
&& Global_Variable_Query(kVariableBehavior) == 3
) {
Actor_Set_Goal_Number(kActorLucy, kGoalLucyReturnToHF03);
@@ -346,7 +346,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case kGoalLucyRunAwayWithHelp1:
Actor_Says(kActorLucy, 320, 16);
- Actor_Set_Goal_Number(kActorHolloway, 242);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayGoToHF03);
Actor_Set_Immunity_To_Obstacles(kActorLucy, true);
AI_Movement_Track_Flush(kActorLucy);
AI_Movement_Track_Append(kActorLucy, 378, 0);
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index 496d277577..611a18a930 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -71,7 +71,7 @@ void SceneScriptNR01::InitializeScene() {
Ambient_Sounds_Add_Sound(377, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0);
if (Game_Flag_Query(643)
- && Actor_Query_Goal_Number(kActorSteele) == 230
+ && Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01WaitForMcCoy
) {
Game_Flag_Reset(kFlagSpinnerAtNR01);
Game_Flag_Reset(kFlagSpinnerAtHF01);
@@ -326,7 +326,7 @@ void SceneScriptNR01::PlayerWalkedIn() {
if (Game_Flag_Query(kFlagUG06toNR01)) {
Loop_Actor_Travel_Stairs(kActorMcCoy, 3, true, kAnimationModeIdle);
Game_Flag_Reset(kFlagUG06toNR01);
- if (Actor_Query_Goal_Number(kActorSteele) == 230) {
+ if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01WaitForMcCoy) {
Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
Actor_Says(kActorSteele, 1440, 13);
Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorSteele, 48, false, true);
diff --git a/engines/bladerunner/script/scene/nr07.cpp b/engines/bladerunner/script/scene/nr07.cpp
index aa70aa3f3a..1f081313d5 100644
--- a/engines/bladerunner/script/scene/nr07.cpp
+++ b/engines/bladerunner/script/scene/nr07.cpp
@@ -209,7 +209,7 @@ void SceneScriptNR07::sub_401A10() {
Actor_Voice_Over(1710, kActorVoiceOver);
Actor_Voice_Over(1720, kActorVoiceOver);
Actor_Voice_Over(1730, kActorVoiceOver);
- Actor_Set_Goal_Number(kActorHolloway, 240);
+ Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayGoToNR07);
}
void SceneScriptNR07::sub_401C60() {