diff --git a/RJWSexperience/IdeologyAddon/Ideology/HistoryEvents/PartnerDependentRule.cs b/RJWSexperience/IdeologyAddon/Ideology/HistoryEvents/PartnerDependentRule.cs index 13bc7cc..11d0ca0 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/HistoryEvents/PartnerDependentRule.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/HistoryEvents/PartnerDependentRule.cs @@ -9,14 +9,8 @@ namespace RJWSexperience.Ideology.HistoryEvents [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] public HistoryEventDef historyEventDef; [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] - public PartnerFilter filter; + public TwoPawnFilter filter; - public bool Applies(Pawn pawn, Pawn partner) - { - if (filter == null) - return false; - - return filter.Applies(pawn, partner); - } + public bool Applies(Pawn pawn, Pawn partner) => filter?.Applies(pawn, partner) == true; } } diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precepts/DefExtension_ModifyPreference.cs b/RJWSexperience/IdeologyAddon/Ideology/Precepts/DefExtension_ModifyPreference.cs index 86608e1..698bda1 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Precepts/DefExtension_ModifyPreference.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Precepts/DefExtension_ModifyPreference.cs @@ -1,6 +1,4 @@ -using RimWorld; -using rjw; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Verse; @@ -25,7 +23,7 @@ namespace RJWSexperience.Ideology.Precepts [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] public float multiplier = 1f; [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] - public PartnerFilter filter; + public TwoPawnFilter filter; public bool Applies(Pawn pawn, Pawn partner) { diff --git a/RJWSexperience/IdeologyAddon/Ideology/PartnerFilter.cs b/RJWSexperience/IdeologyAddon/Ideology/RelationFilter.cs similarity index 74% rename from RJWSexperience/IdeologyAddon/Ideology/PartnerFilter.cs rename to RJWSexperience/IdeologyAddon/Ideology/RelationFilter.cs index 00019a4..cff5738 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/PartnerFilter.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/RelationFilter.cs @@ -1,22 +1,15 @@ using RimWorld; -using rjw; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Verse; namespace RJWSexperience.Ideology { - public class PartnerFilter + public class RelationFilter { - [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] - public bool? isAnimal; [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] public bool? isVeneratedAnimal; [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] - public bool? isSlave; - [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] - public bool? isPrisoner; - [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] public bool? isAlien; [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] public List hasOneOfRelations; @@ -29,18 +22,9 @@ namespace RJWSexperience.Ideology public bool Applies(Pawn pawn, Pawn partner) { - if (isAnimal != null && isAnimal != partner.IsAnimal()) - return false; - if (isVeneratedAnimal != null && isVeneratedAnimal != pawn.Ideo.IsVeneratedAnimal(partner)) return false; - if (isSlave != null && isSlave != partner.IsSlave) - return false; - - if (isPrisoner != null && isPrisoner != partner.IsPrisoner) - return false; - //if (isAlien != null && isAlien != partner) // return false; diff --git a/RJWSexperience/IdeologyAddon/Ideology/SinglePawnFilter.cs b/RJWSexperience/IdeologyAddon/Ideology/SinglePawnFilter.cs new file mode 100644 index 0000000..daa240f --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/SinglePawnFilter.cs @@ -0,0 +1,30 @@ +using rjw; +using System.Diagnostics.CodeAnalysis; +using Verse; + +namespace RJWSexperience.Ideology +{ + public class SinglePawnFilter + { + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public bool? isAnimal; + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public bool? isSlave; + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public bool? isPrisoner; + + public bool Applies(Pawn pawn) + { + if (isAnimal != null && isAnimal != pawn.IsAnimal()) + return false; + + if (isSlave != null && isSlave != pawn.IsSlave) + return false; + + if (isPrisoner != null && isPrisoner != pawn.IsPrisoner) + return false; + + return true; + } + } +} diff --git a/RJWSexperience/IdeologyAddon/Ideology/TwoPawnFilter.cs b/RJWSexperience/IdeologyAddon/Ideology/TwoPawnFilter.cs new file mode 100644 index 0000000..438254e --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/TwoPawnFilter.cs @@ -0,0 +1,30 @@ +using rjw; +using System.Diagnostics.CodeAnalysis; +using Verse; + +namespace RJWSexperience.Ideology +{ + public class TwoPawnFilter + { + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public SinglePawnFilter doer; + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public SinglePawnFilter partner; + [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")] + public RelationFilter relations; + + public bool Applies(Pawn pawn, Pawn partner) + { + if (doer?.Applies(pawn) == false) + return false; + + if (this.partner?.Applies(pawn) == false) + return false; + + if (relations?.Applies(pawn, partner) == false) + return false; + + return true; + } + } +} diff --git a/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj b/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj index bbe876e..bc76a0e 100644 --- a/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj +++ b/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj @@ -52,6 +52,9 @@ + + + @@ -63,7 +66,6 @@ - diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Bestiality.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Bestiality.xml index cc034fc..db81b03 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Bestiality.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Bestiality.xml @@ -16,32 +16,46 @@
  • - true + + true + RSI_SexWithVeneratedAnimal
  • - true - false + + true + + + false + RSI_SexWithNonVeneratedAnimal
  • - true - -
  • Bond
  • - + + true + + + +
  • Bond
  • +
    +
    RSI_SexWithBondedAnimal
  • - true - -
  • Bond
  • - + + true + + + +
  • Bond
  • +
    +
    RSI_SexWithNonBondAnimal @@ -113,7 +127,9 @@
  • - true + + true + 0.05
  • @@ -160,7 +176,9 @@
  • - true + + true + 0.1
  • @@ -210,7 +228,9 @@
  • - true + + true + 0.5
  • @@ -279,14 +299,20 @@
  • - true + + true + 2.0
  • - true - false + + true + + + false + 0.05
  • @@ -342,19 +368,27 @@
  • - true - -
  • Bond
  • - + + true + + + +
  • Bond
  • +
    +
    2.0
  • - true - -
  • Bond
  • - + + true + + + +
  • Bond
  • +
    +
    0.1 @@ -409,7 +443,9 @@
  • - true + + true + 2.0
  • diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Incest.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Incest.xml index 77d3604..ad5f08f 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Incest.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Incest.xml @@ -26,39 +26,43 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • - + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
    +
    RSI_CloseRelativeMarriage
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • -
  • GreatGrandparent
  • -
  • GreatGrandchild
  • -
  • GranduncleOrGrandaunt
  • -
  • GrandnephewOrGrandniece
  • -
  • CousinOnceRemoved
  • -
  • SecondCousin
  • -
  • Cousin
  • -
  • Kin
  • - + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
  • GreatGrandparent
  • +
  • GreatGrandchild
  • +
  • GranduncleOrGrandaunt
  • +
  • GrandnephewOrGrandniece
  • +
  • CousinOnceRemoved
  • +
  • SecondCousin
  • +
  • Cousin
  • +
  • Kin
  • +
    +
    RSI_IncestuosMarriage @@ -85,39 +89,43 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • - + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
    +
    RSI_CloseRelativeSex
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • -
  • GreatGrandparent
  • -
  • GreatGrandchild
  • -
  • GranduncleOrGrandaunt
  • -
  • GrandnephewOrGrandniece
  • -
  • CousinOnceRemoved
  • -
  • SecondCousin
  • -
  • Cousin
  • -
  • Kin
  • - + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
  • GreatGrandparent
  • +
  • GreatGrandchild
  • +
  • GranduncleOrGrandaunt
  • +
  • GrandnephewOrGrandniece
  • +
  • CousinOnceRemoved
  • +
  • SecondCousin
  • +
  • Cousin
  • +
  • Kin
  • +
    +
    RSI_IncestuosSex @@ -163,19 +171,21 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • - - -
  • Spouse
  • -
    + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
    + +
  • Spouse
  • +
    +
    0.5 @@ -212,27 +222,29 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • -
  • GreatGrandparent
  • -
  • GreatGrandchild
  • -
  • GranduncleOrGrandaunt
  • -
  • GrandnephewOrGrandniece
  • -
  • CousinOnceRemoved
  • -
  • SecondCousin
  • -
  • Cousin
  • -
  • Kin
  • - - -
  • Spouse
  • -
    + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
  • GreatGrandparent
  • +
  • GreatGrandchild
  • +
  • GranduncleOrGrandaunt
  • +
  • GrandnephewOrGrandniece
  • +
  • CousinOnceRemoved
  • +
  • SecondCousin
  • +
  • Cousin
  • +
  • Kin
  • +
    + +
  • Spouse
  • +
    +
    0.5 @@ -269,27 +281,29 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • -
  • GreatGrandparent
  • -
  • GreatGrandchild
  • -
  • GranduncleOrGrandaunt
  • -
  • GrandnephewOrGrandniece
  • -
  • CousinOnceRemoved
  • -
  • SecondCousin
  • -
  • Cousin
  • -
  • Kin
  • - - -
  • Spouse
  • -
    + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
  • GreatGrandparent
  • +
  • GreatGrandchild
  • +
  • GranduncleOrGrandaunt
  • +
  • GrandnephewOrGrandniece
  • +
  • CousinOnceRemoved
  • +
  • SecondCousin
  • +
  • Cousin
  • +
  • Kin
  • +
    + +
  • Spouse
  • +
    +
    0.1 @@ -324,24 +338,26 @@
  • - -
  • Parent
  • -
  • Child
  • -
  • Sibling
  • -
  • HalfSibling
  • -
  • Grandparent
  • -
  • Grandchild
  • -
  • NephewOrNiece
  • -
  • UncleOrAunt
  • -
  • GreatGrandparent
  • -
  • GreatGrandchild
  • -
  • GranduncleOrGrandaunt
  • -
  • GrandnephewOrGrandniece
  • -
  • CousinOnceRemoved
  • -
  • SecondCousin
  • -
  • Cousin
  • -
  • Kin
  • - + + +
  • Parent
  • +
  • Child
  • +
  • Sibling
  • +
  • HalfSibling
  • +
  • Grandparent
  • +
  • Grandchild
  • +
  • NephewOrNiece
  • +
  • UncleOrAunt
  • +
  • GreatGrandparent
  • +
  • GreatGrandchild
  • +
  • GranduncleOrGrandaunt
  • +
  • GrandnephewOrGrandniece
  • +
  • CousinOnceRemoved
  • +
  • SecondCousin
  • +
  • Cousin
  • +
  • Kin
  • +
    +
    2.0 diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Rape.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Rape.xml index 0573c70..1e013e0 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Rape.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Rape.xml @@ -16,13 +16,17 @@
  • - true + + true + RSI_RapedSlave
  • - true + + true + RSI_RapedPrisoner
  • diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Virginity.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Virginity.xml index 9085cd2..459c3d5 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Virginity.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Virginity.xml @@ -21,9 +21,11 @@
  • - -
  • Spouse
  • - + + +
  • Spouse
  • +
    +
    RSI_VirginTakenNotSpouse