rjw-genes/Source/Genes/Cum/HediffComp_ProcessCumbucket.cs

29 lines
1,019 B
C#
Raw Normal View History

2024-07-16 16:22:17 +00:00

using RimWorld;
using System;
using Verse;
namespace RJW_Genes
{
public class HediffComp_ProcessCumbucket : HediffComp
{
2024-07-16 16:28:29 +00:00
2024-07-16 16:22:17 +00:00
public HediffsCompProperties_ProcessCumbucketMTB Props
{
get
{
return (HediffsCompProperties_ProcessCumbucketMTB)this.props;
}
}
public override void CompPostTick(ref float severityAdjustment)
{
if (this.Props.mtbDaysPerStage[this.parent.CurStageIndex] > 0f && base.Pawn.IsHashIntervalTick(60) && Rand.MTBEventOccurs(this.Props.mtbDaysPerStage[this.parent.CurStageIndex], 60000f, 60f))
{
2024-07-16 16:34:04 +00:00
ModLog.Debug($"Triggered HediffComp_ProcessCumbucket CompPostTick - Starting a JobDriver ProcessCumbucket for {this.parent.pawn}");
2024-07-16 16:22:17 +00:00
this.Pawn.jobs.StartJob(JobMaker.MakeJob(DefDatabase<JobDef>.GetNamed("ProcessCumbucket")), lastJobEndCondition: Verse.AI.JobCondition.InterruptForced, resumeCurJobAfterwards: true);
}
}
}
}