From 8f4ebb749a0e60f7ae1a675c862169342cae8f33 Mon Sep 17 00:00:00 2001 From: Leonhard Applis Date: Wed, 10 Aug 2022 20:52:32 +0200 Subject: [PATCH] Drafted Pregnancy Precept --- 1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml | 205 ++++++++++++++++++ .../ThoughtWorker_Precept_NonPregnant.cs | 29 +++ ...houghtWorker_Precept_NonPregnant_Social.cs | 28 +++ .../ThoughtWorker_Precept_Pregnant.cs | 30 +++ .../ThoughtWorker_Precept_Pregnant_Social.cs | 29 +++ Source/IdeologyAddon/IdeologyAddon.csproj | 3 +- 6 files changed, 322 insertions(+), 2 deletions(-) create mode 100644 1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml create mode 100644 Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs create mode 100644 Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs create mode 100644 Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs create mode 100644 Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs 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. + +
  • + Pregnancy_Horrible_Pregnant +
  • +
  • + Pregnancy_Horrible_Pregnant_Social +
  • + + +
    + + + + + Pregnancy_Respected_Pregnant + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + Thought_Situational + +
  • + + I am pregnant. This makes me a pillar of society. + 5 +
  • +
    +
    + + + Pregnancy_Elevated_Pregnant + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + Thought_Situational + +
  • + + I am soon making our colony stronger. + 10 +
  • +
    +
    + + + Pregnancy_Respected_Pregnant_Social + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + Thought_SituationalSocial + +
  • + + 10 +
  • +
    +
    + + + Pregnancy_Elevated_Pregnant_Social + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + Thought_SituationalSocial + +
  • + + 20 +
  • +
    +
    + + + Pregnancy_Horrible_Pregnant_Social + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + Thought_SituationalSocial + +
  • + + -20 +
  • +
    +
    + + + Pregnancy_Horrible_Pregnant + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + Thought_Situational + +
  • + + How did I end up like this? I never wanted to be pregnant! + -10 +
  • +
    +
    + + + + Pregnancy_Horrible_NonPregnant + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social + Thought_Situational + true + +
  • + + I wish to be pregnant. + -6 +
  • +
    +
    + + + Pregnancy_Horrible_NonPregnant_Social + RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social + Thought_SituationalSocial + +
  • + + -5 +
  • +
    +
    + +
    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/IdeologyAddon.csproj b/Source/IdeologyAddon/IdeologyAddon.csproj index 1ea925e..90a125c 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