protected override bool TryExecuteWorker(IncidentParms parms) { Map map = parms.target as Map; FelineAspectProperties felineProps = def.GetModExtension <FelineAspectProperties>(); if (felineProps != null) { //Get executioner. Pawn executioner = altar(map).tempExecutioner; if (ExecutionerIsValid(executioner, felineProps)) { //Apply Hediffs //To body executioner.health.AddHediff(felineProps.hediffToApplyToBody, null); //To hands foreach (BodyPartDef hand in felineProps.handDefs) { List <BodyPartRecord> records = executioner.RaceProps.body.AllParts.FindAll(part => part.def == hand); if (records?.Count > 0) { foreach (var record in records) { executioner.health.AddHediff(felineProps.hediffToApplyToHands, record); } } } } } return(true); }
public bool ExecutionerIsValid(Pawn preacher, FelineAspectProperties felineProps) { if (!preacher.health.hediffSet.HasHediff(felineProps.hediffToApplyToBody, false)) { return(true); } return(false); }
public override bool CanSummonNow(Map map) { FelineAspectProperties felineProps = def.GetModExtension <FelineAspectProperties>(); if (felineProps != null) { //Get executioner. Pawn executioner = altar(map).tempExecutioner; return(ExecutionerIsValid(executioner, felineProps)); } return(false); }