public static bool HasSoulTraitRequirements(ThoughtDef thdef, Pawn p) { if (p.needs.TryGetNeed <Need_Soul>() == null) { SituationalThoughtHandlerModded.CreateNewSoul(p); } PatronInfo pinfo = p.needs.TryGetNeed <Need_Soul>().patronInfo; List <TraitDef> lvt = thdef.requiredTraits; if (lvt == null) { Log.Message("No Required Traits"); } SoulTraitDef stdef = pinfo.PatronSpecificTrait(pinfo.PatronName); int tt = 0; foreach (TraitDef tdef in lvt) { if (stdef.defName == tdef.defName) { tt += 1; } } if (tt > 0) { return(true); } else { return(false); } }
public override void PreOpen() { base.PreOpen(); if (SelPawn != null) { soul = SelPawn.needs.TryGetNeed<Need_Soul>(); this.SelPawnPatron = soul.patronInfo.PatronName; this.SelPawnSoulState = soul.CurCategory.ToString(); PatronColor = PatronInfo.PatronColor(SelPawnPatron); STraits = soul.SoulTraits; this.psykerPowerLevel = soul.PsykerPowerLevel.ToString(); this.culturalTolerance = soul.CulturalTolerance; } }
public override void PreOpen() { base.PreOpen(); this.SelPawn = this.SelThing as Pawn; if (SelPawn != null) { soul = SelPawn.needs.TryGetNeed <Need_Soul>(); this.SelPawnPatron = soul.patronInfo.PatronName; this.SelPawnSoulState = soul.CurCategory.ToString(); PatronColor = PatronInfo.PatronColor(SelPawnPatron); if (soul.SoulTraits.NullOrEmpty()) { Log.Message("NoSoulTraits"); } if (!soul.SoulTraits.NullOrEmpty()) { Log.Message(soul.SoulTraits.Count.ToString()); STraits = soul.SoulTraits; } this.psykerPowerLevel = soul.PsykerPowerLevel.ToString(); this.culturalTolerance = soul.CulturalTolerance; } }