// Update is called once per frame void LateUpdate() { if (eventstat == 0) { d2_.AnimTrigger(2, true); if (tri1.GetComponent <BoxTrigger>().GetState()) { eventstat = 1; Debug.Log("Door 2 switch"); door2.GetComponent <Object_Door>().DoorSwitch(); d1_.SetLookAt(Camera.main.transform); Timer = Timer1; ActiveTimer = true; } } if (check2 == true) { if (tri2.GetComponent <BoxTrigger>().GetState()) { Debug.Log("Closing door"); door1.GetComponent <Object_Door>().DoorSwitch(); sci_.PlaySound(Dialogs[1], true); sci_.AnimTrigger(-6); check2 = false; Timer = 4f; eventstat = 5; ActiveTimer = true; ActiveRefuse = false; StopTimer = false; guard_.StopRota(); d1_.StopLookAt(); d2_.StopLookAt(); } } if (check3 == true) { if (tri3.GetComponent <BoxTrigger>().GetState()) { guard_.SetLookAt(objPlayer.transform); guard_.PlaySound(guardExit[Random.Range(0, guardExit.Length)]); check3 = false; } } if (ActiveTimer) { Timer -= Time.deltaTime; } if (ActiveRefuse) { refuseTimer -= Time.deltaTime; if (refuseTimer <= 0) { switch (refusestat) { case 0: { sci_.PlaySound(Refuse[0], true); refusestat = 1; refuseTimer = refuseTimer2; guard_.SetRota(objPlayer.transform); d2_.SetLookAt(GameController.instance.playercache.DefHead); break; } case 1: { refusestat = 2; sci_.PlaySound(Refuse[1], true); refuseTimer = refuseTimer3; break; } case 2: { d1_.StopLookAt(); d2_.StopLookAt(); refusestat = 3; guard_.AnimTrigger(1, true); sci_.PlaySound(Refuse[2], true); Debug.Log("Another door opening, cause refuse"); door1.GetComponent <Object_Door>().DoorSwitch(); refuseTimer = refuseTimer4; break; } case 3: { guard_.PlaySFX(GeneralSFX[4]); GameController.instance.playercache.Death(0); ActiveRefuse = false; break; } } } } if (Timer <= 0.0f && StopTimer == false) { switch (eventstat) { case 1: { d1_.StopLookAt(); d2_.StopLookAt(); Debug.Log("Door should open"); door1.GetComponent <Object_Door>().DoorSwitch(); sci_.PlaySound(Dialogs[0], true); sci_.AnimTrigger(-6); Timer = Timer2; eventstat = 2; ActiveRefuse = true; refuseTimer = refuseTimer1; break; } case 2: { d1_.SetPath(path1); GameController.instance.PlayHorror(Horror[0], ata1, npc.none); eventstat = 3; Timer = 0.8f; break; } case 3: { d2_.SetPath(path2); eventstat = 4; Timer = Timer3; break; } case 4: { check2 = true; StopTimer = true; d1_.SetLookAt(GameController.instance.npcController.mainList[(int)npc.scp173].transform); d2_.SetLookAt(GameController.instance.npcController.mainList[(int)npc.scp173].transform); break; } case 5: { d1_.SetPath(path3); StartCoroutine(WaitForWalk()); eventstat = 6; Timer = 3f; break; } case 6: { Debug.Log("Door should open on chaos"); door1.GetComponent <Object_Door>().DoorSwitch(); check3 = true; sci_.PlaySound(Dialogs[2], true); sci_.AnimTrigger(-6); d2_.SetRota(door1.transform); d2_.StopLookAt(); StartCoroutine(SmallSequence()); eventstat = 7; Timer = Timer4; break; } case 7: { objPlayer.GetComponent <Player_Control>().FakeBlink(0.6f); lightmana.SetActive(false); d1_.PlaySound(classd2); eventstat = 8; Timer = 0.7f; d1_.AnimTrigger(-1, true); GameController.instance.npcController.mainList[(int)npc.scp173].transform.rotation = Quaternion.Euler(0, 90, 0); GameController.instance.npcController.mainList[(int)npc.scp173].Spawn(false, ata1.position); DecalSystem.instance.Decal(ata1.transform.position, new Vector3(90f, 0, 0), 2f, true, 0.4f, 1, 2); d1_.StopLookAt(); break; } case 8: { d2_.StopLookAt(); d2_.AnimTrigger(-5); d1_.PlaySFX(GeneralSFX[3]); lightmana.SetActive(true); sci2_.AnimTrigger(-4); sci_.PlaySFX(GeneralSFX[0]); eventstat = 9; Timer = 1f; GameController.instance.PlayHorror(Horror[1], null, npc.none); break; } case 9: { lightmana.SetActive(false); objPlayer.GetComponent <Player_Control>().FakeBlink(0.3f); eventstat = 10; Timer = 0.5f; GameController.instance.npcController.mainList[(int)npc.scp173].Spawn(false, ata2.position); DecalSystem.instance.Decal(ata2.transform.position, new Vector3(90f, 0, 0), 4f, true, 0.4f, 1, 0); d2_.AnimTrigger(-2, true); d2_.StopLookAt(); d2_.PlaySFX(GeneralSFX[3]); break; } case 10: { check3 = false; GameController.instance.npcController.mainList[(int)npc.scp173].Event_Spawn(true, ata2.transform.position); guard_.PlaySound(guardWhat[Random.Range(0, guardWhat.Length)]); sci_.PlaySFX(GeneralSFX[1]); lightmana.SetActive(true); sci2_.AnimTrigger(1, true); Timer = Timer5; eventstat = 11; break; } case 11: { lightmana.SetActive(false); objPlayer.GetComponent <Player_Control>().FakeBlink(0.4f); eventstat = 12; Timer = 0.7f; GameController.instance.npcController.mainList[(int)npc.scp173].transform.rotation = Quaternion.Euler(0, -90, 0); GameController.instance.npcController.mainList[(int)npc.scp173].Spawn(false, ata3.position); guard_.StopLookAt(); guard_.PlaySound(guardDies); guard_.SetRota(GameController.instance.npcController.mainList[(int)npc.scp173].transform); sci_.PlaySFX(GeneralSFX[5]); break; } case 12: { sci_.PlaySFX(GeneralSFX[2]); emelight.SetActive(true); guard_.AnimTrigger(1, true); Timer = 1.5f; eventstat = 13; ActiveTimer2 = true; if (GetComponent <ReflectionProbe>() != null) { RerenderProbe1.GetComponent <ReflectionProbe>().RenderProbe(); RerenderProbe2.GetComponent <ReflectionProbe>().RenderProbe(); } break; } case 13: { emelight.SetActive(false); objPlayer.GetComponent <Player_Control>().FakeBlink(0.4f); GameController.instance.npcController.mainList[(int)npc.scp173].Spawn(false, ataFinal.position); eventstat = 14; Timer = 0.7f; guard_.AnimTrigger(-2, true); guard_.PlaySFX(GeneralSFX[3]); sci_.PlaySFX(GeneralSFX[5]); sci_.PlaySFX(GeneralSFX[6]); StopTimer2 = true; flask.SetActive(false); break; } case 14: { objPlayer.GetComponent <Player_Control>().FakeBlink(0.6f); sci_.SetSeq(Alarm); guard_.StopRota(); objPlayer.GetComponent <Player_Control>().playerWarp((GameController.instance.WorldAnchor.transform.position + ((GameController.instance.WorldAnchor.transform.rotation * Quaternion.Inverse(TeleportAnchor.transform.rotation)) * (objPlayer.transform.position - TeleportAnchor.position))), GameController.instance.WorldAnchor.transform.eulerAngles.y - TeleportAnchor.transform.eulerAngles.y); d1_.puppetWarp(GameController.instance.WorldAnchor.transform.position + ((GameController.instance.WorldAnchor.transform.rotation * Quaternion.Inverse(TeleportAnchor.transform.rotation)) * (d1.transform.position - TeleportAnchor.position)), GameController.instance.WorldAnchor.transform.eulerAngles.y - TeleportAnchor.transform.eulerAngles.y); d2_.puppetWarp(GameController.instance.WorldAnchor.transform.position + ((GameController.instance.WorldAnchor.transform.rotation * Quaternion.Inverse(TeleportAnchor.transform.rotation)) * (d2.transform.position - TeleportAnchor.position)), GameController.instance.WorldAnchor.transform.eulerAngles.y - TeleportAnchor.transform.eulerAngles.y); guard_.puppetWarp(GameController.instance.WorldAnchor.transform.position + ((GameController.instance.WorldAnchor.transform.rotation * Quaternion.Inverse(TeleportAnchor.transform.rotation)) * (guard.transform.position - TeleportAnchor.position)), GameController.instance.WorldAnchor.transform.eulerAngles.y - TeleportAnchor.transform.eulerAngles.y); d1_.DeactivateCollision(); d2_.DeactivateCollision(); StopTimer = true; firstEvent.End(); if (GameController.instance.isAlive) { GameController.instance.DefaultAmbiance(); GameController.instance.DefMusic(); GameController.instance.doGameplay = true; GameController.instance.Action_QuickSave(); GameController.instance.SetMapPos(0, 10); GameController.instance.canSave = true; RenderSettings.fog = true; GameController.instance.CullerFlag = true; Destroy(introZone); } break; } } } if (ActiveTimer2) { TimerSecondary -= Time.deltaTime; } if (TimerSecondary <= 0.0f && StopTimer2 == false) { if (flask.activeSelf == true) { flask.SetActive(false); } else { flask.SetActive(true); } guard_.PlaySFX(GeneralSFX[4]); TimerSecondary = 0.1f; } }
void IntroUpdate() { if (ActiveTimer) { Timer -= Time.deltaTime; } if (runningAway) { RunawayTimer -= Time.deltaTime; } if (RunawayTimer <= 0.0f && runningAway == true) { if (EventState == -5) { Escape5(); } if (EventState == -4) { Escape4(); } if (EventState == -3) { Escape3(); } if (EventState == -2) { Escape2(); } if (EventState == -1) { Escape1(); } } if (Timer <= 0.0f && Start == false) { Timer = Timer1; Guard1_con.PlaySound(Dialogs[0], true); if (grabbed == false) { SCP_UI.instance.ShowTutorial("tutograb"); } Start = true; } if (grabbed == false && Item == null) { SCP_UI.instance.ShowTutorial("tutoinv1"); grabbed = true; } if (Timer <= 0.0f && StopTimer == false && Start == true) { if (EventState == -13) { EVRefuse3(); } if (EventState == -12) { EVRefuse2(); } if (EventState == -11) { EVRefuse1(); } if (EventState == 3) { Scene3(); StopTimer = true; } if (EventState == 2) { Scene2(); } if (EventState == 1) { Scene1_5(); } if (EventState == 0) { Scene1(); } } if (ActiveTimer2) { TimerSecondary -= Time.deltaTime; } if (TimerSecondary <= 0.0f && StopTimer2 == false) { if (EventState2 == 2) { AsyncScene_2(); } if (EventState2 == 1) { AsyncScene_1(); } } if (Check1 == true) { if (Trigger1.GetComponent <BoxTrigger>().GetState()) { Check1 = false; ActiveTimer = true; Scene1_6(); } } if (Check3 == true) { if (Trigger3.GetComponent <BoxTrigger>().GetState()) { if (!back1) { Guard1_con.PlaySound(Dialogs[5], true); back1 = true; } Guard1_con.ResumePath(); Guard1_con.StopRota(); Guard1_con.AnimTrigger(1, false); Guard1_con.StopLookAt(); Guard2_con.ResumePath(); LastState = EventState; Check3 = false; Check2 = true; ActiveTimer = true; runningAway = false; EventState = 3; } } if (Check2 == true) { if (!Trigger2.GetComponent <BoxTrigger>().GetState() && EventState != -1) { Guard1_con.StopSound(); Guard2_con.StopSound(); EventState = LastState; if (!back1) { RunawayTimer = 6; Guard1_con.PlaySound(Dialogs[2], true, true); } if (Conver != -1) { StopCoroutine(co); Conver = -1; } Guard1_con.SetLookAt(playerHead); ActiveTimer = false; ActiveTimer2 = false; runningAway = true; Guard1_con.SetRota(Player.transform); Guard2_con.SetLookAt(playerHead); Guard2_con.PausePath(); Guard1_con.PausePath(); Check2 = false; Check3 = true; } } if (Check4 == true) { if (Trigger4.GetComponent <BoxTrigger>().GetState()) { Guard1_con.StopPursuit(); Guard1_con.PlaySound(Gunshot); Player.GetComponent <Player_Control>().Death(0); GameController.instance.deathmsg = Localization.GetString("deathStrings", "death_intro"); Check4 = false; Check3 = false; Check2 = false; runningAway = false; Guard1_con.AnimTrigger(-1, true); } } }
public override void EventUpdate() { if (Time.frameCount % 15 == 0 && eventState != 20 && !outDoorsClosed && isOut.GetState()) { eventState = 1; Timer = 2; Object_Door door; outDoorsClosed = true; audSource.clip = scene1; SubtitleEngine.instance.playVoice(scene1.name, true); audSource.Play(); Interact = Physics.OverlapSphere(doorCloser1.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser2.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser3.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser4.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser5.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } } if (Time.frameCount % 15 == 0 && eventState == 14 && inDoorsClosed) { /*eventState = 1; * Timer = 2;*/ inDoorsClosed = false; Object_Door door; Interact = Physics.OverlapSphere(doorCloser4.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (!door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser5.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (!door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } } if (Time.frameCount % 15 == 0 && eventState == 14 && !inDoorsClosed && isIn.GetState()) { eventState = 15; inDoorsClosed = true; /* * Timer = 2;*/ Object_Door door; Interact = Physics.OverlapSphere(doorCloser4.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; } Interact = Physics.OverlapSphere(doorCloser5.position, 1f, doorLayer); if (Interact.Length > 0) { door = Interact[0].gameObject.GetComponent <Object_Door>(); door.isDisabled = false; if (door.GetState()) { door.DoorSwitch(); } door.isDisabled = true; audSource.PlayOneShot(blackOut); GameController.instance.canSave = true; GameController.instance.playercache.FakeBlink(0.25f); probe.RenderProbe(); EventFinished(); } } Timer -= Time.deltaTime; if (Timer < 0) { switch (eventState) { case 1: { Debug.Log("Step one"); guard.SetPath(new Transform[1] { step1 }, false); eventState = 2; Timer = 3.5f; break; } case 2: { guard.AnimTrigger(3, false); eventState = 3; Timer = 1.5f; break; } case 3: { Debug.Log("Step two"); guard.StopRota(); guard.SetPath(stepSeq, false); eventState = 4; Timer = 0.5f; break; } case 4: { scp.RotateTo(guard.transform.position); eventState = 5; Timer = 1.5f; break; } case 5: { guard.SetLookAt(scp.transform); scp.evChangeState(3); eventState = 6; Timer = 1.5f; break; } case 6: { guard.StopLookAt(); guard.SetRota(scp.transform); guard.AnimTrigger(1, true); eventState = 7; Timer = 3; break; } case 7: { guard.SetPath(new Transform[1] { step3 }, false); eventState = 8; Timer = 3; break; } case 8: { guard.SetPath(new Transform[1] { step4 }, false); eventState = 9; Timer = 3; break; } case 9: { guard.SetPath(stepSeq2, false); eventState = 10; Timer = 1.5f; break; } case 10: { guard.StopRota(); guard.AnimTrigger(-3); scp.evWalkTo(stepSeq2[1].position); eventState = 11; Timer = 0.75f; audSource.Stop(); audSource.clip = scene2; audSource.Play(); break; } case 11: { DecalSystem.instance.Decal(decal1.transform.position, decal1.transform.rotation.eulerAngles, 2, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal1.transform.position, decal1.transform.rotation.eulerAngles - new Vector3(0, 180, 0), 2, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal2.transform.position, decal2.transform.rotation.eulerAngles, 2, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal2.transform.position, decal2.transform.rotation.eulerAngles - new Vector3(0, 180, 0), 3, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal3.transform.position, decal3.transform.rotation.eulerAngles, 2, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal3.transform.position, decal3.transform.rotation.eulerAngles - new Vector3(0, 180, 0), 3, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal4.transform.position, decal4.transform.rotation.eulerAngles, 2, false, 0.2f, 1, 2); DecalSystem.instance.Decal(decal4.transform.position, decal4.transform.rotation.eulerAngles - new Vector3(0, 180, 0), 2, false, 0.2f, 1, 2); eventState = 12; Timer = 0.25f; break; } case 12: { eventState = 13; //scp.evChangeState(0); Timer = 10f; Destroy(guard.gameObject); break; } case 13: { eventState = 14; scp.StopEvent(); Debug.Log("096 Stopped"); break; } } } }