void OnStart()
{
ConnectEntities("D", "lever_simple01", "castle_portcullis_1", true, -1, "PortOpen1");
ConnectEntities("E", "lever_simple02", "castle_portcullis_2", true, -1, "PortOpen2");
ConnectEntities("F", "lever_simple03", "castle_portcullis_3", true, -1, "PortOpen3");
AddEntityCollideCallback("Player", "GraveArea_1", "Grave1", true, 1);
AddEntityCollideCallback("Player", "GraveArea_2", "Grave2", true, 1);
AddEntityCollideCallback("Player", "GraveArea_3", "Grave3", true, 1);
AddEntityCollideCallback("Player", "GraveArea_4", "Grave4", true, 1);
for(int i=1;i<=3;i++)
AddEntityCollideCallback("Player", "WhisperArea_"+i, "WhisperTunnel", true, 1);
SetEntityPlayerLookAtCallback("GraceAreaCorpse_1", "CorpseDisappear1", true);
SetEntityPlayerLookAtCallback("GraceAreaCorpse_2", "CorpseDisappear2", true);
}
///////Insanity Event///////
///Ports///
void PortOpen1(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_1", 1);
SetMoveObjectState("castle_portcullis_2", 0);
SetMoveObjectState("castle_portcullis_3", 0);
SetLeverStuckState("lever_simple01", 0, true);
}
void PortOpen2(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_2", 1);
SetMoveObjectState("castle_portcullis_1", 0);
SetMoveObjectState("castle_portcullis_3", 0);
SetLeverStuckState("lever_simple02", 0, true);
}
void PortOpen3(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_3", 1);
SetMoveObjectState("castle_portcullis_2", 0);
SetMoveObjectState("castle_portcullis_1", 0);
SetLeverStuckState("lever_simple03", 0, true);
}
///Ports End///
///Graveyard///
void Grave1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_1", true);
AddLocalVarInt("Var1", 1);
func5();
}
void Grave2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_2", true);
AddLocalVarInt("Var1", 1);
func5();
}
void Grave3(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var1", 1);
func5();
}
void Grave4(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var1", 1);
func5();
}
void func5()
{
if(GetLocalVarInt("Var1") == 4)
{
SetEntityActive("coffin_dirty_3", true);
SetEntityActive("Flask_03", true);
}
}
void CorpseDisappear1(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse03_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}
void CorpseDisappear2(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse02_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}
///Graveyard End///
///Spike Tunnel///
void WhisperTunnel(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_whisper.snt", "Player", 1.0f, false);
}
///Spike Tunnel End///
void OnEnter()
{
}
void OnLeave()
{
}