Beispiel #1
0
 private void Update()
 {
     if (this.PutOnDisguise)
     {
         bool flag = false;
         int  num  = 1;
         while ((this.Student.StudentManager.Students[num] != null && this.Student.StudentManager.Students[num].Male) || (num > 5 && num < 21) || num == 21 || num == 26 || num == 31 || num == 36 || num == 41 || num == 46 || num == 51 || num == 56 || num == 61 || num == 66 || num == 71 || num == this.MissionMode.TargetID || flag)
         {
             num = UnityEngine.Random.Range(2, 90);
             if (this.MissionMode.MultiMission)
             {
                 flag = false;
                 for (int i = 1; i < 11; i++)
                 {
                     if (num == PlayerPrefs.GetInt("MissionModeTarget" + i))
                     {
                         flag = true;
                     }
                 }
             }
         }
         this.Student.StudentManager.Students[num].gameObject.SetActive(false);
         this.Student.StudentManager.Students[num].Replaced = true;
         this.Cosmetic.StudentID = num;
         this.Cosmetic.Start();
         OutlineScript component = this.Cosmetic.FemaleHair[this.Cosmetic.Hairstyle].GetComponent <OutlineScript>();
         if (component != null)
         {
             component.enabled = false;
         }
         else
         {
             component = this.Cosmetic.FemaleHairRenderers[this.Cosmetic.Hairstyle].GetComponent <OutlineScript>();
             if (component != null)
             {
                 component.enabled = false;
             }
         }
         this.Student.FaceCollider.tag = "Disguise";
         Debug.Log("Nemesis has disguised herself as " + this.Student.StudentManager.Students[num].Name);
         this.PutOnDisguise = false;
     }
     if (!this.Dying)
     {
         if (!this.Attacking)
         {
             if (this.Yandere.Laughing && Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 10f)
             {
                 this.MissionMode.LastKnownPosition.position = this.Yandere.transform.position;
                 this.UpdateLKP();
             }
             if (!this.Yandere.CanMove && !this.Yandere.Laughing)
             {
                 if (this.Student.Pathfinding.canSearch)
                 {
                     this.Student.Character.GetComponent <Animation>().CrossFade("f02_idleShort_00");
                     this.Student.Pathfinding.canSearch = false;
                     this.Student.Pathfinding.canMove   = false;
                     this.Student.Pathfinding.speed     = 0f;
                 }
             }
             else
             {
                 if (this.Yandere.Stance.Current != StanceType.Crouching && this.Yandere.Stance.Current != StanceType.Crawling && Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 10f && this.Yandere.Running)
                 {
                     this.MissionMode.LastKnownPosition.position = this.Yandere.transform.position;
                     this.UpdateLKP();
                 }
                 if (!this.Student.Pathfinding.canSearch)
                 {
                     if (!this.Chasing)
                     {
                         this.Student.Character.GetComponent <Animation>().CrossFade(this.Student.WalkAnim);
                         this.Student.Pathfinding.speed = 1f;
                     }
                     else
                     {
                         this.Student.Character.GetComponent <Animation>().CrossFade("f02_sithRun_00");
                         this.Student.Pathfinding.speed = 5f;
                     }
                     this.Student.Pathfinding.canSearch = true;
                     this.Student.Pathfinding.canMove   = true;
                 }
                 this.InView = false;
                 this.LookForYandere();
                 if (!this.Chasing)
                 {
                     this.Student.Pathfinding.speed = Mathf.MoveTowards(this.Student.Pathfinding.speed, this.InView ? 2f : 1f, Time.deltaTime * 0.1f);
                     this.Student.Character.GetComponent <Animation>()[this.Student.WalkAnim].speed = this.Student.Pathfinding.speed;
                 }
                 else
                 {
                     this.Student.Pathfinding.speed = 5f;
                 }
                 if (Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 1f)
                 {
                     if (this.InView || this.Chasing)
                     {
                         this.Student.CharacterAnimation.CrossFade("f02_knifeLowSanityA_00");
                         this.Yandere.CharacterAnimation.CrossFade("f02_knifeLowSanityB_00");
                         AudioSource.PlayClipAtPoint(this.YandereDeath, base.transform.position);
                         this.Student.Pathfinding.canSearch = false;
                         this.Student.Pathfinding.canMove   = false;
                         this.Knife.SetActive(true);
                         this.Attacking         = true;
                         this.OriginalYPosition = this.Yandere.transform.position.y;
                         this.Yandere.StudentManager.YandereDying = true;
                         this.Yandere.StudentManager.StopMoving();
                         base.GetComponent <AudioSource>().Play();
                         this.Yandere.YandereVision = false;
                         this.Yandere.FollowHips    = true;
                         this.Yandere.Laughing      = false;
                         this.Yandere.CanMove       = false;
                         this.Yandere.EyeShrink     = 0.5f;
                         this.Yandere.StopAiming();
                         this.Yandere.EmptyHands();
                     }
                 }
                 else if (Vector3.Distance(base.transform.position, this.MissionMode.LastKnownPosition.position) < 1f)
                 {
                     this.Student.Character.GetComponent <Animation>().CrossFade("f02_nemesisScan_00");
                     this.Student.Pathfinding.speed = 0f;
                     this.ScanTimer += Time.deltaTime;
                     if (this.ScanTimer > 6f)
                     {
                         Vector3 vector = new Vector3(0f, 0f, -2.5f);
                         this.MissionMode.LastKnownPosition.position = ((this.MissionMode.LastKnownPosition.position == vector) ? this.Yandere.transform.position : vector);
                         this.Chasing = false;
                         this.UpdateLKP();
                     }
                 }
             }
             if (this.Difficulty == 1 || this.Difficulty == 3)
             {
                 if (Vector3.Distance(base.transform.position, this.Yandere.transform.position) >= 1f)
                 {
                     this.Student.Prompt.HideButton[2] = true;
                     return;
                 }
                 if (Mathf.Abs(Vector3.Angle(-base.transform.forward, this.Yandere.transform.position - base.transform.position)) > 45f)
                 {
                     this.Student.Prompt.HideButton[2] = true;
                 }
                 else if (this.Yandere.Armed)
                 {
                     this.Student.Prompt.HideButton[2] = false;
                 }
                 if (!this.Yandere.Armed)
                 {
                     this.Student.Prompt.HideButton[2] = true;
                 }
                 if (this.Student.Prompt.Circle[2].fillAmount < 1f)
                 {
                     this.Yandere.TargetStudent         = this.Student;
                     this.Yandere.AttackManager.Stealth = true;
                     this.Student.AttackReaction();
                     this.Student.Pathfinding.canSearch = false;
                     this.Student.Pathfinding.canMove   = false;
                     this.Student.Prompt.HideButton[2]  = true;
                     this.Dying = true;
                     return;
                 }
             }
         }
         else
         {
             this.SpecialEffect();
             this.Yandere.targetRotation     = Quaternion.LookRotation(base.transform.position - this.Yandere.transform.position);
             this.Yandere.transform.rotation = Quaternion.Slerp(this.Yandere.transform.rotation, this.Yandere.targetRotation, Time.deltaTime * 10f);
             this.Yandere.MoveTowardsTarget(base.transform.position + base.transform.forward * 0.5f);
             this.Yandere.EyeShrink          = 0.5f;
             this.Yandere.transform.position = new Vector3(this.Yandere.transform.position.x, this.OriginalYPosition, this.Yandere.transform.position.z);
             Quaternion b = Quaternion.LookRotation(this.Yandere.transform.position - base.transform.position);
             base.transform.rotation = Quaternion.Slerp(base.transform.rotation, b, Time.deltaTime * 10f);
             Animation component2 = this.Student.Character.GetComponent <Animation>();
             if (component2["f02_knifeLowSanityA_00"].time >= component2["f02_knifeLowSanityA_00"].length)
             {
                 if (this.MissionMode.enabled)
                 {
                     this.MissionMode.GameOverID = 13;
                     this.MissionMode.GameOver();
                     this.MissionMode.Phase = 4;
                     base.enabled           = false;
                     return;
                 }
                 SceneManager.LoadScene("LoadingScene");
                 return;
             }
         }
     }
     else
     {
         if (this.Student.Alive)
         {
             this.Student.MoveTowardsTarget(this.Yandere.transform.position + this.Yandere.transform.forward * this.Yandere.AttackManager.Distance);
             Quaternion b2 = Quaternion.LookRotation(base.transform.position - new Vector3(this.Yandere.transform.position.x, base.transform.position.y, this.Yandere.transform.position.z));
             base.transform.rotation = Quaternion.Slerp(base.transform.rotation, b2, Time.deltaTime * 10f);
             return;
         }
         base.enabled = false;
     }
 }
 // Token: 0x060005E9 RID: 1513 RVA: 0x000526C8 File Offset: 0x00050AC8
 private void Update()
 {
     if (this.PutOnDisguise)
     {
         int num = 1;
         while (this.Student.StudentManager.Students[num].Male || num == this.MissionMode.TargetID)
         {
             num = UnityEngine.Random.Range(2, 33);
         }
         this.Student.StudentManager.Students[num].gameObject.SetActive(false);
         this.Cosmetic.StudentID = num;
         this.Cosmetic.Start();
         OutlineScript component = this.Cosmetic.FemaleHair[this.Cosmetic.Hairstyle].GetComponent <OutlineScript>();
         if (component != null)
         {
             component.enabled = false;
         }
         this.Student.FaceCollider.tag = "Disguise";
         this.PutOnDisguise            = false;
     }
     if (!this.Dying)
     {
         if (!this.Attacking)
         {
             if (this.Yandere.Laughing && Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 10f)
             {
                 this.MissionMode.LastKnownPosition.position = this.Yandere.transform.position;
                 this.UpdateLKP();
             }
             if (!this.Yandere.CanMove && !this.Yandere.Laughing)
             {
                 if (this.Student.Pathfinding.canSearch)
                 {
                     this.Student.Character.GetComponent <Animation>().CrossFade(this.Student.IdleAnim);
                     this.Student.Pathfinding.canSearch = false;
                     this.Student.Pathfinding.canMove   = false;
                     this.Student.Pathfinding.speed     = 0f;
                 }
             }
             else
             {
                 if (this.Yandere.Stance.Current != StanceType.Crouching && this.Yandere.Stance.Current != StanceType.Crawling && Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 10f && Input.GetButton("LB"))
                 {
                     this.MissionMode.LastKnownPosition.position = this.Yandere.transform.position;
                     this.UpdateLKP();
                 }
                 if (!this.Student.Pathfinding.canSearch)
                 {
                     this.Student.Character.GetComponent <Animation>().CrossFade(this.Student.WalkAnim);
                     this.Student.Pathfinding.canSearch = true;
                     this.Student.Pathfinding.canMove   = true;
                     this.Student.Pathfinding.speed     = 1f;
                 }
                 this.InView = false;
                 this.LookForYandere();
                 this.Student.Pathfinding.speed = Mathf.MoveTowards(this.Student.Pathfinding.speed, (!this.InView) ? 1f : 2f, Time.deltaTime * 0.1f);
                 this.Student.Character.GetComponent <Animation>()[this.Student.WalkAnim].speed = this.Student.Pathfinding.speed;
                 if (Vector3.Distance(base.transform.position, this.Yandere.transform.position) < 1f)
                 {
                     if (this.InView)
                     {
                         this.Student.Character.GetComponent <Animation>().CrossFade("f02_knifeLowSanityA_00");
                         this.Yandere.CharacterAnimation.CrossFade("f02_knifeLowSanityB_00");
                         AudioSource.PlayClipAtPoint(this.YandereDeath, base.transform.position);
                         this.Student.Pathfinding.canSearch = false;
                         this.Student.Pathfinding.canMove   = false;
                         this.Knife.SetActive(true);
                         this.Attacking         = true;
                         this.OriginalYPosition = this.Yandere.transform.position.y;
                         this.Yandere.StudentManager.YandereDying = true;
                         this.Yandere.StudentManager.StopMoving();
                         AudioSource component2 = base.GetComponent <AudioSource>();
                         component2.Play();
                         this.Yandere.YandereVision = false;
                         this.Yandere.FollowHips    = true;
                         this.Yandere.Laughing      = false;
                         this.Yandere.CanMove       = false;
                         this.Yandere.EyeShrink     = 1f;
                         this.Yandere.StopAiming();
                         this.Yandere.EmptyHands();
                     }
                 }
                 else if (Vector3.Distance(base.transform.position, this.MissionMode.LastKnownPosition.position) < 1f)
                 {
                     this.Student.Character.GetComponent <Animation>().CrossFade("f02_nemesisScan_00");
                     this.Student.Pathfinding.speed = 0f;
                     this.ScanTimer += Time.deltaTime;
                     if (this.ScanTimer > 6f)
                     {
                         Vector3 vector = new Vector3(0f, 0f, -2.5f);
                         this.MissionMode.LastKnownPosition.position = ((!(this.MissionMode.LastKnownPosition.position == vector)) ? vector : this.Yandere.transform.position);
                         this.UpdateLKP();
                     }
                 }
             }
             if (this.Difficulty == 1 || this.Difficulty == 3)
             {
                 float f = Vector3.Angle(-base.transform.forward, this.Yandere.transform.position - base.transform.position);
                 if (Mathf.Abs(f) > 45f)
                 {
                     this.Student.Prompt.HideButton[2] = true;
                 }
                 else if (this.Yandere.Armed)
                 {
                     this.Student.Prompt.HideButton[2] = false;
                 }
                 if (!this.Yandere.Armed)
                 {
                     this.Student.Prompt.HideButton[2] = true;
                 }
                 if (this.Student.Prompt.Circle[2].fillAmount < 1f)
                 {
                     this.Yandere.TargetStudent         = this.Student;
                     this.Yandere.AttackManager.Stealth = true;
                     this.Student.AttackReaction();
                     this.Student.Pathfinding.canSearch = false;
                     this.Student.Pathfinding.canMove   = false;
                     this.Student.Prompt.HideButton[2]  = true;
                     this.Dying = true;
                 }
             }
         }
         else
         {
             this.SpecialEffect();
             this.Yandere.targetRotation     = Quaternion.LookRotation(base.transform.position - this.Yandere.transform.position);
             this.Yandere.transform.rotation = Quaternion.Slerp(this.Yandere.transform.rotation, this.Yandere.targetRotation, Time.deltaTime * 10f);
             this.Yandere.MoveTowardsTarget(base.transform.position + base.transform.forward * 0.5f);
             this.Yandere.EyeShrink          = 1f;
             this.Yandere.transform.position = new Vector3(this.Yandere.transform.position.x, this.OriginalYPosition, this.Yandere.transform.position.z);
             Quaternion b = Quaternion.LookRotation(this.Yandere.transform.position - base.transform.position);
             base.transform.rotation = Quaternion.Slerp(base.transform.rotation, b, Time.deltaTime * 10f);
             Animation component3 = this.Student.Character.GetComponent <Animation>();
             if (component3["f02_knifeLowSanityA_00"].time >= component3["f02_knifeLowSanityA_00"].length)
             {
                 this.MissionMode.GameOverID = 13;
                 this.MissionMode.GameOver();
                 this.MissionMode.Phase = 4;
                 base.enabled           = false;
             }
         }
     }
     else if (this.Student.Alive)
     {
         this.Student.MoveTowardsTarget(this.Yandere.transform.position + this.Yandere.transform.forward * this.Yandere.AttackManager.Distance);
         Quaternion b2 = Quaternion.LookRotation(base.transform.position - new Vector3(this.Yandere.transform.position.x, base.transform.position.y, this.Yandere.transform.position.z));
         base.transform.rotation = Quaternion.Slerp(base.transform.rotation, b2, Time.deltaTime * 10f);
     }
     else
     {
         base.enabled = false;
     }
 }