diff --git a/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml b/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml
new file mode 100644
index 0000000..4b1e67a
--- /dev/null
+++ b/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+
+
+ Pregnancy
+
+ UI/Issues/Birth
+
+
+
+
+ Pregnancy_Holy
+ Pregnancy
+
+ To be pregnant is a duty worthy of respect. Women carry our society into the next generation.
+ Medium
+ 10
+
+
+ Pregnancy_Respected_Pregnant
+
+
+ Pregnancy_Respected_Pregnant_Social
+
+
+
+
+
+ Pregnancy_Elevated
+ Pregnancy
+
+ Being pregnant is considered noble.
+ Low
+ 20
+
+
+ Pregnancy_Elevated_Pregnant
+
+
+ Pregnancy_Elevated_Pregnant_Social
+
+
+
+
+
+ Pregnancy_NoRules
+ Pregnancy
+
+ There are no thoughts about pregnancy.
+ Low
+ 30
+
+
+
+
+
+ Pregnancy_Required
+ Pregnancy
+ High
+ 40
+
+ Women should be pregnant - those who are not, are seen unworthy.
+
+
+ Pregnancy_Respected_Pregnant
+
+
+ Pregnancy_Respected_Pregnant_Social
+
+
+ Pregnancy_Horrible_NonPregnant
+
+
+ Pregnancy_Horrible_NonPregnant_Social
+
+
+
+
+
+ Pregnancy_Horrible
+ Pregnancy
+ Low
+ 50
+
+ Being Pregnant is unclean. Take care and stay pure.
+
+
+
+
+
+
diff --git a/1.3/Defs/PreceptDefs/Precepts_SexProselytizing.xml b/1.3/Defs/PreceptDefs/Precepts_SexProselytizing.xml
new file mode 100644
index 0000000..8afe4c1
--- /dev/null
+++ b/1.3/Defs/PreceptDefs/Precepts_SexProselytizing.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ Sex_Proselytizing
+
+ UI/Issues/Submissive
+
+
+
+ Proselyzing_By_Orgasm
+ Sex_Proselytizing
+
+ Orgasms converts both partners towards this ideology.
+ Low
+ 50
+ 400
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/PreceptDefs/Precepts_SizeMatters.xml b/1.3/Defs/PreceptDefs/Precepts_SizeMatters.xml
new file mode 100644
index 0000000..b9bc867
--- /dev/null
+++ b/1.3/Defs/PreceptDefs/Precepts_SizeMatters.xml
@@ -0,0 +1,172 @@
+
+
+
+
+
+ GenitalSize
+
+ UI/Memes/SexualDissolutely
+
+
+
+
+
+ GenitalSize_Big_Better
+ GenitalSize
+ The size matters.
+
+ High
+ 20
+ 200
+
+
+ GenitalSize_Approved
+
+
+ GenitalSize_Approved_Social
+
+
+
+
+
+ GenitalSize_NoRules
+ GenitalSize
+ The size is unimportant.
+
+ High
+ 10
+ 100
+
+
+
+
+
+ GenitalSize_Smaller_Better
+ GenitalSize
+ The greeks actually believed, that a big genital is an animalistic feature. Important members are known for their small genitals.
+
+ High
+ 30
+ 200
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/IdeologyAddon/Ideology/IdeoUtility.cs b/Source/IdeologyAddon/Ideology/IdeoUtility.cs
index 2334aec..2f558de 100644
--- a/Source/IdeologyAddon/Ideology/IdeoUtility.cs
+++ b/Source/IdeologyAddon/Ideology/IdeoUtility.cs
@@ -1,4 +1,5 @@
using RimWorld;
+using rjw;
using Verse;
namespace RJWSexperience.Ideology
@@ -33,5 +34,49 @@ namespace RJWSexperience.Ideology
}
return finalMultiplier;
}
+ internal static void ConvertPawnBySex(Pawn pawn, Pawn partner, float severity = 0.01f)
+ {
+ // Important Note: This is called on "orgasm" - hence when a pawn has the orgasm he is the "pawn" here.
+ // If Bob fucks Alice, Alice has the orgasm and Alice is the Pawn while Bob is the Partner.
+ // Hence, the Conversion happens from Partner -> Pawn and not the other way round!
+
+ // Short Circuit: Either pawn is null, exit early and do nothing
+ if (pawn == null || partner == null) return;
+ bool sameIdeo = pawn.Ideo == partner.Ideo;
+ // Option A: Partner has same Ideo as Pawn, increase certainty
+ if (sameIdeo)
+ {
+ pawn.ideo.OffsetCertainty(severity);
+ }
+ // Option B: Partner as different Ideo, try to convert
+ else
+ {
+ pawn.ideo.IdeoConversionAttempt(severity, partner.Ideo);
+ }
+ }
+
+ public static float getGenitalSize(Pawn p)
+ {
+ if (p == null)
+ return 0f;
+
+ // Iff the pawn has multiple genitalia, the "best" is picked (the biggest penis or tightest vagina)
+ float best_seen_size = 0f;
+ foreach (Hediff part in rjw.Genital_Helper.get_AllPartsHediffList(p))
+ {
+ // Only check for Vaginas and Penises, not for Anus or for things not categorized as primary sexual parts
+ if (Genital_Helper.is_penis(part) || Genital_Helper.is_vagina(part))
+ {
+ best_seen_size = part.Severity > best_seen_size ? part.Severity : best_seen_size;
+ }
+ }
+
+
+ // For Women, the scale is inverted.
+ if (p.gender == Gender.Female)
+ return 1 - best_seen_size;
+
+ return best_seen_size;
+ }
}
}
diff --git a/Source/IdeologyAddon/Ideology/Patches/RJW_Patch_Ideo.cs b/Source/IdeologyAddon/Ideology/Patches/RJW_Patch_Ideo.cs
index b7c48d6..ddb13db 100644
--- a/Source/IdeologyAddon/Ideology/Patches/RJW_Patch_Ideo.cs
+++ b/Source/IdeologyAddon/Ideology/Patches/RJW_Patch_Ideo.cs
@@ -210,5 +210,42 @@ namespace RJWSexperience.Ideology.Patches
ideo = mother?.Ideo;
return mother?.Faction ?? baby.Faction;
}
+
+ [HarmonyPatch(typeof(JobDriver_Sex), "Roll_Orgasm_Duration_Reset")]
+ public static class RJW_Patch_Orgasm_IdeoConversion
+ {
+ public static void Postfix(JobDriver_Sex __instance)
+ {
+ // ShortCuts: Exit Early if Pawn or Partner are null (can happen with Animals or Masturbation)
+ // TODO: From my Tests, this does still invoke on masturbation
+ if (__instance.pawn == null || __instance.Partner == null)
+ return;
+ // Orgasm is called "all the time" - it exits early when the sex is still going.
+ // Hence, we hijack the "Roll_Orgasm_Duration_Reset" which is fired after the real orgasm happened
+ // But we have to check for one edge case, namely the function is also done when sex is initialized (which we catch by checking for orgasm > 0
+ if (__instance.orgasms <= 0) return;
+
+ if (__instance.Partner.Ideo.HasPrecept(VariousDefOf.Proselyzing_By_Orgasm))
+ {
+ // Pawn is the one having the orgasm
+ // Partner is "giving" the orgasm, hence the pawn will be converted towards the partners ideology
+ IdeoUtility.ConvertPawnBySex(__instance.pawn, __instance.Partner, 0.03f);
+ }
+ }
+ }
+
+ // TODO: This does not work as intended!
+ // Something is wrong with this, it's not called correctly.I expect this to be the wrong Harmony Patch Point
+ [HarmonyPatch(typeof(SexUtility), "Aftersex", new Type[] { typeof(SexProps) })]
+ public static class RJW_Patch_Aftersex_IdeoConversion
+ {
+ // This is not exactly where I should put it (Maybe after The JobDriver_Sex Finishes??)
+ public static void Postfix(SexProps props)
+ {
+ IdeoUtility.ConvertPawnBySex(props.pawn, props.partner, props.orgasms * 0.03f);
+ }
+
+ }
+
}
}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved.cs
new file mode 100644
index 0000000..6c5f491
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved.cs
@@ -0,0 +1,31 @@
+using RimWorld;
+using rjw;
+using Verse;
+
+namespace RJWSexperience.Ideology
+{
+ public class ThoughtWorker_Precept_GenitalSize_Approved : ThoughtWorker_Precept
+ {
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+ // We have 5 stages, which map directly to genitalia severity:
+ // Micro(<0.2), Small(>0.2&&<0.4), Normal(>0.4&&<0.6), Big(>0.6&&<0.8), Huge(>0.8)
+ if (p != null && Genital_Helper.get_AllPartsHediffList(p).Count > 0)
+ {
+ float best_size = IdeoUtility.getGenitalSize(p);
+ if (best_size < 0.2f)
+ return ThoughtState.ActiveAtStage(0);
+ else if (best_size < 0.4f)
+ return ThoughtState.ActiveAtStage(1);
+ else if (best_size < 0.6f)
+ return ThoughtState.ActiveAtStage(2);
+ else if (best_size < 0.8f)
+ return ThoughtState.ActiveAtStage(3);
+ else if (best_size > 0.8f)
+ return ThoughtState.ActiveAtStage(4);
+ }
+ // This might can happen if the pawn has no genitalia ... maybe?
+ return ThoughtState.Inactive;
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs
new file mode 100644
index 0000000..22dadbe
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs
@@ -0,0 +1,29 @@
+using RimWorld;
+using rjw;
+using Verse;
+
+namespace RJWSexperience.Ideology
+{
+ public class ThoughtWorker_Precept_GenitalSize_Approved_Social : ThoughtWorker_Precept_Social
+ {
+
+ // Important Note: For the Social Worker, we measure otherPawns genitalia
+ protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
+ {
+ // We have 3 stages, which map directly to genitalia severity:
+ // Unfavorable(<0.4), Normal(>0.4&&<0.6), Favorable(>0.6)
+ if (otherPawn != null && Genital_Helper.get_AllPartsHediffList(otherPawn).Count > 0)
+ {
+ float best_size = IdeoUtility.getGenitalSize(otherPawn);
+ if (best_size < 0.4f)
+ return ThoughtState.ActiveAtStage(0);
+ else if (best_size < 0.6f)
+ return ThoughtState.ActiveAtStage(1);
+ else if (best_size > 0.6f)
+ return ThoughtState.ActiveAtStage(2);
+ }
+ // This might can happen if the pawn has no genitalia ... maybe?
+ return ThoughtState.Inactive;
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved.cs
new file mode 100644
index 0000000..7f7eae2
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved.cs
@@ -0,0 +1,32 @@
+using RimWorld;
+using rjw;
+using Verse;
+
+namespace RJWSexperience.Ideology
+{
+ public class ThoughtWorker_Precept_GenitalSize_Disapproved : ThoughtWorker_Precept
+ {
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+ // We have 5 stages, which map directly to genitalia severity:
+ // Micro(<0.2), Small(>0.2&&<0.4), Normal(>0.4&&<0.6), Big(>0.6&&<0.8), Huge(>0.8)
+ if (p != null && Genital_Helper.get_AllPartsHediffList(p).Count > 0)
+ {
+ float best_size = IdeoUtility.getGenitalSize(p);
+ if (best_size < 0.2f)
+ return ThoughtState.ActiveAtStage(0);
+ else if (best_size < 0.4f)
+ return ThoughtState.ActiveAtStage(1);
+ else if (best_size < 0.6f)
+ return ThoughtState.ActiveAtStage(2);
+ else if (best_size < 0.8f)
+ return ThoughtState.ActiveAtStage(3);
+ else if (best_size > 0.8f)
+ return ThoughtState.ActiveAtStage(4);
+ }
+ // This might can happen if the pawn has no genitalia ... maybe?
+ return ThoughtState.Inactive;
+ }
+
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs
new file mode 100644
index 0000000..7df72e4
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs
@@ -0,0 +1,28 @@
+using RimWorld;
+using rjw;
+using Verse;
+
+namespace RJWSexperience.Ideology
+{
+ public class ThoughtWorker_Precept_GenitalSize_Disapproved_Social : ThoughtWorker_Precept_Social
+ {
+ // Important Note: For the Social Worker, we measure otherPawns genitalia
+ protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
+ {
+ // We have 3 stages, which map directly to genitalia severity:
+ // Unfavorable(<0.4), Normal(>0.4&&<0.6), Favorable(>0.6)
+ if (otherPawn != null && Genital_Helper.get_AllPartsHediffList(otherPawn).Count > 0)
+ {
+ float best_size = IdeoUtility.getGenitalSize(otherPawn);
+ if (best_size < 0.4f)
+ return ThoughtState.ActiveAtStage(0);
+ else if (best_size < 0.6f)
+ return ThoughtState.ActiveAtStage(1);
+ else if (best_size > 0.6f)
+ return ThoughtState.ActiveAtStage(2);
+ }
+ // This might can happen if the pawn has no genitalia ... maybe?
+ return ThoughtState.Inactive;
+ }
+ }
+ }
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs
new file mode 100644
index 0000000..118d2bd
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs
@@ -0,0 +1,29 @@
+using RimWorld;
+using Verse;
+using rjw;
+
+namespace RJWSexperience.Ideology.Ideology.Precept_Workers
+{
+ ///
+ /// thought worker for a thought that is active when a certain hediff is present, and who's stage depends on the ether state of the pawn
+ /// Shamelessly taken from: https://github.com/Tachyonite/Pawnmorpher/blob/master/Source/Pawnmorphs/Esoteria/Thoughts/ThoughtWorker_EtherHediff.cs
+ ///
+ public class ThoughtWorker_Precept_NonPregnant : ThoughtWorker_Precept
+ {
+ /// Gets the current thought state of the given pawn.
+ /// The pawn for whom the thoughts are generated.
+ ///
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+
+ var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
+
+ if (pregnancy == null)
+ {
+ return ThoughtState.Inactive;
+ }
+
+ return ThoughtState.ActiveAtStage(0);
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs
new file mode 100644
index 0000000..68ed70b
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs
@@ -0,0 +1,28 @@
+using RimWorld;
+using Verse;
+using rjw;
+
+namespace RJWSexperience.Ideology.Ideology.Precept_Workers
+{
+ ///
+ /// thought worker for a thought that is active when a certain hediff is present, and who's stage depends on the ether state of the pawn
+ /// Shamelessly taken from: https://github.com/Tachyonite/Pawnmorpher/blob/master/Source/Pawnmorphs/Esoteria/Thoughts/ThoughtWorker_EtherHediff.cs
+ ///
+ public class ThoughtWorker_Precept_NonPregnant_Social : ThoughtWorker_Precept
+ {
+ /// Gets the current thought state of the given pawn.
+ /// The pawn for whom the thoughts are generated.
+ ///
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+
+ var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
+
+ if (pregnancy != null)
+ {
+ return ThoughtState.Inactive;
+ } else
+ return ThoughtState.ActiveAtStage(0);
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs
new file mode 100644
index 0000000..fab5f90
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs
@@ -0,0 +1,30 @@
+
+using RimWorld;
+using Verse;
+using rjw;
+
+namespace RJWSexperience.Ideology.Ideology.Precept_Workers
+{
+ ///
+ /// thought worker for a thought that is active when a certain hediff is present, and who's stage depends on the ether state of the pawn
+ /// Shamelessly taken from: https://github.com/Tachyonite/Pawnmorpher/blob/master/Source/Pawnmorphs/Esoteria/Thoughts/ThoughtWorker_EtherHediff.cs
+ ///
+ public class ThoughtWorker_Precept_Pregnant : ThoughtWorker_Precept
+ {
+ /// Gets the current thought state of the given pawn.
+ /// The pawn for whom the thoughts are generated.
+ ///
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+
+ var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
+
+ if (pregnancy == null)
+ {
+ return ThoughtState.Inactive;
+ }
+
+ return ThoughtState.ActiveAtStage(0);
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs
new file mode 100644
index 0000000..b1cdaa0
--- /dev/null
+++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs
@@ -0,0 +1,29 @@
+using RimWorld;
+using Verse;
+using rjw;
+
+namespace RJWSexperience.Ideology.Ideology.Precept_Workers
+{
+ ///
+ /// thought worker for a thought that is active when a certain hediff is present, and who's stage depends on the ether state of the pawn
+ /// Shamelessly taken from: https://github.com/Tachyonite/Pawnmorpher/blob/master/Source/Pawnmorphs/Esoteria/Thoughts/ThoughtWorker_EtherHediff.cs
+ ///
+ public class ThoughtWorker_Precept_Pregnant_Social : ThoughtWorker_Precept
+ {
+ /// Gets the current thought state of the given pawn.
+ /// The pawn for whom the thoughts are generated.
+ ///
+ protected override ThoughtState ShouldHaveThought(Pawn p)
+ {
+
+ var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
+
+ if (pregnancy == null)
+ {
+ return ThoughtState.Inactive;
+ }
+
+ return ThoughtState.ActiveAtStage(0);
+ }
+ }
+}
diff --git a/Source/IdeologyAddon/Ideology/VariousDefOf.cs b/Source/IdeologyAddon/Ideology/VariousDefOf.cs
index 8d1f5a4..4cce63e 100644
--- a/Source/IdeologyAddon/Ideology/VariousDefOf.cs
+++ b/Source/IdeologyAddon/Ideology/VariousDefOf.cs
@@ -21,5 +21,10 @@ namespace RJWSexperience.Ideology
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysColony;
[MayRequireIdeology] public static readonly PreceptDef Submissive_Male;
[MayRequireIdeology] public static readonly PreceptDef Submissive_Female;
+ [MayRequireIdeology] public static readonly PreceptDef Proselyzing_By_Orgasm;
+ [MayRequireIdeology] public static readonly PreceptDef Proselyzing_By_Sex;
+ [MayRequireIdeology] public static readonly PreceptDef GenitalSize_Approved;
+ [MayRequireIdeology] public static readonly PreceptDef GenitalSize_Disapproved;
+ [MayRequireIdeology] public static readonly PreceptDef GenitalSize_NoRules;
}
}
diff --git a/Source/IdeologyAddon/IdeologyAddon.csproj b/Source/IdeologyAddon/IdeologyAddon.csproj
index 1ea925e..819c938 100644
--- a/Source/IdeologyAddon/IdeologyAddon.csproj
+++ b/Source/IdeologyAddon/IdeologyAddon.csproj
@@ -32,8 +32,7 @@
- ..\..\..\rjw\1.3\Assemblies\RJW.dll
- False
+ ..\..\..\rjw-vegapnk\1.3\Assemblies\RJW.dll
@@ -52,6 +51,14 @@
+
+
+
+
+
+
+
+