public Pawn_PrayTracker(Pawn pawn, Religion religion) { this.pawn = pawn; if (religion.GetSettings <ReligionSettings_Prayings>(SettingsTagDefOf.PrayingsTag) != null) { this.pray = new Need_Pray(pawn) { def = religion.GetSettings <ReligionSettings_Prayings>(SettingsTagDefOf.PrayingsTag).Need }; } }
public override float GetPriority(Pawn pawn) { Need_Pray prayNeed = pawn.GetReligionComponent().PrayTracker.PrayNeed; if (prayNeed != null) { float curLevel = prayNeed.CurLevel; TimeAssignmentDef timeAssignmentDef = pawn.timetable != null ? pawn.timetable.CurrentAssignment : TimeAssignmentDefOf.Anything; if (timeAssignmentDef.allowJoy && curLevel <= 0.05f) { return(1f); } } return(0.0f); //return pawn.GetReligionComponent().PietyTracker.PietyNeed.CurCategoryIntWithoutZero * 19f; }
public static void TickCheckEnd(Pawn pawn) { Need_Pray prayNeed = pawn.GetReligionComponent().PrayTracker.PrayNeed; if (prayNeed != null) { prayNeed.Gain(0.0008f); if (prayNeed.CurLevel <= 0.999899983406067) { return; } else { pawn.jobs.curDriver.EndJobWith(JobCondition.Succeeded); } } }