diff options
author | Thanasis Antoniou | 2019-04-09 16:31:39 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-04-09 16:32:51 +0300 |
commit | a9404284c3778c087aa1f10428db632880296a99 (patch) | |
tree | c278becceb546ac06d0aae139f40d5a058673308 /engines/bladerunner/script/ai | |
parent | d8f43160df030abd06f3f941d7edd02b6f4c9fba (diff) | |
download | scummvm-rg350-a9404284c3778c087aa1f10428db632880296a99.tar.gz scummvm-rg350-a9404284c3778c087aa1f10428db632880296a99.tar.bz2 scummvm-rg350-a9404284c3778c087aa1f10428db632880296a99.zip |
BLADERUNNER: Fix Officer Leary crowd interrogation
He will now resume interrogation after McCoy interrupts him
Also used named constants for timers
Diffstat (limited to 'engines/bladerunner/script/ai')
24 files changed, 192 insertions, 175 deletions
diff --git a/engines/bladerunner/script/ai/bullet_bob.cpp b/engines/bladerunner/script/ai/bullet_bob.cpp index 47e3852c29..f49462492a 100644 --- a/engines/bladerunner/script/ai/bullet_bob.cpp +++ b/engines/bladerunner/script/ai/bullet_bob.cpp @@ -58,15 +58,15 @@ bool AIScriptBulletBob::Update() { && !Game_Flag_Query(kFlagRC04McCoyCombatMode) && Global_Variable_Query(kVariableChapter) < 4 ) { - AI_Countdown_Timer_Reset(kActorBulletBob, 2); - AI_Countdown_Timer_Start(kActorBulletBob, 2, 10); + AI_Countdown_Timer_Reset(kActorBulletBob, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorBulletBob, kActorTimerAIScriptCustomTask2, 10); Actor_Set_Goal_Number(kActorBulletBob, kGoalBulletBobWarningMcCoy); Actor_Modify_Friendliness_To_Other(kActorBulletBob, kActorMcCoy, -15); Game_Flag_Set(kFlagRC04McCoyCombatMode); } else if ( Actor_Query_Goal_Number(kActorBulletBob) == kGoalBulletBobWarningMcCoy && !Player_Query_Combat_Mode() ) { - AI_Countdown_Timer_Reset(kActorBulletBob, 2); + AI_Countdown_Timer_Reset(kActorBulletBob, kActorTimerAIScriptCustomTask2); Game_Flag_Reset(kFlagRC04McCoyCombatMode); Game_Flag_Set(kFlagRC04McCoyWarned); Actor_Set_Goal_Number(kActorBulletBob, kGoalBulletBobDefault); @@ -96,11 +96,11 @@ bool AIScriptBulletBob::Update() { } void AIScriptBulletBob::TimerExpired(int timer) { - if (timer == 2 + if (timer == kActorTimerAIScriptCustomTask2 && Actor_Query_Goal_Number(kActorBulletBob) == kGoalBulletBobWarningMcCoy ) { Actor_Set_Goal_Number(kActorBulletBob, kGoalBulletBobShootMcCoy); - AI_Countdown_Timer_Reset(kActorBulletBob, 2); + AI_Countdown_Timer_Reset(kActorBulletBob, kActorTimerAIScriptCustomTask2); return; //true; } return; //false; diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp index b4e059ab6e..1e6422873c 100644 --- a/engines/bladerunner/script/ai/dektora.cpp +++ b/engines/bladerunner/script/ai/dektora.cpp @@ -110,20 +110,20 @@ bool AIScriptDektora::Update() { } void AIScriptDektora::TimerExpired(int timer) { - if (timer == 0) { + if (timer == kActorTimerAIScriptCustomTask0) { if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR08Dance) { if (Player_Query_Current_Scene() == kSceneNR08) { - AI_Countdown_Timer_Reset(kActorDektora, 0); - AI_Countdown_Timer_Start(kActorDektora, 0, 10); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorDektora, kActorTimerAIScriptCustomTask0, 10); } else { Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR08Leave); - AI_Countdown_Timer_Reset(kActorDektora, 0); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask0); } return; //true; } if (Actor_Query_Goal_Number(kActorDektora) == kGoalDektoraNR11Burning) { - AI_Countdown_Timer_Reset(kActorDektora, 0); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorDektora, kGoalDektoraNR11BurningGoToMcCoy); return; //true; } @@ -417,8 +417,8 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Flush(kActorDektora); Actor_Put_In_Set(kActorDektora, kSetNR05_NR08); Actor_Set_At_XYZ(kActorDektora, -923.93f, 127.85f, 413.46f, 30); - AI_Countdown_Timer_Reset(kActorDektora, 0); - AI_Countdown_Timer_Start(kActorDektora, 0, 45); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorDektora, kActorTimerAIScriptCustomTask0, 45); break; case kGoalDektoraNR08Leave: @@ -458,9 +458,9 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalDektoraNR11Hiding: AI_Movement_Track_Flush(kActorDektora); - AI_Countdown_Timer_Reset(kActorDektora, 0); - AI_Countdown_Timer_Reset(kActorDektora, 1); - AI_Countdown_Timer_Reset(kActorDektora, 2); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Reset(kActorDektora, kActorTimerAIScriptCustomTask2); Actor_Put_In_Set(kActorDektora, kSetNR11); Actor_Set_At_XYZ(kActorDektora, -184.0f, 0.33f, -268.0f, 256); break; diff --git a/engines/bladerunner/script/ai/early_q.cpp b/engines/bladerunner/script/ai/early_q.cpp index 4d67360f7b..a0f4983eb7 100644 --- a/engines/bladerunner/script/ai/early_q.cpp +++ b/engines/bladerunner/script/ai/early_q.cpp @@ -78,11 +78,11 @@ bool AIScriptEarlyQ::Update() { } void AIScriptEarlyQ::TimerExpired(int timer) { - if (timer == 0 + if (timer == kActorTimerAIScriptCustomTask0 && Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR05WillLeave ) { if (Player_Query_Current_Scene() == kSceneNR05) { - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR05Leave); } else { Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR05Wait); @@ -90,19 +90,19 @@ void AIScriptEarlyQ::TimerExpired(int timer) { return; //true; } - if (timer == 0 + if (timer == kActorTimerAIScriptCustomTask0 && Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04GoToMcCoy ) { Player_Loses_Control(); - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04HandDrink); return; //true; } - if (timer == 1 + if (timer == kActorTimerAIScriptCustomTask1 && Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04WaitForPulledGun ) { - AI_Countdown_Timer_Reset(kActorEarlyQ, 1); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask1); Player_Loses_Control(); Actor_Change_Animation_Mode(kActorEarlyQ, 29); Delay(2500); @@ -207,7 +207,7 @@ void AIScriptEarlyQ::OtherAgentEnteredCombatMode(int otherActorId, int combatMod Game_Flag_Set(kFlagNotUsed565); } Game_Flag_Set(kFlagNR04McCoyAimedAtEarlyQ); - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04McCoyPulledGun); return; // true; } @@ -219,7 +219,7 @@ void AIScriptEarlyQ::OtherAgentEnteredCombatMode(int otherActorId, int combatMod if (Game_Flag_Query(kFlagNotUsed565)) { Game_Flag_Reset(kFlagNotUsed565); } - AI_Countdown_Timer_Reset(kActorEarlyQ, 1); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask1); Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04Talk3); return; //true; } @@ -335,8 +335,8 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalEarlyQNR04GoToMcCoy: Loop_Actor_Walk_To_Actor(kActorEarlyQ, 0, 36, 0, 0); - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); - AI_Countdown_Timer_Start(kActorEarlyQ, 0, 4); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorEarlyQ, kActorTimerAIScriptCustomTask0, 4); break; case kGoalEarlyQNR04McCoyPulledGun: @@ -378,8 +378,8 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { break; case kGoalEarlyQNR04WaitForPulledGun: - AI_Countdown_Timer_Reset(kActorEarlyQ, 1); - AI_Countdown_Timer_Start(kActorEarlyQ, 1, 5); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Start(kActorEarlyQ, kActorTimerAIScriptCustomTask1, 5); break; case kGoalEarlyQNR04TakeDisk: @@ -432,8 +432,8 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { break; case kGoalEarlyQNR05WillLeave: - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); - AI_Countdown_Timer_Start(kActorEarlyQ, 0, 20); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorEarlyQ, kActorTimerAIScriptCustomTask0, 20); break; case kGoalEarlyQNR05Leave: @@ -460,7 +460,7 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 229: AI_Movement_Track_Flush(kActorEarlyQ); - AI_Countdown_Timer_Reset(kActorEarlyQ, 0); + AI_Countdown_Timer_Reset(kActorEarlyQ, kActorTimerAIScriptCustomTask0); break; case kGoalEarlyQNR04Wait: diff --git a/engines/bladerunner/script/ai/gaff.cpp b/engines/bladerunner/script/ai/gaff.cpp index bfcd163a0d..ac9d944228 100644 --- a/engines/bladerunner/script/ai/gaff.cpp +++ b/engines/bladerunner/script/ai/gaff.cpp @@ -57,8 +57,8 @@ bool AIScriptGaff::Update() { } void AIScriptGaff::TimerExpired(int timer) { - if (timer == 0) { - AI_Countdown_Timer_Reset(kActorGaff, 0); + if (timer == kActorTimerAIScriptCustomTask0) { + AI_Countdown_Timer_Reset(kActorGaff, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07TalkToMcCoy); } //return false; @@ -171,7 +171,7 @@ void AIScriptGaff::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) && Actor_Query_In_Set(kActorMcCoy, kSetMA07) && Actor_Query_Goal_Number(kActorGaff) == kGoalGaffMA07Wait ) { - AI_Countdown_Timer_Reset(kActorGaff, 0); + AI_Countdown_Timer_Reset(kActorGaff, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07ShootMcCoy); } // return false; diff --git a/engines/bladerunner/script/ai/general_doll.cpp b/engines/bladerunner/script/ai/general_doll.cpp index ee531d0d44..eb82c54ba2 100644 --- a/engines/bladerunner/script/ai/general_doll.cpp +++ b/engines/bladerunner/script/ai/general_doll.cpp @@ -61,10 +61,10 @@ bool AIScriptGeneralDoll::Update() { } void AIScriptGeneralDoll::TimerExpired(int timer) { - if (timer == 2) { + if (timer == kActorTimerAIScriptCustomTask2) { Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); Actor_Change_Animation_Mode(kActorGeneralDoll, kAnimationModeDie); - AI_Countdown_Timer_Reset(kActorGeneralDoll, 2); + AI_Countdown_Timer_Reset(kActorGeneralDoll, kActorTimerAIScriptCustomTask2); return; //true; } return; //false; diff --git a/engines/bladerunner/script/ai/generic_walker_a.cpp b/engines/bladerunner/script/ai/generic_walker_a.cpp index c7afdbc767..b764f77d83 100644 --- a/engines/bladerunner/script/ai/generic_walker_a.cpp +++ b/engines/bladerunner/script/ai/generic_walker_a.cpp @@ -66,8 +66,8 @@ bool AIScriptGenericWalkerA::Update() { } void AIScriptGenericWalkerA::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorGenwalkerA, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorGenwalkerA, kActorTimerAIScriptCustomTask2); Game_Flag_Reset(kFlagGenericWalkerWaiting); return;// true; } @@ -79,8 +79,8 @@ void AIScriptGenericWalkerA::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorGenwalkerA, 0); if (!Game_Flag_Query(kFlagGenericWalkerWaiting)) { Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerA, 2); - AI_Countdown_Timer_Start(kActorGenwalkerA, 2, Random_Query(6, 10)); + AI_Countdown_Timer_Reset(kActorGenwalkerA, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerA, kActorTimerAIScriptCustomTask2, Random_Query(6, 10)); } // return true; } @@ -358,8 +358,8 @@ bool AIScriptGenericWalkerA::prepareWalker() { Global_Variable_Set(kVariableGenericWalkerAModel, model); Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerA, 2); - AI_Countdown_Timer_Start(kActorGenwalkerA, 2, Random_Query(4, 12)); + AI_Countdown_Timer_Reset(kActorGenwalkerA, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerA, kActorTimerAIScriptCustomTask2, Random_Query(4, 12)); Actor_Set_Goal_Number(kActorGenwalkerA, 1); return true; } diff --git a/engines/bladerunner/script/ai/generic_walker_b.cpp b/engines/bladerunner/script/ai/generic_walker_b.cpp index acada61e42..b4c37e8048 100644 --- a/engines/bladerunner/script/ai/generic_walker_b.cpp +++ b/engines/bladerunner/script/ai/generic_walker_b.cpp @@ -62,8 +62,8 @@ bool AIScriptGenericWalkerB::Update() { } void AIScriptGenericWalkerB::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorGenwalkerB, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorGenwalkerB, kActorTimerAIScriptCustomTask2); Game_Flag_Reset(kFlagGenericWalkerWaiting); return;// true; } @@ -75,8 +75,8 @@ void AIScriptGenericWalkerB::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorGenwalkerB, 0); if (!Game_Flag_Query(kFlagGenericWalkerWaiting)) { Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerB, 2); - AI_Countdown_Timer_Start(kActorGenwalkerB, 2, Random_Query(6, 10)); + AI_Countdown_Timer_Reset(kActorGenwalkerB, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerB, kActorTimerAIScriptCustomTask2, Random_Query(6, 10)); } // return true; } @@ -334,8 +334,8 @@ bool AIScriptGenericWalkerB::prepareWalker() { Global_Variable_Set(kVariableGenericWalkerBModel, model); Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerB, 2); - AI_Countdown_Timer_Start(kActorGenwalkerB, 2, Random_Query(4, 12)); + AI_Countdown_Timer_Reset(kActorGenwalkerB, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerB, kActorTimerAIScriptCustomTask2, Random_Query(4, 12)); Actor_Set_Goal_Number(kActorGenwalkerB, 1); return true; } diff --git a/engines/bladerunner/script/ai/generic_walker_c.cpp b/engines/bladerunner/script/ai/generic_walker_c.cpp index a70ebc09ff..80b1191c46 100644 --- a/engines/bladerunner/script/ai/generic_walker_c.cpp +++ b/engines/bladerunner/script/ai/generic_walker_c.cpp @@ -63,8 +63,8 @@ bool AIScriptGenericWalkerC::Update() { } void AIScriptGenericWalkerC::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorGenwalkerC, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorGenwalkerC, kActorTimerAIScriptCustomTask2); Game_Flag_Reset(kFlagGenericWalkerWaiting); return;// true; } @@ -76,8 +76,8 @@ void AIScriptGenericWalkerC::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorGenwalkerC, 0); if (!Game_Flag_Query(kFlagGenericWalkerWaiting)) { Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerC, 2); - AI_Countdown_Timer_Start(kActorGenwalkerC, 2, Random_Query(6, 10)); + AI_Countdown_Timer_Reset(kActorGenwalkerC, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerC, kActorTimerAIScriptCustomTask2, Random_Query(6, 10)); } // return true; } @@ -337,8 +337,8 @@ bool AIScriptGenericWalkerC::prepareWalker() { Global_Variable_Set(kVariableGenericWalkerCModel, model); Game_Flag_Set(kFlagGenericWalkerWaiting); - AI_Countdown_Timer_Reset(kActorGenwalkerC, 2); - AI_Countdown_Timer_Start(kActorGenwalkerC, 2, Random_Query(4, 12)); + AI_Countdown_Timer_Reset(kActorGenwalkerC, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorGenwalkerC, kActorTimerAIScriptCustomTask2, Random_Query(4, 12)); Actor_Set_Goal_Number(kActorGenwalkerC, 1); return true; } diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp index b5407198c7..974629b4d0 100644 --- a/engines/bladerunner/script/ai/gordo.cpp +++ b/engines/bladerunner/script/ai/gordo.cpp @@ -101,8 +101,8 @@ bool AIScriptGordo::Update() { } void AIScriptGordo::TimerExpired(int timer) { - if (timer == 0) { - AI_Countdown_Timer_Reset(kActorGordo, 0); + if (timer == kActorTimerAIScriptCustomTask0) { + AI_Countdown_Timer_Reset(kActorGordo, kActorTimerAIScriptCustomTask0); if (Player_Query_Combat_Mode()) { Actor_Set_Goal_Number(kActorGordo, kGoalGordoNR01RunAway); } else { @@ -629,7 +629,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalGordoNR01GiveUp: ADQ_Add(kActorGordo, 170, 18); - AI_Countdown_Timer_Start(kActorGordo, 0, 10); + AI_Countdown_Timer_Start(kActorGordo, kActorTimerAIScriptCustomTask0, 10); break; case kGoalGordoNR01TalkToMcCoy: @@ -689,7 +689,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalGordoNR01Die: Music_Stop(2); - AI_Countdown_Timer_Reset(kActorGordo, 0); + AI_Countdown_Timer_Reset(kActorGordo, kActorTimerAIScriptCustomTask0); ADQ_Flush(); AI_Movement_Track_Flush(kActorGordo); if (Game_Flag_Query(kFlagGordoIsReplicant)) { diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp index 6472c5a801..735f442661 100644 --- a/engines/bladerunner/script/ai/hanoi.cpp +++ b/engines/bladerunner/script/ai/hanoi.cpp @@ -47,7 +47,7 @@ void AIScriptHanoi::Initialize() { bool AIScriptHanoi::Update() { if (Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayGoToNR07) { - AI_Countdown_Timer_Reset(kActorHanoi, 0); + AI_Countdown_Timer_Reset(kActorHanoi, kActorTimerAIScriptCustomTask0); } if (Global_Variable_Query(kVariableChapter) == 3 @@ -99,7 +99,7 @@ bool AIScriptHanoi::Update() { } void AIScriptHanoi::TimerExpired(int timer) { - if (timer == 0) { + if (timer == kActorTimerAIScriptCustomTask0) { if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03StartGuarding) { Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); return; //true; @@ -219,11 +219,11 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { switch (newGoalNumber) { case kGoalHanoiDefault: - AI_Countdown_Timer_Start(kActorHanoi, 0, 45); + AI_Countdown_Timer_Start(kActorHanoi, kActorTimerAIScriptCustomTask0, 45); break; case kGoalHanoiResetTimer: - AI_Countdown_Timer_Reset(kActorHanoi, 0); + AI_Countdown_Timer_Reset(kActorHanoi, kActorTimerAIScriptCustomTask0); break; case kGoalHanoiNR07TalkToMcCoy: @@ -283,13 +283,13 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalHanoiNR03StartGuarding: Actor_Put_In_Set(kActorHanoi, kSetNR03); Actor_Set_At_Waypoint(kActorHanoi, 362, 300); - AI_Countdown_Timer_Reset(kActorHanoi, 0); - AI_Countdown_Timer_Start(kActorHanoi, 0, 6); + AI_Countdown_Timer_Reset(kActorHanoi, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorHanoi, kActorTimerAIScriptCustomTask0, 6); break; case kGoalHanoiThrowOutMcCoy: Game_Flag_Set(kFlagNR03McCoyThrownOut); - AI_Countdown_Timer_Reset(kActorHanoi, 0); + AI_Countdown_Timer_Reset(kActorHanoi, kActorTimerAIScriptCustomTask0); Player_Loses_Control(); Player_Set_Combat_Mode(false); // this is missing in ITA & SPA versions of the game Actor_Force_Stop_Walking(kActorMcCoy); diff --git a/engines/bladerunner/script/ai/holloway.cpp b/engines/bladerunner/script/ai/holloway.cpp index 8efb3c933f..c7eb29ea70 100644 --- a/engines/bladerunner/script/ai/holloway.cpp +++ b/engines/bladerunner/script/ai/holloway.cpp @@ -48,8 +48,8 @@ bool AIScriptHolloway::Update() { } void AIScriptHolloway::TimerExpired(int timer) { - if (timer == 0) { - AI_Countdown_Timer_Reset(kActorHolloway, 0); + if (timer == kActorTimerAIScriptCustomTask0) { + AI_Countdown_Timer_Reset(kActorHolloway, kActorTimerAIScriptCustomTask0); if (Global_Variable_Query(kVariableHollowayArrest) == 1) { Player_Gains_Control(); } @@ -90,7 +90,7 @@ void AIScriptHolloway::OtherAgentEnteredCombatMode(int otherActorId, int combatM if (otherActorId == kActorMcCoy && Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayApproachMcCoy ) { - AI_Countdown_Timer_Reset(kActorHolloway, 0); + AI_Countdown_Timer_Reset(kActorHolloway, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorHolloway, kGoalHollowayKnockOutMcCoy); } } @@ -146,8 +146,8 @@ bool AIScriptHolloway::GoalChanged(int currentGoalNumber, int newGoalNumber) { } else { Actor_Says(kActorHolloway, 30, kAnimationModeTalk); Actor_Face_Actor(kActorMcCoy, kActorHolloway, true); - AI_Countdown_Timer_Reset(kActorHolloway, 0); - AI_Countdown_Timer_Start(kActorHolloway, 0, 1); + AI_Countdown_Timer_Reset(kActorHolloway, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorHolloway, kActorTimerAIScriptCustomTask0, 1); } break; diff --git a/engines/bladerunner/script/ai/klein.cpp b/engines/bladerunner/script/ai/klein.cpp index fc2893d17d..8091feee79 100644 --- a/engines/bladerunner/script/ai/klein.cpp +++ b/engines/bladerunner/script/ai/klein.cpp @@ -72,8 +72,8 @@ bool AIScriptKlein::Update() { && Actor_Query_Friendliness_To_Other(kActorKlein, kActorMcCoy) < 35 && !Game_Flag_Query(kFlagPS07KleinInsulted) ) { - AI_Countdown_Timer_Reset(kActorKlein, 2); - AI_Countdown_Timer_Start(kActorKlein, 2, 5); + AI_Countdown_Timer_Reset(kActorKlein, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorKlein, kActorTimerAIScriptCustomTask2, 5); Game_Flag_Set(kFlagPS07KleinInsulted); return true; } @@ -91,7 +91,7 @@ bool AIScriptKlein::Update() { } void AIScriptKlein::TimerExpired(int timer) { - if (timer == 2) { + if (timer == kActorTimerAIScriptCustomTask2) { if ( Game_Flag_Query(kFlagPS07KleinInsulted) && !Game_Flag_Query(kFlagPS07KleinInsultedTalk) && Actor_Query_Is_In_Current_Set(kActorKlein) diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp index 0e1a1156ce..94f3093ee5 100644 --- a/engines/bladerunner/script/ai/leon.cpp +++ b/engines/bladerunner/script/ai/leon.cpp @@ -73,18 +73,18 @@ bool AIScriptLeon::Update() { } void AIScriptLeon::TimerExpired(int timer) { - if (timer == 0 + if (timer == kActorTimerAIScriptCustomTask0 && Actor_Query_Goal_Number(kActorLeon) == kGoalLeonLeave ) { - AI_Countdown_Timer_Reset(kActorLeon, 0); + AI_Countdown_Timer_Reset(kActorLeon, kActorTimerAIScriptCustomTask0); Actor_Set_Goal_Number(kActorLeon, kGoalLeonGone); } } void AIScriptLeon::CompletedMovementTrack() { if (Actor_Query_Goal_Number(kActorLeon) == kGoalLeonLeave) { - AI_Countdown_Timer_Reset(kActorLeon, 0); - AI_Countdown_Timer_Start(kActorLeon, 0, 8); + AI_Countdown_Timer_Reset(kActorLeon, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorLeon, kActorTimerAIScriptCustomTask0, 8); //return true; } //return false; @@ -111,7 +111,7 @@ void AIScriptLeon::OtherAgentEnteredThisScene(int otherActorId) { if (otherActorId == kActorMcCoy && Actor_Query_Goal_Number(kActorLeon) == kGoalLeonLeave ) { - AI_Countdown_Timer_Reset(kActorLeon, 0); + AI_Countdown_Timer_Reset(kActorLeon, kActorTimerAIScriptCustomTask0); AI_Movement_Track_Flush(kActorLeon); AI_Movement_Track_Append(kActorLeon, 353, 0); AI_Movement_Track_Repeat(kActorLeon); diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp index ab007e1468..52b2b80934 100644 --- a/engines/bladerunner/script/ai/lucy.cpp +++ b/engines/bladerunner/script/ai/lucy.cpp @@ -111,14 +111,14 @@ bool AIScriptLucy::Update() { } void AIScriptLucy::TimerExpired(int timer) { - AI_Countdown_Timer_Reset(kActorLucy, 0); - if (timer == 0 - && Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03 - ) { - if (Player_Query_Current_Scene() == kSceneHF03) { - AI_Countdown_Timer_Start(kActorLucy, 0, 20); - } else { - Actor_Set_Goal_Number(kActorLucy, kGoalLucyMoveAround); + if (timer == kActorTimerAIScriptCustomTask0) { // rephrased this to be more expandable (if required) + AI_Countdown_Timer_Reset(kActorLucy, kActorTimerAIScriptCustomTask0); + if(Actor_Query_Goal_Number(kActorLucy) == kGoalLucyGoToHF03) { + if (Player_Query_Current_Scene() == kSceneHF03) { + AI_Countdown_Timer_Start(kActorLucy, kActorTimerAIScriptCustomTask0, 20); + } else { + Actor_Set_Goal_Number(kActorLucy, kGoalLucyMoveAround); + } } } } @@ -132,8 +132,8 @@ void AIScriptLucy::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorLucy, kGoalLucyReturnToHF03); return; //true; } - AI_Countdown_Timer_Reset(kActorLucy, 0); - AI_Countdown_Timer_Start(kActorLucy, 0, 30); + AI_Countdown_Timer_Reset(kActorLucy, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorLucy, kActorTimerAIScriptCustomTask0, 30); break; case kGoalLucyHF03RunOutPhase1: diff --git a/engines/bladerunner/script/ai/luther.cpp b/engines/bladerunner/script/ai/luther.cpp index f30763a0d9..4ad0e5639d 100644 --- a/engines/bladerunner/script/ai/luther.cpp +++ b/engines/bladerunner/script/ai/luther.cpp @@ -72,8 +72,8 @@ bool AIScriptLuther::Update() { if ( Actor_Query_Goal_Number(kActorLuther) == kGoalLutherDyingStarted && !Game_Flag_Query(kFlagUG15LutherLanceStartedDying) ) { - AI_Countdown_Timer_Reset(kActorLuther, 2); - AI_Countdown_Timer_Start(kActorLuther, 2, 5); + AI_Countdown_Timer_Reset(kActorLuther, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorLuther, kActorTimerAIScriptCustomTask2, 5); Actor_Set_Goal_Number(kActorLuther, kGoalLutherDyingWait); Game_Flag_Set(kFlagUG15LutherLanceStartedDying); return false; @@ -116,8 +116,8 @@ bool AIScriptLuther::Update() { } void AIScriptLuther::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorLuther, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorLuther, kActorTimerAIScriptCustomTask2); Actor_Set_Goal_Number(kActorLuther, kGoalLutherDyingCheck); // return true; } diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp index 3521abbb9d..86a1c5f881 100644 --- a/engines/bladerunner/script/ai/maggie.cpp +++ b/engines/bladerunner/script/ai/maggie.cpp @@ -94,10 +94,10 @@ bool AIScriptMaggie::Update() { } void AIScriptMaggie::TimerExpired(int timer) { - if (timer == 0) { + if (timer == kActorTimerAIScriptCustomTask0) { int goal = Actor_Query_Goal_Number(kActorMaggie); if (goal == kGoalMaggieMA02Wait) { - AI_Countdown_Timer_Reset(kActorMaggie, 0); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); if (Random_Query(0, 4)) { AI_Movement_Track_Flush(kActorMaggie); AI_Movement_Track_Append(kActorMaggie, randomWaypointMA02(), 0); @@ -109,7 +109,7 @@ void AIScriptMaggie::TimerExpired(int timer) { } if (goal == kGoalMaggieMA02SitDown) { - AI_Countdown_Timer_Reset(kActorMaggie, 0); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); Actor_Change_Animation_Mode(kActorMaggie, 55); return; //true } @@ -132,8 +132,8 @@ void AIScriptMaggie::CompletedMovementTrack() { if (goal == kGoalMaggieMA02Wait) { Actor_Face_Actor(kActorMaggie, kActorMcCoy, true); - AI_Countdown_Timer_Reset(kActorMaggie, 0); - AI_Countdown_Timer_Start(kActorMaggie, 0, Random_Query(1, 5)); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorMaggie, kActorTimerAIScriptCustomTask0, Random_Query(1, 5)); return; //true } @@ -194,8 +194,8 @@ void AIScriptMaggie::ClickedByPlayer() { Actor_Face_Actor(kActorMaggie, kActorMcCoy, true); Actor_Change_Animation_Mode(kActorMaggie, 56); } - AI_Countdown_Timer_Reset(kActorMaggie, 0); - AI_Countdown_Timer_Start(kActorMaggie, 0, Random_Query(3, 9)); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorMaggie, kActorTimerAIScriptCustomTask0, Random_Query(3, 9)); return; // true } @@ -280,7 +280,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case kGoalMaggieMA02WalkToMcCoy: - AI_Countdown_Timer_Reset(kActorMaggie, 0); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); AI_Movement_Track_Flush(kActorMaggie); Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 30, false, false); Actor_Face_Actor(kActorMaggie, kActorMcCoy, true); @@ -289,8 +289,8 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case kGoalMaggieMA02Wait: - AI_Countdown_Timer_Reset(kActorMaggie, 0); - AI_Countdown_Timer_Start(kActorMaggie, 0, Random_Query(3, 9)); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorMaggie, kActorTimerAIScriptCustomTask0, Random_Query(3, 9)); return true; case 9: @@ -310,8 +310,8 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Change_Animation_Mode(kActorMaggie, 54); _animationState = kMaggieStateLayingIdle; _animationFrame = 0; - AI_Countdown_Timer_Reset(kActorMaggie, 0); - AI_Countdown_Timer_Start(kActorMaggie, 0, Random_Query(2, 9)); + AI_Countdown_Timer_Reset(kActorMaggie, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorMaggie, kActorTimerAIScriptCustomTask0, Random_Query(2, 9)); return true; case kGoalMaggieMA02Sleep: diff --git a/engines/bladerunner/script/ai/moraji.cpp b/engines/bladerunner/script/ai/moraji.cpp index e7ae6691a8..732905e2f6 100644 --- a/engines/bladerunner/script/ai/moraji.cpp +++ b/engines/bladerunner/script/ai/moraji.cpp @@ -46,8 +46,8 @@ bool AIScriptMoraji::Update() { && Player_Query_Current_Scene() == kSceneDR05 && !Game_Flag_Query(kFlagDR05BombActivated) ) { - AI_Countdown_Timer_Reset(kActorMoraji, 2); - AI_Countdown_Timer_Start(kActorMoraji, 2, 30); + AI_Countdown_Timer_Reset(kActorMoraji, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorMoraji, kActorTimerAIScriptCustomTask2, 30); Game_Flag_Set(kFlagDR05BombActivated); return true; } @@ -63,8 +63,8 @@ bool AIScriptMoraji::Update() { } void AIScriptMoraji::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorMoraji, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorMoraji, kActorTimerAIScriptCustomTask2); if (Actor_Query_Goal_Number(kActorMoraji) != kGoalMorajiJump && Actor_Query_Goal_Number(kActorMoraji) != kGoalMorajiLayDown @@ -80,7 +80,7 @@ void AIScriptMoraji::TimerExpired(int timer) { void AIScriptMoraji::CompletedMovementTrack() { if (Actor_Query_Goal_Number(kActorMoraji) == kGoalMorajiRunOut) { - AI_Countdown_Timer_Reset(kActorMoraji, 2); + AI_Countdown_Timer_Reset(kActorMoraji, kActorTimerAIScriptCustomTask2); Game_Flag_Set(kFlagDR05BombWillExplode); _animationState = 3; @@ -476,7 +476,7 @@ void AIScriptMoraji::SetAnimationState(int animationState, int animationFrame, i bool AIScriptMoraji::ReachedMovementTrackWaypoint(int waypointId) { if (waypointId == 96) - AI_Countdown_Timer_Reset(kActorMoraji, 2); + AI_Countdown_Timer_Reset(kActorMoraji, kActorTimerAIScriptCustomTask2); return true; } diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp index 66f05e56ba..15f7044ba9 100644 --- a/engines/bladerunner/script/ai/officer_grayford.cpp +++ b/engines/bladerunner/script/ai/officer_grayford.cpp @@ -202,8 +202,8 @@ bool AIScriptOfficerGrayford::Update() { } void AIScriptOfficerGrayford::TimerExpired(int timer) { - if (timer == 2) { - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 104) { Actor_Set_Goal_Number(kActorOfficerGrayford, 105); } else if (Actor_Query_Goal_Number(kActorOfficerGrayford) == 105) { @@ -255,8 +255,8 @@ void AIScriptOfficerGrayford::CompletedMovementTrack() { if (Random_Query(0, 2)) { Actor_Change_Animation_Mode(kActorOfficerGrayford, 43); } else { - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); - AI_Countdown_Timer_Start(kActorOfficerGrayford, 2, Random_Query(6, 12)); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2, Random_Query(6, 12)); } Actor_Face_Waypoint(kActorOfficerGrayford, 97, true); // return false; @@ -365,7 +365,7 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); Actor_Says(kActorMcCoy, 1005, kAnimationModeTalk); AI_Movement_Track_Flush(kActorOfficerGrayford); - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); if (_animationState == 35 || _animationState == 34) { _animationState = 37; _animationFrame = 0; @@ -380,7 +380,7 @@ void AIScriptOfficerGrayford::ClickedByPlayer() { Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); Actor_Says(kActorMcCoy, 1005, kAnimationModeTalk); AI_Movement_Track_Flush(kActorOfficerGrayford); - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); if (_animationState == 35 || _animationState == 34) { _animationState = 37; _animationFrame = 0; @@ -548,14 +548,14 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb return true; case 104: - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 112, 0); AI_Movement_Track_Repeat(kActorOfficerGrayford); return true; case 105: - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); AI_Movement_Track_Flush(kActorOfficerGrayford); AI_Movement_Track_Append(kActorOfficerGrayford, 113, 0); AI_Movement_Track_Repeat(kActorOfficerGrayford); @@ -565,7 +565,7 @@ bool AIScriptOfficerGrayford::GoalChanged(int currentGoalNumber, int newGoalNumb Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true); Actor_Says(kActorMcCoy, 1000, 14); AI_Movement_Track_Flush(kActorOfficerGrayford); - AI_Countdown_Timer_Reset(kActorOfficerGrayford, 2); + AI_Countdown_Timer_Reset(kActorOfficerGrayford, kActorTimerAIScriptCustomTask2); if (_animationState == 35 || _animationState == 34 diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp index c4ddef72ae..a4ece9fece 100644 --- a/engines/bladerunner/script/ai/officer_leary.cpp +++ b/engines/bladerunner/script/ai/officer_leary.cpp @@ -198,18 +198,28 @@ bool AIScriptOfficerLeary::Update() { } void AIScriptOfficerLeary::TimerExpired(int timer) { - if (timer == 1) { - AI_Countdown_Timer_Reset(kActorOfficerLeary, 1); + if (timer == kActorTimerAIScriptCustomTask1) { + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask1); if (Actor_Query_In_Set(kActorMcCoy, kSetHF05)) { Actor_Set_Goal_Number(kActorOfficerLeary, 430); Actor_Set_Goal_Number(kActorOfficerGrayford, 430); } else { Game_Flag_Set(kFlagHF05PoliceAttacked); } - } else if (timer == 2) { - AI_Countdown_Timer_Reset(kActorOfficerLeary, 2); + } else if (timer == kActorTimerAIScriptCustomTask2) { + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask2); Game_Flag_Reset(kFlagOfficerLearyTakingNotes); } +#if BLADERUNNER_ORIGINAL_BUGS +#else + else if (timer == kActorTimerAIScriptCustomTask0) { + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask0); + if (Actor_Query_Goal_Number(kActorOfficerLeary) == kGoalOfficerLearyRC01ResumeWalkToCrowd) { + Actor_Set_Goal_Number(kActorOfficerLeary, kGoalOfficerLearyRC01WalkToCrowd); + } + } +#endif // BLADERUNNER_ORIGINAL_BUGS + } void AIScriptOfficerLeary::CompletedMovementTrack() { @@ -340,6 +350,13 @@ bool AIScriptOfficerLeary::GoalChanged(int currentGoalNumber, int newGoalNumber) AI_Movement_Track_Append(kActorOfficerLeary, 35, 0); AI_Movement_Track_Repeat(kActorOfficerLeary); return true; +#if BLADERUNNER_ORIGINAL_BUGS +#else + case kGoalOfficerLearyRC01ResumeWalkToCrowd: + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask0); // usable for custom stuff are timers 0-2 + AI_Countdown_Timer_Start(kActorOfficerLeary, kActorTimerAIScriptCustomTask0, 4); // wait a few seconds before starting taking notes again + return true; +#endif // BLADERUNNER_ORIGINAL_BUGS case 99: AI_Movement_Track_Flush(kActorOfficerLeary); return false; @@ -521,13 +538,13 @@ bool AIScriptOfficerLeary::GoalChanged(int currentGoalNumber, int newGoalNumber) Actor_Set_Goal_Number(kActorOfficerLeary, 410); return true; case 420: - AI_Countdown_Timer_Reset(kActorOfficerLeary, 1); - AI_Countdown_Timer_Start(kActorOfficerLeary, 1, 120); + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Start(kActorOfficerLeary, kActorTimerAIScriptCustomTask1, 120); Actor_Set_Goal_Number(kActorOfficerLeary, 410); return true; case 425: - AI_Countdown_Timer_Reset(kActorOfficerLeary, 1); - AI_Countdown_Timer_Start(kActorOfficerLeary, 1, 60); + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Start(kActorOfficerLeary, kActorTimerAIScriptCustomTask1, 60); Actor_Set_Goal_Number(kActorOfficerLeary, 410); return true; case 430: @@ -1226,8 +1243,8 @@ void AIScriptOfficerLeary::SetAnimationState(int animationState, int animationFr bool AIScriptOfficerLeary::ReachedMovementTrackWaypoint(int waypointId) { if (waypointId == 57 || waypointId == 58) { Game_Flag_Set(kFlagOfficerLearyTakingNotes); - AI_Countdown_Timer_Reset(kActorOfficerLeary, 2); - AI_Countdown_Timer_Start(kActorOfficerLeary, 2, 6); + AI_Countdown_Timer_Reset(kActorOfficerLeary, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorOfficerLeary, kActorTimerAIScriptCustomTask2, 6); } return true; } diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index d931ac7fcc..85c1e58a97 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -87,8 +87,8 @@ bool AIScriptSadik::Update() { } void AIScriptSadik::TimerExpired(int timer) { - if (timer == 0) { - AI_Countdown_Timer_Reset(kActorSadik, 0); + if (timer == kActorTimerAIScriptCustomTask0) { + AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0); // goals 303, 304 and 305 are never set, cut out part of game? switch (Actor_Query_Goal_Number(kActorSadik)) { @@ -340,13 +340,13 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { // goals 303, 304 and 305 are never set, cut out part of game? case 303: - AI_Countdown_Timer_Reset(kActorSadik, 0); - AI_Countdown_Timer_Start(kActorSadik, 0, 5); + AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorSadik, kActorTimerAIScriptCustomTask0, 5); return true; case 304: Actor_Set_Targetable(kActorSadik, false); - AI_Countdown_Timer_Reset(kActorSadik, 0); + AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0); return true; case 305: @@ -356,7 +356,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalSadikUG18PrepareShootMcCoy: Sound_Play(kSfxLGCAL1, 100, 0, 0, 50); - AI_Countdown_Timer_Start(kActorSadik, 0, 2); + AI_Countdown_Timer_Start(kActorSadik, kActorTimerAIScriptCustomTask0, 2); return true; case kGoalSadikUG18ShootMcCoy: @@ -370,7 +370,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 309: - AI_Countdown_Timer_Reset(kActorSadik, 0); + AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0); return true; case 400: diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index f44efeb2e8..7569157ace 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -192,7 +192,7 @@ bool AIScriptSteele::Update() { } void AIScriptSteele::TimerExpired(int timer) { - if (timer == 0 + if (timer == kActorTimerAIScriptCustomTask0 && Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR11StartWaiting ) { if (Player_Query_Current_Scene() == kSceneNR11) { @@ -203,10 +203,10 @@ void AIScriptSteele::TimerExpired(int timer) { return; // true; } - if (timer == 1) { + if (timer == kActorTimerAIScriptCustomTask1) { int goal = Actor_Query_Goal_Number(kActorSteele); - AI_Countdown_Timer_Reset(kActorSteele, 1); + AI_Countdown_Timer_Reset(kActorSteele, kActorTimerAIScriptCustomTask1); if (goal == kGoalSteeleKP03Exploded) { Actor_Set_Goal_Number(kActorSteele, kGoalSteeleKP03Dying); @@ -852,19 +852,19 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case kGoalSteeleNR11StartWaiting: - AI_Countdown_Timer_Reset(kActorSteele, 0); - AI_Countdown_Timer_Start(kActorSteele, 0, 15); + AI_Countdown_Timer_Reset(kActorSteele, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorSteele, kActorTimerAIScriptCustomTask0, 15); return true; case kGoalSteeleNR11StopWaiting: - AI_Countdown_Timer_Reset(kActorSteele, 0); + AI_Countdown_Timer_Reset(kActorSteele, kActorTimerAIScriptCustomTask0); return true; case kGoalSteeleNR11Enter: if (comp_distance(kActorMcCoy, -4.0, 0.33f, 0.0f, 100.0f, 0.33f, -4.0f) < 48.0f) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, 32.0f, 0.33f, 17.0f, 0, false, false, 0); } - AI_Countdown_Timer_Reset(kActorSteele, 0); + AI_Countdown_Timer_Reset(kActorSteele, kActorTimerAIScriptCustomTask0); Player_Loses_Control(); if (Actor_Query_Goal_Number(kActorDektora) == kGoalSteeleNR01ConfrontGordo) { Async_Actor_Walk_To_XYZ(kActorMcCoy, -15.53f, 0.33f, 73.49f, 0, false); @@ -1356,7 +1356,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalSteeleKP03Exploded: Actor_Force_Stop_Walking(kActorSteele); Actor_Change_Animation_Mode(kActorSteele, 51); - AI_Countdown_Timer_Start(kActorSteele, 1, 2); + AI_Countdown_Timer_Start(kActorSteele, kActorTimerAIScriptCustomTask1, 2); return true; case kGoalSteeleKP03Dying: @@ -1376,7 +1376,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorSteele, 460, 3); Actor_Says(kActorSteele, 470, 3); } - AI_Countdown_Timer_Start(kActorSteele, 1, 3); + AI_Countdown_Timer_Start(kActorSteele, kActorTimerAIScriptCustomTask1, 3); return true; case kGoalSteeleKP03ShootMcCoy: diff --git a/engines/bladerunner/script/ai/transient.cpp b/engines/bladerunner/script/ai/transient.cpp index 3edbbaa62d..8fefc8e973 100644 --- a/engines/bladerunner/script/ai/transient.cpp +++ b/engines/bladerunner/script/ai/transient.cpp @@ -76,17 +76,17 @@ bool AIScriptTransient::Update() { && !Game_Flag_Query(kFlagCT04HomelessTrashFinish) ) { Game_Flag_Set(kFlagCT04HomelessTrashFinish); - AI_Countdown_Timer_Reset(kActorTransient, 1); - AI_Countdown_Timer_Start(kActorTransient, 1, 12); + AI_Countdown_Timer_Reset(kActorTransient, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Start(kActorTransient, kActorTimerAIScriptCustomTask1, 12); } return false; } void AIScriptTransient::TimerExpired(int timer) { - if (timer == 0) { + if (timer == kActorTimerAIScriptCustomTask0) { if (Actor_Query_Goal_Number(kActorTransient) == 395 && Actor_Query_Which_Set_In(kActorMcCoy) == kSetUG13) { - AI_Countdown_Timer_Start(kActorTransient, 0, Random_Query(20, 10)); + AI_Countdown_Timer_Start(kActorTransient, kActorTimerAIScriptCustomTask0, Random_Query(20, 10)); switch (Random_Query(1, 3)) { case 1: Sound_Play(kSfxBUMSNOR1, 50, 0, 0, 50); @@ -100,17 +100,17 @@ void AIScriptTransient::TimerExpired(int timer) { } } else if (Actor_Query_Goal_Number(kActorTransient) != 599) { Actor_Set_Goal_Number(kActorTransient, 391); - AI_Countdown_Timer_Reset(kActorTransient, 0); + AI_Countdown_Timer_Reset(kActorTransient, kActorTimerAIScriptCustomTask0); } } - if (timer == 1) { + if (timer == kActorTimerAIScriptCustomTask1) { if (Actor_Query_Goal_Number(kActorTransient) == kGoalTransientDefault) { // stop diggin the trash Actor_Set_Goal_Number(kActorTransient, 10); Actor_Change_Animation_Mode(kActorTransient, kAnimationModeIdle); } Actor_Set_Goal_Number(kActorTransient, 10); Actor_Set_Targetable(kActorTransient, false); - AI_Countdown_Timer_Reset(kActorTransient, 1); + AI_Countdown_Timer_Reset(kActorTransient, kActorTimerAIScriptCustomTask1); } } @@ -210,10 +210,10 @@ bool AIScriptTransient::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 395: Actor_Change_Animation_Mode(kActorTransient, 55); - AI_Countdown_Timer_Start(kActorTransient, 0, Random_Query(30, 40)); + AI_Countdown_Timer_Start(kActorTransient, kActorTimerAIScriptCustomTask0, Random_Query(30, 40)); return true; case 599: - AI_Countdown_Timer_Reset(kActorTransient, 0); + AI_Countdown_Timer_Reset(kActorTransient, kActorTimerAIScriptCustomTask0); return true; } return false; diff --git a/engines/bladerunner/script/ai/tyrell_guard.cpp b/engines/bladerunner/script/ai/tyrell_guard.cpp index a0b95bb32d..25992c2079 100644 --- a/engines/bladerunner/script/ai/tyrell_guard.cpp +++ b/engines/bladerunner/script/ai/tyrell_guard.cpp @@ -46,15 +46,15 @@ bool AIScriptTyrellGuard::Update() { void AIScriptTyrellGuard::TimerExpired(int timer) { switch (timer) { - case 0: - AI_Countdown_Timer_Reset(kActorTyrellGuard, 0); + case kActorTimerAIScriptCustomTask0: + AI_Countdown_Timer_Reset(kActorTyrellGuard, kActorTimerAIScriptCustomTask0); if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetTB02_TB03) { Actor_Set_Goal_Number(kActorTyrellGuard, kGoalTyrellGuardWakeUpAndArrestMcCoy); } break; - case 1: - AI_Countdown_Timer_Reset(kActorTyrellGuard, 1); + case kActorTimerAIScriptCustomTask1: + AI_Countdown_Timer_Reset(kActorTyrellGuard, kActorTimerAIScriptCustomTask1); Actor_Set_Goal_Number(kActorTyrellGuard, kGoalTyrellGuardArrestMcCoy); break; } @@ -109,7 +109,7 @@ bool AIScriptTyrellGuard::GoalChanged(int currentGoalNumber, int newGoalNumber) case kGoalTyrellGuardSleeping: if (currentGoalNumber != newGoalNumber) { Actor_Change_Animation_Mode(kActorTyrellGuard, 55); - AI_Countdown_Timer_Start(kActorTyrellGuard, 0, 30); + AI_Countdown_Timer_Start(kActorTyrellGuard, kActorTimerAIScriptCustomTask0, 30); } return true; @@ -125,9 +125,9 @@ bool AIScriptTyrellGuard::GoalChanged(int currentGoalNumber, int newGoalNumber) return true; case kGoalTyrellGuardWakeUp: - AI_Countdown_Timer_Reset(kActorTyrellGuard, 0); + AI_Countdown_Timer_Reset(kActorTyrellGuard, kActorTimerAIScriptCustomTask0); Actor_Says(kActorTyrellGuard, 310, 14); - AI_Countdown_Timer_Start(kActorTyrellGuard, 1, 20); + AI_Countdown_Timer_Start(kActorTyrellGuard, kActorTimerAIScriptCustomTask1, 20); return true; case kGoalTyrellGuardArrestMcCoy: @@ -139,7 +139,7 @@ bool AIScriptTyrellGuard::GoalChanged(int currentGoalNumber, int newGoalNumber) return true; case kGoalTyrellGuardWait: - AI_Countdown_Timer_Reset(kActorTyrellGuard, 1); + AI_Countdown_Timer_Reset(kActorTyrellGuard, kActorTimerAIScriptCustomTask1); return true; } return false; diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp index aad4bfd109..a1cc7c01b6 100644 --- a/engines/bladerunner/script/ai/zuben.cpp +++ b/engines/bladerunner/script/ai/zuben.cpp @@ -58,8 +58,8 @@ bool AIScriptZuben::Update() { && Player_Query_Current_Scene() == kSceneCT01 && !Game_Flag_Query(kFlagCT01ZubenMcCoyCheck) ) { - AI_Countdown_Timer_Reset(kActorZuben, 2); - AI_Countdown_Timer_Start(kActorZuben, 2, 30); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask2); + AI_Countdown_Timer_Start(kActorZuben, kActorTimerAIScriptCustomTask2, 30); Game_Flag_Set(kFlagCT01ZubenMcCoyCheck); return true; } @@ -99,7 +99,7 @@ bool AIScriptZuben::Update() { if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenCT06AttackMcCoy && Player_Query_Current_Scene() == kSceneCT07 ) { - AI_Countdown_Timer_Reset(kActorZuben, 0); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask0); Game_Flag_Set(kFlagCT05WarehouseOpen); Actor_Set_Targetable(kActorZuben, true); if (Actor_Query_Goal_Number(kActorGordo) == kGoalGordoDefault) { @@ -118,7 +118,7 @@ bool AIScriptZuben::Update() { } void AIScriptZuben::TimerExpired(int timer) { - if (timer == 2) { // Check on McCoy every 30s + if (timer == kActorTimerAIScriptCustomTask2) { // Check on McCoy every 30s if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenDefault && Player_Query_Current_Scene() == kSceneCT01 && Random_Query(1, 3) < 3 @@ -127,19 +127,19 @@ void AIScriptZuben::TimerExpired(int timer) { } Game_Flag_Reset(kFlagCT01ZubenMcCoyCheck); // return true; - } else if (timer == 1) { + } else if (timer == kActorTimerAIScriptCustomTask1) { if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenCT02RunToFreeSlotG) { // Zuben fleeing, after 10s Music_Stop(10); Actor_Set_Goal_Number(kActorZuben, kGoalZubenCT06HideAtFreeSlotA); - AI_Countdown_Timer_Reset(kActorZuben, 1); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask1); // return true; } - } else if (timer == 0) { // Zuben fleeing, after 70s + } else if (timer == kActorTimerAIScriptCustomTask0) { // Zuben fleeing, after 70s if (Player_Query_Current_Set() != kSetCT01_CT12) { Music_Stop(2); } Actor_Set_Goal_Number(kActorZuben, kGoalZubenFled); // Let Zuben flee completly, he will catch McCoy on MA01 - AI_Countdown_Timer_Reset(kActorZuben, 0); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask0); // return true; } // return false; @@ -158,7 +158,7 @@ void AIScriptZuben::CompletedMovementTrack() { } else if (Actor_Query_Goal_Number(kActorZuben) == kGoalZubenCT06HideAtFreeSlotA && Game_Flag_Query(kFlagCT02McCoyFell) ) { - AI_Countdown_Timer_Reset(kActorZuben, 0); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask0); Game_Flag_Reset(kFlagCT02McCoyFell); Game_Flag_Set(kFlagCT02McCoyCombatReady); Game_Flag_Set(kFlagNotUsed721); @@ -332,10 +332,10 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append_Run(kActorZuben, 84, 0); AI_Movement_Track_Append_Run(kActorZuben, 85, 0); AI_Movement_Track_Append(kActorZuben, 39, 0); - AI_Countdown_Timer_Reset(kActorZuben, 1); - AI_Countdown_Timer_Start(kActorZuben, 1, 10); - AI_Countdown_Timer_Reset(kActorZuben, 0); - AI_Countdown_Timer_Start(kActorZuben, 0, 70); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask1); + AI_Countdown_Timer_Start(kActorZuben, kActorTimerAIScriptCustomTask1, 10); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask0); + AI_Countdown_Timer_Start(kActorZuben, kActorTimerAIScriptCustomTask0, 70); AI_Movement_Track_Repeat(kActorZuben); return false; @@ -400,7 +400,7 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) { return false; case kGoalZubenCT06JumpDown: - AI_Countdown_Timer_Reset(kActorZuben, 0); + AI_Countdown_Timer_Reset(kActorZuben, kActorTimerAIScriptCustomTask0); Actor_Put_In_Set(kActorZuben, kSetCT06); Actor_Set_At_XYZ(kActorZuben, 37.14f, -58.23f, 4.0f, 256); _animationFrame = 0; |