diff options
-rw-r--r-- | engines/bladerunner/game_constants.h | 18 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/gordo.cpp | 183 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.h | 8 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/hf01.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr01.cpp | 86 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr02.cpp | 123 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr03.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.h | 2 |
9 files changed, 309 insertions, 125 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index eb8e1e343f..d447b126c6 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -906,11 +906,17 @@ enum Flags { kFlagHF05toHF06 = 529, // is never checked kFlagHF06toHF05 = 530, kFlagCT11toDR01 = 531, + kFlagNR01toNR02 = 532, + kFlagNR02toNR01 = 533, + kFlagNR03toNR01 = 534, + kFlagNR01toNR03 = 535, + kFlagCT09Entered = 538, kFlagCT09LeonInterrupted = 539, kFlagCT09DeskClerkTalk = 540, kFlagGordoTalk1 = 543, kFlagGordoTalk2 = 544, + kFlagNotUsed545 = 545, // is never set kFlagDR06MannequinHeadOpen = 548, kFlagMcCoyTiedDown = 550, kFlagDR01toCT11 = 558, @@ -992,6 +998,7 @@ enum Variables { kVariableAffectionTowards = 45, // 0 none, 1 steele, 2 dektora, 3 lucy kVariableGunPulledInFrontOfSebastian = 46, kVariableDNAEvidences = 48, + kVariableNR02Music = 50, kVariableReplicants = 51, kVariableNextTvNews = 52 }; @@ -1134,8 +1141,8 @@ enum Scenes { kSceneMA05 = 51, // McCoy's Apartment - Balcony kSceneMA06 = 52, // McCoy's Apartment - Elevator kSceneMA07 = 53, // McCoy's Apartment - Ground floor - kSceneNR01 = 54, - kSceneNR02 = 55, + kSceneNR01 = 54, // Nightclub Row - Outside + kSceneNR02 = 55, // Nightclub Row - Taffy Lewis' kSceneNR03 = 56, kSceneNR04 = 57, kSceneNR05 = 58, @@ -1570,7 +1577,12 @@ enum GoalGordo { kGoalGordoGoToDNARow = 101, kGoalGordoGoToChinaTown = 102, kGoalGordoGoToFreeSlotHAGJ = 103, - kGoalGordoGoToFreeSlotAH = 104 + kGoalGordoGoToFreeSlotAH = 104, + // chapter 3 + kGoalGordoStartChapter3 = 200, + kGoalGordoWaitAtNR02 = 201, + kGoalGordoTalkToMcCoyAtNR02 = 215 + }; enum GoalGuzza { diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp index 8bc03eaa30..e16ca05601 100644 --- a/engines/bladerunner/script/ai/gordo.cpp +++ b/engines/bladerunner/script/ai/gordo.cpp @@ -72,8 +72,8 @@ bool AIScriptGordo::Update() { } if (Global_Variable_Query(kVariableChapter) == 3) { - if (Actor_Query_Goal_Number(kActorGordo) < 200) { - Actor_Set_Goal_Number(kActorGordo, 200); + if (Actor_Query_Goal_Number(kActorGordo) < kGoalGordoStartChapter3) { + Actor_Set_Goal_Number(kActorGordo, kGoalGordoStartChapter3); } if (Actor_Query_Goal_Number(kActorGordo) == 254) { Actor_Set_Goal_Number(kActorGordo, 255); @@ -151,8 +151,8 @@ void AIScriptGordo::CompletedMovementTrack() { return;// true; } - if (Actor_Query_Goal_Number(kActorGordo) > 100 - && Actor_Query_Goal_Number(kActorGordo) < 200 + if (Actor_Query_Goal_Number(kActorGordo) > kGoalGordoWalkAround + && Actor_Query_Goal_Number(kActorGordo) < kGoalGordoStartChapter3 ) { Actor_Set_Goal_Number(kActorGordo, kGoalGordoWalkAround); return;// true; @@ -170,10 +170,12 @@ void AIScriptGordo::CompletedMovementTrack() { } Actor_Set_Goal_Number(kActorGordo, 205); } + if (Actor_Query_Goal_Number(kActorGordo) == 220) { Game_Flag_Set(594); Actor_Set_Goal_Number(kActorGordo, 221); } + if (Actor_Query_Goal_Number(kActorGordo) == 222) { if (Game_Flag_Query(kFlagGordoIsReplicant)) { if (Global_Variable_Query(kVariableBehavior) == 2) { @@ -186,9 +188,11 @@ void AIScriptGordo::CompletedMovementTrack() { } Scene_Exits_Enable(); } + if (Actor_Query_Goal_Number(kActorGordo) == 225) { - Actor_Set_Goal_Number(kActorGordo, 200); + Actor_Set_Goal_Number(kActorGordo, kGoalGordoStartChapter3); } + if (Actor_Query_Goal_Number(kActorGordo) == 243) { Music_Stop(2); Actor_Set_Goal_Number(kActorGordo, 280); @@ -248,7 +252,7 @@ bool AIScriptGordo::ShotAtAndHit() { Delay(1500); Actor_Voice_Over(2410, kActorVoiceOver); Actor_Voice_Over(2420, kActorVoiceOver); - Game_Flag_Set(532); + Game_Flag_Set(kFlagNR01toNR02); Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); } if (Actor_Query_Goal_Number(kActorGordo) == 250) { @@ -303,34 +307,42 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { int rnd; switch (newGoalNumber) { + + // chapter 1 + case kGoalGordoDefault: Actor_Put_In_Set(kActorGordo, kSetCT01_CT12); Actor_Set_At_XYZ(kActorGordo, -308.44f, -12.5f, 442.78f, 256); Actor_Change_Animation_Mode(kActorGordo, 53); break; + case kGoalGordoWalkThroughCT05: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 119, 0); AI_Movement_Track_Append(kActorGordo, 118, 0); AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoLeaveCT05: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 119, 0); AI_Movement_Track_Append(kActorGordo, 33, 1); AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoGetUpCT01: Game_Flag_Set(kFlagCT01GordoTalk); Actor_Set_Goal_Number(kActorGordo, 99); Actor_Change_Animation_Mode(kActorGordo, 29); break; + case kGoalGordoWalkOutFromCT01: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 43, 0); AI_Movement_Track_Append(kActorGordo, 33, 1); AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoBidFarewellToHowieLee: Actor_Face_Actor(kActorGordo, kActorHowieLee, true); Actor_Says(kActorGordo, 0, 13); @@ -338,6 +350,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Goal_Number(kActorGordo, kGoalGordoWalkOutFromCT01); Player_Gains_Control(); break; + case kGoalGordoWalkToHowieLee: Player_Loses_Control(); Actor_Set_Immunity_To_Obstacles(kActorGordo, true); @@ -345,12 +358,15 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorGordo, 100, 0); AI_Movement_Track_Repeat(kActorGordo); break; + + // chapter 2 + case kGoalGordoWalkAround: AI_Movement_Track_Flush(kActorGordo); _animationState = 0; _animationFrame = 0; _animationStateNext = 0; - sub_41117C(); + unknown(); rnd = Random_Query(1, 4); if (Actor_Clue_Query(kActorMcCoy, kClueGordoInterview1) || Actor_Clue_Query(kActorMcCoy, kClueGordoInterview2) @@ -373,6 +389,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { break; } break; + case kGoalGordoGoToDNARow: AI_Movement_Track_Flush(kActorGordo); if (Random_Query(1, 2) == 1) { @@ -397,6 +414,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { } AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoGoToChinaTown: if (Random_Query(1, 3) == 1) { AI_Movement_Track_Append(kActorGordo, 54, 1); @@ -410,6 +428,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorGordo, 40, 15); AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoGoToFreeSlotHAGJ: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 40, Random_Query(15, 45)); @@ -422,6 +441,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorGordo, 42, Random_Query(10, 20)); AI_Movement_Track_Repeat(kActorGordo); break; + case kGoalGordoGoToFreeSlotAH: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 33, Random_Query(15, 45)); @@ -430,21 +450,24 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { } AI_Movement_Track_Repeat(kActorGordo); break; - case 200: + + // chapter 3 + + case kGoalGordoStartChapter3: if (Global_Variable_Query(kVariableBehavior) == 2) { if (Game_Flag_Query(kFlagLucyRanAway) && Game_Flag_Query(591) && Player_Query_Current_Scene() != kSceneNR02 ) { - Actor_Set_Goal_Number(kActorGordo, 201); + Actor_Set_Goal_Number(kActorGordo, kGoalGordoWaitAtNR02); } else { Actor_Set_Goal_Number(kActorGordo, 225); } } else { - Actor_Set_Goal_Number(kActorGordo, 201); + Actor_Set_Goal_Number(kActorGordo, kGoalGordoWaitAtNR02); } break; - case 201: + case kGoalGordoWaitAtNR02: AI_Movement_Track_Flush(kActorGordo); Actor_Put_In_Set(kActorGordo, kSetNR02); Actor_Set_At_XYZ(kActorGordo, 148.12f, -24.0f, 456.04f, 506); @@ -542,9 +565,11 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Goal_Number(kActorGordo, 220); } break; - case 215: - sub_4103B8(); + + case kGoalGordoTalkToMcCoyAtNR02: + talkToMcCoyAtNR02(); break; + case 220: Actor_Set_Targetable(kActorGordo, true); Scene_Exits_Disable(); @@ -553,15 +578,18 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorGordo); Music_Play(1, 50, 0, 2, -1, 0, 0); break; + case 221: Actor_Set_At_XYZ(kActorGordo, -90.91f, -24.0f, -14.71f, 708); Actor_Change_Animation_Mode(kActorGordo, 26); break; + case 222: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append_Run(kActorGordo, 367, 0); AI_Movement_Track_Repeat(kActorGordo); break; + case 225: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append(kActorGordo, 39, 10); @@ -569,18 +597,22 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorGordo, 39, 10); AI_Movement_Track_Repeat(kActorGordo); break; + case 230: Actor_Put_In_Set(kActorGordo, kSetNR01); Actor_Set_At_XYZ(kActorGordo, -194.24f, 23.88f, -851.98f, 343); break; + case 240: Actor_Put_In_Set(kActorGordo, kSetNR01); Actor_Set_At_XYZ(kActorGordo, -194.24f, 23.88f, -851.98f, 343); break; + case 241: ADQ_Add(kActorGordo, 170, 18); AI_Countdown_Timer_Start(kActorGordo, 0, 10); break; + case 242: Actor_Face_Actor(kActorGordo, kActorMcCoy, true); Actor_Says(kActorGordo, 180, 13); @@ -593,8 +625,9 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 3080, 15); Actor_Says(kActorGordo, 200, 15); Actor_Says(kActorMcCoy, 3085, 15); - dialogueWithGordo2(); + dialogue2(); break; + case 243: AI_Movement_Track_Flush(kActorGordo); AI_Movement_Track_Append_Run(kActorGordo, 369, 0); @@ -602,15 +635,18 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorGordo, 33, 0); AI_Movement_Track_Repeat(kActorGordo); break; + case 250: Actor_Put_In_Set(kActorGordo, kSetNR01); Actor_Set_At_XYZ(kActorGordo, -194.24f, 23.88f, -851.98f, 343); Actor_Change_Animation_Mode(kActorGordo, 80); Actor_Set_Goal_Number(kActorSteele, 250); break; + case 251: Actor_Change_Animation_Mode(kActorGordo, 83); break; + case 255: ADQ_Flush(); Actor_Change_Animation_Mode(kActorGordo, 83); @@ -620,15 +656,18 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { Delay(3000); Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyArrested); break; + case 260: Actor_Set_Targetable(kActorGordo, false); break; + case 280: Scene_Exits_Enable(); Game_Flag_Set(592); Actor_Put_In_Set(kActorGordo, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorGordo, 33, 0); break; + case 299: Music_Stop(2); AI_Countdown_Timer_Reset(kActorGordo, 0); @@ -637,11 +676,12 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { if (Game_Flag_Query(kFlagGordoIsReplicant)) { Actor_Change_Animation_Mode(kActorGordo, 84); } else { - Actor_Change_Animation_Mode(kActorGordo, 48); + Actor_Change_Animation_Mode(kActorGordo, kAnimationModeDie); } Actor_Set_Goal_Number(kActorGordo, 599); - Actor_Retired_Here(kActorGordo, 36, 18, 1, -1); + Actor_Retired_Here(kActorGordo, 36, 18, true, -1); break; + case 400: AI_Movement_Track_Flush(kActorGordo); Actor_Put_In_Set(kActorGordo, kSetFreeSlotA); @@ -719,6 +759,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { break; } break; + case 1: switch (_state) { case 0: @@ -754,6 +795,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { break; } break; + case 2: *animation = 114; if (Random_Query(0, 1)) { @@ -763,6 +805,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 3: *animation = 115; _animationFrame++; @@ -774,6 +817,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Set_Goal_Number(kActorGordo, kGoalGordoWalkToHowieLee); } break; + case 4: *animation = 120; if (_animationFrame == 0 && var_45B078) { @@ -786,6 +830,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { } } break; + case 5: *animation = 121; _animationFrame++; @@ -795,6 +840,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 6: *animation = 122; _animationFrame++; @@ -804,6 +850,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 7: *animation = 123; _animationFrame++; @@ -813,6 +860,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 8: *animation = 124; _animationFrame++; @@ -822,6 +870,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 9: *animation = 125; _animationFrame++; @@ -831,6 +880,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 10: *animation = 126; _animationFrame++; @@ -840,6 +890,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 11: *animation = 127; _animationFrame++; @@ -849,6 +900,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 12: *animation = 127; _animationFrame++; @@ -858,6 +910,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 4; } break; + case 13: *animation = 114; _animationFrame++; @@ -865,6 +918,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 14: *animation = 103; _animationFrame++; @@ -874,6 +928,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 16; } break; + case 15: *animation = 104; _animationFrame++; @@ -883,6 +938,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationState = 0; } break; + case 16: *animation = 93; _animationFrame++; @@ -890,8 +946,10 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 17: break; + case 18: *animation = 105; _animationFrame++; @@ -908,6 +966,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeCombatIdle); } break; + case 19: *animation = 111; _animationFrame++; @@ -918,6 +977,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeIdle); } break; + case 20: *animation = 112; _animationFrame++; @@ -928,6 +988,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeIdle); } break; + case 21: *animation = 96; _animationFrame++; @@ -938,6 +999,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeCombatIdle); } break; + case 22: *animation = 97; _animationFrame++; @@ -948,18 +1010,21 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeCombatIdle); } break; + case 23: *animation = 113; if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(113) - 1) { _animationFrame++; } break; + case 24: *animation = 100; if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(100) - 1) { ++_animationFrame; } break; + case 25: *animation = 107; _animationFrame++; @@ -967,6 +1032,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 26: *animation = 108; _animationFrame++; @@ -974,6 +1040,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 27: *animation = 98; _animationFrame++; @@ -981,6 +1048,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 28: *animation = 99; _animationFrame++; @@ -988,6 +1056,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 29: *animation = 109; _animationFrame++; @@ -995,6 +1064,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 30: *animation = 110; _animationFrame++; @@ -1002,6 +1072,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 31: *animation = 101; _animationFrame++; @@ -1009,6 +1080,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 32: *animation = 102; _animationFrame++; @@ -1016,6 +1088,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 33: *animation = 106; _animationFrame++; @@ -1030,6 +1103,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { } } break; + case 34: *animation = 119; _animationFrame++; @@ -1049,6 +1123,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeIdle); } break; + case 35: *animation = 128; _animationFrame++; @@ -1056,6 +1131,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { _animationFrame = 0; } break; + case 36: if (_animationFrame == 0 && var_45B078) { Actor_Change_Animation_Mode(kActorGordo, 80); @@ -1069,6 +1145,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { } } break; + case 37: if (_animationFrame == 0 && var_45B078) { Actor_Change_Animation_Mode(kActorGordo, 80); @@ -1082,6 +1159,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { } } break; + case 38: *animation = 131; _animationFrame++; @@ -1099,6 +1177,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Set_Goal_Number(kActorGordo, 243); } break; + case 39: *animation = 132; _animationFrame++; @@ -1139,14 +1218,17 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { break; } break; + case kAnimationModeWalk: _animationState = 25; _animationFrame = 0; break; + case kAnimationModeRun: _animationState = 26; _animationFrame = 0; break; + case kAnimationModeTalk: if (_animationState) { _animationState = 4; @@ -1158,6 +1240,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case kAnimationModeCombatIdle: switch (_animationState) { case 14: @@ -1181,18 +1264,22 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { break; } break; + case kAnimationModeCombatAttack: _animationState = 18; _animationFrame = 0; break; + case kAnimationModeCombatWalk: _animationState = 27; _animationFrame = 0; break; + case kAnimationModeCombatRun: _animationState = 28; _animationFrame = 0; break; + case 12: if (_animationState) { _animationState = 5; @@ -1204,6 +1291,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 13: if (_animationState) { _animationState = 6; @@ -1215,6 +1303,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 14: if (_animationState) { _animationState = 7; @@ -1226,6 +1315,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 15: if (_animationState) { _animationState = 8; @@ -1237,6 +1327,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 16: if (_animationState) { _animationState = 9; @@ -1248,6 +1339,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 17: if (_animationState) { _animationState = 10; @@ -1259,6 +1351,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 18: if (_animationState) { _animationState = 11; @@ -1270,6 +1363,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 19: if (_animationState) { _animationState = 12; @@ -1281,6 +1375,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } var_45B078 = 0; break; + case 21: switch (_animationState) { case 14: @@ -1309,6 +1404,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { break; } break; + case 22: if (Random_Query(0, 1)) { _animationState = 21; @@ -1317,38 +1413,47 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { } _animationFrame = 0; break; + case 23: _animationState = 34; _animationFrame = 0; break; + case 26: _animationState = 33; _animationFrame = 0; break; + case 29: _animationState = 3; _animationFrame = 0; break; + case 30: _animationState = 13; _animationFrame = 0; break; + case 44: _animationState = 29; _animationFrame = 0; break; + case 45: _animationState = 30; _animationFrame = 0; break; + case 46: _animationState = 31; _animationFrame = 0; break; + case 47: _animationState = 32; _animationFrame = 0; break; + case 48: switch (_animationState) { case 14: @@ -1368,32 +1473,39 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { break; } break; + case 49: _animationState = 24; _animationFrame = 0; break; + case 53: _animationState = 2; _animationFrame = 0; break; + case 80: _animationState = 35; _animationFrame = 0; break; + case 81: _animationState = 36; _animationFrame = 0; var_45B078 = 0; break; + case 82: _animationState = 37; _animationFrame = 0; var_45B078 = 0; break; + case 83: _animationState = 38; _animationFrame = 0; break; + case 84: _animationState = 39; _animationFrame = 0; @@ -1509,7 +1621,7 @@ void AIScriptGordo::McCoyTalkWithGordo() { return Player_Gains_Control(); } -void AIScriptGordo::sub_4103B8() { +void AIScriptGordo::talkToMcCoyAtNR02() { Player_Loses_Control(); Actor_Face_Heading(kActorMcCoy, 308, false); Actor_Says(kActorMcCoy, 3210, kAnimationModeTalk); @@ -1525,14 +1637,14 @@ void AIScriptGordo::sub_4103B8() { Actor_Says(kActorGordo, 350, 13); Actor_Says(kActorMcCoy, 3225, 18); Player_Gains_Control(); - dialogueWithGordo1(); + dialogue1(); Player_Loses_Control(); Game_Flag_Set(561); Actor_Face_Heading(kActorGordo, 506, false); Actor_Change_Animation_Mode(kActorGordo, 23); } -void AIScriptGordo::dialogueWithGordo2() { +void AIScriptGordo::dialogue2() { Music_Stop(5); Dialogue_Menu_Clear_List(); DM_Add_To_List_Never_Repeat_Once_Selected(820, -1, 5, 7); @@ -1580,29 +1692,29 @@ void AIScriptGordo::dialogueWithGordo2() { } } -void AIScriptGordo::dialogueWithGordo1() { +void AIScriptGordo::dialogue1() { Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(760, 2, 5, 6); - DM_Add_To_List_Never_Repeat_Once_Selected(770, 6, 3, 1); + DM_Add_To_List_Never_Repeat_Once_Selected(760, 2, 5, 6); // ZUBEN + DM_Add_To_List_Never_Repeat_Once_Selected(770, 6, 3, 1); // JOB if (Actor_Clue_Query(kActorMcCoy, kClueDektorasDressingRoom) || Actor_Clue_Query(kActorMcCoy, kClueWomanInAnimoidRow) ) { - DM_Add_To_List_Never_Repeat_Once_Selected(780, 5, 5, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(780, 5, 5, 5); // BLOND WOMAN } if (Actor_Clue_Query(kActorMcCoy, kClueLucy)) { - DM_Add_To_List_Never_Repeat_Once_Selected(790, 5, 5, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(790, 5, 5, 5); // LUCY } if (Actor_Clue_Query(kActorMcCoy, kClueStolenCheese)) { - DM_Add_To_List_Never_Repeat_Once_Selected(800, -1, 4, 8); + DM_Add_To_List_Never_Repeat_Once_Selected(800, -1, 4, 8); // CHEESE } - Dialogue_Menu_Add_DONE_To_List(810); + Dialogue_Menu_Add_DONE_To_List(810); // DONE Dialogue_Menu_Appear(320, 240); int answer = Dialogue_Menu_Query_Input(); Dialogue_Menu_Disappear(); switch (answer) { - case 760: + case 760: // ZUBEN Actor_Says(kActorMcCoy, 3230, kAnimationModeTalk); Actor_Says(kActorGordo, 360, 16); Actor_Says(kActorMcCoy, 3260, 15); @@ -1615,7 +1727,8 @@ void AIScriptGordo::dialogueWithGordo1() { Actor_Modify_Friendliness_To_Other(kActorGordo, kActorMcCoy, -3); } break; - case 770: + + case 770: // JOB Actor_Says(kActorMcCoy, 3235, kAnimationModeTalk); Actor_Says(kActorGordo, 410, 12); Actor_Says(kActorMcCoy, 3270, 15); @@ -1630,7 +1743,8 @@ void AIScriptGordo::dialogueWithGordo1() { } Actor_Says(kActorGordo, 460, 15); break; - case 780: + + case 780: // BLOND WOMAN Actor_Says(kActorMcCoy, 3240, kAnimationModeTalk); Actor_Says(kActorGordo, 470, 17); Actor_Says(kActorMcCoy, 3285, 16); @@ -1643,7 +1757,8 @@ void AIScriptGordo::dialogueWithGordo1() { Actor_Says(kActorGordo, 520, 12); Actor_Modify_Friendliness_To_Other(kActorGordo, kActorMcCoy, -4); break; - case 790: + + case 790: // LUCY Actor_Says(kActorMcCoy, 3245, kAnimationModeTalk); Actor_Says(kActorGordo, 470, 17); Actor_Says(kActorMcCoy, 3285, 16); @@ -1656,7 +1771,8 @@ void AIScriptGordo::dialogueWithGordo1() { Actor_Says(kActorGordo, 520, 12); Actor_Modify_Friendliness_To_Other(kActorGordo, kActorMcCoy, -1); break; - case 800: + + case 800: // CHEESE Actor_Says(kActorMcCoy, 3250, kAnimationModeTalk); Actor_Says(kActorGordo, 530, 18); Actor_Says(kActorMcCoy, 3300, 15); @@ -1669,13 +1785,14 @@ void AIScriptGordo::dialogueWithGordo1() { Actor_Says(kActorGordo, 570, 14); Actor_Clue_Acquire(kActorMcCoy, kClueGordoConfession, false, kActorGordo); break; - case 810: + + case 810: // DONE Actor_Says(kActorMcCoy, 3255, kAnimationModeTalk); break; } } -void AIScriptGordo::sub_41117C() { +void AIScriptGordo::unknown() { // this has no real use as _animationState is always 0 switch (_animationState) { case 0: diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index c03927dddd..a690c74c44 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -941,7 +941,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 232: - Game_Flag_Set(532); + Game_Flag_Set(kFlagNR01toNR02); Set_Enter(kSetNR02, kSceneNR02); return true; diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h index ac16b706a3..d137e3c86e 100644 --- a/engines/bladerunner/script/ai_script.h +++ b/engines/bladerunner/script/ai_script.h @@ -138,10 +138,10 @@ DECLARE_SCRIPT(Gordo) int _state; void McCoyTalkWithGordo(); - void sub_4103B8(); - void dialogueWithGordo2(); - void dialogueWithGordo1(); - void sub_41117C(); + void talkToMcCoyAtNR02(); + void dialogue2(); + void dialogue1(); + void unknown(); END_SCRIPT DECLARE_SCRIPT(Dektora) diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp index a469b83b66..18b3ac2e38 100644 --- a/engines/bladerunner/script/scene/hf01.cpp +++ b/engines/bladerunner/script/scene/hf01.cpp @@ -360,7 +360,7 @@ void SceneScriptHF01::PlayerWalkedIn() { } if (Game_Flag_Query(kFlagSpinnerMissing)) { - Actor_Set_Goal_Number(kActorSteele, 280); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleTalkAboutMissingSpinner); Game_Flag_Reset(kFlagSpinnerMissing); //return true; return; diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp index c91fdb43a9..d9300e427e 100644 --- a/engines/bladerunner/script/scene/nr01.cpp +++ b/engines/bladerunner/script/scene/nr01.cpp @@ -24,6 +24,13 @@ namespace BladeRunner { +enum kNR01Loops { + kNR01LoopInshot = 0, + kNR01LoopMainLoop = 1, + kNR01LoopOutshoot = 3, + kNR01LoopMainLoopNoSpinner = 4 +}; + void SceneScriptNR01::InitializeScene() { if (Game_Flag_Query(kFlagSpinnerMissing)) { Setup_Scene_Information(-153.86f, 23.88f, -570.21f, 402); @@ -31,13 +38,13 @@ void SceneScriptNR01::InitializeScene() { Setup_Scene_Information( -416.0f, 31.93f, -841.0f, 200); Actor_Set_Invisible(kActorMcCoy, true); Preload(167); - } else if (Game_Flag_Query(534)) { + } else if (Game_Flag_Query(kFlagNR03toNR01)) { Setup_Scene_Information( -416.0f, 31.93f, -841.0f, 200); } else if (Game_Flag_Query(kFlagUG06toNR01)) { Setup_Scene_Information( -270.0f, 4.93f, -1096.0f, 500); - } else if (Game_Flag_Query(533)) { + } else if (Game_Flag_Query(kFlagNR02toNR01)) { Setup_Scene_Information( 312.0f, 31.66f, -901.0f, 700); - } else if (Game_Flag_Query(545)) { + } else if (Game_Flag_Query(kFlagNotUsed545)) { Setup_Scene_Information( -170.0f, 24.0f, -574.0f, 768); } else { Setup_Scene_Information( 76.0f, 23.88f, -109.0f, 966); @@ -79,15 +86,15 @@ void SceneScriptNR01::InitializeScene() { if ( Game_Flag_Query(kFlagSpinnerAtNR01) && !Game_Flag_Query(kFlagArrivedFromSpinner1) ) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR01LoopInshot, false); + Scene_Loop_Set_Default(kNR01LoopMainLoop); Game_Flag_Set(kFlagArrivedFromSpinner1); } else if (Game_Flag_Query(kFlagSpinnerAtNR01) && Game_Flag_Query(kFlagArrivedFromSpinner1) ) { - Scene_Loop_Set_Default(1); + Scene_Loop_Set_Default(kNR01LoopMainLoop); } else { - Scene_Loop_Set_Default(4); + Scene_Loop_Set_Default(kNR01LoopMainLoopNoSpinner); } } @@ -124,12 +131,13 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { } else { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(535); + Game_Flag_Set(kFlagNR01toNR03); Set_Enter(kSetNR03, kSceneNR03); } } return true; } + if (exitId == 1) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -281.0f, 31.93f, -1061.0f, 0, true, false, 0)) { Actor_Face_Heading(kActorMcCoy, 45, false); @@ -141,15 +149,17 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { } return true; } + if (exitId == 2) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 312.0f, 31.66f, -901.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(532); + Game_Flag_Set(kFlagNR01toNR02); Set_Enter(kSetNR02, kSceneNR02); } return true; } + if (exitId == 3) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 108.0f, 23.88f, -93.0f, 0, true, false, 0)) { Game_Flag_Reset(kFlagMcCoyInChinaTown); @@ -167,7 +177,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtPS01); Set_Enter(kSetPS01, kScenePS01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationMcCoysApartment: Game_Flag_Set(kFlagMcCoyInMcCoyApartment); @@ -175,7 +185,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtMA01); Set_Enter(kSetMA01, kSceneMA01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationRuncitersAnimals: Game_Flag_Set(kFlagMcCoyInRunciters); @@ -183,7 +193,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtRC01); Set_Enter(kSetRC01, kSceneRC01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationChinatown: Game_Flag_Set(kFlagMcCoyInChinaTown); @@ -191,7 +201,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtCT01); Set_Enter(kSetCT01_CT12, kSceneCT01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationAnimoidRow: Game_Flag_Set(kFlagMcCoyInAnimoidRow); @@ -199,7 +209,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtAR01); Set_Enter(kSetAR01_AR02, kSceneAR01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationTyrellBuilding: Game_Flag_Set(kFlagMcCoyInTyrellBuilding); @@ -207,7 +217,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtTB02); Set_Enter(kSetTB02_TB03, kSceneTB02); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationDNARow: Game_Flag_Set(kFlagMcCoyInDNARow); @@ -215,7 +225,7 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtDR01); Set_Enter(kSetDR01_DR02_DR04, kSceneDR01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationBradburyBuilding: Game_Flag_Set(kFlagMcCoyInBradburyBuilding); @@ -223,14 +233,14 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { Game_Flag_Reset(kFlagArrivedFromSpinner1); Game_Flag_Set(kFlagSpinnerAtBB01); Set_Enter(kSetBB01, kSceneBB01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; case kSpinnerDestinationHysteriaHall: Game_Flag_Set(kFlagMcCoyInHysteriaHall); Game_Flag_Reset(kFlagSpinnerAtNR01); Game_Flag_Set(kFlagSpinnerAtHF01); Set_Enter(kSetHF01, kSceneHF01); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR01LoopOutshoot, true); break; default: Player_Loses_Control(); @@ -246,12 +256,17 @@ bool SceneScriptNR01::ClickedOnExit(int exitId) { } bool SceneScriptNR01::ClickedOn2DRegion(int region) { - if (region == 0 && Player_Query_Combat_Mode()) { + if (region == 0 + && Player_Query_Combat_Mode() + ) { Sound_Play(517, 100, 0, 0, 50); Actor_Set_Goal_Number(kActorSteele, 260); Scene_2D_Region_Remove(0); } - if (region == 1 && Player_Query_Combat_Mode()) { + + if (region == 1 + && Player_Query_Combat_Mode() + ) { Sound_Play(517, 100, 0, 0, 50); Actor_Set_Goal_Number(kActorGordo, 299); Actor_Set_Goal_Number(kActorSteele, 258); @@ -266,6 +281,7 @@ void SceneScriptNR01::SceneFrameAdvanced(int frame) { if (frame == 61) { Sound_Play(118, 40, 0, 0, 50); } + if (frame == 184) { Sound_Play(117, 40, 80, 80, 50); } @@ -277,7 +293,7 @@ void SceneScriptNR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptNR01::PlayerWalkedIn() { if (Game_Flag_Query(kFlagSpinnerMissing)) { - Actor_Set_Goal_Number(kActorSteele, 280); + Actor_Set_Goal_Number(kActorSteele, kGoalSteeleTalkAboutMissingSpinner); Game_Flag_Reset(kFlagSpinnerMissing); //return true; return; @@ -289,21 +305,21 @@ void SceneScriptNR01::PlayerWalkedIn() { Scene_2D_Region_Add(0, 450, 316, 464, 333); Scene_2D_Region_Add(1, 233, 321, 240, 362); ADQ_Add(kActorGordo, 70, 81); - ADQ_Add(kActorSteele, 990, 3); + ADQ_Add(kActorSteele, 990, kAnimationModeTalk); ADQ_Add(kActorGordo, 80, 82); ADQ_Add(kActorGordo, 90, 81); - ADQ_Add(kActorSteele, 1010, 3); + ADQ_Add(kActorSteele, 1010, kAnimationModeTalk); ADQ_Add(kActorGordo, 100, 81); - ADQ_Add(kActorSteele, 1020, 3); + ADQ_Add(kActorSteele, 1020, kAnimationModeTalk); ADQ_Add(kActorGordo, 110, 82); - ADQ_Add(kActorSteele, 1030, 3); - ADQ_Add(kActorSteele, 1040, 3); + ADQ_Add(kActorSteele, 1030, kAnimationModeTalk); + ADQ_Add(kActorSteele, 1040, kAnimationModeTalk); ADQ_Add(kActorGordo, 120, 82); } if (Game_Flag_Query(604)) { if (Game_Flag_Query(622)) { - ADQ_Add(kActorHanoi, 150, 3); + ADQ_Add(kActorHanoi, 150, kAnimationModeTalk); Game_Flag_Reset(622); } Game_Flag_Reset(604); @@ -319,9 +335,9 @@ void SceneScriptNR01::PlayerWalkedIn() { return; } - if (Game_Flag_Query(534)) { + if (Game_Flag_Query(kFlagNR03toNR01)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -380.0f, 31.73f, -841.0f, 0, false, false, 0); - Game_Flag_Reset(534); + Game_Flag_Reset(kFlagNR03toNR01); } else { if (Game_Flag_Query(kFlagUG06toNR01)) { Loop_Actor_Travel_Stairs(kActorMcCoy, 3, true, kAnimationModeIdle); @@ -390,16 +406,16 @@ void SceneScriptNR01::PlayerWalkedIn() { } } } - } else if (Game_Flag_Query(533)) { + } else if (Game_Flag_Query(kFlagNR02toNR01)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, 239.0f, 31.66f, -901.0f, 0, 0, false, 0); - Game_Flag_Reset(533); + Game_Flag_Reset(kFlagNR02toNR01); if (Actor_Query_Goal_Number(kActorGordo) == 230) { Scene_Exits_Disable(); Actor_Set_Goal_Number(kActorGordo, 231); Non_Player_Actor_Combat_Mode_On(kActorGordo, kActorCombatStateIdle, true, kActorMcCoy, 3, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 20, 300, false); } - } else if (Game_Flag_Query(545)) { - Game_Flag_Reset(545); + } else if (Game_Flag_Query(kFlagNotUsed545)) { + Game_Flag_Reset(kFlagNotUsed545); Actor_Put_In_Set(kActorHanoi, kSetNR01); Actor_Set_At_XYZ(kActorHanoi, -202.0f, 24.0f, -574.0f, 0); Actor_Face_Heading(kActorHanoi, 256, false); @@ -433,8 +449,8 @@ void SceneScriptNR01::PlayerWalkedOut() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); if (!Game_Flag_Query(kFlagNR01toUG06) - && !Game_Flag_Query(532) - && !Game_Flag_Query(535) + && !Game_Flag_Query(kFlagNR01toNR02) + && !Game_Flag_Query(kFlagNR01toNR03) && !Game_Flag_Query(632) && !Game_Flag_Query(722) ) { diff --git a/engines/bladerunner/script/scene/nr02.cpp b/engines/bladerunner/script/scene/nr02.cpp index 97a460032d..88909dcd97 100644 --- a/engines/bladerunner/script/scene/nr02.cpp +++ b/engines/bladerunner/script/scene/nr02.cpp @@ -25,10 +25,12 @@ namespace BladeRunner { void SceneScriptNR02::InitializeScene() { - sub_402134(); + playNextMusic(); Setup_Scene_Information(-283.0f, -24.0f, 326.0f, 200); - Game_Flag_Reset(532); + Game_Flag_Reset(kFlagNR01toNR02); + Scene_Exit_Add_2D_Exit(0, 0, 105, 75, 291, 3); + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); @@ -72,10 +74,15 @@ bool SceneScriptNR02::MouseClick(int x, int y) { } bool SceneScriptNR02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("VID PHONE 01", objectName) || Object_Query_Click("VID PHONE 02", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -191.9f, -24.0f, 62.15f, 0, 1, false, 0)) { + if (Object_Query_Click("VID PHONE 01", objectName) + || Object_Query_Click("VID PHONE 02", objectName) + ) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -191.9f, -24.0f, 62.15f, 0, true, false, 0)) { Actor_Face_Heading(kActorMcCoy, 13, false); - if (Actor_Clue_Query(kActorMcCoy, kClueFolder) && Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy) && !Game_Flag_Query(670)) { + if ( Actor_Clue_Query(kActorMcCoy, kClueFolder) + && Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy) + && !Game_Flag_Query(670) + ) { Actor_Set_Goal_Number(kActorMcCoy, 350); Game_Flag_Set(670); } else { @@ -98,27 +105,32 @@ bool SceneScriptNR02::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptNR02::ClickedOnActor(int actorId) { if (actorId == kActorGordo - && Actor_Query_Goal_Number(kActorGordo) == 201 + && Actor_Query_Goal_Number(kActorGordo) == kGoalGordoWaitAtNR02 ) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 67.37f, -24.0f, 389.32f, 0, true, false, 0)) { - Actor_Set_Goal_Number(kActorGordo, 215); + Actor_Set_Goal_Number(kActorGordo, kGoalGordoTalkToMcCoyAtNR02); } } return false; } bool SceneScriptNR02::ClickedOnItem(int itemId, bool a2) { - if ((itemId == 89 || itemId == 90) && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 109.38f, -24.0f, 420.5f, 0, true, false, 0)) { - Actor_Face_Heading(kActorMcCoy, 423, false); - if (itemId == 89) { - Item_Remove_From_World(89); - Item_Pickup_Spin_Effect(953, 214, 380); - Actor_Clue_Acquire(kActorMcCoy, kClueGordosLighter1, true, -1); - } - if (itemId == 90) { - Item_Remove_From_World(90); - Item_Pickup_Spin_Effect(954, 214, 380); - Actor_Clue_Acquire(kActorMcCoy, kClueGordosLighter2, true, -1); + if (itemId == 89 + || itemId == 90 + ) { + if(!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 109.38f, -24.0f, 420.5f, 0, true, false, 0)) { + Actor_Face_Heading(kActorMcCoy, 423, false); + if (itemId == 89) { + Item_Remove_From_World(89); + Item_Pickup_Spin_Effect(953, 214, 380); + Actor_Clue_Acquire(kActorMcCoy, kClueGordosLighter1, true, -1); + } + + if (itemId == 90) { + Item_Remove_From_World(90); + Item_Pickup_Spin_Effect(954, 214, 380); + Actor_Clue_Acquire(kActorMcCoy, kClueGordosLighter2, true, -1); + } } } return false; @@ -126,13 +138,15 @@ bool SceneScriptNR02::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR02::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -283.0f, -24.0f, 326.0f, 0, 1, false, 0)) { - if (Actor_Query_Goal_Number(kActorGordo) < 230 || Actor_Query_Goal_Number(kActorGordo) > 250) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -283.0f, -24.0f, 326.0f, 0, true, false, 0)) { + if (Actor_Query_Goal_Number(kActorGordo) < 230 + || Actor_Query_Goal_Number(kActorGordo) > 250 + ) { Music_Stop(2); } Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(533); + Game_Flag_Set(kFlagNR02toNR01); Set_Enter(kSetNR01, kSceneNR01); } return true; @@ -145,8 +159,12 @@ bool SceneScriptNR02::ClickedOn2DRegion(int region) { } void SceneScriptNR02::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing() && (Actor_Query_Goal_Number(kActorGordo) < 210 || Actor_Query_Goal_Number(kActorGordo) > 222)) { - sub_402134(); + if (!Music_Is_Playing() + && (Actor_Query_Goal_Number(kActorGordo) < 210 + || Actor_Query_Goal_Number(kActorGordo) > 222 + ) + ) { + playNextMusic(); } //return false; } @@ -158,62 +176,81 @@ void SceneScriptNR02::PlayerWalkedIn() { if (Actor_Query_Goal_Number(kActorGordo) == 211) { Actor_Set_Goal_Number(kActorGordo, 220); } + if (Actor_Query_Goal_Number(kActorGordo) == 204) { Actor_Set_Goal_Number(kActorGordo, 205); } + if (Actor_Query_Goal_Number(kActorGordo) == 206) { Actor_Set_Goal_Number(kActorGordo, 205); } - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -203.0f, -24.0f, 334.0f, 0, 0, false, 0); + + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -203.0f, -24.0f, 334.0f, 0, false, false, 0); //return false; } void SceneScriptNR02::PlayerWalkedOut() { Music_Stop(2); - if (Actor_Query_Goal_Number(kActorGordo) < 210 && Actor_Query_Goal_Number(kActorGordo) >= 205) { + if (Actor_Query_Goal_Number(kActorGordo) < 210 + && Actor_Query_Goal_Number(kActorGordo) >= 205 + ) { Actor_Set_Goal_Number(kActorGordo, 204); } } void SceneScriptNR02::DialogueQueueFlushed(int a1) { - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(kActorGordo) == 206) { + if (Player_Query_Current_Scene() == kSceneNR02 + && Actor_Query_Goal_Number(kActorGordo) == 206 + ) { Sound_Play(575, 50, 0, 0, 50); Sound_Play(321, 50, 0, 0, 50); } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(kActorGordo) == 207) { + + if (Player_Query_Current_Scene() == kSceneNR02 + && Actor_Query_Goal_Number(kActorGordo) == 207 + ) { Sound_Play(576, 50, 0, 0, 50); Sound_Play(323, 50, 0, 0, 50); } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(kActorGordo) == 208) { + + if (Player_Query_Current_Scene() == kSceneNR02 + && Actor_Query_Goal_Number(kActorGordo) == 208 + ) { Sound_Play(579, 50, 0, 0, 50); Sound_Play(324, 50, 0, 0, 50); } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(kActorGordo) > 205 && Actor_Query_Goal_Number(kActorGordo) < 210) { + + if (Player_Query_Current_Scene() == kSceneNR02 + && Actor_Query_Goal_Number(kActorGordo) > 205 + && Actor_Query_Goal_Number(kActorGordo) < 210 + ) { Actor_Set_Goal_Number(kActorGordo, 205); - //return true; - return; - } else if (Actor_Query_Goal_Number(kActorGordo) > 205 && Actor_Query_Goal_Number(kActorGordo) < 210) { + return; // true; + } + + if (Actor_Query_Goal_Number(kActorGordo) > 205 + && Actor_Query_Goal_Number(kActorGordo) < 210 + ) { Actor_Set_Goal_Number(kActorGordo, 204); - //return true; - return; + return; // true; } //return false; } -void SceneScriptNR02::sub_402134() { - int v0 = Global_Variable_Query(50); - if (v0 == 0) { +void SceneScriptNR02::playNextMusic() { + int track = Global_Variable_Query(kVariableNR02Music); + if (track == 0) { Music_Play(8, 41, 0, 2, -1, 0, 0); - } else if (v0 == 1) { + } else if (track == 1) { Music_Play(9, 41, 0, 2, -1, 0, 0); - } else if (v0 == 2) { + } else if (track == 2) { Music_Play(10, 41, 0, 2, -1, 0, 0); } - v0++; - if (v0 > 2) { - v0 = 0; + track++; + if (track > 2) { + track = 0; } - Global_Variable_Set(50, v0); + Global_Variable_Set(kVariableNR02Music, track); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr03.cpp b/engines/bladerunner/script/scene/nr03.cpp index a2a09cbb85..641b5c443d 100644 --- a/engines/bladerunner/script/scene/nr03.cpp +++ b/engines/bladerunner/script/scene/nr03.cpp @@ -132,11 +132,12 @@ bool SceneScriptNR03::ClickedOnExit(int exitId) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 410.0f, -70.19f, -715.0f, 0, 1, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(534); + Game_Flag_Set(kFlagNR03toNR01); Set_Enter(kSetNR01, kSceneNR01); } return true; } + if (exitId == 1) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -161.0f, -70.19f, -1139.0f, 0, 1, false, 0)) { if (Actor_Query_Which_Set_In(kActorHanoi) == 55) { @@ -164,6 +165,7 @@ bool SceneScriptNR03::ClickedOnExit(int exitId) { return true; } + if (exitId == 2) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -151.0f, -70.19f, -476.0f, 12, 1, false, 0)) { if (Actor_Query_Goal_Number(kActorHanoi) == 213 || Actor_Query_Which_Set_In(kActorHanoi) != 55) { @@ -261,14 +263,14 @@ void SceneScriptNR03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptNR03::PlayerWalkedIn() { Player_Set_Combat_Mode(false); if (Game_Flag_Query(573)) { - if (Game_Flag_Query(535) ) { + if (Game_Flag_Query(kFlagNR01toNR03) ) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, 302.0f, -70.19f, -715.0f, 0, 0, false, 0); - Game_Flag_Reset(535); + Game_Flag_Reset(kFlagNR01toNR03); } } else { Game_Flag_Set(573); Async_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, -70.19f, -643.0f, 0, false); - Game_Flag_Reset(535); + Game_Flag_Reset(kFlagNR01toNR03); Actor_Voice_Over(1490, kActorVoiceOver); Actor_Voice_Over(1510, kActorVoiceOver); Actor_Voice_Over(1520, kActorVoiceOver); diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index 498424af81..9f5a10029f 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -298,7 +298,7 @@ DECLARE_SCRIPT(NR01) END_SCRIPT DECLARE_SCRIPT(NR02) - void sub_402134(); + void playNextMusic(); END_SCRIPT DECLARE_SCRIPT(NR03) |