diff options
author | Peter Kohaut | 2019-01-26 14:31:04 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-26 14:31:04 +0100 |
commit | 71c262f88183720a0710a7627b4db324e8d3f66c (patch) | |
tree | f2eb290108426fa6879e60b5a0229e09f800d929 /engines/bladerunner/script/scene | |
parent | bff136ca0c3974525ade5c42b2f3975299c03695 (diff) | |
download | scummvm-rg350-71c262f88183720a0710a7627b4db324e8d3f66c.tar.gz scummvm-rg350-71c262f88183720a0710a7627b4db324e8d3f66c.tar.bz2 scummvm-rg350-71c262f88183720a0710a7627b4db324e8d3f66c.zip |
BLADERUNNER: Analysed Leon scene at Yukon Hotel
Diffstat (limited to 'engines/bladerunner/script/scene')
-rw-r--r-- | engines/bladerunner/script/scene/ct09.cpp | 98 |
1 files changed, 59 insertions, 39 deletions
diff --git a/engines/bladerunner/script/scene/ct09.cpp b/engines/bladerunner/script/scene/ct09.cpp index c9506d54c5..4211ae015e 100644 --- a/engines/bladerunner/script/scene/ct09.cpp +++ b/engines/bladerunner/script/scene/ct09.cpp @@ -25,16 +25,18 @@ namespace BladeRunner { void SceneScriptCT09::InitializeScene() { - if (Game_Flag_Query(85)) { - Setup_Scene_Information(160.0f, 349.0f, 587.0f, 490); + if (Game_Flag_Query(kFlagCT10toCT09)) { + Setup_Scene_Information(160.0f, 349.0f, 587.0f, 490); } else if (Game_Flag_Query(kFlagCT08toCT09)) { Setup_Scene_Information(235.0f, 3348.52f, 599.0f, 800); } else { - Setup_Scene_Information(107.0f, 348.52f, 927.0f, 200); + Setup_Scene_Information(107.0f, 348.52f, 927.0f, 200); } + Scene_Exit_Add_2D_Exit(0, 321, 164, 345, 309, 1); - Scene_Exit_Add_2D_Exit(1, 0, 0, 15, 479, 3); + Scene_Exit_Add_2D_Exit(1, 0, 0, 15, 479, 3); Scene_Exit_Add_2D_Exit(2, 198, 177, 263, 311, 0); + Ambient_Sounds_Add_Looping_Sound(336, 28, 0, 1); Ambient_Sounds_Add_Sound(375, 6, 180, 33, 33, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); @@ -54,12 +56,12 @@ bool SceneScriptCT09::MouseClick(int x, int y) { bool SceneScriptCT09::ClickedOn3DObject(const char *objectName, bool a2) { if (Object_Query_Click("BELL", objectName)) { - if (Actor_Query_Which_Set_In(kActorLeon) != 31) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 229.0f, 348.52f, 851.0f, 36, 1, false, 0)) { + if (Actor_Query_Which_Set_In(kActorLeon) != kSetCT09) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 229.0f, 348.52f, 851.0f, 36, true, false, 0)) { Actor_Face_Object(kActorMcCoy, "BELL", true); Sound_Play(337, 100, 0, 0, 50); if (!Actor_Query_Goal_Number(kActorDeskClerk)) { - Actor_Says(kActorDeskClerk, 160, 3); + Actor_Says(kActorDeskClerk, 160, kAnimationModeTalk); } } } @@ -70,28 +72,30 @@ bool SceneScriptCT09::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptCT09::ClickedOnActor(int actorId) { if (actorId == kActorDeskClerk) { - if (!Actor_Query_Goal_Number(kActorDeskClerk) && Actor_Query_Which_Set_In(kActorLeon) != 31) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 270.0f, 348.52f, 846.0f, 12, 1, false, 0)) { + if (Actor_Query_Goal_Number(kActorDeskClerk) == kGoalDeskClerkDefault + && Actor_Query_Which_Set_In(kActorLeon) != kSetCT09 + ) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 270.0f, 348.52f, 846.0f, 12, true, false, 0)) { Player_Loses_Control(); Actor_Face_Actor(kActorMcCoy, kActorDeskClerk, true); - if (Global_Variable_Query(kVariableChapter) < 3) { - Actor_Says(kActorMcCoy, 650, 3); + if (Global_Variable_Query(kVariableChapter) < 3) { // it is impossible to get here before chapter 3 + Actor_Says(kActorMcCoy, 650, kAnimationModeTalk); Actor_Says(kActorDeskClerk, 250, 12); Actor_Says(kActorMcCoy, 665, 18); - } else if (Game_Flag_Query(540)) { - Actor_Says(kActorMcCoy, 650, 18); - Actor_Says(kActorDeskClerk, 220, 15); - } else { - Game_Flag_Set(540); + } else if (!Game_Flag_Query(kFlagCT09DeskClerkTalk)) { + Game_Flag_Set(kFlagCT09DeskClerkTalk); Actor_Says(kActorDeskClerk, 170, 13); Actor_Says(kActorMcCoy, 630, 12); Actor_Says(kActorDeskClerk, 180, 14); - Actor_Says(kActorMcCoy, 635, 3); + Actor_Says(kActorMcCoy, 635, kAnimationModeTalk); Actor_Says(kActorDeskClerk, 190, 15); Actor_Says(kActorMcCoy, 640, 12); - Actor_Says(kActorMcCoy, 645, 3); + Actor_Says(kActorMcCoy, 645, kAnimationModeTalk); Actor_Says(kActorDeskClerk, 200, 13); Actor_Says(kActorDeskClerk, 210, 14); + } else { + Actor_Says(kActorMcCoy, 650, 18); + Actor_Says(kActorDeskClerk, 220, 15); } Player_Gains_Control(); } @@ -107,8 +111,8 @@ bool SceneScriptCT09::ClickedOnItem(int itemId, bool a2) { bool SceneScriptCT09::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, 348.52f, 599.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 235.0f, 348.52f, 599.0f, 0, 0, false, 0); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, 348.52f, 599.0f, 0, true, false, 0)) { + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 235.0f, 348.52f, 599.0f, 0, false, false, 0); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagCT09toCT08); @@ -116,8 +120,9 @@ bool SceneScriptCT09::ClickedOnExit(int exitId) { } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 107.0f, 348.52f, 927.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 107.0f, 348.52f, 927.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagCT09toCT11); @@ -125,8 +130,9 @@ bool SceneScriptCT09::ClickedOnExit(int exitId) { } return true; } + if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 159.0f, 349.0f, 570.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 159.0f, 349.0f, 570.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagCT09toCT10); @@ -142,7 +148,13 @@ bool SceneScriptCT09::ClickedOn2DRegion(int region) { } void SceneScriptCT09::SceneFrameAdvanced(int frame) { - if (frame == 6 || frame == 12 || frame == 19 || frame == 25 || frame == 46 || frame == 59) { + if (frame == 6 + || frame == 12 + || frame == 19 + || frame == 25 + || frame == 46 + || frame == 59 + ) { Sound_Play(97, Random_Query(47, 47), 70, 70, 50); } } @@ -151,31 +163,36 @@ void SceneScriptCT09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptCT09::PlayerWalkedIn() { - bool v0 = false; - if (Global_Variable_Query(kVariableChapter) == 3 && !Game_Flag_Query(538)) { - Game_Flag_Set(538); - Actor_Set_Goal_Number(kActorLeon, 1); - v0 = true; + bool leonScene = false; + + if ( Global_Variable_Query(kVariableChapter) == 3 + && !Game_Flag_Query(kFlagCT09Entered) + ) { + Game_Flag_Set(kFlagCT09Entered); + Actor_Set_Goal_Number(kActorLeon, kGoalLeonHoldingDeskClerk); + leonScene = true; } + if (Game_Flag_Query(kFlagCT10toCT09)) { Game_Flag_Reset(kFlagCT10toCT09); } else if (Game_Flag_Query(kFlagCT08toCT09)) { - if (v0) { + if (leonScene) { Async_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, 348.52f, 599.0f, 0, false); } else { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, 348.52f, 599.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, 348.52f, 599.0f, 0, false, false, 0); } Game_Flag_Reset(kFlagCT08toCT09); } else { - if (v0) { + if (leonScene) { Async_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 348.52f, 886.0f, 0, false); } else { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 348.52f, 886.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 124.0f, 348.52f, 886.0f, 0, false, false, 0); } Game_Flag_Reset(kFlagCT11toCT09); } - if (Actor_Query_Goal_Number(kActorDeskClerk) == 2) { - if (Game_Flag_Query(539)) { + + if (Actor_Query_Goal_Number(kActorDeskClerk) == kGoalDeskClerkRecovered) { + if (Game_Flag_Query(kFlagCT09LeonInterrupted)) { Actor_Says(kActorDeskClerk, 70, 13); Actor_Face_Actor(kActorMcCoy, kActorDeskClerk, true); Actor_Says(kActorMcCoy, 600, 17); @@ -193,7 +210,7 @@ void SceneScriptCT09::PlayerWalkedIn() { Actor_Says(kActorDeskClerk, 60, 13); Actor_Modify_Friendliness_To_Other(kActorDeskClerk, kActorMcCoy, -1); } - Actor_Set_Goal_Number(kActorDeskClerk, 0); + Actor_Set_Goal_Number(kActorDeskClerk, kGoalDeskClerkDefault); } } @@ -202,13 +219,16 @@ void SceneScriptCT09::PlayerWalkedOut() { void SceneScriptCT09::DialogueQueueFlushed(int a1) { Actor_Force_Stop_Walking(kActorMcCoy); - if (Actor_Query_Goal_Number(kActorLeon) == 1 && !Game_Flag_Query(539)) { + + if ( Actor_Query_Goal_Number(kActorLeon) == kGoalLeonHoldingDeskClerk + && !Game_Flag_Query(kFlagCT09LeonInterrupted) + ) { Player_Loses_Control(); - Actor_Set_Goal_Number(kActorLeon, 2); + Actor_Set_Goal_Number(kActorLeon, kGoalLeonReleaseDeskClerk); //return true; - } else { - //return false; } + + //return false; } } // End of namespace BladeRunner |