public static bool ShouldBecomeConceitedOnNewTitle(Pawn p) { TraitSet traitSet = p.story?.traits; if (traitSet != null && traitSet.HasTrait(TraitDefOf.Ascetic)) { return(false); } if (p.Faction != null && p.Faction.IsPlayer && !p.IsQuestLodger()) { return(GetConceitedTraits(p).Any()); } return(true); }
public static IEnumerable <Trait> GetConceitedTraits(Pawn p) { TraitSet traits = p.story?.traits; if (traits == null) { yield break; } for (int i = 0; i < ConceitedTraits.Count; i++) { Trait trait = traits.GetTrait(ConceitedTraits[i]); if (trait != null) { yield return(trait); } } }
public static bool IsPawnConceited(Pawn p) { TraitSet traitSet = p.story?.traits; if (traitSet != null && traitSet.HasTrait(TraitDefOf.Ascetic)) { return(false); } if (p.Faction.IsPlayer && !p.IsQuestLodger()) { if (traitSet != null) { if (!traitSet.HasTrait(TraitDefOf.Abrasive) && !traitSet.HasTrait(TraitDefOf.Greedy)) { return(traitSet.HasTrait(TraitDefOf.Jealous)); } return(true); } return(false); } return(true); }
public Pawn_StoryTracker(Pawn pawn) { this.pawn = pawn; this.traits = new TraitSet(pawn); }