Beispiel #1
0
    // Token: 0x06000655 RID: 1621 RVA: 0x0005AF9C File Offset: 0x0005939C
    public IEnumerator GetPhotos()
    {
        Debug.Log("We were told to get photos.");
        if (!this.Corkboard)
        {
            for (int i = 1; i < 26; i++)
            {
                this.Hearts[i].gameObject.SetActive(false);
            }
        }
        for (int ID = 1; ID < 26; ID++)
        {
            if (PlayerGlobals.GetPhoto(ID))
            {
                Debug.Log("Photo " + ID + " is ''true''.");
                string path = string.Concat(new object[]
                {
                    "file:///",
                    Application.streamingAssetsPath,
                    "/Photographs/Photo_",
                    ID,
                    ".png"
                });
                Debug.Log("Attempting to get " + path);
                WWW www = new WWW(path);
                yield return(www);

                if (www.error == null)
                {
                    this.Photographs[ID].mainTexture = www.texture;
                    if (!this.Corkboard && PlayerGlobals.GetSenpaiPhoto(ID))
                    {
                        this.Hearts[ID].gameObject.SetActive(true);
                    }
                }
                else
                {
                    Debug.Log(string.Concat(new object[]
                    {
                        "Could not retrieve Photo ",
                        ID,
                        ". Maybe it was deleted from Streaming Assets? Setting Photo ",
                        ID,
                        " to ''false''."
                    }));
                    PlayerGlobals.SetPhoto(ID, false);
                }
            }
        }
        this.LoadingScreen.SetActive(false);
        if (!this.Corkboard)
        {
            this.PauseScreen.Sideways = true;
        }
        this.UpdateButtonPrompts();
        base.enabled = true;
        base.gameObject.SetActive(true);
        yield break;
    }
 // Token: 0x0600079E RID: 1950 RVA: 0x0007429C File Offset: 0x0007269C
 private void Update()
 {
     if (this.Snapping)
     {
         if (this.Close)
         {
             this.currentPercent += 40f * Time.unscaledDeltaTime;
             while (this.currentPercent >= 1f)
             {
                 this.Frame           = Mathf.Min(this.Frame + 1, 8);
                 this.currentPercent -= 1f;
             }
             this.Sprite.spriteName = "Shutter" + this.Frame.ToString();
             if (this.Frame == 8)
             {
                 this.StudentManager.GhostChan.gameObject.SetActive(true);
                 this.StudentManager.GhostChan.Look();
                 this.CheckPhoto();
                 this.SmartphoneCamera.targetTexture = null;
                 this.Yandere.PhonePromptBar.Show    = false;
                 this.NotificationManager.SetActive(false);
                 this.HeartbeatCamera.SetActive(false);
                 this.MainCamera.enabled = false;
                 this.PhotoIcons.SetActive(true);
                 this.SubPanel.SetActive(false);
                 this.Panel.SetActive(false);
                 this.Close = false;
                 this.PromptBar.ClearButtons();
                 this.PromptBar.Label[0].text = "Save";
                 this.PromptBar.Label[1].text = "Delete";
                 if (!this.Yandere.RivalPhone)
                 {
                     this.PromptBar.Label[2].text = "Send";
                 }
                 this.PromptBar.UpdateButtons();
                 this.PromptBar.Show = true;
                 Time.timeScale      = 0f;
             }
         }
         else
         {
             this.currentPercent += 40f * Time.unscaledDeltaTime;
             while (this.currentPercent >= 1f)
             {
                 this.Frame           = Mathf.Max(this.Frame - 1, 1);
                 this.currentPercent -= 1f;
             }
             this.Sprite.spriteName = "Shutter" + this.Frame.ToString();
             if (this.Frame == 1)
             {
                 this.Sprite.color = new Color(this.Sprite.color.r, this.Sprite.color.g, this.Sprite.color.b, 0f);
                 this.Snapping     = false;
             }
         }
     }
     else if (this.Yandere.Aiming)
     {
         this.TargetStudent = 0;
         this.Timer        += Time.deltaTime;
         if (this.Timer > 0.5f)
         {
             if (Physics.Raycast(this.SmartphoneCamera.transform.position, this.SmartphoneCamera.transform.TransformDirection(Vector3.forward), out this.hit, float.PositiveInfinity, this.OnlyPhotography))
             {
                 if (this.hit.collider.gameObject.name == "Face")
                 {
                     GameObject gameObject = this.hit.collider.gameObject.transform.root.gameObject;
                     this.FaceStudent = gameObject.GetComponent <StudentScript>();
                     if (this.FaceStudent != null)
                     {
                         this.TargetStudent = this.FaceStudent.StudentID;
                         if (this.TargetStudent > 1)
                         {
                             this.ReactionDistance = 1.66666f;
                         }
                         else
                         {
                             this.ReactionDistance = this.FaceStudent.VisionDistance;
                         }
                         if (!this.FaceStudent.Alarmed && !this.FaceStudent.Distracted && !this.FaceStudent.InEvent && !this.FaceStudent.Wet && this.FaceStudent.Schoolwear > 0 && !this.FaceStudent.Fleeing && !this.FaceStudent.Following && !this.FaceStudent.ShoeRemoval.enabled && !this.FaceStudent.HoldingHands && this.FaceStudent.Actions[this.FaceStudent.Phase] != StudentActionType.Mourn && !this.FaceStudent.Guarding && Vector3.Distance(this.Yandere.transform.position, gameObject.transform.position) < this.ReactionDistance && this.FaceStudent.CanSeeObject(this.Yandere.gameObject, this.Yandere.transform.position + Vector3.up))
                         {
                             if (this.MissionMode)
                             {
                                 this.PenaltyTimer += Time.deltaTime;
                                 if (this.PenaltyTimer > 1f)
                                 {
                                     this.FaceStudent.Reputation.PendingRep -= -10f;
                                     this.PenaltyTimer = 0f;
                                 }
                             }
                             if (!this.FaceStudent.CameraReacting)
                             {
                                 if (this.FaceStudent.enabled && !this.FaceStudent.Stop)
                                 {
                                     if (this.FaceStudent.PhotoPatience > 0f)
                                     {
                                         if (this.FaceStudent.StudentID > 1)
                                         {
                                             if (this.Yandere.Bloodiness > 0f || (double)this.Yandere.Sanity < 33.33333)
                                             {
                                                 this.FaceStudent.Alarm += 200f;
                                             }
                                             else
                                             {
                                                 this.FaceStudent.CameraReact();
                                             }
                                         }
                                         else
                                         {
                                             this.FaceStudent.Alarm         += Time.deltaTime * (100f / this.FaceStudent.DistanceToPlayer) * this.FaceStudent.Paranoia * this.FaceStudent.Perception * this.FaceStudent.DistanceToPlayer * 2f;
                                             this.FaceStudent.YandereVisible = true;
                                         }
                                     }
                                     else
                                     {
                                         this.Penalize();
                                     }
                                 }
                             }
                             else
                             {
                                 this.FaceStudent.PhotoPatience = Mathf.MoveTowards(this.FaceStudent.PhotoPatience, 0f, Time.deltaTime);
                                 if (this.FaceStudent.PhotoPatience > 0f)
                                 {
                                     this.FaceStudent.CameraPoseTimer = 1f;
                                 }
                             }
                         }
                     }
                 }
                 else if (this.hit.collider.gameObject.name == "Panties" || this.hit.collider.gameObject.name == "Skirt")
                 {
                     GameObject gameObject2 = this.hit.collider.gameObject.transform.root.gameObject;
                     if (Physics.Raycast(this.SmartphoneCamera.transform.position, this.SmartphoneCamera.transform.TransformDirection(Vector3.forward), out this.hit, float.PositiveInfinity, this.OnlyCharacters))
                     {
                         if (Vector3.Distance(this.Yandere.transform.position, gameObject2.transform.position) < 5f)
                         {
                             if (this.hit.collider.gameObject == gameObject2)
                             {
                                 if (!this.Yandere.Lewd)
                                 {
                                     this.Yandere.NotificationManager.DisplayNotification(NotificationType.Lewd);
                                 }
                                 this.Yandere.Lewd = true;
                             }
                             else
                             {
                                 this.Yandere.Lewd = false;
                             }
                         }
                         else
                         {
                             this.Yandere.Lewd = false;
                         }
                     }
                 }
                 else
                 {
                     this.Yandere.Lewd = false;
                 }
             }
             else
             {
                 this.Yandere.Lewd = false;
             }
         }
     }
     else
     {
         this.Timer = 0f;
     }
     if (this.TookPhoto)
     {
         this.ResumeGameplay();
     }
     if (!this.DisplayError)
     {
         if (this.PhotoIcons.activeInHierarchy && !this.Snapping && !this.TextMessages.gameObject.activeInHierarchy)
         {
             if (Input.GetButtonDown("A"))
             {
                 if (!this.Yandere.RivalPhone)
                 {
                     bool flag = !this.SenpaiX.activeInHierarchy;
                     this.PromptBar.transform.localPosition = new Vector3(this.PromptBar.transform.localPosition.x, -627f, this.PromptBar.transform.localPosition.z);
                     this.PromptBar.ClearButtons();
                     this.PromptBar.Show = false;
                     this.PhotoIcons.SetActive(false);
                     this.ID        = 0;
                     this.FreeSpace = false;
                     while (this.ID < 26)
                     {
                         this.ID++;
                         if (!PlayerGlobals.GetPhoto(this.ID))
                         {
                             this.FreeSpace = true;
                             this.Slot      = this.ID;
                             this.ID        = 26;
                         }
                     }
                     if (this.FreeSpace)
                     {
                         Application.CaptureScreenshot(Application.streamingAssetsPath + "/Photographs/Photo_" + this.Slot.ToString() + ".png");
                         this.TookPhoto = true;
                         Debug.Log("Setting Photo " + this.Slot + " to ''true''.");
                         PlayerGlobals.SetPhoto(this.Slot, true);
                         if (flag)
                         {
                             PlayerGlobals.SetSenpaiPhoto(this.Slot, true);
                         }
                         if (this.KittenShot)
                         {
                             TaskGlobals.SetKittenPhoto(this.Slot, true);
                             this.TaskManager.UpdateTaskStatus();
                         }
                     }
                     else
                     {
                         this.DisplayError = true;
                     }
                 }
                 else if (!this.PantiesX.activeInHierarchy)
                 {
                     this.StudentManager.CommunalLocker.RivalPhone.LewdPhotos = true;
                     SchemeGlobals.SetSchemeStage(4, 3);
                     this.Schemes.UpdateInstructions();
                     this.ResumeGameplay();
                 }
             }
             if (!this.Yandere.RivalPhone && Input.GetButtonDown("X"))
             {
                 this.Panel.SetActive(true);
                 this.MainMenu.SetActive(false);
                 this.PauseScreen.Show          = true;
                 this.PauseScreen.Panel.enabled = true;
                 this.PromptBar.ClearButtons();
                 this.PromptBar.Label[1].text = "Exit";
                 this.PromptBar.Label[3].text = "Interests";
                 this.PromptBar.UpdateButtons();
                 if (!this.InfoX.activeInHierarchy)
                 {
                     this.PauseScreen.Sideways = true;
                     StudentGlobals.SetStudentPhotographed(this.Student.StudentID, true);
                     this.ID = 0;
                     while (this.ID < this.Student.Outlines.Length)
                     {
                         this.Student.Outlines[this.ID].enabled = true;
                         this.ID++;
                     }
                     this.StudentInfo.UpdateInfo(this.Student.StudentID);
                     this.StudentInfo.gameObject.SetActive(true);
                 }
                 else if (!this.TextMessages.gameObject.activeInHierarchy)
                 {
                     this.PauseScreen.Sideways = false;
                     this.TextMessages.gameObject.SetActive(true);
                     this.SpawnMessage();
                 }
             }
             if (Input.GetButtonDown("B"))
             {
                 this.ResumeGameplay();
             }
         }
         else if (this.PhotoIcons.activeInHierarchy && Input.GetButtonDown("B"))
         {
             this.ResumeGameplay();
         }
     }
     else
     {
         float t = Time.unscaledDeltaTime * 10f;
         this.ErrorWindow.transform.localScale = Vector3.Lerp(this.ErrorWindow.transform.localScale, new Vector3(1f, 1f, 1f), t);
         if (Input.GetButtonDown("A"))
         {
             this.ResumeGameplay();
         }
     }
 }
    // Token: 0x06001A07 RID: 6663 RVA: 0x000FDC0C File Offset: 0x000FBE0C
    public static PlayerSaveData ReadFromGlobals()
    {
        PlayerSaveData playerSaveData = new PlayerSaveData();

        playerSaveData.alerts             = PlayerGlobals.Alerts;
        playerSaveData.enlightenment      = PlayerGlobals.Enlightenment;
        playerSaveData.enlightenmentBonus = PlayerGlobals.EnlightenmentBonus;
        playerSaveData.headset            = PlayerGlobals.Headset;
        playerSaveData.kills           = PlayerGlobals.Kills;
        playerSaveData.numbness        = PlayerGlobals.Numbness;
        playerSaveData.numbnessBonus   = PlayerGlobals.NumbnessBonus;
        playerSaveData.pantiesEquipped = PlayerGlobals.PantiesEquipped;
        playerSaveData.pantyShots      = PlayerGlobals.PantyShots;
        foreach (int num in PlayerGlobals.KeysOfPhoto())
        {
            if (PlayerGlobals.GetPhoto(num))
            {
                playerSaveData.photo.Add(num);
            }
        }
        foreach (int num2 in PlayerGlobals.KeysOfPhotoOnCorkboard())
        {
            if (PlayerGlobals.GetPhotoOnCorkboard(num2))
            {
                playerSaveData.photoOnCorkboard.Add(num2);
            }
        }
        foreach (int num3 in PlayerGlobals.KeysOfPhotoPosition())
        {
            playerSaveData.photoPosition.Add(num3, PlayerGlobals.GetPhotoPosition(num3));
        }
        foreach (int num4 in PlayerGlobals.KeysOfPhotoRotation())
        {
            playerSaveData.photoRotation.Add(num4, PlayerGlobals.GetPhotoRotation(num4));
        }
        playerSaveData.reputation     = PlayerGlobals.Reputation;
        playerSaveData.seduction      = PlayerGlobals.Seduction;
        playerSaveData.seductionBonus = PlayerGlobals.SeductionBonus;
        foreach (int num5 in PlayerGlobals.KeysOfSenpaiPhoto())
        {
            if (PlayerGlobals.GetSenpaiPhoto(num5))
            {
                playerSaveData.senpaiPhoto.Add(num5);
            }
        }
        playerSaveData.senpaiShots  = PlayerGlobals.SenpaiShots;
        playerSaveData.socialBonus  = PlayerGlobals.SocialBonus;
        playerSaveData.speedBonus   = PlayerGlobals.SpeedBonus;
        playerSaveData.stealthBonus = PlayerGlobals.StealthBonus;
        foreach (int num6 in PlayerGlobals.KeysOfStudentFriend())
        {
            if (PlayerGlobals.GetStudentFriend(num6))
            {
                playerSaveData.studentFriend.Add(num6);
            }
        }
        foreach (string text in PlayerGlobals.KeysOfStudentPantyShot())
        {
            if (PlayerGlobals.GetStudentPantyShot(text))
            {
                playerSaveData.studentPantyShot.Add(text);
            }
        }
        return(playerSaveData);
    }