mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
lactation precepts
This commit is contained in:
parent
edada8ff48
commit
5752647b4f
10 changed files with 231 additions and 17 deletions
Binary file not shown.
|
@ -70,10 +70,13 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Source\HarmonyPatches\HarmonyPatch_Ideo.cs" />
|
||||
<Compile Include="Source\HediffDefOf\HediffDefOf_Milk.cs" />
|
||||
<Compile Include="Source\LactationUtility.cs" />
|
||||
<Compile Include="Source\PreceptDefOf\PreceptDefOf_Lactation.cs" />
|
||||
<Compile Include="Source\Precepts\Precept_Lactation.cs" />
|
||||
<Compile Include="Source\Thoughts\ThoughtWorker_Precept_Lactating_Essential.cs" />
|
||||
<Compile Include="Source\Thoughts\ThoughtWorker_Precept_Lactating_Essential_Social.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
|
|
|
@ -4,28 +4,29 @@
|
|||
<!--Issue-->
|
||||
|
||||
<IssueDef>
|
||||
<defName>Lactation</defName>
|
||||
<label>lactation</label>
|
||||
<defName>Lactating</defName>
|
||||
<label>lactating</label>
|
||||
<iconPath>UI/Issues/MeatEating</iconPath>
|
||||
</IssueDef>
|
||||
|
||||
<PreceptDef>
|
||||
<defName>Lactating_Essential</defName>
|
||||
<issue>Lactation</issue>
|
||||
<issue>Lactating</issue>
|
||||
<label>essential</label>
|
||||
<description>Milk from breasts is healthy and delicious. It should be produced and consumed by everyone on a regular basis.</description>
|
||||
<impact>High</impact>
|
||||
<description>Milk from breasts is creamy and delicious. It should be produced and consumed on a regular basis.</description>
|
||||
<comps>
|
||||
|
||||
<li Class="PreceptComp_SituationalThought">
|
||||
<thought>Lactating_Essential</thought>
|
||||
<description>Pawns with sizeable breasts should be producing milk</description>
|
||||
<description>Sizeable breasts must produce milk</description>
|
||||
<tooltipShowMoodRange>true</tooltipShowMoodRange>
|
||||
</li>
|
||||
<li Class="PreceptComp_SituationalThought">
|
||||
<thought>Lactating_Essential_Social</thought>
|
||||
</li>
|
||||
|
||||
|
||||
</comps>
|
||||
</PreceptDef>
|
||||
|
||||
|
||||
<ThoughtDef>
|
||||
<defName>Lactating_Essential</defName>
|
||||
<thoughtClass>Thought_Situational</thoughtClass>
|
||||
|
@ -33,15 +34,55 @@
|
|||
<stages>
|
||||
<li>
|
||||
<label>producing milk</label>
|
||||
<description>Expressing milk for my friends and family fills me with maternal pride.</description>
|
||||
<baseMoodEffect>7</baseMoodEffect>
|
||||
<description>Expressing milk for fills me with maternal pride.</description>
|
||||
<baseMoodEffect>6</baseMoodEffect>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label>not producing milk</label>
|
||||
<description>I'm as useless as a dry well.</description>
|
||||
<baseMoodEffect>-12</baseMoodEffect>
|
||||
<description>We live in such difficult times. Producing milk is a pipe dream, but it would be nice.</description>
|
||||
<baseMoodEffect>-6</baseMoodEffect>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label>not producing milk</label>
|
||||
<description>I'm as useless as a dry well. A healthy supply of my milk is expected, but I'm failing to deliver.</description>
|
||||
<baseMoodEffect>-9</baseMoodEffect>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label>not producing milk</label>
|
||||
<description>Producing milk is a basic duty for someone like me. I'm embarrassed and ashamed to be dry.</description>
|
||||
<baseMoodEffect>-16</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</ThoughtDef>
|
||||
|
||||
|
||||
|
||||
<ThoughtDef>
|
||||
<defName>Lactating_Essential_Social</defName>
|
||||
<thoughtClass>Thought_SituationalSocial</thoughtClass>
|
||||
<workerClass>CRIALactation.ThoughtWorker_Precept_Lactating_Essential_Social</workerClass>
|
||||
<stages>
|
||||
<li>
|
||||
<label>producing milk</label>
|
||||
<baseOpinionOffset>15</baseOpinionOffset>
|
||||
</li>
|
||||
<li>
|
||||
<label>not producing milk (low expectations)</label>
|
||||
<baseOpinionOffset>-5</baseOpinionOffset>
|
||||
</li>
|
||||
<li>
|
||||
<label>not producing milk (moderate expectations)</label>
|
||||
<baseOpinionOffset>-20</baseOpinionOffset>
|
||||
</li>
|
||||
<li>
|
||||
<label>not producing milk (high expectations)</label>
|
||||
<baseOpinionOffset>-40</baseOpinionOffset>
|
||||
</li>
|
||||
|
||||
</stages>
|
||||
</ThoughtDef>
|
||||
|
||||
</Defs>
|
||||
|
|
25
CRIALactation/Source/HarmonyPatches/HarmonyPatch_Ideo.cs
Normal file
25
CRIALactation/Source/HarmonyPatches/HarmonyPatch_Ideo.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using Milk;
|
||||
using UnityEngine;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
|
||||
/** //to be implemented next update
|
||||
[HarmonyPatch(typeof(IdeoUtility), "Notify_MemberGenerated")]
|
||||
public static class HarmonyPatch_Ideo_Notify_MemberGenerated
|
||||
{
|
||||
public static void Prefix()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}**/
|
||||
}
|
23
CRIALactation/Source/HarmonyPatches/Harmony_PatchAll.cs
Normal file
23
CRIALactation/Source/HarmonyPatches/Harmony_PatchAll.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace C0ffeeRIA
|
||||
{
|
||||
|
||||
[StaticConstructorOnStartup]
|
||||
public static class Harmony_PatchAll
|
||||
{
|
||||
static Harmony_PatchAll()
|
||||
{
|
||||
Harmony harmony = new Harmony("CRIALactation");
|
||||
harmony.PatchAll(Assembly.GetExecutingAssembly());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using Milk;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -20,5 +21,22 @@ 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 (Genital_Helper.has_breasts(p) && !Genital_Helper.has_male_breasts(p))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void StartLactating(Pawn p, bool natural)
|
||||
{
|
||||
Hediff lactating = HediffMaker.MakeHediff(natural ? HediffDefOf_Milk.Lactating_Natural : HediffDefOf_Milk.Lactating_Drug, p, null);
|
||||
lactating.Severity = Rand.Value;
|
||||
p.health.AddHediff(lactating, Genital_Helper.get_breastsBPR(p));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
22
CRIALactation/Source/PreceptDefOf/PreceptDefOf_Lactation.cs
Normal file
22
CRIALactation/Source/PreceptDefOf/PreceptDefOf_Lactation.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using RimWorld;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
[DefOf]
|
||||
public static class PreceptDefOf_Lactation
|
||||
{
|
||||
static PreceptDefOf_Lactation()
|
||||
{
|
||||
DefOfHelper.EnsureInitializedInCtor(typeof(PreceptDefOf_Lactation));
|
||||
}
|
||||
|
||||
public static PreceptDef Lactating_Essential;
|
||||
|
||||
}
|
||||
}
|
|
@ -10,13 +10,41 @@ using UnityEngine;
|
|||
|
||||
namespace CRIALactation
|
||||
{
|
||||
/** //doesn't work because inheritance problems with rimworld
|
||||
public class Precept_Lactation : Precept
|
||||
{
|
||||
|
||||
|
||||
public override void Notify_MemberSpawned(Pawn pawn)
|
||||
{
|
||||
Log.Message("spawning pawn with lact");
|
||||
if (!pawn.IsColonistPlayerControlled && !LactationUtility.IsLactating(pawn))
|
||||
{
|
||||
LactationUtility.StartLactating(pawn, pawn.relations.ChildrenCount > 0);
|
||||
}
|
||||
|
||||
//spawned into map
|
||||
base.Notify_MemberSpawned(pawn);
|
||||
}
|
||||
|
||||
public override void Notify_MemberGenerated(Pawn pawn)
|
||||
{
|
||||
Log.Message("Creating pawn with lact");
|
||||
|
||||
//first created
|
||||
if(pawn.IsColonistPlayerControlled && LactationUtility.HasMilkableBreasts(pawn))
|
||||
{
|
||||
|
||||
if (!LactationUtility.IsLactating(pawn))
|
||||
{
|
||||
LactationUtility.StartLactating(pawn, pawn.relations.ChildrenCount > 0);
|
||||
Log.Message("Creating pawn with lact" + pawn.Name);
|
||||
}
|
||||
}
|
||||
|
||||
base.Notify_MemberGenerated(pawn);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
**/
|
||||
}
|
||||
|
|
|
@ -15,13 +15,16 @@ namespace CRIALactation
|
|||
|
||||
protected override ThoughtState ShouldHaveThought(Pawn p)
|
||||
{
|
||||
|
||||
if (!p.IsColonistPlayerControlled) return false;
|
||||
|
||||
if (ThoughtUtility.ThoughtNullified(p, this.def))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!Genital_Helper.has_breasts(p) || Genital_Helper.has_male_breasts(p))
|
||||
if(!LactationUtility.HasMilkableBreasts(p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -31,8 +34,18 @@ namespace CRIALactation
|
|||
return ThoughtState.ActiveAtStage(0);
|
||||
}
|
||||
|
||||
return ThoughtState.ActiveAtStage(1);
|
||||
|
||||
if(ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.VeryLow.order)
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(1);
|
||||
}
|
||||
else if(ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.Moderate.order)
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using Milk;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class ThoughtWorker_Precept_Lactating_Essential_Social : ThoughtWorker_Precept_Social
|
||||
{
|
||||
protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
|
||||
{
|
||||
|
||||
if(LactationUtility.HasMilkableBreasts(otherPawn) && !LactationUtility.IsLactating(otherPawn))
|
||||
{
|
||||
|
||||
return ThoughtState.ActiveAtStage(0);
|
||||
|
||||
}
|
||||
|
||||
if (ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.VeryLow.order)
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(1);
|
||||
}
|
||||
else if (ExpectationsUtility.CurrentExpectationFor(p).order <= ExpectationDefOf.Moderate.order)
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue