aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-02-02 18:19:34 +0100
committerPeter Kohaut2019-02-03 00:14:09 +0100
commitcee294137a95742a7be711c23bc4a3dcc7a6465e (patch)
tree612c92299f91bb4c4f9422de526afc0052fa9b1c
parentce3b7316568b10bcfc21b314b4d2658bc75e29d1 (diff)
downloadscummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.tar.gz
scummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.tar.bz2
scummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.zip
BLADERUNNER: Cleanup for scene at UG18
-rw-r--r--engines/bladerunner/game_constants.h35
-rw-r--r--engines/bladerunner/script/ai/clovis.cpp8
-rw-r--r--engines/bladerunner/script/ai/guzza.cpp51
-rw-r--r--engines/bladerunner/script/ai/officer_grayford.cpp2
-rw-r--r--engines/bladerunner/script/ai/officer_leary.cpp2
-rw-r--r--engines/bladerunner/script/ai/sadik.cpp29
-rw-r--r--engines/bladerunner/script/ai/transient.cpp2
-rw-r--r--engines/bladerunner/script/scene/ct12.cpp4
-rw-r--r--engines/bladerunner/script/scene/ma07.cpp4
-rw-r--r--engines/bladerunner/script/scene/ps14.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug07.cpp4
-rw-r--r--engines/bladerunner/script/scene/ug18.cpp260
-rw-r--r--engines/bladerunner/script/scene_script.h8
13 files changed, 224 insertions, 187 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index b5d21e05a7..f775b078ae 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -1002,7 +1002,7 @@ enum Flags {
kFlagNR03McCoyThrownOut = 604,
kFlagNR04DiscFound = 605,
kFlagNR04EarlyQStungByScorpions = 606,
-
+ kFlagMcCoyRetiredHuman = 607,
kFlagTB07toTB02 = 608,
kFlagNR04McCoyAimedAtEarlyQ = 609,
kFlagUG08Entered = 610,
@@ -1048,6 +1048,7 @@ enum Flags {
kFlagTB07ShadeDown = 661, // is never set
kFlagUG19Available = 665,
kFlagCallWithGuzza = 670,
+ kFlagUG18GuzzaScene = 671,
kFlagMA07toPS14 = 672,
kFlagPS14toMA07 = 673,
kFlagUG15RatShot = 676,
@@ -1066,6 +1067,7 @@ enum Flags {
kFlagUG14DeadHomeless = 694,
kFlagUG15LanceLuthorTrade = 698,
kFlagBulletBobDead = 702,
+ kFlagUG18BriefcaseTaken = 703,
kFlagRC02EnteredChapter4 = 704,
kFlagRC02RunciterTalkWithGun = 705,
kFlagRC02RunciterTalk2 = 706,
@@ -1530,7 +1532,7 @@ enum GameItems {
kItemRadiationGoogles = 88,
kItemGordosLighter1 = 89,
kItemGordosLighter2 = 90,
-
+ kItemBriefcase = 91,
// 92 is never used
// 93 is never used
// 94 is never used
@@ -1829,7 +1831,17 @@ enum GoalGuzza {
kGoalGuzzaGoToHawkersCircle2 = 103,
kGoalGuzzaGoToFreeSlotB = 104,
kGoalGuzzaGoToFreeSlotG = 105,
- kGoalGuzzaSitAtNR03 = 201
+ kGoalGuzzaSitAtNR03 = 201,
+ kGoalGuzzaUG18Wait = 300,
+ kGoalGuzzaUG18Target = 301,
+ kGoalGuzzaUG18WillGetShotBySadik = 302,
+ kGoalGuzzaUG18HitByMcCoy = 303,
+ kGoalGuzzaUG18MissedByMcCoy = 304,
+ kGoalGuzzaUG18ShotByMcCoy = 305,
+ kGoalGuzzaUG18ShootMcCoy = 306,
+ kGoalGuzzaUG18FallDown = 307,
+ kGoalGuzzaUG18ShotBySadik = 390,
+ kGoalGuzzaGone = 599
};
enum GoalClovis {
@@ -1838,7 +1850,12 @@ enum GoalClovis {
kGoalClovisBB11StopSadik = 102,
kGoalClovisBB11TalkWithSadik = 103,
kGoalClovisBB11PrepareTalkToMcCoy = 104, // bug? this is not triggered when player skips dialogue too fast
- kGoalClovisBB11TalkToMcCoy = 105 // ends Chapter 2
+ kGoalClovisBB11TalkToMcCoy = 105, // ends Chapter 2
+ kGoalClovisUG18Wait = 300,
+ kGoalClovisUG18SadikWillShootGuzza = 301,
+ kGoalClovisUG18SadikIsShootingGuzza = 302,
+ kGoalClovisUG18GuzzaDied = 303,
+ kGoalClovisUG18Leave = 310
};
enum GoalLucy {
@@ -1897,7 +1914,15 @@ enum GoalSadik {
kGoalSadikBB11CatchMcCoy = 104,
kGoalSadikBB11KnockOutMcCoy = 105,
kGoalSadikBB11KickMcCoy = 106,
- kGoalSadikBB11TalkWithClovis = 107
+ kGoalSadikBB11TalkWithClovis = 107,
+ kGoalSadikUG18Wait = 300,
+ kGoalSadikUG18Move = 301,
+ kGoalSadikUG18Decide = 302,
+ // 303, 304 and 305 are never set or used
+ kGoalSadikUG18WillShootMcCoy = 306,
+ kGoalSadikUG18PrepareShootMcCoy = 307,
+ kGoalSadikUG18ShootMcCoy = 308,
+ kGoalSadikUG18Leave = 310
};
enum GoalLuther {
diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp
index c8a57eed98..653dd3ee3c 100644
--- a/engines/bladerunner/script/ai/clovis.cpp
+++ b/engines/bladerunner/script/ai/clovis.cpp
@@ -305,16 +305,16 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Game_Flag_Set(kFlagChapter3Intro);
return true;
- case 300:
+ case kGoalClovisUG18Wait:
Actor_Put_In_Set(kActorClovis, kSetUG18);
Actor_Set_At_XYZ(kActorClovis, -52.26f, 0.0f, 611.02f, 900);
Actor_Change_Animation_Mode(kActorClovis, kAnimationModeIdle);
return true;
- case 301:
- case 302:
+ case kGoalClovisUG18SadikWillShootGuzza:
+ case kGoalClovisUG18SadikIsShootingGuzza:
case 303:
- case 310:
+ case kGoalClovisUG18Leave:
return true;
case 350:
diff --git a/engines/bladerunner/script/ai/guzza.cpp b/engines/bladerunner/script/ai/guzza.cpp
index f715c0be75..d76ee3ee73 100644
--- a/engines/bladerunner/script/ai/guzza.cpp
+++ b/engines/bladerunner/script/ai/guzza.cpp
@@ -111,7 +111,7 @@ void AIScriptGuzza::ClickedByPlayer() {
Actor_Says(kActorMcCoy, 3970, 13);
Actor_Says(kActorGuzza, 780, -1);
}
- //TODO: test this, seems like a bug in game
+ //TODO: test this, looks like a bug in game
if (Random_Query(1, 4) == 1) {
AI_Movement_Track_Pause(4);
Actor_Says(kActorMcCoy, 4005, 15);
@@ -148,23 +148,23 @@ void AIScriptGuzza::OtherAgentEnteredCombatMode(int otherActorId, int combatMode
}
void AIScriptGuzza::ShotAtAndMissed() {
- if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
+ if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaUG18Target) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
- Actor_Set_Goal_Number(kActorGuzza, 304);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18MissedByMcCoy);
}
// return false;
}
bool AIScriptGuzza::ShotAtAndHit() {
- if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
+ if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaUG18Target) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
- Actor_Set_Goal_Number(kActorGuzza, 303);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18HitByMcCoy);
}
return false;
}
void AIScriptGuzza::Retired(int byActorId) {
- Actor_Set_Goal_Number(kActorGuzza, 599);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGone);
// return false;
}
@@ -218,34 +218,34 @@ bool AIScriptGuzza::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case 201:
- Actor_Change_Animation_Mode(kActorGuzza, 53);
+ case kGoalGuzzaSitAtNR03:
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeSit);
_animationState = 1;
_animationFrame = 0;
Actor_Put_In_Set(kActorGuzza, kSetNR03);
Actor_Set_At_XYZ(kActorGuzza, -229.0f, -70.19f, -469.0f, 400);
return true;
- case 300:
+ case kGoalGuzzaUG18Wait:
Actor_Put_In_Set(kActorGuzza, kSetUG18);
Actor_Set_At_XYZ(kActorGuzza, 10.79f, 0.0f, -354.17f, 400);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeIdle);
return true;
- case 301:
+ case kGoalGuzzaUG18Target:
Actor_Set_Targetable(kActorGuzza, true);
return true;
- case 302:
- case 303:
- case 304:
+ case kGoalGuzzaUG18WillGetShotBySadik:
+ case kGoalGuzzaUG18HitByMcCoy:
+ case kGoalGuzzaUG18MissedByMcCoy:
Actor_Set_Targetable(kActorGuzza, false);
return true;
- case 305:
- case 306:
- case 307:
- case 390:
+ case kGoalGuzzaUG18ShotByMcCoy:
+ case kGoalGuzzaUG18ShootMcCoy:
+ case kGoalGuzzaUG18FallDown:
+ case kGoalGuzzaUG18ShotBySadik:
return true;
}
return false;
@@ -568,7 +568,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
*animation = 172;
_animationState = 24;
_flag = false;
- Actor_Change_Animation_Mode(kActorGuzza, 4);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatIdle);
_state = 0;
_counter = 0;
_frameDelta = 1;
@@ -877,12 +877,12 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
}
_animationFrame = 0;
break;
-
+
case 23:
_animationState = 32;
_animationFrame = 0;
break;
-
+
case 30:
if (_animationState == 1) {
_animationState = 3;
@@ -894,6 +894,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 31:
if (_animationState == 1) {
_animationState = 3;
@@ -905,6 +906,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 32:
if (_animationState == 1) {
_animationState = 3;
@@ -916,6 +918,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 33:
if (_animationState == 1) {
_animationState = 3;
@@ -927,6 +930,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 34:
if (_animationState == 1) {
_animationState = 3;
@@ -938,32 +942,39 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case kAnimationModeWalkUp:
_animationState = 9;
_animationFrame = 0;
break;
+
case kAnimationModeWalkDown:
_animationState = 10;
_animationFrame = 0;
break;
+
case 48:
_animationState = 28;
_animationFrame = 0;
break;
+
case 53:
_animationState = 1;
_animationFrame = 0;
break;
+
case 58:
_animationState = 22;
_animationFrame = 0;
_flag = false;
break;
+
case 59:
_animationState = 23;
_animationFrame = 0;
_flag = false;
break;
+
case 61:
_animationState = 33;
_animationFrame = 0;
diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp
index da21d21114..a4680c4389 100644
--- a/engines/bladerunner/script/ai/officer_grayford.cpp
+++ b/engines/bladerunner/script/ai/officer_grayford.cpp
@@ -394,7 +394,7 @@ bool AIScriptOfficerGrayford::ShotAtAndHit() {
void AIScriptOfficerGrayford::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorOfficerGrayford, 599);
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
int AIScriptOfficerGrayford::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp
index 718a39aff7..2aa3fecd77 100644
--- a/engines/bladerunner/script/ai/officer_leary.cpp
+++ b/engines/bladerunner/script/ai/officer_leary.cpp
@@ -264,7 +264,7 @@ bool AIScriptOfficerLeary::ShotAtAndHit() {
void AIScriptOfficerLeary::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorOfficerLeary, 599);
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
int AIScriptOfficerLeary::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp
index 250e090b5e..109f8d05c7 100644
--- a/engines/bladerunner/script/ai/sadik.cpp
+++ b/engines/bladerunner/script/ai/sadik.cpp
@@ -90,8 +90,9 @@ void AIScriptSadik::TimerExpired(int timer) {
if (timer == 0) {
AI_Countdown_Timer_Reset(kActorSadik, 0);
+ // goals 303, 304 and 305 are never set, cut out part of game?
switch (Actor_Query_Goal_Number(kActorSadik)) {
- case 302:
+ case kGoalSadikUG18Decide:
Actor_Set_Goal_Number(kActorSadik, 305);
break;
@@ -99,8 +100,8 @@ void AIScriptSadik::TimerExpired(int timer) {
Actor_Set_Goal_Number(kActorSadik, 305);
break;
- case 307:
- Actor_Set_Goal_Number(kActorSadik, 308);
+ case kGoalSadikUG18PrepareShootMcCoy:
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18ShootMcCoy);
break;
}
}
@@ -120,8 +121,8 @@ void AIScriptSadik::CompletedMovementTrack() {
Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11KickMcCoy);
break;
- case 301:
- Actor_Set_Goal_Number(kActorSadik, 302);
+ case kGoalSadikUG18Move:
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Decide);
break;
default:
@@ -171,8 +172,7 @@ void AIScriptSadik::ShotAtAndMissed() {
}
bool AIScriptSadik::ShotAtAndHit() {
-
- if (Actor_Query_Goal_Number(kActorSadik) == 301) {
+ if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18Move) {
if (Game_Flag_Query(kFlagSadikIsReplicant)) {
Actor_Set_Health(kActorSadik, 60, 60);
} else {
@@ -289,13 +289,13 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Goal_Number(kActorMcCoy, 199);
return true;
- case 300:
+ case kGoalSadikUG18Wait:
Actor_Put_In_Set(kActorSadik, kSetUG18);
Actor_Set_At_XYZ(kActorSadik, 111.89f, 0.0f, 408.42f, 0);
Actor_Change_Animation_Mode(kActorSadik, 4);
return true;
- case 301:
+ case kGoalSadikUG18Move:
Actor_Set_Targetable(kActorSadik, true);
World_Waypoint_Set(436, 89, -356.11f, 0.0f, 652.42f);
AI_Movement_Track_Flush(kActorSadik);
@@ -303,10 +303,11 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSadik);
return true;
- case 302:
+ case kGoalSadikUG18Decide:
Actor_Set_Targetable(kActorSadik, false);
return true;
+ // goals 303, 304 and 305 are never set, cut out part of game?
case 303:
AI_Countdown_Timer_Reset(kActorSadik, 0);
AI_Countdown_Timer_Start(kActorSadik, 0, 5);
@@ -318,16 +319,16 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case 305:
- case 306:
- case 310:
+ case kGoalSadikUG18WillShootMcCoy:
+ case kGoalSadikUG18Leave:
return true;
- case 307:
+ case kGoalSadikUG18PrepareShootMcCoy:
Sound_Play(12, 100, 0, 0, 50);
AI_Countdown_Timer_Start(kActorSadik, 0, 2);
return true;
- case 308:
+ case kGoalSadikUG18ShootMcCoy:
if (Player_Query_Current_Scene() == kSceneUG18) {
Actor_Force_Stop_Walking(kActorMcCoy);
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
diff --git a/engines/bladerunner/script/ai/transient.cpp b/engines/bladerunner/script/ai/transient.cpp
index 62d3c02090..c5dc4caec0 100644
--- a/engines/bladerunner/script/ai/transient.cpp
+++ b/engines/bladerunner/script/ai/transient.cpp
@@ -172,7 +172,7 @@ void AIScriptTransient::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorTransient, 599);
if (Global_Variable_Query(kVariableChapter) == 4) {
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
}
diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp
index 5bd35d83c3..cab008d97a 100644
--- a/engines/bladerunner/script/scene/ct12.cpp
+++ b/engines/bladerunner/script/scene/ct12.cpp
@@ -128,8 +128,8 @@ bool SceneScriptCT12::ClickedOnActor(int actorId) {
if (actorId == kActorOfficerGrayford
&& Global_Variable_Query(kVariableChapter) == 4
- && Game_Flag_Query(671)
- && Game_Flag_Query(703)
+ && Game_Flag_Query(kFlagUG18GuzzaScene)
+ && Game_Flag_Query(kFlagUG18BriefcaseTaken)
) {
Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true);
diff --git a/engines/bladerunner/script/scene/ma07.cpp b/engines/bladerunner/script/scene/ma07.cpp
index 27b489733b..f943f46dd6 100644
--- a/engines/bladerunner/script/scene/ma07.cpp
+++ b/engines/bladerunner/script/scene/ma07.cpp
@@ -76,7 +76,7 @@ bool SceneScriptMA07::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 104.0f, -162.0f, 56.0f, 12, true, false, 0)) {
if (Global_Variable_Query(kVariableChapter) == 4
- && Game_Flag_Query(671)
+ && Game_Flag_Query(kFlagUG18GuzzaScene)
) {
Actor_Set_Goal_Number(kActorMcCoy, 400);
} else {
@@ -141,7 +141,7 @@ void SceneScriptMA07::PlayerWalkedIn() {
}
if (!Game_Flag_Query(648)
- && Game_Flag_Query(671)
+ && Game_Flag_Query(kFlagUG18GuzzaScene)
&& Global_Variable_Query(kVariableChapter) == 4
) {
Scene_Exits_Disable();
diff --git a/engines/bladerunner/script/scene/ps14.cpp b/engines/bladerunner/script/scene/ps14.cpp
index bd22dffafd..392776a635 100644
--- a/engines/bladerunner/script/scene/ps14.cpp
+++ b/engines/bladerunner/script/scene/ps14.cpp
@@ -74,7 +74,7 @@ bool SceneScriptPS14::ClickedOnExit(int exitId) {
Loop_Actor_Travel_Stairs(kActorMcCoy, 3, true, kAnimationModeIdle);
if (Global_Variable_Query(kVariableChapter) == 4
- && Game_Flag_Query(671)
+ && Game_Flag_Query(kFlagUG18GuzzaScene)
) {
if (Actor_Clue_Query(kActorMcCoy, kClueBriefcase)) {
Game_Flag_Set(666);
diff --git a/engines/bladerunner/script/scene/ug07.cpp b/engines/bladerunner/script/scene/ug07.cpp
index 9892d16067..795ab2f2d6 100644
--- a/engines/bladerunner/script/scene/ug07.cpp
+++ b/engines/bladerunner/script/scene/ug07.cpp
@@ -116,8 +116,8 @@ bool SceneScriptUG07::ClickedOnExit(int exitId) {
}
if (exitId == 2) {
- if (!Game_Flag_Query(607)
- && Game_Flag_Query(671)
+ if (!Game_Flag_Query(kFlagMcCoyRetiredHuman)
+ && Game_Flag_Query(kFlagUG18GuzzaScene)
&& Global_Variable_Query(kVariableChapter) == 4
&& !Game_Flag_Query(598)
) {
diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp
index 35b4661205..292062a589 100644
--- a/engines/bladerunner/script/scene/ug18.cpp
+++ b/engines/bladerunner/script/scene/ug18.cpp
@@ -60,12 +60,12 @@ void SceneScriptUG18::InitializeScene() {
Scene_Loop_Set_Default(4);
if ( Game_Flag_Query(kFlagCallWithGuzza)
- && !Game_Flag_Query(671)
+ && !Game_Flag_Query(kFlagUG18GuzzaScene)
&& Global_Variable_Query(kVariableChapter) == 4
) {
- Actor_Set_Goal_Number(kActorGuzza, 300);
- Actor_Set_Goal_Number(kActorClovis, 300);
- Actor_Set_Goal_Number(kActorSadik, 300);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18Wait);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18Wait);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Wait);
}
}
@@ -77,7 +77,7 @@ void SceneScriptUG18::SceneLoaded() {
Clickable_Object("MACHINE_01");
Unclickable_Object("MACHINE_01");
- if (Game_Flag_Query(671)) {
+ if (Game_Flag_Query(kFlagUG18GuzzaScene)) {
Actor_Put_In_Set(kActorGuzza, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorGuzza, 41, 0);
if (Actor_Query_Which_Set_In(kActorSadik) == kSetUG18) {
@@ -85,11 +85,12 @@ void SceneScriptUG18::SceneLoaded() {
Actor_Set_At_Waypoint(kActorSadik, 33, 0);
}
}
+
if ( Game_Flag_Query(kFlagCallWithGuzza)
- && !Game_Flag_Query(671)
+ && !Game_Flag_Query(kFlagUG18GuzzaScene)
&& Global_Variable_Query(kVariableChapter) == 4
) {
- Item_Add_To_World(91, 987, 89, -55.21f, 0.0f, -302.17f, 0, 12, 12, false, true, false, true);
+ Item_Add_To_World(kItemBriefcase, 987, kSetUG18, -55.21f, 0.0f, -302.17f, 0, 12, 12, false, true, false, true);
}
}
@@ -106,13 +107,13 @@ bool SceneScriptUG18::ClickedOnActor(int actorId) {
}
bool SceneScriptUG18::ClickedOnItem(int itemId, bool combatMode) {
- if (itemId == 91) {
+ if (itemId == kItemBriefcase) {
if (combatMode) {
- Item_Remove_From_World(91);
- } else if (!Loop_Actor_Walk_To_Item(kActorMcCoy, 91, 12, true, false)) {
+ Item_Remove_From_World(kItemBriefcase);
+ } else if (!Loop_Actor_Walk_To_Item(kActorMcCoy, kItemBriefcase, 12, true, false)) {
Item_Pickup_Spin_Effect(987, 368, 243);
Item_Remove_From_World(itemId);
- Game_Flag_Set(703);
+ Game_Flag_Set(kFlagUG18BriefcaseTaken);
Actor_Clue_Acquire(kActorMcCoy, kClueBriefcase, true, kActorGuzza);
}
}
@@ -141,8 +142,9 @@ void SceneScriptUG18::SceneFrameAdvanced(int frame) {
void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
if (actorId == kActorGuzza) {
- if (newGoal == 303) {
- Game_Flag_Set(607);
+ switch (newGoal) {
+ case kGoalGuzzaUG18HitByMcCoy:
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
ADQ_Flush();
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 7);
Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, 10);
@@ -150,8 +152,10 @@ void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
Actor_Face_Actor(kActorGuzza, kActorMcCoy, true);
ADQ_Add(kActorGuzza, 1220, 58);
Scene_Exits_Enable();
- Actor_Set_Goal_Number(kActorGuzza, 305);
- } else if (newGoal == 304) {
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18ShotByMcCoy);
+ break;
+
+ case kGoalGuzzaUG18MissedByMcCoy:
ADQ_Flush();
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 7);
Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, 10);
@@ -159,32 +163,48 @@ void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
Actor_Face_Actor(kActorGuzza, kActorMcCoy, true);
ADQ_Add(kActorGuzza, 1220, 58);
Scene_Exits_Enable();
- Actor_Set_Goal_Number(kActorGuzza, 306);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18ShootMcCoy);
+ break;
}
return;
}
if (actorId == kActorSadik) {
- if (newGoal == 302) {
+ switch (newGoal) {
+ case kGoalSadikUG18Decide:
if (Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy) > 55
- && Game_Flag_Query(607)
+ && Game_Flag_Query(kFlagMcCoyRetiredHuman)
) {
- sub_403588();
+ Actor_Says(kActorClovis, 660, 13);
+ Actor_Says(kActorMcCoy, 5995, 13);
+ Actor_Says(kActorClovis, 670, 13);
+ Actor_Says(kActorMcCoy, 6000, 13);
+ Actor_Says_With_Pause(kActorClovis, 680, 2.0f, 13);
+ Actor_Says(kActorClovis, 690, 13);
+ Actor_Says(kActorClovis, 700, 13);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Leave);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18Leave);
} else {
- Actor_Set_Goal_Number(kActorSadik, 307);
- Actor_Set_Goal_Number(kActorClovis, 310);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18PrepareShootMcCoy);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18Leave);
}
- } else if (newGoal == 304) {
+ break;
+
+ // goals 303, 304 and 305 are never set, cut out part of game?
+ case 304:
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -3);
ADQ_Add(kActorSadik, 380, -1);
- Actor_Set_Goal_Number(kActorSadik, 306);
- } else if (newGoal == 305) {
- Actor_Change_Animation_Mode(kActorSadik, 6);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18WillShootMcCoy);
+ break;
+
+ case 305:
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(12, 100, 0, 0, 50);
Actor_Force_Stop_Walking(kActorMcCoy);
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Player_Loses_Control();
Actor_Retired_Here(kActorMcCoy, 6, 6, true, kActorSadik);
+ break;
}
}
}
@@ -193,13 +213,13 @@ void SceneScriptUG18::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -488.71f, 0.0f, 123.59f, 0, false, false, 0);
if ( Game_Flag_Query(kFlagCallWithGuzza)
- && !Game_Flag_Query(671)
+ && !Game_Flag_Query(kFlagUG18GuzzaScene)
&& Actor_Query_Is_In_Current_Set(kActorGuzza)
) {
Scene_Exits_Disable();
- sub_402734();
- sub_403278();
- Game_Flag_Set(671);
+ talkWithGuzza();
+ talkWithClovis();
+ Game_Flag_Set(kFlagUG18GuzzaScene);
}
}
@@ -207,32 +227,35 @@ void SceneScriptUG18::PlayerWalkedOut() {
}
void SceneScriptUG18::DialogueQueueFlushed(int a1) {
- int v0 = Actor_Query_Goal_Number(kActorGuzza);
- if (v0 == 301) {
- Actor_Set_Goal_Number(kActorGuzza, 302);
- Actor_Change_Animation_Mode(kActorSadik, 6);
+ switch (Actor_Query_Goal_Number(kActorGuzza)) {
+ case kGoalGuzzaUG18Target:
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18WillGetShotBySadik);
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(14, 100, 0, 0, 50);
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
ADQ_Add(kActorClovis, 630, 13);
- Actor_Set_Goal_Number(kActorClovis, 301);
- } else if (v0 == 305) {
- Actor_Change_Animation_Mode(kActorMcCoy, 6);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18SadikWillShootGuzza);
+ break;
+
+ case kGoalGuzzaUG18ShotByMcCoy:
+ // Bug in the game, shot animation is not reset so McCoy looks still while he is shooting
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(13, 100, 0, 0, 50);
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(900);
- Actor_Change_Animation_Mode(kActorMcCoy, 6);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(14, 100, 0, 0, 50);
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(1100);
- Actor_Change_Animation_Mode(kActorMcCoy, 6);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(12, 100, 0, 0, 50);
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
Delay(900);
- Actor_Change_Animation_Mode(kActorMcCoy, 6);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack);
Sound_Play(14, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, 61);
- Overlay_Play("UG18over", 1, 0, 1, 0);
- Actor_Set_Goal_Number(kActorGuzza, 307);
+ Overlay_Play("UG18over", 1, false, true, 0);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18FallDown);
Player_Gains_Control();
ADQ_Add_Pause(2000);
ADQ_Add(kActorSadik, 360, -1);
@@ -240,48 +263,57 @@ void SceneScriptUG18::DialogueQueueFlushed(int a1) {
ADQ_Add(kActorClovis, 650, 14);
ADQ_Add(kActorSadik, 370, 14);
ADQ_Add(kActorClovis, 1320, 14);
- Actor_Set_Goal_Number(kActorClovis, 303);
- } else if (v0 == 306) {
- Actor_Change_Animation_Mode(kActorGuzza, 6);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18GuzzaDied);
+ break;
+
+ case kGoalGuzzaUG18ShootMcCoy:
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatAttack);
Sound_Play(13, 100, 0, 0, 50);
Actor_Force_Stop_Walking(kActorMcCoy);
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Player_Loses_Control();
- Actor_Retired_Here(kActorMcCoy, 6, 6, 1, kActorGuzza);
- Actor_Set_Goal_Number(kActorGuzza, 307);
+ Actor_Retired_Here(kActorMcCoy, 6, 6, true, kActorGuzza);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18FallDown);
+ break;
}
- int v1 = Actor_Query_Goal_Number(kActorClovis);
- if (v1 == 301) {
- Actor_Change_Animation_Mode(kActorSadik, 6);
+ switch (Actor_Query_Goal_Number(kActorClovis)) {
+ case kGoalClovisUG18SadikWillShootGuzza:
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(14, 100, 0, 0, 50);
- Actor_Change_Animation_Mode(kActorGuzza, 22);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
ADQ_Add(kActorClovis, 640, 13);
ADQ_Add(kActorGuzza, 1210, 13);
- Actor_Set_Goal_Number(kActorClovis, 302);
- } else if (v1 == 302) {
- Actor_Change_Animation_Mode(kActorSadik, 6);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18SadikIsShootingGuzza);
+ break;
+
+ case kGoalClovisUG18SadikIsShootingGuzza:
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
Sound_Play(14, 100, 0, 0, 50);
Actor_Change_Animation_Mode(kActorGuzza, 61);
ADQ_Add_Pause(2000);
ADQ_Add(kActorClovis, 650, 14);
ADQ_Add(kActorSadik, 370, 14);
ADQ_Add(kActorClovis, 1320, 14);
- Actor_Set_Goal_Number(kActorGuzza, 390);
- Actor_Retired_Here(kActorGuzza, 72, 32, 1, kActorSadik);
- Actor_Set_Goal_Number(kActorClovis, 303);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18ShotBySadik);
+ Actor_Retired_Here(kActorGuzza, 72, 32, true, kActorSadik);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18GuzzaDied);
Scene_Exits_Enable();
- } else if (v1 == 303) {
- Actor_Set_Goal_Number(kActorSadik, 301);
+ break;
+
+ case kGoalClovisUG18GuzzaDied:
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Move);
+ break;
}
- if (Actor_Query_Goal_Number(kActorSadik) == 306) {
- Actor_Change_Animation_Mode(kActorSadik, 48);
- Actor_Set_Goal_Number(kActorSadik, 307);
- Actor_Set_Goal_Number(kActorClovis, 310);
+
+ if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18WillShootMcCoy) {
+ Actor_Change_Animation_Mode(kActorSadik, kAnimationModeDie);
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18PrepareShootMcCoy);
+ Actor_Set_Goal_Number(kActorClovis, kGoalClovisUG18Leave);
}
}
-void SceneScriptUG18::sub_402734() {
+void SceneScriptUG18::talkWithGuzza() {
Actor_Face_Actor(kActorMcCoy, kActorGuzza, true);
Actor_Says(kActorMcCoy, 5860, 9);
Delay(500);
@@ -325,7 +357,7 @@ void SceneScriptUG18::sub_402734() {
Actor_Says(kActorGuzza, 950, 14);
Actor_Says(kActorGuzza, 960, 13);
Actor_Says(kActorGuzza, 970, 3);
- if (Game_Flag_Query(607)) {
+ if (Game_Flag_Query(kFlagMcCoyRetiredHuman)) {
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 3);
Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, 5);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -117.13f, 0.0f, -284.47f, 0, false, false, 0);
@@ -337,66 +369,50 @@ void SceneScriptUG18::sub_402734() {
Actor_Says(kActorMcCoy, 5970, 14);
Actor_Says(kActorGuzza, 1000, 3);
Actor_Says(kActorMcCoy, 5975, 15);
- } else {
- sub_402DE8();
- }
-}
-
-void SceneScriptUG18::sub_402DE8() {
- if (Player_Query_Agenda() != kPlayerAgendaPolite) {
- if (Global_Variable_Query(kVariableAffectionTowards) > 1
- || Player_Query_Agenda() == kPlayerAgendaSurly
- ) {
- sub_403114();
- } else {
- sub_402F8C();
- }
- } else {
+ } else if (Player_Query_Agenda() == kPlayerAgendaPolite) {
Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -1);
Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, -1);
Actor_Says(kActorMcCoy, 5935, 14);
Actor_Says(kActorMcCoy, 5940, 18);
Actor_Says(kActorGuzza, 1020, 13);
Actor_Says(kActorGuzza, 1030, 14);
+ } else if (Global_Variable_Query(kVariableAffectionTowards) > 1
+ || Player_Query_Agenda() == kPlayerAgendaSurly
+ ) {
+ Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 20);
+ Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, 10);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -117.13f, 0.0f, -284.47f, 0, false, false, 0);
+ Actor_Face_Actor(kActorMcCoy, kActorGuzza, true);
+ Actor_Says(kActorMcCoy, 5950, 16);
+ Actor_Says(kActorMcCoy, 5955, 14);
+ Actor_Says(kActorGuzza, 1110, 13);
+ Actor_Says(kActorGuzza, 1120, 15);
+ Actor_Says(kActorMcCoy, 5990, 3);
+ Actor_Says(kActorGuzza, 1130, 15);
+ Actor_Says(kActorGuzza, 1140, 16);
+ } else {
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -117.13f, 0.0f, -284.47f, 0, false, false, 0);
+ Actor_Face_Actor(kActorMcCoy, kActorGuzza, true);
+ Actor_Says(kActorMcCoy, 5945, 12);
+ Actor_Says(kActorGuzza, 1040, 15);
+ Actor_Says(kActorMcCoy, 5980, 15);
+ Actor_Says(kActorGuzza, 1050, 12);
+ Actor_Says(kActorGuzza, 1060, 13);
+ Actor_Says(kActorGuzza, 1070, 14);
+ Actor_Says(kActorMcCoy, 5985, 18);
+ Actor_Says(kActorGuzza, 1080, 3);
+ Actor_Says(kActorGuzza, 1090, 14);
+ Actor_Says(kActorGuzza, 1100, 13);
}
}
-void SceneScriptUG18::sub_402F8C() {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -117.13f, 0.0f, -284.47f, 0, false, false, 0);
- Actor_Face_Actor(kActorMcCoy, kActorGuzza, true);
- Actor_Says(kActorMcCoy, 5945, 12);
- Actor_Says(kActorGuzza, 1040, 15);
- Actor_Says(kActorMcCoy, 5980, 15);
- Actor_Says(kActorGuzza, 1050, 12);
- Actor_Says(kActorGuzza, 1060, 13);
- Actor_Says(kActorGuzza, 1070, 14);
- Actor_Says(kActorMcCoy, 5985, 18);
- Actor_Says(kActorGuzza, 1080, 3);
- Actor_Says(kActorGuzza, 1090, 14);
- Actor_Says(kActorGuzza, 1100, 13);
-}
-
-void SceneScriptUG18::sub_403114() {
- Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 20);
- Actor_Modify_Friendliness_To_Other(kActorSadik, kActorMcCoy, 10);
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -117.13f, 0.0f, -284.47f, 0, false, false, 0);
- Actor_Face_Actor(kActorMcCoy, kActorGuzza, true);
- Actor_Says(kActorMcCoy, 5950, 16);
- Actor_Says(kActorMcCoy, 5955, 14);
- Actor_Says(kActorGuzza, 1110, 13);
- Actor_Says(kActorGuzza, 1120, 15);
- Actor_Says(kActorMcCoy, 5990, 3);
- Actor_Says(kActorGuzza, 1130, 15);
- Actor_Says(kActorGuzza, 1140, 16);
-}
-
-void SceneScriptUG18::sub_403278() {
+void SceneScriptUG18::talkWithClovis() {
ADQ_Flush();
Actor_Start_Speech_Sample(kActorClovis, 590);
Delay(500);
Loop_Actor_Walk_To_XYZ(kActorGuzza, 126.79f, 0.0f, -362.17f, 0, false, false, 0);
Actor_Face_Heading(kActorGuzza, 729, false);
- Actor_Set_Goal_Number(kActorGuzza, 301);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18Target);
ADQ_Add(kActorSadik, 350, 13);
ADQ_Add_Pause(1500);
ADQ_Add(kActorGuzza, 1150, 58);
@@ -412,16 +428,4 @@ void SceneScriptUG18::sub_403278() {
ADQ_Add(kActorGuzza, 1200, 59);
}
-void SceneScriptUG18::sub_403588() {
- Actor_Says(kActorClovis, 660, 13);
- Actor_Says(kActorMcCoy, 5995, 13);
- Actor_Says(kActorClovis, 670, 13);
- Actor_Says(kActorMcCoy, 6000, 13);
- Actor_Says_With_Pause(kActorClovis, 680, 2.0f, 13);
- Actor_Says(kActorClovis, 690, 13);
- Actor_Says(kActorClovis, 700, 13);
- Actor_Set_Goal_Number(kActorSadik, 310);
- Actor_Set_Goal_Number(kActorClovis, 310);
-}
-
} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index a1899a3d30..ca6f416367 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -504,12 +504,8 @@ DECLARE_SCRIPT(UG17)
END_SCRIPT
DECLARE_SCRIPT(UG18)
- void sub_402734();
- void sub_402DE8();
- void sub_402F8C();
- void sub_403114();
- void sub_403278();
- void sub_403588();
+ void talkWithGuzza();
+ void talkWithClovis();
END_SCRIPT
DECLARE_SCRIPT(UG19)