diff options
author | Peter Kohaut | 2019-01-29 20:34:10 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-29 23:36:29 +0100 |
commit | 2c3af4b8e967386dd1e27641b82c0bec03d75bc8 (patch) | |
tree | f8772843593d099047b0c008cf65c3b78b4a8151 /engines/bladerunner/script | |
parent | 4ba4902c3d559bacaa0177fceea936ac41f0df60 (diff) | |
download | scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.tar.gz scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.tar.bz2 scummvm-rg350-2c3af4b8e967386dd1e27641b82c0bec03d75bc8.zip |
BLADERUNNER: Cleanup of front EarlyQ's scenes scripts
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/early_q.cpp | 203 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/gordo.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/hanoi.cpp | 301 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/lucy.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 85 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/steele.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr01.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr03.cpp | 252 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr04.cpp | 44 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr05.cpp | 218 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr08.cpp | 24 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.h | 10 |
13 files changed, 658 insertions, 503 deletions
diff --git a/engines/bladerunner/script/ai/early_q.cpp b/engines/bladerunner/script/ai/early_q.cpp index 2e45ffeb6d..e06c52a547 100644 --- a/engines/bladerunner/script/ai/early_q.cpp +++ b/engines/bladerunner/script/ai/early_q.cpp @@ -44,64 +44,80 @@ void AIScriptEarlyQ::Initialize() { } bool AIScriptEarlyQ::Update() { - if (Global_Variable_Query(kVariableChapter) != 1 || Game_Flag_Query(490)) { - if (Global_Variable_Query(kVariableChapter) != 2 || Game_Flag_Query(491)) { - if (Global_Variable_Query(kVariableChapter) != 3 || Game_Flag_Query(564)) { - return false; - } else { - Game_Flag_Set(564); - Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); - Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); - Actor_Set_Goal_Number(kActorEarlyQ, 200); - } - } else { - Game_Flag_Set(491); - Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); - Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); - Actor_Set_Goal_Number(kActorEarlyQ, 100); - } - } else { - Game_Flag_Set(490); + if ( Global_Variable_Query(kVariableChapter) == 1 + && !Game_Flag_Query(kFlagEarlyQStartedChapter1) + ) { + Game_Flag_Set(kFlagEarlyQStartedChapter1); Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); Actor_Set_Goal_Number(kActorEarlyQ, 0); + return true; } - return true; + if ( Global_Variable_Query(kVariableChapter) == 2 + && !Game_Flag_Query(kFlagEarlyQStartedChapter2) + ) { + Game_Flag_Set(kFlagEarlyQStartedChapter2); + Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); + Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); + Actor_Set_Goal_Number(kActorEarlyQ, 100); + return true; + } + + if ( Global_Variable_Query(kVariableChapter) == 3 + && !Game_Flag_Query(kFlagEarlyQStartedChapter3) + ) { + Game_Flag_Set(kFlagEarlyQStartedChapter3); + Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); + Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQStartWalkingAround); + return true; + } + + return false; } void AIScriptEarlyQ::TimerExpired(int timer) { - if (Actor_Query_Goal_Number(kActorEarlyQ) == 221 && !timer) { + if (timer == 0 + && Actor_Query_Goal_Number(kActorEarlyQ) == 221 + ) { if (Player_Query_Current_Scene() == 58) { AI_Countdown_Timer_Reset(kActorEarlyQ, 0); Actor_Set_Goal_Number(kActorEarlyQ, 222); } else { - Actor_Set_Goal_Number(kActorEarlyQ, 220); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR05); } + return; //true; } - if (Actor_Query_Goal_Number(kActorEarlyQ) != 205 || timer) { - if (Actor_Query_Goal_Number(kActorEarlyQ) == 211 && timer == 1) { - AI_Countdown_Timer_Reset(kActorEarlyQ, 1); - Player_Loses_Control(); - Actor_Change_Animation_Mode(kActorEarlyQ, 29); - Delay(2500); - Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, 1); - Actor_Change_Animation_Mode(kActorEarlyQ, 6); - Delay(100); - _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, 22); - Delay(250); - _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, 48); - Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1); - } else { - return; //false; - } - } else { + + if (timer == 0 + && Actor_Query_Goal_Number(kActorEarlyQ) == 205 + ) { Player_Loses_Control(); AI_Countdown_Timer_Reset(kActorEarlyQ, 0); Actor_Set_Goal_Number(kActorEarlyQ, 215); + return; //true; } - return; //true; + if (timer == 1 + && Actor_Query_Goal_Number(kActorEarlyQ) == 211 + ) { + AI_Countdown_Timer_Reset(kActorEarlyQ, 1); + Player_Loses_Control(); + Actor_Change_Animation_Mode(kActorEarlyQ, 29); + Delay(2500); + Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, 1); + Actor_Change_Animation_Mode(kActorEarlyQ, 6); + Delay(100); + _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, kAnimationModeCombatHit); + Delay(250); + _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, kAnimationModeDie); + Actor_Retired_Here(kActorMcCoy, 12, 12, true, -1); + + return; //true; + } + + return; //false; } void AIScriptEarlyQ::CompletedMovementTrack() { @@ -150,8 +166,8 @@ void AIScriptEarlyQ::CompletedMovementTrack() { Actor_Set_Goal_Number(kActorEarlyQ, 223); return; //false; - case 230: - Actor_Set_Goal_Number(kActorEarlyQ, 200); + case kGoalEarlyQGoToNR04: + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQStartWalkingAround); return; //false; default: @@ -182,43 +198,52 @@ void AIScriptEarlyQ::OtherAgentExitedThisScene(int otherActorId) { } void AIScriptEarlyQ::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { - if (Game_Flag_Query(569) != 1 || otherActorId || combatMode != 1 || Game_Flag_Query(609)) { - if (Actor_Query_Goal_Number(kActorEarlyQ) != 211 || otherActorId || combatMode) { - return; //false; - } else { - if (Game_Flag_Query(565) == 1) { - Game_Flag_Reset(565); - } - AI_Countdown_Timer_Reset(kActorEarlyQ, 1); - Actor_Set_Goal_Number(kActorEarlyQ, 213); - } - } else { + if ( Game_Flag_Query(569) + && otherActorId == kActorMcCoy + && combatMode + && !Game_Flag_Query(609) + ) { if (!Game_Flag_Query(565)) { Game_Flag_Set(565); } Game_Flag_Set(609); AI_Countdown_Timer_Reset(kActorEarlyQ, 0); Actor_Set_Goal_Number(kActorEarlyQ, 206); + return; // true; } - return; //true; + if ( Actor_Query_Goal_Number(kActorEarlyQ) == 211 + && otherActorId == kActorMcCoy + && !combatMode + ) { + if (Game_Flag_Query(565) == 1) { + Game_Flag_Reset(565); + } + AI_Countdown_Timer_Reset(kActorEarlyQ, 1); + Actor_Set_Goal_Number(kActorEarlyQ, 213); + return; //true; + } + + return; //false; } void AIScriptEarlyQ::ShotAtAndMissed() { - if (Actor_Query_Goal_Number(kActorEarlyQ) != 211) - return; //false; - - Actor_Set_Goal_Number(kActorEarlyQ, 216); - return; //true; + if (Actor_Query_Goal_Number(kActorEarlyQ) == 211) { + Actor_Set_Goal_Number(kActorEarlyQ, 216); + //return true; + } + // return false; } bool AIScriptEarlyQ::ShotAtAndHit() { - if (Actor_Query_Goal_Number(kActorEarlyQ) < 201 || Actor_Query_Goal_Number(kActorEarlyQ) > 217) - return 0; - - Actor_Set_Goal_Number(kActorEarlyQ, 216); + if (Actor_Query_Goal_Number(kActorEarlyQ) >= 201 + && Actor_Query_Goal_Number(kActorEarlyQ) <= 217 + ) { + Actor_Set_Goal_Number(kActorEarlyQ, 216); + return true; + } - return true; + return false; } void AIScriptEarlyQ::Retired(int byActorId) { @@ -277,19 +302,19 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorEarlyQ); break; - case 200: + case kGoalEarlyQStartWalkingAround: AI_Movement_Track_Flush(kActorEarlyQ); Actor_Put_In_Set(kActorEarlyQ, kSetFreeSlotH); Actor_Set_At_Waypoint(kActorEarlyQ, 40, 0); - if (Game_Flag_Query(47) == 1 - && Game_Flag_Query(kFlagGordoRanWay) + if (Game_Flag_Query(kFlagDektoraIsReplicant) + && Game_Flag_Query(kFlagGordoRanAway) && Game_Flag_Query(kFlagLucyRanAway) ) { - Actor_Set_Goal_Number(kActorEarlyQ, 220); - } else if (Game_Flag_Query(47)) { - Actor_Set_Goal_Number(kActorEarlyQ, 230); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR05); + } else if (Game_Flag_Query(kFlagDektoraIsReplicant)) { + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR04); } else { - Actor_Set_Goal_Number(kActorEarlyQ, 220); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR05); } break; @@ -397,9 +422,9 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Repeat(kActorEarlyQ); break; - case 220: + case kGoalEarlyQGoToNR05: if (Player_Query_Current_Set() == kSetNR05_NR08) { - Actor_Set_Goal_Number(kActorEarlyQ, 230); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR04); } else { Actor_Put_In_Set(kActorEarlyQ, kSetNR05_NR08); Actor_Set_At_XYZ(kActorEarlyQ, -671.56f, 0.0f, -287.02f, 849); @@ -425,7 +450,7 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Goal_Number(kActorEarlyQ, 224); Actor_Set_Goal_Number(kActorHanoi, 230); } else { - Actor_Set_Goal_Number(kActorEarlyQ, 220); + Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQGoToNR05); } break; @@ -438,7 +463,7 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Countdown_Timer_Reset(kActorEarlyQ, 0); break; - case 230: + case kGoalEarlyQGoToNR04: AI_Movement_Track_Flush(kActorEarlyQ); if (Random_Query(1, 3) > 1) { AI_Movement_Track_Append(kActorEarlyQ, 322, Random_Query(15, 30)); @@ -820,7 +845,7 @@ bool AIScriptEarlyQ::UpdateAnimation(int *animation, int *frame) { bool AIScriptEarlyQ::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kAnimationModeIdle: switch (_animationState) { case 1: Actor_Change_Animation_Mode(kActorEarlyQ, 73); @@ -864,30 +889,35 @@ bool AIScriptEarlyQ::ChangeAnimationMode(int mode) { } break; - case 1: + case kAnimationModeWalk: _animationState = 5; _animationFrame = 0; break; - case 3: + case kAnimationModeTalk: _animationState = 20; _animationFrame = 0; _flag = 0; break; - case 4: - if ((unsigned int)(_animationState - 12) > 3 || (_animationState != 12 && _animationState != 13 && _animationState != 15)) { + case kAnimationModeCombatIdle: + if ((unsigned int)(_animationState - 12) > 3 + || (_animationState != 12 + && _animationState != 13 + && _animationState != 15 + ) + ) { _animationState = 13; _animationFrame = 0; } break; - case 6: + case kAnimationModeCombatAttack: _animationState = 15; _animationFrame = 0; break; - case 7: + case kAnimationModeCombatWalk: _animationState = 6; _animationFrame = 0; break; @@ -940,8 +970,13 @@ bool AIScriptEarlyQ::ChangeAnimationMode(int mode) { _flag = 0; break; - case 21: - if ((unsigned int)(_animationState - 12) > 3 || (_animationState != 12 && _animationState != 13 && _animationState != 15)) { + case kAnimationModeHit: + if ((unsigned int)(_animationState - 12) > 3 + || (_animationState != 12 + && _animationState != 13 + && _animationState != 15 + ) + ) { if (Random_Query(0, 1)) { _animationState = 16; } else { @@ -974,7 +1009,7 @@ bool AIScriptEarlyQ::ChangeAnimationMode(int mode) { _flag = 0; break; - case 48: + case kAnimationModeDie: _animationState = 4; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp index 82a28666d7..f8137e8b53 100644 --- a/engines/bladerunner/script/ai/gordo.cpp +++ b/engines/bladerunner/script/ai/gordo.cpp @@ -273,7 +273,7 @@ bool AIScriptGordo::ShotAtAndHit() { void AIScriptGordo::Retired(int byActorId) { if (Actor_Query_Goal_Number(kActorGordo) == kGoalGordoNR01Attack) { Player_Loses_Control(); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Actor_Set_Goal_Number(kActorGordo, kGoalGordoDead); Delay(2000); Player_Set_Combat_Mode(false); @@ -680,7 +680,7 @@ bool AIScriptGordo::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalGordoNR01RanAway: Scene_Exits_Enable(); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Actor_Put_In_Set(kActorGordo, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorGordo, 33, 0); break; @@ -1116,7 +1116,7 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) { Actor_Change_Animation_Mode(kActorGordo, kAnimationModeCombatIdle); if (Game_Flag_Query(kFlagNR02GordoJumpDown)) { Actor_Set_Goal_Number(kActorGordo, kGoalGordoNR02RunAway3); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); } } break; @@ -1683,7 +1683,7 @@ void AIScriptGordo::dialogue2() { Game_Flag_Reset(kFlagSpinnerAtNR01); Game_Flag_Reset(kFlagSpinnerAtHF01); Game_Flag_Set(kFlagSpinnerAtPS01); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Scene_Exits_Enable(); Game_Flag_Reset(kFlagMcCoyInNightclubRow); Game_Flag_Set(kFlagMcCoyInPoliceStation); @@ -1703,7 +1703,7 @@ void AIScriptGordo::dialogue2() { Delay(1000); Actor_Says(kActorGordo, 570, 13); } - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Scene_Exits_Enable(); Actor_Set_Goal_Number(kActorGordo, kGoalGordoNR01RunAway); } diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp index 91be365379..f01e5ad89c 100644 --- a/engines/bladerunner/script/ai/hanoi.cpp +++ b/engines/bladerunner/script/ai/hanoi.cpp @@ -26,7 +26,7 @@ namespace BladeRunner { AIScriptHanoi::AIScriptHanoi(BladeRunnerEngine *vm) : AIScriptBase(vm) { _var1 = 0; - _var2 = 0; + _flag1 = 0; _var3 = 0; _var4 = 1; } @@ -38,7 +38,7 @@ void AIScriptHanoi::Initialize() { _animationNext = 0; _var1 = 0; - _var2 = 0; + _flag1 = 0; _var3 = 0; _var4 = 1; @@ -49,35 +49,49 @@ bool AIScriptHanoi::Update() { if (Actor_Query_Goal_Number(kActorHolloway) == kGoalHollowayGoToNR07) { AI_Countdown_Timer_Reset(kActorHanoi, 0); } - if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorHanoi) < 200) { - Actor_Set_Goal_Number(kActorHanoi, 210); + + if (Global_Variable_Query(kVariableChapter) == 3 + && Actor_Query_Goal_Number(kActorHanoi) < kGoalHanoiDefault + ) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); } - if (Player_Query_Current_Scene() != 56 && Actor_Query_Goal_Number(kActorHanoi) == 236) { - Actor_Set_Goal_Number(kActorHanoi, 210); + + if (Player_Query_Current_Scene() != kSceneNR03 + && Actor_Query_Goal_Number(kActorHanoi) == 236 + ) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); } - if (Player_Query_Current_Scene() == 56 - && Actor_Query_Goal_Number(kActorHanoi) != 215 - && Actor_Query_Goal_Number(kActorHanoi) != 230 - && Actor_Query_Goal_Number(kActorHanoi) != 235 - && Actor_Query_Goal_Number(kActorHanoi) != 236) { + + if (Player_Query_Current_Scene() == kSceneNR03 + && Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiNR03StartGuarding + && Actor_Query_Goal_Number(kActorHanoi) != 230 + && Actor_Query_Goal_Number(kActorHanoi) != 235 + && Actor_Query_Goal_Number(kActorHanoi) != 236 + ) { + // McCoy close to table swivel if (Actor_Query_Inch_Distance_From_Waypoint(kActorMcCoy, 364) < 420) { - if (Actor_Query_Goal_Number(kActorHanoi) == 210) { - Actor_Set_Goal_Number(kActorHanoi, 211); + if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03GoToDefaultPosition) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToSwivelTable); } - } else if (Actor_Query_Goal_Number(kActorHanoi) == 211) { - Actor_Set_Goal_Number(kActorHanoi, 210); + } else if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03GoToSwivelTable) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); } + + // McCoy close to office door if (Actor_Query_Inch_Distance_From_Waypoint(kActorMcCoy, 361) < 240) { - if (Actor_Query_Goal_Number(kActorHanoi) == 210) { - Actor_Set_Goal_Number(kActorHanoi, 212); + if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03GoToDefaultPosition) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToOfficeDoor); } - } else if (Actor_Query_Goal_Number(kActorHanoi) == 212) { - Actor_Set_Goal_Number(kActorHanoi, 210); + } else if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03GoToOfficeDoor) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); } + + // McCoy close to dancer if (Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorHysteriaPatron1) < 120 - && Actor_Query_Which_Set_In(kActorHanoi) == 55 - && Actor_Query_Goal_Number(kActorHanoi) != 213) { - Actor_Set_Goal_Number(kActorHanoi, 213); + && Actor_Query_Which_Set_In(kActorHanoi) == kSetNR03 + && Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiNR03GoToDancer + ) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDancer); } } @@ -86,30 +100,21 @@ bool AIScriptHanoi::Update() { void AIScriptHanoi::TimerExpired(int timer) { if (timer == 0) { - if (Actor_Query_Goal_Number(kActorHanoi) == 215) { - Actor_Set_Goal_Number(kActorHanoi, 210); + if (Actor_Query_Goal_Number(kActorHanoi) == kGoalHanoiNR03StartGuarding) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); return; //true; } - if (Actor_Query_Goal_Number(kActorHanoi) == 220) - return; //false; - - Actor_Set_Goal_Number(kActorHanoi, 202); - return; //true; + if (Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiNR03ThrowOutMcCoy) { + Actor_Set_Goal_Number(kActorHanoi, 202); + return; //true; + } } return; //false; } void AIScriptHanoi::CompletedMovementTrack() { switch (Actor_Query_Goal_Number(kActorHanoi)) { - case 235: - Actor_Set_Goal_Number(kActorHanoi, 236); - break; - - case 240: - Actor_Set_Goal_Number(kActorHanoi, 241); - break; - case 202: Actor_Says(kActorHanoi, 130, 3); Actor_Says(kActorDektora, 540, 30); @@ -117,17 +122,25 @@ void AIScriptHanoi::CompletedMovementTrack() { break; case 203: - Actor_Face_Actor(kActorHanoi, kActorMcCoy, 1); - Actor_Face_Actor(kActorMcCoy, kActorHanoi, 1); + Actor_Face_Actor(kActorHanoi, kActorMcCoy, true); + Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); Actor_Change_Animation_Mode(kActorHanoi, 23); - Actor_Set_Invisible(kActorMcCoy, 1); - Actor_Says(kActorMcCoy, 3595, 3); - Actor_Says(kActorHanoi, 140, 3); - Actor_Set_Goal_Number(kActorHanoi, 220); + Actor_Set_Invisible(kActorMcCoy, true); + Actor_Says(kActorMcCoy, 3595, kAnimationModeTalk); + Actor_Says(kActorHanoi, 140, kAnimationModeTalk); + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy); + break; + + case kGoalHanoiNR03GoToDancer: + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); + break; + + case 235: + Actor_Set_Goal_Number(kActorHanoi, 236); break; - case 213: - Actor_Set_Goal_Number(kActorHanoi, 210); + case 240: + Actor_Set_Goal_Number(kActorHanoi, 241); break; default: @@ -142,12 +155,14 @@ void AIScriptHanoi::ReceivedClue(int clueId, int fromActorId) { } void AIScriptHanoi::ClickedByPlayer() { - if (Actor_Query_Goal_Number(kActorHanoi) == 230 || Actor_Query_Goal_Number(kActorHanoi) == 235) { - Actor_Face_Actor(kActorMcCoy, kActorHanoi, 1); + if (Actor_Query_Goal_Number(kActorHanoi) == 230 + || Actor_Query_Goal_Number(kActorHanoi) == 235 + ) { + Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); Actor_Says(kActorMcCoy, 8915, 11); if (Actor_Query_Goal_Number(kActorHanoi) == 230) { - Actor_Says(kActorHanoi, 210, 3); + Actor_Says(kActorHanoi, 210, kAnimationModeTalk); } } } @@ -165,14 +180,16 @@ void AIScriptHanoi::OtherAgentExitedThisScene(int otherActorId) { } void AIScriptHanoi::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { - if (Player_Query_Current_Scene() != 56 || otherActorId || combatMode != 1) { - return; //false; + if (Player_Query_Current_Scene() == kSceneNR03 + && otherActorId == kActorMcCoy + && combatMode + ) { + Player_Set_Combat_Mode(kActorMcCoy); + Player_Loses_Control(); + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy); + return; //true; } - Player_Set_Combat_Mode(0); - Player_Loses_Control(); - Actor_Set_Goal_Number(kActorHanoi, 220); - - return; //true; + return; //false; } void AIScriptHanoi::ShotAtAndMissed() { @@ -192,7 +209,7 @@ int AIScriptHanoi::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueI } bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { - if (!newGoalNumber) { + if (newGoalNumber == 0) { AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append(kActorHanoi, 39, 0); AI_Movement_Track_Repeat(kActorHanoi); @@ -201,7 +218,7 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { } switch (newGoalNumber) { - case 200: + case kGoalHanoiDefault: AI_Countdown_Timer_Start(kActorHanoi, 0, 45); break; @@ -210,11 +227,13 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { break; case 202: - if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetNR07 && Actor_Query_In_Set(kActorDektora, kSetNR07)) { + if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetNR07 + && Actor_Query_In_Set(kActorDektora, kSetNR07) + ) { Player_Loses_Control(); Actor_Put_In_Set(kActorHanoi, kSetNR07); Actor_Set_At_XYZ(kActorHanoi, -102.0f, -73.5f, -233.0f, 0); - Async_Actor_Walk_To_Waypoint(kActorMcCoy, 338, 0, 0); + Async_Actor_Walk_To_Waypoint(kActorMcCoy, 338, 0, false); AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append(kActorHanoi, 336, 1); AI_Movement_Track_Repeat(kActorHanoi); @@ -237,45 +256,45 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Change_Animation_Mode(kActorHanoi, 23); break; - case 210: + case kGoalHanoiNR03GoToDefaultPosition: AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append_With_Facing(kActorHanoi, 362, 0, 300); AI_Movement_Track_Repeat(kActorHanoi); break; - case 211: + case kGoalHanoiNR03GoToSwivelTable: AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append_With_Facing(kActorHanoi, 363, 0, 500); AI_Movement_Track_Repeat(kActorHanoi); break; - case 212: + case kGoalHanoiNR03GoToOfficeDoor: AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append_With_Facing(kActorHanoi, 361, 0, 457); AI_Movement_Track_Repeat(kActorHanoi); break; - case 213: + case kGoalHanoiNR03GoToDancer: AI_Movement_Track_Flush(kActorHanoi); AI_Movement_Track_Append_With_Facing(kActorHanoi, 365, Random_Query(15, 20), 600); AI_Movement_Track_Repeat(kActorHanoi); break; - case 215: + 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); break; - case 220: - Game_Flag_Set(604); + case kGoalHanoiNR03ThrowOutMcCoy: + Game_Flag_Set(kFlagNR03McCoyThrownOut); AI_Countdown_Timer_Reset(kActorHanoi, 0); Player_Loses_Control(); - Player_Set_Combat_Mode(0); + Player_Set_Combat_Mode(false); Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Change_Animation_Mode(kActorMcCoy, 48); - Actor_Set_Invisible(kActorMcCoy, 1); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie); + Actor_Set_Invisible(kActorMcCoy, true); AI_Movement_Track_Flush(kActorHanoi); Actor_Put_In_Set(kActorHanoi, kSetNR01); Actor_Set_At_XYZ(kActorHanoi, -444.0f, 24.0f, -845.0f, 512); @@ -327,54 +346,67 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) { bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { switch (_animationState) { case 0: - if (_var2 == 1) { + if (_flag1) { *animation = 649; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(649)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { *animation = 648; _animationFrame = 0; - _var2 = 0; + _flag1 = false; } - } else if (_var2 == 0) { - *animation = 648; - if (_var3) { - _var3--; - if (!Random_Query(0, 6)) { - _var4 = -_var4; - } - } else { - _animationFrame += _var4; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(648)) { - _animationFrame = 0; - } - if (_animationFrame < 0) { - _animationFrame = Slice_Animation_Query_Number_Of_Frames(648) - 1; - } - if (_animationFrame == 5 || _animationFrame == 15 || _animationFrame == 11 || !_animationFrame) { - _var3 = Random_Query(5, 12); - } - if (_animationFrame >= 10 && _animationFrame <= 13) { - _var3 = Random_Query(0, 1); - } - if (!_animationFrame) { - if (!Random_Query(0, 4)) { - _var2 = 1; - } + break; + } + + *animation = 648; + if (_var3 != 0) { + _var3--; + if (!Random_Query(0, 6)) { + _var4 = -_var4; + } + } else { + _animationFrame += _var4; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { + _animationFrame = 0; + } + + if (_animationFrame < 0) { + _animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1; + } + + if (_animationFrame == 5 + || _animationFrame == 15 + || _animationFrame == 11 + || _animationFrame == 0 + ) { + _var3 = Random_Query(5, 12); + } + + if (_animationFrame >= 10 + && _animationFrame <= 13 + ) { + _var3 = Random_Query(0, 1); + } + + if (_animationFrame == 0) { + if (!Random_Query(0, 4)) { + _flag1 = true; } } } break; case 1: - if (_var2) { + if (_flag1) { *animation = 649; - if ( Slice_Animation_Query_Number_Of_Frames(649) < Slice_Animation_Query_Number_Of_Frames(649)) { + if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) { _animationFrame += 2; } else { _animationFrame -= 2; } - if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(649) - 1 - || _animationFrame <= 0) { + + if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1 + || _animationFrame <= 0 + ) { _animationFrame = 0; _animationState = _animationStateNext; *animation = _animationNext; @@ -389,7 +421,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 2: *animation = 657; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(657)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 3; *animation = 658; @@ -399,7 +431,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 3: *animation = 658; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(658)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; } break; @@ -407,7 +439,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 4: *animation = 659; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(659)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 3; *animation = 658; @@ -421,8 +453,9 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { _animationState = 0; _animationFrame = 0; *animation = 648; - Actor_Face_Actor(kActorMcCoy, kActorHanoi, 1); - Actor_Set_Invisible(kActorMcCoy, 0); + + Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); + Actor_Set_Invisible(kActorMcCoy, false); if (Actor_Query_In_Set(kActorHanoi, kSetNR01)) { AI_Movement_Track_Flush(kActorHanoi); @@ -434,22 +467,22 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { break; case 6: - *animation = 345; + *animation = 345; // Sadik is used in this animation, but he is well hidden _animationFrame++; if (_animationFrame > 26) { - Actor_Change_Animation_Mode(kActorHanoi, 0); + Actor_Change_Animation_Mode(kActorHanoi, kAnimationModeIdle); _animationState = 0; _animationFrame = 0; *animation = 648; Actor_Set_Goal_Number(kActorMcCoy, 210); - Actor_Set_Goal_Number(kActorHanoi, 210); + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition); } break; case 7: *animation = 645; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(645)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; } break; @@ -457,7 +490,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 8: *animation = 642; _animationFrame++; - if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(642) - 1) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; } break; @@ -465,8 +498,8 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 9: *animation = 643; _animationFrame++; - if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(643) - 1) { - Actor_Change_Animation_Mode(kActorHanoi, 4); + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { + Actor_Change_Animation_Mode(kActorHanoi, kAnimationModeCombatIdle); _animationState = 8; _animationFrame = 0; *animation = 642; @@ -477,17 +510,21 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 10: *animation = 644; _animationFrame++; + if (_animationFrame == 4) { Ambient_Sounds_Play_Sound(492, 77, 0, 0, 20); } + if (_animationFrame == 6) { Ambient_Sounds_Play_Sound(493, 97, 0, 0, 20); } + if (_animationFrame == 5) { Actor_Force_Stop_Walking(kActorMcCoy); Actor_Change_Animation_Mode(kActorMcCoy, 48); } - if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { + + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { Actor_Change_Animation_Mode(kActorHanoi, 4); _animationFrame = 0; _animationState = 8; @@ -498,7 +535,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 11: *animation = 660; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(660)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { *animation = 648; _animationFrame = 0; _animationState = 0; @@ -508,7 +545,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 12: *animation = 646; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(646)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { *animation = 642; _animationFrame = 0; _animationState = 0; @@ -517,18 +554,20 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 13: *animation = 647; - if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(647) - 1) { + if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { _animationFrame++; } break; case 14: *animation = 650; - if (!_animationFrame && _var1) { + if (_animationFrame == 0 + && _var1 // this is never set so it's always 0 + ) { _animationState = 0; } else { _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(650)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; } } @@ -537,7 +576,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 15: *animation = 651; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(651)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -547,7 +586,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 16: *animation = 652; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(652)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -557,7 +596,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 17: *animation = 653; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(653)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -567,7 +606,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 18: *animation = 654; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(654)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -577,7 +616,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 19: *animation = 655; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(655)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -587,7 +626,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { case 20: *animation = 656; _animationFrame++; - if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(656)) { + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { _animationFrame = 0; _animationState = 14; *animation = 650; @@ -605,10 +644,12 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) { bool AIScriptHanoi::ChangeAnimationMode(int mode) { switch (mode) { case kAnimationModeIdle: - if ((unsigned int)(_animationState - 2) > 1) { - _animationState = 0; - } else { + if (_animationState == 2 + || _animationState == 3 + ) { _animationState = 3; + } else { + _animationState = 0; } _animationFrame = 0; break; @@ -682,7 +723,9 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) { break; case 23: - if (_animationState != 3 && _animationState != 4) { + if (_animationState != 3 + && _animationState != 4 + ) { Actor_Set_Invisible(kActorMcCoy, true); _animationState = 2; _animationFrame = 0; diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp index f735415851..981c8fc31c 100644 --- a/engines/bladerunner/script/ai/lucy.cpp +++ b/engines/bladerunner/script/ai/lucy.cpp @@ -282,7 +282,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalLucyMoveAround: if (Global_Variable_Query(kVariableHollowayArrest) == 3) { if (Game_Flag_Query(591) - && Game_Flag_Query(kFlagGordoRanWay) + && Game_Flag_Query(kFlagGordoRanAway) && Player_Query_Current_Scene() != kSceneHF03 ) { Actor_Set_Goal_Number(kActorLucy, kGoalLucyGoToHF03); diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index b532088f5a..720c8ef1ea 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -327,38 +327,23 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Face_Actor(kActorMcCoy, kActorSadik, true); return true; - case 231: - Player_Set_Combat_Mode(false); - Preload(18); - Set_Enter(kSetNR10, kSceneNR10); - Player_Loses_Control(); - Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Put_In_Set(kActorMcCoy, kSetNR10); - Actor_Set_At_XYZ(kActorMcCoy, 14.0f, 110.84f, -300.0f, 926); - Actor_Change_Animation_Mode(kActorMcCoy, 48); - _animationState = 27; - _animationFrame = 0; - flt_462714 = 2.84f; - flt_462710 = 110.84f; - off_45A100 = -6.0f; - return true; - - case 230: - dword_45A0FC = Actor_Query_Goal_Number(kActorSteele) == 215; - Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack); - return true; - case 220: - Actor_Change_Animation_Mode(kActorMcCoy, 75); + case 200: + Player_Loses_Control(); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); return true; - case 212: - Global_Variable_Set(47, 0); - Player_Set_Combat_Mode_Access(false); - Player_Gains_Control(); - Scene_Exits_Disable(); - _animationState = 68; - _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + case kGoalMcCoyNR03ThrownOut: + Actor_Put_In_Set(kActorMcCoy, kSetNR01); + Actor_Set_At_XYZ(kActorMcCoy, -204.0f, 24.0f, -817.0f, 256); + Actor_Set_Invisible(kActorMcCoy, false); + if (Game_Flag_Query(627)) { + Actor_Set_Goal_Number(kActorMcCoy, 212); + } else { + _animationState = 53; + _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + Actor_Set_Invisible(kActorMcCoy, false); + } return true; case 211: @@ -375,22 +360,38 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { Player_Gains_Control(); return true; - case 210: - Actor_Put_In_Set(kActorMcCoy, kSetNR01); - Actor_Set_At_XYZ(kActorMcCoy, -204.0, 24.0, -817.0, 256); - Actor_Set_Invisible(kActorMcCoy, false); - if (Game_Flag_Query(627)) { - Actor_Set_Goal_Number(kActorMcCoy, 212); - } else { - _animationState = 53; - _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - Actor_Set_Invisible(kActorMcCoy, false); - } + case 212: + Global_Variable_Set(47, 0); + Player_Set_Combat_Mode_Access(false); + Player_Gains_Control(); + Scene_Exits_Disable(); + _animationState = 68; + _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1; return true; - case 200: + case 220: + Actor_Change_Animation_Mode(kActorMcCoy, 75); + return true; + + case 230: + dword_45A0FC = Actor_Query_Goal_Number(kActorSteele) == 215; + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack); + return true; + + case 231: + Player_Set_Combat_Mode(false); + Preload(18); + Set_Enter(kSetNR10, kSceneNR10); Player_Loses_Control(); - Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); + Actor_Force_Stop_Walking(kActorMcCoy); + Actor_Put_In_Set(kActorMcCoy, kSetNR10); + Actor_Set_At_XYZ(kActorMcCoy, 14.0f, 110.84f, -300.0f, 926); + Actor_Change_Animation_Mode(kActorMcCoy, 48); + _animationState = 27; + _animationFrame = 0; + flt_462714 = 2.84f; + flt_462710 = 110.84f; + off_45A100 = -6.0f; return true; case 301: diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index fa0d9cc91c..af6a76c48a 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -1124,7 +1124,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Says(kActorMcCoy, 3065, 18); Actor_Says(kActorSteele, 1280, 13); Actor_Says(kActorSteele, 1290, 13); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Player_Gains_Control(); if (Game_Flag_Query(kFlagSpinnerAtHF01)) { Actor_Put_In_Set(kActorSteele, kSetHF01); @@ -1152,7 +1152,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { case kGoalSteeleNR01McCoyShotGordo: Game_Flag_Reset(kFlagSteeleAimingAtGordo); ADQ_Flush(); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Actor_Set_Targetable(kActorSteele, false); Delay(1000); Player_Set_Combat_Mode(false); @@ -1186,7 +1186,7 @@ bool AIScriptSteele::GoalChanged(int currentGoalNumber, int newGoalNumber) { _animationFrame = 0; Actor_Set_Goal_Number(kActorGordo, kGoalGordoNR01ReleaseHostage); Game_Flag_Reset(kFlagSteeleAimingAtGordo); - Game_Flag_Set(kFlagGordoRanWay); + Game_Flag_Set(kFlagGordoRanAway); Actor_Set_Targetable(kActorSteele, false); Player_Loses_Control(); return true; diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h index fc7a0b1417..134a6a9608 100644 --- a/engines/bladerunner/script/ai_script.h +++ b/engines/bladerunner/script/ai_script.h @@ -290,7 +290,7 @@ END_SCRIPT DECLARE_SCRIPT(Hanoi) int _var1; - int _var2; + bool _flag1; int _var3; int _var4; END_SCRIPT diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp index 856960b646..6089e6a917 100644 --- a/engines/bladerunner/script/scene/nr01.cpp +++ b/engines/bladerunner/script/scene/nr01.cpp @@ -319,12 +319,12 @@ void SceneScriptNR01::PlayerWalkedIn() { ADQ_Add(kActorGordo, 120, 82); } - if (Game_Flag_Query(604)) { + if (Game_Flag_Query(kFlagNR03McCoyThrownOut)) { if (Game_Flag_Query(622)) { ADQ_Add(kActorHanoi, 150, kAnimationModeTalk); Game_Flag_Reset(622); } - Game_Flag_Reset(604); + Game_Flag_Reset(kFlagNR03McCoyThrownOut); Player_Gains_Control(); //return true; return; diff --git a/engines/bladerunner/script/scene/nr03.cpp b/engines/bladerunner/script/scene/nr03.cpp index 641b5c443d..e2f627dca1 100644 --- a/engines/bladerunner/script/scene/nr03.cpp +++ b/engines/bladerunner/script/scene/nr03.cpp @@ -24,26 +24,34 @@ namespace BladeRunner { +enum kNR03Loops { + kNR03LoopMainLoop = 0, + kNR03LoopTableSwivel = 2 +}; + void SceneScriptNR03::InitializeScene() { - if (Game_Flag_Query(537)) { - Setup_Scene_Information(-301.98f, -70.19f, -348.58f, 0); - } else if (Game_Flag_Query(437)) { - Setup_Scene_Information(-161.0f, -70.19f, -1139.0f, 500); - Game_Flag_Reset(437); + if (Game_Flag_Query(kFlagNR05toNR03)) { + Setup_Scene_Information(-301.98f, -70.19f, -348.58f, 0); + } else if (Game_Flag_Query(kFlatNR04toNR03)) { + Setup_Scene_Information( -161.0f, -70.19f, -1139.0f, 500); + Game_Flag_Reset(kFlatNR04toNR03); } else { - Setup_Scene_Information(410.0f, -70.19f, -715.0f, 690); + Setup_Scene_Information( 410.0f, -70.19f, -715.0f, 690); } - Scene_Exit_Add_2D_Exit(0, 561, 0, 639, 216, 1); - Scene_Exit_Add_2D_Exit(1, 210, 85, 240, 145, 0); - Scene_Exit_Add_2D_Exit(2, 0, 135, 85, 295, 3); + + Scene_Exit_Add_2D_Exit(0, 561, 0, 639, 216, 1); + Scene_Exit_Add_2D_Exit(1, 210, 85, 240, 145, 0); + Scene_Exit_Add_2D_Exit(2, 0, 135, 85, 295, 3); + Scene_2D_Region_Add(0, 331, 73, 375, 114); + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(259, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(260, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(261, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); @@ -57,21 +65,26 @@ void SceneScriptNR03::InitializeScene() { Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(573)) { - if (Game_Flag_Query(537)) { - Scene_Loop_Start_Special(0, 2, 0); - Scene_Loop_Set_Default(0); - Game_Flag_Reset(537); + + if (Game_Flag_Query(kFlagNR03Entered)) { + if (Game_Flag_Query(kFlagNR05toNR03)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR03LoopTableSwivel, false); + Scene_Loop_Set_Default(kNR03LoopMainLoop); + Game_Flag_Reset(kFlagNR05toNR03); } else { - Scene_Loop_Set_Default(0); + Scene_Loop_Set_Default(kNR03LoopMainLoop); } } else { - Actor_Set_Goal_Number(kActorGuzza, 201); - Scene_Loop_Start_Special(0, 2, 0); - Scene_Loop_Set_Default(0); + Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaSitAtNR03); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR03LoopTableSwivel, false); + Scene_Loop_Set_Default(kNR03LoopMainLoop); } - if (Actor_Query_Goal_Number(kActorHanoi) > 209 && Actor_Query_Goal_Number(kActorHanoi) < 215) { - Actor_Set_Goal_Number(kActorHanoi, 215); + + // Guarding in NR03 + if (Actor_Query_Goal_Number(kActorHanoi) > 209 + && Actor_Query_Goal_Number(kActorHanoi) < 215 + ) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03StartGuarding); } } @@ -105,16 +118,16 @@ bool SceneScriptNR03::ClickedOnActor(int actorId) { if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorHanoi, 48, true, false)) { AI_Movement_Track_Pause(kActorHanoi); Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); - if (Game_Flag_Query(611)) { - Actor_Says(kActorMcCoy, 3350, 16); - Actor_Says(kActorHanoi, 50, 17); - } else { - Game_Flag_Set(611); - Actor_Says(kActorMcCoy, 3340, 3); + if (!Game_Flag_Query(kFlagNR03HanoiTalk)) { + Game_Flag_Set(kFlagNR03HanoiTalk); + Actor_Says(kActorMcCoy, 3340, kAnimationModeTalk); Actor_Face_Actor(kActorHanoi, kActorMcCoy, true); Actor_Says(kActorHanoi, 30, 13); Actor_Says(kActorMcCoy, 3345, 14); Actor_Says(kActorHanoi, 40, 14); + } else { + Actor_Says(kActorMcCoy, 3350, 16); + Actor_Says(kActorHanoi, 50, 17); } AI_Movement_Track_Unpause(kActorHanoi); return true; @@ -129,7 +142,7 @@ bool SceneScriptNR03::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR03::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 410.0f, -70.19f, -715.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 410.0f, -70.19f, -715.0f, 0, true, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(kFlagNR03toNR01); @@ -139,70 +152,74 @@ bool SceneScriptNR03::ClickedOnExit(int exitId) { } 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) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -161.0f, -70.19f, -1139.0f, 0, true, false, 0)) { + if (Actor_Query_Which_Set_In(kActorHanoi) == kSetNR03) { AI_Movement_Track_Pause(kActorHanoi); Actor_Face_Actor(kActorHanoi, kActorMcCoy, true); Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); - int v3 = Global_Variable_Query(44); - if (v3 == 0) { + int warnings = Global_Variable_Query(kVariableHanoiNR04Warnings); + if (warnings == 0) { Actor_Says(kActorHanoi, 50, 13); AI_Movement_Track_Unpause(kActorHanoi); - } else if (v3 == 1) { + } else if (warnings == 1) { Actor_Says(kActorHanoi, 210, 15); AI_Movement_Track_Unpause(kActorHanoi); - } else if (v3 == 2) { - Actor_Set_Goal_Number(kActorHanoi, 220); + } else if (warnings == 2) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy); } + // game bug? after reentering this does nothing as variable is never reset or checked for > 2 + Global_Variable_Increment(kVariableHanoiNR04Warnings, 1); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(kFlatNR03toNR04); + Set_Enter(kSetNR04, kSceneNR04); } - Global_Variable_Increment(44, 1); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(438); - Set_Enter(kSetNR04, kSceneNR04); } 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) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -151.0f, -70.19f, -476.0f, 12, true, false, 0)) { + if (Actor_Query_Which_Set_In(kActorHanoi) == kSetNR03 + && Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiNR03GoToDancer + ) { + Actor_Face_Heading(kActorMcCoy, 680, false); + Actor_Change_Animation_Mode(kActorMcCoy, 12); + Delay(150); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle); + AI_Movement_Track_Pause(kActorHanoi); + Actor_Face_Actor(kActorHanoi, kActorMcCoy, true); + + int warnings = Global_Variable_Query(kVariableHanoiNR05Warnings); + if (warnings == 0) { + Actor_Says(kActorHanoi, 0, 15); + Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); + Actor_Says(kActorMcCoy, 3335, 13); + Actor_Says(kActorHanoi, 10, 16); + AI_Movement_Track_Unpause(kActorHanoi); + } else if (warnings == 1) { + Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); + Actor_Says(kActorHanoi, 210, 12); + AI_Movement_Track_Unpause(kActorHanoi); + } else if (warnings == 2) { + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy); + } + // game bug? after reentering this does nothing as variable is never reset or checked for > 2 + Global_Variable_Increment(kVariableHanoiNR05Warnings, 1); + } else { Player_Loses_Control(); Player_Set_Combat_Mode(false); - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -229.0f, -70.19f, -469.0f, 0, 0, false, 1); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -229.0f, -70.19f, -469.0f, 0, false, false, 1); Actor_Face_Heading(kActorMcCoy, 656, false); Actor_Change_Animation_Mode(kActorMcCoy, 53); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(536); + Game_Flag_Set(kFlagNR03toNR05); Set_Enter(kSetNR05_NR08, kSceneNR05); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 2, 0); - return true; - } - Actor_Face_Heading(kActorMcCoy, 680, false); - Actor_Change_Animation_Mode(kActorMcCoy, 12); - Delay(150); - Actor_Change_Animation_Mode(kActorMcCoy, 0); - AI_Movement_Track_Pause(kActorHanoi); - Actor_Face_Actor(kActorHanoi, kActorMcCoy, true); - - int v1 = Global_Variable_Query(43); - if (v1 == 0) { - Actor_Says(kActorHanoi, 0, 15); - Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); - Actor_Says(kActorMcCoy, 3335, 13); - Actor_Says(kActorHanoi, 10, 16); - AI_Movement_Track_Unpause(kActorHanoi); - } else if (v1 == 1) { - Actor_Face_Actor(kActorMcCoy, kActorHanoi, true); - Actor_Says(kActorHanoi, 210, 12); - AI_Movement_Track_Unpause(kActorHanoi); - } else if (v1 == 2) { - Actor_Set_Goal_Number(kActorHanoi, 220); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR03LoopTableSwivel, false); } - Global_Variable_Increment(43, 1); } return true; } @@ -211,17 +228,17 @@ bool SceneScriptNR03::ClickedOnExit(int exitId) { bool SceneScriptNR03::ClickedOn2DRegion(int region) { if (region == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 79.2f, -70.19f, -984.0f, 12, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 79.2f, -70.19f, -984.0f, 12, true, false, 0)) { Actor_Face_Actor(kActorMcCoy, kActorHysteriaPatron1, true); - int v1 = Random_Query(0, 4); - if (v1 == 0) { - Actor_Says(kActorMcCoy, 1055, 3); - } else if (v1 == 1) { - Actor_Says(kActorMcCoy, 8590, 3); - } else if (v1 == 2) { - Actor_Says(kActorMcCoy, 8930, 3); - } else if (v1 == 3) { - Actor_Says(kActorMcCoy, 7465, 3); + int rnd = Random_Query(0, 4); + if (rnd == 0) { + Actor_Says(kActorMcCoy, 1055, kAnimationModeTalk); + } else if (rnd == 1) { + Actor_Says(kActorMcCoy, 8590, kAnimationModeTalk); + } else if (rnd == 2) { + Actor_Says(kActorMcCoy, 8930, kAnimationModeTalk); + } else if (rnd == 3) { + Actor_Says(kActorMcCoy, 7465, kAnimationModeTalk); } } return true; @@ -231,24 +248,25 @@ bool SceneScriptNR03::ClickedOn2DRegion(int region) { void SceneScriptNR03::SceneFrameAdvanced(int frame) { if (!Music_Is_Playing()) { - sub_402994(); + playNextMusic(); } + if (frame == 72) { Sound_Play(345, 83, -70, -70, 50); } + if (frame == 76) { Sound_Play(353, 62, -70, -70, 50); } - if (frame > 70 && frame < 110) { - sub_40259C(frame); - } else { - if (frame != 110) { - //return false; - return; - } - if (Actor_Query_Goal_Number(kActorGuzza) == 201) { + + if (frame > 70 + && frame < 110 + ) { + rotateActorOnTable(frame); + } else if (frame == 110) { + if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaSitAtNR03) { Actor_Set_Goal_Number(kActorGuzza, 200); - } else if (!Game_Flag_Query(536)) { + } else if (!Game_Flag_Query(kFlagNR03toNR05)) { Actor_Set_Goal_Number(kActorMcCoy, 200); Player_Gains_Control(); } @@ -262,30 +280,29 @@ 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(kFlagNR01toNR03) ) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, 302.0f, -70.19f, -715.0f, 0, 0, false, 0); - Game_Flag_Reset(kFlagNR01toNR03); - } - } else { - Game_Flag_Set(573); + if (!Game_Flag_Query(kFlagNR03Entered)) { + Game_Flag_Set(kFlagNR03Entered); Async_Actor_Walk_To_XYZ(kActorMcCoy, 206.0f, -70.19f, -643.0f, 0, false); Game_Flag_Reset(kFlagNR01toNR03); Actor_Voice_Over(1490, kActorVoiceOver); Actor_Voice_Over(1510, kActorVoiceOver); Actor_Voice_Over(1520, kActorVoiceOver); + } else if (Game_Flag_Query(kFlagNR01toNR03) ) { + Loop_Actor_Walk_To_XYZ(kActorMcCoy, 302.0f, -70.19f, -715.0f, 0, false, false, 0); + Game_Flag_Reset(kFlagNR01toNR03); } + if (Player_Query_Combat_Mode()) { - Actor_Set_Goal_Number(kActorHanoi, 220); + Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy); } //return false; } void SceneScriptNR03::PlayerWalkedOut() { - if (!Game_Flag_Query(438)) { + if (!Game_Flag_Query(kFlatNR03toNR04)) { Music_Stop(2); } - if (Game_Flag_Query(536)) { + if (Game_Flag_Query(kFlagNR03toNR05)) { Player_Gains_Control(); } } @@ -293,22 +310,25 @@ void SceneScriptNR03::PlayerWalkedOut() { void SceneScriptNR03::DialogueQueueFlushed(int a1) { } -void SceneScriptNR03::sub_40259C(int frame) { +void SceneScriptNR03::rotateActorOnTable(int frame) { int facing; float angle, invertedAngle; angle = cos((frame - 70) * (M_PI / 40.0f)) * M_PI_2; invertedAngle = M_PI - angle; - if (!Game_Flag_Query(536) && Actor_Query_Goal_Number(kActorGuzza) != 201) { + if (!Game_Flag_Query(kFlagNR03toNR05) + && Actor_Query_Goal_Number(kActorGuzza) != kGoalGuzzaSitAtNR03 + ) { angle = angle + M_PI; invertedAngle = invertedAngle + M_PI; } + float c = cos(invertedAngle); float s = sin(invertedAngle); float x = 36.49f * s - -60.21f * c + -265.49f; float z = -60.21f * s + 36.49f * c + -408.79f; - if (Actor_Query_Goal_Number(kActorGuzza) == 201) { + if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaSitAtNR03) { facing = angle * (512.0f / M_PI); facing = facing + 144; if (facing < 0) { @@ -332,23 +352,23 @@ void SceneScriptNR03::sub_40259C(int frame) { } } -void SceneScriptNR03::sub_402994() { +void SceneScriptNR03::playNextMusic() { if (Music_Is_Playing()) { Music_Adjust(51, 0, 2); } else { - int v0 = Global_Variable_Query(53); - if (v0 == 0) { + int track = Global_Variable_Query(kVariableNR03Music); + if (track == 0) { Music_Play(14, 51, 0, 2, -1, 0, 0); - } else if (v0 == 1) { + } else if (track == 1) { Music_Play(13, 51, 0, 2, -1, 0, 0); - } else if (v0 == 2) { + } else if (track == 2) { Music_Play(5, 51, 0, 2, -1, 0, 0); } - v0++; - if (v0 > 2) { - v0 = 0; + track++; + if (track > 2) { + track = 0; } - Global_Variable_Set(53, v0); + Global_Variable_Set(kVariableNR03Music, track); } } diff --git a/engines/bladerunner/script/scene/nr04.cpp b/engines/bladerunner/script/scene/nr04.cpp index 05250e82fe..f4d784cf2e 100644 --- a/engines/bladerunner/script/scene/nr04.cpp +++ b/engines/bladerunner/script/scene/nr04.cpp @@ -26,11 +26,15 @@ namespace BladeRunner { void SceneScriptNR04::InitializeScene() { Music_Adjust(30, 80, 2); + Setup_Scene_Information(53.0f, 0.0f, -110.0f, 569); + Scene_Exit_Add_2D_Exit(0, 498, 126, 560, 238, 0); - Scene_2D_Region_Add(0, 0, 259, 61, 479); - Scene_2D_Region_Add(1, 62, 327, 92, 479); + + Scene_2D_Region_Add(0, 0, 259, 61, 479); + Scene_2D_Region_Add(1, 62, 327, 92, 479); Scene_2D_Region_Add(2, 93, 343, 239, 479); + Ambient_Sounds_Add_Looping_Sound(408, 16, 0, 1); Ambient_Sounds_Add_Looping_Sound(384, 16, 0, 1); Ambient_Sounds_Add_Sound(259, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); @@ -46,6 +50,7 @@ void SceneScriptNR04::InitializeScene() { Ambient_Sounds_Add_Sound(191, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(192, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(195, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(0); } @@ -62,9 +67,12 @@ void SceneScriptNR04::SceneLoaded() { } bool SceneScriptNR04::MouseClick(int x, int y) { - if (Actor_Query_Animation_Mode(kActorMcCoy) == 85 || Actor_Query_Animation_Mode(kActorMcCoy) == 29) { + if (Actor_Query_Animation_Mode(kActorMcCoy) == 85 + || Actor_Query_Animation_Mode(kActorMcCoy) == 29 + ) { return true; } + if (Actor_Query_Animation_Mode(kActorMcCoy) == 53) { Actor_Change_Animation_Mode(kActorMcCoy, 29); return true; @@ -73,8 +81,13 @@ bool SceneScriptNR04::MouseClick(int x, int y) { } bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("B.TV01", objectName) || Object_Query_Click("B.TV02", objectName) || Object_Query_Click("B.TV03", objectName) || Object_Query_Click("B.TV05", objectName) || Object_Query_Click("DESK", objectName)) { - if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 546, 0, 1, false)) { + if (Object_Query_Click("B.TV01", objectName) + || Object_Query_Click("B.TV02", objectName) + || Object_Query_Click("B.TV03", objectName) + || Object_Query_Click("B.TV05", objectName) + || Object_Query_Click("DESK", objectName) + ) { + if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 546, 0, true, false)) { if (!Object_Query_Click("DESK", objectName)) { Actor_Face_Object(kActorMcCoy, "B.TV01", true); Actor_Voice_Over(1530, kActorVoiceOver); @@ -86,7 +99,7 @@ bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { Actor_Voice_Over(1600, kActorVoiceOver); Actor_Voice_Over(1610, kActorVoiceOver); } else if (Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt)) { - Actor_Says(kActorMcCoy, 8580, 3); + Actor_Says(kActorMcCoy, 8580, kAnimationModeTalk); } else { Actor_Clue_Acquire(kActorMcCoy, kClueCollectionReceipt, false, -1); Item_Pickup_Spin_Effect(961, 247, 141); @@ -98,9 +111,10 @@ bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { } } - } else if (Object_Query_Click("TORUS01", objectName) - && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 18.56f, 0.0f, 38.86f, 0, 1, false, 0) - && !Game_Flag_Query(605)) { + } else if ( Object_Query_Click("TORUS01", objectName) + && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 18.56f, 0.0f, 38.86f, 0, true, false, 0) + && !Game_Flag_Query(605) + ) { Unclickable_Object("TORUS01"); Scene_Exits_Disable(); Player_Loses_Control(); @@ -116,7 +130,9 @@ bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { } bool SceneScriptNR04::ClickedOnActor(int actorId) { - if (actorId == kActorEarlyQ && Game_Flag_Query(606)) { + if (actorId == kActorEarlyQ + && Game_Flag_Query(606) + ) { Actor_Voice_Over(1640, kActorVoiceOver); Actor_Voice_Over(1650, kActorVoiceOver); Actor_Voice_Over(1660, kActorVoiceOver); @@ -136,7 +152,7 @@ bool SceneScriptNR04::ClickedOnExit(int exitId) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 45.0f, 0.0f, -106.0f, 0, 1, false, 0)) { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(437); + Game_Flag_Set(kFlatNR04toNR03); Set_Enter(kSetNR03, kSceneNR03); } return true; @@ -145,7 +161,11 @@ bool SceneScriptNR04::ClickedOnExit(int exitId) { } bool SceneScriptNR04::ClickedOn2DRegion(int region) { - if ((region == 0 || region == 1 || region == 2) && Actor_Query_Which_Set_In(kActorEarlyQ) != 12 && Actor_Query_Animation_Mode(kActorMcCoy) != 53 && !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 445, 0, 1, false)) { + if ((region == 0 || region == 1 || region == 2) + && Actor_Query_Which_Set_In(kActorEarlyQ) != 12 + && Actor_Query_Animation_Mode(kActorMcCoy) != 53 + && !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 445, 0, true, false) + ) { Actor_Face_Heading(kActorMcCoy, 49, false); Actor_Change_Animation_Mode(kActorMcCoy, 85); Delay(2500); diff --git a/engines/bladerunner/script/scene/nr05.cpp b/engines/bladerunner/script/scene/nr05.cpp index 96b881b729..e681b5146e 100644 --- a/engines/bladerunner/script/scene/nr05.cpp +++ b/engines/bladerunner/script/scene/nr05.cpp @@ -24,27 +24,36 @@ namespace BladeRunner { +enum kNR05Loops { + kNR05LoopPanFromNR08 = 0, + kNR05LoopMainLoop = 1, + kNR05LoopTableSwivel = 3 +}; + + void SceneScriptNR05::InitializeScene() { - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); - } else if (Game_Flag_Query(536)) { - Setup_Scene_Information(-456.0f, 0.0f, -611.0f, 0); + if (Game_Flag_Query(kFlagNR08toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopPanFromNR08, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); + } else if (Game_Flag_Query(kFlagNR03toNR05)) { + Setup_Scene_Information( -456.0f, 0.0f, -611.0f, 0); } else { - Setup_Scene_Information(-527.0f, 1.57f, -406.0f, 649); + Setup_Scene_Information( -527.0f, 1.57f, -406.0f, 649); } + Scene_Exit_Add_2D_Exit(0, 459, 147, 639, 290, 1); if (Game_Flag_Query(620)) { Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); } + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); @@ -62,15 +71,16 @@ void SceneScriptNR05::InitializeScene() { Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(536)) { - Scene_Loop_Start_Special(0, 3, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(536); + + if (Game_Flag_Query(kFlagNR08toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopPanFromNR08, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + } else if (Game_Flag_Query(kFlagNR03toNR05)) { + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kNR05LoopTableSwivel, false); + Scene_Loop_Set_Default(kNR05LoopMainLoop); + Game_Flag_Reset(kFlagNR03toNR05); } else { - Scene_Loop_Set_Default(1); + Scene_Loop_Set_Default(kNR05LoopMainLoop); } } @@ -90,19 +100,21 @@ bool SceneScriptNR05::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptNR05::ClickedOnActor(int actorId) { if (actorId == kActorEarlyQBartender) { - if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQBartender, 120, 1, false)) { - sub_4020B4(); + if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQBartender, 120, true, false)) { + talkToBartender(); } return true; } + if (actorId == kActorEarlyQ) { Actor_Set_Goal_Number(kActorEarlyQ, 229); - if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQ, 36, 1, false)) { - sub_4022DC(); + if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorEarlyQ, 36, true, false)) { + talkToEarlyQ(); } Actor_Set_Goal_Number(kActorEarlyQ, 221); return true; } + return false; } @@ -112,21 +124,22 @@ bool SceneScriptNR05::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR05::ClickedOnExit(int exitId) { if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -444.0f, 0.0f, -451.0f, 0, 1, false, 0)) { + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -444.0f, 0.0f, -451.0f, 0, true, false, 0)) { Player_Loses_Control(); Music_Stop(2); Player_Set_Combat_Mode(false); Actor_Face_Heading(kActorMcCoy, 1021, false); - Actor_Change_Animation_Mode(kActorMcCoy, 53); - Game_Flag_Set(537); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSit); + Game_Flag_Set(kFlagNR05toNR03); Set_Enter(kSetNR03, kSceneNR03); - Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, 0); + Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kNR05LoopTableSwivel, false); } return true; } + if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -777.56f, 0.0f, -166.86f, 0, 1, false, 0)) { - Game_Flag_Set(546); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -777.56f, 0.0f, -166.86f, 0, true, false, 0)) { + Game_Flag_Set(kFlagNR05toNR08); Set_Enter(kSetNR05_NR08, kSceneNR08); } return true; @@ -140,49 +153,55 @@ bool SceneScriptNR05::ClickedOn2DRegion(int region) { void SceneScriptNR05::SceneFrameAdvanced(int frame) { if (!Music_Is_Playing()) { - sub_402B9C(); + playNextMusic(); } + if (frame == 78) { Sound_Play(345, 83, 70, 70, 50); } + if (frame == 86) { Sound_Play(353, 62, 70, 70, 50); } + rotateActorOnGround(kActorHysteriaPatron2); rotateActorOnGround(kActorMcCoy); + if (Actor_Query_Goal_Number(kActorEarlyQ) == 224) { Actor_Set_Goal_Number(kActorEarlyQ, 225); - if (Player_Query_Current_Scene() == 58) { + if (Player_Query_Current_Scene() == kSceneNR05) { Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); } } - if (frame > 77 && frame <= 134) { + + if (frame > 77 + && frame <= 134 + ) { rotateActorOnTable(frame - 13); - if (frame == 134 && !Game_Flag_Query(537)) { + if ( frame == 134 + && !Game_Flag_Query(kFlagNR05toNR03) + ) { Actor_Set_Goal_Number(kActorMcCoy, 200); } //return true; - return; - } else { - //return false; - return; } + //return false; } void SceneScriptNR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { } void SceneScriptNR05::PlayerWalkedIn() { - if (Game_Flag_Query(547)) { + if (Game_Flag_Query(kFlagNR08toNR05)) { Music_Stop(2); - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -697.56f, 0.0f, -174.86f, 0, 1, false, 0); - Game_Flag_Reset(547); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -697.56f, 0.0f, -174.86f, 0, true, false, 0); + Game_Flag_Reset(kFlagNR08toNR05); } // return false; } void SceneScriptNR05::PlayerWalkedOut() { - if (Game_Flag_Query(537)) { + if (Game_Flag_Query(kFlagNR05toNR03)) { Music_Stop(2); } Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); @@ -195,7 +214,7 @@ void SceneScriptNR05::DialogueQueueFlushed(int a1) { void SceneScriptNR05::rotateActorOnTable(int frame) { float angle = cos((frame - 65) * (M_PI / 57.0f)) * M_PI_2; float invertedAngle = M_PI - angle; - if (!Game_Flag_Query(537)) { + if (!Game_Flag_Query(kFlagNR05toNR03)) { angle = angle + M_PI; invertedAngle = invertedAngle + M_PI; } @@ -215,75 +234,82 @@ void SceneScriptNR05::rotateActorOnTable(int frame) { Actor_Set_At_XYZ(kActorMcCoy, x, 0.0f, z, facing); } -void SceneScriptNR05::sub_4020B4() { +void SceneScriptNR05::talkToBartender() { Actor_Face_Actor(kActorMcCoy, kActorEarlyQBartender, true); Actor_Face_Actor(kActorEarlyQBartender, kActorMcCoy, true); - if (Game_Flag_Query(588)) { - if (Game_Flag_Query(589)) { - Actor_Says(kActorMcCoy, 3480, 19); - Actor_Says(kActorEarlyQBartender, 30, 12); - Actor_Says(kActorMcCoy, 3485, 3); - Actor_Says(kActorEarlyQBartender, 40, 13); - Actor_Change_Animation_Mode(kActorEarlyQBartender, 23); - Actor_Change_Animation_Mode(kActorMcCoy, 75); - Global_Variable_Increment(kVariableMcCoyDrinks, 1); - } else { - Actor_Says(kActorMcCoy, 3475, 17); - Actor_Says(kActorEarlyQBartender, 20, 23); - Game_Flag_Set(589); - Actor_Change_Animation_Mode(kActorMcCoy, 75); - Global_Variable_Increment(kVariableMcCoyDrinks, 1); - } - } else { + if (!Game_Flag_Query(kFlagNR05BartenderTalk1)) { Actor_Says(kActorEarlyQBartender, 0, 13); - Actor_Says(kActorMcCoy, 3470, 3); + Actor_Says(kActorMcCoy, 3470, kAnimationModeTalk); Actor_Says(kActorEarlyQBartender, 10, 23); - Game_Flag_Set(588); + Game_Flag_Set(kFlagNR05BartenderTalk1); + Actor_Change_Animation_Mode(kActorMcCoy, 75); + Global_Variable_Increment(kVariableMcCoyDrinks, 1); + } else if (!Game_Flag_Query(kFlagNR05BartenderTalk2)) { + Actor_Says(kActorMcCoy, 3475, 17); + Actor_Says(kActorEarlyQBartender, 20, 23); + Game_Flag_Set(kFlagNR05BartenderTalk2); + Actor_Change_Animation_Mode(kActorMcCoy, 75); + Global_Variable_Increment(kVariableMcCoyDrinks, 1); + } else { + Actor_Says(kActorMcCoy, 3480, 19); + Actor_Says(kActorEarlyQBartender, 30, 12); + Actor_Says(kActorMcCoy, 3485, kAnimationModeTalk); + Actor_Says(kActorEarlyQBartender, 40, 13); + Actor_Change_Animation_Mode(kActorEarlyQBartender, 23); Actor_Change_Animation_Mode(kActorMcCoy, 75); Global_Variable_Increment(kVariableMcCoyDrinks, 1); } } -void SceneScriptNR05::sub_4022DC() { +void SceneScriptNR05::talkToEarlyQ() { if (Actor_Query_Goal_Number(kActorEarlyQ) == 220) { Actor_Set_Goal_Number(kActorEarlyQ, 221); } Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, true); Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, true); - if (!Game_Flag_Query(590)) { - Actor_Says(kActorMcCoy, 8513, 3); - Actor_Says(kActorEarlyQ, 360, 3); + + if (!Game_Flag_Query(kFlagNR05EarlyQTalk)) { + Actor_Says(kActorMcCoy, 8513, kAnimationModeTalk); + Actor_Says(kActorEarlyQ, 360, kAnimationModeTalk); Actor_Says(kActorMcCoy, 3495, 11); Actor_Says(kActorEarlyQ, 370, 15); Actor_Says(kActorMcCoy, 3500, 17); Actor_Says(kActorEarlyQ, 380, 13); - Game_Flag_Set(590); + Game_Flag_Set(kFlagNR05EarlyQTalk); return; } + Dialogue_Menu_Clear_List(); if (Actor_Query_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy) >= 48) { - if (Actor_Clue_Query(kActorMcCoy, kClueDragonflyCollection) || Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt)) { - DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); + if (Actor_Clue_Query(kActorMcCoy, kClueDragonflyCollection) + || Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt) + ) { + DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); // JEWELRY } if (Actor_Clue_Query(kActorMcCoy, kClueLucy)) { - DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); // LUCY } if (Actor_Clue_Query(kActorMcCoy, kClueDektorasDressingRoom)) { - DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); // BLOND WOMAN } } + if (!Dialogue_Menu_Query_List_Size()) { - Actor_Says(kActorMcCoy, 3520, 3); - Actor_Says(kActorEarlyQ, 730, 3); + Actor_Says(kActorMcCoy, 3520, kAnimationModeTalk); + Actor_Says(kActorEarlyQ, 730, kAnimationModeTalk); Actor_Face_Heading(kActorEarlyQ, 849, false); return; } - Dialogue_Menu_Add_DONE_To_List(100); + + Dialogue_Menu_Add_DONE_To_List(100); // DONE + Dialogue_Menu_Appear(320, 240); int answer = Dialogue_Menu_Query_Input(); Dialogue_Menu_Disappear(); - if (answer == 890) { - Actor_Says(kActorMcCoy, 3505, 3); + + switch(answer){ + case 890: // JEWELRY + Actor_Says(kActorMcCoy, 3505, kAnimationModeTalk); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); Actor_Says(kActorEarlyQ, 420, 12); Actor_Says(kActorEarlyQ, 430, 13); @@ -297,17 +323,21 @@ void SceneScriptNR05::sub_4022DC() { Actor_Says(kActorMcCoy, 3545, 15); Actor_Says(kActorEarlyQ, 520, 12); Actor_Face_Heading(kActorEarlyQ, 849, false); - } else if (answer == 900) { + break; + + case 900: // LUCY Actor_Says(kActorMcCoy, 3510, 15); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); - Actor_Says_With_Pause(kActorEarlyQ, 530, 1.2f, 3); + Actor_Says_With_Pause(kActorEarlyQ, 530, 1.2f, kAnimationModeTalk); Actor_Says(kActorEarlyQ, 540, 15); Actor_Says(kActorMcCoy, 3550, 13); Actor_Says(kActorEarlyQ, 560, 14); Actor_Says(kActorEarlyQ, 570, 13); Actor_Says(kActorMcCoy, 3555, 12); Actor_Face_Heading(kActorEarlyQ, 849, false); - } else if (answer == 910) { + break; + + case 910: // BLOND WOMAN Actor_Says(kActorMcCoy, 3515, 14); Actor_Modify_Friendliness_To_Other(kActorEarlyQ, kActorMcCoy, -1); if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote)) { @@ -325,14 +355,20 @@ void SceneScriptNR05::sub_4022DC() { Actor_Says(kActorEarlyQ, 660, 12); } Actor_Face_Heading(kActorEarlyQ, 849, false); + break; } } void SceneScriptNR05::rotateActorOnGround(int actorId) { int animationMode = Actor_Query_Animation_Mode(actorId); - if (animationMode == kAnimationModeWalk || animationMode == kAnimationModeRun || animationMode == kAnimationModeCombatWalk || animationMode == kAnimationModeCombatRun) { + if (animationMode == kAnimationModeWalk + || animationMode == kAnimationModeRun + || animationMode == kAnimationModeCombatWalk + || animationMode == kAnimationModeCombatRun + ) { return; } + float x, y, z; Actor_Query_XYZ(actorId, &x, &y, &z); x -= -542.0f; @@ -347,23 +383,23 @@ void SceneScriptNR05::rotateActorOnGround(int actorId) { } } -void SceneScriptNR05::sub_402B9C() { +void SceneScriptNR05::playNextMusic() { if (Music_Is_Playing()) { Music_Adjust(51, 0, 2); } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { + int track = Global_Variable_Query(kVariableNR05Music); + if (track == 0) { Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { + } else if (track == 1) { Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { + } else if (track == 2) { Music_Play(7, 41, -80, 2, -1, 0, 0); } - v0++; - if (v0 > 2) { - v0 = 0; + track++; + if (track > 2) { + track = 0; } - Global_Variable_Set(54, v0); + Global_Variable_Set(kVariableNR05Music, track); } } diff --git a/engines/bladerunner/script/scene/nr08.cpp b/engines/bladerunner/script/scene/nr08.cpp index 8fa1d06f28..47d863b299 100644 --- a/engines/bladerunner/script/scene/nr08.cpp +++ b/engines/bladerunner/script/scene/nr08.cpp @@ -27,7 +27,7 @@ namespace BladeRunner { void SceneScriptNR08::InitializeScene() { if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01GoToNR08) { Setup_Scene_Information(-1174.1f, 0.32f, 303.9f, 435); - } else if (Game_Flag_Query(546)) { + } else if (Game_Flag_Query(kFlagNR05toNR08)) { Scene_Loop_Start_Special(0, 0, 0); Scene_Loop_Set_Default(1); Setup_Scene_Information(-1102.88f, 0.0f, 107.43f, 0); @@ -96,7 +96,7 @@ bool SceneScriptNR08::ClickedOnItem(int itemId, bool a2) { bool SceneScriptNR08::ClickedOnExit(int exitId) { if (exitId == 0) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1102.88f, 0.0f, 107.43f, 0, 1, false, 0)) { - Game_Flag_Set(547); + Game_Flag_Set(kFlagNR08toNR05); Set_Enter(kSetNR05_NR08, kSceneNR05); } return true; @@ -177,11 +177,13 @@ void SceneScriptNR08::PlayerWalkedIn() { Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); Outtake_Play(kOuttakeDektora, true, -1); } + if (Actor_Query_Goal_Number(kActorDektora) == 245) { Actor_Face_Heading(kActorDektora, 790, false); Loop_Actor_Travel_Stairs(kActorDektora, 8, 1, kAnimationModeIdle); Actor_Set_Goal_Number(kActorDektora, 246); } + if (Actor_Query_Goal_Number(kActorSteele) == kGoalSteeleNR01GoToNR08) { Actor_Says(kActorSteele, 1640, 12); if (!Game_Flag_Query(kFlagDirectorsCut)) { @@ -194,22 +196,20 @@ void SceneScriptNR08::PlayerWalkedIn() { Actor_Says(kActorSteele, 1680, 14); Actor_Says(kActorSteele, 1690, 15); Actor_Set_Goal_Number(kActorSteele, 235); - //return true; - return; - } else { - if (Game_Flag_Query(546)) { - Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1090.88f, 0.0f, 147.43f, 0, 1, false, 0); - Game_Flag_Reset(546); - } - //return false; - return; + return; // true; } + + if (Game_Flag_Query(kFlagNR05toNR08)) { + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1090.88f, 0.0f, 147.43f, 0, true, false, 0); + Game_Flag_Reset(kFlagNR05toNR08); + } + //return false; } void SceneScriptNR08::PlayerWalkedOut() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(547)) { + if (!Game_Flag_Query(kFlagNR08toNR05)) { Music_Stop(2); } } diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index 9f5a10029f..ed7bcebdee 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -302,8 +302,8 @@ DECLARE_SCRIPT(NR02) END_SCRIPT DECLARE_SCRIPT(NR03) - void sub_40259C(int frame); - void sub_402994(); + void rotateActorOnTable(int frame); + void playNextMusic(); END_SCRIPT DECLARE_SCRIPT(NR04) @@ -314,10 +314,10 @@ END_SCRIPT DECLARE_SCRIPT(NR05) void rotateActorOnTable(int frame); - void sub_4020B4(); - void sub_4022DC(); + void talkToBartender(); + void talkToEarlyQ(); void rotateActorOnGround(int actorId); - void sub_402B9C(); + void playNextMusic(); END_SCRIPT DECLARE_SCRIPT(NR06) |