Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnStart()
- {
- AddEntityCollideCallback("Player", "AreaBangDoor", "CollideBangDoor", true, 1); //Begin the door bang and pain event
- AddEntityCollideCallback("Player", "ScriptArea_2", "func_sound", true, 1);
- AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
- AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
- SetEntityPlayerInteractCallback("phonograph_1", "func1", true);
- }
- void CollideBangDoor(string &in asParent, string &in asChild, int alState) //Player collides with area, the door bangs. Add a timer for a scare later.
- {
- PlaySoundAtEntity("bangs", "05_event_door_bang", "mansion_a", 1, false);
- PlaySoundAtEntity("whineaa", "scare_whine_loop", "Player", 0.5f, false);
- FadeSepiaColorTo(0.75f, 0.3f);
- FadeImageTrailTo(1.5, 0.5);
- AddTimer("bang1", 0.6f, "TimerBangDoor");
- AddTimer("bang2", 1.6f, "TimerBangDoor");
- AddTimer("bang3", 2.5f, "TimerBangDoor");
- AddTimer("bang4", 3.0f, "TimerBangDoor");
- }
- void TimerBangDoor(string &in asTimer)
- {
- if(asTimer == "bang1"){
- AddPropImpulse("mansion_a", 0, 0, 5, "World");
- PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);
- CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
- StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
- GiveSanityDamage(10, true);
- }
- else if(asTimer == "bang2") {
- AddPropImpulse("mansion_a", 0, 0, 5, "World");
- CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
- StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
- }
- else if(asTimer == "bang3") {
- AddPropImpulse("mansion_a", 0, 0, 5, "World");
- PlaySoundAtEntity("scare", "react_breath", "Player", 0.5f, false);
- CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
- StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
- }
- else {
- SetSwingDoorLocked("mansion_a", false, false);
- FadeSepiaColorTo(0, 0.3f);
- FadeImageTrailTo(0, 0.1);
- StopSound("whineaa", 4);
- }
- }
- void KeyOnDoor(string &in asItem, string &in asEntity)
- {
- SetSwingDoorLocked("mansion_1", false, true);
- PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
- RemoveItem("key_1");
- }
- void func_slam(string &in asParent, string &in asChild, int alState)
- {
- SetSwingDoorClosed("mansion_1", true, true);
- StartPlayerLookAt("mansion_1", 10.0f, 10.0f, "");
- AddTimer("", 1.0f, "stoplook");
- PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
- PlaySoundAtEntity("", "react_scare", "Player", 0, false);
- PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
- GiveSanityDamage(5.0f, true);
- SetSwingDoorLocked("mansion_1", true, true);
- }
- void stoplook(string &in asTimer)
- {
- StopPlayerLookAt();
- }
- void OnEnter()
- {
- AddEntityCollideCallback("Player", "corpse_fallout", "corpse1", true, 1); //Corpse falls out of cabinet
- }
- void corpse1(string &in asParent, string &in asChild, int alState)
- {
- SetEntityActive("corpse_male_1", true); //Corpse falls out of the closet
- }
Add Comment
Please, Sign In to add comment