public static void OnDrain(HFlag __instance) { var heroine = __instance.GetLeadingHeroine(); var controller = GetEffectController(heroine); controller.DrainInflation(Mathf.Max(3, Mathf.CeilToInt(InflationMaxCount.Value / 2.2f))); }
public static void OnInsideFinish(HFlag __instance) { try { if (__instance.player != null) { var heroine = __instance.GetLeadingHeroine(); var currentCrest = heroine.GetCurrentCrest(); if (currentCrest == CrestType.siphoning) { #if KK __instance.player.physical = Mathf.Min(100, __instance.player.physical + 15); __instance.player.intellect = Mathf.Min(100, __instance.player.intellect + 10); __instance.player.hentai = Mathf.Min(100, __instance.player.hentai + 5); #elif KKS __instance.player.koikatsuPoint += 10; #endif // 22 is sleep GameAPI.GetActionControl()?.AddDesire(22, heroine, 35); } } } catch (Exception e) { UnityEngine.Debug.LogError(e); } }
public static void OnFinishInside(HFlag __instance) { var heroine = __instance.GetLeadingHeroine(); var controller = GetEffectController(heroine); controller.AddInflation(1); }
private static void OnAnalCum(HFlag hFlag) { if (IsATrap(hFlag.GetLeadingHeroine())) { // If it's a trap, disable the first h guide after coming inside the back hole (wouldn't disappear otherwise) Object.FindObjectOfType <HSprite>()?.objFirstHHelpBase?.SetActive(false); } }
public static void OnInsideFinish2(HFlag __instance) { try { if (__instance.player != null) { var heroine = __instance.GetLeadingHeroine(); var currentCrest = heroine.GetCurrentCrest(); if (currentCrest == CrestType.breedgasm) { PreggersHooks.ApplyTempPreggers(heroine); } } } catch (Exception e) { UnityEngine.Debug.LogError(e); } }
[HarmonyWrapSafe] // Ignore crashes private static void OnFinishInside(HFlag __instance) { if (!IsEffectActive()) { return; } var heroine = __instance.GetLeadingHeroine(); var controller = PregnancyPlugin.GetEffectController(heroine); if (controller.Data.GameplayEnabled && !controller.Data.IsPregnant && controller.Data.Fertility > 0.001f) { var isDangerousDay = HFlag.GetMenstruation(heroine.MenstruationDay) == HFlag.MenstruationType.危険日; if (UnityEngine.Random.RandomRangeInt(0, 100) < (isDangerousDay ? 95 : 30)) { PregnancyPlugin.Logger.LogInfo("Through the power of a pin hole, pregnancy"); PregnancyGameController.StartPregnancyDelayed(heroine, true); } } }
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 OnInsideFinish(HFlag __instance) { try { if (__instance.player != null) { var heroine = __instance.GetLeadingHeroine(); var currentCrest = heroine.GetCurrentCrest(); if (currentCrest == CrestType.siphoning) { __instance.player.physical = Mathf.Min(100, __instance.player.physical + 15); __instance.player.intellect = Mathf.Min(100, __instance.player.intellect + 10); __instance.player.hentai = Mathf.Min(100, __instance.player.hentai + 5); Game.Instance.actScene?.actCtrl?.AddDesire(22, heroine, 35); } } } catch (Exception e) { UnityEngine.Debug.LogError(e); } }
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); } }