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 SceneScriptCT04::InitializeScene() {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (Game_Flag_Query(72)) {
|
|
|
|
Scene_Loop_Start_Special(0, 0, 0);
|
|
|
|
Scene_Loop_Set_Default(1);
|
|
|
|
Setup_Scene_Information(-150.0f, -621.3f, 357.0f, 533);
|
|
|
|
} else {
|
|
|
|
Scene_Loop_Set_Default(1);
|
|
|
|
Setup_Scene_Information(-82.86f, -621.3f, 769.03f, 1020);
|
|
|
|
}
|
|
|
|
Scene_Exit_Add_2D_Exit(0, 590, 0, 639, 479, 1);
|
|
|
|
Scene_Exit_Add_2D_Exit(1, 194, 84, 320, 274, 0);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(56, 15, -100, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1);
|
|
|
|
Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
|
|
|
|
Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
|
|
|
|
Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
|
|
|
|
Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
|
|
|
|
Ambient_Sounds_Add_Sound(376, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(377, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0);
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::SceneLoaded() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Obstacle_Object("DUMPSTER", true);
|
|
|
|
Obstacle_Object("RIGHTWALL01", true);
|
|
|
|
Obstacle_Object("BACK-BLDNG", true);
|
|
|
|
Clickable_Object("DUMPSTER");
|
|
|
|
Footstep_Sounds_Set(0, 1);
|
|
|
|
if (Game_Flag_Query(72)) {
|
|
|
|
Game_Flag_Reset(72);
|
|
|
|
}
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Actor_Query_Goal_Number(kActorTransient)) {
|
|
|
|
Actor_Change_Animation_Mode(kActorTransient, 38);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::MouseClick(int x, int y) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::ClickedOn3DObject(const char *objectName, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (objectName) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Game_Flag_Query(137) && !Game_Flag_Query(169) && !Actor_Query_Goal_Number(kActorTransient)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Game_Flag_Set(137);
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Set_Goal_Number(kActorTransient, 2);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2018-02-13 23:08:37 +01:00
|
|
|
if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(kVariableChapter) == 1) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -147.41f, -621.3f, 724.57f, 0, 1, false, 0)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Player_Loses_Control();
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Face_Heading(kActorMcCoy, 792, false);
|
|
|
|
Actor_Put_In_Set(kActorTransient, 99);
|
|
|
|
Actor_Set_At_XYZ(kActorTransient, 0, 0, 0, 0);
|
|
|
|
Actor_Change_Animation_Mode(kActorMcCoy, 40);
|
|
|
|
Actor_Voice_Over(320, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(330, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(340, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
Game_Flag_Set(170);
|
|
|
|
Game_Flag_Set(173);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (Game_Flag_Query(170)) {
|
|
|
|
if (Game_Flag_Query(172)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Voice_Over(270, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(280, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else if (Game_Flag_Query(171)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Voice_Over(250, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(260, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Voice_Over(230, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(240, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
Game_Flag_Reset(173);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (Game_Flag_Query(174)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 75, 0, 1, false)) {
|
|
|
|
Actor_Face_Heading(kActorMcCoy, 707, false);
|
|
|
|
Actor_Change_Animation_Mode(kActorMcCoy, 38);
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Play_Sound(553, 45, 30, 30, 0);
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Voice_Over(1810, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(1820, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 75, 0, 1, false)) {
|
|
|
|
Actor_Face_Heading(kActorMcCoy, 707, false);
|
|
|
|
Actor_Change_Animation_Mode(kActorMcCoy, 38);
|
|
|
|
Actor_Clue_Acquire(kActorMcCoy, kClueLicensePlate, 1, -1);
|
2016-09-10 18:33:04 +02:00
|
|
|
Item_Pickup_Spin_Effect(952, 392, 225);
|
|
|
|
Game_Flag_Set(174);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::sub_401D4C() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Dialogue_Menu_Clear_List();
|
2016-10-01 03:20:03 +02:00
|
|
|
if (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0) {
|
2016-09-10 18:33:04 +02:00
|
|
|
DM_Add_To_List_Never_Repeat_Once_Selected(410, 8, 4, -1);
|
|
|
|
}
|
|
|
|
DM_Add_To_List_Never_Repeat_Once_Selected(420, 2, 6, 8);
|
|
|
|
Dialogue_Menu_Appear(320, 240);
|
|
|
|
int answer = Dialogue_Menu_Query_Input();
|
|
|
|
Dialogue_Menu_Disappear();
|
|
|
|
if (answer == 410) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorTransient, 10, 14);
|
|
|
|
Actor_Says(kActorTransient, 20, 14);
|
|
|
|
Actor_Modify_Friendliness_To_Other(kActorTransient, kActorMcCoy, 5);
|
2016-10-01 03:20:03 +02:00
|
|
|
if (Query_Difficulty_Level() != 0) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Global_Variable_Decrement(2, 10);
|
|
|
|
}
|
|
|
|
} else if (answer == 420) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 430, 3);
|
|
|
|
Actor_Says(kActorTransient, 30, 14);
|
|
|
|
Actor_Modify_Friendliness_To_Other(kActorTransient, kActorMcCoy, -5);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::ClickedOnActor(int actorId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (actorId == 12) {
|
|
|
|
if (Game_Flag_Query(169)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorTransient, 36, 1, false)) {
|
|
|
|
Actor_Voice_Over(290, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(300, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(310, kActorVoiceOver);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
} else {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Set_Targetable(kActorTransient, false);
|
|
|
|
if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorTransient, 36, 1, false)) {
|
|
|
|
Actor_Face_Actor(kActorMcCoy, kActorTransient, true);
|
2016-09-10 18:33:04 +02:00
|
|
|
if (!Game_Flag_Query(137)) {
|
2018-02-13 23:08:37 +01:00
|
|
|
if (Game_Flag_Query(kFlagZubenRetired)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 435, 3);
|
|
|
|
Actor_Set_Goal_Number(kActorTransient, 2);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
|
|
|
Music_Stop(3);
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 425, 3);
|
|
|
|
Actor_Says(kActorTransient, 0, 13);
|
2016-09-10 18:33:04 +02:00
|
|
|
sub_401D4C();
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Set_Goal_Number(kActorTransient, 2);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
Game_Flag_Set(137);
|
|
|
|
} else {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Face_Actor(kActorMcCoy, kActorTransient, true);
|
|
|
|
Actor_Says(kActorMcCoy, 435, 3);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::ClickedOnItem(int itemId, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::ClickedOnExit(int exitId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 1) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -82.86f, -621.3f, 769.03f, 0, 1, false, 0)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
|
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Actor_Query_Goal_Number(kActorTransient)) {
|
|
|
|
Actor_Set_Goal_Number(kActorTransient, 2);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
Game_Flag_Set(74);
|
2018-02-05 18:46:09 +01:00
|
|
|
Set_Enter(28, kSceneCT05);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (exitId == 0) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -187.0f, -621.3f, 437.0f, 0, 1, false, 0)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
|
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
|
|
|
Game_Flag_Set(73);
|
2018-02-05 18:46:09 +01:00
|
|
|
Set_Enter(5, kSceneCT03);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptCT04::ClickedOn2DRegion(int region) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::SceneFrameAdvanced(int frame) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (Game_Flag_Query(325)) {
|
|
|
|
Game_Flag_Reset(325);
|
|
|
|
Sound_Play(180, 100, 80, 80, 50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::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 SceneScriptCT04::PlayerWalkedIn() {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::PlayerWalkedOut() {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptCT04::DialogueQueueFlushed(int a1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|