diff options
author | Peter Kohaut | 2019-02-06 22:58:41 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-02-07 23:45:19 +0100 |
commit | c99d3ea132f9ac451d4b69b56b66061f3e337ce5 (patch) | |
tree | 3940bbf61b27fab00c93a583834d82ca2aa5576d | |
parent | ee7fa40b36e5760187d24e31265bb758b36c23d3 (diff) | |
download | scummvm-rg350-c99d3ea132f9ac451d4b69b56b66061f3e337ce5.tar.gz scummvm-rg350-c99d3ea132f9ac451d4b69b56b66061f3e337ce5.tar.bz2 scummvm-rg350-c99d3ea132f9ac451d4b69b56b66061f3e337ce5.zip |
BLADERUNNER: Cleanup of Clovis scripts for chapter 5
-rw-r--r-- | engines/bladerunner/game_constants.h | 31 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/clovis.cpp | 188 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/maggie.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mutant1.cpp | 12 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/sadik.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/kp01.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/kp05.cpp | 8 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/kp06.cpp | 16 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/kp07.cpp | 37 |
10 files changed, 183 insertions, 129 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index 06c6ae9c47..7248cca5cb 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -960,7 +960,7 @@ enum Flags { kFlagTB06DogCollarTaken = 519, kFlagTB06KitchenBoxTaken = 520, kFlagHC03TrapDoorOpened = 521, - + kFlagMutantsActive = 523, kFlagUG06Chapter4Started = 524, kFlagCT10Entered = 525, // 526 is never used @@ -1019,6 +1019,7 @@ enum Flags { kFlagKP07toKP06 = 579, // 580 is never used // 581 is never used + kFlagKP07BusActive = 582, // is never set // 583 is never used kFlagHF04DoorsClosed = 584, kFlagHF04CloseDoors = 585, @@ -1093,7 +1094,8 @@ enum Flags { kFlagMA02Chapter5Started = 654, kFlagMA02RajifTalk = 655, kFlagUG02RagiationGooglesTaken = 656, - + kFlagNotUsed657 = 657, // is never set + kFlagKP07Entered = 658, kFlagNR11BreakWindow = 659, kFlagDNARowAvailableTalk = 660, kFlagTB07ShadeDown = 661, // is never set @@ -1116,7 +1118,7 @@ enum Flags { kFlagChapter4Intro = 680, // 681 is never used kFlagUG15BridgeBroken = 682, - + kFlagClovisLyingDown = 685, kFlagNotUsed686 = 686, // 687 is never used kFlagPS05TV0 = 688, @@ -1127,7 +1129,8 @@ enum Flags { kFlagUG03DeadHomeless = 693, kFlagUG14DeadHomeless = 694, // 695 is never used - + kFlagKP07ReplicantsAttackMcCoy = 696, + kFlagKP07McCoyPulledGun = 697, kFlagUG15LanceLuthorTrade = 698, // 700 is never used @@ -1144,7 +1147,7 @@ enum Flags { kFlagMA04WatchedTV = 711, kFlagMcCoyShotAtZuben = 712, kFlagDR04McCoyShotMoraji = 713, - + kFlagMcCoyAttackedReplicants = 714, kFlagDR06UnlockedToUG16 = 715, kFlagRC04BobTalk3 = 717, @@ -1629,7 +1632,7 @@ enum GameItems { kItemDogWrapper = 115, // 116 is never used // 117 is never used - + kItemPowerSource = 118, kItemTyrellSalesPamphlet = 119, kItemMoonbusPhoto = 120, kItemGreenPawnLock = 121, @@ -1945,14 +1948,28 @@ enum GoalClovis { kGoalClovisBB11TalkWithSadik = 103, kGoalClovisBB11PrepareTalkToMcCoy = 104, // bug? this is not triggered when player skips dialogue too fast kGoalClovisBB11TalkToMcCoy = 105, // ends Chapter 2 + // chapter 4 kGoalClovisUG18Wait = 300, kGoalClovisUG18SadikWillShootGuzza = 301, kGoalClovisUG18SadikIsShootingGuzza = 302, kGoalClovisUG18GuzzaDied = 303, kGoalClovisUG18Leave = 310, + kGoalClovisStartChapter3 = 350, kGoalClovisStartChapter4 = 400, kGoalClovisUG07ChaseMcCoy = 401, - kGoalClovisUG07KillMcCoy = 402 + kGoalClovisUG07KillMcCoy = 402, + // chapter 5 + kGoalClovisStartChapter5 = 500, + kGoalClovisDecide = 510, + kGoalClovisKP06Wait = 511, // this immediately reset to kGoalClovisKP07Wait by Sadik at start of chapter 5 + kGoalClovisKP06TalkToMcCoy = 512, // never triggered + kGoalClovisKP07Wait = 513, + kGoalClovisKP07TalkToMcCoy = 514, + kGoalClovisKP07SayFinalWords = 515, + kGoalClovisKP07FlyAway = 516, // and game over + kGoalClovisKP07ReplicantsAttackMcCoy = 517, + kGoalClovisKP07LayDown = 518, + kGoalClovisGone = 599 }; enum GoalLucy { diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index 1ab80abc07..a9917810fb 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -56,9 +56,9 @@ bool AIScriptClovis::Update() { } if (Global_Variable_Query(kVariableChapter) == 3 - && Actor_Query_Goal_Number(kActorClovis) < 350 + && Actor_Query_Goal_Number(kActorClovis) < kGoalClovisStartChapter3 ) { - Actor_Set_Goal_Number(kActorClovis, 350); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisStartChapter3); return true; } @@ -71,23 +71,23 @@ bool AIScriptClovis::Update() { } if (Global_Variable_Query(kVariableChapter) == 5 - && Actor_Query_Goal_Number(kActorClovis) < 500 + && Actor_Query_Goal_Number(kActorClovis) < kGoalClovisStartChapter5 ) { - Actor_Set_Goal_Number(kActorClovis, 500); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisStartChapter5); } - if (Actor_Query_Goal_Number(kActorClovis) == 511 - && Game_Flag_Query(657) + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisKP06Wait + && Game_Flag_Query(kFlagNotUsed657) ) { - Actor_Set_Goal_Number(kActorClovis, 512); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP06TalkToMcCoy); } if ( Game_Flag_Query(kFlagMcCoyIsHelpingReplicants) - && !Game_Flag_Query(696) - && Game_Flag_Query(697) + && !Game_Flag_Query(kFlagKP07ReplicantsAttackMcCoy) + && Game_Flag_Query(kFlagKP07McCoyPulledGun) ) { - Actor_Set_Goal_Number(kActorClovis, 517); - Game_Flag_Set(696); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07ReplicantsAttackMcCoy); + Game_Flag_Set(kFlagKP07ReplicantsAttackMcCoy); return true; } return false; @@ -130,7 +130,7 @@ void AIScriptClovis::ReceivedClue(int clueId, int fromActorId) { } void AIScriptClovis::ClickedByPlayer() { - if (Actor_Query_Goal_Number(kActorClovis) == 599) { + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisGone) { Actor_Face_Actor(kActorMcCoy, kActorClovis, true); Actor_Says(kActorMcCoy, 8630, 16); } @@ -152,8 +152,8 @@ void AIScriptClovis::OtherAgentEnteredCombatMode(int otherActorId, int combatMod if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants) && Actor_Query_In_Set(kActorMcCoy, kSetKP07) ) { - Game_Flag_Set(697); - Game_Flag_Set(714); + Game_Flag_Set(kFlagKP07McCoyPulledGun); + Game_Flag_Set(kFlagMcCoyAttackedReplicants); // return true; } // return false; @@ -164,17 +164,19 @@ void AIScriptClovis::ShotAtAndMissed() { } bool AIScriptClovis::ShotAtAndHit() { - if (!Game_Flag_Query(697)) { - if (Actor_Query_Goal_Number(kActorClovis) == 515) { + if (!Game_Flag_Query(kFlagKP07McCoyPulledGun)) { + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisKP07SayFinalWords) { ADQ_Flush(); - Actor_Set_Goal_Number(kActorClovis, 599); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisGone); shotAnim(); 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) { + } else if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisKP07Wait + || Actor_Query_Goal_Number(kActorClovis) == kGoalClovisKP07LayDown + ) { ADQ_Flush(); - Actor_Set_Goal_Number(kActorClovis, 599); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisGone); shotAnim(); Actor_Set_Targetable(kActorClovis, false); Music_Stop(3); @@ -187,7 +189,7 @@ void AIScriptClovis::Retired(int byActorId) { if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { if (Actor_Query_In_Set(kActorClovis, kSetKP07)) { Global_Variable_Decrement(kVariableReplicants, 1); - Actor_Set_Goal_Number(kActorClovis, 599); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisGone); if (Global_Variable_Query(kVariableReplicants) == 0) { Player_Loses_Control(); @@ -319,7 +321,7 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalClovisUG18Leave: return true; - case 350: + case kGoalClovisStartChapter3: Actor_Put_In_Set(kActorClovis, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorClovis, 33, 0); return true; @@ -353,25 +355,25 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Retired_Here(kActorMcCoy, 12, 48, true, kActorClovis); return true; - case 500: - Actor_Set_Goal_Number(kActorClovis, 510); + case kGoalClovisStartChapter5: + Actor_Set_Goal_Number(kActorClovis, kGoalClovisDecide); return true; - case 510: + case kGoalClovisDecide: if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { - Actor_Set_Goal_Number(kActorClovis, 513); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07Wait); } else { - Actor_Set_Goal_Number(kActorClovis, 511); - Game_Flag_Set(685); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP06Wait); + Game_Flag_Set(kFlagClovisLyingDown); } return true; - case 511: + case kGoalClovisKP06Wait: Actor_Put_In_Set(kActorClovis, kSetKP05_KP06); Actor_Set_At_XYZ(kActorClovis, -1072.0f, 8.26f, -708.0f, 530); return true; - case 512: + case kGoalClovisKP06TalkToMcCoy: Actor_Says(kActorClovis, 110, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2255, kAnimationModeTalk); Actor_Says(kActorClovis, 120, kAnimationModeTalk); @@ -379,10 +381,10 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorClovis, 140, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2260, kAnimationModeTalk); Actor_Says(kActorClovis, 150, kAnimationModeTalk); - Actor_Set_Goal_Number(kActorClovis, 513); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07Wait); return true; - case 513: + case kGoalClovisKP07Wait: Actor_Put_In_Set(kActorClovis, kSetKP07); Actor_Set_Targetable(kActorClovis, true); if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { @@ -396,12 +398,12 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { someAnim(); return true; - case 514: + case kGoalClovisKP07TalkToMcCoy: Actor_Says(kActorMcCoy, 2345, 16); Actor_Says(kActorClovis, 170, -1); Actor_Says(kActorClovis, 180, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2350, 17); - if (!Game_Flag_Query(714)) { + if (!Game_Flag_Query(kFlagMcCoyAttackedReplicants)) { Actor_Says(kActorMcCoy, 2355, 11); } Actor_Says(kActorClovis, 190, -1); @@ -409,10 +411,10 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 2360, 18); Actor_Says(kActorClovis, 210, kAnimationModeTalk); Actor_Says(kActorClovis, 220, -1); - Actor_Set_Goal_Number(kActorClovis, 515); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07SayFinalWords); return true; - case 515: + case kGoalClovisKP07SayFinalWords: ADQ_Add(kActorClovis, 240, -1); ADQ_Add(kActorClovis, 250, -1); ADQ_Add(kActorClovis, 260, -1); @@ -423,7 +425,7 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { ADQ_Add(kActorClovis, 300, -1); return true; - case 516: + case kGoalClovisKP07FlyAway: Actor_Says(kActorMcCoy, 8501, kAnimationModeTalk); Actor_Says(kActorClovis, 1260, kAnimationModeTalk); Actor_Says(kActorMcCoy, 8502, kAnimationModeTalk); @@ -449,31 +451,54 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Game_Over(); return true; - case 517: - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorLucy, kSetKP07)) { + case kGoalClovisKP07ReplicantsAttackMcCoy: + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorLucy, kSetKP07) + ) { Actor_Set_Goal_Number(kActorLucy, kGoalLucyGone); Global_Variable_Decrement(kVariableReplicants, 1); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorLuther, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorLuther, kSetKP07) + ) { Actor_Set_Goal_Number(kActorLuther, kGoalLutherGone); Global_Variable_Decrement(kVariableReplicants, 1); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorDektora, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorDektora, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorDektora, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorZuben, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorZuben, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorZuben, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorSadik, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorSadik, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorIzo, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorIzo, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorIzo, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorGordo, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorGordo, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorGordo, kActorCombatStateIdle, true, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } - if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorClovis, kSetKP07)) { + + if (Global_Variable_Query(kVariableChapter) == 5 + && Actor_Query_In_Set(kActorClovis, kSetKP07) + ) { Non_Player_Actor_Combat_Mode_On(kActorClovis, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } return true; @@ -482,7 +507,7 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800); Actor_Face_Heading(kActorClovis, 1022, false); Actor_Set_Targetable(kActorClovis, true); - Game_Flag_Set(685); + Game_Flag_Set(kFlagClovisLyingDown); someAnim(); return true; @@ -1073,7 +1098,9 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { case 33: *animation = 244; - if (!_animationFrame && _flag) { + if (_animationFrame == 0 + && _flag + ) { _animationState = 32; _animationFrame = 0; Actor_Change_Animation_Mode(kActorClovis, 54); @@ -1183,39 +1210,40 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) { bool AIScriptClovis::ChangeAnimationMode(int mode) { switch (mode) { case kAnimationModeIdle: - if (!Game_Flag_Query(685)) { - switch (_animationState) { - case 2: - Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); - break; - case 4: - break; - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - _flag = 1; - break; - case 12: - _flag = 1; - break; - case 13: - _animationState = 15; - _animationFrame = 0; - break; - default: - _animationState = 0; - _animationFrame = 0; - _var1 = 0; - break; - } + if (Game_Flag_Query(kFlagClovisLyingDown)) { + _animationState = 32; + _animationFrame = 0; + break; + } + + switch (_animationState) { + case 2: + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); + break; + case 4: + break; + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + _flag = 1; + break; + case 12: + _flag = 1; + break; + case 13: + _animationState = 15; + _animationFrame = 0; + break; + default: + _animationState = 0; + _animationFrame = 0; + _var1 = 0; break; } - _animationState = 32; - _animationFrame = 0; break; case kAnimationModeWalk: @@ -1230,7 +1258,7 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) { case kAnimationModeTalk: case 9: - if (Game_Flag_Query(685)) { + if (Game_Flag_Query(kFlagClovisLyingDown)) { _animationFrame = 0; _animationState = 34; } else { @@ -1465,7 +1493,7 @@ void AIScriptClovis::shotAnim() { } void AIScriptClovis::someAnim() { - if (Game_Flag_Query(685)) { + if (Game_Flag_Query(kFlagClovisLyingDown)) { _animationState = 32; _animationFrame = 0; return; diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp index 9928835e7e..c1ff0e29de 100644 --- a/engines/bladerunner/script/ai/maggie.cpp +++ b/engines/bladerunner/script/ai/maggie.cpp @@ -373,8 +373,8 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 2390, 13); if (Actor_Query_Goal_Number(kActorSadik) == 411) { Actor_Set_Goal_Number(kActorSadik, 412); - } else { - Actor_Set_Goal_Number(kActorClovis, 512); + } else { // there is no way how Maggie can explode and Sadik's goal is not 411 + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP06TalkToMcCoy); } } break; diff --git a/engines/bladerunner/script/ai/mutant1.cpp b/engines/bladerunner/script/ai/mutant1.cpp index 3849cfcaea..1ae338f334 100644 --- a/engines/bladerunner/script/ai/mutant1.cpp +++ b/engines/bladerunner/script/ai/mutant1.cpp @@ -56,21 +56,25 @@ bool AIScriptMutant1::Update() { switch (Actor_Query_Goal_Number(kActorMutant1)) { case 400: - if (!Game_Flag_Query(523) && Game_Flag_Query(524) == 1) { + if (!Game_Flag_Query(kFlagMutantsActive) + && Game_Flag_Query(kFlagUG06Chapter4Started) + ) { Actor_Set_Goal_Number(kActorMutant1, 401); Actor_Set_Goal_Number(kActorMutant2, 401); Actor_Set_Goal_Number(kActorMutant3, 401); Actor_Set_Targetable(kActorMutant1, 1); Actor_Set_Targetable(kActorMutant2, 1); Actor_Set_Targetable(kActorMutant3, 1); - Game_Flag_Set(523); + Game_Flag_Set(kFlagMutantsActive); } break; case 401: if (Actor_Query_Which_Set_In(kActorMutant1) == Player_Query_Current_Set() - && (Actor_Query_Friendliness_To_Other(kActorMutant1, kActorMcCoy) < 30 - || Actor_Query_Combat_Aggressiveness(70) >= 60)) { + && (Actor_Query_Friendliness_To_Other(kActorMutant1, kActorMcCoy) < 30 + || Actor_Query_Combat_Aggressiveness(kActorMutant1) >= 60 + ) + ) { Actor_Set_Goal_Number(kActorMutant1, 410); } break; diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index 0d6e40b75b..7a86c1d389 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -79,7 +79,7 @@ bool AIScriptSadik::Update() { } if (Actor_Query_Goal_Number(kActorSadik) == 411) { - if (Game_Flag_Query(657)) { + if (Game_Flag_Query(kFlagNotUsed657)) { Actor_Set_Goal_Number(kActorSadik, 412); } } @@ -163,7 +163,7 @@ void AIScriptSadik::ShotAtAndMissed() { if (Actor_Query_Goal_Number(kActorSadik) == 414 || Actor_Query_Goal_Number(kActorSadik) == 416 ) { - Game_Flag_Set(714); + Game_Flag_Set(kFlagMcCoyAttackedReplicants); if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) { Actor_Set_Goal_Number(kActorSadik, 418); Scene_Exits_Disable(); @@ -184,7 +184,7 @@ bool AIScriptSadik::ShotAtAndHit() { if (Actor_Query_Goal_Number(kActorSadik) == 414 || Actor_Query_Goal_Number(kActorSadik) == 416 ) { - Game_Flag_Set(714); + Game_Flag_Set(kFlagMcCoyAttackedReplicants); if (Actor_Query_Which_Set_In(kActorSadik) != kSetKP07) { Actor_Set_Goal_Number(kActorSadik, 418); Scene_Exits_Disable(); @@ -357,7 +357,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 411: Actor_Put_In_Set(kActorSadik, kSetKP05_KP06); Actor_Set_At_XYZ(kActorSadik, -1134.0f, 0.0f, 73.45f, 398); - Actor_Set_Goal_Number(kActorClovis, 513); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07Wait); Actor_Set_Goal_Number(kActorMaggie, kGoalMaggieKP05Wait); return true; @@ -431,7 +431,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 418: Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants); - Actor_Set_Goal_Number(kActorClovis, 518); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07LayDown); Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false); return true; diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index 94351950ca..1715f6d6ed 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -1279,7 +1279,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { Global_Variable_Set(kVariableChapter, 4); Scene_Exits_Enable(); Actor_Set_Health(kActorMcCoy, 50, 50); - Game_Flag_Set(523); + Game_Flag_Set(kFlagMutantsActive); Game_Flag_Set(kFlagNR01toUG06); Game_Flag_Set(kFlagChapter4Intro); Chapter_Enter(4, kSetUG06, kSceneUG06); @@ -1289,7 +1289,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { Game_Flag_Set(kFlagChapter4Starting); Global_Variable_Set(kVariableChapter, 4); Scene_Exits_Enable(); - Game_Flag_Set(523); + Game_Flag_Set(kFlagMutantsActive); Game_Flag_Set(kFlagChapter4Intro); Chapter_Enter(4, kSetUG06, kSceneUG06); return true; diff --git a/engines/bladerunner/script/scene/kp01.cpp b/engines/bladerunner/script/scene/kp01.cpp index 52f7bfb258..ab432a30e3 100644 --- a/engines/bladerunner/script/scene/kp01.cpp +++ b/engines/bladerunner/script/scene/kp01.cpp @@ -164,7 +164,7 @@ void SceneScriptKP01::PlayerWalkedIn() { Loop_Actor_Walk_To_XYZ(kActorMcCoy, 211.0f, -12.2f, -146.0f, 0, false, false, 0); if (!Game_Flag_Query(kFlagMcCoyIsHelpingReplicants) - && !Game_Flag_Query(714) + && !Game_Flag_Query(kFlagMcCoyAttackedReplicants) && Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleKP01Wait && Actor_Query_Goal_Number(kActorSteele) != kGoalSteeleGone ) { diff --git a/engines/bladerunner/script/scene/kp05.cpp b/engines/bladerunner/script/scene/kp05.cpp index 69de280027..91cfa0752b 100644 --- a/engines/bladerunner/script/scene/kp05.cpp +++ b/engines/bladerunner/script/scene/kp05.cpp @@ -59,7 +59,7 @@ void SceneScriptKP05::SceneLoaded() { if (!Actor_Clue_Query(kActorMcCoy, kCluePowerSource) && Game_Flag_Query(kFlagMcCoyIsHelpingReplicants) ) { - Item_Add_To_World(118, 960, 9, -1095.0f, 0.0f, 770.0f, 256, 24, 24, false, true, false, true); + Item_Add_To_World(kItemPowerSource, 960, kSetKP05_KP06, -1095.0f, 0.0f, 770.0f, 256, 24, 24, false, true, false, true); } } @@ -76,11 +76,11 @@ bool SceneScriptKP05::ClickedOnActor(int actorId) { } bool SceneScriptKP05::ClickedOnItem(int itemId, bool a2) { - if (itemId == 118) { + if (itemId == kItemPowerSource) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1058.0f, 0.0f, 852.0f, 0, true, false, 0)) { - Actor_Face_Item(kActorMcCoy, 118, true); + Actor_Face_Item(kActorMcCoy, kItemPowerSource, true); Actor_Clue_Acquire(kActorMcCoy, kCluePowerSource, true, -1); - Item_Remove_From_World(118); + Item_Remove_From_World(kItemPowerSource); Item_Pickup_Spin_Effect(960, 58, 321); } } diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp index 5087e33e44..466b957b3f 100644 --- a/engines/bladerunner/script/scene/kp06.cpp +++ b/engines/bladerunner/script/scene/kp06.cpp @@ -76,7 +76,7 @@ bool SceneScriptKP06::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptKP06::ClickedOnActor(int actorId) { if ( actorId == kActorSadik - && !Game_Flag_Query(714) + && !Game_Flag_Query(kFlagMcCoyAttackedReplicants) ) { if (Actor_Clue_Query(kActorSadik, kCluePowerSource)) { Actor_Face_Actor(kActorMcCoy, kActorSadik, true); @@ -115,9 +115,9 @@ bool SceneScriptKP06::ClickedOnExit(int exitId) { if (Actor_Clue_Query(kActorSadik, kCluePowerSource) || Actor_Query_Goal_Number(kActorSadik) != 416 ) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, true, false, 0)) { if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { - if (!Game_Flag_Query(714)) { + if (!Game_Flag_Query(kFlagMcCoyAttackedReplicants)) { Player_Set_Combat_Mode(false); } } else if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleKP06Leave) { @@ -130,11 +130,11 @@ bool SceneScriptKP06::ClickedOnExit(int exitId) { Game_Flag_Set(kFlagKP06toKP07); Set_Enter(kSetKP07, kSceneKP07); } - } else if (Actor_Clue_Query(kActorMcCoy, kCluePowerSource) ) { - Actor_Says(kActorSadik, 280, 3); - Actor_Says(kActorSadik, 290, 3); + } else if (Actor_Clue_Query(kActorMcCoy, kCluePowerSource)) { + Actor_Says(kActorSadik, 280, kAnimationModeTalk); + Actor_Says(kActorSadik, 290, kAnimationModeTalk); Actor_Clue_Acquire(kActorSadik, kCluePowerSource, true, kActorMcCoy); - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -731.0f, 8.26f, -657.0f, 0, false, true, 0); Player_Set_Combat_Mode(false); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); @@ -196,7 +196,7 @@ void SceneScriptKP06::PlayerWalkedIn() { Actor_Face_Actor(kActorMcCoy, kActorGaff, true); Actor_Says(kActorMcCoy, 6245, 11); Actor_Says(kActorGaff, 230, 14); - if (Game_Flag_Query(714)) { + if (Game_Flag_Query(kFlagMcCoyAttackedReplicants)) { Actor_Says(kActorMcCoy, 6250, 15); Actor_Says(kActorGaff, 240, 13); Delay(1000); diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp index 4574252015..c087e4fb9d 100644 --- a/engines/bladerunner/script/scene/kp07.cpp +++ b/engines/bladerunner/script/scene/kp07.cpp @@ -85,7 +85,7 @@ void SceneScriptKP07::InitializeScene() { Ambient_Sounds_Add_Looping_Sound(586, 52, 1, 1); Ambient_Sounds_Add_Looping_Sound(109, 38, 1, 1); - if (Game_Flag_Query(582)) { + if (Game_Flag_Query(kFlagKP07BusActive)) { Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(0); @@ -114,20 +114,25 @@ bool SceneScriptKP07::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptKP07::ClickedOnActor(int actorId) { if (actorId == kActorClovis) { - if (Game_Flag_Query(697) || actorId != kActorClovis || Actor_Query_Goal_Number(kActorClovis) == 599 || Actor_Query_Goal_Number(kActorClovis) == 515) { - return false; - } - if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { - Actor_Set_Goal_Number(kActorClovis, 516); - } else { - Music_Play(20, 31, 0, 0, -1, 1, 0); - Actor_Set_Goal_Number(kActorClovis, 514); + if (!Game_Flag_Query(kFlagKP07McCoyPulledGun) + && Actor_Query_Goal_Number(kActorClovis) != kGoalClovisGone + && Actor_Query_Goal_Number(kActorClovis) != kGoalClovisKP07SayFinalWords + ) { + if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07FlyAway); + } else { + Music_Play(20, 31, 0, 0, -1, 1, 0); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07TalkToMcCoy); + } + return true; } } else { Actor_Face_Actor(kActorMcCoy, actorId, true); Actor_Says(kActorMcCoy, 8590, 14); + return true; } - return true; + + return false; } bool SceneScriptKP07::ClickedOnItem(int itemId, bool a2) { @@ -159,7 +164,7 @@ void SceneScriptKP07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptKP07::PlayerWalkedIn() { Loop_Actor_Walk_To_XYZ(kActorMcCoy, 9.0f, -41.88f, -81.0f, 0, 0, false, 0); - if (!Game_Flag_Query(658)) { + if (!Game_Flag_Query(kFlagKP07Entered)) { if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) { Actor_Face_Actor(kActorMcCoy, kActorClovis, true); Actor_Says(kActorClovis, 1240, 3); @@ -176,7 +181,7 @@ void SceneScriptKP07::PlayerWalkedIn() { Actor_Says(kActorClovis, 160, 3); Actor_Retired_Here(kActorClovis, 72, 60, 0, -1); } - Game_Flag_Set(658); + Game_Flag_Set(kFlagKP07Entered); } } @@ -185,11 +190,11 @@ void SceneScriptKP07::PlayerWalkedOut() { } void SceneScriptKP07::DialogueQueueFlushed(int a1) { - if (Actor_Query_Goal_Number(kActorClovis) == 515) { + if (Actor_Query_Goal_Number(kActorClovis) == kGoalClovisKP07SayFinalWords) { Actor_Set_Targetable(kActorClovis, false); - Actor_Change_Animation_Mode(kActorClovis, 21); - Actor_Retired_Here(kActorClovis, 12, 48, 1, -1); - Actor_Set_Goal_Number(kActorClovis, 599); + Actor_Change_Animation_Mode(kActorClovis, kAnimationModeHit); + Actor_Retired_Here(kActorClovis, 12, 48, true, -1); + Actor_Set_Goal_Number(kActorClovis, kGoalClovisGone); } } |