Exemplo n.º 1
0
        public void ReadData()
        {
            var data = GetExtendedData();

            Data = PregnancyData.Load(data) ?? new PregnancyData();

            if (!CanGetDangerousDays())
            {
                // Force the girl to always be on the safe day, happens every day after day of conception
                var heroine = ChaControl.GetHeroine();
                if (heroine != null)
                {
                    HFlag.SetMenstruation(heroine, HFlag.MenstruationType.安全日);
                }
            }
        }
        public void ReadData()
        {
            var data = GetExtendedData();

            Data = PregnancyData.Load(data) ?? new PregnancyData();

            // PregnancyPlugin.Logger.LogDebug($"Preg - ReadData week {Data.Week} {ChaControl.name}");

#if KK
            if (!CanGetDangerousDays())
            {
                // Force the girl to always be on the safe day, happens every day after day of conception
                var heroine = ChaControl.GetHeroine();
                if (heroine != null)
                {
                    HFlag.SetMenstruation(heroine, HFlag.MenstruationType.安全日);
                }
            }
#endif
        }
Exemplo n.º 3
0
        public void ReadData()
        {
            var heroine = KoikatuAPI.GetCurrentGameMode() == GameMode.MainGame ? ChaControl.GetHeroine() : null;

            if (heroine?.charFile != null)
            {
                Data = heroine.charFile.GetPregnancyData() ?? new PregnancyData();
            }
            else
            {
                Data = PregnancyData.Load(GetExtendedData()) ?? new PregnancyData();
            }

            // PregnancyPlugin.Logger.LogDebug($"Preg - ReadData week {Data.Week} {ChaControl.name}");

            if (!CanGetDangerousDays())
            {
                // Force the girl to always be on the safe day, happens every day after day of conception
                if (heroine != null)
                {
                    HFlag.SetMenstruation(heroine, HFlag.MenstruationType.安全日);
                }
            }
        }
Exemplo n.º 4
0
        private static void DrawHeroineCheats(SaveData.Heroine currentAdvGirl, CheatToolsWindow cheatToolsWindow)
        {
            GUILayout.BeginVertical();
            {
                GUILayout.Label("Selected girl name: " + currentAdvGirl.Name);

                GUILayout.BeginVertical();
                {
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Favor: " + currentAdvGirl.favor, GUILayout.Width(60));
                        currentAdvGirl.favor = (int)GUILayout.HorizontalSlider(currentAdvGirl.favor, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Lewd: " + currentAdvGirl.lewdness, GUILayout.Width(60));
                        currentAdvGirl.lewdness = (int)GUILayout.HorizontalSlider(currentAdvGirl.lewdness, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Anger: " + currentAdvGirl.anger, GUILayout.Width(60));
                        currentAdvGirl.anger = (int)GUILayout.HorizontalSlider(currentAdvGirl.anger, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Intimacy: " + currentAdvGirl.intimacy, GUILayout.Width(60));
                        currentAdvGirl.intimacy = (int)GUILayout.HorizontalSlider(currentAdvGirl.intimacy, 0, 100);
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();

                GUILayout.Space(4);

                GUILayout.Label("Sex experience: " + GetHExpText(currentAdvGirl));
                GUILayout.Label("Set to: (changes multiple stats)");
                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("Virgin"))
                    {
                        MakeVirgin(currentAdvGirl);
                    }
                    if (GUILayout.Button("Inexp"))
                    {
                        MakeInexperienced(currentAdvGirl);
                    }
                    if (GUILayout.Button("Exp"))
                    {
                        MakeExperienced(currentAdvGirl);
                    }
                    if (GUILayout.Button("Horny"))
                    {
                        MakeHorny(currentAdvGirl);
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(4);

                GUILayout.Label("Set all touch experience");
                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("0%"))
                    {
                        SetGirlHExp(currentAdvGirl, 0f);
                    }
                    if (GUILayout.Button("50%"))
                    {
                        SetGirlHExp(currentAdvGirl, 50f);
                    }
                    if (GUILayout.Button("100%"))
                    {
                        SetGirlHExp(currentAdvGirl, 100f);
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(8);

                if (GUILayout.Button("Reset conversation time"))
                {
                    currentAdvGirl.talkTime = currentAdvGirl.talkTimeMax;
                }

                var actCtrl = _gameMgr?.actScene?.actCtrl;
                if (actCtrl != null)
                {
                    var sortedDesires = Enum.GetValues(typeof(DesireEng)).Cast <DesireEng>()
                                        .Select(i => new { id = i, value = actCtrl.GetDesire((int)i, currentAdvGirl) })
                                        .Where(x => x.value > 5)
                                        .OrderByDescending(x => x.value)
                                        .Take(8);

                    var any = false;
                    foreach (var desire in sortedDesires)
                    {
                        if (!any)
                        {
                            GUILayout.Label("Desires (and their strengths):\n");
                            any = true;
                        }
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label((int)desire.id + " " + desire.id);
                            GUILayout.FlexibleSpace();
                            GUILayout.Label(desire.value + "%");
                            if (GUILayout.Button("X", GUILayout.ExpandWidth(false)))
                            {
                                actCtrl.SetDesire((int)desire.id, currentAdvGirl, 0);
                            }
                        }
                        GUILayout.EndHorizontal();
                    }
                    if (!any)
                    {
                        GUILayout.Label("Has no desires");
                    }

                    if (GUILayout.Button("Clear all desires"))
                    {
                        for (int i = 0; i < 31; i++)
                        {
                            actCtrl.SetDesire(i, currentAdvGirl, 0);
                        }
                    }

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Set desire ", GUILayout.ExpandWidth(false));
                        _setdesireId = GUILayout.TextField(_setdesireId ?? "");
                        GUILayout.Label(" to value ", GUILayout.ExpandWidth(false));
                        _setdesireValue = GUILayout.TextField(_setdesireValue ?? "");
                        if (GUILayout.Button("OK", GUILayout.ExpandWidth(false)))
                        {
                            try
                            {
                                actCtrl.SetDesire((int)Enum.Parse(typeof(DesireEng), _setdesireId), currentAdvGirl, int.Parse(_setdesireValue));
                            }
                            catch (Exception e)
                            {
                                CheatToolsPlugin.Logger.LogMessage("Invalid desire ID (0-30) or value (0-100) - " + e.Message);
                            }
                        }
                    }
                    GUILayout.EndHorizontal();

                    var wantsMast = actCtrl.GetDesire(4, currentAdvGirl) > 80;
                    if (!wantsMast)
                    {
                        if (GUILayout.Button("Make desire to m********e"))
                        {
                            actCtrl.SetDesire(4, currentAdvGirl, 100);
                        }
                    }

                    var wantsLes = actCtrl.GetDesire(26, currentAdvGirl) > 80;
                    if (!wantsLes)
                    {
                        if (GUILayout.Button("Make desire to lesbian"))
                        {
                            actCtrl.SetDesire(26, currentAdvGirl, 100);
                            actCtrl.SetDesire(27, currentAdvGirl, 100);
                        }
                    }
                }

                GUILayout.Space(8);

                // 危険日 is risky, 安全日 is safe. Only change when user clicks to avoid messing with the value unnecessarily
                GUI.changed = false;
                var isDangerousDay = GUILayout.Toggle(HFlag.GetMenstruation(currentAdvGirl.MenstruationDay) == HFlag.MenstruationType.危険日, "Is on a risky day");
                if (GUI.changed)
                {
                    HFlag.SetMenstruation(currentAdvGirl, isDangerousDay ? HFlag.MenstruationType.危険日 : HFlag.MenstruationType.安全日);
                }

                currentAdvGirl.isVirgin     = GUILayout.Toggle(currentAdvGirl.isVirgin, "isVirgin");
                currentAdvGirl.isAnalVirgin = GUILayout.Toggle(currentAdvGirl.isAnalVirgin, "isAnalVirgin");

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("Sex count: ", GUILayout.ExpandWidth(false));
                    GUI.changed = false;
                    var newCount = GUILayout.TextField(currentAdvGirl.hCount.ToString(), GUILayout.ExpandWidth(true));
                    if (GUI.changed && int.TryParse(newCount, out var newCountInt))
                    {
                        currentAdvGirl.hCount = Mathf.Max(newCountInt, 0);
                    }
                }
                GUILayout.EndHorizontal();

                currentAdvGirl.isAnger = GUILayout.Toggle(currentAdvGirl.isAnger, "Is angry");
                currentAdvGirl.isDate  = GUILayout.Toggle(currentAdvGirl.isDate, "Date promised");
                //currentAdvGirl.isFirstGirlfriend = GUILayout.Toggle(currentAdvGirl.isFirstGirlfriend, "isFirstGirlfriend");

                GUI.changed = false;
                var newVal = GUILayout.Toggle(currentAdvGirl.talkEvent.Contains(0) || currentAdvGirl.talkEvent.Contains(1), "Had first meeting");
                if (GUI.changed)
                {
                    if (newVal)
                    {
                        currentAdvGirl.talkEvent.Add(0);
                        currentAdvGirl.talkEvent.Add(1);
                    }
                    else
                    {
                        currentAdvGirl.talkEvent.Remove(0);
                        currentAdvGirl.talkEvent.Remove(1);
                    }
                }

                GUI.changed = false;
                newVal      = GUILayout.Toggle(currentAdvGirl.talkEvent.Contains(2), "Is a friend");
                if (GUI.changed)
                {
                    if (newVal)
                    {
                        currentAdvGirl.talkEvent.Add(2);
                    }
                    else
                    {
                        currentAdvGirl.talkEvent.Remove(2);
                    }
                }

                currentAdvGirl.isGirlfriend = GUILayout.Toggle(currentAdvGirl.isGirlfriend, "Is a girlfriend");
                currentAdvGirl.isStaff      = GUILayout.Toggle(currentAdvGirl.isStaff, "Is a club member");

                currentAdvGirl.denial.kiss      = GUILayout.Toggle(currentAdvGirl.denial.kiss, "Won't refuse kiss");
                currentAdvGirl.denial.massage   = GUILayout.Toggle(currentAdvGirl.denial.massage, "Won't refuse strong massage");
                currentAdvGirl.denial.anal      = GUILayout.Toggle(currentAdvGirl.denial.anal, "Won't refuse anal");
                currentAdvGirl.denial.aibu      = GUILayout.Toggle(currentAdvGirl.denial.aibu, "Won't refuse vibrator");
                currentAdvGirl.denial.notCondom = GUILayout.Toggle(currentAdvGirl.denial.notCondom, "Insert w/o condom OK");

                if (_gameMgr?.actScene != null && currentAdvGirl.transform != null && GUILayout.Button("Follow me"))
                {
                    var npc = currentAdvGirl.transform.GetComponent <NPC>();
                    if (npc)
                    {
                        _gameMgr.actScene.Player.ChaserSet(npc);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Could not make heroine follow - NPC component not found");
                    }
                }

                if (GUILayout.Button("Navigate to heroine's GameObject"))
                {
                    if (currentAdvGirl.transform != null)
                    {
                        cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(currentAdvGirl.transform);
                    }
                    else
                    {
                        CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Heroine has no body assigned");
                    }
                }

                if (GUILayout.Button("Open Heroine in inspector"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(currentAdvGirl, "Heroine " + currentAdvGirl.Name), true);
                }

                if (GUILayout.Button("Inspect extended data"))
                {
                    cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(ExtensibleSaveFormat.ExtendedSave.GetAllExtendedData(currentAdvGirl.charFile), "ExtData for " + currentAdvGirl.Name), true);
                }
            }
            GUILayout.EndVertical();
        }