2016-09-10 18:33:04 +02:00
|
|
|
/* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-02-10 20:34:28 +01:00
|
|
|
#include "bladerunner/script/scene_script.h"
|
2016-09-10 18:33:04 +02:00
|
|
|
|
|
|
|
namespace BladeRunner {
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::InitializeScene() {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagDR03toDR02)) {
|
2019-01-24 22:57:41 +01:00
|
|
|
Setup_Scene_Information(-1162.0f, 7.18f, -322.0f, 552);
|
2019-01-14 21:09:12 +01:00
|
|
|
} else if (Game_Flag_Query(kFlagDR01toDR02)) {
|
2019-01-24 22:57:41 +01:00
|
|
|
Setup_Scene_Information( -835.0f, -0.04f, -118.0f, 193);
|
2019-01-14 21:09:12 +01:00
|
|
|
} else if (Game_Flag_Query(kFlagBB01toDR02)) {
|
2019-01-24 22:57:41 +01:00
|
|
|
Setup_Scene_Information(-1258.0f, 7.18f, -314.0f, 400);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2019-01-24 22:57:41 +01:00
|
|
|
Setup_Scene_Information( 168.78f, 0.16f, -775.72f, 193);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-24 22:57:41 +01:00
|
|
|
|
|
|
|
Scene_Exit_Add_2D_Exit(0, 605, 0, 639, 479, 1);
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exit_Add_2D_Exit(1, 222, 176, 279, 314, 0);
|
2019-01-24 22:57:41 +01:00
|
|
|
if (Game_Flag_Query(kFlagBB01Available)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exit_Add_2D_Exit(2, 95, 0, 148, 292, 0);
|
|
|
|
}
|
2019-06-01 02:28:00 +03:00
|
|
|
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);
|
|
|
|
}
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2019-05-09 15:15:33 +03:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(false);
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(0);
|
2019-04-06 00:02:32 +03:00
|
|
|
Ambient_Sounds_Add_Looping_Sound(kSfxCTRAIN1, 50, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(kSfxHUMMER3, 27, 85, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(kSfxBIGFAN2, 38, 85, 1);
|
2019-04-06 19:21:00 +03:00
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDR1, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDR2, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDR3, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxSPIN2A, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxSPIN1A, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0);
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagDR01toDR02)) {
|
|
|
|
Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Loop_Set_Default(1);
|
|
|
|
} else {
|
|
|
|
Scene_Loop_Set_Default(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::SceneLoaded() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Obstacle_Object("TRASH CAN WITH FIRE", true);
|
|
|
|
Obstacle_Object("V2PYLON02", true);
|
|
|
|
Obstacle_Object("V2PYLON04", true);
|
|
|
|
Obstacle_Object("U2 CHEWDOOR", true);
|
|
|
|
Obstacle_Object("MMTRASHCAN", true);
|
|
|
|
Obstacle_Object("PARKMETR02", true);
|
|
|
|
Obstacle_Object("TRANSFORMER 01", true);
|
|
|
|
Obstacle_Object("TRANSFORMER 02", true);
|
|
|
|
Obstacle_Object("PARKMETR01", true);
|
|
|
|
Obstacle_Object("Z2ENTRYDR", true);
|
|
|
|
Obstacle_Object("Z2DR2", true);
|
2019-06-01 02:28:00 +03:00
|
|
|
// there are two objects named "TRASH CAN WITH FIRE" in the scene (but not visible)
|
|
|
|
// and none of them have to be set clickable
|
2016-09-10 18:33:04 +02:00
|
|
|
Clickable_Object("TRASH CAN WITH FIRE");
|
|
|
|
Clickable_Object("U2 CHEWDOOR");
|
|
|
|
Clickable_Object("MMTRASHCAN");
|
|
|
|
Clickable_Object("U2 EYE");
|
|
|
|
Clickable_Object("U2 E");
|
|
|
|
Clickable_Object("MMNEWSP01");
|
2019-01-26 18:23:54 +01:00
|
|
|
Clickable_Object("MMNEWSP02");
|
2016-09-10 18:33:04 +02:00
|
|
|
Clickable_Object("MMNEWSP04");
|
|
|
|
Clickable_Object("MMNEWSP05");
|
|
|
|
Clickable_Object("MMNEWSP07");
|
|
|
|
Clickable_Object("PARKMETR02");
|
|
|
|
Clickable_Object("TRANSFORMER 01");
|
|
|
|
Clickable_Object("TRANSFORMER 02");
|
|
|
|
Clickable_Object("V2CANPIPE02");
|
2019-06-01 02:28:00 +03:00
|
|
|
// 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
|
2016-09-10 18:33:04 +02:00
|
|
|
Unclickable_Object("TRASH CAN WITH FIRE");
|
|
|
|
Unclickable_Object("U2 CHEWDOOR");
|
|
|
|
Unclickable_Object("MMTRASHCAN");
|
2019-06-01 16:51:19 +03:00
|
|
|
if (_vm->_cutContent) {
|
|
|
|
if (Game_Flag_Query(kFlagMcCoyCommentsOnEyeOfEyeworks)) {
|
|
|
|
Unclickable_Object("U2 EYE");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Unclickable_Object("U2 EYE");
|
|
|
|
}
|
2016-09-10 18:33:04 +02:00
|
|
|
Unclickable_Object("U2 E");
|
|
|
|
Unclickable_Object("MMNEWSP01");
|
|
|
|
Unclickable_Object("MMNEWSP02");
|
|
|
|
Unclickable_Object("MMNEWSP04");
|
2019-01-26 18:23:54 +01:00
|
|
|
Unclickable_Object("MMNEWSP05");
|
2016-09-10 18:33:04 +02:00
|
|
|
Unclickable_Object("MMNEWSP07");
|
|
|
|
Unclickable_Object("PARKMETR02");
|
|
|
|
Unclickable_Object("TRANSFORMER 01");
|
|
|
|
Unclickable_Object("TRANSFORMER 02");
|
|
|
|
Unclickable_Object("V2CANPIPE02");
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::MouseClick(int x, int y) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::ClickedOn3DObject(const char *objectName, bool a2) {
|
2019-06-01 16:51:19 +03:00
|
|
|
if (_vm->_cutContent) {
|
|
|
|
if (!Game_Flag_Query(kFlagMcCoyCommentsOnEyeOfEyeworks)
|
|
|
|
&& (Object_Query_Click("U2 EYE", objectName))
|
|
|
|
) {
|
|
|
|
Game_Flag_Set(kFlagMcCoyCommentsOnEyeOfEyeworks);
|
|
|
|
Unclickable_Object("U2 EYE");
|
|
|
|
Actor_Voice_Over(660, kActorVoiceOver);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::ClickedOnActor(int actorId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::ClickedOnItem(int itemId, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::ClickedOnExit(int exitId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 0) {
|
2019-05-09 15:15:33 +03:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -835.0f, -0.04f, -118.0f, 0, true, false, false)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Async_Actor_Walk_To_XYZ(kActorMcCoy, -727.0f, -0.04f, -118.0f, 0, false);
|
2019-01-14 21:09:12 +01:00
|
|
|
Game_Flag_Set(kFlagDR02toDR01);
|
|
|
|
Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-04-06 00:02:32 +03:00
|
|
|
Ambient_Sounds_Adjust_Looping_Sound(kSfxHUMMER3, 12, -101, 1);
|
|
|
|
Ambient_Sounds_Adjust_Looping_Sound(kSfxBIGFAN2, 14, -101, 1);
|
2016-09-10 18:33:04 +02:00
|
|
|
return true;
|
|
|
|
}
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2019-06-01 02:28:00 +03:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 1) {
|
2019-05-09 15:15:33 +03:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1162.0f, 7.18f, -322.0f, 0, true, false, false)) {
|
2018-02-13 23:08:37 +01:00
|
|
|
if (Global_Variable_Query(kVariableChapter) > 2) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 8522, 15);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2019-01-14 21:09:12 +01:00
|
|
|
Game_Flag_Set(kFlagDR02toDR03);
|
|
|
|
Set_Enter(kSetDR03, kSceneDR03);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 2) {
|
2019-05-09 15:15:33 +03:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1258.0f, 7.18f, -314.0f, 0, true, false, false)) {
|
2019-01-14 21:09:12 +01:00
|
|
|
Game_Flag_Set(kFlagDR02toBB01);
|
2019-01-24 22:57:41 +01:00
|
|
|
Game_Flag_Reset(kFlagMcCoyInDNARow);
|
|
|
|
Game_Flag_Set(kFlagMcCoyInBradburyBuilding);
|
2019-01-14 21:09:12 +01:00
|
|
|
Set_Enter(kSetBB01, kSceneBB01);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptDR02::ClickedOn2DRegion(int region) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::SceneFrameAdvanced(int frame) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (frame == 1) {
|
2019-04-05 21:33:47 +03:00
|
|
|
Sound_Play(kSfxSTEAM1, 10, 85, 85, 50);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::PlayerWalkedIn() {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagDR03toDR02)) {
|
|
|
|
Game_Flag_Reset(kFlagDR03toDR02);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagDR01toDR02)) {
|
|
|
|
Game_Flag_Reset(kFlagDR01toDR02);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagBB01toDR02)) {
|
|
|
|
Game_Flag_Reset(kFlagBB01toDR02);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::PlayerWalkedOut() {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptDR02::DialogueQueueFlushed(int a1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|