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 SceneScriptUG03::InitializeScene() {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (Game_Flag_Query(335)) {
|
|
|
|
Setup_Scene_Information(-51.0f, 0.03f, 255.0f, 780);
|
|
|
|
Game_Flag_Reset(335);
|
|
|
|
} else if (Game_Flag_Query(337)) {
|
|
|
|
Setup_Scene_Information(-139.0f, 0.03f, -13.0f, 540);
|
|
|
|
Game_Flag_Reset(337);
|
|
|
|
} else {
|
|
|
|
Setup_Scene_Information(-121.88f, 0.03f, 213.35f, 540);
|
|
|
|
}
|
|
|
|
Scene_Exit_Add_2D_Exit(0, 46, 137, 131, 296, 0);
|
|
|
|
Scene_Exit_Add_2D_Exit(1, 559, 141, 639, 380, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(331, 15, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(395, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(393, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(226, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0);
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG03::SceneLoaded() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Obstacle_Object("=WALL_RIGHT_HOLE", true);
|
|
|
|
Unobstacle_Object("=HOLERUBBLE1", true);
|
|
|
|
Clickable_Object("CHAIR_HEADZAPPER");
|
|
|
|
Clickable_Object("CHAIR_BACK");
|
|
|
|
Clickable_Object("CHAIR_SEAT");
|
|
|
|
Clickable_Object("CHAIR_STRAPLEGLEFT");
|
|
|
|
Clickable_Object("CHAIR_STRAPLEGRIGHT");
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::MouseClick(int x, int y) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::ClickedOn3DObject(const char *objectName, bool a2) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if ((Object_Query_Click("CHAIR_BACK", objectName) || Object_Query_Click("CHAIR_SEAT", objectName) || Object_Query_Click("CHAIR_HEADZAPPER", objectName)) && !Loop_Actor_Walk_To_Scene_Object(kActorMcCoy, "CHAIR_BACK", 36, true, false)) {
|
|
|
|
Actor_Face_Object(kActorMcCoy, "CHAIR_BACK", true);
|
|
|
|
if (!Actor_Clue_Query(kActorMcCoy, kClueScaryChair)) {
|
|
|
|
Actor_Voice_Over(2550, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(2560, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(2570, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(2580, kActorVoiceOver);
|
|
|
|
Actor_Voice_Over(2590, kActorVoiceOver);
|
|
|
|
Actor_Clue_Acquire(kActorMcCoy, kClueScaryChair, 1, -1);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::ClickedOnActor(int actorId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::ClickedOnItem(int itemId, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::ClickedOnExit(int exitId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 0) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -139.0f, 0.0f, -13.0f, 0, 1, false, 0)) {
|
2018-02-13 23:08:37 +01:00
|
|
|
if (Global_Variable_Query(kVariableChapter) < 4) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 8522, 14);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
|
|
|
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
|
|
|
|
Ambient_Sounds_Remove_All_Looping_Sounds(1);
|
|
|
|
Game_Flag_Set(336);
|
2018-02-05 18:46:09 +01:00
|
|
|
Set_Enter(83, kSceneUG10);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (exitId == 1) {
|
2017-03-29 01:50:47 +02:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -51.0f, 0.0f, 255.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(334);
|
2018-02-05 18:46:09 +01:00
|
|
|
Set_Enter(77, kSceneUG04);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG03::ClickedOn2DRegion(int region) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG03::SceneFrameAdvanced(int frame) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG03::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 SceneScriptUG03::PlayerWalkedIn() {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG03::PlayerWalkedOut() {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG03::DialogueQueueFlushed(int a1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|