mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
mc for onslort 1.4
This commit is contained in:
parent
711a61a31a
commit
396cbb8c56
23 changed files with 237 additions and 43 deletions
|
@ -30,6 +30,15 @@ namespace CRIALactation
|
|||
base.Apply(target, dest);
|
||||
Pawn pawn = target.Pawn;
|
||||
LactationUtility.ExtendLactationDuration(pawn);
|
||||
|
||||
//let's expand the breasts too!
|
||||
var breastList = pawn.GetBreastList();
|
||||
if (!breastList.NullOrEmpty())
|
||||
foreach (var breasts in breastList.Where(x => !x.TryGetComp<CompHediffBodyPart>().FluidType.NullOrEmpty()))
|
||||
{
|
||||
breasts.Severity += LactationSettings.hucowBreastSizeBonus; //this could make some big ones rediculous.
|
||||
if (breasts.Severity < LactationSettings.hucowBreastSizeMinimum) breasts.Severity = LactationSettings.hucowBreastSizeMinimum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,11 @@ namespace CRIALactation
|
|||
|
||||
public override string CompInspectStringExtra()
|
||||
{
|
||||
if((parent as Pawn).health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation) != null
|
||||
&& (parent as Pawn).health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation).TryGetComp<HediffComp_LactationInduction>().canMassage())
|
||||
//if ((parent as Pawn).health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation) != null
|
||||
// && (parent as Pawn).health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation).TryGetComp<HediffComp_LactationInduction>().canMassage())
|
||||
|
||||
if ((parent as Pawn).health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation) != null
|
||||
&& (parent as Pawn).health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactationCooldown) == null)
|
||||
{
|
||||
return "Ready to stimulate breasts for lactation.";
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace CRIALactation
|
|||
{
|
||||
|
||||
CompIngredients ingredients = foodSource.TryGetComp<CompIngredients>();
|
||||
if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk || foodDef.defName == "VCE_HumanoidCheese" || foodDef.defName == "cheese")
|
||||
if (foodDef == ThingDefOf_Milk.HumanMilk || foodDef == ThingDefOf_Milk.HumanoidMilk || foodDef == ThingDefOf_Milk.HumanMilkBulk || foodDef == ThingDefOf_Milk.HumanoidMilkBulk || foodDef.defName == "VCE_HumanoidCheese" || foodDef.defName == "cheese")
|
||||
{
|
||||
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkRaw, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef));
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace CRIALactation
|
|||
|
||||
}
|
||||
else if (ingredients == null
|
||||
|| !(ingredients.ingredients.Contains(ThingDefOf_Milk.HumanMilk) || (ingredients.ingredients.Contains(ThingDefOf_Milk.HumanoidMilk)))
|
||||
|| !(ingredients.ingredients.Contains(ThingDefOf_Milk.HumanMilk) || (ingredients.ingredients.Contains(ThingDefOf_Milk.HumanoidMilk)) || (ingredients.ingredients.Contains(ThingDefOf_Milk.HumanMilkBulk)) || (ingredients.ingredients.Contains(ThingDefOf_Milk.HumanoidMilkBulk)))
|
||||
&& !LactationUtility.IsHucow(ingester)) {
|
||||
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankNonMilkMeal, ingester, foodDef, FoodUtility.GetMeatSourceCategory(foodDef));
|
||||
__result = ___ingestThoughts;
|
||||
|
@ -58,7 +58,7 @@ namespace CRIALactation
|
|||
if (ingester.Ideo != null)
|
||||
{
|
||||
|
||||
if (ingredient == ThingDefOf_Milk.HumanoidMilk || ingredient == ThingDefOf_Milk.HumanMilk || ingredient.defName == "VCE_HumanoidCheese" || ingredient.defName == "cheese")
|
||||
if (ingredient == ThingDefOf_Milk.HumanoidMilk || ingredient == ThingDefOf_Milk.HumanMilk || ingredient == ThingDefOf_Milk.HumanoidMilkBulk || ingredient == ThingDefOf_Milk.HumanMilkBulk || ingredient.defName == "VCE_HumanoidCheese" || ingredient.defName == "cheese")
|
||||
{
|
||||
AddThoughtsFromIdeo_Patch(HistoryEventDefOf_Milk.DrankMilkMeal, ingester, ingredient, meatSourceCategory);
|
||||
}
|
||||
|
@ -77,6 +77,8 @@ namespace CRIALactation
|
|||
{
|
||||
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanMilk);
|
||||
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanoidMilk);
|
||||
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanMilkBulk);
|
||||
compIngredients.ingredients.Add(ThingDefOf_Milk.HumanoidMilkBulk);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace CRIALactation
|
|||
public static void Prefix(Thing __instance, Pawn ingester)
|
||||
{
|
||||
|
||||
if(__instance?.def == ThingDefOf_Milk.HumanMilk || __instance?.def == ThingDefOf_Milk.HumanoidMilk)
|
||||
if(__instance?.def == ThingDefOf_Milk.HumanMilk || __instance?.def == ThingDefOf_Milk.HumanoidMilk || __instance?.def == ThingDefOf_Milk.HumanMilkBulk || __instance?.def == ThingDefOf_Milk.HumanoidMilkBulk)
|
||||
{
|
||||
if (ingester.TryGetComp<CompLactation>() == null) return;
|
||||
ingester.TryGetComp<CompLactation>().lastHumanLactationIngestedTick = Find.TickManager.TicksGame;
|
||||
|
|
|
@ -13,10 +13,11 @@ using System.Reflection.Emit;
|
|||
namespace CRIALactation
|
||||
|
||||
{
|
||||
/*
|
||||
[HarmonyPatch(typeof(HumanCompHasGatherableBodyResource), "CompTick")]
|
||||
public static class HarmonyPatch_Milk_HumanCompHasGatherableBodyResource
|
||||
{
|
||||
/*
|
||||
|
||||
public static void Prefix(HumanCompHasGatherableBodyResource __instance)
|
||||
{
|
||||
if (!__instance.parent.IsHashIntervalTick(100))
|
||||
|
@ -45,8 +46,9 @@ namespace CRIALactation
|
|||
p.health.AddHediff(HediffDef.Named("Lactating_Permanent"));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
|
||||
{
|
||||
|
||||
|
@ -75,7 +77,7 @@ namespace CRIALactation
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static float AdjustGatherResourceDaysForPrecept(float resourcesIntervalDays, HumanCompHasGatherableBodyResource __instance)
|
||||
{
|
||||
|
||||
|
@ -92,7 +94,9 @@ namespace CRIALactation
|
|||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
[HarmonyPatch(typeof(CompHyperMilkableHuman), "ResourceAmount", MethodType.Getter)]
|
||||
public static class HarmonyPatch_IncreaseYieldForHucowHyperMilkable
|
||||
{
|
||||
|
@ -111,5 +115,5 @@ namespace CRIALactation
|
|||
Pawn p = __instance.parent as Pawn;
|
||||
__result *= p.GetStatValue(StatDefOf_Lactation.MilkProductionYield);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace CRIALactation
|
|||
|
||||
public static HediffDef InducingLactation;
|
||||
public static HediffDef Hucow;
|
||||
public static HediffDef InducingLactationCooldown;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using Verse;
|
|||
|
||||
namespace CRIALactation
|
||||
{
|
||||
/*
|
||||
public class HediffCompProperties_LactationInduction : HediffCompProperties
|
||||
{
|
||||
public HediffCompProperties_LactationInduction()
|
||||
|
@ -14,4 +15,5 @@ namespace CRIALactation
|
|||
this.compClass = typeof(HediffComp_LactationInduction);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ using Verse;
|
|||
|
||||
namespace CRIALactation
|
||||
{
|
||||
/*
|
||||
public class HediffComp_LactationInduction : HediffComp
|
||||
{
|
||||
private readonly int OneDayInTicks = 60000;
|
||||
|
@ -23,6 +24,9 @@ namespace CRIALactation
|
|||
|
||||
public bool canMassage()
|
||||
{
|
||||
|
||||
|
||||
|
||||
return tickLastMassaged + OneDayInTicks / TimesMassagedADay < GenTicks.TicksGame;
|
||||
}
|
||||
|
||||
|
@ -35,4 +39,5 @@ namespace CRIALactation
|
|||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace CRIALactation
|
|||
{
|
||||
public class JobDriver_MassageBreasts : JobDriver
|
||||
{
|
||||
private readonly float WorkTotal = 300f;
|
||||
private readonly float WorkTotal = 600f;
|
||||
|
||||
public override bool TryMakePreToilReservations(bool errorOnFailed)
|
||||
{
|
||||
|
@ -47,7 +47,24 @@ namespace CRIALactation
|
|||
Pawn p = job.GetTarget(TargetIndex.A).Thing as Pawn;
|
||||
if (massageProgress >= WorkTotal)
|
||||
{
|
||||
p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation).TryGetComp<HediffComp_LactationInduction>().massage(pawn);
|
||||
|
||||
Hediff induce = p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation);
|
||||
induce.Severity += (1f / LactationSettings.totalMassagesUntilLactation);
|
||||
//0.05f ; //20 times, 3 times a day = 7 days, give or take
|
||||
|
||||
if (induce.Severity >= 1)
|
||||
{
|
||||
//p.health.AddHediff(cooldown,
|
||||
LactationUtility.StartLactating(p, true);
|
||||
//remove the other hediff
|
||||
p.health.RemoveHediff(induce);
|
||||
}
|
||||
|
||||
//Add cooldown hediff. This has the pain debuff so i'm going to add it even if you're now lactating. The last one would have still hurt.
|
||||
Hediff cooldown = HediffMaker.MakeHediff(HediffDefOf_Milk.InducingLactationCooldown, p, null);
|
||||
cooldown.Severity = LactationSettings.massageCooldown;
|
||||
p.health.AddHediff(cooldown, null, null, null);
|
||||
|
||||
return JobCondition.Succeeded;
|
||||
}
|
||||
|
||||
|
|
93
CRIALactation/Source/LactationSettings.cs
Normal file
93
CRIALactation/Source/LactationSettings.cs
Normal file
|
@ -0,0 +1,93 @@
|
|||
using HugsLib.Settings;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class LactationSettings : ModSettings
|
||||
{
|
||||
|
||||
public static float massageCooldown = 0.3f;
|
||||
public static int totalMassagesUntilLactation = 20; // severity += 1 / this amount
|
||||
|
||||
public static float hucowBreastSizeBonus = 0f; //size increase when changed to hucow
|
||||
public static float hucowBreastSizeMinimum = 0.5f; //smallest size breasts can end up.
|
||||
|
||||
|
||||
private static Vector2 scrollPosition;
|
||||
private static float height_modifier = 300f;
|
||||
|
||||
public static void DoWindowContents(Rect inRect)
|
||||
{
|
||||
|
||||
//30f for top page description and bottom close button
|
||||
Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f);
|
||||
|
||||
//-16 for slider, height_modifier - additional height for hidden options toggles
|
||||
Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + height_modifier);
|
||||
|
||||
Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect); // scroll
|
||||
|
||||
Listing_Standard listingStandard = new Listing_Standard();
|
||||
listingStandard.maxOneColumn = true;
|
||||
listingStandard.ColumnWidth = viewRect.width - 10f; // / 2.05f;
|
||||
listingStandard.Begin(viewRect);
|
||||
listingStandard.Gap(5f);
|
||||
|
||||
listingStandard.Label("CRIALactation.massageCooldown".Translate() + ": " + Math.Round(massageCooldown, 3), -1f, "CRIALactation.massageCooldownDesc".Translate());
|
||||
massageCooldown = (float)listingStandard.Slider(massageCooldown, 0.01f, 1f);
|
||||
listingStandard.Gap(5f);
|
||||
|
||||
listingStandard.Label("CRIALactation.totalMassagesUntilLactation".Translate() + ": " + totalMassagesUntilLactation, -1f, "CRIALactation.totalMassagesUntilLactationDesc".Translate());
|
||||
totalMassagesUntilLactation = (int)listingStandard.Slider(totalMassagesUntilLactation, 1, 100);
|
||||
listingStandard.Gap(10f);
|
||||
|
||||
listingStandard.Label("CRIALactation.hucowBreastSizeBonus".Translate() + ": " + Math.Round(hucowBreastSizeBonus, 3), -1f, "CRIALactation.hucowBreastSizeBonusDesc".Translate());
|
||||
hucowBreastSizeBonus = (float)listingStandard.Slider(hucowBreastSizeBonus, 0f, 1f);
|
||||
listingStandard.Gap(5f);
|
||||
|
||||
listingStandard.Label("CRIALactation.hucowBreastSizeMinimum".Translate() + ": " + Math.Round(hucowBreastSizeMinimum, 3), -1f, "CRIALactation.hucowBreastSizeMinimumDesc".Translate());
|
||||
hucowBreastSizeMinimum = (float)listingStandard.Slider(hucowBreastSizeMinimum, 0.1f, 5f);
|
||||
listingStandard.Gap(5f);
|
||||
|
||||
listingStandard.End();
|
||||
Widgets.EndScrollView();
|
||||
|
||||
}
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
|
||||
Scribe_Values.Look(ref massageCooldown, "massageCooldown", massageCooldown, true);
|
||||
Scribe_Values.Look(ref totalMassagesUntilLactation, "totalMassagesUntilLactation", totalMassagesUntilLactation, true);
|
||||
Scribe_Values.Look(ref hucowBreastSizeBonus, "hucowBreastSizeBonus", hucowBreastSizeBonus, true);
|
||||
Scribe_Values.Look(ref hucowBreastSizeMinimum, "hucowBreastSizeMinimum", hucowBreastSizeMinimum, true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace CRIALactation.Settings
|
||||
{
|
||||
public class LactationSettingsMain : Mod
|
||||
{
|
||||
public LactationSettingsMain(ModContentPack content) : base(content)
|
||||
{
|
||||
GetSettings<LactationSettings>();
|
||||
}
|
||||
|
||||
public override string SettingsCategory()
|
||||
{
|
||||
return "CRIALactationSettings.settings".Translate();
|
||||
}
|
||||
|
||||
public override void DoSettingsWindowContents(Rect inRect)
|
||||
{
|
||||
|
||||
LactationSettings.DoWindowContents(inRect);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,6 @@ namespace CRIALactation
|
|||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Drug, false) ||
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Permanent, false) ||
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Heavy_Lactating_Permanent, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,7 +27,7 @@ namespace CRIALactation
|
|||
{
|
||||
if (p.TryGetComp<CompMilkableHuman>() == null) return false;
|
||||
|
||||
if (Genital_Helper.has_breasts(p) && (MilkBase.flatChestGivesMilk || !Genital_Helper.has_male_breasts(p)))
|
||||
if (Genital_Helper.has_breasts(p) && (MilkSettings.flatChestGivesMilk || !Genital_Helper.has_male_breasts(p)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -39,8 +38,10 @@ namespace CRIALactation
|
|||
public static void StartLactating(Pawn p, bool natural)
|
||||
{
|
||||
Hediff lactating = HediffMaker.MakeHediff(HediffDefOf_Milk.Lactating_Natural, p, null);
|
||||
lactating.Severity = Rand.Value;
|
||||
p.health.AddHediff(lactating, Genital_Helper.get_breastsBPR(p));
|
||||
lactating.Severity = 1;// Rand.Value;
|
||||
p.health.AddHediff(lactating, null, null, null);
|
||||
//just adding to base body, not to breasts. Just in case the target has multiple breasts so to not confuse
|
||||
//p.health.AddHediff(lactating, Genital_Helper.get_breastsBPR(p));
|
||||
}
|
||||
|
||||
public static void StopBeingHucow(Pawn p)
|
||||
|
@ -56,7 +57,9 @@ namespace CRIALactation
|
|||
public static bool isMassageable(Pawn p)
|
||||
{
|
||||
Hediff lactationInductionHediff = p.health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation);
|
||||
Hediff lactationInductionCooldownHediff = p.health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactationCooldown);
|
||||
if (lactationInductionHediff == null) return false;
|
||||
if (lactationInductionCooldownHediff != null) return false;
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -68,15 +71,27 @@ namespace CRIALactation
|
|||
var drugLact = p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.Lactating_Drug);
|
||||
if(drugLact != null)
|
||||
{
|
||||
drugLact.TryGetComp<HediffComp_Disappears>().ticksToDisappear = 1800000;
|
||||
drugLact.Severity = 1;
|
||||
//drugLact.TryGetComp<HediffComp_Disappears>().ticksToDisappear = 1800000;
|
||||
}
|
||||
|
||||
var naturalLact = p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.Lactating_Natural);
|
||||
if (naturalLact != null)
|
||||
{
|
||||
naturalLact.TryGetComp<HediffComp_Disappears>().ticksToDisappear = 1800000;
|
||||
naturalLact.Severity = 1;
|
||||
//naturalLact.TryGetComp<HediffComp_Disappears>().ticksToDisappear = 1800000;
|
||||
}
|
||||
|
||||
if (ModsConfig.BiotechActive)
|
||||
{
|
||||
var hediffLactBT = p.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Lactating"));
|
||||
if (hediffLactBT != null)
|
||||
{
|
||||
hediffLactBT.Severity = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,5 +20,9 @@ namespace CRIALactation
|
|||
|
||||
public static ThingDef HumanoidMilk;
|
||||
|
||||
public static ThingDef HumanMilkBulk;
|
||||
|
||||
public static ThingDef HumanoidMilkBulk;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace CRIALactation
|
|||
public abstract class SpecialThingFilterWorker_MilkBase : SpecialThingFilterWorker
|
||||
{
|
||||
|
||||
protected bool IsHumanMilk(ThingDef t) => t == ThingDefOf_Milk.HumanMilk || t == ThingDefOf_Milk.HumanoidMilk;
|
||||
protected bool IsHumanMilk(ThingDef t) => t == ThingDefOf_Milk.HumanMilk || t == ThingDefOf_Milk.HumanoidMilk || t == ThingDefOf_Milk.HumanoidMilkBulk || t == ThingDefOf_Milk.HumanMilkBulk;
|
||||
|
||||
protected bool IsHumanMilk(Thing t) => IsHumanMilk(t.def);
|
||||
|
||||
|
|
|
@ -43,8 +43,12 @@ namespace CRIALactation
|
|||
Hediff lactationInductionHediff = pawn2?.health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation);
|
||||
if (lactationInductionHediff == null) return false;
|
||||
|
||||
HediffComp_LactationInduction lactInductComp = lactationInductionHediff.TryGetComp<HediffComp_LactationInduction>();
|
||||
return p != pawn2 && lactInductComp.canMassage() && !pawn2.Downed && !pawn2.Drafted && !pawn2.InAggroMentalState && !pawn2.IsFormingCaravan() && pawn2.CanCasuallyInteractNow(false, true, false) && p.CanReserve(pawn2, 1, -1, null, forced);
|
||||
//we have the cooldown
|
||||
Hediff lactationInductionCooldownHediff = pawn2?.health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactationCooldown);
|
||||
if (lactationInductionCooldownHediff != null) return false;
|
||||
|
||||
//HediffComp_LactationInduction lactInductComp = lactationInductionHediff.TryGetComp<HediffComp_LactationInduction>();
|
||||
return p != pawn2 && !pawn2.Downed && !pawn2.Drafted && !pawn2.InAggroMentalState && !pawn2.IsFormingCaravan() && pawn2.CanCasuallyInteractNow(false, true, false) && p.CanReserve(pawn2, 1, -1, null, forced);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue