Skip to content

Commit

Permalink
BLADERUNNER: DR01, DR02 improved navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniou79 committed May 31, 2019
1 parent f50492e commit 1273022
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
35 changes: 30 additions & 5 deletions engines/bladerunner/script/scene/dr01.cpp
Expand Up @@ -129,11 +129,36 @@ bool SceneScriptDR01::ClickedOnItem(int itemId, bool a2) {

bool SceneScriptDR01::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -835.0f, -0.04f, -118.0f, 0, true, false, false)) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -911.0f, -0.04f, -118.0f, 0, false);
Ambient_Sounds_Adjust_Looping_Sound(kSfxFACTAMB2, 10, -100, 1);
Game_Flag_Set(kFlagDR01toDR02);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR02);
if (_vm->_cutContent) {
float x, y, z;
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
bool exitFlag = true;
bool fromFarTop = false;
if (x < -1088) {
fromFarTop = true;
exitFlag = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1149.80f, 0.56f, -94.45f, 0, true, false, false);
} else if (-1088 < x && x < -642) {
exitFlag = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1271.89f, 6.71f, -268.63f, 0, true, false, false);
} else {
exitFlag = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -835.0f, -0.04f, -118.0f, 0, true, false, false);
}
if (!exitFlag) {
if (fromFarTop) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -1066.51f, 0.51f, -110.60f, 0, false);
} else {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -911.0f, -0.04f, -118.0f, 0, false);
}
Ambient_Sounds_Adjust_Looping_Sound(kSfxFACTAMB2, 10, -100, 1);
Game_Flag_Set(kFlagDR01toDR02);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR02);
}
} else {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -835.0f, -0.04f, -118.0f, 0, true, false, false)) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -911.0f, -0.04f, -118.0f, 0, false);
Ambient_Sounds_Adjust_Looping_Sound(kSfxFACTAMB2, 10, -100, 1);
Game_Flag_Set(kFlagDR01toDR02);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR02);
}
}
return true;
}
Expand Down
29 changes: 29 additions & 0 deletions engines/bladerunner/script/scene/dr02.cpp
Expand Up @@ -40,6 +40,11 @@ void SceneScriptDR02::InitializeScene() {
if (Game_Flag_Query(kFlagBB01Available)) {
Scene_Exit_Add_2D_Exit(2, 95, 0, 148, 292, 0);
}
if (_vm->_cutContent) {
// improved navigation of this set of scenes
Scene_Exit_Add_2D_Exit(3, 0, 0, 34, 479, 3);
Scene_Exit_Add_2D_Exit(4, 34, 445, 605, 479, 2);
}

Ambient_Sounds_Remove_All_Non_Looping_Sounds(false);
Ambient_Sounds_Remove_All_Looping_Sounds(0);
Expand Down Expand Up @@ -72,6 +77,8 @@ void SceneScriptDR02::SceneLoaded() {
Obstacle_Object("PARKMETR01", true);
Obstacle_Object("Z2ENTRYDR", true);
Obstacle_Object("Z2DR2", true);
// there are two objects named "TRASH CAN WITH FIRE" in the scene (but not visible)
// and none of them have to be set clickable
Clickable_Object("TRASH CAN WITH FIRE");
Clickable_Object("U2 CHEWDOOR");
Clickable_Object("MMTRASHCAN");
Expand All @@ -86,6 +93,9 @@ void SceneScriptDR02::SceneLoaded() {
Clickable_Object("TRANSFORMER 01");
Clickable_Object("TRANSFORMER 02");
Clickable_Object("V2CANPIPE02");
// there are two objects named "TRASH CAN WITH FIRE" in the scene (but not visible)
// and none of them have to be set clickable
// and also reseting them here would only reset one of them - and one remains as clickable
Unclickable_Object("TRASH CAN WITH FIRE");
Unclickable_Object("U2 CHEWDOOR");
Unclickable_Object("MMTRASHCAN");
Expand Down Expand Up @@ -130,6 +140,25 @@ bool SceneScriptDR02::ClickedOnExit(int exitId) {
return true;
}

if (_vm->_cutContent
&& (exitId == 3 || exitId == 4)) {
if ((exitId == 3 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1162.45f, 0.78f, -167.45f, 0, true, false, false))
|| (exitId == 4 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -975.17f, 0.42f, -120.04f, 0, true, false, false))
) {
if (exitId == 3) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -1176.40f, 0.58f, -86.02f, 0, false);
} else {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -845.00f, 0.37f, -31.60f, 0, false);
}
Game_Flag_Set(kFlagDR02toDR01);
Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
}
Ambient_Sounds_Adjust_Looping_Sound(kSfxHUMMER3, 12, -101, 1);
Ambient_Sounds_Adjust_Looping_Sound(kSfxBIGFAN2, 14, -101, 1);
return true;
}


if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1162.0f, 7.18f, -322.0f, 0, true, false, false)) {
if (Global_Variable_Query(kVariableChapter) > 2) {
Expand Down

0 comments on commit 1273022

Please sign in to comment.