From 69934d06f5979ad441ad63d5b3e021f87caa7a3d Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Wed, 1 Mar 2023 17:00:58 -0800 Subject: [PATCH] Add patch to darken nipples during Biotech lactation, but commented out --- .../RJW_Menstruation/Patch/Biotech_Patch.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs index e7c5192..2ffe8b3 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs @@ -220,4 +220,28 @@ namespace RJW_Menstruation comp.Notify_UpdatedGenes(); } } + + //[HarmonyPatch(typeof(ChildcareUtility), nameof(ChildcareUtility.SuckleFromLactatingPawn))] + //public class GreedyConsume_Patch + //{ + // private static float ConsumeAndAdjustNipples(HediffComp_Chargeable instance, float desiredCharge) + // { + // // Pulling breast comp every tick might be too much for performance. + // const float averageNippleChangePerTick = 0.0025f / 50000f; + // instance.Pawn.GetBreastComp()?.AdjustNippleProgress(Rand.Range(0.0f, averageNippleChangePerTick * 2) * Configurations.MaxBreastIncrementFactor); + // return instance.GreedyConsume(desiredCharge); + // } + + // private static readonly MethodInfo GreedyConsume = AccessTools.Method(typeof(HediffComp_Chargeable), nameof(HediffComp_Chargeable.GreedyConsume), new Type[] { typeof(HediffComp_Chargeable), typeof(float) }); + // public static IEnumerable Transpiler(IEnumerable instructions) + // { + // if(GreedyConsume == null) throw new InvalidOperationException("GreedyConsume not found"); + // foreach (var instruction in instructions) + // { + // if (instruction.Calls(GreedyConsume)) + // yield return CodeInstruction.Call(typeof(GreedyConsume_Patch), nameof(GreedyConsume_Patch.ConsumeAndAdjustNipples)); + // yield return instruction; + // } + // } + //} } \ No newline at end of file