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);
            }
        }
Пример #2
0
 public override void PostDraw()
 {
     if (cpawn.needs.TryGetNeed <Need_Soul>() == null)
     {
         //Log.Message("NoNeed");
         SituationalThoughtHandlerModded.CreateNewSoul(cpawn);
     }
     if (cpawn.needs.TryGetNeed <Need_Soul>().NoPatron)
     {
         return;
     }
     if (cpawn.needs.TryGetNeed <Need_Soul>().patronInfo.PatronName != "Slaanesh" || cpawn.needs.TryGetNeed <Need_Soul>().patronInfo.PatronName != "Undivided")
     {
         this.DrawOverlays(PatronName, cpawn);
     }
 }
        private static bool HasSoulTraitNullyfyingTraits(ThoughtDef def, Pawn p)
        {
            if (p == null)
            {
                Log.Message("NoPawn");
            }
            if (def == null)
            {
                Log.Message("NoDef");
            }

            if (p.needs.TryGetNeed <Need_Soul>() == null)

            {
                Log.Message("New Soul");
                SituationalThoughtHandlerModded.CreateNewSoul(p);
            }

            List <SoulTrait> straitlist = p.needs.TryGetNeed <Need_Soul>().SoulTraits;

            if (straitlist == null)
            {
                Log.Message("Nolist");
            }
            int tt = 0;

            foreach (SoulTrait strait in straitlist)
            {
                foreach (ThoughtDef tdef in strait.SDef.NullifiesThoughts)
                {
                    if (tdef.defName == def.defName)
                    {
                        tt += 1;
                    }
                }
            }
            if (tt > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }