diff options
author | Peter Kohaut | 2019-01-25 21:51:44 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-25 23:16:24 +0100 |
commit | 474e4e2f0914a106e02dac2779d58f990e119bf9 (patch) | |
tree | 82eb370f7ff7343449089f0b3d8812fbccfea0cd /engines/bladerunner/script/ai | |
parent | a1f608cebb41beba2df85ca4dfc87da27d794651 (diff) | |
download | scummvm-rg350-474e4e2f0914a106e02dac2779d58f990e119bf9.tar.gz scummvm-rg350-474e4e2f0914a106e02dac2779d58f990e119bf9.tar.bz2 scummvm-rg350-474e4e2f0914a106e02dac2779d58f990e119bf9.zip |
BLADERUNNER: Cleanup of BBxx scripts
Removed issue where McCoy went to jail for no reason at start of 3rd act
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r-- | engines/bladerunner/script/ai/bryant.cpp | 17 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/bullet_bob.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/clovis.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/general_doll.cpp | 73 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 120 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/sadik.cpp | 184 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/sebastian.cpp | 5 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 3 |
8 files changed, 229 insertions, 185 deletions
diff --git a/engines/bladerunner/script/ai/bryant.cpp b/engines/bladerunner/script/ai/bryant.cpp index 74e5e2005e..bedb19de63 100644 --- a/engines/bladerunner/script/ai/bryant.cpp +++ b/engines/bladerunner/script/ai/bryant.cpp @@ -45,17 +45,26 @@ void AIScriptBryant::Initialize() { World_Waypoint_Set(333, kSetBB12, -34.0f, 0.0f, 33.0f); World_Waypoint_Set(334, kSetBB05, 3.0f, -60.30f, -144.0f); World_Waypoint_Set(335, kSetBB12, -50.0f, 0.0f, 212.0f); + Actor_Put_In_Set(kActorBryant, kSetBB05); + Actor_Set_Goal_Number(kActorBryant, 100); } bool AIScriptBryant::Update() { - if (Global_Variable_Query(kVariableChapter) == 2 && Actor_Query_Goal_Number(kActorBryant) <= 101 && Player_Query_Current_Scene() == kSceneBB05) { + if (Global_Variable_Query(kVariableChapter) == 2 + && Actor_Query_Goal_Number(kActorBryant) <= 101 + && Player_Query_Current_Scene() == kSceneBB05 + ) { Actor_Set_Goal_Number(kActorBryant, 101); return true; } - if (Global_Variable_Query(kVariableChapter) == 3 && Player_Query_Current_Scene() == kSceneBB05 && !Game_Flag_Query(686)) { - Game_Flag_Set(686); + + if ( Global_Variable_Query(kVariableChapter) == 3 + && Player_Query_Current_Scene() == kSceneBB05 + && !Game_Flag_Query(kFlagNotUsed686) + ) { + Game_Flag_Set(kFlagNotUsed686); return true; } return false; @@ -250,7 +259,7 @@ bool AIScriptBryant::ChangeAnimationMode(int mode) { _animationState = 1; _animationFrame = 0; break; - case 48: + case kAnimationModeDie: _animationState = 2; _animationFrame = 0; Actor_Set_Goal_Number(kActorBryant, 0); diff --git a/engines/bladerunner/script/ai/bullet_bob.cpp b/engines/bladerunner/script/ai/bullet_bob.cpp index 439431d2d4..1c1730c7d5 100644 --- a/engines/bladerunner/script/ai/bullet_bob.cpp +++ b/engines/bladerunner/script/ai/bullet_bob.cpp @@ -145,7 +145,7 @@ bool AIScriptBulletBob::ShotAtAndHit() { Actor_Set_Goal_Number(kActorBulletBob, 99); _animationFrame = 0; _animationState = 3; - Ambient_Sounds_Play_Speech_Sound(2, 9000, 100, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGordo, 9000, 100, 0, 0, 0); // not a typo, it's really from Gordo Actor_Face_Heading(kActorBulletBob, 281, false); } diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index 6f4d0bfd3d..d95c0e501e 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -272,19 +272,19 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Face_Current_Camera(5, true); Actor_Says(kActorClovis, 100, 17); Delay(1000); - if (!Game_Flag_Query(48)) { + if (!Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Clue_Acquire(kActorMcCoy, kClueStaggeredbyPunches, true, kActorSadik); } - Game_Flag_Set(383); - Game_Flag_Reset(509); + Game_Flag_Set(kFlagNotUsed383); + Game_Flag_Reset(kFlagBB11SadikFight); Global_Variable_Set(kVariableChapter, 3); Actor_Set_Goal_Number(kActorClovis, 200); Actor_Set_Goal_Number(kActorSadik, 200); Actor_Clue_Acquire(kActorMcCoy, kClueAct2Ended, true, -1); Player_Gains_Control(); Chapter_Enter(3, kSetCT08_CT51_UG12, kSceneCT08); - Game_Flag_Set(550); - Game_Flag_Set(679); + Game_Flag_Set(kFlagMcCoyTiedDown); + Game_Flag_Set(kFlagChapter3Intro); return true; case 300: diff --git a/engines/bladerunner/script/ai/general_doll.cpp b/engines/bladerunner/script/ai/general_doll.cpp index 7fdc9b0ba0..729bac22ed 100644 --- a/engines/bladerunner/script/ai/general_doll.cpp +++ b/engines/bladerunner/script/ai/general_doll.cpp @@ -38,62 +38,60 @@ void AIScriptGeneralDoll::Initialize() { Actor_Put_In_Set(kActorGeneralDoll, kSetFreeSlotG); Actor_Set_At_Waypoint(kActorGeneralDoll, 39, 0); + Actor_Set_Goal_Number(kActorGeneralDoll, 100); } bool AIScriptGeneralDoll::Update() { if (Global_Variable_Query(kVariableChapter) == 2 - && Actor_Query_Goal_Number(kActorGeneralDoll) <= 101 - && Player_Query_Current_Scene() == kSceneBB05) { + && Actor_Query_Goal_Number(kActorGeneralDoll) <= 101 + && Player_Query_Current_Scene() == kSceneBB05 + ) { Actor_Set_Goal_Number(kActorGeneralDoll, 101); - } else if (Global_Variable_Query(kVariableChapter) != 3 || Actor_Query_Goal_Number(kActorGeneralDoll) >= 200) { - return false; + return true; } - return true; + if (Global_Variable_Query(kVariableChapter) == 3 + && Actor_Query_Goal_Number(kActorGeneralDoll) < 200 + ) { + return true; + } + + return false; } void AIScriptGeneralDoll::TimerExpired(int timer) { - if (timer != 2) - return; //false; - - Actor_Change_Animation_Mode(kActorMcCoy, 48); - Actor_Change_Animation_Mode(kActorGeneralDoll, 48); - AI_Countdown_Timer_Reset(kActorGeneralDoll, 2); - - return; //true; + if (timer == 2) { + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); + Actor_Change_Animation_Mode(kActorGeneralDoll, kAnimationModeDie); + AI_Countdown_Timer_Reset(kActorGeneralDoll, 2); + return; //true; + } + return; //false; } void AIScriptGeneralDoll::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorGeneralDoll)) { - case 200: - Actor_Set_Goal_Number(kActorGeneralDoll, 201); - return; //true; - - case 201: - Actor_Set_Goal_Number(kActorGeneralDoll, 200); - return; //true; - case 101: if (Player_Query_Current_Scene() == 6) { switch (Random_Query(0, 5)) { case 0: - Ambient_Sounds_Play_Speech_Sound(58, 0, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 0, 80, 0, 0, 0); break; case 1: - Ambient_Sounds_Play_Speech_Sound(58, 10, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 10, 80, 0, 0, 0); break; case 2: - Ambient_Sounds_Play_Speech_Sound(58, 20, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 20, 80, 0, 0, 0); break; case 3: - Ambient_Sounds_Play_Speech_Sound(58, 30, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 30, 80, 0, 0, 0); break; case 4: - Ambient_Sounds_Play_Speech_Sound(58, 40, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 40, 80, 0, 0, 0); break; case 5: - Ambient_Sounds_Play_Speech_Sound(58, 50, 80, 0, 0, 0); + Ambient_Sounds_Play_Speech_Sound(kActorGeneralDoll, 50, 80, 0, 0, 0); break; } Actor_Set_Goal_Number(kActorGeneralDoll, 102); @@ -110,6 +108,13 @@ void AIScriptGeneralDoll::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorGeneralDoll, 101); return; //true; + case 200: + Actor_Set_Goal_Number(kActorGeneralDoll, 201); + return; //true; + + case 201: + Actor_Set_Goal_Number(kActorGeneralDoll, 200); + return; //true; } return; //false @@ -120,7 +125,7 @@ void AIScriptGeneralDoll::ReceivedClue(int clueId, int fromActorId) { } void AIScriptGeneralDoll::ClickedByPlayer() { - Actor_Face_Actor(kActorMcCoy, kActorGeneralDoll, 1); + Actor_Face_Actor(kActorMcCoy, kActorGeneralDoll, true); Actor_Voice_Over(30, kActorVoiceOver); Actor_Voice_Over(40, kActorVoiceOver); } @@ -147,13 +152,15 @@ void AIScriptGeneralDoll::ShotAtAndMissed() { bool AIScriptGeneralDoll::ShotAtAndHit() { AI_Movement_Track_Flush(kActorGeneralDoll); - Global_Variable_Increment(25, 1); - if (!Game_Flag_Query(399) && Global_Variable_Query(25) == 1) { + Global_Variable_Increment(kVariableGeneralDollShot, 1); + if (!Game_Flag_Query(kFlagGeneralDollShot) + && Global_Variable_Query(kVariableGeneralDollShot) == 1 + ) { Sound_Play(121, 100, 0, 0, 50); - Game_Flag_Set(399); + Game_Flag_Set(kFlagGeneralDollShot); Actor_Set_Goal_Number(kActorGeneralDoll, 104); - ChangeAnimationMode(48); - Actor_Set_Targetable(kActorGeneralDoll, 0); + ChangeAnimationMode(kAnimationModeDie); + Actor_Set_Targetable(kActorGeneralDoll, false); } return false; diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 0f8843af61..12e58b85cf 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -599,7 +599,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { dword_45A0DC = 0; _animationState = 0; Player_Gains_Control(); - Item_Add_To_World(109, 982, kSetCT08_CT51_UG12, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); + Item_Add_To_World(kItemChair, 982, kSetCT08_CT51_UG12, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); } break; case 58: @@ -627,7 +627,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(46)) { _animationFrame = 0; } - if (!Game_Flag_Query(550)) { + if (!Game_Flag_Query(kFlagMcCoyTiedDown)) { _animationFrame = 0; _animationState = 59; *animation = 48; @@ -1230,52 +1230,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { bool AIScriptMcCoy::ChangeAnimationMode(int mode) { switch (mode) { case kAnimationModeIdle: - if (!Game_Flag_Query(550)) { - switch (_animationState) { - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - Game_Flag_Set(kFlagMcCoyAnimation1); - dword_45A0D8 = 0; - dword_45A0DC = 30; - dword_45A0E4 = 0; - _animationFrameDelta = 1; - dword_45A0E8 = 3; - return true; - case 14: - case 17: - case 20: - case 21: - case 36: - _animationState = 16; - _animationFrame = 0; - return true; - case 15: - _animationState = 16; - _animationFrame = 16 - ((16 * _animationFrame) / 12); - return true; - case 16: - case 25: - case 26: - case 55: - return true; - case 60: - _animationState = 61; - return true; - default: - _animationState = 0; - _animationFrame = 0; - dword_45A0DC = 0; - return true; - } - } else { + if (Game_Flag_Query(kFlagMcCoyTiedDown)) { if (_animationFrame <= 6) { int random = Random_Query(0, 2); int soundId = 0; @@ -1292,25 +1247,74 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationFrame = 0; return true; } + switch (_animationState) { + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + Game_Flag_Set(kFlagMcCoyAnimation1); + dword_45A0D8 = 0; + dword_45A0DC = 30; + dword_45A0E4 = 0; + _animationFrameDelta = 1; + dword_45A0E8 = 3; + return true; + case 14: + case 17: + case 20: + case 21: + case 36: + _animationState = 16; + _animationFrame = 0; + return true; + case 15: + _animationState = 16; + _animationFrame = 16 - ((16 * _animationFrame) / 12); + return true; + case 16: + case 25: + case 26: + case 55: + return true; + case 60: + _animationState = 61; + return true; + default: + _animationState = 0; + _animationFrame = 0; + dword_45A0DC = 0; + return true; + } + break; case kAnimationModeWalk: - if (_animationState != 27 && _animationState != 50) { - if (!Game_Flag_Query(550)) { - _animationState = 32; + if (_animationState != 27 + && _animationState != 50 + ) { + if (Game_Flag_Query(kFlagMcCoyTiedDown)) { + _animationState = 58; _animationFrame = 0; } else { - _animationState = 58; + _animationState = 32; _animationFrame = 0; } } break; case kAnimationModeRun: - if (_animationState != 27 && _animationState != 50) { - if (!Game_Flag_Query(550)) { - _animationState = 31; - _animationFrame = 0; - } else { + if (_animationState != 27 + && _animationState != 50 + ) { + if (Game_Flag_Query(kFlagMcCoyTiedDown)) { _animationState = 58; _animationFrame = 4; + } else { + _animationState = 31; + _animationFrame = 0; } } break; @@ -1702,7 +1706,7 @@ void AIScriptMcCoy::sub_4054F0() { } void AIScriptMcCoy::sub_405660() { - if (Game_Flag_Query(550)) { + if (Game_Flag_Query(kFlagMcCoyTiedDown)) { if (_animationFrame <= 6) { int v1 = Random_Query(0, 2); int v2 = 0; diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index 353a926eec..be81315d03 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -50,13 +50,13 @@ void AIScriptSadik::Initialize() { } bool AIScriptSadik::Update() { - if (Global_Variable_Query(kVariableChapter) == 2 - && Player_Query_Current_Scene() == kSceneBB09 - && !Game_Flag_Query(391) + if ( Global_Variable_Query(kVariableChapter) == 2 + && Player_Query_Current_Scene() == kSceneBB09 + && !Game_Flag_Query(kFlagBB09SadikRun) ) { Actor_Set_Goal_Number(kActorSadik, 101); Actor_Set_Targetable(kActorSadik, true); - Game_Flag_Set(391); + Game_Flag_Set(kFlagBB09SadikRun); Game_Flag_Set(kFlagUnused406); return true; } @@ -65,12 +65,19 @@ bool AIScriptSadik::Update() { Sound_Play(_var1, 100, 0, 0, 50); _var1 = 0; } - if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorSadik) < 200) { + + 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) { + + 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); @@ -80,7 +87,7 @@ bool AIScriptSadik::Update() { } void AIScriptSadik::TimerExpired(int timer) { - if (!timer) { + if (timer == 0) { AI_Countdown_Timer_Reset(kActorSadik, 0); switch (Actor_Query_Goal_Number(kActorSadik)) { @@ -101,10 +108,6 @@ void AIScriptSadik::TimerExpired(int timer) { void AIScriptSadik::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorSadik)) { - case 301: - Actor_Set_Goal_Number(kActorSadik, 302); - break; - case 101: Actor_Set_Goal_Number(kActorSadik, 102); break; @@ -117,6 +120,10 @@ void AIScriptSadik::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorSadik, 106); break; + case 301: + Actor_Set_Goal_Number(kActorSadik, 302); + break; + default: return; //false; } @@ -130,7 +137,7 @@ void AIScriptSadik::ReceivedClue(int clueId, int fromActorId) { void AIScriptSadik::ClickedByPlayer() { if (Actor_Query_Goal_Number(kActorSadik) == 599) { - Actor_Face_Actor(kActorMcCoy, kActorSadik, 1); + Actor_Face_Actor(kActorMcCoy, kActorSadik, true); Actor_Says(kActorMcCoy, 8580, 16); } } @@ -152,9 +159,11 @@ void AIScriptSadik::OtherAgentEnteredCombatMode(int otherActorId, int combatMode } void AIScriptSadik::ShotAtAndMissed() { - if (Actor_Query_Goal_Number(kActorSadik) == 414 || Actor_Query_Goal_Number(kActorSadik) == 416) { + if (Actor_Query_Goal_Number(kActorSadik) == 414 + || Actor_Query_Goal_Number(kActorSadik) == 416 + ) { Game_Flag_Set(714); - if (Actor_Query_Which_Set_In(kActorSadik) != 48) { + if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) { Actor_Set_Goal_Number(kActorSadik, 418); Scene_Exits_Disable(); } @@ -162,30 +171,37 @@ void AIScriptSadik::ShotAtAndMissed() { } bool AIScriptSadik::ShotAtAndHit() { + if (Actor_Query_Goal_Number(kActorSadik) == 301) { - if (Game_Flag_Query(48)) { + if (Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Set_Health(kActorSadik, 60, 60); } else { Actor_Set_Health(kActorSadik, 40, 40); } return true; - } else { - if (Actor_Query_Goal_Number(kActorSadik) == 414 || Actor_Query_Goal_Number(kActorSadik) == 416) { - Game_Flag_Set(714); - if (Actor_Query_Which_Set_In(kActorSadik) != 48) { - Actor_Set_Goal_Number(kActorSadik, 418); - Scene_Exits_Disable(); - } + } + + if (Actor_Query_Goal_Number(kActorSadik) == 414 + || Actor_Query_Goal_Number(kActorSadik) == 416 + ) { + Game_Flag_Set(714); + if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) { + Actor_Set_Goal_Number(kActorSadik, 418); + Scene_Exits_Disable(); } - return false; } + return false; } void AIScriptSadik::Retired(int byActorId) { - if ((Actor_Query_Goal_Number(kActorSadik) == 418 || Actor_Query_Goal_Number(kActorSadik) == 450) - && Actor_Query_Which_Set_In(kActorSadik) != 48) { + if ((Actor_Query_Goal_Number(kActorSadik) == 418 + || Actor_Query_Goal_Number(kActorSadik) == 450 + ) + && Actor_Query_Which_Set_In(kActorSadik) != kSetKP07 + ) { Scene_Exits_Enable(); } + if (Actor_Query_In_Set(kActorSadik, kSetKP07)) { Global_Variable_Decrement(kVariableReplicants, 1); Actor_Set_Goal_Number(kActorSadik, 599); @@ -193,8 +209,8 @@ void AIScriptSadik::Retired(int byActorId) { 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); + 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(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); @@ -233,7 +249,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 313, 0); AI_Movement_Track_Repeat(kActorSadik); - Game_Flag_Set(509); + Game_Flag_Set(kFlagBB11SadikFight); return true; case 103: @@ -241,7 +257,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Face_Heading(kActorSadik, kActorMcCoy, kActorMcCoy); _animationState = 32; _animationFrame = -1; - Actor_Change_Animation_Mode(kActorMcCoy, 48); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); return true; case 104: @@ -280,7 +296,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 301: - Actor_Set_Targetable(kActorSadik, 1); + Actor_Set_Targetable(kActorSadik, true); World_Waypoint_Set(436, 89, -356.11f, 0.0f, 652.42f); AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append_Run(kActorSadik, 436, 0); @@ -288,7 +304,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 302: - Actor_Set_Targetable(kActorSadik, 0); + Actor_Set_Targetable(kActorSadik, false); return true; case 303: @@ -297,7 +313,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 304: - Actor_Set_Targetable(kActorSadik, 0); + Actor_Set_Targetable(kActorSadik, false); AI_Countdown_Timer_Reset(kActorSadik, 0); return true; @@ -314,10 +330,10 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 308: if (Player_Query_Current_Scene() == 102) { Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Change_Animation_Mode(kActorSadik, 6); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack); Sound_Play(12, 100, 0, 0, 50); - Actor_Change_Animation_Mode(kActorMcCoy, 48); - Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); + Actor_Retired_Here(kActorMcCoy, 6, 6, true, -1); } return true; @@ -357,8 +373,8 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 413: - Loop_Actor_Walk_To_XYZ(kActorSadik, -1062.0f, 0.0f, 219.0f, 0, 0, 1, 0); - Actor_Set_Targetable(kActorSadik, 1); + Loop_Actor_Walk_To_XYZ(kActorSadik, -1062.0f, 0.0f, 219.0f, 0, false, true, 0); + Actor_Set_Targetable(kActorSadik, true); Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false); Actor_Set_Goal_Number(kActorSadik, 450); return true; @@ -366,49 +382,49 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 414: Actor_Put_In_Set(kActorSadik, kSetKP05_KP06); Actor_Set_At_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 150); - Actor_Set_Targetable(kActorSadik, 1); + Actor_Set_Targetable(kActorSadik, true); return true; case 415: - Actor_Says(kActorSadik, 110, 3); - Actor_Says(kActorMcCoy, 2290, 3); - Actor_Says(kActorSadik, 310, 3); - Actor_Says(kActorMcCoy, 2300, 3); - if (Game_Flag_Query(48)) { - Actor_Says(kActorSadik, 180, 3); - Actor_Says(kActorSadik, 190, 3); - Actor_Says(kActorMcCoy, 2310, 3); - Actor_Says(kActorSadik, 200, 3); + Actor_Says(kActorSadik, 110, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2290, kAnimationModeTalk); + Actor_Says(kActorSadik, 310, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2300, kAnimationModeTalk); + if (Game_Flag_Query(kFlagSadikIsReplicant)) { + Actor_Says(kActorSadik, 180, kAnimationModeTalk); + Actor_Says(kActorSadik, 190, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2310, kAnimationModeTalk); + Actor_Says(kActorSadik, 200, kAnimationModeTalk); } else { - Actor_Says(kActorSadik, 140, 3); - Actor_Says(kActorSadik, 150, 3); - Actor_Says(kActorMcCoy, 2305, 3); - Actor_Says(kActorSadik, 160, 3); - Actor_Says(kActorSadik, 170, 3); + Actor_Says(kActorSadik, 140, kAnimationModeTalk); + Actor_Says(kActorSadik, 150, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2305, kAnimationModeTalk); + Actor_Says(kActorSadik, 160, kAnimationModeTalk); + Actor_Says(kActorSadik, 170, kAnimationModeTalk); } - Actor_Says(kActorMcCoy, 2315, 3); - Actor_Says(kActorSadik, 210, 3); - Actor_Says(kActorSadik, 220, 3); - Actor_Says(kActorSadik, 230, 3); - Actor_Says(kActorSadik, 240, 3); - Actor_Says(kActorSadik, 250, 3); - Actor_Says(kActorSadik, 260, 3); + Actor_Says(kActorMcCoy, 2315, kAnimationModeTalk); + Actor_Says(kActorSadik, 210, kAnimationModeTalk); + Actor_Says(kActorSadik, 220, kAnimationModeTalk); + Actor_Says(kActorSadik, 230, kAnimationModeTalk); + Actor_Says(kActorSadik, 240, kAnimationModeTalk); + Actor_Says(kActorSadik, 250, kAnimationModeTalk); + Actor_Says(kActorSadik, 260, kAnimationModeTalk); Actor_Set_Goal_Number(kActorSadik, 416); return true; case 416: - Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, 0, 0, 0); - Actor_Face_Heading(kActorSadik, 150, 0); + Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, false, false, 0); + Actor_Face_Heading(kActorSadik, 150, false); return true; case 417: - Actor_Face_Actor(kActorSadik, kActorMcCoy, 1); - Actor_Says(kActorSadik, 320, 3); - Loop_Actor_Walk_To_XYZ(kActorSadik, -857.0f, 0.0f, -703.0f, 0, 0, 1, 0); - Actor_Says(kActorMcCoy, 2330, 3); - Actor_Says(kActorSadik, 330, 3); - Actor_Says(kActorMcCoy, 2335, 3); - Actor_Says(kActorSadik, 340, 3); + Actor_Face_Actor(kActorSadik, kActorMcCoy, true); + Actor_Says(kActorSadik, 320, kAnimationModeTalk); + Loop_Actor_Walk_To_XYZ(kActorSadik, -857.0f, 0.0f, -703.0f, 0, false, true, 0); + Actor_Says(kActorMcCoy, 2330, kAnimationModeTalk); + Actor_Says(kActorSadik, 330, kAnimationModeTalk); + Actor_Says(kActorMcCoy, 2335, kAnimationModeTalk); + Actor_Says(kActorSadik, 340, kAnimationModeTalk); Actor_Set_Goal_Number(kActorSadik, 416); return true; @@ -553,7 +569,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 328; _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); } break; @@ -564,7 +580,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 7; *animation = 312; - Actor_Change_Animation_Mode(kActorSadik, 4); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle); } break; @@ -575,7 +591,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 7; *animation = 312; - Actor_Change_Animation_Mode(kActorSadik, 4); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle); } break; @@ -632,7 +648,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 7; *animation = 312; - Actor_Change_Animation_Mode(kActorSadik, 4); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle); } break; @@ -695,7 +711,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 328; _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); } break; @@ -726,7 +742,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 328; _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); } break; @@ -737,7 +753,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 328; _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); } break; @@ -763,7 +779,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _var1 = 221; } if (_animationFrame == 6) { - Actor_Change_Animation_Mode(0, 21); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeHit); } } if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { @@ -771,7 +787,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); if (Actor_Query_Goal_Number(kActorSadik) == 105) { Actor_Change_Animation_Mode(kActorSadik, 63); } @@ -783,10 +799,10 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { _animationFrame++; if (_animationFrame == 4) { if (Actor_Query_Goal_Number(kActorSadik) == 105) { - Actor_Change_Animation_Mode(0, 48); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); _var1 = 222; } else { - Actor_Change_Animation_Mode(0, 68); + Actor_Change_Animation_Mode(kActorMcCoy, 68); _var1 = 223; } } @@ -795,7 +811,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) { *animation = 328; _animationFrame = 0; _animationState = 0; - Actor_Change_Animation_Mode(kActorSadik, 0); + Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle); if (Actor_Query_Goal_Number(kActorSadik) == 105) { AI_Movement_Track_Flush(kActorSadik); AI_Movement_Track_Append(kActorSadik, 318, 0); @@ -995,7 +1011,9 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { break; case 62: - if (Actor_Query_Goal_Number(kActorSadik) != 105 && Actor_Query_Goal_Number(kActorSadik) != 106) { + if (Actor_Query_Goal_Number(kActorSadik) != 105 + && Actor_Query_Goal_Number(kActorSadik) != 106 + ) { _animationState = 31; _animationFrame = 0; } else { @@ -1005,7 +1023,9 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { break; case 63: - if (Actor_Query_Goal_Number(kActorSadik) != 105 && Actor_Query_Goal_Number(kActorSadik) != 106) { + if (Actor_Query_Goal_Number(kActorSadik) != 105 + && Actor_Query_Goal_Number(kActorSadik) != 106 + ) { _animationState = 30; _animationFrame = 2; } else { diff --git a/engines/bladerunner/script/ai/sebastian.cpp b/engines/bladerunner/script/ai/sebastian.cpp index b6a9b50bea..2d8bec2852 100644 --- a/engines/bladerunner/script/ai/sebastian.cpp +++ b/engines/bladerunner/script/ai/sebastian.cpp @@ -40,8 +40,11 @@ void AIScriptSebastian::Initialize() { } bool AIScriptSebastian::Update() { - if (Actor_Query_Goal_Number(kActorSebastian) < 200 && Global_Variable_Query(kVariableChapter) == 3) + if (Actor_Query_Goal_Number(kActorSebastian) < 200 + && Global_Variable_Query(kVariableChapter) == 3 + ) { Actor_Set_Goal_Number(kActorSebastian, 200); + } return false; } diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index 637d3b0983..9c7d51f56f 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -150,8 +150,9 @@ bool AIScriptSteele::Update() { return true; } - if (Actor_Query_Goal_Number(kActorSteele) != 271) { + if (Actor_Query_Goal_Number(kActorSteele) == 271) { Actor_Set_Goal_Number(kActorSteele, 270); + return true; } break; |