From 6b550dd831fed2e02def116d939d1a822e9e1f0e Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Sat, 21 May 2022 12:30:14 +0200 Subject: [PATCH 1/2] Added Mood Bonus for Genitals by Precept --- ...ughtWorker_Precept_GenitalSize_Approved.cs | 56 ++++++ ...tWorker_Precept_GenitalSize_Disapproved.cs | 57 +++++++ RJWSexperience/IdeologyAddon/VariousDefOf.cs | 3 + .../Defs/PreceptDefs/Precepts_SizeMatters.xml | 159 ++++++++++++++++++ 4 files changed, 275 insertions(+) create mode 100644 RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs create mode 100644 RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs create mode 100644 RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml diff --git a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs new file mode 100644 index 0000000..da4f94c --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs @@ -0,0 +1,56 @@ +using RimWorld; +using rjw; +using Verse; + +namespace RJWSexperience.Ideology +{ + // This Thoughtworker Checks for Bukkake-Hediff and adds a approving thought if the gender and ideology are fullfilled. + // The thought gets removed when the Hediff is removed. + 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 = 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; + } + + private 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 inversed. + if (p.gender == Gender.Female) + return 1 - best_seen_size; + + return best_seen_size; + } + } +} diff --git a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs new file mode 100644 index 0000000..090cb0f --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs @@ -0,0 +1,57 @@ +using RimWorld; +using rjw; +using Verse; + +namespace RJWSexperience.Ideology +{ + // This Thoughtworker Checks for Bukkake-Hediff and adds a approving thought if the gender and ideology are fullfilled. + // The thought gets removed when the Hediff is removed. + 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 = 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; + } + + private 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 inversed. + if (p.gender == Gender.Female) + return 1 - best_seen_size; + + return best_seen_size; + } + } +} diff --git a/RJWSexperience/IdeologyAddon/VariousDefOf.cs b/RJWSexperience/IdeologyAddon/VariousDefOf.cs index a8b11d5..6acb042 100644 --- a/RJWSexperience/IdeologyAddon/VariousDefOf.cs +++ b/RJWSexperience/IdeologyAddon/VariousDefOf.cs @@ -72,5 +72,8 @@ namespace RJWSexperience.Ideology [MayRequireIdeology] public static readonly PreceptDef Necrophilia_Disapproved = DefDatabase.GetNamed("Necrophilia_Disapproved"); [MayRequireIdeology] public static readonly PreceptDef Necrophilia_Acceptable = DefDatabase.GetNamed("Necrophilia_Acceptable"); [MayRequireIdeology] public static readonly PreceptDef Necrophilia_Approved = DefDatabase.GetNamed("Necrophilia_Approved"); + [MayRequireIdeology] public static readonly PreceptDef GenitalSize_Approved = DefDatabase.GetNamed("GenitalSize_Approved"); + [MayRequireIdeology] public static readonly PreceptDef GenitalSize_Disapproved = DefDatabase.GetNamed("GenitalSize_Disapproved"); + [MayRequireIdeology] public static readonly PreceptDef GenitalSize_NoRules = DefDatabase.GetNamed("GenitalSize_NoRules"); } } diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml new file mode 100644 index 0000000..40bfada --- /dev/null +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml @@ -0,0 +1,159 @@ + + + + + + GenitalSize + + UI/Memes/SexualDissolutely + + + + + + GenitalSize_Big_Better + GenitalSize + The size matters. + + High + 20 + 200 + +
  • + GenitalSize_Approved +
  • + +
    +
    + + + 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 + +
  • + GenitalSize_Disapproved +
  • + +
    +
    + + + + + GenitalSize_Approved + Thought_Situational + RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Approved + +
  • + + I ... I am okay the way I am! + -10 +
  • +
  • + + I think I am below average. + -5 +
  • +
  • + + I guess I am the average. + 0 +
  • +
  • + + I think I am above average. + +5 +
  • +
  • + + Don't want to be the elephant in the room, but parts of me are. + +10 +
  • +
    +
    + + + GenitalSize_Disapproved + RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved + Thought_Situational + +
  • + + I do not need great genitals, as I am a being of supreme intellect and grace. + +10 +
  • +
  • + + I think I am below average. + +5 +
  • +
  • + + I guess I am the average. + 0 +
  • +
  • + + I think I am above average. + -5 +
  • +
  • + + I am closer to an animal, than to a human. Why did I have to be born this way? + -10 +
  • +
    +
    + + + +
    \ No newline at end of file From 8d8441cb27b0988f939a4ed7c37236d648503ef0 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Sat, 21 May 2022 16:22:25 +0200 Subject: [PATCH 2/2] Added Social Thoughts on SizeMatters --- ...ughtWorker_Precept_GenitalSize_Approved.cs | 29 +--------- ...ker_Precept_GenitalSize_Approved_Social.cs | 29 ++++++++++ ...tWorker_Precept_GenitalSize_Disapproved.cs | 29 +--------- ..._Precept_GenitalSize_Disapproved_Social.cs | 28 ++++++++++ .../IdeologyAddon/Ideology/Utility.cs | 25 +++++++++ .../Defs/PreceptDefs/Precepts_SizeMatters.xml | 53 ++++++++++++------- 6 files changed, 119 insertions(+), 74 deletions(-) create mode 100644 RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs create mode 100644 RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs diff --git a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs index da4f94c..6c5f491 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved.cs @@ -4,9 +4,7 @@ using Verse; namespace RJWSexperience.Ideology { - // This Thoughtworker Checks for Bukkake-Hediff and adds a approving thought if the gender and ideology are fullfilled. - // The thought gets removed when the Hediff is removed. - public class ThoughtWorker_Precept_GenitalSize_Disapproved : ThoughtWorker_Precept + public class ThoughtWorker_Precept_GenitalSize_Approved : ThoughtWorker_Precept { protected override ThoughtState ShouldHaveThought(Pawn p) { @@ -14,7 +12,7 @@ namespace RJWSexperience.Ideology // 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 = getGenitalSize(p); + float best_size = IdeoUtility.getGenitalSize(p); if (best_size < 0.2f) return ThoughtState.ActiveAtStage(0); else if (best_size < 0.4f) @@ -29,28 +27,5 @@ namespace RJWSexperience.Ideology // This might can happen if the pawn has no genitalia ... maybe? return ThoughtState.Inactive; } - - private 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 inversed. - if (p.gender == Gender.Female) - return 1 - best_seen_size; - - return best_seen_size; - } } } diff --git a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Approved_Social.cs new file mode 100644 index 0000000..22dadbe --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/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/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs index 090cb0f..7f7eae2 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved.cs @@ -4,9 +4,7 @@ using Verse; namespace RJWSexperience.Ideology { - // This Thoughtworker Checks for Bukkake-Hediff and adds a approving thought if the gender and ideology are fullfilled. - // The thought gets removed when the Hediff is removed. - public class ThoughtWorker_Precept_GenitalSize_Approved : ThoughtWorker_Precept + public class ThoughtWorker_Precept_GenitalSize_Disapproved : ThoughtWorker_Precept { protected override ThoughtState ShouldHaveThought(Pawn p) { @@ -14,7 +12,7 @@ namespace RJWSexperience.Ideology // 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 = getGenitalSize(p); + float best_size = IdeoUtility.getGenitalSize(p); if (best_size < 0.2f) return ThoughtState.ActiveAtStage(0); else if (best_size < 0.4f) @@ -30,28 +28,5 @@ namespace RJWSexperience.Ideology return ThoughtState.Inactive; } - private 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 inversed. - if (p.gender == Gender.Female) - return 1 - best_seen_size; - - return best_seen_size; - } } } diff --git a/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs new file mode 100644 index 0000000..7df72e4 --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/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/RJWSexperience/IdeologyAddon/Ideology/Utility.cs b/RJWSexperience/IdeologyAddon/Ideology/Utility.cs index 83fcfb8..f7b12db 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Utility.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Utility.cs @@ -1,4 +1,5 @@ using RimWorld; +using rjw; using System.Collections.Generic; using System.Linq; using Verse; @@ -45,5 +46,29 @@ namespace RJWSexperience.Ideology } return false; } + + 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 inversed. + if (p.gender == Gender.Female) + return 1 - best_seen_size; + + return best_seen_size; + } } } diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml index 40bfada..b9bc867 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_SizeMatters.xml @@ -22,11 +22,9 @@
  • GenitalSize_Approved
  • -
    @@ -54,11 +52,9 @@
  • GenitalSize_Disapproved
  • -
    @@ -131,29 +127,46 @@ - + + + + GenitalSize_Disapproved_Social + RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved_Social + Thought_SituationalSocial + +
  • + + -5 +
  • +
  • + + 0 +
  • +
  • + + +5 +
  • +
    +
    + \ No newline at end of file