diff options
author | Peter Kohaut | 2019-01-26 16:46:33 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-27 11:48:59 +0100 |
commit | 8b849d282f05d5ae3264a7f5bad4cb8f865499a8 (patch) | |
tree | 4d142322cbdf2c558e85e27292edf49d677ebd22 /engines/bladerunner/script | |
parent | 22a71f0b38c7d3226124fb9f97874836c206d1b5 (diff) | |
download | scummvm-rg350-8b849d282f05d5ae3264a7f5bad4cb8f865499a8.tar.gz scummvm-rg350-8b849d282f05d5ae3264a7f5bad4cb8f865499a8.tar.bz2 scummvm-rg350-8b849d282f05d5ae3264a7f5bad4cb8f865499a8.zip |
BLADERUNNER: Cleanup of Gaff script for chapter 1 & 2
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/gaff.cpp | 101 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/zuben.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct05.cpp | 36 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct12.cpp | 38 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ma01.cpp | 52 |
5 files changed, 157 insertions, 76 deletions
diff --git a/engines/bladerunner/script/ai/gaff.cpp b/engines/bladerunner/script/ai/gaff.cpp index 1706062d20..43d9e9beeb 100644 --- a/engines/bladerunner/script/ai/gaff.cpp +++ b/engines/bladerunner/script/ai/gaff.cpp @@ -33,19 +33,25 @@ void AIScriptGaff::Initialize() { _animationStateNext = 0; _animationNext = 0; Actor_Put_In_Set(kActorGaff, kSetFreeSlotC); - Actor_Set_Goal_Number(kActorGaff, 0); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffDefault); //return false; } bool AIScriptGaff::Update() { - if (Global_Variable_Query(kVariableChapter) == 2 && !Game_Flag_Query(471)) { - Actor_Set_Goal_Number(kActorGaff, 100); - Game_Flag_Set(471); + if ( Global_Variable_Query(kVariableChapter) == 2 + && !Game_Flag_Query(kFlagGaffChapter2Started) + ) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffStartWalkingAround); + Game_Flag_Set(kFlagGaffChapter2Started); return true; } - if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorGaff) < 299) { + + if (Global_Variable_Query(kVariableChapter) == 4 + && Actor_Query_Goal_Number(kActorGaff) < 299 + ) { Actor_Set_Goal_Number(kActorGaff, 299); } + return false; } @@ -59,7 +65,7 @@ void AIScriptGaff::TimerExpired(int timer) { } void AIScriptGaff::CompletedMovementTrack() { - if (Actor_Query_Goal_Number(kActorGaff) == 3) { + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffMA01ApproachMcCoy) { Actor_Face_Actor(kActorGaff, kActorMcCoy, true); Actor_Says(kActorGaff, 0, kAnimationModeTalk); Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorGaff, 36, false, true); @@ -92,21 +98,25 @@ void AIScriptGaff::CompletedMovementTrack() { Actor_Clue_Acquire(kActorGaff, kClueMcCoyRetiredZuben, true, -1); Game_Flag_Set(kFlagGaffApproachedMcCoyAboutZuben); Player_Gains_Control(); - Actor_Set_Goal_Number(kActorGaff, 4); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01Leave); } - if (Actor_Query_Goal_Number(kActorGaff) == 2) { - Actor_Set_Goal_Number(kActorGaff, 10); + + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12GoToSpinner) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12FlyAway); } - if (Actor_Query_Goal_Number(kActorGaff) == 100) { - Actor_Set_Goal_Number(kActorGaff, 101); + + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffStartWalkingAround) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffWalkAround); return;// true; } - if (Actor_Query_Goal_Number(kActorGaff) == 101) { - Actor_Set_Goal_Number(kActorGaff, 102); + + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffWalkAround) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffRepeatWalkingAround); return;// true; } - if (Actor_Query_Goal_Number(kActorGaff) == 102) { - Actor_Set_Goal_Number(kActorGaff, 101); + + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffRepeatWalkingAround) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffWalkAround); return;// true; } // return false; @@ -120,7 +130,7 @@ void AIScriptGaff::ClickedByPlayer() { if ((Global_Variable_Query(kVariableChapter) == 2 || Global_Variable_Query(kVariableChapter) == 3 ) - && Game_Flag_Query(471) + && Game_Flag_Query(kFlagGaffChapter2Started) ) { AI_Movement_Track_Pause(kActorGaff); Actor_Face_Actor(kActorMcCoy, kActorGaff, true); @@ -128,7 +138,6 @@ void AIScriptGaff::ClickedByPlayer() { if (Random_Query(1, 3) == 1) { Actor_Says(kActorMcCoy, 3970, 14); Actor_Says(kActorGaff, 100, 13); - AI_Movement_Track_Unpause(kActorGaff); } else if (Random_Query(1, 3) == 2) { Actor_Says(kActorMcCoy, 3970, 14); Actor_Says(kActorGaff, 110, 13); @@ -159,7 +168,8 @@ void AIScriptGaff::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) && combatMode == 1 && Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_In_Set(kActorMcCoy, kSetMA07) - && Actor_Query_Goal_Number(kActorGaff) == 300) { + && Actor_Query_Goal_Number(kActorGaff) == 300 + ) { AI_Countdown_Timer_Reset(kActorGaff, 0); Actor_Set_Goal_Number(kActorGaff, 303); } @@ -184,43 +194,50 @@ int AIScriptGaff::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) { switch (newGoalNumber) { - case 1: + case kGoalGaffCT12WaitForMcCoy: Actor_Put_In_Set(kActorGaff, kSetCT01_CT12); Actor_Set_At_Waypoint(kActorGaff, 43, 0); return true; - case 2: + + case kGoalGaffCT12GoToSpinner: AI_Movement_Track_Append(kActorGaff, 123, 1); AI_Movement_Track_Repeat(kActorGaff); return true; - case 3: + + case kGoalGaffMA01ApproachMcCoy: Player_Loses_Control(); AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 124, 0); AI_Movement_Track_Append(kActorGaff, 126, 0); AI_Movement_Track_Repeat(kActorGaff); return true; - case 4: + + case kGoalGaffMA01Leave: AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 124, 0); AI_Movement_Track_Append(kActorGaff, 35, 0); AI_Movement_Track_Repeat(kActorGaff); return true; - case 5: + + case kGoalGaffCT12Leave: AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 35, 90); AI_Movement_Track_Repeat(kActorGaff); return true; - case 10: + + case kGoalGaffCT12FlyAway: Game_Flag_Reset(kFlagCT12GaffSpinner); Scene_Loop_Set_Default(2); - Scene_Loop_Start_Special(2, 6, true); + Scene_Loop_Start_Special(kSceneLoopModeOnce, 6, true); return true; - case 100: + + case kGoalGaffStartWalkingAround: AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 35, 300); AI_Movement_Track_Repeat(kActorGaff); return true; - case 101: + + case kGoalGaffWalkAround: { AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 82, 1); @@ -244,22 +261,26 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorGaff); } return true; - case 102: + + case kGoalGaffRepeatWalkingAround: AI_Movement_Track_Flush(kActorGaff); AI_Movement_Track_Append(kActorGaff, 35, 90); AI_Movement_Track_Repeat(kActorGaff); return true; + case 299: AI_Movement_Track_Flush(kActorGaff); Actor_Put_In_Set(kActorGaff, kSetFreeSlotC); Actor_Set_At_Waypoint(kActorGaff, 35, 0); return true; + case 300: Player_Loses_Control(); Actor_Put_In_Set(kActorGaff, kSetMA07); Actor_Set_At_XYZ(kActorGaff, -102.54f, -172.43f, 463.18f, 1015); Actor_Set_Goal_Number(kActorGaff, 301); return true; + case 301: Game_Flag_Set(648); Actor_Face_Actor(kActorGaff, kActorMcCoy, true); @@ -287,8 +308,10 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Start_Speech_Sample(kActorGaff, 210); Actor_Set_Goal_Number(kActorGaff, 302); return true; + case 302: return true; + case 303: Actor_Face_Actor(kActorGaff, kActorMcCoy, true); Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatAttack); @@ -296,6 +319,7 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1); return true; + case 499: AI_Movement_Track_Flush(kActorGaff); Actor_Put_In_Set(kActorGaff, kSetKP05_KP06); @@ -314,6 +338,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 1: *animation = 788; _animationFrame++; @@ -321,6 +346,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 2: *animation = 798; _animationFrame++; @@ -328,6 +354,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 3: *animation = 799; _animationFrame++; @@ -337,6 +364,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 798; } break; + case 4: *animation = 800; _animationFrame++; @@ -346,6 +374,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 798; } break; + case 5: *animation = 801; _animationFrame++; @@ -355,6 +384,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 798; } break; + case 6: *animation = 800; _animationFrame++; @@ -364,6 +394,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 798; } break; + case 7: *animation = 801; _animationFrame++; @@ -373,6 +404,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 798; } break; + case 8: *animation = 802; _animationFrame++; @@ -381,9 +413,10 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) { *animation = 794; _animationFrame = 0; Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); // TODO: check this, it was set directly by calling actor script - Actor_Set_Goal_Number(kActorGaff, 5); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12Leave); } break; + default: *animation = 399; break; @@ -398,37 +431,45 @@ bool AIScriptGaff::ChangeAnimationMode(int mode) { _animationState = 0; _animationFrame = 0; break; + case kAnimationModeWalk: if (_animationState != 1) { _animationState = 1; _animationFrame = 0; } break; + case kAnimationModeTalk: _animationState = 2; _animationFrame = 0; break; + case 12: _animationState = 3; _animationFrame = 0; break; + case 13: _animationState = 4; _animationFrame = 0; break; + case 14: _animationState = 5; _animationFrame = 0; break; + case 15: _animationState = 6; _animationFrame = 0; break; + case 16: _animationState = 7; _animationFrame = 0; break; - case 41: + + case kAnimationModeSpinnerGetIn: _animationState = 8; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp index af1d64cfd8..6155a27e3b 100644 --- a/engines/bladerunner/script/ai/zuben.cpp +++ b/engines/bladerunner/script/ai/zuben.cpp @@ -178,7 +178,7 @@ void AIScriptZuben::CompletedMovementTrack() { Game_Flag_Set(kFlagZubenSpared); Game_Flag_Set(kFlagCT01ZubenGone); Actor_Set_Goal_Number(kActorZuben, kGoalZubenSpared); - Actor_Set_Goal_Number(kActorGaff, 1); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12WaitForMcCoy); Set_Enter(kSetCT06, kSceneCT06); } if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenMA01AttackMcCoy) { @@ -366,11 +366,11 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) { Game_Flag_Set(kFlagCT01ZubenGone); if (Actor_Query_In_Set(kActorZuben, kSetCT07)) { Game_Flag_Set(kFlagCT07toCT06); - Actor_Set_Goal_Number(kActorGaff, 1); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12WaitForMcCoy); Set_Enter(kSetCT06, kSceneCT06); } else if (Actor_Query_In_Set(kActorZuben, kSetMA01)) { Player_Set_Combat_Mode(false); - Actor_Set_Goal_Number(kActorGaff, 3); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01ApproachMcCoy); } Actor_Set_Goal_Number(kActorZuben, kGoalZubenDead); return false; diff --git a/engines/bladerunner/script/scene/ct05.cpp b/engines/bladerunner/script/scene/ct05.cpp index a398d45559..2c5c908e39 100644 --- a/engines/bladerunner/script/scene/ct05.cpp +++ b/engines/bladerunner/script/scene/ct05.cpp @@ -25,32 +25,35 @@ namespace BladeRunner { void SceneScriptCT05::InitializeScene() { - if (Game_Flag_Query(90)) { - Game_Flag_Reset(90); + if (Game_Flag_Query(kFlagCT12toCT05)) { + Game_Flag_Reset(kFlagCT12toCT05); Setup_Scene_Information(-128.42f, -109.91f, 112.83f, 516); } else if (Game_Flag_Query(kFlagCT06toCT05)) { - Setup_Scene_Information(192.35f, 43.09f, 128.97f, 768); + Setup_Scene_Information( 192.35f, 43.09f, 128.97f, 768); } else { - Setup_Scene_Information(-375.0f, -109.91f, 750.0f, 600); + Setup_Scene_Information( -375.0f, -109.91f, 750.0f, 600); } + if (Game_Flag_Query(kFlagCT05WarehouseOpen)) { Scene_Exit_Add_2D_Exit(0, 228, 205, 293, 300, 0); } Scene_Exit_Add_2D_Exit(1, 320, 458, 639, 479, 2); Scene_Exit_Add_2D_Exit(2, 380, 110, 542, 300, 0); + Ambient_Sounds_Add_Looping_Sound(106, 15, -100, 1); Ambient_Sounds_Add_Looping_Sound(107, 15, 100, 1); Ambient_Sounds_Add_Looping_Sound( 56, 13, -100, 1); - Ambient_Sounds_Add_Sound( 90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound( 91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(205, 5, 30, 18, 30, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(kFlagCT05WarehouseOpen)) { Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(0); } - if (Actor_Query_Goal_Number(kActorGaff) == 1) { - Overlay_Play("ct05over", 0, 1, 0, 0); + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) { + Overlay_Play("ct05over", 0, true, false, 0); } } @@ -139,25 +142,27 @@ bool SceneScriptCT05::ClickedOnExit(int exitId) { if (exitId == 0) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -128.42f, -109.91f, 112.83f, 0, true, false, 0)) { Game_Flag_Set(kFlagCT05toCT12); - if (Actor_Query_Goal_Number(kActorGaff) == 1) { + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) { Overlay_Remove("ct05over"); } Set_Enter(kSetCT01_CT12, kSceneCT12); } return true; } + if (exitId == 1) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -308.18f, -109.91f, 674.77f, 0, true, false, 0)) { Game_Flag_Set(kFlagCT05toCT04); - if (Actor_Query_Goal_Number(kActorGaff) == 1) { + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) { Overlay_Remove("ct05over"); - Actor_Set_Goal_Number(kActorGaff, 5); - Game_Flag_Set(409); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12Leave); + Game_Flag_Set(kFlagMA01GaffApproachMcCoy); } Set_Enter(kSetCT03_CT04, kSceneCT04); } return true; } + if (exitId == 2) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 71.99f, -109.91f, 288.79f, 0, true, false, 0)) { Footstep_Sound_Override_On(2); @@ -167,7 +172,7 @@ bool SceneScriptCT05::ClickedOnExit(int exitId) { Loop_Actor_Travel_Stairs(kActorMcCoy, 5, true, kAnimationModeIdle); Footstep_Sound_Override_Off(); Game_Flag_Set(kFlagCT05toCT06); - if (Actor_Query_Goal_Number(kActorGaff) == 1) { + if (Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy) { Overlay_Remove("ct05over"); } Set_Enter(kSetCT06, kSceneCT06); @@ -182,7 +187,10 @@ bool SceneScriptCT05::ClickedOn2DRegion(int region) { } void SceneScriptCT05::SceneFrameAdvanced(int frame) { - if (frame == 7 || frame == 15 || frame == 29) { + if (frame == 7 + || frame == 15 + || frame == 29 + ) { switch (Random_Query(0, 4)) { case 4: Sound_Play(40, Random_Query(25, 50), -70, -70, 50); diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp index c90473d3d0..5bd35d83c3 100644 --- a/engines/bladerunner/script/scene/ct12.cpp +++ b/engines/bladerunner/script/scene/ct12.cpp @@ -38,41 +38,45 @@ void SceneScriptCT12::InitializeScene() { } else { Setup_Scene_Information(-386.13f, -6.5f, 1132.72f, 783); } - Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3); - Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0); + + Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3); + Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0); Scene_Exit_Add_2D_Exit(2, 500, 180, 619, 346, 0); if (Global_Variable_Query(kVariableChapter) > 2) { - Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1); } if (Global_Variable_Query(kVariableChapter) > 3) { Scene_Exit_Add_2D_Exit(4, 324, 150, 435, 340, 0); } - Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1); + + Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1); Ambient_Sounds_Add_Looping_Sound(55, 20, -100, 1); Ambient_Sounds_Add_Looping_Sound(56, 20, -100, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Global_Variable_Query(kVariableChapter) < 2 - && Actor_Query_Goal_Number(kActorGaff) == 1 + && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy ) { Actor_Put_In_Set(kActorGaff, kSetCT01_CT12); Actor_Set_At_XYZ(kActorGaff, -534.0f, -6.5f, 952.0f, 367); Game_Flag_Set(kFlagCT12GaffSpinner); } + if (Game_Flag_Query(kFlagCT01toCT12) && Game_Flag_Query(kFlagSpinnerAtCT01) ) { if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3 ) { - Scene_Loop_Start_Special(0, 1, 0); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 1, false); } Scene_Loop_Set_Default(2); Game_Flag_Reset(kFlagCT01toCT12); @@ -82,7 +86,7 @@ void SceneScriptCT12::InitializeScene() { if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3 ) { - Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false); } Scene_Loop_Set_Default(2); Game_Flag_Reset(kFlagCT01toCT12); @@ -163,6 +167,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) { } return true; } + if (exitId == 1) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -182.69f, -6.5f, 696.94f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); @@ -172,6 +177,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) { } return true; } + if (exitId == 2) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -386.13f, -6.5f, 1132.72f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); @@ -181,6 +187,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) { } return true; } + if (exitId == 3) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -493.0f, -6.5f, 1174.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); @@ -190,6 +197,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) { } return true; } + if (exitId == 4) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -292.0f, -6.5f, 990.0f, 0, true, false, 0)) { if (Global_Variable_Query(kVariableChapter) == 4) { @@ -213,18 +221,23 @@ void SceneScriptCT12::SceneFrameAdvanced(int frame) { if (((frame - 1) % 10) == 0) { Sound_Play(Random_Query(59, 60), 10, -80, -80, 50); } + if (frame == 160) { Actor_Change_Animation_Mode(kActorGaff, 41); } + if (frame == 152) { Sound_Play(116, 100, 40, 0, 50); } + if (frame == 203) { Sound_Play(119, 100, 40, 0, 50); } + if (frame == 212) { Sound_Play(117, 40, 0, 0, 50); } + if (frame == 269) { Player_Gains_Control(); Player_Set_Combat_Mode(false); @@ -238,7 +251,7 @@ void SceneScriptCT12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptCT12::PlayerWalkedIn() { if ( Global_Variable_Query(kVariableChapter) < 2 && !Game_Flag_Query(kFlagGaffApproachedMcCoyAboutZuben) - && Actor_Query_Goal_Number(kActorGaff) == 1 + && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffCT12WaitForMcCoy ) { Player_Loses_Control(); Loop_Actor_Walk_To_Actor(kActorGaff, kActorMcCoy, 48, false, false); @@ -277,8 +290,9 @@ void SceneScriptCT12::PlayerWalkedIn() { Actor_Clue_Acquire(kActorGaff, kClueMcCoyLetZubenEscape, true, -1); } - Actor_Set_Goal_Number(kActorGaff, 2); + Actor_Set_Goal_Number(kActorGaff, kGoalGaffCT12GoToSpinner); } + if (Game_Flag_Query(kFlagCT11toCT12)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -520.0f, -6.5f, 1103.0f, 0, false, false, 0); Game_Flag_Reset(kFlagCT11toCT12); diff --git a/engines/bladerunner/script/scene/ma01.cpp b/engines/bladerunner/script/scene/ma01.cpp index 566edeb0c2..4d0ac5523e 100644 --- a/engines/bladerunner/script/scene/ma01.cpp +++ b/engines/bladerunner/script/scene/ma01.cpp @@ -39,23 +39,26 @@ enum kMA01Exits { void SceneScriptMA01::InitializeScene() { Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); if (Game_Flag_Query(kFlagSpinnerAtMA01)) { - Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); + Setup_Scene_Information( 381.0f, 0.0f, 54.0f, 992); } if (Game_Flag_Query(kFlagMA06toMA01)) { Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660); } + Scene_Exit_Add_2D_Exit(kMA01ExitMA06, 328, 132, 426, 190, 0); if (Game_Flag_Query(kFlagSpinnerAtMA01)) { Scene_Exit_Add_2D_Exit(kMA01ExitSpinner, 234, 240, 398, 328, 2); } - Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); - Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); - Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); - Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + + Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); + Ambient_Sounds_Add_Looping_Sound( 99, 40, -100, 1); + Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); + Ambient_Sounds_Add_Sound( 68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound( 69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(kFlagMA06toMA01)) { Scene_Loop_Set_Default(kMA01LoopMain); Game_Flag_Reset(kFlagMA06toMA01); @@ -65,9 +68,10 @@ void SceneScriptMA01::InitializeScene() { Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA01LoopInshotRoof, false); Scene_Loop_Set_Default(kMA01LoopMain); } - if (Game_Flag_Query(409)) { - Actor_Set_Goal_Number(kActorGaff, 3); - Game_Flag_Reset(409); + + if (Game_Flag_Query(kFlagMA01GaffApproachMcCoy)) { + Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA01ApproachMcCoy); + Game_Flag_Reset(kFlagMA01GaffApproachMcCoy); } } @@ -100,13 +104,14 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) { if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenMA01AttackMcCoy) { return true; } + if (exitId == kMA01ExitMA06) { if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenFled) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 72, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 72, true, false, 0)) { Actor_Set_Goal_Number(kActorZuben, kGoalZubenMA01AttackMcCoy); Scene_Exits_Disable(); } - } else if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 12, 1, false, 0)) { + } else if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 12, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagMA01toMA06); @@ -114,8 +119,9 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) { } return true; } + if (exitId == kMA01ExitSpinner) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 381.0f, 0.0f, 54.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 381.0f, 0.0f, 54.0f, 0, true, false, 0)) { Player_Loses_Control(); Actor_Face_Heading(kActorMcCoy, 736, false); Game_Flag_Reset(kFlagMcCoyInChinaTown); @@ -211,34 +217,44 @@ void SceneScriptMA01::SceneFrameAdvanced(int frame) { if (frame == 15) { Ambient_Sounds_Play_Sound(102, 70, -100, 100, 0); } - if (frame == 61 || frame == 183) { + + if (frame == 61 + || frame == 183 + ) { Ambient_Sounds_Play_Sound(116, 100, 40, 0, 99); } - if (frame == 107 || frame == 227) { + + if (frame == 107 + || frame == 227 + ) { Ambient_Sounds_Play_Sound(119, 100, 40, 0, 99); } + if (frame == 1) { Ambient_Sounds_Play_Sound(118, 40, -60, 20, 99); } + if (frame == 241) { Ambient_Sounds_Play_Sound(117, 40, 0, 0, 99); } + if (frame == 58) { Sound_Play(122, 17, 20, 20, 50); } + if ((frame == 75 || frame == 196 ) && Game_Flag_Query(kFlagArrivedFromSpinner2) ) { Actor_Face_Heading(kActorMcCoy, 736, false); - Actor_Change_Animation_Mode(kActorMcCoy, 42); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut); Game_Flag_Reset(kFlagArrivedFromSpinner2); } else { if ( frame == 196 && !Game_Flag_Query(kFlagArrivedFromSpinner2) ) { - Actor_Change_Animation_Mode(kActorMcCoy, 41); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetIn); //return true; return; } @@ -259,7 +275,9 @@ void SceneScriptMA01::PlayerWalkedOut() { Actor_Set_Invisible(kActorMcCoy, false); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(kFlagMA01toMA06) && Global_Variable_Query(kVariableChapter) == 1) { + if (!Game_Flag_Query(kFlagMA01toMA06) + && Global_Variable_Query(kVariableChapter) == 1 + ) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Outtake_Play(kOuttakeTowards2, true, -1); |