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 SceneScriptMA07::InitializeScene() {
|
2019-01-24 22:57:41 +01:00
|
|
|
if (Game_Flag_Query(kFlagUG19toMA07)) {
|
|
|
|
Setup_Scene_Information( 6.75f, -172.43f, 356.0f, 997);
|
|
|
|
Game_Flag_Reset(kFlagUG19toMA07);
|
2019-01-31 20:20:21 +01:00
|
|
|
Game_Flag_Set(kFlagUG19Available);
|
2019-01-24 22:57:41 +01:00
|
|
|
} else if (Game_Flag_Query(kFlagPS14toMA07)) {
|
|
|
|
Setup_Scene_Information(-312.0f, -162.8f, 180.0f, 0);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2019-01-24 22:57:41 +01:00
|
|
|
Setup_Scene_Information( 104.0f, -162.16f, 56.0f, 519);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2019-04-06 00:02:32 +03:00
|
|
|
Ambient_Sounds_Add_Looping_Sound(kSfxRAIN10, 100, 1, 1);
|
2019-04-06 19:21:00 +03:00
|
|
|
Ambient_Sounds_Add_Sound(kSfxCOLONY, 100, 300, 16, 25, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxSPIN2B, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxSPIN3A, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDER2, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDER3, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(kSfxTHNDER4, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
|
2019-01-24 22:57:41 +01:00
|
|
|
|
2018-02-13 23:08:37 +01:00
|
|
|
if (Global_Variable_Query(kVariableChapter) > 1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exit_Add_2D_Exit(1, 0, 200, 50, 479, 3);
|
|
|
|
}
|
2019-01-31 20:20:21 +01:00
|
|
|
if (Game_Flag_Query(kFlagUG19Available)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exit_Add_2D_Exit(2, 176, 386, 230, 426, 2);
|
|
|
|
}
|
|
|
|
Scene_Exit_Add_2D_Exit(0, 270, 216, 382, 306, 0);
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::SceneLoaded() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Obstacle_Object("BARRICADE", true);
|
2019-06-28 15:30:05 +03:00
|
|
|
if (_vm->_cutContent) {
|
2019-05-06 23:52:48 +03:00
|
|
|
if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelShouldBeOutsideMcCoysAct3) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelIsOutsideMcCoysBuildingAct3);
|
|
|
|
}
|
|
|
|
}
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::MouseClick(int x, int y) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::ClickedOn3DObject(const char *objectName, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::ClickedOnActor(int actorId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::ClickedOnItem(int itemId, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::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, 104.0f, -162.0f, 56.0f, 12, true, false, false)) {
|
2019-01-24 22:57:41 +01:00
|
|
|
if (Global_Variable_Query(kVariableChapter) == 4
|
2019-02-02 18:19:34 +01:00
|
|
|
&& Game_Flag_Query(kFlagUG18GuzzaScene)
|
2019-01-24 22:57:41 +01:00
|
|
|
) {
|
2019-02-02 19:37:31 +01:00
|
|
|
Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyStartChapter5);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2017-09-10 20:19:02 +02:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
2017-09-10 20:19:02 +02:00
|
|
|
Game_Flag_Set(kFlagMA07toMA06);
|
2019-01-14 21:09:12 +01:00
|
|
|
Set_Enter(kSetMA06, kSceneMA06);
|
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 == 1) {
|
2019-05-09 15:15:33 +03:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -400.0f, -162.8f, 185.08f, 0, true, false, false)) {
|
2017-09-10 20:19:02 +02:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
2019-01-24 22:57:41 +01:00
|
|
|
Game_Flag_Set(kFlagMA07toPS14);
|
|
|
|
Game_Flag_Reset(kFlagMcCoyInMcCoyApartment);
|
|
|
|
Game_Flag_Set(kFlagMcCoyInPoliceStation);
|
2019-01-14 21:09:12 +01:00
|
|
|
Set_Enter(kSetPS14, kScenePS14);
|
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, 8.0f, -172.43f, 356.0f, 0, true, false, false)) {
|
2019-01-21 21:57:44 +01:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
2019-01-24 22:57:41 +01:00
|
|
|
Game_Flag_Set(kFlagMA07toUG19);
|
2019-01-14 21:09:12 +01:00
|
|
|
Set_Enter(kSetUG19, kSceneUG19);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptMA07::ClickedOn2DRegion(int region) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::SceneFrameAdvanced(int frame) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
|
2019-02-03 17:52:17 +01:00
|
|
|
if (actorId == kActorGaff
|
|
|
|
&& newGoal == kGoalGaffMA07Left
|
|
|
|
) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exits_Enable();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::PlayerWalkedIn() {
|
2019-01-24 22:57:41 +01:00
|
|
|
if (Game_Flag_Query(kFlagPS14toMA07)) {
|
2019-05-09 15:15:33 +03:00
|
|
|
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -268.0f, -162.8f, 188.0f, 0, false, false, false);
|
2019-01-24 22:57:41 +01:00
|
|
|
Game_Flag_Reset(kFlagPS14toMA07);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-02-02 00:17:18 +01:00
|
|
|
|
2019-05-06 23:52:48 +03:00
|
|
|
if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutsideMcCoysBuildingAct3) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelIsOutWalksToPoliceHQAct3);
|
|
|
|
} else if (_vm->_cutContent && Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutsideMcCoysBuildingAct4) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelIsOutWalksToPoliceHQAct4);
|
|
|
|
}
|
2019-02-02 00:17:18 +01:00
|
|
|
|
2018-02-10 20:34:28 +01:00
|
|
|
if (Game_Flag_Query(kFlagMA06toMA07)) {
|
|
|
|
Game_Flag_Reset(kFlagMA06toMA07);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-02-02 00:17:18 +01:00
|
|
|
|
2019-02-03 17:52:17 +01:00
|
|
|
if (!Game_Flag_Query(kFlagMA07GaffTalk)
|
2019-02-02 18:19:34 +01:00
|
|
|
&& Game_Flag_Query(kFlagUG18GuzzaScene)
|
2019-01-24 22:57:41 +01:00
|
|
|
&& Global_Variable_Query(kVariableChapter) == 4
|
|
|
|
) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Exits_Disable();
|
2019-06-26 19:38:00 +03:00
|
|
|
#if BLADERUNNER_ORIGINAL_BUGS
|
|
|
|
#else
|
|
|
|
// don't have McCoy with his gun drawn out when talking to Gaff here
|
|
|
|
Player_Set_Combat_Mode(false);
|
|
|
|
#endif // BLADERUNNER_ORIGINAL_BUGS
|
2019-02-03 17:52:17 +01:00
|
|
|
Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07Wait);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-02-02 00:17:18 +01:00
|
|
|
|
2019-02-02 19:37:31 +01:00
|
|
|
if (Game_Flag_Query(kFlagMcCoyFreedOfAccusations)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Voice_Over(1360, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(1370, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(1380, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(1390, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(1400, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
Delay(1000);
|
2019-02-02 19:37:31 +01:00
|
|
|
Game_Flag_Reset(kFlagMcCoyFreedOfAccusations);
|
2017-09-10 20:19:02 +02:00
|
|
|
Game_Flag_Set(kFlagMA06ToMA02);
|
2018-02-13 23:08:37 +01:00
|
|
|
Set_Enter(kSetMA02_MA04, kSceneMA02);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
//return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::PlayerWalkedOut() {
|
2019-05-06 23:52:48 +03:00
|
|
|
if (_vm->_cutContent) {
|
|
|
|
if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutsideMcCoysBuildingAct3
|
|
|
|
|| Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutWalksToPoliceHQAct3
|
|
|
|
|| Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutFleeingToPoliceHQAct3
|
|
|
|
) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelAtEndOfAct3IfNotMetWithMcCoy);
|
|
|
|
} else if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutResumesWalkToPoliceHQAct3) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelAtEndOfAct3IfMetWithMcCoy);
|
|
|
|
} else if (Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutsideMcCoysBuildingAct4
|
|
|
|
|| Actor_Query_Goal_Number(kActorRachael) == kGoalRachaelIsOutWalksToPoliceHQAct4
|
|
|
|
) {
|
|
|
|
Actor_Set_Goal_Number(kActorRachael, kGoalRachaelAtEndOfAct4);
|
|
|
|
}
|
|
|
|
}
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptMA07::DialogueQueueFlushed(int a1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|