aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorPeter Kohaut2019-02-03 17:52:17 +0100
committerPeter Kohaut2019-02-05 21:54:50 +0100
commit6222fa443de8557e5af05e4dffbf53df9e54d8eb (patch)
tree44230cc402522aa3a339e8ac8735e8b30a14e79f /engines/bladerunner/script
parent470f5fbbae7dae623ce5b0465f5e75964850a2d6 (diff)
downloadscummvm-rg350-6222fa443de8557e5af05e4dffbf53df9e54d8eb.tar.gz
scummvm-rg350-6222fa443de8557e5af05e4dffbf53df9e54d8eb.tar.bz2
scummvm-rg350-6222fa443de8557e5af05e4dffbf53df9e54d8eb.zip
BLADERUNNER: Gaff scripts cleanup
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/ai/gaff.cpp47
-rw-r--r--engines/bladerunner/script/scene/kp01.cpp2
-rw-r--r--engines/bladerunner/script/scene/kp06.cpp4
-rw-r--r--engines/bladerunner/script/scene/ma02.cpp4
-rw-r--r--engines/bladerunner/script/scene/ma07.cpp8
-rw-r--r--engines/bladerunner/script/scene/rc01.cpp24
6 files changed, 34 insertions, 55 deletions
diff --git a/engines/bladerunner/script/ai/gaff.cpp b/engines/bladerunner/script/ai/gaff.cpp
index 43d9e9beeb..57bdd8a2dc 100644
--- a/engines/bladerunner/script/ai/gaff.cpp
+++ b/engines/bladerunner/script/ai/gaff.cpp
@@ -47,9 +47,9 @@ bool AIScriptGaff::Update() {
}
if (Global_Variable_Query(kVariableChapter) == 4
- && Actor_Query_Goal_Number(kActorGaff) < 299
+ && Actor_Query_Goal_Number(kActorGaff) < kGoalGaffStartChapter4
) {
- Actor_Set_Goal_Number(kActorGaff, 299);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffStartChapter4);
}
return false;
@@ -59,7 +59,7 @@ bool AIScriptGaff::Update() {
void AIScriptGaff::TimerExpired(int timer) {
if (timer == 0) {
AI_Countdown_Timer_Reset(kActorGaff, 0);
- Actor_Set_Goal_Number(kActorGaff, 301);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07TalkToMcCoy);
}
//return false;
}
@@ -164,14 +164,15 @@ void AIScriptGaff::OtherAgentExitedThisScene(int otherActorId) {
}
void AIScriptGaff::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ // It is impossible to triger this as player has no control at this moment
if (otherActorId == kActorMcCoy
&& combatMode == 1
&& Global_Variable_Query(kVariableChapter) == 4
&& Actor_Query_In_Set(kActorMcCoy, kSetMA07)
- && Actor_Query_Goal_Number(kActorGaff) == 300
+ && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffMA07Wait
) {
AI_Countdown_Timer_Reset(kActorGaff, 0);
- Actor_Set_Goal_Number(kActorGaff, 303);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07ShootMcCoy);
}
// return false;
}
@@ -274,15 +275,15 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_At_Waypoint(kActorGaff, 35, 0);
return true;
- case 300:
+ case kGoalGaffMA07Wait:
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);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07TalkToMcCoy);
return true;
- case 301:
- Game_Flag_Set(648);
+ case kGoalGaffMA07TalkToMcCoy:
+ Game_Flag_Set(kFlagMA07GaffTalk);
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
Actor_Says(kActorGaff, 110, 12);
Actor_Face_Actor(kActorMcCoy, kActorGaff, true);
@@ -306,21 +307,21 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Delay(4000);
Player_Gains_Control();
Actor_Start_Speech_Sample(kActorGaff, 210);
- Actor_Set_Goal_Number(kActorGaff, 302);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07Left);
return true;
- case 302:
+ case kGoalGaffMA07Left:
return true;
- case 303:
+ case kGoalGaffMA07ShootMcCoy:
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatAttack);
Sound_Play(27, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
- Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
+ Actor_Retired_Here(kActorMcCoy, 12, 12, true, -1);
return true;
- case 499:
+ case kGoalGaffGone:
AI_Movement_Track_Flush(kActorGaff);
Actor_Put_In_Set(kActorGaff, kSetKP05_KP06);
Actor_Set_At_XYZ(kActorGaff, -782.15f, 8.26f, -263.64f, 52);
@@ -334,7 +335,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 0:
*animation = 794;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(794)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
}
break;
@@ -342,7 +343,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 1:
*animation = 788;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(788)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
}
break;
@@ -350,7 +351,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 2:
*animation = 798;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(798)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
}
break;
@@ -358,7 +359,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 3:
*animation = 799;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(799)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationState = 2;
_animationFrame = 0;
*animation = 798;
@@ -368,7 +369,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 4:
*animation = 800;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(800)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationState = 2;
_animationFrame = 0;
*animation = 798;
@@ -378,7 +379,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 5:
*animation = 801;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(801)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationState = 2;
_animationFrame = 0;
*animation = 798;
@@ -388,7 +389,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 6:
*animation = 800;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(800)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationState = 2;
_animationFrame = 0;
*animation = 798;
@@ -398,7 +399,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 7:
*animation = 801;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(801)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationState = 2;
_animationFrame = 0;
*animation = 798;
@@ -408,7 +409,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
case 8:
*animation = 802;
_animationFrame++;
- if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(35)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(35) - 1) { // Bug in the game?
Actor_Set_Invisible(kActorGaff, true);
*animation = 794;
_animationFrame = 0;
diff --git a/engines/bladerunner/script/scene/kp01.cpp b/engines/bladerunner/script/scene/kp01.cpp
index 8fbccd5ccf..52f7bfb258 100644
--- a/engines/bladerunner/script/scene/kp01.cpp
+++ b/engines/bladerunner/script/scene/kp01.cpp
@@ -166,7 +166,7 @@ void SceneScriptKP01::PlayerWalkedIn() {
if (!Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)
&& !Game_Flag_Query(714)
&& Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleKP01Wait
- && Actor_Query_Goal_Number(kActorSteele) != 599
+ && Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleGone
) {
Player_Loses_Control();
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleKP01TalkToMcCoy);
diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp
index 0cd53dfe1a..ab1dbed84f 100644
--- a/engines/bladerunner/script/scene/kp06.cpp
+++ b/engines/bladerunner/script/scene/kp06.cpp
@@ -119,7 +119,7 @@ bool SceneScriptKP06::ClickedOnExit(int exitId) {
} else if (Actor_Query_Goal_Number(kActorSteele) == 433) {
Actor_Set_Goal_Number(kActorSteele, 499);
} else {
- Actor_Set_Goal_Number(kActorGaff, 499);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffGone);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
@@ -187,7 +187,7 @@ void SceneScriptKP06::PlayerWalkedIn() {
//return true;
return;
} else {
- Actor_Set_Goal_Number(kActorGaff, 499);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffGone);
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
Actor_Says(kActorGaff, 220, 13);
Actor_Face_Actor(kActorMcCoy, kActorGaff, true);
diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp
index b3e93869a9..b749b18357 100644
--- a/engines/bladerunner/script/scene/ma02.cpp
+++ b/engines/bladerunner/script/scene/ma02.cpp
@@ -186,7 +186,7 @@ void SceneScriptMA02::PlayerWalkedIn() {
}
if ( Global_Variable_Query(kVariableChapter) == 5
- && !Game_Flag_Query(654)
+ && !Game_Flag_Query(kFlagMA02Chapter5Started)
) {
if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
Actor_Says(kActorMcCoy, 2390, kAnimationModeIdle);
@@ -194,7 +194,7 @@ void SceneScriptMA02::PlayerWalkedIn() {
} else {
Actor_Says(kActorMcCoy, 2385, kAnimationModeTalk);
}
- Game_Flag_Set(654);
+ Game_Flag_Set(kFlagMA02Chapter5Started);
Autosave_Game(3);
}
diff --git a/engines/bladerunner/script/scene/ma07.cpp b/engines/bladerunner/script/scene/ma07.cpp
index 2b5c0f43cc..3f5c467d00 100644
--- a/engines/bladerunner/script/scene/ma07.cpp
+++ b/engines/bladerunner/script/scene/ma07.cpp
@@ -121,7 +121,9 @@ void SceneScriptMA07::SceneFrameAdvanced(int frame) {
}
void SceneScriptMA07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
- if (actorId == kActorGaff && newGoal == 302) {
+ if (actorId == kActorGaff
+ && newGoal == kGoalGaffMA07Left
+ ) {
Scene_Exits_Enable();
}
}
@@ -140,12 +142,12 @@ void SceneScriptMA07::PlayerWalkedIn() {
Game_Flag_Reset(kFlagMA06toMA07);
}
- if (!Game_Flag_Query(648)
+ if (!Game_Flag_Query(kFlagMA07GaffTalk)
&& Game_Flag_Query(kFlagUG18GuzzaScene)
&& Global_Variable_Query(kVariableChapter) == 4
) {
Scene_Exits_Disable();
- Actor_Set_Goal_Number(kActorGaff, 300);
+ Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07Wait);
}
if (Game_Flag_Query(kFlagMcCoyFreedOfAccusations)) {
diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp
index 15c4d5e45a..37241cf9f3 100644
--- a/engines/bladerunner/script/scene/rc01.cpp
+++ b/engines/bladerunner/script/scene/rc01.cpp
@@ -51,31 +51,7 @@ void SceneScriptRC01::InitializeScene() {
//TODO: not part of game, remove
Game_Flag_Set(kFlagIntroPlayed); // force skip intro
Game_Flag_Set(kFlagRC02toRC01); // no landing
- // Game_Flag_Set(kFlagRC01PoliceDone);
- // Game_Flag_Set(kFlagKIAPrivacyAddon);
- // Game_Flag_Set(kFlagZubenRetired);
- // Game_Flag_Set(kFlagSpinnerAtMA01);
- // Set_Enter(kSetMA02_MA04, kSceneMA04);
-
- Spinner_Set_Selectable_Destination_Flag(0, true);
- Spinner_Set_Selectable_Destination_Flag(1, true);
- Spinner_Set_Selectable_Destination_Flag(2, true);
- Spinner_Set_Selectable_Destination_Flag(3, true);
- Spinner_Set_Selectable_Destination_Flag(4, true);
- Spinner_Set_Selectable_Destination_Flag(5, true);
- Spinner_Set_Selectable_Destination_Flag(6, true);
- Spinner_Set_Selectable_Destination_Flag(7, true);
- Spinner_Set_Selectable_Destination_Flag(8, true);
- Spinner_Set_Selectable_Destination_Flag(9, true);
-
- // ESPER_Flag_To_Activate();
- // Voight_Kampff_Activate(kActorLucy, 50);
-
- // Global_Variable_Set(kVariableChapter, 2);
- // Chapter_Enter(2, kSetRC03, kSceneRC03);
-
// Set_Enter(kSetPS10_PS11_PS12_PS13, 73);
-
#endif
if (!Game_Flag_Query(kFlagIntroPlayed)) {