diff options
author | Peter Kohaut | 2019-01-29 20:34:10 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-29 23:36:29 +0100 |
commit | 2c3af4b8e967386dd1e27641b82c0bec03d75bc8 (patch) | |
tree | f8772843593d099047b0c008cf65c3b78b4a8151 /engines/bladerunner/script/scene/nr05.cpp | |
parent | 4ba4902c3d559bacaa0177fceea936ac41f0df60 (diff) | |
download | scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.tar.gz scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.tar.bz2 scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.zip |
BLADERUNNER: Cleanup of front EarlyQ's scenes scripts
Diffstat (limited to 'engines/bladerunner/script/scene/nr05.cpp')
-rw-r--r-- | engines/bladerunner/script/scene/nr05.cpp | 218 |
1 files changed, 127 insertions, 91 deletions
diff --git a/engines/bladerunner/script/scene/nr05.cpp b/engines/bladerunner/script/scene/nr05.cpp index 96b881b729..e681b5146e 100644 --- a/engines/bladerunner/script/scene/nr05.cpp +++ b/engines/bladerunner/script/scene/nr05.cpp @@ -24,27 +24,36 @@ namespace BladeRunner { +enum kNR05Loops { + kNR05LoopPanFromNR08 = 0, + kNR05LoopMainLoop = 1, + kNR05LoopTableSwivel = 3 +}; + + void SceneScriptNR05::InitializeScene() { - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); - } else if (Game_Flag_Query(536)) { - Setup_Scene_Information(-456.0f, 0.0f, -611.0f, 0); + if (Game_Flag_Query(kFlagNR08toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopPanFromNR08, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); + } else if (Game_Flag_Query(kFlagNR03toNR05)) { + Setup_Scene_Information( -456.0f, 0.0f, -611.0f, 0); } else { - Setup_Scene_Information(-527.0f, 1.57f, -406.0f, 649); + Setup_Scene_Information( -527.0f, 1.57f, -406.0f, 649); } + Scene_Exit_Add_2D_Exit(0, 459, 147, 639, 290, 1); if (Game_Flag_Query(620)) { Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); } + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); @@ -62,15 +71,16 @@ void SceneScriptNR05::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); - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(536)) { - Scene_Loop_Start_Special(0, 3, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(536); + + if (Game_Flag_Query(kFlagNR08toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopPanFromNR08, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + } else if (Game_Flag_Query(kFlagNR03toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopTableSwivel, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + Game_Flag_Reset(kFlagNR03toNR05); } else { - Scene_Loop_Set_Default(1); + Scene_Loop_Set_Default(kNR05LoopMainLoop); } } @@ -90,19 +100,21 @@ bool SceneScriptNR05::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptNR05::ClickedOnActor(int actorId) { if (actorId == kActorEarlyQBartender) { - if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQBartender, 120, 1, false)) { - sub_4020B4(); + if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQBartender, 120, true, false)) { + talkToBartender(); } return true; } + if (actorId == kActorEarlyQ) { Actor_Set_Goal_Number(kActorEarlyQ, 229); - if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQ, 36, 1, false)) { - sub_4022DC(); + if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQ, 36, true, false)) { + talkToEarlyQ(); } Actor_Set_Goal_Number(kActorEarlyQ, 221); return true; } + return false; } @@ -112,21 +124,22 @@ bool SceneScriptNR05::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR05::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -444.0f, 0.0f, -451.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -444.0f, 0.0f, -451.0f, 0, true, false, 0)) { Player_Loses_Control(); Music_Stop(2); Player_Set_Combat_Mode(false); Actor_Face_Heading(kActorMcCoy, 1021, false); - Actor_Change_Animation_Mode(kActorMcCoy, 53); - Game_Flag_Set(537); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSit); + Game_Flag_Set(kFlagNR05toNR03); Set_Enter(kSetNR03, kSceneNR03); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, 0); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR05LoopTableSwivel, false); } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -777.56f, 0.0f, -166.86f, 0, 1, false, 0)) { - Game_Flag_Set(546); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -777.56f, 0.0f, -166.86f, 0, true, false, 0)) { + Game_Flag_Set(kFlagNR05toNR08); Set_Enter(kSetNR05_NR08, kSceneNR08); } return true; @@ -140,49 +153,55 @@ bool SceneScriptNR05::ClickedOn2DRegion(int region) { void SceneScriptNR05::SceneFrameAdvanced(int frame) { if (!Music_Is_Playing()) { - sub_402B9C(); + playNextMusic(); } + if (frame == 78) { Sound_Play(345, 83, 70, 70, 50); } + if (frame == 86) { Sound_Play(353, 62, 70, 70, 50); } + rotateActorOnGround(kActorHysteriaPatron2); rotateActorOnGround(kActorMcCoy); + if (Actor_Query_Goal_Number(kActorEarlyQ) == 224) { Actor_Set_Goal_Number(kActorEarlyQ, 225); - if (Player_Query_Current_Scene() == 58) { + if (Player_Query_Current_Scene() == kSceneNR05) { Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); } } - if (frame > 77 && frame <= 134) { + + if (frame > 77 + && frame <= 134 + ) { rotateActorOnTable(frame - 13); - if (frame == 134 && !Game_Flag_Query(537)) { + if ( frame == 134 + && !Game_Flag_Query(kFlagNR05toNR03) + ) { Actor_Set_Goal_Number(kActorMcCoy, 200); } //return true; - return; - } else { - //return false; - return; } + //return false; } void SceneScriptNR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { } void SceneScriptNR05::PlayerWalkedIn() { - if (Game_Flag_Query(547)) { + if (Game_Flag_Query(kFlagNR08toNR05)) { Music_Stop(2); - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -697.56f, 0.0f, -174.86f, 0, 1, false, 0); - Game_Flag_Reset(547); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -697.56f, 0.0f, -174.86f, 0, true, false, 0); + Game_Flag_Reset(kFlagNR08toNR05); } // return false; } void SceneScriptNR05::PlayerWalkedOut() { - if (Game_Flag_Query(537)) { + if (Game_Flag_Query(kFlagNR05toNR03)) { Music_Stop(2); } Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); @@ -195,7 +214,7 @@ void SceneScriptNR05::DialogueQueueFlushed(int a1) { void SceneScriptNR05::rotateActorOnTable(int frame) { float angle = cos((frame - 65) * (M_PI / 57.0f)) * M_PI_2; float invertedAngle = M_PI - angle; - if (!Game_Flag_Query(537)) { + if (!Game_Flag_Query(kFlagNR05toNR03)) { angle = angle + M_PI; invertedAngle = invertedAngle + M_PI; } @@ -215,75 +234,82 @@ void SceneScriptNR05::rotateActorOnTable(int frame) { Actor_Set_At_XYZ(kActorMcCoy, x, 0.0f, z, facing); } -void SceneScriptNR05::sub_4020B4() { +void SceneScriptNR05::talkToBartender() { Actor_Face_Actor(kActorMcCoy, kActorEarlyQBartender, true); Actor_Face_Actor(kActorEarlyQBartender, kActorMcCoy, true); - if (Game_Flag_Query(588)) { - if (Game_Flag_Query(589)) { - Actor_Says(kActorMcCoy, 3480, 19); - Actor_Says(kActorEarlyQBartender, 30, 12); - Actor_Says(kActorMcCoy, 3485, 3); - Actor_Says(kActorEarlyQBartender, 40, 13); - Actor_Change_Animation_Mode(kActorEarlyQBartender, 23); - Actor_Change_Animation_Mode(kActorMcCoy, 75); - Global_Variable_Increment(kVariableMcCoyDrinks, 1); - } else { - Actor_Says(kActorMcCoy, 3475, 17); - Actor_Says(kActorEarlyQBartender, 20, 23); - Game_Flag_Set(589); - Actor_Change_Animation_Mode(kActorMcCoy, 75); - Global_Variable_Increment(kVariableMcCoyDrinks, 1); - } - } else { + if (!Game_Flag_Query(kFlagNR05BartenderTalk1)) { Actor_Says(kActorEarlyQBartender, 0, 13); - Actor_Says(kActorMcCoy, 3470, 3); + Actor_Says(kActorMcCoy, 3470, kAnimationModeTalk); Actor_Says(kActorEarlyQBartender, 10, 23); - Game_Flag_Set(588); + Game_Flag_Set(kFlagNR05BartenderTalk1); + Actor_Change_Animation_Mode(kActorMcCoy, 75); + Global_Variable_Increment(kVariableMcCoyDrinks, 1); + } else if (!Game_Flag_Query(kFlagNR05BartenderTalk2)) { + Actor_Says(kActorMcCoy, 3475, 17); + Actor_Says(kActorEarlyQBartender, 20, 23); + Game_Flag_Set(kFlagNR05BartenderTalk2); + Actor_Change_Animation_Mode(kActorMcCoy, 75); + Global_Variable_Increment(kVariableMcCoyDrinks, 1); + } else { + Actor_Says(kActorMcCoy, 3480, 19); + Actor_Says(kActorEarlyQBartender, 30, 12); + Actor_Says(kActorMcCoy, 3485, kAnimationModeTalk); + Actor_Says(kActorEarlyQBartender, 40, 13); + Actor_Change_Animation_Mode(kActorEarlyQBartender, 23); Actor_Change_Animation_Mode(kActorMcCoy, 75); Global_Variable_Increment(kVariableMcCoyDrinks, 1); } } -void SceneScriptNR05::sub_4022DC() { +void SceneScriptNR05::talkToEarlyQ() { if (Actor_Query_Goal_Number(kActorEarlyQ) == 220) { Actor_Set_Goal_Number(kActorEarlyQ, 221); } Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, true); Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, true); - if (!Game_Flag_Query(590)) { - Actor_Says(kActorMcCoy, 8513, 3); - Actor_Says(kActorEarlyQ, 360, 3); + + if (!Game_Flag_Query(kFlagNR05EarlyQTalk)) { + Actor_Says(kActorMcCoy, 8513, kAnimationModeTalk); + Actor_Says(kActorEarlyQ, 360, kAnimationModeTalk); Actor_Says(kActorMcCoy, 3495, 11); Actor_Says(kActorEarlyQ, 370, 15); Actor_Says(kActorMcCoy, 3500, 17); Actor_Says(kActorEarlyQ, 380, 13); - Game_Flag_Set(590); + Game_Flag_Set(kFlagNR05EarlyQTalk); return; } + Dialogue_Menu_Clear_List(); if (Actor_Query_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy) >= 48) { - if (Actor_Clue_Query(kActorMcCoy, kClueDragonflyCollection) || Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt)) { - DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); + if (Actor_Clue_Query(kActorMcCoy, kClueDragonflyCollection) + || Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt) + ) { + DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); // JEWELRY } if (Actor_Clue_Query(kActorMcCoy, kClueLucy)) { - DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); // LUCY } if (Actor_Clue_Query(kActorMcCoy, kClueDektorasDressingRoom)) { - DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); // BLOND WOMAN } } + if (!Dialogue_Menu_Query_List_Size()) { - Actor_Says(kActorMcCoy, 3520, 3); - Actor_Says(kActorEarlyQ, 730, 3); + Actor_Says(kActorMcCoy, 3520, kAnimationModeTalk); + Actor_Says(kActorEarlyQ, 730, kAnimationModeTalk); Actor_Face_Heading(kActorEarlyQ, 849, false); return; } - Dialogue_Menu_Add_DONE_To_List(100); + + Dialogue_Menu_Add_DONE_To_List(100); // DONE + Dialogue_Menu_Appear(320, 240); int answer = Dialogue_Menu_Query_Input(); Dialogue_Menu_Disappear(); - if (answer == 890) { - Actor_Says(kActorMcCoy, 3505, 3); + + switch(answer){ + case 890: // JEWELRY + Actor_Says(kActorMcCoy, 3505, kAnimationModeTalk); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); Actor_Says(kActorEarlyQ, 420, 12); Actor_Says(kActorEarlyQ, 430, 13); @@ -297,17 +323,21 @@ void SceneScriptNR05::sub_4022DC() { Actor_Says(kActorMcCoy, 3545, 15); Actor_Says(kActorEarlyQ, 520, 12); Actor_Face_Heading(kActorEarlyQ, 849, false); - } else if (answer == 900) { + break; + + case 900: // LUCY Actor_Says(kActorMcCoy, 3510, 15); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); - Actor_Says_With_Pause(kActorEarlyQ, 530, 1.2f, 3); + Actor_Says_With_Pause(kActorEarlyQ, 530, 1.2f, kAnimationModeTalk); Actor_Says(kActorEarlyQ, 540, 15); Actor_Says(kActorMcCoy, 3550, 13); Actor_Says(kActorEarlyQ, 560, 14); Actor_Says(kActorEarlyQ, 570, 13); Actor_Says(kActorMcCoy, 3555, 12); Actor_Face_Heading(kActorEarlyQ, 849, false); - } else if (answer == 910) { + break; + + case 910: // BLOND WOMAN Actor_Says(kActorMcCoy, 3515, 14); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote)) { @@ -325,14 +355,20 @@ void SceneScriptNR05::sub_4022DC() { Actor_Says(kActorEarlyQ, 660, 12); } Actor_Face_Heading(kActorEarlyQ, 849, false); + break; } } void SceneScriptNR05::rotateActorOnGround(int actorId) { int animationMode = Actor_Query_Animation_Mode(actorId); - if (animationMode == kAnimationModeWalk || animationMode == kAnimationModeRun || animationMode == kAnimationModeCombatWalk || animationMode == kAnimationModeCombatRun) { + if (animationMode == kAnimationModeWalk + || animationMode == kAnimationModeRun + || animationMode == kAnimationModeCombatWalk + || animationMode == kAnimationModeCombatRun + ) { return; } + float x, y, z; Actor_Query_XYZ(actorId, &x, &y, &z); x -= -542.0f; @@ -347,23 +383,23 @@ void SceneScriptNR05::rotateActorOnGround(int actorId) { } } -void SceneScriptNR05::sub_402B9C() { +void SceneScriptNR05::playNextMusic() { if (Music_Is_Playing()) { Music_Adjust(51, 0, 2); } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { + int track = Global_Variable_Query(kVariableNR05Music); + 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(kVariableNR05Music, track); } } |