aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/scene/ps01.cpp
diff options
context:
space:
mode:
authorPeter Kohaut2019-01-26 18:25:39 +0100
committerPeter Kohaut2019-01-27 11:48:59 +0100
commitbc7713e04036247ec08feed6ce67b39d486bdeb8 (patch)
tree254bc03ec5aeb578c925fcb2bb0af02c840194a2 /engines/bladerunner/script/scene/ps01.cpp
parent1ca97137ad232d2fadfcc881f769b791d8f7705f (diff)
downloadscummvm-rg350-bc7713e04036247ec08feed6ce67b39d486bdeb8.tar.gz
scummvm-rg350-bc7713e04036247ec08feed6ce67b39d486bdeb8.tar.bz2
scummvm-rg350-bc7713e04036247ec08feed6ce67b39d486bdeb8.zip
BLADERUNNER: Cleanup of Police station scripts for chapter 1 & 2
Diffstat (limited to 'engines/bladerunner/script/scene/ps01.cpp')
-rw-r--r--engines/bladerunner/script/scene/ps01.cpp96
1 files changed, 61 insertions, 35 deletions
diff --git a/engines/bladerunner/script/scene/ps01.cpp b/engines/bladerunner/script/scene/ps01.cpp
index bafa4a5570..c80562f1ad 100644
--- a/engines/bladerunner/script/scene/ps01.cpp
+++ b/engines/bladerunner/script/scene/ps01.cpp
@@ -24,6 +24,14 @@
namespace BladeRunner {
+enum kPS01Loops {
+ kPS01LoopInshoot = 0,
+ kPS01LoopMainLoop = 1,
+ kPS01LoopDoorAnim = 3,
+ kPS01LoopOutshoot = 4,
+ kPS01LoopNoSpinner = 5
+};
+
void SceneScriptPS01::InitializeScene() {
Setup_Scene_Information(1872.0f, 16592.0f, -2975.0f, 200);
Scene_Exit_Add_2D_Exit(0, 36, 194, 138, 326, 0);
@@ -31,22 +39,23 @@ void SceneScriptPS01::InitializeScene() {
Scene_Exit_Add_2D_Exit(1, 344, 288, 584, 384, 2);
}
Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1);
- Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
+ Ambient_Sounds_Add_Sound( 69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
+
if (Game_Flag_Query(kFlagPS02toPS01)) {
if (Game_Flag_Query(kFlagSpinnerAtPS01)) {
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kPS01LoopMainLoop);
} else {
- Scene_Loop_Set_Default(5);
+ Scene_Loop_Set_Default(kPS01LoopNoSpinner);
}
} else {
Actor_Set_Invisible(kActorMcCoy, true);
Game_Flag_Set(kFlagArrivedFromSpinner2);
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kPS01LoopInshoot, false);
+ Scene_Loop_Set_Default(kPS01LoopMainLoop);
Player_Loses_Control();
}
}
@@ -78,12 +87,13 @@ bool SceneScriptPS01::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptPS01::ClickedOnExit(int exitId) {
if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1920.0f, 16581.0f, -2653.0f, 12, 1, false, 0)) {
- Game_Flag_Set(718);
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1920.0f, 16581.0f, -2653.0f, 12, true, false, 0)) {
+ Game_Flag_Set(kflagPS01toPS02);
Set_Enter(kSetPS02, kScenePS02);
}
return true;
}
+
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1877.9f, 16592.0f, -2975.0f, 0, true, false, 0)) {
Actor_Set_At_XYZ(kActorMcCoy, 1872.0f, 16592.0f, -2975.0f, 870);
@@ -95,77 +105,77 @@ bool SceneScriptPS01::ClickedOnExit(int exitId) {
Game_Flag_Reset(kFlagMcCoyInTyrellBuilding);
Game_Flag_Reset(kFlagMcCoyInDNARow);
Game_Flag_Reset(kFlagMcCoyInBradburyBuilding);
- int spinnerDest = Spinner_Interface_Choose_Dest(3, true);
+ int spinnerDest = Spinner_Interface_Choose_Dest(kPS01LoopDoorAnim, true);
switch (spinnerDest) {
case kSpinnerDestinationMcCoysApartment:
Game_Flag_Set(kFlagMcCoyInMcCoyApartment);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtMA01);
Set_Enter(kSetMA01, kSceneMA01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationRuncitersAnimals:
Game_Flag_Set(kFlagMcCoyInRunciters);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtRC01);
Set_Enter(kSetRC01, kSceneRC01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationChinatown:
Game_Flag_Set(kFlagMcCoyInChinaTown);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtCT01);
Set_Enter(kSetCT01_CT12, kSceneCT01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationAnimoidRow:
Game_Flag_Set(kFlagMcCoyInAnimoidRow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtAR01);
Set_Enter(kSetAR01_AR02, kSceneAR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationTyrellBuilding:
Game_Flag_Set(kFlagMcCoyInTyrellBuilding);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtTB02);
Set_Enter(kSetTB02_TB03, kSceneTB02);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationDNARow:
Game_Flag_Set(kFlagMcCoyInDNARow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtDR01);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationBradburyBuilding:
Game_Flag_Set(kFlagMcCoyInBradburyBuilding);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtBB01);
Set_Enter(kSetBB01, kSceneBB01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationNightclubRow:
Game_Flag_Set(kFlagMcCoyInNightclubRow);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtNR01);
Set_Enter(kSetNR01, kSceneNR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
case kSpinnerDestinationHysteriaHall:
Game_Flag_Set(kFlagMcCoyInHysteriaHall);
Game_Flag_Reset(kFlagSpinnerAtPS01);
Game_Flag_Set(kFlagSpinnerAtHF01);
Set_Enter(kSetHF01, kSceneHF01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kPS01LoopOutshoot, true);
break;
default:
Actor_Face_Heading(kActorMcCoy, 870, false);
Game_Flag_Set(kFlagMcCoyInPoliceStation);
Game_Flag_Set(kFlagArrivedFromSpinner2);
Player_Loses_Control();
- Scene_Loop_Start_Special(2, 3, 1);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, kPS01LoopDoorAnim, true);
break;
}
}
@@ -179,74 +189,87 @@ bool SceneScriptPS01::ClickedOn2DRegion(int region) {
}
void SceneScriptPS01::SceneFrameAdvanced(int frame) {
- if (frame == 71 || frame == 188) {
+ if (frame == 71
+ || frame == 188
+ ) {
Sound_Play(116, 100, 40, 0, 50);
}
- if (frame == 108 || frame == 228) {
+
+ if (frame == 108
+ || frame == 228
+ ) {
Sound_Play(119, 100, 40, 0, 50);
}
+
if (frame == 1) {
Sound_Play(118, 40, 0, 0, 50);
}
+
if (frame == 76) {
Sound_Play(121, 50, 0, 0, 50);
}
+
if (frame == 192) {
Sound_Play(120, 50, 0, 0, 50);
}
+
if (frame == 59) {
Sound_Play(122, 15, 0, 0, 50);
}
+
if (frame == 275) {
Sound_Play(117, 40, 0, 0, 50);
}
+
if (!Game_Flag_Query(kFlagArrivedFromSpinner2)) {
switch (frame) {
case 196:
Actor_Face_Heading(kActorMcCoy, 870, false);
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -1);
- Actor_Change_Animation_Mode(kActorMcCoy, 41);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetIn);
break;
+
case 220:
Actor_Set_Frame_Rate_FPS(kActorMcCoy, 0);
break;
+
case 240:
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -2);
break;
}
- //return true;
- return;
+ return; // true;
}
+
if (frame == 75) {
Actor_Face_Heading(kActorMcCoy, 870, false);
- Actor_Change_Animation_Mode(kActorMcCoy, 42);
- //return true;
- return;
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut);
+ return; // true;
}
+
if (frame == 119) {
Game_Flag_Reset(kFlagArrivedFromSpinner2);
Player_Gains_Control();
- //return true;
- return;
+ return; // true;
}
+
if (frame > 195) {
if (frame == 239) {
Game_Flag_Reset(kFlagArrivedFromSpinner2);
Player_Gains_Control();
}
- //return true;
- return;
+ return; // true;
}
+
if (frame == 181) {
Actor_Face_Heading(kActorMcCoy, 870, false);
- Actor_Change_Animation_Mode(kActorMcCoy, 42);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeSpinnerGetOut);
} else if (frame == 182) {
Actor_Set_Frame_Rate_FPS(kActorMcCoy, 0);
} else if (frame == 195) {
Actor_Set_Frame_Rate_FPS(kActorMcCoy, -2);
}
- //return true;
- return;
+
+ return; // true;
}
void SceneScriptPS01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
@@ -264,7 +287,10 @@ void SceneScriptPS01::PlayerWalkedOut() {
Actor_Set_Invisible(kActorMcCoy, false);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(718) && Global_Variable_Query(kVariableChapter) == 1) {
+
+ if (!Game_Flag_Query(kflagPS01toPS02)
+ && Global_Variable_Query(kVariableChapter) == 1
+ ) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards3, true, -1);