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:
c0ffee 2022-10-14 18:10:00 -07:00
parent 1d6ecb3f95
commit 5b4b203d13
19 changed files with 233 additions and 70 deletions

View file

@ -28,6 +28,7 @@ namespace CRIALactation
Toil massage = new Toil();
massage.FailOnDespawnedOrNull(TargetIndex.A);
massage.FailOnAggroMentalStateAndHostile(TargetIndex.A);
float massageProgress = 0;
massage.initAction = delegate
{
Pawn p = job.GetTarget(TargetIndex.A).Thing as Pawn;
@ -46,14 +47,9 @@ namespace CRIALactation
Pawn p = job.GetTarget(TargetIndex.A).Thing as Pawn;
if (massageProgress >= WorkTotal)
{
p.TryGetComp<CompInduceLactation>().MassageBreasts();
p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf_Milk.InducingLactation).TryGetComp<HediffComp_LactationInduction>().massage(pawn);
return JobCondition.Succeeded;
}
if (!(p.TryGetComp<CompInduceLactation>().isActive && p.TryGetComp<CompInduceLactation>().CanMassage))
{
return JobCondition.Incompletable;
}
return JobCondition.Ongoing;
@ -74,7 +70,5 @@ namespace CRIALactation
yield break;
}
float massageProgress = 0f;
}
}