private static float GetMilkAmount(PregnancyCharaController controller)
            {
                if (controller == null)
                {
                    return(0);
                }
                if (PregnancyPlugin.LactationForceMaxCapacity.Value)
                {
                    return(1);
                }
                var data = controller.Data;

                if (data.AlwaysLactates)
                {
                    return(1);
                }
                // Gradually increase
                if (data.IsPregnant)
                {
                    return(Mathf.Clamp01(data.Week / 40f));
                }
                // Gradually decrease after pregnancy finishes
                if (data.PregnancyCount > 0)
                {
                    return(1 - Mathf.Clamp01(data.WeeksSinceLastPregnancy / (40f / PregnancyPlugin.PregnancyProgressionSpeed.Value)));
                }
                return(0);
            }
            private static void GetMenstruationOverridePrefix()
            {
                if (_lastHeroine != null)
                {
                    // Get a schedule directly this way since the controller is not spawned in class roster
                    var schedule = _lastHeroine.GetRelatedChaFiles()
                                   .Select(c => PregnancyData.Load(ExtendedSave.GetExtendedDataById(c, GUID))?.MenstruationSchedule ?? MenstruationSchedule.Default)
                                   .FirstOrDefault(x => x != MenstruationSchedule.Default);

                    _menstruationsBackup = HFlag.menstruations;
                    HFlag.menstruations  = PregnancyCharaController.GetMenstruationsArr(schedule);
                }
            }
            private static void GetMenstruationOverridePrefix()
            {
                if (_lastHeroine != null)
                {
                    // Get a schedule directly this way since the controller is not spawned in class roster
                    var schedule = _lastHeroine.GetRelatedChaFiles().Select(control =>
                    {
                        var d = ExtendedSave.GetExtendedDataById(control, GUID);
                        if (d == null)
                        {
                            return(PregnancyDataUtils.MenstruationSchedule.Default);
                        }
                        PregnancyDataUtils.DeserializeData(d, out _, out _, out _, out var s);
                        return(s);
                    }).FirstOrDefault(x => x != PregnancyDataUtils.MenstruationSchedule.Default);

                    _menstruationsBackup = HFlag.menstruations;
                    HFlag.menstruations  = PregnancyCharaController.GetMenstruationsArr(schedule);
                }
            }
Beispiel #4
0
 public PregnancyBoneEffect(PregnancyCharaController controller)
 {
     _controller = controller;
 }