Exemple #1
0
 public void GainTrait(Trait trait)
 {
     if (HasTrait(trait.def))
     {
         Log.Warning(pawn + " already has trait " + trait.def);
         return;
     }
     allTraits.Add(trait);
     pawn.Notify_DisabledWorkTypesChanged();
     if (pawn.skills != null)
     {
         pawn.skills.Notify_SkillDisablesChanged();
     }
     if (!pawn.Dead && pawn.RaceProps.Humanlike && pawn.needs.mood != null)
     {
         pawn.needs.mood.thoughts.situational.Notify_SituationalThoughtsDirty();
     }
     MeditationFocusTypeAvailabilityCache.ClearFor(pawn);
 }
 private void OnPostTitleChanged(Faction faction, RoyalTitleDef newTitle)
 {
     pawn.Notify_DisabledWorkTypesChanged();
     pawn.needs?.AddOrRemoveNeedsAsAppropriate();
     if (newTitle != null)
     {
         if (newTitle.disabledJoyKinds != null && pawn.jobs != null && RoyalTitleUtility.ShouldBecomeConceitedOnNewTitle(pawn))
         {
             foreach (JoyKindDef disabledJoyKind in newTitle.disabledJoyKinds)
             {
                 pawn.jobs.Notify_JoyKindDisabled(disabledJoyKind);
             }
         }
         for (int i = 0; i < newTitle.grantedAbilities.Count; i++)
         {
             pawn.abilities.GainAbility(newTitle.grantedAbilities[i]);
         }
         UpdateHighestTitleAchieved(faction, newTitle);
     }
     QuestUtility.SendQuestTargetSignals(pawn.questTags, "TitleChanged", pawn.Named("SUBJECT"));
     MeditationFocusTypeAvailabilityCache.ClearFor(pawn);
 }
 public bool CanPawnUse(Pawn p)
 {
     return(MeditationFocusTypeAvailabilityCache.PawnCanUse(p, this));
 }