mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
null partner bugfix
This commit is contained in:
parent
0d112972ef
commit
91d05d0e1e
13 changed files with 312 additions and 3 deletions
26
CRIALactation/Source/HediffDefOf/HediffDefOf_Milk.cs
Normal file
26
CRIALactation/Source/HediffDefOf/HediffDefOf_Milk.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
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 HediffDefOf_Milk {
|
||||
static HediffDefOf_Milk()
|
||||
{
|
||||
DefOfHelper.EnsureInitializedInCtor(typeof(HediffDefOf_Milk));
|
||||
}
|
||||
|
||||
public static HediffDef Lactating_Drug;
|
||||
public static HediffDef Lactating_Permanent;
|
||||
public static HediffDef Heavy_Lactating_Permanent;
|
||||
public static HediffDef Lactating_Natural;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
24
CRIALactation/Source/LactationUtility.cs
Normal file
24
CRIALactation/Source/LactationUtility.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using Milk;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public static class LactationUtility
|
||||
{
|
||||
|
||||
public static bool IsLactating(Pawn p)
|
||||
{
|
||||
|
||||
return
|
||||
p.health.hediffSet.HasHediff(HediffDefOf_Milk.Lactating_Natural, false) ||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
22
CRIALactation/Source/Precepts/Precept_Lactation.cs
Normal file
22
CRIALactation/Source/Precepts/Precept_Lactation.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
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 Precept_Lactation : Precept
|
||||
{
|
||||
|
||||
public override void Notify_MemberSpawned(Pawn pawn)
|
||||
{
|
||||
base.Notify_MemberSpawned(pawn);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
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 : ThoughtWorker_Precept
|
||||
{
|
||||
|
||||
protected override ThoughtState ShouldHaveThought(Pawn p)
|
||||
{
|
||||
if (ThoughtUtility.ThoughtNullified(p, this.def))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!Genital_Helper.has_breasts(p) || Genital_Helper.has_male_breasts(p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(LactationUtility.IsLactating(p))
|
||||
{
|
||||
return ThoughtState.ActiveAtStage(0);
|
||||
}
|
||||
|
||||
return ThoughtState.ActiveAtStage(1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue