diff options
author | Peter Kohaut | 2019-01-25 23:06:34 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-25 23:18:20 +0100 |
commit | cd37d510f93a7e9ba35a442d2a3d15de9f4846da (patch) | |
tree | 9f3a6b5c6cc4e02ce0c1fbd4df876eb724e82db7 | |
parent | 474e4e2f0914a106e02dac2779d58f990e119bf9 (diff) | |
download | scummvm-rg350-cd37d510f93a7e9ba35a442d2a3d15de9f4846da.tar.gz scummvm-rg350-cd37d510f93a7e9ba35a442d2a3d15de9f4846da.tar.bz2 scummvm-rg350-cd37d510f93a7e9ba35a442d2a3d15de9f4846da.zip |
BLADERUNNER: Cleanup of actor scripts for a fight in BB11
Also named goal for McCoy arrest
-rw-r--r-- | engines/bladerunner/game_constants.h | 28 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/clovis.cpp | 80 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/dektora.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/gordo.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 112 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/officer_grayford.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/sadik.cpp | 88 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/tyrell_guard.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/bb11.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr11.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps14.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/tb03.cpp | 2 |
13 files changed, 232 insertions, 106 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index 12d4eaa69f..4512a22375 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -811,6 +811,7 @@ enum Flags { kFlagNotUsed370 = 370, // is never checked kFlagAR02DektoraBoughtScorpions = 374, + kFlagBB11SadikPunchedMcCoy = 375, kFlagDirectorsCut = 378, kFlagCT08toCT51 = 379, // is never checked @@ -1460,7 +1461,12 @@ enum AffectionTowards { enum GoalMcCoy { kGoalMcCoyDefault = 0, - kGoalMcCoyDodge = 1 + kGoalMcCoyDodge = 1, + kGoalMcCoyBB11GetUp = 100, + kGoalMcCoyBB11PrepareToRunAway = 101, + kGoalMcCoyBB11RunAway = 102, + kGoalMcCoyBB11GetCaught = 103, + kGoalMcCoyArrested = 500 }; enum GoalSteele { @@ -1511,6 +1517,15 @@ enum GoalGuzza { kGoalGuzzaGoToOffice = 102 }; +enum GoalClovis { + kGoalClovisDefault = 100, + kGoalClovisBB11WalkToMcCoy = 101, + kGoalClovisBB11StopSadik = 102, + kGoalClovisBB11TalkWithSadik = 103, + kGoalClovisBB11PrepareToTalkToMcCoy = 104, // bug? this is not triggered when player skips dialogue + kGoalClovisBB11TalkToMcCoy = 105 // ends Chapter 2 +}; + enum GoalIzo { kGoalIzoDefault = 0, kGoalIzoPrepareCamera = 1, @@ -1533,6 +1548,17 @@ enum GoalIzo { kGoalIzoDead = 599 }; +enum GoalSadik { + kGoalSadikDefaut = 100, + kGoalSadikRunFromBB09 = 101, + kGoalSadikBB11Wait = 102, + kGoalSadikBB11ThrowMcCoy = 103, + kGoalSadikBB11CatchMcCoy = 104, + kGoalSadikBB11KnockOutMcCoy = 105, + kGoalSadikBB11KickMcCoy = 106, + kGoalSadikBB11TalkWithClovis = 107 +}; + enum GoalTransient { kGoalTransientDefault = 0, kGoalTransientCT04Leave = 2 diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index d95c0e501e..4702c35326 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -46,34 +46,52 @@ void AIScriptClovis::Initialize() { _var5 = 0; _flag = 0; - Actor_Set_Goal_Number(kActorClovis, 100); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisDefault); } bool AIScriptClovis::Update() { - if (Actor_Query_Goal_Number(kActorClovis) == 104) { - Actor_Set_Goal_Number(kActorClovis, 105); + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisBB11PrepareToTalkToMcCoy) { + Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11TalkToMcCoy); return true; - } else if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorClovis) < 350) { + } + + if (Global_Variable_Query(kVariableChapter) == 3 + && Actor_Query_Goal_Number(kActorClovis) < 350 + ) { Actor_Set_Goal_Number(kActorClovis, 350); return true; - } else if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(542)) { + } + + if ( Global_Variable_Query(kVariableChapter) == 4 + && !Game_Flag_Query(542) + ) { Game_Flag_Set(542); Actor_Set_Goal_Number(kActorClovis, 400); return true; - } else { - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorClovis) < 500) { - Actor_Set_Goal_Number(kActorClovis, 500); - } - if (Actor_Query_Goal_Number(kActorClovis) == 511 && Game_Flag_Query(657)) { - Actor_Set_Goal_Number(kActorClovis, 512); - } - if (Game_Flag_Query(653) && !Game_Flag_Query(696) && Game_Flag_Query(697)) { - Actor_Set_Goal_Number(kActorClovis, 517); - Game_Flag_Set(696); - return true; - } - return false; } + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_Goal_Number(kActorClovis) < 500 + ) { + Actor_Set_Goal_Number(kActorClovis, 500); + } + + if (Actor_Query_Goal_Number(kActorClovis) == 511 + && Game_Flag_Query(657) + ) { + Actor_Set_Goal_Number(kActorClovis, 512); + } + + if ( Game_Flag_Query(653) + && !Game_Flag_Query(696) + && Game_Flag_Query(697) + ) { + Actor_Set_Goal_Number(kActorClovis, 517); + Game_Flag_Set(696); + return true; + } + return false; + } void AIScriptClovis::TimerExpired(int timer) { @@ -82,12 +100,12 @@ void AIScriptClovis::TimerExpired(int timer) { void AIScriptClovis::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorClovis)) { - case 101: - Actor_Set_Goal_Number(kActorClovis, 103); + case kGoalClovisBB11WalkToMcCoy: + Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11StopSadik); break; - case 102: - Actor_Set_Goal_Number(kActorClovis, 102); + case kGoalClovisBB11StopSadik: + Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11TalkWithSadik); break; case 401: @@ -223,28 +241,28 @@ int AIScriptClovis::GetFriendlinessModifierIfGetsClue(int otherActorId, int clue bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { switch (newGoalNumber) { - case 100: + case kGoalClovisDefault: AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 33, 0); AI_Movement_Track_Repeat(kActorClovis); return true; - case 101: + case kGoalClovisBB11WalkToMcCoy: AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 319, 0); AI_Movement_Track_Append(kActorClovis, 320, 0); AI_Movement_Track_Repeat(kActorClovis); return true; - case 102: + case kGoalClovisBB11StopSadik: Actor_Start_Speech_Sample(kActorClovis, 0); AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 321, 0); AI_Movement_Track_Repeat(kActorClovis); return true; - case 103: - Actor_Set_Goal_Number(kActorSadik, 107); + case kGoalClovisBB11TalkWithSadik: + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11TalkWithClovis); Actor_Says(kActorClovis, 10, 15); Actor_Says(kActorSadik, 0, kAnimationModeTalk); Actor_Face_Actor(kActorClovis, kActorSadik, true); @@ -260,7 +278,7 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); return true; - case 105: + case kGoalClovisBB11TalkToMcCoy: Actor_Says(kActorClovis, 60, 30); Actor_Says(kActorSadik, 30, kAnimationModeTalk); Actor_Says(kActorClovis, 70, 30); @@ -544,7 +562,7 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { break; case 1: - if (!_var1) { + if (_var1 == 0) { *animation = 228; } if (_var1 == 1) { @@ -597,8 +615,8 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { _animationState = 2; _animationFrame = 0; *animation = 238; - if (Actor_Query_Goal_Number(kActorClovis) == 103) { - Actor_Set_Goal_Number(kActorClovis, 104); + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisBB11TalkWithSadik) { + Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11PrepareToTalkToMcCoy); } } break; diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp index c7c6341b72..48972c4b26 100644 --- a/engines/bladerunner/script/ai/dektora.cpp +++ b/engines/bladerunner/script/ai/dektora.cpp @@ -269,7 +269,7 @@ bool AIScriptDektora::ShotAtAndHit() { } else { Actor_Change_Animation_Mode(kActorDektora, 48); Delay(2000); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } return true; diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp index 9d1754aeac..e5fcebbd3a 100644 --- a/engines/bladerunner/script/ai/gordo.cpp +++ b/engines/bladerunner/script/ai/gordo.cpp @@ -249,7 +249,7 @@ bool AIScriptGordo::ShotAtAndHit() { Actor_Voice_Over(2410, kActorVoiceOver); Actor_Voice_Over(2420, kActorVoiceOver); Game_Flag_Set(532); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } if (Actor_Query_Goal_Number(kActorGordo) == 250) { Actor_Set_Goal_Number(kActorGordo, 254); @@ -618,7 +618,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { Game_Flag_Reset(603); Actor_Set_Targetable(kActorSteele, false); Delay(3000); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); break; case 260: Actor_Set_Targetable(kActorGordo, false); diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 12e58b85cf..120d322195 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -62,19 +62,25 @@ bool AIScriptMcCoy::Update() { Sound_Play(dword_45A0F8, 100, 0, 0, 50); dword_45A0F8 = -1; } + switch (Actor_Query_Goal_Number(kActorMcCoy)) { - case 101: - Actor_Set_Goal_Number(kActorMcCoy, 102); + case kGoalMcCoyBB11PrepareToRunAway: + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11RunAway); return true; - case 102: - if (Actor_Query_Inch_Distance_From_Waypoint(kActorMcCoy, 316) < 36 && !Game_Flag_Query(375)) { - Actor_Change_Animation_Mode(kActorMcCoy, 21); - Game_Flag_Set(375); + + case kGoalMcCoyBB11RunAway: + if ( Actor_Query_Inch_Distance_From_Waypoint(kActorMcCoy, 316) < 36 + && !Game_Flag_Query(kFlagBB11SadikPunchedMcCoy) + ) { + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeHit); + Game_Flag_Set(kFlagBB11SadikPunchedMcCoy); } + if (Actor_Query_Inch_Distance_From_Waypoint(kActorMcCoy, 316) < 4) { - Actor_Set_Goal_Number(kActorMcCoy, 103); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11GetCaught); } return true; + case 201: Actor_Set_Goal_Number(kActorMcCoy, 0); if (Player_Query_Current_Set() == kSetNR03) { @@ -85,6 +91,7 @@ bool AIScriptMcCoy::Update() { } Player_Gains_Control(); return true; + case 212: if (Global_Variable_Query(47) >= 13) { Global_Variable_Set(47, 500); @@ -92,17 +99,21 @@ bool AIScriptMcCoy::Update() { Global_Variable_Decrement(47, 1); } break; + case 221: Actor_Set_Goal_Number(kActorMcCoy, 0); Actor_Set_Goal_Number(kActorEarlyQ, 212); return true; + case 309: sub_4053E0(); break; + case 391: Actor_Retired_Here(kActorMcCoy, 12, 48, 1, -1); Actor_Set_Goal_Number(kActorMcCoy, 599); break; + case 231: sub_4053E0(); break; @@ -122,19 +133,23 @@ void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) { case kClueSushiMenu: Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationChinatown, true); break; + case kClueDragonflyEarring: case kClueBombingSuspect: Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationAnimoidRow, true); break; + case kClueKingstonKitchenBox1: case kClueKingstonKitchenBox2: if (Query_Difficulty_Level() == 0) { Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationAnimoidRow, true); } break; + case kClueDragonflyCollection: Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationNightclubRow, true); break; + case kClueHysteriaToken: case kClueCarRegistration1: case kClueCarRegistration2: @@ -143,23 +158,28 @@ void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) { Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationHysteriaHall, true); Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationNightclubRow, true); break; + case kClueWeaponsCache: case kClueWeaponsOrderForm: case kClueShippingForm: case kCluePoliceIssueWeapons: Global_Variable_Increment(49, 1); break; + case kClueFolder: Global_Variable_Increment(49, 5); break; + case kClueHomelessManKid: case kClueOriginalRequisitionForm: Global_Variable_Increment(49, 3); break; + case kClueScaryChair: case kClueIzosStashRaided: Global_Variable_Increment(49, 2); break; + case kClueDNATyrell: case kClueDNASebastian: case kClueDNAChew: @@ -169,7 +189,11 @@ void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) { Global_Variable_Increment(kVariableDNAEvidences, 1); break; } - if (Global_Variable_Query(49) > 6 && Global_Variable_Query(kVariableChapter) > 3 && !Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy)) { + + if ( Global_Variable_Query(49) > 6 + && Global_Variable_Query(kVariableChapter) > 3 + && !Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy) + ) { Delay(500); Actor_Voice_Over(3320, kActorVoiceOver); switch (clueId) { @@ -185,16 +209,20 @@ void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) { Actor_Voice_Over(3370, kActorVoiceOver); Actor_Voice_Over(3380, kActorVoiceOver); break; + case kClueHomelessManKid: Actor_Voice_Over(3330, kActorVoiceOver); break; + case kClueScaryChair: Actor_Voice_Over(3390, kActorVoiceOver); Actor_Voice_Over(3400, kActorVoiceOver); Actor_Voice_Over(3420, kActorVoiceOver); break; } + Actor_Clue_Acquire(kActorMcCoy, kClueGuzzaFramedMcCoy, true, -1); + if (clueId == kClueFolder) { Actor_Voice_Over(2780, kActorVoiceOver); Actor_Voice_Over(2800, kActorVoiceOver); @@ -247,15 +275,19 @@ void AIScriptMcCoy::Retired(int byActorId) { Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorLucy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } } + if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) { Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } + if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) { Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } + if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != 599) { Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } + if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != 599) { Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } @@ -269,26 +301,32 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { unsigned int affectionTowards; switch (newGoalNumber) { - case 0: + case kGoalMcCoyDefault: return true; + case kGoalMcCoyDodge: dodge(); return true; + case 2: sub_405920(); return true; - case 100: + + case kGoalMcCoyBB11GetUp: Actor_Set_At_Waypoint(kActorMcCoy, 315, 263); _animationState = 53; _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; Actor_Set_Invisible(kActorMcCoy, false); return true; - case 102: + + case kGoalMcCoyBB11RunAway: Async_Actor_Walk_To_Waypoint(kActorMcCoy, 316, 0, true); return true; - case 103: + + case kGoalMcCoyBB11GetCaught: Actor_Face_Actor(kActorMcCoy, kActorSadik, true); return true; + case 231: Player_Set_Combat_Mode(false); Preload(18); @@ -304,13 +342,16 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { flt_462710 = 110.84f; off_45A100 = -6.0f; return true; + case 230: dword_45A0FC = Actor_Query_Goal_Number(kActorSteele) == 215; Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack); return true; + case 220: Actor_Change_Animation_Mode(kActorMcCoy, 75); return true; + case 212: Global_Variable_Set(47, 0); Player_Set_Combat_Mode_Access(false); @@ -319,6 +360,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { _animationState = 68; _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; return true; + case 211: Actor_Face_Heading(kActorMcCoy, 512, false); Actor_Face_Heading(kActorMcCoy, 768, true); @@ -332,6 +374,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Goal_Number(kActorMcCoy, 0); Player_Gains_Control(); return true; + case 210: Actor_Put_In_Set(kActorMcCoy, kSetNR01); Actor_Set_At_XYZ(kActorMcCoy, -204.0, 24.0, -817.0, 256); @@ -344,22 +387,27 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Invisible(kActorMcCoy, false); } return true; + case 200: Player_Loses_Control(); Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); return true; + case 301: _animationState = 62; _animationFrame = 0; return true; + case 302: _animationState = 64; _animationFrame = 0; return true; + case 303: _animationState = 65; _animationFrame = 0; return true; + case 350: Sound_Play(123, 50, 0, 0, 50); Delay(1000); @@ -397,6 +445,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 6705, 11); Sound_Play(123, 50, 0, 0, 50); return true; + case 390: Actor_Force_Stop_Walking(kActorMcCoy); Player_Loses_Control(); @@ -408,6 +457,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; } return true; + case 400: Actor_Set_Health(kActorMcCoy, 50, 50); Game_Flag_Set(373); @@ -453,7 +503,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Chapter_Enter(5, kSetMA02_MA04, kSceneMA02); } return true; - case 500: + + case kGoalMcCoyArrested: Music_Stop(3); Player_Set_Combat_Mode(false); Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); @@ -666,8 +717,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { *animation = 19; _animationFrame = 0; _animationState = 0; - if (Actor_Query_Goal_Number(kActorMcCoy) == 100) { - Actor_Set_Goal_Number(kActorMcCoy, 101); + if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyBB11GetUp) { + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11PrepareToRunAway); } if (Actor_Query_Goal_Number(kActorMcCoy) == 210) { Actor_Set_Goal_Number(kActorMcCoy, 211); @@ -1292,6 +1343,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { return true; } break; + case kAnimationModeWalk: if (_animationState != 27 && _animationState != 50 @@ -1305,6 +1357,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } } break; + case kAnimationModeRun: if (_animationState != 27 && _animationState != 50 @@ -1318,6 +1371,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } } break; + case kAnimationModeTalk: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1329,6 +1383,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 20; } break; + case kAnimationModeCombatIdle: switch (_animationState) { case 14: @@ -1367,6 +1422,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; + case kAnimationModeCombatAim: switch (_animationState) { case 17: @@ -1387,22 +1443,26 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; + case kAnimationModeCombatAttack: _animationState = 21; _animationFrame = 0; break; + case kAnimationModeCombatWalk: if (_animationState != 27 && _animationState != 50) { _animationState = 36; _animationFrame = 0; } break; + case kAnimationModeCombatRun: if (_animationState != 27 && _animationState != 50) { _animationState = 37; _animationFrame = 0; } break; + case 9: case 12: if (_animationState < 3 || _animationState > 12) { @@ -1415,6 +1475,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 21; } break; + case 10: case 13: if (_animationState < 3 || _animationState > 12) { @@ -1427,6 +1488,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 27; } break; + case 11: case 14: if (_animationState < 3 || _animationState > 12) { @@ -1439,6 +1501,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 22; } break; + case 15: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1450,6 +1513,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 23; } break; + case 16: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1461,6 +1525,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 24; } break; + case 17: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1472,6 +1537,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 25; } break; + case 18: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1483,6 +1549,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 26; } break; + case 19: if (_animationState < 3 || _animationState > 12) { _animationState = 13; @@ -1494,9 +1561,11 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 27; } break; + case 20: dodge(); break; + case kAnimationModeHit: switch (_animationState) { case 14: @@ -1524,6 +1593,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; + case kAnimationModeCombatHit: if (Random_Query(0, 1) == 1) { _animationState = 23; @@ -1532,19 +1602,23 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { } _animationFrame = 0; break; + case 23: _animationState = 66; _animationFrame = 0; break; + case 29: Player_Loses_Control(); _animationFrame = 0; _animationState = 71; break; + case 38: _animationState = 47; _animationFrame = 0; break; + case 39: _animationFrame = 0; _animationState = 52; @@ -1552,35 +1626,43 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationFrame = 23; } break; + case 40: _animationState = 44; _animationFrame = 0; break; + case 41: _animationState = 45; _animationFrame = 0; break; + case 42: _animationState = 46; _animationFrame = 0; Player_Loses_Control(); break; + case kAnimationModeWalkUp: _animationState = 38; _animationFrame = 0; break; + case kAnimationModeWalkDown: _animationState = 39; _animationFrame = 0; break; + case kAnimationModeCombatWalkUp: _animationState = 40; _animationFrame = 0; break; + case kAnimationModeCombatWalkDown: _animationState = 41; _animationFrame = 0; break; + case kAnimationModeDie: switch (_animationState) { case 14: diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp index d55b611d75..da21d21114 100644 --- a/engines/bladerunner/script/ai/officer_grayford.cpp +++ b/engines/bladerunner/script/ai/officer_grayford.cpp @@ -472,7 +472,7 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); if (Game_Flag_Query(kFlagDR04McCoyShotMoraji)) { - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } else { Actor_Says(kActorMcCoy, 960, 15); Actor_Says(kActorMcCoy, 965, 18); diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index be81315d03..250e090b5e 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -46,7 +46,7 @@ void AIScriptSadik::Initialize() { Actor_Put_In_Set(kActorSadik, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorSadik, 33, 0); - Actor_Set_Goal_Number(kActorSadik, 100); + Actor_Set_Goal_Number(kActorSadik, kGoalSadikDefaut); } bool AIScriptSadik::Update() { @@ -54,14 +54,14 @@ bool AIScriptSadik::Update() { && Player_Query_Current_Scene() == kSceneBB09 && !Game_Flag_Query(kFlagBB09SadikRun) ) { - Actor_Set_Goal_Number(kActorSadik, 101); + Actor_Set_Goal_Number(kActorSadik, kGoalSadikRunFromBB09); Actor_Set_Targetable(kActorSadik, true); Game_Flag_Set(kFlagBB09SadikRun); Game_Flag_Set(kFlagUnused406); return true; } - if (_var1) { + if (_var1 != 0) { Sound_Play(_var1, 100, 0, 0, 50); _var1 = 0; } @@ -108,16 +108,16 @@ void AIScriptSadik::TimerExpired(int timer) { void AIScriptSadik::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorSadik)) { - case 101: - Actor_Set_Goal_Number(kActorSadik, 102); + case kGoalSadikRunFromBB09: + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11Wait); break; - case 104: - Actor_Set_Goal_Number(kActorSadik, 105); + case kGoalSadikBB11CatchMcCoy: + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11KnockOutMcCoy); break; - case 105: - Actor_Set_Goal_Number(kActorSadik, 106); + case kGoalSadikBB11KnockOutMcCoy: + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11KickMcCoy); break; case 301: @@ -231,13 +231,13 @@ int AIScriptSadik::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueI bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { switch (newGoalNumber) { - case 100: + case kGoalSadikDefaut: AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 33, 0); AI_Movement_Track_Repeat(kActorSadik); return true; - case 101: + case kGoalSadikRunFromBB09: AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append_Run(kActorSadik, 131, 0); AI_Movement_Track_Append_Run(kActorSadik, 132, 0); @@ -245,41 +245,41 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorSadik); return true; - case 102: + case kGoalSadikBB11Wait: AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 313, 0); AI_Movement_Track_Repeat(kActorSadik); Game_Flag_Set(kFlagBB11SadikFight); return true; - case 103: - Actor_Set_Immunity_To_Obstacles(kActorSadik, 1); + case kGoalSadikBB11ThrowMcCoy: + Actor_Set_Immunity_To_Obstacles(kActorSadik, true); Actor_Face_Heading(kActorSadik, kActorMcCoy, kActorMcCoy); _animationState = 32; _animationFrame = -1; Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); return true; - case 104: - Actor_Set_Goal_Number(kActorMcCoy, 100); + case kGoalSadikBB11CatchMcCoy: + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11GetUp); AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 314, 0); AI_Movement_Track_Append_Run(kActorSadik, 317, 0); AI_Movement_Track_Repeat(kActorSadik); return true; - case 105: + case kGoalSadikBB11KnockOutMcCoy: Actor_Change_Animation_Mode(kActorSadik, 62); return true; - case 106: - Actor_Face_Heading(kActorSadik, 100, 0); + case kGoalSadikBB11KickMcCoy: + Actor_Face_Heading(kActorSadik, 100, false); Actor_Change_Animation_Mode(kActorSadik, 63); - Actor_Set_Goal_Number(kActorClovis, 101); - Actor_Set_Immunity_To_Obstacles(kActorSadik, 0); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11WalkToMcCoy); + Actor_Set_Immunity_To_Obstacles(kActorSadik, false); return true; - case 107: + case kGoalSadikBB11TalkWithClovis: _var1 = 0; return false; @@ -328,7 +328,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 308: - if (Player_Query_Current_Scene() == 102) { + if (Player_Query_Current_Scene() == kSceneUG18) { Actor_Force_Stop_Walking(kActorMcCoy); Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack); Sound_Play(12, 100, 0, 0, 50); @@ -767,14 +767,14 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 0; *animation = 328; - Actor_Set_Goal_Number(kActorSadik, 104); + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11CatchMcCoy); } break; case 33: *animation = 344; _animationFrame++; - if (Actor_Query_Goal_Number(kActorSadik) == 105) { + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) { if (_animationFrame == 4) { _var1 = 221; } @@ -788,7 +788,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationState = 0; Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); - if (Actor_Query_Goal_Number(kActorSadik) == 105) { + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) { Actor_Change_Animation_Mode(kActorSadik, 63); } } @@ -798,7 +798,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 343; _animationFrame++; if (_animationFrame == 4) { - if (Actor_Query_Goal_Number(kActorSadik) == 105) { + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) { Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); _var1 = 222; } else { @@ -812,12 +812,12 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 0; Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); - if (Actor_Query_Goal_Number(kActorSadik) == 105) { + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) { AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 318, 0); AI_Movement_Track_Repeat(kActorSadik); } else { - if (Actor_Query_Goal_Number(kActorSadik) == 106) { + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KickMcCoy) { Actor_Change_Animation_Mode(kActorSadik, 63); } } @@ -839,7 +839,7 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { Actor_Set_Frame_Rate_FPS(kActorSadik, -2); switch (mode) { - case 0: + case kAnimationModeIdle: switch (_animationState) { case 19: case 20: @@ -862,22 +862,22 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { } break; - case 1: + case kAnimationModeWalk: _animationFrame = 0; _animationState = 1; break; - case 2: + case kAnimationModeRun: _animationFrame = 0; _animationState = 2; break; - case 3: + case kAnimationModeTalk: _animationState = 20; _animationFrame = 0; break; - case 4: + case kAnimationModeCombatIdle: switch (_animationState) { case 0: _animationFrame = 0; @@ -911,17 +911,17 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { case 20: return true; - case 6: + case kAnimationModeCombatAttack: _animationFrame = 0; _animationState = 18; break; - case 7: + case kAnimationModeCombatWalk: _animationFrame = 0; _animationState = 3; break; - case 8: + case kAnimationModeCombatRun: _animationFrame = 0; _animationState = 4; break; @@ -961,7 +961,7 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 21: + case kAnimationModeHit: switch (_animationState) { case 7: case 8: @@ -991,7 +991,7 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 22: + case kAnimationModeCombatHit: if (Random_Query(0, 1)) { _animationState = 12; } else { @@ -1005,14 +1005,14 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 48: + case kAnimationModeDie: _animationState = 14; _animationFrame = 0; break; case 62: - if (Actor_Query_Goal_Number(kActorSadik) != 105 - && Actor_Query_Goal_Number(kActorSadik) != 106 + if (Actor_Query_Goal_Number(kActorSadik) != kGoalSadikBB11KnockOutMcCoy + && Actor_Query_Goal_Number(kActorSadik) != kGoalSadikBB11KickMcCoy ) { _animationState = 31; _animationFrame = 0; @@ -1023,8 +1023,8 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { break; case 63: - if (Actor_Query_Goal_Number(kActorSadik) != 105 - && Actor_Query_Goal_Number(kActorSadik) != 106 + if (Actor_Query_Goal_Number(kActorSadik) != kGoalSadikBB11KnockOutMcCoy + && Actor_Query_Goal_Number(kActorSadik) != kGoalSadikBB11KickMcCoy ) { _animationState = 30; _animationFrame = 2; diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index 9c7d51f56f..ddc50ad568 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -1203,7 +1203,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Start_Speech_Sample(kActorSteele, 1150); Actor_Change_Animation_Mode(kActorSteele, 49); Delay(5000); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); return true; case 275: diff --git a/engines/bladerunner/script/ai/tyrell_guard.cpp b/engines/bladerunner/script/ai/tyrell_guard.cpp index 0dea8ab4e4..5e40453730 100644 --- a/engines/bladerunner/script/ai/tyrell_guard.cpp +++ b/engines/bladerunner/script/ai/tyrell_guard.cpp @@ -119,7 +119,7 @@ bool AIScriptTyrellGuard::GoalChanged(int currentGoalNumber, int newGoalNumber) Ambient_Sounds_Play_Sound(590, 100, 0, 0, 0); Delay(1000); Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); return true; case 302: AI_Countdown_Timer_Reset(kActorTyrellGuard, 0); @@ -131,7 +131,7 @@ bool AIScriptTyrellGuard::GoalChanged(int currentGoalNumber, int newGoalNumber) Ambient_Sounds_Play_Sound(590, 100, 0, 0, 0); Delay(1000); Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); return true; case 304: AI_Countdown_Timer_Reset(kActorTyrellGuard, 1); diff --git a/engines/bladerunner/script/scene/bb11.cpp b/engines/bladerunner/script/scene/bb11.cpp index 75e0c6045b..3e34b0b53c 100644 --- a/engines/bladerunner/script/scene/bb11.cpp +++ b/engines/bladerunner/script/scene/bb11.cpp @@ -101,11 +101,11 @@ bool SceneScriptBB11::ClickedOn2DRegion(int region) { } void SceneScriptBB11::SceneFrameAdvanced(int frame) { - if ( Actor_Query_Goal_Number(kActorSadik) == 105 - && !Game_Flag_Query(375) + if ( Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy + && !Game_Flag_Query(kFlagBB11SadikPunchedMcCoy) ) { Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); - Game_Flag_Set(375); + Game_Flag_Set(kFlagBB11SadikPunchedMcCoy); } else { if (frame == 1) { Sound_Play(74, 10, -100, 100, 50); @@ -117,11 +117,11 @@ void SceneScriptBB11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo } void SceneScriptBB11::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(kActorSadik) == 102 + if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11Wait && Global_Variable_Query(kVariableChapter) == 2 ) { Actor_Set_Invisible(kActorMcCoy, true); - Actor_Set_Goal_Number(kActorSadik, 103); + Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11ThrowMcCoy); Music_Play(11, 61, 0, 1, -1, 0, 0); Player_Loses_Control(); } diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp index 518f4fc436..f97cc4c8f0 100644 --- a/engines/bladerunner/script/scene/nr11.cpp +++ b/engines/bladerunner/script/scene/nr11.cpp @@ -330,7 +330,7 @@ void SceneScriptNR11::PlayerWalkedIn() { Actor_Set_Goal_Number(kActorSteele, 275); } } else { - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } } // return true; diff --git a/engines/bladerunner/script/scene/ps14.cpp b/engines/bladerunner/script/scene/ps14.cpp index 44b57cbc5e..73b87e7c83 100644 --- a/engines/bladerunner/script/scene/ps14.cpp +++ b/engines/bladerunner/script/scene/ps14.cpp @@ -79,7 +79,7 @@ bool SceneScriptPS14::ClickedOnExit(int exitId) { Game_Flag_Set(666); Actor_Set_Goal_Number(kActorMcCoy, 400); } else { - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } } else if (Global_Variable_Query(kVariableChapter) > 3) { Actor_Says(kActorMcCoy, 8522, 12); diff --git a/engines/bladerunner/script/scene/tb03.cpp b/engines/bladerunner/script/scene/tb03.cpp index 8a46c8c3c4..bd4d9c5311 100644 --- a/engines/bladerunner/script/scene/tb03.cpp +++ b/engines/bladerunner/script/scene/tb03.cpp @@ -141,7 +141,7 @@ void SceneScriptTB03::PlayerWalkedIn() { Actor_Says(kActorOfficerGrayford, 260, -1); Actor_Says(kActorMcCoy, 170, 14); Delay(1000); - Actor_Set_Goal_Number(kActorMcCoy, 500); + Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } } |