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
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class HediffCompProperties_LactationInduction : HediffCompProperties
|
||||
{
|
||||
public HediffCompProperties_LactationInduction()
|
||||
{
|
||||
this.compClass = typeof(HediffComp_LactationInduction);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace CRIALactation
|
||||
{
|
||||
public class HediffComp_LactationInduction : HediffComp
|
||||
{
|
||||
private readonly int OneDayInTicks = 60000;
|
||||
private float TimesMassagedADay = 2.5f;
|
||||
private int tickLastMassaged = 0, DaysToLactating = 15;
|
||||
|
||||
|
||||
|
||||
public void massage(Pawn massager)
|
||||
{
|
||||
|
||||
this.parent.Severity += (float)1 / (DaysToLactating * (TimesMassagedADay + Rand.Value));
|
||||
}
|
||||
|
||||
public bool canMassage()
|
||||
{
|
||||
return tickLastMassaged + OneDayInTicks / TimesMassagedADay < GenTicks.TicksGame;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void CompExposeData()
|
||||
{
|
||||
Scribe_Values.Look<int>(ref this.tickLastMassaged, "lastLactationInductionMassagedTick", 0);
|
||||
base.CompExposeData();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue