Merge branch 'precept-proposal' into 'dev'

Precept proposal

See merge request amevarashi/rjw-sexperience-ideology!2
This commit is contained in:
amevarashi 2022-08-14 12:12:21 +00:00
commit 91dd9c245e
15 changed files with 741 additions and 2 deletions

View file

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- This Precept was based on the "Blindness Precept" from ideology -->
<!-- Issue -->
<IssueDef>
<defName>Pregnancy</defName>
<label>pregnancy</label>
<iconPath>UI/Issues/Birth</iconPath>
</IssueDef>
<!-- Precepts -->
<PreceptDef>
<defName>Pregnancy_Holy</defName>
<issue>Pregnancy</issue>
<label>holy</label>
<description>To be pregnant is a duty worthy of respect. Women carry our society into the next generation.</description>
<impact>Medium</impact>
<displayOrderInIssue>10</displayOrderInIssue>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Respected_Pregnant</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Respected_Pregnant_Social</thought>
</li>
</comps>
</PreceptDef>
<PreceptDef>
<defName>Pregnancy_Elevated</defName>
<issue>Pregnancy</issue>
<label>elevated</label>
<description>Being pregnant is considered noble.</description>
<impact>Low</impact>
<displayOrderInIssue>20</displayOrderInIssue>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Elevated_Pregnant</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Elevated_Pregnant_Social</thought>
</li>
</comps>
</PreceptDef>
<PreceptDef>
<defName>Pregnancy_NoRules</defName>
<issue>Pregnancy</issue>
<label>indifferent</label>
<description>There are no thoughts about pregnancy.</description>
<impact>Low</impact>
<displayOrderInIssue>30</displayOrderInIssue>
<comps>
</comps>
</PreceptDef>
<PreceptDef>
<defName>Pregnancy_Required</defName>
<issue>Pregnancy</issue>
<impact>High</impact>
<displayOrderInIssue>40</displayOrderInIssue>
<label>breeding</label>
<description>Women should be pregnant - those who are not, are seen unworthy.</description>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Respected_Pregnant</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Respected_Pregnant_Social</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_NonPregnant</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_NonPregnant_Social</thought>
</li>
</comps>
</PreceptDef>
<PreceptDef>
<defName>Pregnancy_Horrible</defName>
<issue>Pregnancy</issue>
<impact>Low</impact>
<displayOrderInIssue>50</displayOrderInIssue>
<label>horrible</label>
<description>Being Pregnant is unclean. Take care and stay pure. </description>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_Pregnant</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_Pregnant_Social</thought>
</li>
<comps>
</comps>
</PreceptDef>
<!-- Thoughts : Pregnant -->
<ThoughtDef>
<defName>Pregnancy_Respected_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<description>I am pregnant. This makes me a pillar of society.</description>
<baseMoodEffect>5</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Elevated_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<description>I am soon making our colony stronger.</description>
<baseMoodEffect>10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Respected_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<baseOpinionOffset>10</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Elevated_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<baseOpinionOffset>20</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Horrible_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<baseOpinionOffset>-20</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Horrible_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
<label>pregnant</label>
<description>How did I end up like this? I never wanted to be pregnant!</description>
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<!-- Thoughts: Not Pregnant -->
<ThoughtDef>
<defName>Pregnancy_Horrible_NonPregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<doNotApplyToQuestLodgers>true</doNotApplyToQuestLodgers>
<stages>
<li>
<label>not pregnant</label>
<description>I wish to be pregnant.</description>
<baseMoodEffect>-6</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>Pregnancy_Horrible_NonPregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>unfertilized</label>
<baseOpinionOffset>-5</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
</Defs>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Issues -->
<IssueDef>
<defName>Sex_Proselytizing</defName>
<label>sex type</label>
<iconPath>UI/Issues/Submissive</iconPath>
</IssueDef>
<!-- Currently does not work as intended!
<PreceptDef>
<defName>Proselyzing_By_Sex</defName>
<issue>Sex_Proselytizing</issue>
<label>Sexual Proselyzing</label>
<description>Sex converts both partners towards this ideology.</description>
<impact>Low</impact>
<displayOrderInIssue>40</displayOrderInIssue>
<displayOrderInImpact>300</displayOrderInImpact>
</PreceptDef>
-->
<PreceptDef>
<defName>Proselyzing_By_Orgasm</defName>
<issue>Sex_Proselytizing</issue>
<label>Orgasm Proselyzing</label>
<description>Orgasms converts both partners towards this ideology.</description>
<impact>Low</impact>
<displayOrderInIssue>50</displayOrderInIssue>
<displayOrderInImpact>400</displayOrderInImpact>
</PreceptDef>
</Defs>

View file

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Issues -->
<IssueDef>
<defName>GenitalSize</defName>
<label>Size Matters</label>
<iconPath>UI/Memes/SexualDissolutely</iconPath>
</IssueDef>
<!-- Precepts Male -->
<PreceptDef>
<defName>GenitalSize_Big_Better</defName>
<issue>GenitalSize</issue>
<description>The size matters.</description>
<label>Bigger = Better</label>
<impact>High</impact>
<displayOrderInIssue>20</displayOrderInIssue>
<displayOrderInImpact>200</displayOrderInImpact>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>GenitalSize_Approved</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>GenitalSize_Approved_Social</thought>
</li>
</comps>
</PreceptDef>
<PreceptDef>
<defName>GenitalSize_NoRules</defName>
<issue>GenitalSize</issue>
<description>The size is unimportant.</description>
<label>No Rules</label>
<impact>High</impact>
<displayOrderInIssue>10</displayOrderInIssue>
<displayOrderInImpact>100</displayOrderInImpact>
<comps>
</comps>
</PreceptDef>
<PreceptDef>
<defName>GenitalSize_Smaller_Better</defName>
<issue>GenitalSize</issue>
<description>The greeks actually believed, that a big genital is an animalistic feature. Important members are known for their small genitals.</description>
<label>Smaller = Better</label>
<impact>High</impact>
<displayOrderInIssue>30</displayOrderInIssue>
<displayOrderInImpact>200</displayOrderInImpact>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>GenitalSize_Disapproved</thought>
</li>
<li Class="PreceptComp_SituationalThought">
<thought>GenitalSize_Disapproved_Social</thought>
</li>
</comps>
</PreceptDef>
<!-- Thoughts - Mood -->
<ThoughtDef>
<defName>GenitalSize_Approved</defName>
<thoughtClass>Thought_Situational</thoughtClass>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Approved</workerClass>
<stages>
<li>
<label>Despised Genitalsize</label>
<description>I ... I am okay the way I am!</description>
<baseMoodEffect>-10</baseMoodEffect>
</li>
<li>
<label>Unwanted Genitalsize</label>
<description>I think I am below average.</description>
<baseMoodEffect>-5</baseMoodEffect>
</li>
<li>
<label>Normal Genitals</label>
<description>I guess I am the average.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
<li>
<label>Appreciated Genitals</label>
<description>I think I am above average.</description>
<baseMoodEffect>+5</baseMoodEffect>
</li>
<li>
<label>Venerated Genitals</label>
<description>Don't want to be the elephant in the room, but parts of me are.</description>
<baseMoodEffect>+10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>GenitalSize_Disapproved</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
<label>Venerated Genitals</label>
<description>I do not need great genitals, as I am a being of supreme intellect and grace.</description>
<baseMoodEffect>+10</baseMoodEffect>
</li>
<li>
<label>Appreciated Genitals</label>
<description>I think I am below average.</description>
<baseMoodEffect>+5</baseMoodEffect>
</li>
<li>
<label>Normal Genitals</label>
<description>I guess I am the average.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
<li>
<label>Unwanted Genitals</label>
<description>I think I am above average.</description>
<baseMoodEffect>-5</baseMoodEffect>
</li>
<li>
<label>Despised Genitals</label>
<description>I am closer to an animal, than to a human. Why did I have to be born this way? </description>
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<!-- Social-Thoughts (Opinion)-->
<ThoughtDef>
<defName>GenitalSize_Approved_Social</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Approved_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>Unwanted Genitals</label>
<baseOpinionOffset>-5</baseOpinionOffset>
</li>
<li>
<label>Normal Genitals</label>
<baseOpinionOffset>0</baseOpinionOffset>
</li>
<li>
<label>Favorable Genitals</label>
<baseOpinionOffset>+5</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>GenitalSize_Disapproved_Social</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>Unwanted Genitals</label>
<baseOpinionOffset>-5</baseOpinionOffset>
</li>
<li>
<label>Normal Genitals</label>
<baseOpinionOffset>0</baseOpinionOffset>
</li>
<li>
<label>Favorable Genitals</label>
<baseOpinionOffset>+5</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
</Defs>

View file

@ -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;
}
}
}

View file

@ -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);
}
}
}
}

View file

@ -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;
}
}
}

View file

@ -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;
}
}
}

View file

@ -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;
}
}
}

View file

@ -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;
}
}
}

View file

@ -0,0 +1,29 @@
using RimWorld;
using Verse;
using rjw;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
{
/// <summary>
/// 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
/// </summary>
public class ThoughtWorker_Precept_NonPregnant : ThoughtWorker_Precept
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
if (pregnancy == null)
{
return ThoughtState.Inactive;
}
return ThoughtState.ActiveAtStage(0);
}
}
}

View file

@ -0,0 +1,28 @@
using RimWorld;
using Verse;
using rjw;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
{
/// <summary>
/// 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
/// </summary>
public class ThoughtWorker_Precept_NonPregnant_Social : ThoughtWorker_Precept
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
if (pregnancy != null)
{
return ThoughtState.Inactive;
} else
return ThoughtState.ActiveAtStage(0);
}
}
}

View file

@ -0,0 +1,30 @@

using RimWorld;
using Verse;
using rjw;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
{
/// <summary>
/// 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
/// </summary>
public class ThoughtWorker_Precept_Pregnant : ThoughtWorker_Precept
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
if (pregnancy == null)
{
return ThoughtState.Inactive;
}
return ThoughtState.ActiveAtStage(0);
}
}
}

View file

@ -0,0 +1,29 @@
using RimWorld;
using Verse;
using rjw;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
{
/// <summary>
/// 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
/// </summary>
public class ThoughtWorker_Precept_Pregnant_Social : ThoughtWorker_Precept
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
var pregnancy = rjw.PregnancyHelper.GetPregnancy(p);
if (pregnancy == null)
{
return ThoughtState.Inactive;
}
return ThoughtState.ActiveAtStage(0);
}
}
}

View file

@ -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;
}
}

View file

@ -32,8 +32,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="RJW">
<HintPath>..\..\..\rjw\1.3\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\rjw-vegapnk\1.3\Assemblies\RJW.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
@ -52,6 +51,14 @@
<Compile Include="Harmony.cs" />
<Compile Include="Ideology\HistoryEvents\ArgsNamesCustom.cs" />
<Compile Include="Ideology\Keyed.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Approved.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Approved_Social.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Disapproved.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_NonPregnant.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_NonPregnant_Social.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_Pregnant.cs" />
<Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_Pregnant_Social.cs" />
<Compile Include="Ideology\RelationFilter.cs" />
<Compile Include="Ideology\RsiHistoryEventDefOf.cs" />
<Compile Include="Ideology\TwoPawnFilter.cs" />