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 SceneScriptUG01::InitializeScene() {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagUG10toUG01)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Setup_Scene_Information(34.47f, -50.13f, -924.11f, 500);
|
2019-01-14 21:09:12 +01:00
|
|
|
Game_Flag_Reset(kFlagUG10toUG01);
|
2019-01-13 20:38:17 +01:00
|
|
|
} else if (Game_Flag_Query(kFlagRC03toUG01)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Setup_Scene_Information(-68.0f, -50.13f, -504.0f, 377);
|
|
|
|
} else {
|
|
|
|
Setup_Scene_Information(-126.0f, -50.13f, -286.0f, 0);
|
|
|
|
}
|
|
|
|
Scene_Exit_Add_2D_Exit(0, 280, 204, 330, 265, 0);
|
2019-01-21 21:57:44 +01:00
|
|
|
Scene_Exit_Add_2D_Exit(1, 144, 0, 210, 104, 0);
|
|
|
|
Scene_Exit_Add_2D_Exit(2, 0, 173, 139, 402, 3);
|
|
|
|
|
2016-09-10 18:33:04 +02:00
|
|
|
Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1);
|
|
|
|
Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1);
|
2019-01-21 21:57:44 +01:00
|
|
|
Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(397, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0);
|
|
|
|
Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0);
|
|
|
|
|
|
|
|
if (Game_Flag_Query(kFlagUG01SteamOff)) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Loop_Set_Default(3);
|
|
|
|
} else {
|
|
|
|
Scene_Loop_Set_Default(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG01::SceneLoaded() {
|
2016-09-10 18:33:04 +02:00
|
|
|
Unobstacle_Object("BEAM02", true);
|
|
|
|
Unobstacle_Object("BEAM03", true);
|
|
|
|
Unobstacle_Object("BEAM04", true);
|
|
|
|
Clickable_Object("PIPES_FG_LFT");
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::MouseClick(int x, int y) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::ClickedOn3DObject(const char *objectName, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (Object_Query_Click("PIPES_FG_LFT", objectName)) {
|
2019-01-21 21:57:44 +01:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -9.0f, -50.13f, -148.0f, 0, 1, false, 0)
|
|
|
|
&& !Game_Flag_Query(kFlagUG01SteamOff)
|
|
|
|
) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 8525, 13);
|
2016-09-10 18:33:04 +02:00
|
|
|
Scene_Loop_Set_Default(3);
|
2018-02-25 19:31:52 +01:00
|
|
|
Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, true);
|
2019-01-21 21:57:44 +01:00
|
|
|
Game_Flag_Set(kFlagUG01SteamOff);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Says(kActorMcCoy, 8525, 13);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::ClickedOnActor(int actorId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::ClickedOnItem(int itemId, bool a2) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::ClickedOnExit(int exitId) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 0) {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -32.0f, -50.13f, -1350.0f, 12, true, false, 0)) {
|
|
|
|
Game_Flag_Set(kFlagUG01toUG10);
|
2019-01-13 20:38:17 +01:00
|
|
|
Set_Enter(kSetUG10, kSceneUG10);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2019-01-21 21:57:44 +01:00
|
|
|
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 1) {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -70.0f, -50.13f, -500.0f, 0, true, false, 0)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Face_Heading(kActorMcCoy, 768, false);
|
2019-01-14 21:09:12 +01:00
|
|
|
Loop_Actor_Travel_Ladder(kActorMcCoy, 12, true, 0);
|
2019-01-13 20:38:17 +01:00
|
|
|
Game_Flag_Set(kFlagUG01toRC03);
|
2019-01-24 22:57:41 +01:00
|
|
|
Game_Flag_Reset(kFlagMcCoyInUnderground);
|
|
|
|
Game_Flag_Set(kFlagMcCoyInRunciters);
|
2019-01-13 20:38:17 +01:00
|
|
|
Set_Enter(kSetRC03, kSceneRC03);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2019-01-21 21:57:44 +01:00
|
|
|
|
2016-09-10 18:33:04 +02:00
|
|
|
if (exitId == 2) {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -126.0f, -50.13f, -286.0f, 0, true, false, 0)) {
|
|
|
|
Game_Flag_Set(kFlagUG01toUG02);
|
2019-01-13 20:38:17 +01:00
|
|
|
Set_Enter(kSetUG02, kSceneUG02);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
bool SceneScriptUG01::ClickedOn2DRegion(int region) {
|
2016-09-10 18:33:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG01::SceneFrameAdvanced(int frame) {
|
2016-09-10 18:33:04 +02:00
|
|
|
if (frame >= 61 && frame <= 120) {
|
2019-01-21 21:57:44 +01:00
|
|
|
float density = (120 - frame) / 29500.0f; // why is this so big?
|
|
|
|
Set_Fog_Density("BoxFog01", density);
|
|
|
|
Set_Fog_Density("BoxFog02", density);
|
|
|
|
Set_Fog_Density("BoxFog03", density);
|
|
|
|
Set_Fog_Density("BoxFog04", density);
|
2016-09-10 18:33:04 +02:00
|
|
|
} else if (frame > 120) {
|
|
|
|
Set_Fog_Density("BoxFog01", 0.0f);
|
|
|
|
Set_Fog_Density("BoxFog02", 0.0f);
|
|
|
|
Set_Fog_Density("BoxFog03", 0.0f);
|
|
|
|
Set_Fog_Density("BoxFog04", 0.0f);
|
|
|
|
}
|
|
|
|
//return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG01::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 SceneScriptUG01::PlayerWalkedIn() {
|
2019-01-14 21:09:12 +01:00
|
|
|
if (Game_Flag_Query(kFlagUG02toUG01)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -55.0f, -50.13f, -288.0f, 12, 0, false, 0);
|
2019-01-14 21:09:12 +01:00
|
|
|
Game_Flag_Reset(kFlagUG02toUG01);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-21 21:57:44 +01:00
|
|
|
|
2019-01-13 20:38:17 +01:00
|
|
|
if (Game_Flag_Query(kFlagRC03toUG01)) {
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Set_At_XYZ(kActorMcCoy, -70.0f, 93.87f, -500.0f, 768);
|
|
|
|
Loop_Actor_Travel_Ladder(kActorMcCoy, 12, 0, 0);
|
|
|
|
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -58.0f, -50.13f, -488.0f, 0, 0, false, 0);
|
2019-01-13 20:38:17 +01:00
|
|
|
Game_Flag_Reset(kFlagRC03toUG01);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
2019-01-21 21:57:44 +01:00
|
|
|
|
2017-03-29 01:50:47 +02:00
|
|
|
if (Actor_Query_Goal_Number(kActorLucy) == 310) {
|
2016-09-10 18:33:04 +02:00
|
|
|
Music_Play(21, 35, 0, 3, -1, 0, 0);
|
2017-03-29 01:50:47 +02:00
|
|
|
Actor_Set_Goal_Number(kActorLucy, 311);
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
//return false;
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG01::PlayerWalkedOut() {
|
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);
|
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:10 +01:00
|
|
|
void SceneScriptUG01::DialogueQueueFlushed(int a1) {
|
2016-09-10 18:33:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|