From fd61548f84aed38a3993a4e9e4b5fcfb85f711d6 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Tue, 17 May 2022 21:56:27 +0200 Subject: [PATCH 1/3] Trying to add a Pregnancy Precept - not showing up yet --- .../ThoughtWorker_Precept_NonPregnant.cs | 29 +++ ...houghtWorker_Precept_NonPregnant_Social.cs | 28 +++ .../ThoughtWorker_Precept_Pregnant.cs | 30 +++ .../ThoughtWorker_Precept_Pregnant_Social.cs | 29 +++ .../Defs/PreceptDefs/Precepts_Pregnancy.xml | 208 ++++++++++++++++++ 5 files changed, 324 insertions(+) create mode 100644 RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs create mode 100644 RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs create mode 100644 RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs create mode 100644 RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs create mode 100644 RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs new file mode 100644 index 0000000..696c385 --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/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 + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// + protected override ThoughtState CurrentStateInternal(Pawn p) + { + + var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); + + if (pregnancy == null) + { + return false; + } + + return ThoughtState.ActiveAtStage(0); + } + } +} diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs new file mode 100644 index 0000000..e8efa9a --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/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 + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// + protected override ThoughtState CurrentStateInternal(Pawn p) + { + + var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); + + if (pregnancy != null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + { + return false; + } else + return ThoughtState.ActiveAtStage(0); + } + } +} diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs new file mode 100644 index 0000000..7384c8a --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/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 + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// + protected override ThoughtState CurrentStateInternal(Pawn p) + { + + var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); + + if (pregnancy == null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + { + return false; + } + + return ThoughtState.ActiveAtStage(0); + } + } +} diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs new file mode 100644 index 0000000..8204a09 --- /dev/null +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/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 + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// + protected override ThoughtState CurrentStateInternal(Pawn p) + { + + var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); + + if (pregnancy == null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + { + return false; + } + + return ThoughtState.ActiveAtStage(0); + } + } +} diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml new file mode 100644 index 0000000..d00f70e --- /dev/null +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml @@ -0,0 +1,208 @@ + + + + + + + + + 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 + +
  • Blindsight
  • +
    + +
  • + 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 +
  • +
    +
    + +
    From a8dc448202fcd5a947b9bc44aa9bcb0674bf56f1 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Tue, 17 May 2022 22:10:42 +0200 Subject: [PATCH 2/3] WIP on Pregnancy Precept --- .../ThoughtWorker_Precept_NonPregnant.cs | 6 +++--- .../ThoughtWorker_Precept_NonPregnant_Social.cs | 8 ++++---- .../Precept_Workers/ThoughtWorker_Precept_Pregnant.cs | 8 ++++---- .../ThoughtWorker_Precept_Pregnant_Social.cs | 8 ++++---- RJWSexperience/IdeologyAddon/IdeologyAddon.csproj | 10 ++++++---- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs index 696c385..118d2bd 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant.cs @@ -8,19 +8,19 @@ 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 + 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 CurrentStateInternal(Pawn p) + protected override ThoughtState ShouldHaveThought(Pawn p) { var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); if (pregnancy == null) { - return false; + return ThoughtState.Inactive; } return ThoughtState.ActiveAtStage(0); diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs index e8efa9a..68ed70b 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_NonPregnant_Social.cs @@ -8,19 +8,19 @@ 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 + 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 CurrentStateInternal(Pawn p) + protected override ThoughtState ShouldHaveThought(Pawn p) { var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); - if (pregnancy != null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + if (pregnancy != null) { - return false; + return ThoughtState.Inactive; } else return ThoughtState.ActiveAtStage(0); } diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs index 7384c8a..fab5f90 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant.cs @@ -9,19 +9,19 @@ 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 + 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 CurrentStateInternal(Pawn p) + protected override ThoughtState ShouldHaveThought(Pawn p) { var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); - if (pregnancy == null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + if (pregnancy == null) { - return false; + return ThoughtState.Inactive; } return ThoughtState.ActiveAtStage(0); diff --git a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs index 8204a09..b1cdaa0 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Precept_Workers/ThoughtWorker_Precept_Pregnant_Social.cs @@ -8,19 +8,19 @@ 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 + 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 CurrentStateInternal(Pawn p) + protected override ThoughtState ShouldHaveThought(Pawn p) { var pregnancy = rjw.PregnancyHelper.GetPregnancy(p); - if (pregnancy == null) //ignoring the hediff's stage, the thought's stage is dependent on only the ether state of the pawn c + if (pregnancy == null) { - return false; + return ThoughtState.Inactive; } return ThoughtState.ActiveAtStage(0); diff --git a/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj b/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj index 620b567..96460c9 100644 --- a/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj +++ b/RJWSexperience/IdeologyAddon/IdeologyAddon.csproj @@ -36,12 +36,10 @@ False - D:\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - False + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - ..\..\..\rjw\1.3\Assemblies\RJW.dll - False + ..\..\..\rjw-vegapnk\1.3\Assemblies\RJW.dll @@ -62,6 +60,10 @@ + + + + From ec3ffc7b70cc61ed56b26a0524bc841c0001b493 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Fri, 20 May 2022 20:25:25 +0200 Subject: [PATCH 3/3] Typos --- .../Defs/PreceptDefs/Precepts_Pregnancy.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml index d00f70e..4b1e67a 100644 --- a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Pregnancy.xml @@ -36,9 +36,6 @@ Being pregnant is considered noble. Low 20 - -
  • Blindsight
  • -
  • Pregnancy_Elevated_Pregnant