hucow changes

This commit is contained in:
c0ffee12 2021-08-02 11:55:46 -07:00
parent 064871641c
commit 5e807217bc
21 changed files with 373 additions and 23 deletions

View file

@ -16,7 +16,7 @@ namespace CRIALactation
[HarmonyPatch(typeof(HumanCompHasGatherableBodyResource), "CompTick")]
public static class HarmonyPatch_Milk_HumanCompHasGatherableBodyResource
{
/*
public static void Prefix(HumanCompHasGatherableBodyResource __instance)
{
if (!__instance.parent.IsHashIntervalTick(100))
@ -45,7 +45,7 @@ namespace CRIALactation
p.health.AddHediff(HediffDef.Named("Lactating_Permanent"));
}
}
}
}*/
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
{
@ -84,7 +84,7 @@ namespace CRIALactation
{
return resourcesIntervalDays * 0.666f * ((pawn?.Ideo?.GetRole(pawn) != null && pawn.Ideo.GetRole(pawn).def == PreceptDefOf_Lactation.IdeoRole_Hucow) ? 0.5f : 1f); //1.5x normal rate
return resourcesIntervalDays * 0.666f * pawn.GetStatValue(StatDefOf_Lactation.MilkProductionSpeed); //1.5x normal rate
}
return resourcesIntervalDays;
@ -99,10 +99,7 @@ namespace CRIALactation
public static void Postfix(CompHyperMilkableHuman __instance, ref float __result)
{
Pawn p = __instance.parent as Pawn;
if (p.Ideo.GetRole(p).def == PreceptDefOf_Lactation.IdeoRole_Hucow)
{
__result = 45;
}
__result *= p.GetStatValue(StatDefOf_Lactation.MilkProductionYield);
}
}
@ -112,10 +109,7 @@ namespace CRIALactation
public static void Postfix(CompHyperMilkableHuman __instance, ref float __result)
{
Pawn p = __instance.parent as Pawn;
if (p?.Ideo?.GetRole(p) != null && p.Ideo.GetRole(p).def == PreceptDefOf_Lactation.IdeoRole_Hucow)
{
__result = 45;
}
__result *= p.GetStatValue(StatDefOf_Lactation.MilkProductionYield);
}
}
}