diff options
Diffstat (limited to 'engines/bladerunner/script/scene/nr08.cpp')
-rw-r--r-- | engines/bladerunner/script/scene/nr08.cpp | 92 |
1 files changed, 55 insertions, 37 deletions
diff --git a/engines/bladerunner/script/scene/nr08.cpp b/engines/bladerunner/script/scene/nr08.cpp index 47d863b299..dd4c0e9f13 100644 --- a/engines/bladerunner/script/scene/nr08.cpp +++ b/engines/bladerunner/script/scene/nr08.cpp @@ -34,25 +34,27 @@ void SceneScriptNR08::InitializeScene() { if (Actor_Query_Goal_Number(kActorDektora) == 210) { Music_Stop(1); } - } else if (Game_Flag_Query(439)) { - Setup_Scene_Information(-724.7f, 0.0f, 384.24f, 1000); - Game_Flag_Reset(439); - } else if (Game_Flag_Query(615)) { - Setup_Scene_Information(-1663.33f, 0.65f, 342.84f, 330); - Game_Flag_Reset(615); + } else if (Game_Flag_Query(kFlagNR06toNR08)) { + Setup_Scene_Information( -724.7f, 0.0f, 384.24f, 1000); + Game_Flag_Reset(kFlagNR06toNR08); + } else if (Game_Flag_Query(kFlagNR09toNR08)) { + Setup_Scene_Information(-1663.33f, 0.65f, 342.84f, 330); + Game_Flag_Reset(kFlagNR09toNR08); } + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); if (Actor_Query_Goal_Number(kActorDektora) != 210) { - Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); + Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); } + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(259, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(260, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(261, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); @@ -66,6 +68,7 @@ void SceneScriptNR08::InitializeScene() { Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(1); } @@ -95,28 +98,30 @@ bool SceneScriptNR08::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR08::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1102.88f, 0.0f, 107.43f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1102.88f, 0.0f, 107.43f, 0, true, false, 0)) { Game_Flag_Set(kFlagNR08toNR05); Set_Enter(kSetNR05_NR08, kSceneNR05); } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -724.7f, 0.0f, 384.24f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -724.7f, 0.0f, 384.24f, 0, true, false, 0)) { Actor_Face_Heading(kActorMcCoy, 505, false); Loop_Actor_Travel_Stairs(kActorMcCoy, 4, 1, kAnimationModeIdle); - Game_Flag_Set(440); + Game_Flag_Set(kFlagNR08toNR06); Set_Enter(kSetNR06, kSceneNR06); } return true; } + if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1663.33f, 0.65f, 342.84f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1663.33f, 0.65f, 342.84f, 0, true, false, 0)) { Actor_Face_Heading(kActorMcCoy, 831, false); Footstep_Sound_Override_On(2); Loop_Actor_Travel_Stairs(kActorMcCoy, 6, 1, kAnimationModeIdle); Footstep_Sound_Override_Off(); - Game_Flag_Set(614); + Game_Flag_Set(kFlagNR08toNR09); Set_Enter(kSetNR09, kSceneNR09); } } @@ -129,37 +134,48 @@ bool SceneScriptNR08::ClickedOn2DRegion(int region) { void SceneScriptNR08::SceneFrameAdvanced(int frame) { if (!Music_Is_Playing()) { - sub_4021B4(); + playNextMusic(); } + Set_Fade_Color(0, 0, 0); - if (frame >= 76 && frame < 91) { + + if (frame >= 76 + && frame < 91 + ) { Set_Fade_Density((frame - 76) / 14.0f); Music_Stop(3); Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); - } else if (frame >= 91 && frame < 120) { + } else if (frame >= 91 + && frame < 120 + ) { Actor_Set_Invisible(kActorMcCoy, true); Set_Fade_Density(1.0f); - } else if (frame >= 120 && frame < 135) { + } else if (frame >= 120 + && frame < 135 + ) { Set_Fade_Density((134 - frame) / 14.0f); Music_Play(7, 61, 0, 1, -1, 0, 0); } else { Actor_Set_Invisible(kActorMcCoy, false); Set_Fade_Density(0.0f); } + if (Game_Flag_Query(651) && !Game_Flag_Query(636)) { Game_Flag_Set(636); Scene_Exits_Disable(); Scene_Loop_Set_Default(1); Scene_Loop_Start_Special(kSceneLoopModeOnce, 3, true); } + if (frame == 95) { Actor_Put_In_Set(kActorDektora, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorDektora, 33, 0); - Actor_Change_Animation_Mode(kActorDektora, 0); + Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle); Actor_Set_Goal_Number(kActorDektora, 200); - Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); + Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); } + if (frame == 130) { Scene_Exits_Enable(); } @@ -170,12 +186,14 @@ void SceneScriptNR08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptNR08::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(kActorDektora) != 210 || Game_Flag_Query(729)) { - Music_Adjust(51, 0, 2); - } else { - Game_Flag_Set(729); + if (Actor_Query_Goal_Number(kActorDektora) == 210 + && !Game_Flag_Query(kFlagNR08DektoraShow) + ) { + Game_Flag_Set(kFlagNR08DektoraShow); Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); Outtake_Play(kOuttakeDektora, true, -1); + } else { + Music_Adjust(51, 0, 2); } if (Actor_Query_Goal_Number(kActorDektora) == 245) { @@ -217,25 +235,25 @@ void SceneScriptNR08::PlayerWalkedOut() { void SceneScriptNR08::DialogueQueueFlushed(int a1) { } -void SceneScriptNR08::sub_4021B4() { +void SceneScriptNR08::playNextMusic() { if (Music_Is_Playing()) { Music_Adjust(51, 0, 2); } else if (Actor_Query_Goal_Number(kActorDektora) == 210) { Music_Play(6, 61, 0, 1, -1, 0, 0); } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { + int track = Global_Variable_Query(kVariableEarlyQBackMusic); + if (track == 0) { Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { + } else if (track == 1) { Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { + } else if (track == 2) { Music_Play(7, 41, -80, 2, -1, 0, 0); } - v0++; - if (v0 > 2) { - v0 = 0; + track++; + if (track > 2) { + track = 0; } - Global_Variable_Set(54, v0); + Global_Variable_Set(kVariableEarlyQBackMusic, track); } } |