private static void ApplyBreathingTweaks(ChaControl _female) { if (_hFlag == null) { _hFlag = FindObjectOfType <HFlag>(); } var startValue = 30; var attribute = _female.chaFile.parameter.attribute; if (attribute.bitch || attribute.choroi) { startValue += 20; } if (attribute.hitori || attribute.kireizuki || attribute.dokusyo) { startValue -= 20; } if (attribute.majime) { startValue -= 20; } var heroine = _female.GetHeroine() ?? _hFlag.GetLeadingHeroine(); if (heroine != null) { startValue += ((int)heroine.HExperience - 2) * 10; if (!heroine.isGirlfriend) { startValue -= 10; } } startValue = Mathf.Clamp(startValue, 20, 100); var calculatedVolume = startValue + _hFlag.GetOrgCount() * 20 + _hFlag.gaugeFemale / 2; _female.asVoice.minDistance = Mathf.Clamp(calculatedVolume / 100, 0.17f, 1f); }
public static void OnOrg(HFlag __instance) { try { var h = __instance.GetLeadingHeroine(); var crestType = h.GetCurrentCrest(); switch (crestType) { case CrestType.mindmelt: // This effect makes character slowly forget things on every org h.favor = Mathf.Clamp(h.favor - 10, 0, 100); #if KK h.intimacy = Mathf.Clamp(h.intimacy - 8, 0, 100); h.anger = Mathf.Clamp(h.anger - 10, 0, 100); if (h.anger == 0) { h.isAnger = false; } if (Random.value < 0.15f) { h.isDate = false; } #else if (Random.value < 0.15f) { h.isDayH = false; } if (Random.value < 0.15f) { h.isDresses = false; } #endif if (Random.value < 0.15f) { h.isLunch = false; } // In exchange they get lewder h.lewdness = Mathf.Clamp(h.lewdness + 30, 0, 100); var orgCount = __instance.GetOrgCount(); if (orgCount >= 2) { #if KK if (h.favor == 0 && h.intimacy == 0) #else if (h.favor == 0) #endif { h.isGirlfriend = false; if (Random.value < 0.2f) { h.confessed = false; } } if (h.isKiss && Random.value < 0.1f) { h.isKiss = false; } else if (!h.isAnalVirgin && Random.value < 0.1f) { h.isAnalVirgin = true; } else if (Random.value < 0.3f + orgCount / 10f) { // Remove a random seen event so she acts like it never happened var randomEvent = h.talkEvent.GetRandomElement(); var isMeetingEvent = randomEvent == 0 || randomEvent == 1; if (isMeetingEvent) { if (h.talkEvent.Count <= 2) { h.talkEvent.Clear(); } } else { h.talkEvent.Remove(randomEvent); } } } break; } } catch (Exception e) { UnityEngine.Debug.LogError(e); } }