This commit is contained in:
AbstractConcept 2022-09-30 18:34:08 -05:00
parent dab724fb50
commit f089b94044
46 changed files with 2631 additions and 393 deletions

View file

@ -128,8 +128,14 @@ namespace Rimworld_Animations_Patch
if (pawn.IsHavingSex() == false && pawn.IsMasturbating() == false)
{ return true; }
if (pawn.GetLord() != null && pawn.GetLord().LordJob is LordJob_Ritual)
{ return true; }
if (pawn.GetLord() != null && pawn.GetLord().LordJob is LordJob_Joinable_Party)
{ return true; }
bool hasPrivacy = true;
bool isExhibitionist = pawn.HasTrait("Exhibitionist") || xxx.has_quirk(pawn, "Exhibitionist");
bool isExhibitionist = xxx.has_quirk(pawn, "Exhibitionist");
pawn.IsInBed(out Building bed);
@ -192,22 +198,19 @@ namespace Rimworld_Animations_Patch
public static List<BodyPartRecord> GetHands(this Pawn pawn)
{
if (HandAnimationUtility.handDef == null)
{ HandAnimationUtility.handDef = DefDatabase<BodyPartDef>.GetNamed("Hand", false); }
return pawn.health.hediffSet.GetNotMissingParts().Where(x => x.def == HandAnimationUtility.handDef)?.ToList();
return pawn.health.hediffSet.GetNotMissingParts().Where(x => x.def == PatchBodyPartDefOf.Hand)?.ToList();
}
public static bool HasPreceptForIssue(this Pawn pawn, IssueDef issueDef, out Precept precept)
public static bool HasPreceptForIssue(this Pawn pawn, string issueDefName, out Precept precept)
{
precept = null;
if (pawn?.Ideo == null || issueDef == null)
if (pawn?.Ideo == null)
{ return false; }
foreach (Precept _precept in pawn.Ideo.PreceptsListForReading)
{
if (_precept.def.issue == issueDef)
if (_precept.def.issue.defName == issueDefName)
{
precept = _precept;
return true;
@ -217,28 +220,6 @@ namespace Rimworld_Animations_Patch
return false;
}
public static bool IssueIsMajorTaboo(this Pawn pawn, IssueDef issueDef, out Precept precept)
{
if (HasPreceptForIssue(pawn, issueDef, out precept))
{
if (precept.def.defName.Contains("Forbidden") || precept.def.defName.Contains("Prohibited") || precept.def.defName.Contains("Abhorrent"))
{ return true; }
}
return false;
}
public static bool IssueIsMinorTaboo(this Pawn pawn, IssueDef issueDef, out Precept precept)
{
if (HasPreceptForIssue(pawn, issueDef, out precept))
{
if (precept.def.defName.Contains("Horrible") || precept.def.defName.Contains("Despised") || precept.def.defName.Contains("Disapproved"))
{ return true; }
}
return false;
}
public static bool EnjoysViolence(this Pawn pawn)
{
if (pawn.IsAnimal() || pawn.RaceProps.IsMechanoid)
@ -275,6 +256,14 @@ namespace Rimworld_Animations_Patch
if (traitDef == null)
{ traitDef = DefDatabase<TraitDef>.GetNamedSilentFail(trait.ToLower()); }
return HasTrait(pawn, traitDef);
}
public static bool HasTrait(this Pawn pawn, TraitDef traitDef)
{
if (pawn?.story?.traits?.allTraits == null || pawn.story.traits.allTraits.NullOrEmpty())
{ return false; }
if (traitDef == null)
{ return false; }