mirror of
https://gitgud.io/c0ffeeeeeeee/coffees-rjw-ideology-addons.git
synced 2024-08-14 23:57:38 +00:00
replaced compinducelactation with hediffcomp; cleaner
todo: add abilitydef to hucow handler to begin inducing lactation; give lactation induction hediff to recipient pawn add thoughtdef w/ thoughtworker_hediff to give pawns thoughts on inducing lactation
This commit is contained in:
parent
1d6ecb3f95
commit
5b4b203d13
19 changed files with 233 additions and 70 deletions
|
@ -36,13 +36,15 @@ namespace CRIALactation
|
|||
public override bool HasJobOnThing(Pawn p, Thing t, bool forced = false)
|
||||
{
|
||||
Pawn pawn2 = t as Pawn;
|
||||
if(pawn2?.TryGetComp<CompInduceLactation>() == null)
|
||||
if(pawn2?.health?.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation) == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CompInduceLactation c = pawn2.TryGetComp<CompInduceLactation>();
|
||||
Hediff lactationInductionHediff = pawn2?.health?.hediffSet?.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation);
|
||||
if (lactationInductionHediff == null) return false;
|
||||
|
||||
return p != pawn2 && c.isActive && c.CanMassage && !pawn2.Downed && !pawn2.Drafted && !pawn2.InAggroMentalState && !pawn2.IsFormingCaravan() && pawn2.CanCasuallyInteractNow(false, true, false) && p.CanReserve(pawn2, 1, -1, null, forced);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue