mc for onslort 1.4

This commit is contained in:
c0ffee 2023-02-05 19:05:01 -08:00
parent 711a61a31a
commit 396cbb8c56
23 changed files with 237 additions and 43 deletions

View file

@ -27,7 +27,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>1.4\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>

View file

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
# Visual Studio Version 17
VisualStudioVersion = 17.4.33103.184
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C0ffee's RJW Ideology Addons", "C0ffee's RJW Ideology Addons.csproj", "{D46BAA34-7459-482F-B152-321C071DCE18}"
EndProject
@ -15,16 +15,16 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D46BAA34-7459-482F-B152-321C071DCE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D46BAA34-7459-482F-B152-321C071DCE18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D46BAA34-7459-482F-B152-321C071DCE18}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{D46BAA34-7459-482F-B152-321C071DCE18}.Debug|Any CPU.Build.0 = Release|Any CPU
{D46BAA34-7459-482F-B152-321C071DCE18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D46BAA34-7459-482F-B152-321C071DCE18}.Release|Any CPU.Build.0 = Release|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Debug|Any CPU.Build.0 = Release|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01BE0D84-9292-4F89-90FC-647B66771C61}.Release|Any CPU.Build.0 = Release|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Debug|Any CPU.Build.0 = Release|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{212ED289-C5A3-4807-B482-A53F36B31F23}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<CRIALactationSettings.settings>RJW - C0ffee's RJW Ideology Addons - Lactation</CRIALactationSettings.settings>
<CRIALactation.massageCooldown>Massage Cooldown</CRIALactation.massageCooldown>
<CRIALactation.massageCooldownDesc>Default 0.3. Time between massages to stimulate lacation. 1 = A full day. Changing this number will not update existing cooldown Hediffs, it will only apply to new cooldown hediffs applied.</CRIALactation.massageCooldownDesc>
<CRIALactation.totalMassagesUntilLactation>Total Massages Needed</CRIALactation.totalMassagesUntilLactation>
<CRIALactation.totalMassagesUntilLactationDesc>Default 20. How many massages are required before lacation starts. Progress is saved as 0->1. Each time a massage happens the amount 1/total is added. Changing this value will not reset the current progress amount.</CRIALactation.totalMassagesUntilLactationDesc>
<CRIALactation.hucowBreastSizeBonus>Hucow Breast Size Increase</CRIALactation.hucowBreastSizeBonus>
<CRIALactation.hucowBreastSizeBonusDesc>Default 0.5. When turned into a hucow, this amount will get added to pawns existing breast size.</CRIALactation.hucowBreastSizeBonusDesc>
<CRIALactation.hucowBreastSizeMinimum>Hucow Breast Size Minimum</CRIALactation.hucowBreastSizeMinimum>
<CRIALactation.hucowBreastSizeMinimumDesc>Default 1.0. When turned into a hucow, this is the smallest that breasts will end up being.</CRIALactation.hucowBreastSizeMinimumDesc>
</LanguageData>

View file

@ -26,7 +26,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>1.4\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -45,7 +45,7 @@
<Private>False</Private>
</Reference>
<Reference Include="Milk">
<HintPath>..\..\rjw-mc\1.3\Assemblies\Milk.dll</HintPath>
<HintPath>..\..\rjw-mc\1.4\Assemblies\Milk.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
@ -70,6 +70,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Source\LactationSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Source\CompProperties\CompAbilityEffects\CompProperties_AbilityBeginInducingLactation.cs" />
<Compile Include="Source\CompProperties\CompAbilityEffects\CompProperties_AbilityConvertHucow.cs" />

View file

@ -13,10 +13,10 @@
<stages>
<li>
<statFactors>
<MilkProductionYield>2.75</MilkProductionYield>
<MilkProductionSpeed>0.5</MilkProductionSpeed>
<WorkSpeedGlobal>0.4</WorkSpeedGlobal>
<MoveSpeed>0.65</MoveSpeed>
<MilkProductionYield>2.5</MilkProductionYield> <!-- this will pair up with MC hediffs. With the hyper lact max x2 you'll end up with x5! -->
<MilkProductionSpeed>1.5</MilkProductionSpeed> <!-- this will pair up with MC hediffs-->
<WorkSpeedGlobal>0.7</WorkSpeedGlobal>
<MoveSpeed>0.7</MoveSpeed>
</statFactors>
</li>
</stages>
@ -25,22 +25,38 @@
<HediffDef ParentName="RoleStatBuff">
<defName>InducingLactation</defName>
<label>inducing lactation</label>
<description>This person's breasts are being encouraged to lactate. This is a long, arduous process of breast and nipple stimulation. It causes feelings of soreness and swelling that ends once milk begins expressing.</description>
<description>This person's breasts are being encouraged to lactate. This is a long, arduous process of breast and nipple stimulation.</description>
<hediffClass>HediffWithComps</hediffClass>
<comps>
<li Class="HediffCompProperties_DisappearsOnDeath" />
<li Class="CRIALactation.HediffCompProperties_LactationInduction" />
<!--<li Class="CRIALactation.HediffCompProperties_LactationInduction" />-->
<!-- changed this up to use severity from a new hediff for the cooldown so it can be adjusted in settings easily-->
</comps>
<isBad>false</isBad>
<initialSeverity>0.01</initialSeverity> <!--lactation starts at severity 1. there are settings in game to adjust the gain rate-->
</HediffDef>
<HediffDef>
<defName>InducingLactationCooldown</defName>
<label>induced lactation recently</label>
<hediffClass>HediffWithComps</hediffClass>
<description>This person's breasts are being encouraged to lactate and have been encouraged recently. This causes feelings of soreness, swelling and discomfort.</description>
<defaultLabelColor>(1, 0.50, 0.50)</defaultLabelColor>
<isBad>false</isBad>
<initialSeverity>0.3</initialSeverity>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-1</severityPerDay>
</li>
</comps>
<stages>
<li>
<statFactors>
<MilkProductionYield>2.75</MilkProductionYield>
<MilkProductionSpeed>0.5</MilkProductionSpeed>
<WorkSpeedGlobal>0.4</WorkSpeedGlobal>
<MoveSpeed>0.65</MoveSpeed>
<WorkSpeedGlobal>0.9</WorkSpeedGlobal>
<MoveSpeed>0.9</MoveSpeed>
</statFactors>
</li>
</stages>
</HediffDef>
</Defs>

View file

@ -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;
}
}
}
}

View file

@ -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())
&& (parent as Pawn).health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactationCooldown) == null)
{
return "Ready to stimulate breasts for lactation.";
}

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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,7 +46,8 @@ namespace CRIALactation
p.health.AddHediff(HediffDef.Named("Lactating_Permanent"));
}
}
}*/
}
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
{
@ -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);
}
}
}*/
}

View file

@ -23,6 +23,7 @@ namespace CRIALactation
public static HediffDef InducingLactation;
public static HediffDef Hucow;
public static HediffDef InducingLactationCooldown;

View file

@ -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);
}
}
*/
}

View file

@ -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
}
}
*/
}

View file

@ -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;
}

View 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);
}
}
}

View file

@ -21,14 +21,13 @@ namespace CRIALactation
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Permanent, false) ||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Heavy_Lactating_Permanent, false);
}
public static bool HasMilkableBreasts(Pawn p)
{
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;
}
}
}
}
}

View file

@ -20,5 +20,9 @@ namespace CRIALactation
public static ThingDef HumanoidMilk;
public static ThingDef HumanMilkBulk;
public static ThingDef HumanoidMilkBulk;
}
}

View file

@ -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);

View file

@ -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);
}

Binary file not shown.

View file

@ -27,7 +27,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>1.4\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>