#include "interfaces/Map_Interface.hps"
#include "base/Inputhandler_Types.hps"
#include "helpers/helper_map.hps"
#include "helpers/helper_props.hps"
#include "helpers/helper_effects.hps"
#include "helpers/helper_audio.hps"
#include "helpers/helper_imgui.hps"
#include "helpers/helper_sequences.hps"
#include "helpers/helper_game.hps"
#include "helpers/helper_modules.hps"
#include "helpers/helper_ai.hps"
#include "helpers/helper_player.hps"
#include "helper_custom_depth.hps"
#include "helper_imgui_station.hps"
#include "helper_imgui_station_apps_common.hps"
#include "helper_imgui_station_app_error.hps"
#include "helper_imgui_station_app_numpad.hps"
#include "helper_imgui_station_app_audioplayback.hps"
#include "helper_imgui_station_app_mail.hps"
//--------------------------------------------------
/*Place any global values here. These must be const variables as they will not be saved*/
/*This is also the place for enums and classes, but these should be avoided whenever possible*/
//--------------------------------------------------
const tString gsDoorCodeNo = "0735";
enum eHubRoomTerminalState
{
eHubRoomTerminalState_MainMenu = -1,
eHubRoomTerminalState_Mail,
eHubRoomTerminalState_Power,
eHubRoomTerminalState_Staff,
eHubRoomTerminalState_LogOut,
eHubRoomTerminalState_LogIn_Main,
eHubRoomTerminalState_LogIn_Code,
}
class cScrMap : iScrMap
{
/////////////////////////////////////////
// ==============
// VARIABLE CREATION
// ==============
//{///////////////////////////////////////
//} END VARIABLE CREATION
//--------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////////
// ==============
// MAIN CALLBACKS
// ==============
//{///////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------
////////////////////////////
// Set up map environment
void Setup()
{
}
//-------------------------------------------------------
////////////////////////////
// Run first time starting map
void OnStart()
{
SetupLabCamera();
Map_AddTimer("TrainBounce",1.0,"Timer_TrainBounce");
Map_AddTimer("ComputerLoad",1.0,"Timer_ComputerLoad");
Prop_MoveLinearTo("01_05_transporter_passenger_1", "train_arrived", 10, 12, 4.0f, false);
Light_SetVisible("SamsElectrolyte",false);
ParticleSystem_SetVisible("SamElecPS_*",false);
ParticleSystem_SetVisible("panelPS_*",false);
ParticleSystem_SetVisible("wau_panelPS_*",false);
Light_SetVisible("PointLight_156",false);
Entity_PlayAnimation("patchwork","lying",0.0f,true);
Prop_SetStaticPhysics("01_05_transporter_passenger_door*", true);
Entity_AttachToEntity("player", "01_05_transporter_passenger_1", "", false, true);
Sound_CreateAtEntity("TrainLoop", "01_04_transport_station/Special/Train/sequence", "player", 0.0f, false, 1.0f);
/////Starting Sequence///////
Player_SetJumpDisabled(true);
Effect_Fade_Out(0.0f);
Effect_Fade_In(5.0f);
Sound_FadeGlobalVolume(0.0f, 0.0f, eSoundEntryType_WorldAll);
Sound_FadeGlobalVolume(1.0f, 5.0f, eSoundEntryType_WorldAll);
/////Starting Sequence End//
}
//-------------------------------------------------------
void stunrod_1_OnPlayerInteract(const tString &in asEntity)
{
Sound_CreateAtEntity("", "03_02_omicron_inside/gameplay/battery/battery_pickup", "player", 0.0f, false, 1.0f);
}
bool OmniTool_OnUse(const tString &in asTool, const tString &in asEntity)
{
if (asEntity == "FirstSeal")
{
CathTool_UseOnPanel("Omnitool","FirstSeal");
return true;
}
return false;
}
void FirstSeal_OnConnectionStateChange(const tString &in asEntity, int alState)
{
Map_AddTimer("DockDoorButton_Interact", 2.0f, "DockDoorButton_Interact");
}
void DockDoorButton_Interact(const tString &in asTimer)
{
SlideDoor_SetClosed("FirstSealedDoor",false);
Entity_SetActive("ToolArea_1",false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
ImGui_PreloadImage("inv_omnitool.tga");
ImGui_PreloadImage("graphics/imgui/station/filetreeicons/file_icon.tga");
ImGui_PreloadImage("graphics/imgui/station/thirdparty/pda/pda_background.tga");
}
//-------------------------------------------------------
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
//-------------------------------------------------------
////////////////////////////
// The player has died.
void OnPlayerKilled(int alRecentDeaths, const tString&in asSource)
{
}
//-------------------------------------------------------
////////////////////////////
// To get when player makes input (mostly used for debug)
void OnAction(int alAction, bool abPressed)
{
if(abPressed==false) return;
if(alAction == eAction_Test1)
{
}
}
//-------------------------------------------------------
////////////////////////////
// This only used for pure debug purposes when info needs to printed.
float DrawDebugOutput(cGuiSet @apSet,iFontData @apFont,float afY)
{
//afY = cLux_DrawDebugText("My Debug value:"+..., afY);
return afY;
}
//-------------------------------------------------------
void OnGui(float afTimeStep)
{
}
//-------------------------------------------------------
//} END MAIN CALLBACKS
//////////////////////////////////////////////////////////////////////////////////////////
// ==============
// MAIN FUNCTIONS
// ==============
//{///////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------
/*Put any variables that are used in more than one scene here.*/
//-------------------------------------------------------
/*Put any functions that are used in more than one scene here.*/
bool CollideAutoDoorOpen(const tString &in asParent, const tString &in asChild, int alState)
{
if (alState == 1){
SlideDoor_SetClosed("slidedoor_lab_glass_right_2", false, false);
SlideDoor_SetClosed("slidedoor_lab_glass_left_2", false, false);
}
if (alState == -1){
SlideDoor_SetClosed("slidedoor_lab_glass_right_2", true, false);
SlideDoor_SetClosed("slidedoor_lab_glass_left_2", true, false);
}
return true;
}
bool TriggerScreamFlicker(const tString &in asParent, const tString &in asChild, int alState)
{
Entity_SetActive("AreaTriggerScreamFlicker", false);
Entity_SetActive("DistortionArea_6", true);
Map_AddTimer("Timer_Start", 0.5f, "TimerFlickerStart");
Map_AddTimer("Timer_Break", 2.75f, "TimerFlickerStart");
Map_AddTimer("Timer_Stop", 3.5f, "TimerFlickerStart");
Sound_CreateAtEntity("", "NPC_Creatures/Vocalisations/InWorld/Flesher/ladder_scream", "slidedoor_theta_small_12", 0.0f, false, 2.0f);
return true;
}
void TimerFlickerStart(const tString &in asTimer)
{
if(asTimer == "Timer_Start"){
Lamp_SetFlickerActive("living_quarters_fluo_*",true);
}
if(asTimer == "Timer_Break"){
Lamp_SetFlickerActive("living_quarters_fluo_1",false);
Lamp_SetLit("living_quarters_fluo_1", false, false);
Lamp_SetFlickerActive("living_quarters_fluo_3",false);
Lamp_SetLit("living_quarters_fluo_3", false, false);
ParticleSystem_CreateAtEntity("","elec_spark_physics_few_oneshot.ps","Elec_Area_1",false);
ParticleSystem_CreateAtEntity("","elec_spark_physics_few_oneshot.ps","Elec_Area_2",false);
}
if(asTimer == "Timer_Stop"){
Lamp_SetFlickerActive("living_quarters_fluo_*",false);
Entity_SetActive("DistortionArea_6", false);
}
}
void SwitchedOnLights(const tString &in asEntity, int alState)
{
if (alState == 1){
Sound_Play("SoundScream", 0.1);
Sound_CreateAtEntity("Startup", "01_02_upsilon_inside_02/sfx/carl_torture_event/electricity_start", "ElecSoundArea", 0.0f, false, 1.0f);
Sound_CreateAtEntity("Loop", "01_02_upsilon_inside_02/sfx/carl_torture_event/electricity_loop", "ElecSoundArea", 2.0f, false, 1.0f);
Sound_CreateAtEntity("CooldownLoop", "01_02_upsilon_inside_02/sfx/carl_torture_event/cooldown_loop", "ElecSoundArea", 2.0f, false, 1.0f);
ParticleSystem_CreateAtEntity("OldSparky","elec_spark_large_continuous.ps","SamExecutionElec_*",false);
ParticleSystem_SetVisible("SamElecPS_*",true);
Entity_SetActive("DistortionArea_7", true);
Map_AddTimer("TimerScreamSam", .75f, "TimerSoundLoop");
Light_SetVisible("SamsElectrolyte",true);
}
if (alState == -1){
ParticleSystem_Destroy("OldSparky");
Map_RemoveTimer("TimerScreamSam");
Lamp_SetFlickerActive("living_quarters_fluo_*",false);
ParticleSystem_SetVisible("SamElecPS_*",false);
Entity_SetActive("DistortionArea_7", false);
Entity_SetActive("ark_crew_04_1", false);
Entity_SetActive("ark_crew_04_2", true);
Sound_Stop("Startup", 1.0f);
Sound_Stop("Loop", 1.0f);
Light_SetVisible("SamsElectrolyte",false);
Button_SetLocked("theta_panel_lightswitch_attachment_3", false,true);
Sound_CreateAtEntity("sparkssy", "level_amb_shared_interior/amb/spot/sparks/spark_train_crash", "theta_panel_lightswitch_attachment_3", 0.0f, false, 1.0f);
ParticleSystem_SetVisible("panelPS_*",true);
}
}
void TimerSoundLoop(const tString &in asTimer)
{
if(asTimer == "TimerScreamSam"){
Lamp_SetFlickerActive("living_quarters_fluo_*",true);
Sound_Play("SoundScream", 0.1);
Map_AddTimer("TimerScreamSam", .75f, "TimerSoundLoop");
}
}
void InteractPartialDoorButton(const tString &in asEntity)
{
Light_SetVisible("PointLight_156",true);
ParticleSystem_SetVisible("wau_panelPS_*",false);
Button_SetLocked("theta_panel_26",false,true);
Entity_SetInteractionDisabled("theta_panel_26",true);
Player_GiveDamage(0.1f, 0.1, eDamageType_Electricity, "");
}
//-------------------------------------------------------
//} END MAIN FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////
// ==============
// SCENE X *NAME OF SCENE*
// ==============
//{//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////
// General
//{//////////////////////////////////////
//-------------------------------------------------------
/*Put any variables that are used by many events in Scene X here.*/
//-------------------------------------------------------
/*Put any functions that are used in more than one event in Scene X here.*/
//-------------------------------------------------------
//} END General
/////////////////////////////////////////
// Event *Name Of Event*
//{//////////////////////////////////////
//-------------------------------------------------------
/*Put any variables that are only used in Scene X, Event X here.*/
//-------------------------------------------------------
/*Put any functionsthat are only used in Scene X, Event X here.*/
//-------------------------------------------------------
//} END Event *Name Of Event*
//} END SCENE X
/////////////////////////////////////////
// ==============
// TERMINALS
// ==============
//{//////////////////////////////////////
//-------------------------------------------------------
/////////////////////////////////////////
// Terminal *Name Of Terminal*
//{//////////////////////////////////////
//-------------------------------------------------------
/*Put any variables that are only used Terminal here.*/
bool mbButtonPressed;
//-------------------------------------------------------
/*Put any functions that are only used Terminal here.*/
void Timer_ComputerLoad(const tString &in asTimer)
{
////////////////////////
// This timer should repeat!
Map_AddTimer("ComputerLoadStop",cMath_RandRectf(3.0,6.0),"Timer_ComputerLoad");
Sound_CreateAtEntity("CLoad", "level_amb_shared_machines/tech/HDD/underload_loop", "ComputerEntrance", 0.5f, true, 0.8f);
if(asTimer == "ComputerLoadStop"){
Sound_Stop("CLoad", 0.2f);
Map_AddTimer("ComputerLoad",cMath_RandRectf(10.0,18.0),"Timer_ComputerLoad");
}
}
void TerminalEntrance_EnterGui(const tString&in asEntityName)
{
}
void TerminalEntrance_LeaveGui(const tString&in asEntityName)
{
}
void SetupLabCamera()
{
Gui_CreateCameraTexture("LabCamera", cVector2l(768, 613), 30, 90.0f, 0.1, 60);
Gui_AttachCameraTextureToEntity("LabCamera", "CameraLabArea");
}
/////////ResearchTerminals Begin\\\\\\\\\\\\
void ResearchTerminalOneOnGui(const tString&in asEntityName, float afTimeStep)
{
cImGuiGfx gfx("LabCamera", eImGuiGfx_Special);
ImGui_DrawGfx(gfx, cVector3f(0,0,5.0f), ImGui_GetSize(), cColor(1, 1));
}
void ResearchTerminalTwoOnGui(const tString&in asEntityName, float afTimeStep)
{
}
void ResearchTerminalThreeOnGui(const tString&in asEntityName, float afTimeStep)
{
}
void ResearchTerminalFourOnGui(const tString&in asEntityName, float afTimeStep)
{
}
//-------------------------------------------------------
//} END Terminal *Name Of Terminal*
//} END TERMINALS
}