diff options
author | Peter Kohaut | 2018-03-07 19:12:03 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-03-07 19:21:04 +0100 |
commit | c85201caf5524f3c0106c52fba4bd7a2ebfd1dc1 (patch) | |
tree | 1814c245b9811c69bbf045a2e375f3910902b23b /engines/bladerunner/script | |
parent | 1c576ac30c507b83ffc91d2dd1d1cb7bc7b8949d (diff) | |
download | scummvm-rg350-c85201caf5524f3c0106c52fba4bd7a2ebfd1dc1.tar.gz scummvm-rg350-c85201caf5524f3c0106c52fba4bd7a2ebfd1dc1.tar.bz2 scummvm-rg350-c85201caf5524f3c0106c52fba4bd7a2ebfd1dc1.zip |
BLADERUNNER: Added Howie Lee actor
added some constants
added loop debugger command
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/_template.cpp | 14 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/howie_lee.cpp | 386 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/zuben.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.cpp | 1 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.h | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct01.cpp | 122 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct05.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct12.cpp | 20 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/rc01.cpp | 20 |
9 files changed, 494 insertions, 83 deletions
diff --git a/engines/bladerunner/script/ai/_template.cpp b/engines/bladerunner/script/ai/_template.cpp index cff8e62050..ceebd22594 100644 --- a/engines/bladerunner/script/ai/_template.cpp +++ b/engines/bladerunner/script/ai/_template.cpp @@ -39,30 +39,39 @@ bool AIScriptTemplate::Update() { } void AIScriptTemplate::TimerExpired(int timer) { + //return false; } void AIScriptTemplate::CompletedMovementTrack() { + //return false; } void AIScriptTemplate::ReceivedClue(int clueId, int fromActorId) { + //return false; } void AIScriptTemplate::ClickedByPlayer() { + //return false; } void AIScriptTemplate::EnteredScene(int sceneId) { + // return false; } void AIScriptTemplate::OtherAgentEnteredThisScene(int otherActorId) { + // return false; } void AIScriptTemplate::OtherAgentExitedThisScene(int otherActorId) { + // return false; } void AIScriptTemplate::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { + // return false; } void AIScriptTemplate::ShotAtAndMissed() { + // return false; } bool AIScriptTemplate::ShotAtAndHit() { @@ -70,6 +79,7 @@ bool AIScriptTemplate::ShotAtAndHit() { } void AIScriptTemplate::Retired(int byActorId) { + // return false; } int AIScriptTemplate::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { @@ -108,6 +118,8 @@ bool AIScriptTemplate::ReachedMovementTrackWaypoint(int waypointId) { return true; } -void AIScriptTemplate::FledCombat() {} +void AIScriptTemplate::FledCombat() { + // return false; +} } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai/howie_lee.cpp b/engines/bladerunner/script/ai/howie_lee.cpp new file mode 100644 index 0000000000..fac33acc93 --- /dev/null +++ b/engines/bladerunner/script/ai/howie_lee.cpp @@ -0,0 +1,386 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai_script.h" + +namespace BladeRunner { + +AIScriptHowieLee::AIScriptHowieLee(BladeRunnerEngine *vm) : AIScriptBase(vm) { + var_45DFB8 = 0; +} + +void AIScriptHowieLee::Initialize() { + _animationFrame = 0; + _animationState = 0; + _animationStateNext = 0; + _animationNext = 0; + var_45DFB8 = false; + + Actor_Put_In_Set(kActorHowieLee, kSetCT01_CT12); + Actor_Set_At_Waypoint(kActorHowieLee, 67, 605); + Actor_Set_Goal_Number(kActorHowieLee, 0); +} + +bool AIScriptHowieLee::Update() { + if (Actor_Query_Goal_Number(kActorHowieLee) < 100 && Global_Variable_Query(kVariableChapter) == 2) { + Actor_Set_Goal_Number(kActorHowieLee, 100); + } + if (Global_Variable_Query(kVariableChapter) > 1) { + return true; + } + if (Actor_Query_Goal_Number(kActorHowieLee) == 0) { + Actor_Set_Goal_Number(kActorHowieLee, 1); + } + if (Game_Flag_Query(176) && !Actor_Query_In_Set(kActorHowieLee, kSetCT01_CT12)) { + AI_Movement_Track_Flush(kActorHowieLee); + AI_Movement_Track_Append(kActorHowieLee, 67, 0); + Actor_Set_Goal_Number(kActorHowieLee, 0); + } + if (Actor_Query_Goal_Number(kActorHowieLee) == 1 && Game_Flag_Query(kFlagBoughtHowieLeeFood) && !Game_Flag_Query(176)) { + Actor_Set_Goal_Number(kActorHowieLee, 4); + return true; + } + return false; +} + +void AIScriptHowieLee::TimerExpired(int timer) { + //return false; +} + +void AIScriptHowieLee::CompletedMovementTrack() { + if (Actor_Query_Goal_Number(kActorHowieLee) == 1) { + Actor_Set_Goal_Number(kActorHowieLee, 2); + // return true; + } else if (Actor_Query_Goal_Number(kActorHowieLee) == 2) { + Actor_Set_Goal_Number(kActorHowieLee, 3); + // return true; + } else if (Actor_Query_Goal_Number(kActorHowieLee) == 3) { + Actor_Set_Goal_Number(kActorHowieLee, 0); + // return true; + } else if (Actor_Query_Goal_Number(kActorHowieLee) == 3) { + // Bug/intentional in original game + Actor_Set_Goal_Number(kActorHowieLee, 4); + // return true; + } else if (Actor_Query_Goal_Number(kActorHowieLee) == 4) { + Actor_Set_Goal_Number(kActorHowieLee, 5); + // return true; + } else if (Actor_Query_Goal_Number(kActorHowieLee) == 5) { + Actor_Set_Goal_Number(kActorHowieLee, 0); + // return true; + } + // return false; +} + +void AIScriptHowieLee::ReceivedClue(int clueId, int fromActorId) { + //return false; +} + +void AIScriptHowieLee::ClickedByPlayer() { + //return false; +} + +void AIScriptHowieLee::EnteredScene(int sceneId) { + if (Actor_Query_Goal_Number(kActorHowieLee) == 4 && Actor_Query_In_Set(kActorHowieLee, kSetCT03_CT04)) { + if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171)) { + Game_Flag_Set(171); + // return false; + } + if (!Game_Flag_Query(169) && Game_Flag_Query(170) && !Game_Flag_Query(171) && Random_Query(1, 10) == 1) { + Game_Flag_Set(171); + // return true; + } + // return false; + } +} + +void AIScriptHowieLee::OtherAgentEnteredThisScene(int otherActorId) { + // return false; +} + +void AIScriptHowieLee::OtherAgentExitedThisScene(int otherActorId) { + // return false; +} + +void AIScriptHowieLee::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { + // return false; +} + +void AIScriptHowieLee::ShotAtAndMissed() { + // return false; +} + +bool AIScriptHowieLee::ShotAtAndHit() { + return false; +} + +void AIScriptHowieLee::Retired(int byActorId) { + // return false; +} + +int AIScriptHowieLee::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { + return 0; +} + +bool AIScriptHowieLee::GoalChanged(int currentGoalNumber, int newGoalNumber) { + if (newGoalNumber == 1) { + AI_Movement_Track_Flush(kActorHowieLee); + if (Random_Query(1, 2) == 1) { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 67, Random_Query(3, 10), 720); + } else { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 69, Random_Query(3, 10), 640); + } + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 2) { + AI_Movement_Track_Flush(kActorHowieLee); + if (Random_Query(1, 2) == 1) { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 68, Random_Query(3, 10), 641); + } else { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 67, Random_Query(3, 10), 720); + } + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 3) { + AI_Movement_Track_Flush(kActorHowieLee); + if (Random_Query(1, 2) == 1) { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 69, Random_Query(3, 10), 640); + } else { + AI_Movement_Track_Append_With_Facing(kActorHowieLee, 68, Random_Query(3, 10), 641); + } + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 4) { + AI_Movement_Track_Flush(kActorHowieLee); + AI_Movement_Track_Append(kActorHowieLee, 66, 30); + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 5) { + AI_Movement_Track_Flush(kActorHowieLee); + AI_Movement_Track_Append(kActorHowieLee, 40, 60); + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 6) { + AI_Movement_Track_Flush(kActorHowieLee); + AI_Movement_Track_Append(kActorHowieLee, 67, 90); + AI_Movement_Track_Repeat(kActorHowieLee); + return true; + } else if (newGoalNumber == 50) { + AI_Movement_Track_Flush(kActorHowieLee); + return false; + } else if (newGoalNumber == 100) { + AI_Movement_Track_Flush(kActorHowieLee); + Actor_Put_In_Set(kActorHowieLee, kSetFreeSlotC); + Actor_Set_At_Waypoint(kActorHowieLee, 35, 0); + return false; + } + return false; +} + +bool AIScriptHowieLee::UpdateAnimation(int *animation, int *frame) { + switch (_animationState) { + case 0: + _animationFrame++; + if (var_45DFB8) { + *animation = 673; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(673)) { + _animationFrame = 0; + if (Random_Query(0, 2) > 0) { + var_45DFB8 ^= 1; + } + } + } else { + *animation = 671; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(671)) { + _animationFrame = 0; + if (Random_Query(0, 1) > 0) { + var_45DFB8 ^= 1; + } + } + } + break; + case 1: + *animation = 674; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(674)) { + _animationFrame = 0; + if (_animationState < 3 || _animationState > 8) { + _animationState = 0; + _animationFrame = 0; + var_45DFB8 = Random_Query(0, 1); + } else { + Game_Flag_Set(239); + } + *animation = 673; + } + break; + case 2: + *animation = 672; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(672)) { + _animationFrame = 0; + } + break; + case 3: + if (Game_Flag_Query(239)) { + Game_Flag_Reset(239); + _animationState = 0; + _animationFrame = 0; + var_45DFB8 = Random_Query(0, 1); + *animation = 671; + } else { + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(676)) { + _animationFrame = 0; + } + *animation = 676; + } + break; + case 4: + *animation = 677; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(677)) { + _animationState = 3; + _animationFrame = 0; + *animation = 676; + } + break; + case 5: + *animation = 678; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(678)) { + _animationState = 3; + _animationFrame = 0; + *animation = 676; + } + break; + case 6: + *animation = 679; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(679)) { + _animationState = 3; + _animationFrame = 0; + *animation = 676; + } + break; + case 7: + *animation = 680; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(680)) { + _animationState = 3; + _animationFrame = 0; + *animation = 676; + } + break; + case 8: + *animation = 681; + _animationFrame++; + if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(681)) { + _animationState = 3; + _animationFrame = 0; + *animation = 676; + } + break; + default: + *animation = 399; + break; + } + *frame = _animationFrame; + return true; +} + +bool AIScriptHowieLee::ChangeAnimationMode(int mode) { + switch (mode) { + case kAnimationModeIdle: + if (_animationState < 3 || _animationState > 8) { + _animationState = 0; + _animationFrame = 0; + var_45DFB8 = Random_Query(0, 1); + } else { + Game_Flag_Set(239); + } + break; + case kAnimationModeWalk: + if (_animationState != 2) { + _animationState = 2; + _animationFrame = 0; + } + break; + case kAnimationModeTalk: + _animationState = 3; + _animationFrame = 0; + break; + case 12: + _animationState = 4; + _animationFrame = 0; + break; + case 13: + _animationState = 5; + _animationFrame = 0; + break; + case 14: + _animationState = 6; + _animationFrame = 0; + break; + case 15: + _animationState = 7; + _animationFrame = 0; + break; + case 16: + _animationState = 8; + _animationFrame = 0; + break; + case 43: + _animationState = 1; + _animationFrame = 0; + break; + } + return true; +} + +void AIScriptHowieLee::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) { + *animationState = _animationState; + *animationFrame = _animationFrame; + *animationStateNext = _animationStateNext; + *animationNext = _animationNext; +} + +void AIScriptHowieLee::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) { + _animationState = animationState; + _animationFrame = animationFrame; + _animationStateNext = animationStateNext; + _animationNext = animationNext; +} + +bool AIScriptHowieLee::ReachedMovementTrackWaypoint(int waypointId) { + if (waypointId == 67 && Random_Query(1, 2) == 2) { + Actor_Face_Heading(kActorHowieLee, 850, 0); + _animationFrame = 0; + _animationState = 1; + } + return true; +} + +void AIScriptHowieLee::FledCombat() { + // return false; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp index 7f1781110a..9fe6aa2f10 100644 --- a/engines/bladerunner/script/ai/zuben.cpp +++ b/engines/bladerunner/script/ai/zuben.cpp @@ -80,7 +80,7 @@ bool AIScriptZuben::Update() { } if (Actor_Query_Goal_Number(kActorZuben) == 12 && Player_Query_Current_Scene() == kSceneCT07) { AI_Countdown_Timer_Reset(kActorZuben, 0); - Game_Flag_Set(94); + Game_Flag_Set(kFlagWarehouseOpen); Actor_Set_Targetable(kActorZuben, true); if (Actor_Query_Goal_Number(kActorGordo) == 0) { Actor_Set_Goal_Number(kActorGordo, 1); @@ -382,7 +382,7 @@ bool AIScriptZuben::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Set_Goal_Number(kActorZuben, 9); return false; case 21: - Game_Flag_Set(94); + Game_Flag_Set(kFlagWarehouseOpen); Actor_Set_Targetable(kActorZuben, true); AI_Movement_Track_Flush(kActorZuben); AI_Movement_Track_Append_Run(kActorZuben, 125, 0); diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp index 0d07cefca8..06d91689b6 100644 --- a/engines/bladerunner/script/ai_script.cpp +++ b/engines/bladerunner/script/ai_script.cpp @@ -43,6 +43,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) { _AIScripts[kActorRunciter] = new AIScriptRunciter(_vm); _AIScripts[kActorZuben] = new AIScriptZuben(_vm); _AIScripts[kActorOfficerLeary] = new AIScriptOfficerLeary(_vm); + _AIScripts[kActorHowieLee] = new AIScriptHowieLee(_vm); _AIScripts[kActorLeon] = new AIScriptLeon(_vm); _AIScripts[kActorMaggie] = new AIScriptMaggie(_vm); _AIScripts[kActorGenwalkerA] = new AIScriptGenericWalkerA(_vm); diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h index 530ba6bbc7..73556d61b3 100644 --- a/engines/bladerunner/script/ai_script.h +++ b/engines/bladerunner/script/ai_script.h @@ -146,6 +146,10 @@ DECLARE_SCRIPT(OfficerLeary) bool sub_431420(); END_SCRIPT +DECLARE_SCRIPT(HowieLee) + bool var_45DFB8; +END_SCRIPT + DECLARE_SCRIPT(Leon) int var_45EDAC; float var_45EDA0_z; diff --git a/engines/bladerunner/script/scene/ct01.cpp b/engines/bladerunner/script/scene/ct01.cpp index 5a308099ca..2c650dc1eb 100644 --- a/engines/bladerunner/script/scene/ct01.cpp +++ b/engines/bladerunner/script/scene/ct01.cpp @@ -24,6 +24,23 @@ namespace BladeRunner { +enum kCT01Loops { + kCT01LoopInshotFromCT12WithSpinner = 0, + kCT01LoopInshot = 1, + kCT01LoopMain = 2, + kCT01LoopDoorAnim = 4, + kCT01LoopOutshot = 5, + kCT01LoopInshotFromCT12NoSpinner = 6, + kCT01LoopMainLoopNoSpinner = 7 +}; + +enum kCT01Exits { + kCT01ExitCT02 = 0, + kCT01ExitCT03 = 1, + kCT01ExitCT12 = 2, + kCT01ExitSpinner = 3 +}; + void SceneScriptCT01::InitializeScene() { Music_Play(3, 28, 0, 2, -1, 1, 0); Game_Flag_Reset(247); @@ -38,9 +55,9 @@ void SceneScriptCT01::InitializeScene() { Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 28); if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) { if (Game_Flag_Query(kFlagSpinnerToCT01)) { - Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kCT01LoopInshotFromCT12WithSpinner, false); } else { - Scene_Loop_Start_Special(0, 6, 0); + Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kCT01LoopInshotFromCT12NoSpinner, false); } } } else if (Game_Flag_Query(kFlagSpinnerToCT01)) { @@ -49,15 +66,15 @@ void SceneScriptCT01::InitializeScene() { } else { Setup_Scene_Information(-397.0f, -6.5f, 471.0f, 250); } - Scene_Exit_Add_2D_Exit(0, 290, 256, 360, 304, 1); + Scene_Exit_Add_2D_Exit(kCT01ExitCT02, 290, 256, 360, 304, 1); if (Actor_Clue_Query(kActorMcCoy, kClueZubenRunsAway)) { - Scene_Exit_Add_2D_Exit(1, 571, 233, 639, 367, 1); + Scene_Exit_Add_2D_Exit(kCT01ExitCT03, 571, 233, 639, 367, 1); } - if (Game_Flag_Query(94)) { - Scene_Exit_Add_2D_Exit(2, 506, 400, 639, 479, 2); + if (Game_Flag_Query(kFlagWarehouseOpen)) { + Scene_Exit_Add_2D_Exit(kCT01ExitCT12, 506, 400, 639, 479, 2); } if (Game_Flag_Query(kFlagSpinnerToCT01)) { - Scene_Exit_Add_2D_Exit(3, 0, 286, 158, 350, 2); + Scene_Exit_Add_2D_Exit(kCT01ExitSpinner, 0, 286, 158, 350, 2); } Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); Ambient_Sounds_Add_Looping_Sound(55, 40, -100, 1); @@ -76,9 +93,9 @@ void SceneScriptCT01::InitializeScene() { Ambient_Sounds_Add_Sound(376, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(377, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); if (Game_Flag_Query(kFlagSpinnerToCT01)) { - Scene_Loop_Set_Default(2); + Scene_Loop_Set_Default(kCT01LoopMain); } else { - Scene_Loop_Set_Default(7); + Scene_Loop_Set_Default(kCT01LoopMainLoopNoSpinner); } } @@ -144,14 +161,14 @@ bool SceneScriptCT01::ClickedOnActor(int actorId) { return true; } } - if (actorId == 19) { + if (actorId == kActorZuben) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -335.23f, -6.5f, 578.97f, 12, 1, false, 0)) { Actor_Face_Actor(kActorMcCoy, kActorZuben, true); Actor_Says(kActorMcCoy, 355, 18); - if (!Actor_Query_Goal_Number(kActorZuben)) { + if (Actor_Query_Goal_Number(kActorZuben) == 0) { Actor_Says(kActorZuben, 10, 16); Actor_Face_Actor(kActorHowieLee, kActorMcCoy, true); - Actor_Says(kActorHowieLee, 150, 3); + Actor_Says(kActorHowieLee, 150, kAnimationModeTalk); Actor_Face_Actor(kActorMcCoy, kActorHowieLee, true); Actor_Says(kActorMcCoy, 360, 13); Actor_Modify_Friendliness_To_Other(kActorHowieLee, kActorMcCoy, -5); @@ -160,9 +177,9 @@ bool SceneScriptCT01::ClickedOnActor(int actorId) { return true; } } - if (actorId == 2) { + if (actorId == kActorGordo) { //todo: some weird code in assembly EBP is used but may not be initialized, loc_401C78 - if (!Actor_Query_Goal_Number(kActorGordo)) { + if (Actor_Query_Goal_Number(kActorGordo) == 0) { if (Loop_Actor_Walk_To_XYZ(kActorMcCoy, -338.1f, -6.5f, 419.65f, 6, 1, false, 0)) { return false; } @@ -200,32 +217,32 @@ bool SceneScriptCT01::ClickedOnItem(int itemId, bool a2) { } bool SceneScriptCT01::ClickedOnExit(int exitId) { - if (exitId == 0) { + if (exitId == kCT01ExitCT02) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -327.5f, -6.5f, 352.28f, 0, 1, false, 0)) { Player_Loses_Control(); Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 106, 0, 0, false); Player_Gains_Control(); Game_Flag_Reset(247); - Set_Enter(27, kSceneCT02); + Set_Enter(kSetCT02, kSceneCT02); } return true; } - if (exitId == 1) { + if (exitId == kCT01ExitCT03) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -259.0f, -6.5f, 710.0f, 0, 1, false, 0)) { Game_Flag_Reset(247); - Set_Enter(5, kSceneCT03); + Set_Enter(kSetCT03_CT04, kSceneCT03); } return true; } - if (exitId == 2) { + if (exitId == kCT01ExitCT12) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -419.0f, -6.5f, 696.0f, 0, 1, false, 0)) { - Game_Flag_Set(123); + Game_Flag_Set(kFlagCT01toCT12); Game_Flag_Reset(247); - Set_Enter(4, kSceneCT12); + Set_Enter(kSetCT01_CT12, kSceneCT12); } return true; } - if (exitId == 3) { + if (exitId == kCT01ExitSpinner) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -314.0f, -6.5f, 326.0f, 0, 1, false, 0)) { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -330.0f, -6.5f, 221.0f, 0, 0, true, 0); Loop_Actor_Walk_To_XYZ(kActorMcCoy, -530.0f, -6.5f, 241.0f, 0, 0, true, 0); @@ -240,76 +257,76 @@ bool SceneScriptCT01::ClickedOnExit(int exitId) { int spinnerDest = Spinner_Interface_Choose_Dest(-1, 0); switch (spinnerDest) { - case 0: + case kSpinnerDestinationPoliceStation: Game_Flag_Set(178); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToPS01); - Set_Enter(61, kScenePS01); + Set_Enter(kSetPS01, kScenePS01); Scene_Loop_Start_Special(1, 5, 1); break; - case 1: + case kSpinnerDestinationMcCoysApartment: Game_Flag_Set(179); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToMA01); - Set_Enter(49, kSceneMA01); + Set_Enter(kSetMA01, kSceneMA01); Scene_Loop_Start_Special(1, 5, 1); break; - case 2: + case kSpinnerDestinationRuncitersAnimals: Game_Flag_Set(182); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToRC01); - Set_Enter(69, kSceneRC01); + Set_Enter(kSetRC01, kSceneRC01); Scene_Loop_Start_Special(1, 5, 1); break; - case 4: + case kSpinnerDestinationAnimoidRow: Game_Flag_Set(180); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToAR01); - Set_Enter(0, kSceneAR01); + Set_Enter(kSetAR01_AR02, kSceneAR01); Scene_Loop_Start_Special(1, 5, 1); break; - case 5: + case kSpinnerDestinationTyrellBuilding: Game_Flag_Set(261); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Reset(247); Game_Flag_Set(kFlagSpinnerToTB02); - Set_Enter(17, kSceneTB02); + Set_Enter(kSetTB02_TB03, kSceneTB02); Scene_Loop_Start_Special(1, 5, 1); break; - case 6: + case kSpinnerDestinationDNARow: Game_Flag_Set(177); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToDR01); - Set_Enter(7, kSceneDR01); + Set_Enter(kSetDR01_DR02_DR04, kSceneDR01); Scene_Loop_Start_Special(1, 5, 1); break; - case 7: + case kSpinnerDestinationBradburyBuilding: Game_Flag_Set(258); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToBB01); - Set_Enter(20, kSceneBB01); + Set_Enter(kSetBB01, kSceneBB01); Scene_Loop_Start_Special(1, 5, 1); break; - case 8: + case kSpinnerDestinationNightclubRow: Game_Flag_Set(181); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToNR01); - Set_Enter(54, kSceneNR01); + Set_Enter(kSetNR01, kSceneNR01); Scene_Loop_Start_Special(1, 5, 1); break; - case 9: + case kSpinnerDestinationHysteriaHall: Game_Flag_Set(257); Game_Flag_Reset(247); Game_Flag_Reset(kFlagSpinnerToCT01); Game_Flag_Set(kFlagSpinnerToHF01); - Set_Enter(37, kSceneHF01); + Set_Enter(kSetHF01, kSceneHF01); Scene_Loop_Start_Special(1, 5, 1); break; default: @@ -333,15 +350,6 @@ bool SceneScriptCT01::ClickedOn2DRegion(int region) { void SceneScriptCT01::SceneFrameAdvanced(int frame) { if ((frame < 316 || frame > 435) && !((frame - 1) % 10)) { - /*int v1; - int v2 = Random_Query(0, 1); - if (v2 <= 1) { - if (v2) { - v1 = 60; - } else { - v1 = 59; - } - }*/ Ambient_Sounds_Play_Sound(/*v1*/Random_Query(59, 60), 25, 30, 30, 0); } if (frame == 23) { @@ -353,14 +361,14 @@ void SceneScriptCT01::SceneFrameAdvanced(int frame) { if (frame == 196 || frame == 452) { int v3 = Random_Query(0, 6); if (v3 == 0) { - Overlay_Play("ct01spnr", 0, 0, 1, 0); + Overlay_Play("ct01spnr", 0, false, true, 0); if (Random_Query(0, 1)) { Ambient_Sounds_Play_Sound(68, Random_Query(33, 50), 0, 0, 0); } else { Ambient_Sounds_Play_Sound(67, Random_Query(33, 50), 0, 0, 0); } } else if (v3 == 1) { - Overlay_Play("ct01spnr", 1, 0, 1, 0); + Overlay_Play("ct01spnr", 1, false, true, 0); if (Random_Query(0, 1)) { Ambient_Sounds_Play_Sound(69, Random_Query(33, 50), 0, 0, 0); } else { @@ -396,7 +404,7 @@ void SceneScriptCT01::PlayerWalkedIn() { void SceneScriptCT01::PlayerWalkedOut() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); - if (Game_Flag_Query(123)) { + if (Game_Flag_Query(kFlagCT01toCT12)) { Ambient_Sounds_Remove_Looping_Sound(55, true); Ambient_Sounds_Remove_Looping_Sound(56, true); } else { @@ -480,16 +488,16 @@ void SceneScriptCT01::dialogueWithHowieLee() { break; case 70: Actor_Says(kActorMcCoy, 290, 13); - if (Actor_Query_Friendliness_To_Other(kActorHowieLee, kActorMcCoy) > 49 && (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0)) { - Actor_Says(kActorHowieLee, 50, 3); - Actor_Says(kActorHowieLee, 60, 3); + if (Actor_Query_Friendliness_To_Other(kActorHowieLee, kActorMcCoy) > 49 && (Global_Variable_Query(kVariableChinyen) > 10 || Query_Difficulty_Level() == 0)) { + Actor_Says(kActorHowieLee, 50, kAnimationModeTalk); + Actor_Says(kActorHowieLee, 60, kAnimationModeTalk); Actor_Face_Actor(kActorHowieLee, kActorMcCoy, true); Actor_Says(kActorHowieLee, 70, 16); Actor_Says(kActorMcCoy, 325, 13); if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 10); + Global_Variable_Decrement(kVariableChinyen, 10); } - Game_Flag_Set(192); + Game_Flag_Set(kFlagBoughtHowieLeeFood); } else { Actor_Says(kActorHowieLee, 130, 15); } diff --git a/engines/bladerunner/script/scene/ct05.cpp b/engines/bladerunner/script/scene/ct05.cpp index 0416883819..d5a9ea7055 100644 --- a/engines/bladerunner/script/scene/ct05.cpp +++ b/engines/bladerunner/script/scene/ct05.cpp @@ -33,7 +33,7 @@ void SceneScriptCT05::InitializeScene() { } else { Setup_Scene_Information(-375.0f, -109.91f, 750.0f, 600); } - if (Game_Flag_Query(94)) { + if (Game_Flag_Query(kFlagWarehouseOpen)) { Scene_Exit_Add_2D_Exit(0, 228, 205, 293, 300, 0); } Scene_Exit_Add_2D_Exit(1, 320, 458, 639, 479, 2); @@ -44,7 +44,7 @@ void SceneScriptCT05::InitializeScene() { Ambient_Sounds_Add_Sound(90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); Ambient_Sounds_Add_Sound(205, 5, 30, 18, 30, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(94)) { + if (Game_Flag_Query(kFlagWarehouseOpen)) { Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(0); @@ -138,7 +138,7 @@ bool SceneScriptCT05::ClickedOnItem(int itemId, bool a2) { bool SceneScriptCT05::ClickedOnExit(int exitId) { if (exitId == 0) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -128.42f, -109.91f, 112.83f, 0, 1, false, 0)) { - Game_Flag_Set(76); + Game_Flag_Set(kFlagCT05toCT12); if (Actor_Query_Goal_Number(kActorGaff) == 1) { Overlay_Remove("ct05over"); } diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp index 5acf2fe898..859b065b37 100644 --- a/engines/bladerunner/script/scene/ct12.cpp +++ b/engines/bladerunner/script/scene/ct12.cpp @@ -25,7 +25,7 @@ namespace BladeRunner { void SceneScriptCT12::InitializeScene() { - if (Game_Flag_Query(123)) { + if (Game_Flag_Query(kFlagCT01toCT12)) { Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 616); } else if (Game_Flag_Query(432)) { Setup_Scene_Information(-292.0f, -6.5f, 990.0f, 827); @@ -62,25 +62,25 @@ void SceneScriptCT12::InitializeScene() { if (Global_Variable_Query(kVariableChapter) < 2 && Actor_Query_Goal_Number(kActorGaff) == 1) { Actor_Put_In_Set(kActorGaff, 4); Actor_Set_At_XYZ(kActorGaff, -534.0f, -6.5f, 952.0f, 367); - Game_Flag_Set(294); + Game_Flag_Set(kFlagGaffSpinnerCT12); } - if (Game_Flag_Query(123) && Game_Flag_Query(kFlagSpinnerToCT01)) { + if (Game_Flag_Query(kFlagCT01toCT12) && Game_Flag_Query(kFlagSpinnerToCT01)) { if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) { Scene_Loop_Start_Special(0, 1, 0); } Scene_Loop_Set_Default(2); - Game_Flag_Reset(123); - } else if (Game_Flag_Query(123) && !Game_Flag_Query(kFlagSpinnerToCT01)) { + Game_Flag_Reset(kFlagCT01toCT12); + } else if (Game_Flag_Query(kFlagCT01toCT12) && !Game_Flag_Query(kFlagSpinnerToCT01)) { if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) { Scene_Loop_Start_Special(0, 0, 0); } Scene_Loop_Set_Default(2); - Game_Flag_Reset(123); - } else if (Game_Flag_Query(76) && Game_Flag_Query(294)) { - Game_Flag_Reset(76); + Game_Flag_Reset(kFlagCT01toCT12); + } else if (Game_Flag_Query(kFlagCT05toCT12) && Game_Flag_Query(kFlagGaffSpinnerCT12)) { + Game_Flag_Reset(kFlagCT05toCT12); Scene_Loop_Set_Default(4); - } else if (Game_Flag_Query(76) && !Game_Flag_Query(294)) { - Game_Flag_Reset(76); + } else if (Game_Flag_Query(kFlagCT05toCT12) && !Game_Flag_Query(kFlagGaffSpinnerCT12)) { + Game_Flag_Reset(kFlagCT05toCT12); Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(2); diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp index 83d12d0f39..867e3bd661 100644 --- a/engines/bladerunner/script/scene/rc01.cpp +++ b/engines/bladerunner/script/scene/rc01.cpp @@ -57,16 +57,16 @@ void SceneScriptRC01::InitializeScene() { // Game_Flag_Set(kFlagSpinnerToMA01); // Set_Enter(kSetMA02_MA04, kSceneMA04); - // Spinner_Set_Selectable_Destination_Flag(0, true); - // Spinner_Set_Selectable_Destination_Flag(1, true); - // Spinner_Set_Selectable_Destination_Flag(2, true); - // Spinner_Set_Selectable_Destination_Flag(3, true); - // Spinner_Set_Selectable_Destination_Flag(4, true); - // Spinner_Set_Selectable_Destination_Flag(5, true); - // Spinner_Set_Selectable_Destination_Flag(6, true); - // Spinner_Set_Selectable_Destination_Flag(7, true); - // Spinner_Set_Selectable_Destination_Flag(8, true); - // Spinner_Set_Selectable_Destination_Flag(9, true); + Spinner_Set_Selectable_Destination_Flag(0, true); + Spinner_Set_Selectable_Destination_Flag(1, true); + Spinner_Set_Selectable_Destination_Flag(2, true); + Spinner_Set_Selectable_Destination_Flag(3, true); + Spinner_Set_Selectable_Destination_Flag(4, true); + Spinner_Set_Selectable_Destination_Flag(5, true); + Spinner_Set_Selectable_Destination_Flag(6, true); + Spinner_Set_Selectable_Destination_Flag(7, true); + Spinner_Set_Selectable_Destination_Flag(8, true); + Spinner_Set_Selectable_Destination_Flag(9, true); // ESPER_Flag_To_Activate(); // Voight_Kampff_Activate(kActorLucy, 50); |