diff options
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r-- | engines/bladerunner/script/ai/clovis.cpp | 22 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/dektora.cpp | 19 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/hawkers_barkeep.cpp | 137 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/holloway.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/insect_dealer.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/izo.cpp | 263 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/lucy.cpp | 14 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 27 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/runciter.cpp | 24 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/sadik.cpp | 43 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 171 |
11 files changed, 385 insertions, 345 deletions
diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index a47a4bb7dd..d5043280a1 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -174,7 +174,7 @@ void AIScriptClovis::Retired(int byActorId) { Delay(2000); Player_Set_Combat_Mode(false); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); Game_Flag_Reset(653); @@ -413,15 +413,19 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 8505, kAnimationModeTalk); Actor_Says(kActorClovis, 1300, kAnimationModeTalk); Actor_Says(kActorClovis, 1310, kAnimationModeTalk); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(20, 0, -1); - if (Global_Variable_Query(kVariableAffectionTowards) == 3 && Game_Flag_Query(46)) { - Outtake_Play(21, 0, -1); - } else if (Global_Variable_Query(kVariableAffectionTowards) == 2 && Game_Flag_Query(47)) { - Outtake_Play(22, 0, -1); - } - Outtake_Play(23, 0, -1); + Outtake_Play(kOuttakeEnd4A, 0, -1); + if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy + && Game_Flag_Query(kFlagLucyIsReplicant) + ) { + Outtake_Play(kOuttakeEnd4B, 0, -1); + } else if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora + && Game_Flag_Query(kFlagDektoraIsReplicant) + ) { + Outtake_Play(kOuttakeEnd4C, 0, -1); + } + Outtake_Play(kOuttakeEnd4D, 0, -1); Game_Over(); return true; diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp index b7268c0daa..e6203132e7 100644 --- a/engines/bladerunner/script/ai/dektora.cpp +++ b/engines/bladerunner/script/ai/dektora.cpp @@ -87,12 +87,13 @@ bool AIScriptDektora::Update() { Actor_Set_Goal_Number(kActorDektora, 300); } } else if (Game_Flag_Query(489)) { - if (Game_Flag_Query(504) == 1 - && !Game_Flag_Query(374) - && Player_Query_Current_Scene() - && Player_Query_Current_Scene() != 1) { - if (Game_Flag_Query(726)) { - Item_Remove_From_World(106); + if ( Game_Flag_Query(504) == 1 + && !Game_Flag_Query(374) + && Player_Query_Current_Scene() + && Player_Query_Current_Scene() != 1 + ) { + if (Game_Flag_Query(kFlagAR02Entered)) { + Item_Remove_From_World(kItemScrorpions); } Game_Flag_Set(374); } @@ -292,7 +293,7 @@ void AIScriptDektora::Retired(int byActorId) { Delay(2000); Player_Set_Combat_Mode(false); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); Game_Flag_Reset(653); @@ -1095,8 +1096,8 @@ void AIScriptDektora::checkCombat() { && Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorDektora) != 450 ) { - if (Global_Variable_Query(kVariableAffectionTowards) == 2) { - Global_Variable_Set(kVariableAffectionTowards, 0); + if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora) { + Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone); } Actor_Set_Goal_Number(kActorDektora, 450); diff --git a/engines/bladerunner/script/ai/hawkers_barkeep.cpp b/engines/bladerunner/script/ai/hawkers_barkeep.cpp index 8e82ecc63c..5f77eb91c6 100644 --- a/engines/bladerunner/script/ai/hawkers_barkeep.cpp +++ b/engines/bladerunner/script/ai/hawkers_barkeep.cpp @@ -119,61 +119,15 @@ bool AIScriptHawkersBarkeep::GoalChanged(int currentGoalNumber, int newGoalNumbe bool AIScriptHawkersBarkeep::UpdateAnimation(int *animation, int *frame) { switch (_animationState) { case 0: - if (_var1 == 1) { - if (_var1 == 1) { - *animation = 706; - if (_animationFrame <= 3) - _var3 = 1; - - if (_animationFrame == 11) { - if (Random_Query(0, 2)) - _var3 = -1; - } - - _animationFrame += _var3; - - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(706)) { - *animation = 705; - _animationFrame = 0; - _var1 = 0; - } - } else { - *animation = 707; - - if (_var2) { - _var2--; - - if (_var2 == 0) - _var3 = 2 * Random_Query(0, 1) - 1; - } else { - if (_animationFrame <= 11) - _var3 = 1; - - if (_animationFrame == 14) { - if (Random_Query(0, 2)) - _var3 = -1; - } - - if (_animationFrame == 18) - _var2 = Random_Query(5, 15); - - _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(707)) { - *animation = 705; - _animationFrame = 0; - _var1 = 0; - _var2 = 0; - } - } - } - } else if (_var1 == 0) { + if (_var1 == 0) { *animation = 705; if (_var2) { _var2--; - if (!Random_Query(0, 6)) + if (Random_Query(0, 6) == 0) { _var3 = -_var3; + } } else { _animationFrame += _var3; @@ -203,48 +157,95 @@ bool AIScriptHawkersBarkeep::UpdateAnimation(int *animation, int *frame) { } } } - } - break; + } else if (_var1 == 1) { + *animation = 706; + if (_animationFrame <= 3) + _var3 = 1; + + if (_animationFrame == 11) { + if (Random_Query(0, 2)) + _var3 = -1; + } - case 1: - if (_var1 == 1) { - if (_var1 == 1) { - *animation = 706; - _animationFrame++; + _animationFrame += _var3; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(706)) { - _animationFrame = 0; - _animationState = _animationStateNext; - *animation = _animationNext; - } + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(706)) { + *animation = 705; + _animationFrame = 0; + _var1 = 0; + } + } else if (_var1 == 2) { + *animation = 707; + + if (_var2) { + _var2--; + + if (_var2 == 0) + _var3 = 2 * Random_Query(0, 1) - 1; } else { - *animation = 707; - _animationFrame += 2; + if (_animationFrame <= 11) + _var3 = 1; + if (_animationFrame == 14) { + if (Random_Query(0, 2) != 0) { + _var3 = -1; + } + } + + if (_animationFrame == 18) { + _var2 = Random_Query(5, 15); + } + + _animationFrame++; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(707)) { + *animation = 705; _animationFrame = 0; - _animationState = _animationStateNext; - *animation = _animationNext; + _var1 = 0; + _var2 = 0; } } - } else if (_var1 == 0) { + } + break; + + case 1: + if (_var1 == 0) { _animationFrame = 0; _animationState = _animationStateNext; *animation = _animationNext; + } else if (_var1 == 1) { + *animation = 706; + _animationFrame++; + + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(706)) { + _animationFrame = 0; + _animationState = _animationStateNext; + *animation = _animationNext; + } + } else if (_var1 == 2) { + *animation = 707; + _animationFrame += 2; + + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(707)) { + _animationFrame = 0; + _animationState = _animationStateNext; + *animation = _animationNext; + } } + break; case 2: *animation = 710; - if (!_animationFrame && _flag) { + if (_animationFrame == 0 && _flag) { _animationState = 0; _var1 = 0; } else { _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(710)) + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(710)) { _animationFrame = 0; + } } break; diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp index 7b5fd1dde8..ed4453ec60 100644 --- a/engines/bladerunner/script/ai/holloway.cpp +++ b/engines/bladerunner/script/ai/holloway.cpp @@ -165,10 +165,10 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) { break; case 257: - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Player_Gains_Control(); - Outtake_Play(11, 0, 1); + Outtake_Play(kOuttakeInterrogation, 0, 1); if (Global_Variable_Query(40) == 1) { Actor_Set_Goal_Number(kActorDektora, 245); Actor_Change_Animation_Mode(kActorDektora, kAnimationModeIdle); diff --git a/engines/bladerunner/script/ai/insect_dealer.cpp b/engines/bladerunner/script/ai/insect_dealer.cpp index db957f99e3..fb0924a066 100644 --- a/engines/bladerunner/script/ai/insect_dealer.cpp +++ b/engines/bladerunner/script/ai/insect_dealer.cpp @@ -50,7 +50,9 @@ void AIScriptInsectDealer::Initialize() { } bool AIScriptInsectDealer::Update() { - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorInsectDealer) < 400) + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_Goal_Number(kActorInsectDealer) < 400 + ) Actor_Set_Goal_Number(kActorInsectDealer, 400); return false; @@ -111,7 +113,7 @@ bool AIScriptInsectDealer::GoalChanged(int currentGoalNumber, int newGoalNumber) if (!Game_Flag_Query(374)) { Game_Flag_Set(374); - Item_Remove_From_World(106); + Item_Remove_From_World(kItemScrorpions); } } diff --git a/engines/bladerunner/script/ai/izo.cpp b/engines/bladerunner/script/ai/izo.cpp index 06966ef101..3f2715ac78 100644 --- a/engines/bladerunner/script/ai/izo.cpp +++ b/engines/bladerunner/script/ai/izo.cpp @@ -51,28 +51,39 @@ void AIScriptIzo::Initialize() { } bool AIScriptIzo::Update() { - if (Actor_Query_Goal_Number(kActorIzo) == 100 && Player_Query_Current_Scene() == kSceneUG02) { - Actor_Set_Targetable(kActorIzo, 1); - Actor_Set_Goal_Number(kActorIzo, 101); + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoStopRunning + && Player_Query_Current_Scene() == kSceneUG02 + ) { + Actor_Set_Targetable(kActorIzo, true); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRunToRC03); return true; } - if (Global_Variable_Query(kVariableChapter) == 3 - && Actor_Query_Goal_Number(kActorIzo) == 599 - && Actor_Query_Which_Set_In(kActorIzo) == 70) { + if (Global_Variable_Query(kVariableChapter) == 1 + && Actor_Query_Goal_Number(kActorIzo) == kGoalIzoDead + && Actor_Query_Which_Set_In(kActorIzo) == kSetRC03 + ) { Actor_Put_In_Set(kActorIzo, kSetFreeSlotI); Actor_Set_At_Waypoint(kActorIzo, 41, 0); } - if (!Actor_Query_Goal_Number(kActorIzo) && Player_Query_Current_Scene() == kSceneTB02) { - Actor_Set_Goal_Number(kActorIzo, 155); + + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoDefault + && Player_Query_Current_Scene() == kSceneTB02 + ) { + Actor_Set_Goal_Number(kActorIzo, kGoalIzoGoToHC03); } + if (Global_Variable_Query(kVariableChapter) == 4 - && Actor_Query_Goal_Number(kActorIzo) < 599 - && Actor_Query_Goal_Number(kActorIzo) < 300 - && Actor_Query_Goal_Number(kActorIzo) != 180) { + && Actor_Query_Goal_Number(kActorIzo) < kGoalIzoDead + && Actor_Query_Goal_Number(kActorIzo) < 300 + && Actor_Query_Goal_Number(kActorIzo) != kGoalIzoGotArrested + ) { Actor_Set_Goal_Number(kActorIzo, 300); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorIzo) < 400) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_Goal_Number(kActorIzo) < 400 + ) { Actor_Set_Goal_Number(kActorIzo, 400); } @@ -85,38 +96,38 @@ void AIScriptIzo::TimerExpired(int timer) { void AIScriptIzo::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorIzo)) { - case 3: - Actor_Set_Goal_Number(kActorIzo, 101); + case kGoalIzoRunToUG02: + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRunToRC03); Player_Gains_Control(); return; //true; - case 101: - Actor_Set_Goal_Number(kActorIzo, 102); + case kGoalIzoRunToRC03: + Actor_Set_Goal_Number(kActorIzo, kGoalIzoWaitingAtRC03); return; //true; - case 110: - case 111: - Actor_Set_Goal_Number(kActorIzo, 114); - Actor_Set_Goal_Number(kActorSteele, 100); + case kGoalIzoRC03Walk: + case kGoalIzoRC03Run: + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03RunAway); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleApprehendIzo); Scene_Exits_Enable(); return; //true; - case 114: + case kGoalIzoRC03RunAway: Scene_Exits_Enable(); return; //true; - case 120: + case kGoalIzoGetArrested: Game_Flag_Set(kFlagIzoArrested); - Actor_Set_Goal_Number(kActorIzo, 180); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoGotArrested); Scene_Exits_Enable(); return; //true; - case 150: - Actor_Set_Goal_Number(kActorIzo, 155); + case kGoalIzoGoToHC01: + Actor_Set_Goal_Number(kActorIzo, kGoalIzoGoToHC03); return; //true; - case 155: - Actor_Set_Goal_Number(kActorIzo, 150); + case kGoalIzoGoToHC03: + Actor_Set_Goal_Number(kActorIzo, kGoalIzoGoToHC01); return; //true; case 300: @@ -136,29 +147,31 @@ void AIScriptIzo::ReceivedClue(int clueId, int fromActorId) { } void AIScriptIzo::ClickedByPlayer() { - if (Actor_Query_Goal_Number(kActorIzo) > 500) { - Actor_Face_Actor(kActorMcCoy, kActorIzo, 1); + if (Actor_Query_Goal_Number(kActorIzo) > 500) { // Dead + Actor_Face_Actor(kActorMcCoy, kActorIzo, true); Actor_Says(kActorMcCoy, 8585, 13); return; //true; } - if (Actor_Query_Goal_Number(kActorIzo) == 101 && Player_Query_Current_Set() == kSetUG02) { + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRunToRC03 + && Player_Query_Current_Set() == kSetUG02 + ) { Player_Loses_Control(); - Actor_Set_Goal_Number(kActorIzo, 100); - Actor_Face_Actor(kActorMcCoy, kActorIzo, 1); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoStopRunning); + Actor_Face_Actor(kActorMcCoy, kActorIzo, true); Actor_Says(kActorMcCoy, 5460, 16); - Actor_Face_Actor(kActorIzo, kActorMcCoy, 1); + Actor_Face_Actor(kActorIzo, kActorMcCoy, true); Actor_Says(kActorIzo, 700, 17); Actor_Says(kActorMcCoy, 5465, 14); someDialog(); } - if (Actor_Query_Goal_Number(kActorIzo) == 110) { - Actor_Face_Actor(kActorMcCoy, kActorIzo, 1); + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk) { + Actor_Face_Actor(kActorMcCoy, kActorIzo, true); Actor_Says(kActorMcCoy, 2715, 14); - Actor_Set_Goal_Number(kActorIzo, 111); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03Run); Actor_Says(kActorMcCoy, 1800, 14); - Actor_Set_Goal_Number(kActorSteele, 100); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleApprehendIzo); return; //true; } @@ -178,41 +191,43 @@ void AIScriptIzo::OtherAgentExitedThisScene(int otherActorId) { } void AIScriptIzo::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { - if (Actor_Query_Goal_Number(kActorIzo) == 110) { + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk) { Game_Flag_Query(kFlagIzoIsReplicant); } return; //false; } void AIScriptIzo::ShotAtAndMissed() { - if (Actor_Query_Goal_Number(kActorIzo) != 110) { - return; //false; + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk) { + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03Run); + return; //true; } - Actor_Set_Goal_Number(kActorIzo, 111); - - return; //true; + return; //false; } bool AIScriptIzo::ShotAtAndHit() { - if (Actor_Query_Goal_Number(kActorIzo) == 110 - || Actor_Query_Goal_Number(kActorIzo) == 111 - || Actor_Query_Goal_Number(kActorIzo) == 114) { + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk + || Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Run + || Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03RunAway + ) { Actor_Set_Health(kActorIzo, 50, 50); - if (Actor_Query_Goal_Number(kActorIzo) == 110) { - Actor_Set_Goal_Number(kActorIzo, 111); + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk) { + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03Run); } return true; } else { AI_Movement_Track_Flush(kActorIzo); - Global_Variable_Increment(19, 1); - if (!Game_Flag_Query(444) && Global_Variable_Query(19) == 1) { - Game_Flag_Set(444); + Global_Variable_Increment(kVariableIzoShot, 1); + if (!Game_Flag_Query(kFlagIzoShot) + && Global_Variable_Query(kVariableIzoShot) == 1 + ) { + Game_Flag_Set(kFlagIzoShot); _animationFrame = 0; _animationState = 19; - Actor_Retired_Here(kActorIzo, 36, 12, 1, -1); - Actor_Set_Goal_Number(kActorIzo, 199); + Actor_Retired_Here(kActorIzo, 36, 12, true, -1); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoDie); } return false; } @@ -224,14 +239,14 @@ void AIScriptIzo::Retired(int byActorId) { } Global_Variable_Decrement(kVariableReplicants, 1); - Actor_Set_Goal_Number(kActorIzo, 599); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoDead); if (Global_Variable_Query(kVariableReplicants) == 0) { Player_Loses_Control(); Delay(2000); Player_Set_Combat_Mode(0); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, 1, 0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); Game_Flag_Reset(653); @@ -248,78 +263,79 @@ int AIScriptIzo::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) bool AIScriptIzo::GoalChanged(int currentGoalNumber, int newGoalNumber) { if (newGoalNumber == 200 - || newGoalNumber == 199 - || newGoalNumber == 198 - || newGoalNumber == 180 - || newGoalNumber == 103) { - Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationDNARow, true); - } + || newGoalNumber == kGoalIzoDie + || newGoalNumber == kGoalIzoDieHidden + || newGoalNumber == kGoalIzoGotArrested + || newGoalNumber == kGoalIzoEscape + ) { + Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationDNARow, true); + } switch (newGoalNumber) { - case 0: + case kGoalIzoDefault: AI_Movement_Track_Flush(kActorIzo); return true; - case 1: + case kGoalIzoPrepareCamera: AI_Movement_Track_Flush(kActorIzo); - Actor_Face_Heading(kActorIzo, 520, 0); + Actor_Face_Heading(kActorIzo, 520, false); _animationState = 32; _animationFrame = -1; return true; - case 2: + case kGoalIzoTakePhoto: _animationState = 34; _animationFrame = -1; return true; - case 3: + case kGoalIzoRunToUG02: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append_Run(kActorIzo, 149, 0); AI_Movement_Track_Append_Run(kActorIzo, 152, 0); AI_Movement_Track_Repeat(kActorIzo); Scene_Exit_Add_2D_Exit(1, 394, 229, 485, 371, 1); - Game_Flag_Set(402); + Game_Flag_Set(kFlagHC03Available); return true; - case 100: + case kGoalIzoStopRunning: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Repeat(kActorIzo); return true; - case 101: + case kGoalIzoRunToRC03: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append_Run(kActorIzo, 153, 0); AI_Movement_Track_Append(kActorIzo, 154, 0); AI_Movement_Track_Repeat(kActorIzo); return true; - case 102: + case kGoalIzoWaitingAtRC03: return true; - case 103: + case kGoalIzoEscape: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 153, 0); AI_Movement_Track_Append(kActorIzo, 39, 120); AI_Movement_Track_Append(kActorIzo, 33, 0); AI_Movement_Track_Repeat(kActorIzo); - return 1; + return true; - case 110: - Game_Flag_Set(486); + case kGoalIzoRC03Walk: + Game_Flag_Set(kFlagDNARowAvailable); AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 349, 0); AI_Movement_Track_Repeat(kActorIzo); return true; - case 111: - Game_Flag_Set(486); + case kGoalIzoRC03Run: + Game_Flag_Set(kFlagDNARowAvailable); AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append_Run(kActorIzo, 349, 0); AI_Movement_Track_Repeat(kActorIzo); return true; - case 114: - Game_Flag_Set(486); + case kGoalIzoRC03RunAway: + Game_Flag_Set(kFlagDNARowAvailable); AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append_Run(kActorIzo, 174, 0); AI_Movement_Track_Repeat(kActorIzo); @@ -334,18 +350,18 @@ bool AIScriptIzo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorIzo, 34, 0); } AI_Movement_Track_Repeat(kActorIzo); - Game_Flag_Set(486); + Game_Flag_Set(kFlagDNARowAvailable); return true; - case 120: - Actor_Set_Targetable(kActorIzo, 0); + case kGoalIzoGetArrested: + Actor_Set_Targetable(kActorIzo, false); AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 174, 0); AI_Movement_Track_Append(kActorIzo, 33, 0); AI_Movement_Track_Repeat(kActorIzo); return true; - case 150: + case kGoalIzoGoToHC01: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 39, Random_Query(15, 30)); AI_Movement_Track_Append(kActorIzo, 149, 0); @@ -353,7 +369,7 @@ bool AIScriptIzo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorIzo); return true; - case 155: + case kGoalIzoGoToHC03: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 149, 0); if (Game_Flag_Query(kFlagIzoIsReplicant)) { @@ -372,31 +388,31 @@ bool AIScriptIzo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Flush(kActorIzo); return true; - case 180: - Game_Flag_Set(486); + case kGoalIzoGotArrested: + Game_Flag_Set(kFlagDNARowAvailable); Actor_Put_In_Set(kActorIzo, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorIzo, 33, 0); return true; - case 198: + case kGoalIzoDieHidden: AI_Movement_Track_Flush(kActorIzo); AI_Movement_Track_Append(kActorIzo, 41, 0); AI_Movement_Track_Repeat(kActorIzo); Actor_Set_Goal_Number(kActorIzo, 999); return true; - case 199: - Game_Flag_Set(486); + case kGoalIzoDie: + Game_Flag_Set(kFlagDNARowAvailable); AI_Movement_Track_Flush(kActorIzo); Ambient_Sounds_Play_Speech_Sound(kActorIzo, 9000, 100, 0, 0, 0); - Actor_Change_Animation_Mode(kActorIzo, 48); + Actor_Change_Animation_Mode(kActorIzo, kAnimationModeDie); Actor_Set_Goal_Number(kActorIzo, 999); Scene_Exits_Enable(); - Actor_Retired_Here(kActorIzo, 36, 12, 1, -1); + Actor_Retired_Here(kActorIzo, 36, 12, true, -1); return true; case 200: - Game_Flag_Set(486); + Game_Flag_Set(kFlagDNARowAvailable); return true; case 300: @@ -418,7 +434,7 @@ bool AIScriptIzo::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 999: - Actor_Set_Goal_Number(kActorIzo, 599); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoDead); return true; case 9999: @@ -539,8 +555,10 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { if (_animationFrame == 9) { Actor_Combat_AI_Hit_Attempt(7); } - if (Actor_Query_Goal_Number(kActorIzo) == 102 && _animationFrame == 6) { - Actor_Change_Animation_Mode(0, 20); + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoWaitingAtRC03 + && _animationFrame == 6 + ) { + Actor_Change_Animation_Mode(kActorMcCoy, 20); } Actor_Query_Goal_Number(kActorIzo); if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { @@ -579,14 +597,18 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { case 14: case 15: *animation = _animationFrame + 280; - if (++_animationFrame >= 2 - && (Actor_Query_Goal_Number(kActorIzo) == 110 || Actor_Query_Goal_Number(kActorIzo) == 111)) { + _animationFrame++; + if (_animationFrame >= 2 + && (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Walk + || Actor_Query_Goal_Number(kActorIzo) == kGoalIzoRC03Run + ) + ) { *animation = 297; _animationFrame = 0; _animationState = 0; _var4 = 0; - Actor_Change_Animation_Mode(kActorIzo, 0); - Actor_Set_Goal_Number(kActorIzo, 111); + Actor_Change_Animation_Mode(kActorIzo, kAnimationModeIdle); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03Run); } else { if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { *animation = 297; @@ -700,17 +722,17 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) { *animation = 311; _animationFrame++; if (_animationFrame == 6) { - Scene_Loop_Set_Default(0); - Scene_Loop_Start_Special(2, 2, 1); + Scene_Loop_Set_Default(0); // // HC01 - MainLoop + Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, true); // HC01 - IzoFlashLoop Player_Set_Combat_Mode(kActorSteele); } if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(311)) { *animation = 297; _animationFrame = 0; _animationState = 0; - Game_Flag_Set(407); - Item_Add_To_World(107, 977, 8, 597.46f, 0.14f, 49.92f, 0, 12, 12, 0, 1, 0, 0); - Actor_Set_Goal_Number(kActorIzo, 3); + Game_Flag_Set(kFlagUnused407); + Item_Add_To_World(kItemCamera, 977, kSetHC01_HC02_HC03_HC04, 597.46f, 0.14f, 49.92f, 0, 12, 12, false, true, false, false); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRunToUG02); } break; @@ -784,7 +806,7 @@ bool AIScriptIzo::ChangeAnimationMode(int mode) { return true; case 1: - if (Actor_Query_Goal_Number(kActorIzo) == 102) { + if (Actor_Query_Goal_Number(kActorIzo) == kGoalIzoWaitingAtRC03) { _animationState = 22; } else { _animationState = 20; @@ -987,32 +1009,29 @@ void AIScriptIzo::FledCombat() { } void AIScriptIzo::someDialog() { - int input; - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(0, 7, 4, -1); + DM_Add_To_List_Never_Repeat_Once_Selected(0, 7, 4, -1); // MOTIVES - if (Actor_Clue_Query(0, 179)) { - DM_Add_To_List_Never_Repeat_Once_Selected(10, 8, -1, -1); + if (Actor_Clue_Query(kActorMcCoy, kClueGrigorianInterviewA)) { + DM_Add_To_List_Never_Repeat_Once_Selected(10, 8, -1, -1); // LUCY } - DM_Add_To_List_Never_Repeat_Once_Selected(20, 3, 7, 4); + DM_Add_To_List_Never_Repeat_Once_Selected(20, 3, 7, 4); // REFERENCE DM_Add_To_List_Never_Repeat_Once_Selected(30, -1, 3, 7); - Dialogue_Menu_Appear(320, 240); - - input = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Appear(320, 240); + int input = Dialogue_Menu_Query_Input(); Dialogue_Menu_Disappear(); switch (input) { - case 0: + case 0: // MOTIVES Actor_Says(kActorMcCoy, 5470, 15); Actor_Says(kActorMcCoy, 710, 13); - Actor_Set_Goal_Number(kActorIzo, 103); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoEscape); Player_Gains_Control(); break; - case 10: + case 10: // LUCY if (Game_Flag_Query(kFlagIzoIsReplicant)) { Actor_Says(kActorMcCoy, 5475, 18); Actor_Says(kActorIzo, 720, 12); @@ -1033,19 +1052,19 @@ void AIScriptIzo::someDialog() { Actor_Says(kActorIzo, 830, 13); Actor_Says(kActorIzo, 840, 13); } - Actor_Set_Goal_Number(kActorIzo, 103); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoEscape); Player_Gains_Control(); break; - case 20: + case 20: // REFERENCE Actor_Says(kActorMcCoy, 5480, 18); - Actor_Set_Goal_Number(kActorIzo, 103); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoEscape); Player_Gains_Control(); break; - case 30: - Player_Set_Combat_Mode(kActorSteele); - Actor_Set_Goal_Number(kActorIzo, 103); + case 30: // DONE + Player_Set_Combat_Mode(true); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoEscape); Player_Gains_Control(); break; } diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp index 72cb959a53..0f53758b28 100644 --- a/engines/bladerunner/script/ai/lucy.cpp +++ b/engines/bladerunner/script/ai/lucy.cpp @@ -363,7 +363,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorLucy, 360, 13); Actor_Says(kActorMcCoy, 1710, 13); - if (Global_Variable_Query(kVariableAffectionTowards) == 3) { + if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) { Actor_Says(kActorLucy, 940, 13); Actor_Says(kActorMcCoy, 6780, 12); Actor_Says(kActorLucy, 950, 12); @@ -371,11 +371,13 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 6785, 13); Actor_Says(kActorLucy, 970, 16); Actor_Says(kActorLucy, 980, 13); - if (Game_Flag_Query(47)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant)) { Actor_Says(kActorLucy, 990, 15); } Actor_Says(kActorMcCoy, 6790, 13); - if (Game_Flag_Query(47) && Game_Flag_Query(46)) { + if (Game_Flag_Query(kFlagDektoraIsReplicant) + && Game_Flag_Query(kFlagLucyIsReplicant) + ) { Actor_Says(kActorLucy, 1000, 12); } Actor_Says(kActorLucy, 1010, 15); @@ -450,7 +452,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 300: Actor_Put_In_Set(kActorLucy, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorLucy, 33, 0); - if (Global_Variable_Query(kVariableAffectionTowards) == 3) { + if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) { Actor_Set_Goal_Number(kActorLucy, 310); } break; @@ -861,8 +863,8 @@ void AIScriptLucy::checkCombat() { && Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorLucy) != 450 ) { - if (Global_Variable_Query(kVariableAffectionTowards) == 3) { - Global_Variable_Set(kVariableAffectionTowards, 0); + if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) { + Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone); } Actor_Set_Goal_Number(kActorLucy, 450); Non_Player_Actor_Combat_Mode_On(kActorLucy, kActorCombatStateIdle, false, kActorMcCoy, 4, kAnimationModeIdle, kAnimationModeWalk, kAnimationModeRun, -1, 0, 0, 10, 300, false); diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 2f514ca51f..48a8e8b698 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -266,8 +266,7 @@ int AIScriptMcCoy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueI } bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { - unsigned int v5; - unsigned int v7; + unsigned int affectionTowards; switch (newGoalNumber) { case 0: @@ -412,13 +411,13 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 400: Actor_Set_Health(kActorMcCoy, 50, 50); Game_Flag_Set(373); - v5 = Global_Variable_Query(kVariableAffectionTowards); - if (v5 == 1) { + affectionTowards = Global_Variable_Query(kVariableAffectionTowards); + if (affectionTowards == kAffectionTowardsSteele) { Actor_Modify_Friendliness_To_Other(kActorSteele, kActorMcCoy, 3); - } else if (v5 == 2) { + } else if (affectionTowards == kAffectionTowardsDektora) { Actor_Modify_Friendliness_To_Other(kActorSteele, kActorMcCoy, -5); Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 3); - } else if (v5 == 3) { + } else if (affectionTowards == kAffectionTowardsLucy) { Actor_Modify_Friendliness_To_Other(kActorSteele, kActorMcCoy, -5); Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 5); } @@ -428,20 +427,22 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { if (Actor_Query_Friendliness_To_Other(kActorSteele, kActorMcCoy) < Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy)) { Game_Flag_Set(653); } - v7 = Global_Variable_Query(kVariableAffectionTowards); - if (v7 == 1) { + affectionTowards = Global_Variable_Query(kVariableAffectionTowards); + if (affectionTowards == kAffectionTowardsSteele) { if (Game_Flag_Query(653)) { - Global_Variable_Set(kVariableAffectionTowards, 0); + Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone); } - } else if (v7 == 2 || v7 == 3) { + } else if (affectionTowards == kAffectionTowardsDektora + || affectionTowards == kAffectionTowardsLucy + ) { if (!Game_Flag_Query(653)) { - Global_Variable_Set(kVariableAffectionTowards, 0); + Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone); } } if (!Game_Flag_Query(653)) { Game_Flag_Set(kFlagMaggieIsHurt); } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Global_Variable_Set(kVariableChapter, 5); Outtake_Play(kOuttakeMovieD, false, -1); @@ -598,7 +599,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { dword_45A0DC = 0; _animationState = 0; Player_Gains_Control(); - Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); + Item_Add_To_World(109, 982, kSetCT08_CT51_UG12, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); } break; case 58: diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp index 19e15989a7..e4625f1159 100644 --- a/engines/bladerunner/script/ai/runciter.cpp +++ b/engines/bladerunner/script/ai/runciter.cpp @@ -48,14 +48,18 @@ void AIScriptRunciter::Initialize() { var_45CD80 = 1; var_45CD84 = 0; var_45CD88 = 0; - Actor_Set_Goal_Number(kActorRunciter, 0); + Actor_Set_Goal_Number(kActorRunciter, kGoalRunciterDefault); } bool AIScriptRunciter::Update() { - if (Actor_Query_Goal_Number(kActorRunciter) == 0 && Game_Flag_Query(kFlagRC01PoliceDone)) { - Actor_Set_Goal_Number(kActorRunciter, 2); + if (Actor_Query_Goal_Number(kActorRunciter) == kGoalRunciterDefault + && Game_Flag_Query(kFlagRC01PoliceDone) + ) { + Actor_Set_Goal_Number(kActorRunciter, kGoalRunciterHide); } - if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorRunciter) < 300) { + if (Global_Variable_Query(kVariableChapter) == 4 + && Actor_Query_Goal_Number(kActorRunciter) < 300 + ) { Actor_Set_Goal_Number(kActorRunciter, 300); } return false; @@ -149,8 +153,8 @@ void AIScriptRunciter::ShotAtAndMissed() {} bool AIScriptRunciter::ShotAtAndHit() { Actor_Set_Targetable(kActorRunciter, false); - Actor_Change_Animation_Mode(kActorRunciter, 48); - Actor_Set_Goal_Number(kActorRunciter, 599); + Actor_Change_Animation_Mode(kActorRunciter, kAnimationModeDie); + Actor_Set_Goal_Number(kActorRunciter, kGoalRunciterDead); Delay(2000); if (Actor_Clue_Query(kActorMcCoy, kClueZubensMotive)) { Actor_Voice_Over(2050, kActorVoiceOver); @@ -171,12 +175,12 @@ int AIScriptRunciter::GetFriendlinessModifierIfGetsClue(int otherActorId, int cl } bool AIScriptRunciter::GoalChanged(int currentGoalNumber, int newGoalNumber) { - if (newGoalNumber == 0) { + if (newGoalNumber == kGoalRunciterDefault) { Actor_Put_In_Set(kActorRunciter, kSetRC02_RC51); Actor_Set_At_Waypoint(kActorRunciter, 92, 567); return false; } - if (newGoalNumber == 1) { + if (newGoalNumber == kGoalRunciterWalkAround) { AI_Movement_Track_Flush(kActorRunciter); if (Random_Query(0, 1) == 1) { if (Random_Query(0, 1) == 0) { @@ -194,14 +198,14 @@ bool AIScriptRunciter::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorRunciter); return true; } - if (newGoalNumber == 2) { + if (newGoalNumber == kGoalRunciterHide) { AI_Movement_Track_Flush(kActorRunciter); AI_Movement_Track_Append(kActorRunciter, 39, 120); AI_Movement_Track_Append(kActorRunciter, 40, 0); AI_Movement_Track_Repeat(kActorRunciter); return false; } - if (newGoalNumber == 300) { + if (newGoalNumber == kGoalRunciterAtShop) { Actor_Put_In_Set(kActorRunciter, kSetRC02_RC51); Actor_Set_At_Waypoint(kActorRunciter, 93, 1007); return false; diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index d66609f71d..0684de914c 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -50,30 +50,33 @@ void AIScriptSadik::Initialize() { } bool AIScriptSadik::Update() { - if (Global_Variable_Query(kVariableChapter) != 2 || Player_Query_Current_Scene() != 10 || Game_Flag_Query(391)) { - if (_var1) { - Sound_Play(_var1, 100, 0, 0, 50); - _var1 = 0; - } - if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorSadik) < 200) { - Actor_Set_Goal_Number(kActorSadik, 200); - } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorSadik) < 400) { - Actor_Set_Goal_Number(kActorSadik, 400); - } - if (Actor_Query_Goal_Number(kActorSadik) == 411) { - if (Game_Flag_Query(657)) { - Actor_Set_Goal_Number(kActorSadik, 412); - } - } - return false; - } else { + if (Global_Variable_Query(kVariableChapter) == 2 + && Player_Query_Current_Scene() == kSceneBB09 + && !Game_Flag_Query(391) + ) { Actor_Set_Goal_Number(kActorSadik, 101); - Actor_Set_Targetable(kActorSadik, 1); + Actor_Set_Targetable(kActorSadik, true); Game_Flag_Set(391); Game_Flag_Set(406); return true; } + + if (_var1) { + Sound_Play(_var1, 100, 0, 0, 50); + _var1 = 0; + } + if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorSadik) < 200) { + Actor_Set_Goal_Number(kActorSadik, 200); + } + if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorSadik) < 400) { + Actor_Set_Goal_Number(kActorSadik, 400); + } + if (Actor_Query_Goal_Number(kActorSadik) == 411) { + if (Game_Flag_Query(657)) { + Actor_Set_Goal_Number(kActorSadik, 412); + } + } + return false; } void AIScriptSadik::TimerExpired(int timer) { @@ -192,7 +195,7 @@ void AIScriptSadik::Retired(int byActorId) { Delay(2000); Player_Set_Combat_Mode(0); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, 1, 0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); Game_Flag_Reset(653); diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index e1f8feed19..c5c5b0cb3c 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -42,7 +42,7 @@ void AIScriptSteele::Initialize() { Actor_Put_In_Set(kActorSteele, kSetFreeSlotG); Actor_Set_At_Waypoint(kActorSteele, 39, 0); - Actor_Set_Goal_Number(kActorSteele, 0); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault); Actor_Clue_Acquire(kActorSteele, kClueCrimeSceneNotes, true, -1); } @@ -87,7 +87,7 @@ bool AIScriptSteele::Update() { } if (Actor_Query_Goal_Number(kActorSteele) == 11) { - Actor_Set_Goal_Number(kActorSteele, 0); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault); return true; } @@ -278,17 +278,17 @@ void AIScriptSteele::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorSteele, 11); break; - case 100: - if (Actor_Query_Goal_Number(kActorSteele) == 100) { //why is this here? double check? + case kGoalSteeleApprehendIzo: + if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleApprehendIzo) { //why is this here? double check? Player_Set_Combat_Mode(kActorMcCoy); - if (Actor_Query_Goal_Number(kActorIzo) != 199) { + if (Actor_Query_Goal_Number(kActorIzo) != kGoalIzoDie) { if (Actor_Query_In_Between_Two_Actors(kActorMcCoy, kActorSteele, kActorIzo)) { - Actor_Set_Goal_Number(kActorSteele, 125); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleIzoBlockedByMcCoy); } else if (Game_Flag_Query(kFlagIzoIsReplicant)) { - Actor_Set_Goal_Number(kActorSteele, 120); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleShootIzo); } else { - Actor_Set_Goal_Number(kActorSteele, 121); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleArrestIzo); } } } @@ -332,7 +332,7 @@ void AIScriptSteele::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorSteele, 433); Player_Set_Combat_Mode(kActorSteele); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, false, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(578); Set_Enter(kSetKP07, kSceneKP07); @@ -634,10 +634,10 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { } else { Actor_Clue_Acquire(kActorSteele, kClueGrigorianInterviewB2, true, kActorGrigorian); } - Actor_Set_Goal_Number(kActorSteele, 0); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault); return true; - case 100: + case kGoalSteeleApprehendIzo: AI_Movement_Track_Flush(kActorSteele); if (Game_Flag_Query(kFlagIzoIsReplicant)) { AI_Movement_Track_Append_Run(kActorSteele, 202, 0); @@ -727,92 +727,92 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { } return true; - case 120: + case kGoalSteeleShootIzo: Actor_Force_Stop_Walking(kActorMcCoy); Sound_Play(27, 100, 0, 0, 50); - Actor_Set_Goal_Number(kActorIzo, 199); - Actor_Change_Animation_Mode(kActorMcCoy, 0); - Actor_Face_Actor(kActorMcCoy, kActorSteele, 1); - Loop_Actor_Walk_To_Actor(kActorSteele, 0, 48, 0, 1); - Actor_Says(kActorSteele, 1860, 3); - Actor_Face_Actor(kActorMcCoy, kActorSteele, 1); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoDie); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); + Actor_Face_Actor(kActorMcCoy, kActorSteele, true); + Loop_Actor_Walk_To_Actor(kActorSteele, 0, 48, false, true); + Actor_Says(kActorSteele, 1860, kAnimationModeTalk); + Actor_Face_Actor(kActorMcCoy, kActorSteele, true); Actor_Says(kActorMcCoy, 4825, 18); - Actor_Face_Actor(kActorSteele, kActorMcCoy, 1); - Actor_Says(kActorSteele, 1870, 3); - Actor_Says(kActorSteele, 1880, 3); + Actor_Face_Actor(kActorSteele, kActorMcCoy, true); + Actor_Says(kActorSteele, 1870, kAnimationModeTalk); + Actor_Says(kActorSteele, 1880, kAnimationModeTalk); Actor_Says(kActorMcCoy, 4830, 13); - Actor_Says(kActorSteele, 1890, 3); - Actor_Says(kActorSteele, 1900, 3); - Actor_Face_Actor(kActorSteele, kActorIzo, 1); - Actor_Says(kActorSteele, 1910, 3); - Actor_Says(kActorSteele, 1920, 3); - Actor_Face_Actor(kActorMcCoy, kActorSteele, 1); - Actor_Face_Actor(kActorSteele, kActorMcCoy, 1); - Actor_Says(kActorSteele, 1930, 3); - Actor_Set_Goal_Number(kActorSteele, 130); + Actor_Says(kActorSteele, 1890, kAnimationModeTalk); + Actor_Says(kActorSteele, 1900, kAnimationModeTalk); + Actor_Face_Actor(kActorSteele, kActorIzo, true); + Actor_Says(kActorSteele, 1910, kAnimationModeTalk); + Actor_Says(kActorSteele, 1920, kAnimationModeTalk); + Actor_Face_Actor(kActorMcCoy, kActorSteele, true); + Actor_Face_Actor(kActorSteele, kActorMcCoy, true); + Actor_Says(kActorSteele, 1930, kAnimationModeTalk); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleLeaveRC03); Player_Gains_Control(); return true; - case 121: + case kGoalSteeleArrestIzo: Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Face_Actor(kActorSteele, kActorIzo, 1); - Actor_Change_Animation_Mode(kActorIzo, 0); - Actor_Face_Actor(kActorIzo, kActorSteele, 1); - Actor_Says_With_Pause(kActorSteele, 2010, 0.0, 4); - Actor_Change_Animation_Mode(kActorSteele, 4); - Loop_Actor_Walk_To_Actor(kActorSteele, kActorIzo, 60, 0, 0); - Actor_Change_Animation_Mode(kActorSteele, 4); + Actor_Face_Actor(kActorSteele, kActorIzo, true); + Actor_Change_Animation_Mode(kActorIzo, kAnimationModeIdle); + Actor_Face_Actor(kActorIzo, kActorSteele, true); + Actor_Says_With_Pause(kActorSteele, 2010, 0.0, kAnimationModeCombatIdle); + Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatIdle); + Loop_Actor_Walk_To_Actor(kActorSteele, kActorIzo, 60, false, false); + Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatIdle); _animationState = 23; _animationFrame = 0; - Actor_Says(kActorIzo, 660, 3); - Actor_Says_With_Pause(kActorSteele, 2020, 0.0f, 4); - Actor_Says_With_Pause(kActorSteele, 2030, 0.0f, 4); - Actor_Change_Animation_Mode(kActorSteele, 4); - Actor_Says(kActorIzo, 670, 3); - Actor_Says(kActorSteele, 2040, 4); - Actor_Says(kActorIzo, 680, 3); - Actor_Says(kActorSteele, 2050, 3); - Actor_Face_Actor(kActorSteele, kActorMcCoy, 1); - Actor_Says(kActorSteele, 2060, 3); - Actor_Says(kActorMcCoy, 4845, 3); - Actor_Says(kActorSteele, 2070, 3); - Actor_Says(kActorSteele, 2080, 3); - Actor_Face_Actor(kActorSteele, kActorIzo, 1); - Actor_Says(kActorSteele, 2090, 3); - Actor_Says_With_Pause(kActorSteele, 2100, 1.0f, 3); - Actor_Says(kActorIzo, 690, 3); - Actor_Says(kActorSteele, 2110, 3); - Actor_Says(kActorSteele, 2120, 3); - Actor_Face_Actor(kActorSteele, kActorMcCoy, 1); - Actor_Says(kActorSteele, 2140, 3); - Actor_Says(kActorMcCoy, 4850, 3); - Actor_Says(kActorSteele, 2150, 3); - Actor_Set_Goal_Number(kActorIzo, 120); - Actor_Set_Goal_Number(kActorSteele, 130); - Actor_Set_Goal_Number(kActorSteele, 0); - return true; - - case 125: + Actor_Says(kActorIzo, 660, kAnimationModeTalk); + Actor_Says_With_Pause(kActorSteele, 2020, 0.0f, kAnimationModeCombatIdle); + Actor_Says_With_Pause(kActorSteele, 2030, 0.0f, kAnimationModeCombatIdle); + Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatIdle); + Actor_Says(kActorIzo, 670, kAnimationModeTalk); + Actor_Says(kActorSteele, 2040, kAnimationModeCombatIdle); + Actor_Says(kActorIzo, 680, kAnimationModeTalk); + Actor_Says(kActorSteele, 2050, kAnimationModeTalk); + Actor_Face_Actor(kActorSteele, kActorMcCoy, true); + Actor_Says(kActorSteele, 2060, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 4845, kAnimationModeTalk); + Actor_Says(kActorSteele, 2070, kAnimationModeTalk); + Actor_Says(kActorSteele, 2080, kAnimationModeTalk); + Actor_Face_Actor(kActorSteele, kActorIzo, true); + Actor_Says(kActorSteele, 2090, kAnimationModeTalk); + Actor_Says_With_Pause(kActorSteele, 2100, 1.0f, kAnimationModeTalk); + Actor_Says(kActorIzo, 690, kAnimationModeTalk); + Actor_Says(kActorSteele, 2110, kAnimationModeTalk); + Actor_Says(kActorSteele, 2120, kAnimationModeTalk); + Actor_Face_Actor(kActorSteele, kActorMcCoy, true); + Actor_Says(kActorSteele, 2140, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 4850, kAnimationModeTalk); + Actor_Says(kActorSteele, 2150, kAnimationModeTalk); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoGetArrested); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleLeaveRC03); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleDefault); + return true; + + case kGoalSteeleIzoBlockedByMcCoy: Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Set_Goal_Number(kActorIzo, 114); - Actor_Says(kActorSteele, 1940, 3); - Loop_Actor_Walk_To_Actor(kActorSteele, 0, 60, 0, 1); - Actor_Face_Actor(kActorSteele, kActorMcCoy, 1); - Actor_Face_Actor(kActorMcCoy, kActorSteele, 1); - Actor_Says(kActorSteele, 1950, 3); + Actor_Set_Goal_Number(kActorIzo, kGoalIzoRC03RunAway); + Actor_Says(kActorSteele, 1940, kAnimationModeTalk); + Loop_Actor_Walk_To_Actor(kActorSteele, 0, 60, false, true); + Actor_Face_Actor(kActorSteele, kActorMcCoy, true); + Actor_Face_Actor(kActorMcCoy, kActorSteele, true); + Actor_Says(kActorSteele, 1950, kAnimationModeTalk); Actor_Says(kActorMcCoy, 4835, 14); - Actor_Says(kActorSteele, 1980, 3); + Actor_Says(kActorSteele, 1980, kAnimationModeTalk); Actor_Says(kActorMcCoy, 4840, 15); - Actor_Says(kActorSteele, 1990, 3); - Actor_Says(kActorSteele, 2000, 3); - Actor_Set_Goal_Number(kActorSteele, 130); + Actor_Says(kActorSteele, 1990, kAnimationModeTalk); + Actor_Says(kActorSteele, 2000, kAnimationModeTalk); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleLeaveRC03); Scene_Exits_Enable(); return true; case 126: return true; - case 130: + case kGoalSteeleLeaveRC03: AI_Movement_Track_Flush(kActorSteele); AI_Movement_Track_Append(kActorSteele, 174, 0); AI_Movement_Track_Append(kActorSteele, 35, 0); @@ -1899,7 +1899,7 @@ bool AIScriptSteele::UpdateAnimation(int *animation, int *frame) { bool AIScriptSteele::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kGoalSteeleDefault: if (Game_Flag_Query(603)) { _var1 = 3; } else { @@ -1951,7 +1951,9 @@ bool AIScriptSteele::ChangeAnimationMode(int mode) { case 1: if ((_animationState != 4 && _animationState != 23 && _animationState != 25 && _animationState != 26) || _animationState > 26) { - if (Actor_Query_Goal_Number(kActorSteele) != 100 && Actor_Query_Goal_Number(kActorSteele) != 121) { + if (Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleApprehendIzo + && Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleArrestIzo + ) { _animationState = 2; _animationFrame = 0; } else { @@ -1964,9 +1966,10 @@ bool AIScriptSteele::ChangeAnimationMode(int mode) { } break; case 2: - if (Actor_Query_Goal_Number(kActorSteele) != 100 - && Actor_Query_Goal_Number(kActorSteele) != 121 - && _animationState != 23) { + if (Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleApprehendIzo + && Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleArrestIzo + && _animationState != 23 + ) { _animationState = 3; _animationFrame = 0; } else { @@ -2187,7 +2190,7 @@ void AIScriptSteele::SetAnimationState(int animationState, int animationFrame, i bool AIScriptSteele::ReachedMovementTrackWaypoint(int waypointId) { if (waypointId == 174 - && Actor_Query_Goal_Number(kActorSteele) == 130 + && Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleLeaveRC03 ) Actor_Set_Goal_Number(kActorSteele, kGoalSteeleGoToPoliceStation); |