diff options
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/actor.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/clovis.cpp | 204 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/hanoi.cpp | 25 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/officer_grayford.cpp | 449 |
4 files changed, 324 insertions, 356 deletions
diff --git a/engines/bladerunner/actor.h b/engines/bladerunner/actor.h index f074b55314..e381f6818e 100644 --- a/engines/bladerunner/actor.h +++ b/engines/bladerunner/actor.h @@ -164,7 +164,7 @@ public: int getWalkbox() const { return _walkboxId; } bool isRetired() const { return _isRetired; } - bool isTarget() const { return true;/*return _isTarget; */} + bool isTarget() const { return _isTarget; } void setTarget(bool targetable); bool isImmuneToObstacles() const { return _isImmuneToObstacles; } bool inCombat() const { return _inCombat; } diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index e55fdb9468..58180f3699 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -56,24 +56,23 @@ bool AIScriptClovis::Update() { } else 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)) { + } else 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) != 1 || Game_Flag_Query(696) || Game_Flag_Query(697) != 1) { - return true; - } else { + 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; } - } else { - Game_Flag_Set(542); - Actor_Set_Goal_Number(kActorClovis, 400); - return true; + return false; } } @@ -83,11 +82,11 @@ void AIScriptClovis::TimerExpired(int timer) { void AIScriptClovis::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorClovis)) { - case 100: + case 101: Actor_Set_Goal_Number(kActorClovis, 103); break; - case 101: + case 102: Actor_Set_Goal_Number(kActorClovis, 102); break; @@ -114,7 +113,7 @@ void AIScriptClovis::ReceivedClue(int clueId, int fromActorId) { void AIScriptClovis::ClickedByPlayer() { if (Actor_Query_Goal_Number(kActorClovis) == 599) { - Actor_Face_Actor(kActorMcCoy, kActorClovis, 1); + Actor_Face_Actor(kActorMcCoy, kActorClovis, true); Actor_Says(kActorMcCoy, 8630, 16); } } @@ -132,14 +131,12 @@ void AIScriptClovis::OtherAgentExitedThisScene(int otherActorId) { } void AIScriptClovis::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { - if (Game_Flag_Query(653) != 1 || !Actor_Query_In_Set(kActorMcCoy, kSetKP07)) { - return; //false; + if (Game_Flag_Query(653) && Actor_Query_In_Set(kActorMcCoy, kSetKP07)) { + Game_Flag_Set(697); + Game_Flag_Set(714); + // return true; } - - Game_Flag_Set(697); - Game_Flag_Set(714); - - return; //true; + // return false; } void AIScriptClovis::ShotAtAndMissed() { @@ -152,14 +149,14 @@ bool AIScriptClovis::ShotAtAndHit() { ADQ_Flush(); Actor_Set_Goal_Number(kActorClovis, 599); shotAnim(); - Actor_Set_Targetable(kActorClovis, 0); + Actor_Set_Targetable(kActorClovis, false); ADQ_Add(kActorMcCoy, 2340, -1); Music_Stop(3); } else if (Actor_Query_Goal_Number(kActorClovis) == 513 || Actor_Query_Goal_Number(kActorClovis) == 518) { ADQ_Flush(); Actor_Set_Goal_Number(kActorClovis, 599); shotAnim(); - Actor_Set_Targetable(kActorClovis, 0); + Actor_Set_Targetable(kActorClovis, false); Music_Stop(3); } } @@ -167,7 +164,7 @@ bool AIScriptClovis::ShotAtAndHit() { } void AIScriptClovis::Retired(int byActorId) { - if (Game_Flag_Query(653) == 1) { + if (Game_Flag_Query(653)) { if (Actor_Query_In_Set(kActorClovis, kSetKP07)) { Global_Variable_Decrement(51, 1); Actor_Set_Goal_Number(kActorClovis, 599); @@ -175,8 +172,8 @@ void AIScriptClovis::Retired(int byActorId) { if (!Global_Variable_Query(51)) { 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); + 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_Looping_Sounds(1); Game_Flag_Set(579); @@ -188,40 +185,38 @@ void AIScriptClovis::Retired(int byActorId) { } int AIScriptClovis::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { - if (otherActorId != kActorMcCoy) + if (otherActorId != kActorMcCoy) { return 0; + } switch (clueId) { - case 212: - case 230: + case kClueMcCoyKilledRunciter1: + case kClueMcCoyKilledRunciter2: return 6; - break; - case 214: - case 239: - case 240: + case kClueMcCoyIsABladeRunner: + case kClueMcCoyIsStupid: + case kClueMcCoyIsAnnoying: return -2; - case 215: - case 217: - case 218: - case 219: - case 220: - case 221: - case 241: + case kClueMcCoyLetZubenEscape: + case kClueMcCoyHelpedIzoIzoIsAReplicant: + case kClueMcCoyHelpedDektora: + case kClueMcCoyHelpedLucy: + case kClueMcCoyHelpedGordo: + case kClueMcCoyShotGuzza: + case kClueMcCoyIsKind: return 4; - case 216: + case kClueMcCoyWarnedIzo: return 2; - case 222: + case kClueMcCoyRetiredZuben: return -3; - case 223: - case 224: + case kClueMcCoyRetiredLucy: + case kClueMcCoyRetiredDektora: return -10; - case 226: - case 227: - case 228: - case 242: + case kClueMcCoyRetiredSadik: + case kClueMcCoyShotZubenInTheBack: + case kClueMcCoyRetiredLutherLance: + case kClueMcCoyIsInsane: return -5; - default: - return 0; } return 0; } @@ -251,30 +246,30 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 103: Actor_Set_Goal_Number(kActorSadik, 107); Actor_Says(kActorClovis, 10, 15); - Actor_Says(kActorSadik, 0, 3); - Actor_Face_Actor(kActorClovis, kActorSadik, 1); + Actor_Says(kActorSadik, 0, kAnimationModeTalk); + Actor_Face_Actor(kActorClovis, kActorSadik, true); Actor_Says(kActorClovis, 20, 13); Actor_Says(kActorClovis, 30, 12); - Actor_Face_Actor(kActorSadik, kActorClovis, 1); - Actor_Says(kActorSadik, 10, 3); + Actor_Face_Actor(kActorSadik, kActorClovis, true); + Actor_Says(kActorSadik, 10, kAnimationModeTalk); Actor_Says(kActorClovis, 40, 17); - Actor_Says(kActorSadik, 20, 3); - Actor_Face_Actor(kActorClovis, 0, 1); - Actor_Face_Actor(kActorSadik, 0, 1); + Actor_Says(kActorSadik, 20, kAnimationModeTalk); + Actor_Face_Actor(kActorClovis, kActorMcCoy, true); + Actor_Face_Actor(kActorSadik, kActorMcCoy, true); Actor_Says(kActorClovis, 50, 14); - Actor_Change_Animation_Mode(kActorClovis, 53); + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); return true; case 105: Actor_Says(kActorClovis, 60, 30); - Actor_Says(kActorSadik, 30, 3); + Actor_Says(kActorSadik, 30, kAnimationModeTalk); Actor_Says(kActorClovis, 70, 30); Actor_Says(kActorClovis, 80, 30); Actor_Change_Animation_Mode(kActorClovis, 29); - Actor_Says(kActorSadik, 40, 3); - Actor_Says(kActorSadik, 50, 3); + Actor_Says(kActorSadik, 40, kAnimationModeTalk); + Actor_Says(kActorSadik, 50, kAnimationModeTalk); Actor_Says(kActorClovis, 90, 13); - Actor_Face_Current_Camera(5, 1); + Actor_Face_Current_Camera(5, true); Actor_Says(kActorClovis, 100, 17); Delay(1000); if (!Game_Flag_Query(48)) { @@ -343,7 +338,7 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 510: - if (Game_Flag_Query(653) == 1) { + if (Game_Flag_Query(653)) { Actor_Set_Goal_Number(kActorClovis, 513); } else { Actor_Set_Goal_Number(kActorClovis, 511); @@ -357,26 +352,26 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 512: - Actor_Says(kActorClovis, 110, 3); - Actor_Says(kActorMcCoy, 2255, 3); - Actor_Says(kActorClovis, 120, 3); - Actor_Says(kActorClovis, 130, 3); - Actor_Says(kActorClovis, 140, 3); - Actor_Says(kActorMcCoy, 2260, 3); - Actor_Says(kActorClovis, 150, 3); + Actor_Says(kActorClovis, 110, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2255, kAnimationModeTalk); + Actor_Says(kActorClovis, 120, kAnimationModeTalk); + Actor_Says(kActorClovis, 130, kAnimationModeTalk); + Actor_Says(kActorClovis, 140, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2260, kAnimationModeTalk); + Actor_Says(kActorClovis, 150, kAnimationModeTalk); Actor_Set_Goal_Number(kActorClovis, 513); return true; case 513: Actor_Put_In_Set(kActorClovis, kSetKP07); - Actor_Set_Targetable(kActorClovis, 1); - if (Game_Flag_Query(653) == 1) { + Actor_Set_Targetable(kActorClovis, true); + if (Game_Flag_Query(653)) { Global_Variable_Set(51, 0); Global_Variable_Increment(51, 1); Actor_Set_At_XYZ(kActorClovis, 45.0f, -41.52f, -85.0f, 750); } else { Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800); - Actor_Face_Heading(kActorClovis, 1022, 0); + Actor_Face_Heading(kActorClovis, 1022, false); } someAnim(); return true; @@ -384,15 +379,15 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 514: Actor_Says(kActorMcCoy, 2345, 16); Actor_Says(kActorClovis, 170, -1); - Actor_Says(kActorClovis, 180, 3); + Actor_Says(kActorClovis, 180, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2350, 17); if (!Game_Flag_Query(714)) { Actor_Says(kActorMcCoy, 2355, 11); } Actor_Says(kActorClovis, 190, -1); - Actor_Says(kActorClovis, 200, 3); + Actor_Says(kActorClovis, 200, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2360, 18); - Actor_Says(kActorClovis, 210, 3); + Actor_Says(kActorClovis, 210, kAnimationModeTalk); Actor_Says(kActorClovis, 220, -1); Actor_Set_Goal_Number(kActorClovis, 515); return true; @@ -409,15 +404,15 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 516: - Actor_Says(kActorMcCoy, 8501, 3); - Actor_Says(kActorClovis, 1260, 3); - Actor_Says(kActorMcCoy, 8502, 3); - Actor_Says(kActorClovis, 1270, 3); - Actor_Says(kActorMcCoy, 8504, 3); - Actor_Says(kActorClovis, 1290, 3); - Actor_Says(kActorMcCoy, 8505, 3); - Actor_Says(kActorClovis, 1300, 3); - Actor_Says(kActorClovis, 1310, 3); + Actor_Says(kActorMcCoy, 8501, kAnimationModeTalk); + Actor_Says(kActorClovis, 1260, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 8502, kAnimationModeTalk); + Actor_Says(kActorClovis, 1270, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 8504, kAnimationModeTalk); + Actor_Says(kActorClovis, 1290, kAnimationModeTalk); + 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_Looping_Sounds(1); Outtake_Play(20, 0, -1); @@ -461,8 +456,8 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 518: Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800); - Actor_Face_Heading(kActorClovis, 1022, 0); - Actor_Set_Targetable(kActorClovis, 1); + Actor_Face_Heading(kActorClovis, 1022, false); + Actor_Set_Targetable(kActorClovis, true); Game_Flag_Set(685); someAnim(); return true; @@ -702,7 +697,7 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { if (!_animationFrame && _flag) { _animationState = 2; _animationFrame = 0; - Actor_Change_Animation_Mode(kActorClovis, 53); + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); } else { _animationFrame++; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(241)) { @@ -1163,11 +1158,11 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { bool AIScriptClovis::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kAnimationModeIdle: if (!Game_Flag_Query(685)) { switch (_animationState) { case 2: - Actor_Change_Animation_Mode(kActorClovis, 53); + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); break; case 4: break; @@ -1199,17 +1194,17 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 1: + case kAnimationModeWalk: _animationState = 21; _animationFrame = 0; break; - case 2: + case kAnimationModeRun: _animationState = 22; _animationFrame = 0; break; - case 3: + case kAnimationModeTalk: case 9: if (Game_Flag_Query(685)) { _animationFrame = 0; @@ -1224,7 +1219,7 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { } break; - case 4: + case kAnimationModeCombatIdle: switch (_animationState) { case 13: case 14: @@ -1244,28 +1239,17 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { } break; - case 5: - case 18: - case 19: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - break; - - case 6: + case kAnimationModeCombatAttack: _animationState = 16; _animationFrame = 0; break; - case 7: + case kAnimationModeCombatWalk: _animationState = 21; _animationFrame = 0; break; - case 8: + case kAnimationModeCombatRun: _animationState = 22; _animationFrame = 0; break; @@ -1331,7 +1315,7 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 21: + case kAnimationModeHit: if ((unsigned int)(_animationState - 13) > 3) { if ((unsigned int)(_animationState - 32) > 8) { if (Random_Query(0, 1)) { @@ -1354,7 +1338,7 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { } break; - case 22: + case kAnimationModeCombatHit: if (Random_Query(0, 1)) { _animationState = 17; } else { @@ -1379,12 +1363,12 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { _animationFrame = Slice_Animation_Query_Number_Of_Frames(226) - 1; break; - case 48: + case kAnimationModeDie: _animationState = 41; _animationFrame = 0; break; - case 53: + case kAnimationModeSit: switch (_animationState) { case 4: case 5: @@ -1465,7 +1449,7 @@ void AIScriptClovis::someAnim() { switch (_animationState) { case 2: - Actor_Change_Animation_Mode(kActorClovis, 53); + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); break; case 4: break; diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp index 560f8f9639..4b88be7c5f 100644 --- a/engines/bladerunner/script/ai/hanoi.cpp +++ b/engines/bladerunner/script/ai/hanoi.cpp @@ -85,7 +85,7 @@ bool AIScriptHanoi::Update() { } void AIScriptHanoi::TimerExpired(int timer) { - if (!timer) { + if (timer == 0) { if (Actor_Query_Goal_Number(kActorHanoi) == 215) { Actor_Set_Goal_Number(kActorHanoi, 210); return; //true; @@ -604,7 +604,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { bool AIScriptHanoi::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kAnimationModeIdle: if ((unsigned int)(_animationState - 2) > 1) { _animationState = 0; } else { @@ -613,12 +613,12 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 1: + case kAnimationModeWalk: _animationState = 7; _animationFrame = 0; break; - case 3: + case kAnimationModeTalk: if (_animationState == 3) { _animationState = 4; _animationFrame = 0; @@ -629,12 +629,12 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { } break; - case 4: + case kAnimationModeCombatIdle: _animationState = 8; _animationFrame = 0; break; - case 6: + case kAnimationModeCombatAttack: _animationState = 10; _animationFrame = 0; break; @@ -675,15 +675,15 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { _animationState = 1; break; - case 21: - case 22: + case kAnimationModeHit: + case kAnimationModeCombatHit: _animationState = 12; _animationFrame = 0; break; case 23: if (_animationState != 3 && _animationState != 4) { - Actor_Set_Invisible(kActorMcCoy, 1); + Actor_Set_Invisible(kActorMcCoy, true); _animationState = 2; _animationFrame = 0; } else { @@ -692,7 +692,7 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { } break; - case 48: + case kAnimationModeDie: _animationState = 13; _animationFrame = 0; break; @@ -726,8 +726,9 @@ void AIScriptHanoi::SetAnimationState(int animationState, int animationFrame, in } bool AIScriptHanoi::ReachedMovementTrackWaypoint(int waypointId) { - if (waypointId == 365) - Actor_Face_Actor(kActorHanoi, kActorHysteriaPatron1, 1); + if (waypointId == 365) { + Actor_Face_Actor(kActorHanoi, kActorHysteriaPatron1, true); + } return true; } diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp index e68eb831fa..2d58cd574b 100644 --- a/engines/bladerunner/script/ai/officer_grayford.cpp +++ b/engines/bladerunner/script/ai/officer_grayford.cpp @@ -52,123 +52,118 @@ bool AIScriptOfficerGrayford::Update() { } else if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorOfficerGrayford) < 400) { AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 400); - } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) >= 110 - || Actor_Query_Goal_Number(kActorOfficerGrayford) <= 102 - || Game_Flag_Query(177)) { - if (Actor_Query_Goal_Number(kActorOfficerGrayford)) { - if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 10) { - AI_Movement_Track_Flush(kActorOfficerGrayford); - Actor_Set_Goal_Number(kActorOfficerGrayford, 0); - } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 102) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 103); - } else if (Game_Flag_Query(629) == 1) { - AI_Movement_Track_Unpause(67); - AI_Movement_Track_Unpause(68); - AI_Movement_Track_Unpause(69); - } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 310 - && Actor_Query_Which_Set_In(kActorOfficerGrayford) != Player_Query_Current_Set()) { - Non_Player_Actor_Combat_Mode_Off(24); - Actor_Set_Goal_Number(kActorOfficerGrayford, 305); - } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 599 - && Actor_Query_Which_Set_In(kActorOfficerGrayford) != Player_Query_Current_Set()) { - Actor_Set_Health(24, 50, 50); - Actor_Set_Goal_Number(kActorOfficerGrayford, 305); - } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 305) { - switch (Actor_Query_Which_Set_In(kActorOfficerGrayford)) { - case kSetRC03: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 18, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG01: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG04: - case kSetUG05: - case kSetUG06: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG08: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 13, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG10: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG12: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 16, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetUG14: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 17, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetMA07: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 7, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetNR01: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetDR01_DR02_DR04: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 0, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetBB01: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 1, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - - case kSetCT11: - if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(kActorOfficerGrayford, 310); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 5, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - - default: - return false; - } + } else if (!Game_Flag_Query(177) + && Actor_Query_Goal_Number(kActorOfficerGrayford) > 102 + && Actor_Query_Goal_Number(kActorOfficerGrayford) < 110) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 110); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 0) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 1); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 10) { + AI_Movement_Track_Flush(kActorOfficerGrayford); + Actor_Set_Goal_Number(kActorOfficerGrayford, 0); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 102) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 103); + } else if (Game_Flag_Query(629)) { + AI_Movement_Track_Unpause(kActorGenwalkerA); + AI_Movement_Track_Unpause(kActorGenwalkerB); + AI_Movement_Track_Unpause(kActorGenwalkerC); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 310 + && Actor_Query_Which_Set_In(kActorOfficerGrayford) != Player_Query_Current_Set()) { + Non_Player_Actor_Combat_Mode_Off(kActorOfficerGrayford); + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 599 + && Actor_Query_Which_Set_In(kActorOfficerGrayford) != Player_Query_Current_Set()) { + Actor_Set_Health(kActorOfficerGrayford, 50, 50); + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 305) { + switch (Actor_Query_Which_Set_In(kActorOfficerGrayford)) { + case kSetRC03: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 18, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); } - } else { - Actor_Set_Goal_Number(kActorOfficerGrayford, 1); + break; + + case kSetUG01: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 11, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetUG04: + case kSetUG05: + case kSetUG06: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 10, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetUG08: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 13, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetUG10: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 14, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetUG12: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 16, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetUG14: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 17, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetMA07: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 7, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetNR01: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 3, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetDR01_DR02_DR04: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 0, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetBB01: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 1, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + + case kSetCT11: + if (Actor_Query_Which_Set_In(kActorOfficerGrayford) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(kActorOfficerGrayford, 310); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 5, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); + } + break; + } - } else { - Actor_Set_Goal_Number(kActorOfficerGrayford, 110); } return false; } @@ -230,25 +225,26 @@ void AIScriptOfficerGrayford::CompletedMovementTrack() { AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); AI_Countdown_Timer_Start(kActorOfficerGrayford, 2, Random_Query(6, 12)); } - Actor_Face_Waypoint(kActorOfficerGrayford, 97, 1); - return; //false; + Actor_Face_Waypoint(kActorOfficerGrayford, 97, true); + // return false; + break; case 305: Actor_Set_Goal_Number(kActorOfficerGrayford, 306); break; case 307: - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 0, 1, 0, 12, 4, 7, 8, 0, -1, -1, 15, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateIdle, true, kActorMcCoy, 12, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false); break; case 308: - Actor_Change_Animation_Mode(kActorOfficerGrayford, 4); - Actor_Face_Actor(kActorOfficerGrayford, 0, 1); + Actor_Change_Animation_Mode(kActorOfficerGrayford, kAnimationModeCombatIdle); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); break; } - return; //true; + // return true; } void AIScriptOfficerGrayford::ReceivedClue(int clueId, int fromActorId) { @@ -260,8 +256,8 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 1: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); if (Random_Query(1, 2) == 1) { Actor_Says(kActorMcCoy, 5075, 14); } else { @@ -274,8 +270,8 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 2: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); if (Random_Query(1, 2) == 1) { Actor_Says(kActorMcCoy, 5075, 14); } else { @@ -288,8 +284,8 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 3: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); if (Random_Query(1, 2) == 1) { Actor_Says(kActorMcCoy, 5075, 14); } else { @@ -301,8 +297,8 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 4: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); if (Random_Query(1, 2) == 1) { Actor_Says(kActorMcCoy, 5075, 14); Actor_Says(kActorOfficerGrayford, 160, 13); @@ -316,7 +312,7 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 7: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); Actor_Says(kActorMcCoy, 4515, 14); Actor_Says(kActorOfficerGrayford, 330, 13); Actor_Set_Goal_Number(kActorOfficerGrayford, 7); @@ -325,31 +321,31 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { case 8: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Set_Goal_Number(kActorOfficerGrayford, 99); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); Actor_Says(kActorMcCoy, 5075, 13); Actor_Set_Goal_Number(kActorOfficerGrayford, 8); break; case 104: Actor_Set_Goal_Number(kActorOfficerGrayford, 199); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Says(kActorMcCoy, 1005, 3); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Says(kActorMcCoy, 1005, kAnimationModeTalk); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); if (_animationState == 35 || _animationState == 34) { _animationState = 37; _animationFrame = 0; } - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); Actor_Says(kActorOfficerGrayford, 190, 19); Actor_Set_Goal_Number(kActorOfficerGrayford, 104); break; case 105: Actor_Set_Goal_Number(kActorOfficerGrayford, 199); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Actor_Says(kActorMcCoy, 1005, 3); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Actor_Says(kActorMcCoy, 1005, kAnimationModeTalk); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); if (_animationState == 35 || _animationState == 34) { @@ -391,7 +387,7 @@ void AIScriptOfficerGrayford::ShotAtAndMissed() { bool AIScriptOfficerGrayford::ShotAtAndHit() { if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 307) - Actor_Set_Health(24, 50, 50); + Actor_Set_Health(kActorOfficerGrayford, 50, 50); return false; } @@ -411,69 +407,69 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 82, Random_Query(5, 20)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 2: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 76, Random_Query(10, 20)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 3: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 77, Random_Query(5, 15)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 4: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 78, Random_Query(5, 15)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 5: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 6: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 79, Random_Query(5, 15)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 7: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 80, 1); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 8: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 81, Random_Query(5, 15)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 9: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 82, Random_Query(5, 15)); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 101: Player_Loses_Control(); AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Put_In_Set(kActorOfficerGrayford, kSetDR01_DR02_DR04); Actor_Set_At_Waypoint(kActorOfficerGrayford, 110, 0); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); - Loop_Actor_Walk_To_Waypoint(kActorOfficerGrayford, 111, 0, 0, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); + Loop_Actor_Walk_To_Waypoint(kActorOfficerGrayford, 111, 0, false, true); _animationState = 23; _animationFrame = kActorMcCoy; - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); if (Game_Flag_Query(713)) { Actor_Set_Goal_Number(kActorMcCoy, 500); @@ -482,14 +478,14 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb Actor_Says(kActorMcCoy, 965, 18); _animationState = 24; } - break; + return true; case 102: - break; + return true; case 103: Actor_Says(kActorOfficerGrayford, 120, 19); - Actor_Says_With_Pause(kActorMcCoy, 970, 0.2, 13); + Actor_Says_With_Pause(kActorMcCoy, 970, 0.2f, 13); Actor_Says(kActorMcCoy, 975, 12); if (Actor_Clue_Query(kActorMcCoy, kClueMorajiInterview) == 1) { @@ -500,7 +496,7 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb Actor_Says_With_Pause(kActorOfficerGrayford, 140, 1.0f, 16); Actor_Says_With_Pause(kActorOfficerGrayford, 150, 0.0f, 17); Actor_Says(kActorOfficerGrayford, 160, 15); - Actor_Says_With_Pause(kActorMcCoy, 995, 0.30000001, 14); + Actor_Says_With_Pause(kActorMcCoy, 995, 0.3f, 14); } Player_Gains_Control(); @@ -514,26 +510,26 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb Actor_Change_Animation_Mode(kActorOfficerGrayford, 43); if (Player_Query_Current_Scene() == 28) { - Actor_Says(kActorOfficerGrayford, 170, 3); + Actor_Says(kActorOfficerGrayford, 170, kAnimationModeTalk); } - break; + return true; case 104: AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 112, 0); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 105: AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 113, 0); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 106: - Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, 1); + Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); Actor_Says(kActorMcCoy, 1000, 14); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); @@ -543,16 +539,11 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb _animationFrame = 0; } - Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, 1); + Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true); Actor_Says(kActorOfficerGrayford, 180, 18); Actor_Set_Goal_Number(kActorOfficerGrayford, currentGoalNumber); break; - case 107: - case 108: - case 109: - return false; - case 110: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 0); @@ -560,29 +551,15 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Flush(kActorMoraji); AI_Movement_Track_Append(kActorMoraji, 41, 0); AI_Movement_Track_Repeat(kActorMoraji); - break; + return true; case 300: Actor_Set_Goal_Number(kActorOfficerGrayford, 305); - break; - - case 301: - case 302: - case 303: - case 304: - return false; + return true; case 305: AI_Movement_Track_Flush(kActorOfficerGrayford); switch (Random_Query(1, 10)) { - case 0: - // same as case 308 - AI_Movement_Track_Flush(kActorOfficerGrayford); - AI_Movement_Track_Append_Run(kActorOfficerGrayford, 440, 0); - AI_Movement_Track_Append_Run(kActorOfficerGrayford, 441, 0); - AI_Movement_Track_Repeat(kActorOfficerGrayford); - return true; - case 1: AI_Movement_Track_Append(kActorOfficerGrayford, 398, 15); AI_Movement_Track_Append(kActorOfficerGrayford, 399, 0); @@ -592,7 +569,8 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 403, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 404, 15); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 2: AI_Movement_Track_Append(kActorOfficerGrayford, 385, 10); @@ -600,7 +578,8 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 386, 2); AI_Movement_Track_Append(kActorOfficerGrayford, 387, 15); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 3: AI_Movement_Track_Append(kActorOfficerGrayford, 390, 10); @@ -609,7 +588,8 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 345, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 393, 15); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 4: AI_Movement_Track_Append(kActorOfficerGrayford, 381, 15); @@ -619,14 +599,16 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 384, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 5: AI_Movement_Track_Append(kActorOfficerGrayford, 388, 10); AI_Movement_Track_Append(kActorOfficerGrayford, 389, 10); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 6: AI_Movement_Track_Append(kActorOfficerGrayford, 385, 10); @@ -634,7 +616,8 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 386, 2); AI_Movement_Track_Append(kActorOfficerGrayford, 387, 15); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 7: AI_Movement_Track_Append(kActorOfficerGrayford, 394, 15); @@ -646,7 +629,8 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 430, 15); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; // and go to case 306 + Actor_Set_Goal_Number(kActorOfficerGrayford, 305); + return true; case 8: switch (Random_Query(1, 7)) { @@ -706,18 +690,19 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 406, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); - return true; - - default: return false; + } // fall through + // TODO bug in the game? there should be nothing track related after AI_Movement_Track_Repeat case 9: - if (Random_Query(1, 2) - 1 == 2) { + if (Random_Query(0, 1)) { AI_Movement_Track_Append(kActorOfficerGrayford, 433, 10); AI_Movement_Track_Append(kActorOfficerGrayford, 434, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 435, 0); + AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); + AI_Movement_Track_Repeat(kActorOfficerGrayford); } else { AI_Movement_Track_Append(kActorOfficerGrayford, 420, 10); AI_Movement_Track_Append(kActorOfficerGrayford, 422, 2); @@ -726,54 +711,59 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb AI_Movement_Track_Append(kActorOfficerGrayford, 420, 10); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); + // TODO bug in the game? Same code bellow looks like a case 10 and are from set 84 whereas upper one are from set 81 AI_Movement_Track_Append(kActorOfficerGrayford, 310, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 307, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 309, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 310, 0); + AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); + AI_Movement_Track_Repeat(kActorOfficerGrayford); } + return false; + + case 10: + AI_Movement_Track_Append(kActorOfficerGrayford, 310, 0); + AI_Movement_Track_Append(kActorOfficerGrayford, 307, 0); + AI_Movement_Track_Append(kActorOfficerGrayford, 309, 0); + AI_Movement_Track_Append(kActorOfficerGrayford, 310, 0); AI_Movement_Track_Append(kActorOfficerGrayford, 35, 30); AI_Movement_Track_Repeat(kActorOfficerGrayford); return false; - default: - return false; } - // fall through + return false; case 306: Actor_Set_Goal_Number(kActorOfficerGrayford, 305); - break; + return true; case 307: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append_With_Facing(kActorOfficerGrayford, 419, 0, 512); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 308: AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append_Run(kActorOfficerGrayford, 440, 0); AI_Movement_Track_Append_Run(kActorOfficerGrayford, 441, 0); AI_Movement_Track_Repeat(kActorOfficerGrayford); - break; + return true; case 399: AI_Movement_Track_Flush(kActorOfficerGrayford); Actor_Put_In_Set(kActorOfficerGrayford, kSetTB02_TB03); Actor_Set_At_XYZ(kActorOfficerGrayford, -173.89f, 0.0f, 2084.22f, 859); - Actor_Change_Animation_Mode(kActorOfficerGrayford, 4); - break; + Actor_Change_Animation_Mode(kActorOfficerGrayford, kAnimationModeCombatIdle); + return true; case 599: _animationState = 32; _animationFrame = Slice_Animation_Query_Number_Of_Frames(624) - 1; - break; - - default: - return false; + return true; } - return true; + return false; } bool AIScriptOfficerGrayford::UpdateAnimation(int *animation, int *frame) { @@ -971,7 +961,7 @@ bool AIScriptOfficerGrayford::UpdateAnimation(int *animation, int *frame) { } else { snd = 9015; } - Sound_Play_Speech_Line(24, snd, 75, 0, 99); + Sound_Play_Speech_Line(kActorOfficerGrayford, snd, 75, 0, 99); } if (_animationFrame == 5) { Actor_Combat_AI_Hit_Attempt(kActorOfficerGrayford); @@ -1146,7 +1136,7 @@ bool AIScriptOfficerGrayford::UpdateAnimation(int *animation, int *frame) { bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kAnimationModeIdle: switch (_animationState) { case 9: case 10: @@ -1173,13 +1163,14 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { _animationState = 21; _animationFrame = 0; break; + case 20: case 21: case 34: case 35: case 36: case 37: - return 1; + return true; default: _animationState = 0; @@ -1188,7 +1179,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 1: + case kAnimationModeWalk: if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 101) { _animationState = 6; _animationFrame = 0; @@ -1198,7 +1189,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 2: + case kAnimationModeRun: if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 101) { _animationState = 5; _animationFrame = 0; @@ -1208,7 +1199,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 3: + case kAnimationModeTalk: if (_animationState != 36 && _animationState != 34) { _animationState = 9; _animationFrame = 0; @@ -1216,7 +1207,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 4: + case kAnimationModeCombatIdle: switch (_animationState) { case 5: case 6: @@ -1230,7 +1221,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { case 20: case 22: case 24: - return 1; + return true; case 23: _animationState = 24; @@ -1243,32 +1234,26 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 5: + case kAnimationModeCombatAim: _animationState = 23; _animationFrame = 0; break; - case 6: + case kAnimationModeCombatAttack: _animationFrame = 0; _animationState = 22; break; - case 7: + case kAnimationModeCombatWalk: _animationState = 6; _animationFrame = 0; break; - case 8: + case kAnimationModeCombatRun: _animationState = 5; _animationFrame = 0; break; - case 9: - case 10: - case 11: - case 20: - return 1; - case 12: _animationState = 10; _animationFrame = 0; @@ -1317,7 +1302,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { _var2 = 0; break; - case 21: + case kAnimationModeHit: switch (_animationState) { case 19: case 20: @@ -1345,7 +1330,7 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { } break; - case 22: + case kAnimationModeCombatHit: if (Random_Query(0, 1)) { _animationState = 27; } else { @@ -1359,27 +1344,27 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - case 44: + case kAnimationModeWalkUp: _animationState = 3; _animationFrame = 0; break; - case 45: + case kAnimationModeWalkDown: _animationState = 4; _animationFrame = 0; break; - case 46: + case kAnimationModeCombatWalkUp: _animationState = 7; _animationFrame = 0; break; - case 47: + case kAnimationModeCombatWalkDown: _animationState = 7; _animationFrame = 0; break; - case 48: + case kAnimationModeDie: switch (_animationState) { case 0: case 1: @@ -1407,8 +1392,6 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) { _animationFrame = 0; break; - default: - return 1; } return true; |