From 2bea2307111c8ab1f072b899cbc4780f31ffd162 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Sat, 26 Jan 2019 20:29:36 +0100 Subject: BLADERUNNER: Initial cleanup of HF02 & HF03 --- engines/bladerunner/game_constants.h | 13 ++++-- engines/bladerunner/script/init_script.cpp | 19 ++++++-- engines/bladerunner/script/scene/hf02.cpp | 29 +++++++----- engines/bladerunner/script/scene/hf03.cpp | 75 ++++++++++++++++++------------ engines/bladerunner/script/scene/hf04.cpp | 42 ++++++++++------- engines/bladerunner/script/scene_script.h | 2 +- 6 files changed, 115 insertions(+), 65 deletions(-) diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index 59e638329e..6ab99e79a5 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -901,6 +901,8 @@ enum Flags { kFlagTB06KitchenBoxTaken = 520, kFlagHC03TrapDoorOpened = 521, kFlagCT10Entered = 525, + kFlagHF02toHF03 = 527, + kFlagHF03toHF02 = 528, kFlagCT11toDR01 = 531, kFlagCT09Entered = 538, kFlagCT09LeonInterrupted = 539, @@ -910,9 +912,12 @@ enum Flags { kFlagDR06MannequinHeadOpen = 548, kFlagMcCoyTiedDown = 550, kFlagDR01toCT11 = 558, + kFlagHF03toHF04 = 566, // is never checked + kFlagHF04toHF03 = 567, kFlagKIAPrivacyAddonIntro = 599, kFlagTB07toTB02 = 608, kFlagTB07RachaelTalk = 612, + kFlagHF03LucyTalk = 613, kFlagTB07TyrellMeeting = 625, kFlagCT11DogWrapperTaken = 645, kFlagMA04McCoySleeping = 647, @@ -1096,10 +1101,10 @@ enum Scenes { kSceneHC01 = 31, // Hawker's Circle - Green pawn - Outside kSceneHC02 = 32, // Hawker's Circle - China bar kSceneHC03 = 33, // Hawker's Circle - Green pawn - Inside - kSceneHF01 = 34, // Hysteria Hall - Iutside - kSceneHF02 = 35, - kSceneHF03 = 36, - kSceneHF04 = 37, + kSceneHF01 = 34, // Hysteria Hall - Outside + kSceneHF02 = 35, // Hysteria Hall - Hall of Mirrors - Outside + kSceneHF03 = 36, // Hysteria Hall - Arcade + kSceneHF04 = 37, // Hysteria Hall - Hall of Mirrors - Inside kSceneHF05 = 38, kSceneHF06 = 39, kSceneHF07 = 40, diff --git a/engines/bladerunner/script/init_script.cpp b/engines/bladerunner/script/init_script.cpp index aa3f0070e9..9244c775e2 100644 --- a/engines/bladerunner/script/init_script.cpp +++ b/engines/bladerunner/script/init_script.cpp @@ -79,30 +79,43 @@ void InitScript::Init_Game_Flags() { if (Random_Query(1, 2) == 1) { Game_Flag_Set(kFlagIzoIsReplicant); } + if (Random_Query(1, 2) == 1) { Game_Flag_Set(kFlagGordoIsReplicant); } + if (Random_Query(1, 2) == 1) { Game_Flag_Set(kFlagLucyIsReplicant); } + if (Random_Query(1, 2) == 1) { Game_Flag_Set(kFlagDektoraIsReplicant); } + if (Random_Query(1, 2) == 1) { Game_Flag_Set(kFlagSadikIsReplicant); } + if (Random_Query(1, 2) == 1) { Game_Flag_Set(560); } - if (!Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant) && !Game_Flag_Query(kFlagDektoraIsReplicant)) { + + if (!Game_Flag_Query(kFlagGordoIsReplicant) + && !Game_Flag_Query(kFlagLucyIsReplicant) + && !Game_Flag_Query(kFlagDektoraIsReplicant) + ) { Game_Flag_Set(kFlagDektoraIsReplicant); } if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Global_Variable_Set(40, 1); - } else if (Game_Flag_Query(kFlagGordoIsReplicant) && !Game_Flag_Query(kFlagLucyIsReplicant)) { + } else if ( Game_Flag_Query(kFlagGordoIsReplicant) + && !Game_Flag_Query(kFlagLucyIsReplicant) + ) { Global_Variable_Set(40, 2); - } else if (!Game_Flag_Query(kFlagGordoIsReplicant) && Game_Flag_Query(kFlagLucyIsReplicant)) { + } else if (!Game_Flag_Query(kFlagGordoIsReplicant) + && Game_Flag_Query(kFlagLucyIsReplicant) + ) { Global_Variable_Set(40, 3); } else if (Random_Query(1, 2) == 1) { Global_Variable_Set(40, 2); diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp index c7a179587c..936b11fd2f 100644 --- a/engines/bladerunner/script/scene/hf02.cpp +++ b/engines/bladerunner/script/scene/hf02.cpp @@ -25,18 +25,20 @@ namespace BladeRunner { void SceneScriptHF02::InitializeScene() { - if (Game_Flag_Query(567)) { + if (Game_Flag_Query(kFlagHF04toHF03)) { Setup_Scene_Information(874.0f, 47.76f, -252.0f, 775); - Game_Flag_Reset(567); - } else if (Game_Flag_Query(528)) { + Game_Flag_Reset(kFlagHF04toHF03); + } else if (Game_Flag_Query(kFlagHF03toHF02)) { Setup_Scene_Information(470.0f, 47.76f, -500.0f, 560); } else { Setup_Scene_Information(-18.0f, 47.76f, -288.0f, 275); } - 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, 207, 66, 272, 207, 3); + Ambient_Sounds_Add_Looping_Sound(340, 28, -100, 1); - Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1); + Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1); Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); @@ -84,7 +86,7 @@ bool SceneScriptHF02::ClickedOnItem(int itemId, bool a2) { bool SceneScriptHF02::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagHF02toHF01); @@ -92,11 +94,12 @@ bool SceneScriptHF02::ClickedOnExit(int exitId) { } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(527); + Game_Flag_Set(kFlagHF02toHF03); Set_Enter(kSetHF03, kSceneHF03); } return true; @@ -119,13 +122,15 @@ void SceneScriptHF02::PlayerWalkedIn() { if (Actor_Query_Goal_Number(kActorSteele) == 240) { Actor_Set_Goal_Number(kActorSteele, 241); } - if (Game_Flag_Query(528)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, 0, false, 0); - Game_Flag_Reset(528); + + if (Game_Flag_Query(kFlagHF03toHF02)) { + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 470.0f, 47.76f, -444.0f, 0, false, false, 0); + Game_Flag_Reset(kFlagHF03toHF02); } else if (Game_Flag_Query(kFlagHF01toHF02)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 42.0f, 47.76f, -296.0f, 0, false, false, 0); Game_Flag_Reset(kFlagHF01toHF02); } + if (Actor_Query_Goal_Number(kActorSteele) == 243) { if (Actor_Query_Goal_Number(kActorLucy) == 599) { Actor_Set_Goal_Number(kActorSteele, 244); diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp index c0bdf23183..591861c715 100644 --- a/engines/bladerunner/script/scene/hf03.cpp +++ b/engines/bladerunner/script/scene/hf03.cpp @@ -25,14 +25,16 @@ namespace BladeRunner { void SceneScriptHF03::InitializeScene() { - if (Game_Flag_Query(527)) { - Setup_Scene_Information(479.0f, 47.76f, -496.0f, 600); + if (Game_Flag_Query(kFlagHF02toHF03)) { + Setup_Scene_Information( 479.0f, 47.76f, -496.0f, 600); } else { Setup_Scene_Information(185.62f, 47.76f, -867.42f, 300); } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); + + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); Scene_Exit_Add_2D_Exit(2, 323, 110, 380, 166, 0); + Ambient_Sounds_Add_Looping_Sound(340, 50, 0, 1); Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); @@ -61,18 +63,20 @@ bool SceneScriptHF03::ClickedOn3DObject(const char *objectName, bool a2) { return false; } -void SceneScriptHF03::sub_401C80() { +void SceneScriptHF03::dialogueWithLucy() { Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8); - DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2); - DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1); - DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6); - Dialogue_Menu_Add_DONE_To_List(880); + DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8); // VOIGT-KAMPFF + DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2); // FATHER + DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1); // CRYSTAL + DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6); // RUNCITER + Dialogue_Menu_Add_DONE_To_List(880); // DONE + Dialogue_Menu_Appear(320, 240); int answer = Dialogue_Menu_Query_Input(); Dialogue_Menu_Disappear(); + switch (answer) { - case 840: + case 840: // VOIGT-KAMPFF Actor_Says(kActorMcCoy, 1630, 15); if (Global_Variable_Query(40) == 3) { Actor_Set_Goal_Number(kActorLucy, 214); @@ -83,12 +87,14 @@ void SceneScriptHF03::sub_401C80() { Game_Flag_Set(593); } break; - case 850: + + case 850: // FATHER Actor_Says(kActorMcCoy, 1635, 15); Actor_Says(kActorLucy, 200, 13); Actor_Modify_Friendliness_To_Other(kActorLucy, kActorMcCoy, 3); break; - case 860: + + case 860: // CRYSTAL Actor_Says(kActorMcCoy, 1640, 12); if (Global_Variable_Query(40) == 3) { Actor_Set_Goal_Number(kActorLucy, 214); @@ -129,7 +135,8 @@ void SceneScriptHF03::sub_401C80() { } } break; - case 870: + + case 870: // RUNCITER Actor_Says(kActorMcCoy, 1645, 18); Actor_Says(kActorLucy, 240, 14); Actor_Says(kActorLucy, 250, 12); @@ -144,18 +151,24 @@ void SceneScriptHF03::sub_401C80() { Actor_Says(kActorLucy, 310, 13); Actor_Clue_Acquire(kActorMcCoy, kClueLucyInterview, false, kActorLucy); break; - case 880: + + case 880: // DONE Actor_Says(kActorMcCoy, 1650, 14); break; } } bool SceneScriptHF03::ClickedOnActor(int actorId) { - if (actorId == kActorLucy && Actor_Query_Goal_Number(kActorLucy) == 205) { - if (Game_Flag_Query(kFlagLucyIsReplicant) ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, 1, false)) { + if (actorId == kActorLucy + && Actor_Query_Goal_Number(kActorLucy) == 205 + ) { + if (Game_Flag_Query(kFlagLucyIsReplicant) + ? !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 377, 0, true, false) + : !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 378, 0, true, false) + ) { Actor_Face_Actor(kActorMcCoy, kActorLucy, true); - if (!Game_Flag_Query(613)) { - Game_Flag_Set(613); + if (!Game_Flag_Query(kFlagHF03LucyTalk)) { + Game_Flag_Set(kFlagHF03LucyTalk); if (Game_Flag_Query(kFlagLucyIsReplicant)) { Actor_Says(kActorMcCoy, 1605, 15); Actor_Says(kActorLucy, 100, 12); @@ -178,7 +191,8 @@ bool SceneScriptHF03::ClickedOnActor(int actorId) { Actor_Says(kActorLucy, 190, 15); } } - sub_401C80(); + + dialogueWithLucy(); } } return false; @@ -190,22 +204,24 @@ bool SceneScriptHF03::ClickedOnItem(int itemId, bool a2) { bool SceneScriptHF03::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 46.76f, -824.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 46.76f, -824.0f, 0, true, false, 0)) { Game_Flag_Set(kFlagHF03toHF01); Set_Enter(kSetHF01, kSceneHF01); } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, 1, false, 0)) { - Game_Flag_Set(528); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, true, false, 0)) { + Game_Flag_Set(kFlagHF03toHF02); Set_Enter(kSetHF02, kSceneHF02); } return true; } + if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 942.0f, 47.76f, -847.0f, 0, 1, false, 0)) { - Game_Flag_Set(566); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 942.0f, 47.76f, -847.0f, 0, true, false, 0)) { + Game_Flag_Set(kFlagHF03toHF04); Set_Enter(kSetHF04, kSceneHF04); } return true; @@ -224,13 +240,14 @@ void SceneScriptHF03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptHF03::PlayerWalkedIn() { - if (Game_Flag_Query(527)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, 0, false, 0); - Game_Flag_Reset(527); + if (Game_Flag_Query(kFlagHF02toHF03)) { + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 479.0f, 47.76f, -524.0f, 0, false, false, 0); + Game_Flag_Reset(kFlagHF02toHF03); } else { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 47.76f, -824.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 179.0f, 47.76f, -824.0f, 0, false, false, 0); Game_Flag_Reset(kFlagHF01toHF03); } + if (Actor_Query_Goal_Number(kActorLucy) == 250) { Actor_Set_Goal_Number(kActorLucy, 212); Actor_Says(kActorSteele, 210, 13); diff --git a/engines/bladerunner/script/scene/hf04.cpp b/engines/bladerunner/script/scene/hf04.cpp index c03157fbb4..9dde7ac4f3 100644 --- a/engines/bladerunner/script/scene/hf04.cpp +++ b/engines/bladerunner/script/scene/hf04.cpp @@ -26,16 +26,19 @@ namespace BladeRunner { void SceneScriptHF04::InitializeScene() { Setup_Scene_Information(-33.85f, -0.31f, 395.0f, 0); - Game_Flag_Reset(566); + Game_Flag_Reset(kFlagHF03toHF04); + Scene_Exit_Add_2D_Exit(0, 602, 104, 639, 177, 1); - Ambient_Sounds_Add_Looping_Sound(70, 35, 0, 1); + + Ambient_Sounds_Add_Looping_Sound( 70, 35, 0, 1); Ambient_Sounds_Add_Looping_Sound(109, 40, 0, 1); - Ambient_Sounds_Add_Sound(72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(303, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(304, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(305, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(584)) { Scene_Loop_Set_Default(3); } else { @@ -82,10 +85,10 @@ bool SceneScriptHF04::ClickedOnItem(int itemId, bool a2) { bool SceneScriptHF04::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1132.27f, -0.31f, -113.46f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1132.27f, -0.31f, -113.46f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(567); + Game_Flag_Set(kFlagHF04toHF03); Set_Enter(kSetHF02, kSceneHF02); } return true; @@ -101,12 +104,17 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) { if (frame == 62) { Sound_Play(359, Random_Query(43, 43), 0, 0, 50); } + if (frame == 154) { Sound_Play(360, Random_Query(43, 43), 0, 0, 50); } - if (frame == 179 && Actor_Query_Goal_Number(kActorLucy) == 235) { + + if (frame == 179 + && Actor_Query_Goal_Number(kActorLucy) == 235 + ) { Actor_Set_Goal_Number(kActorLucy, 236); } + if (Game_Flag_Query(585)) { Game_Flag_Reset(585); Scene_Loop_Set_Default(3); @@ -114,13 +122,14 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) { //return true; return; } + if (Game_Flag_Query(586)) { Game_Flag_Reset(586); Scene_Loop_Set_Default(0); Scene_Loop_Start_Special(kSceneLoopModeOnce, 5, true); - //return true; - return; + return; // true; } + if (frame == 89) { Game_Flag_Set(584); Obstacle_Object("HIDE_WALL_A", false); @@ -128,9 +137,9 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) { Unobstacle_Object("PIVOT_WALL#1", false); Unobstacle_Object("PIVOT_WALL#02", false); Unobstacle_Object("PIVOT_WALL#03", true); - //return true; - return; + return; // true; } + if (frame == 180) { Unobstacle_Object("HIDE_WALL_A", false); Unobstacle_Object("HIDE_WALL_B", false); @@ -141,8 +150,7 @@ void SceneScriptHF04::SceneFrameAdvanced(int frame) { if (Actor_Query_Goal_Number(kActorLucy) == 234) { Actor_Set_Goal_Number(kActorLucy, 235); } - //return true; - return; + return; // true; } //return false; } @@ -151,11 +159,13 @@ void SceneScriptHF04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptHF04::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(kActorLucy) == 230 || Actor_Query_Goal_Number(kActorLucy) == 233) { + if (Actor_Query_Goal_Number(kActorLucy) == 230 + || Actor_Query_Goal_Number(kActorLucy) == 233 + ) { Player_Set_Combat_Mode(true); Music_Play(1, 60, 0, 2, -1, 0, 0); } - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -45.0f, -0.31f, 307.0f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -45.0f, -0.31f, 307.0f, 0, false, true, 0); Delay(2500); } diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index f5bd9dcb72..84f709907a 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -206,7 +206,7 @@ DECLARE_SCRIPT(HF02) END_SCRIPT DECLARE_SCRIPT(HF03) - void sub_401C80(); + void dialogueWithLucy(); END_SCRIPT DECLARE_SCRIPT(HF04) -- cgit v1.2.3