void InteractPrisonDoor(string &in asEntity)
{
SetMessage("Ch03Level25", "InteractLockedCellDoor", -1);
AddQuest("25LockedCellDoor", "25LockedCellDoor");
}
void UseKeyOnCellDoor(string &in asItem, string &in asEntity)
{
SetMessage("Ch03Level25", "UseKeyOnCellDoor", -1);
}
void CollideWriggleBarBreak(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("wriggle_bar_break", 1);
if(GetLocalVarInt("wriggle_bar_broken") == 1 ){
SetMessage("BasicPhrases", "UseItemOrCombineItem03", 0);
for(int i=1;i<=4;++i)
RemoveEntityCollideCallback("wriggle_prison_bar_1", "AreaWriggleBarBreak_" + i);
return;
}
if(GetLocalVarInt("wriggle_bar_break")==6)
{
AddLocalVarInt("wriggle_bar_broken", 1);
CreateParticleSystemAtEntity("sparks", "ps_hit_metal.ps", "wriggle_prison_bar_1", false);
PlaySoundAtEntity("breakb", "17_break_wheel.snt", asChild, 0.2f, false);
PlaySoundAtEntity("breakb2", "25_bar_drop.snt", asChild, 0.2f, false);
SetEntityActive("wriggle_prison_bar_1", false);
SetEntityActive("wriggle_prison_bar_item_1", true);
for(int i=1;i<=4;++i)
RemoveEntityCollideCallback("wriggle_prison_bar_1", "AreaWriggleBarBreak_" + i);
}
}
void CollideWriggleBarBreak2(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("wriggle_bar_break2", 1);
if(GetLocalVarInt("wriggle_bar_broken") == 1 ){
SetMessage("BasicPhrases", "UseItemOrCombineItem03", 0);
for(int i=5;i<=8;++i)
RemoveEntityCollideCallback("wriggle_prison_bar_2", "AreaWriggleBarBreak_" + i);
return;
}
if(GetLocalVarInt("wriggle_bar_break2")==6)
{
AddLocalVarInt("wriggle_bar_broken", 1);
CreateParticleSystemAtEntity("sparks", "ps_hit_metal.ps", "wriggle_prison_bar_2", false);
PlaySoundAtEntity("breakb", "17_break_wheel.snt", asChild, 0.2f, false);
PlaySoundAtEntity("breakb2", "25_bar_drop.snt", asChild, 0.2f, false);
SetEntityActive("wriggle_prison_bar_2", false);
SetEntityActive("wriggle_prison_bar_item_2", true);
for(int i=5;i<=8;++i)
RemoveEntityCollideCallback("wriggle_prison_bar_2", "AreaWriggleBarBreak_" + i);
}
}
void InteractLooseBricks(string &in asEntity)
{
SetMessage("Ch03Level25", "InteractLooseBricks", -1);
PlayGuiSound("18_touch_rock.snt", 0.8f);
AddTimer(asEntity, 1.0f, "TimerLooseBricks");
}
void TimerLooseBricks(string &in asTimer)
{
SetEntityPlayerInteractCallback(asTimer, "InteractLooseBricks", true);
}
void UseBarOnBricks(string &in asItem, string &in asEntity)
{
SetEntityActive("wriggle_prison_bar_bend_stone_1", true);
FadeLightTo("PointLight_21", 0.9, 0.8, 0.3, 0.8, -1, 1);
CreateParticleSystemAtEntity("dust", "ps_hit_rock.ps", "AreaLooseBricks", false);
SetLocalVarInt("BarInPlace", 1);
PlaySoundAtEntity("attachb", "25_attach_bar.snt", asEntity, 0.0f, false);
RemoveItem(asItem);
SetEntityActive(asEntity, false);
}
void UseHCOnBricks(string &in asItem, string &in asEntity)
{
SetEntityActive("stone_chipper_move_x_1",true);
SetEntityActive("stone_hammer_move_1",true);
PlaySoundAtEntity("cumble1", "15_rock_break", "AreaHammer", 0, false);
SetMoveObjectState("stone_hammer_move_1", 0.25f);
SetMoveObjectState("stone_chipper_move_x_1", 1.0f);
AddTimer("1", 0.2f, "TimerHammer");
AddTimer("2", 0.6f, "TimerHammer");
AddTimer("3", 0.8f, "TimerHammer");
AddTimer("4", 1.2f, "TimerHammer");
AddTimer("5", 1.4f, "TimerHammer");
SetEntityActive(asEntity, false);
if(HasItem("poison_gland")) RemoveItem(asItem);
}
void TimerHammer(string &in asTimer)
{
if(asTimer == "1"){
PlaySoundAtEntity("bang", "impact_rock_high", "Player", 0, false);
PlaySoundAtEntity("hammer", "15_hammer", "Player", 0, false);
SetMoveObjectState("stone_hammer_move_1", 0.0f);
SetMoveObjectState("stone_chipper_move_x_1", 0.0f);
}
if(asTimer == "2"){
SetMoveObjectState("stone_hammer_move_1", 0.25f);
SetMoveObjectState("stone_chipper_move_x_1", 1.0f);
}
if(asTimer == "3"){
SetMoveObjectState("stone_hammer_move_1", 0.0f);
SetMoveObjectState("stone_chipper_move_x_1", 0.0f);
PlaySoundAtEntity("bang", "impact_rock_high", "Player", 0, false);
PlaySoundAtEntity("hammer", "15_hammer", "Player", 0, false);
}
if(asTimer == "4"){
SetMoveObjectState("stone_hammer_move_1", 0.25f);
SetMoveObjectState("stone_chipper_move_x_1", 1.0f);
}
if(asTimer == "5"){
SetEntityActive("stone_chipper_move_x_1",false);
SetEntityActive("stone_hammer_move_1",false);
PlaySoundAtEntity("bang", "impact_rock_high", "Player", 0, false);
PlaySoundAtEntity("hammer", "15_hammer", "Player", 0, false);
FadeLightTo("PointLight_21", 0.9, 0.8, 0.3, 0.8, -1, 1);
CreateParticleSystemAtEntity("dust", "ps_hit_rock.ps", "AreaLooseBricks", false);
SetLocalVarInt("UsedHC", 1);
CollideBarBendDone("", "", 1);
}
}
void UseBarOnWall(string &in asItem, string &in asEntity)
{
SetMessage("Ch03Level25", "UseBarOnWall", -1);
}
void InteractBendBar(string &in asEntity)
{
PlaySoundAtEntity("rockbars", "15_rock_break", asEntity, 0.5f, false);
}
void CollideBarBendDone(string &in asParent, string &in asChild, int alState)
{
FadeLightTo("PointLight_21", 0,0,0,0, -1, 1);
SetEntityActive("wriggle_prison_bar_bend_stone_1", false);
if(GetLocalVarInt("BarInPlace") == 1)
SetEntityActive("wriggle_prison_bar_obj_dyn_1", true);
for(int i=1; i<=3; ++i)
{
SetPropStaticPhysics("cell_breakable_wall_rock"+i, false);
if(GetLocalVarInt("UsedHC") == 1)
AddPropImpulse("cell_breakable_wall_rock"+i, 0,0,-1.5f, "World");
else
AddPropImpulse("cell_breakable_wall_rock"+i, 0,0,1.5f, "World");
}
AddTimer("ExtraBrickPush", 0.4, "TimerExtraBrickPush");
CreateParticleSystemAtEntity("dust", "ps_break_pottery.ps", "AreaLooseBricks", false);
PlayGuiSound("25_break_rock.snt",1.0f);
SetPropStaticPhysics("cell_breakable_wall_support_1", false);
}
void TimerExtraBrickPush(string &in asTimer)
{
if(GetLocalVarInt("UsedHC") == 1)
for(int i=1; i<=3; ++i)
AddPropImpulse("cell_breakable_wall_rock"+i, 0,0,-2, "World");
else
for(int i=1; i<=3; ++i)
AddPropImpulse("cell_breakable_wall_rock"+i, 0,0,2, "World");
}
void InteractWoodPillar(string &in asEntity)
{
PlaySoundAtEntity("bendwood", "25_strain_wood", asEntity, 0.1f, false);
}
void CollideCollapseWall(string &in asParent, string &in asChild, int alState)
{
for(int i=1; i<=2; ++i)
SetEntityActive("AreaCollapseWall_"+i,false);
StopGuardianCountDown();
AddPlayerBodyForce(0,0,-5000, false);
FadeLightTo("PointLight_21", 0,0,0,0, -1, 1);
SetPropHealth("cell_breakable_wall_1", 0);
SetPropHealth("cell_breakable_wall_support_1", 0);
StartScreenShake(0.2, 0.3, 1, 1);
PlayMusic("25_puzzle_escape", false, 1.0f, 1.0f, 10, false);
CompleteQuest("25LockedCellDoor", "25LockedCellDoor");
SetEntityPlayerInteractCallback("prison_section_plain_1","", false);
AddTimer("DistantHowl", 8, "TimerDistantHowl");
SetEntityActive("AreaEscaped", false);
}
void TimerDistantHowl(string &in asTimer)
{
PlaySoundAtEntity("howl","25_guardian_distant1", "Player", 0, false);
AddTimer("StopRadialBlur", 4.5f, "TimerStopRadialBlur");
AddTimer("react_scare", 0.5f, "TimerScareReaction");
AddTimer("react_breath", 2.5f, "TimerScareReaction");
StartScreenShake(0.01f, 0.0f, 2.0f, 4.0f);
SetRadialBlurStartDist(0.2f);
FadeRadialBlurTo(0.09, 0.015f);
}
void TimerStopRadialBlur(string &in asTimer)
{
AddDebugMessage("Stopping howl blur.", false);
FadeRadialBlurTo(0, 0.02f);
}
void TimerScareReaction(string &in asTimer)
{
PlayGuiSound(asTimer, 0.7f);
if(asTimer == "react_scare")
GiveSanityDamage(15.0f, true);
}