diff --git a/1.4/Defs/PreceptDefs/Precepts_Incest.xml b/1.4/Defs/PreceptDefs/Precepts_Incest.xml index 3a36a95..23f82de 100644 --- a/1.4/Defs/PreceptDefs/Precepts_Incest.xml +++ b/1.4/Defs/PreceptDefs/Precepts_Incest.xml @@ -111,6 +111,15 @@ 60 1000 100 + +
  • + +
  • CloseRelative
  • +
  • FarRelative
  • +
  • NotRelated
  • + + +
    @@ -157,6 +166,12 @@ +
  • + +
  • FarRelative
  • +
  • NotRelated
  • + +
    @@ -275,6 +290,12 @@ +
  • + +
  • CloseRelative
  • +
  • FarRelative
  • + + diff --git a/Source/IdeologyAddon/IdeologyAddon.csproj b/Source/IdeologyAddon/IdeologyAddon.csproj index d23b8ae..63f6689 100644 --- a/Source/IdeologyAddon/IdeologyAddon.csproj +++ b/Source/IdeologyAddon/IdeologyAddon.csproj @@ -53,6 +53,7 @@ + @@ -98,7 +99,7 @@ - 1.4.3542 + 1.4.3555 2.2.2 diff --git a/Source/IdeologyAddon/Patches/Rimworld_Patch.cs b/Source/IdeologyAddon/Patches/Rimworld_Patch.cs index 55f3ba6..de49fe7 100644 --- a/Source/IdeologyAddon/Patches/Rimworld_Patch.cs +++ b/Source/IdeologyAddon/Patches/Rimworld_Patch.cs @@ -80,29 +80,15 @@ namespace RJWSexperience.Ideology.Patches public static bool RsiIncestuous(Pawn one, Pawn two) { PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos); + var allowManualRomanceOnlyFor = incestuousPrecept?.GetModExtension()?.allowManualRomanceOnlyFor; BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two); - if (incestuousPrecept == null || - incestuousPrecept == RsiPreceptDefOf.Incestuos_Disapproved || - incestuousPrecept == RsiPreceptDefOf.Incestuos_Forbidden) + if (allowManualRomanceOnlyFor == null) { return relationDegree < BloodRelationDegree.NotRelated; } - else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_Free) - { - return false; - } - else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_Disapproved_CloseOnly) - { - return relationDegree == BloodRelationDegree.CloseRelative; - } - else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_IncestOnly) - { - return relationDegree == BloodRelationDegree.NotRelated; - } - // Modded incestuous precept? - return true; + return !allowManualRomanceOnlyFor.Contains(relationDegree); } } } diff --git a/Source/IdeologyAddon/Precepts/DefExtension_Incest.cs b/Source/IdeologyAddon/Precepts/DefExtension_Incest.cs new file mode 100644 index 0000000..f4e474d --- /dev/null +++ b/Source/IdeologyAddon/Precepts/DefExtension_Incest.cs @@ -0,0 +1,16 @@ +using RJWSexperience.Ideology.Filters; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Verse; + +namespace RJWSexperience.Ideology.Precepts +{ + /// + /// Special Def extension for the Incestuous issue precepts + /// + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Def loader")] + public class DefExtension_Incest : DefModExtension + { + public List allowManualRomanceOnlyFor; + } +}