Skip to content

Commit

Permalink
deactivated some pawnkinddef related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
erdelf committed Aug 18, 2018
1 parent d269d14 commit 60e5a6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Binary file modified Assemblies/AlienRace.dll
Binary file not shown.
18 changes: 6 additions & 12 deletions Source/AlienRace/AlienRace/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1809,24 +1809,17 @@ public static bool GenerateRandomOldAgeInjuriesPrefix(Pawn pawn)
return true;
}


public static bool FillBackstoryInSlotShuffledPrefix(Pawn pawn, BackstorySlot slot, ref Backstory backstory)
{
bioReference = null;
if (slot == BackstorySlot.Adulthood && DefDatabase<BackstoryDef>.GetNamedSilentFail(defName: pawn.story.childhood.identifier)?.linkedBackstory is string id &&
BackstoryDatabase.TryGetWithIdentifier(identifier: id, bs: out backstory))
return false;

/*
if ((pawn.def is ThingDef_AlienRace alienProps && alienProps.alienRace.generalSettings.pawnsSpecificBackstories ||
(pawn.kindDef.GetModExtension<Info>()?.usePawnKindBackstories ?? false)) && !pawn.kindDef.backstoryCategory.NullOrEmpty())
(pawn.kindDef.GetModExtension<Info>()?.usePawnKindBackstories ?? false)) && !pawn.kindDef.backstoryCategories.NullOrEmpty())
{
/*
Log.Message(pawn.def.defName);
re
Log.Message(string.Join("\n", BackstoryDatabase.allBackstories.Where(kvp => kvp.Value.shuffleable && kvp.Value.spawnCategories.Contains(pawn.kindDef.backstoryCategory) &&
kvp.Value.slot == slot && (slot == BackstorySlot.Childhood ||
!kvp.Value.requiredWorkTags.OverlapsWithOnAnyWorkType(pawn.story.childhood?.workDisables ?? WorkTags.None)) &&
(DefDatabase<BackstoryDef>.GetNamedSilentFail(kvp.Value.identifier)?.commonalityApproved(pawn.gender) ?? true)).Select(kvp => kvp.Value.identifier).ToArray()));
*/
if (BackstoryDatabase.allBackstories.Where(predicate: kvp => kvp.Value.shuffleable && kvp.Value.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory) &&
kvp.Value.slot == slot && (slot == BackstorySlot.Childhood ||
!kvp.Value.requiredWorkTags.OverlapsWithOnAnyWorkType(
Expand All @@ -1841,12 +1834,13 @@ public static bool FillBackstoryInSlotShuffledPrefix(Pawn pawn, BackstorySlot sl
Log.Message(
text:
$"FAILED: {pawn.def.defName} {pawn.kindDef.defName} {pawn.kindDef.backstoryCategory} {BackstoryDatabase.allBackstories.Values.Count(predicate: bs => bs.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory))}");
$"FAILED: {pawn.def.defName} {pawn.kindDef.defName} {pawn.kindDef.backstoryCategories} {BackstoryDatabase.allBackstories.Values.Count(predicate: bs => bs.spawnCategories.Contains(item: pawn.kindDef.backstoryCategory))}");
}
*/
return true;
}

private static PawnBioDef bioReference;

// ReSharper disable once RedundantAssignment
Expand Down
1 change: 0 additions & 1 deletion Source/AlienRace/AlienRace/ThingDef_AlienRace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class AlienSettings
public class GeneralSettings
{
public float maleGenderProbability = 0.5f;
public bool pawnsSpecificBackstories = false;
public bool immuneToAge = false;
public bool canLayDown = true;

Expand Down

0 comments on commit 60e5a6f

Please sign in to comment.