From eda7261968c95c73efc48a51fb194c137954b41c Mon Sep 17 00:00:00 2001 From: amevarashi Date: Fri, 14 Oct 2022 19:29:11 +0500 Subject: [PATCH] Sort out the pregnancy precepts --- 1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml | 20 +++++---- .../ThoughtWorker_Precept_NonPregnant.cs | 40 +++++++---------- ...houghtWorker_Precept_NonPregnant_Social.cs | 40 ++++++++--------- .../ThoughtWorker_Precept_Pregnant.cs | 43 ++++++++----------- .../ThoughtWorker_Precept_Pregnant_Social.cs | 43 ++++++++----------- 5 files changed, 79 insertions(+), 107 deletions(-) diff --git a/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml b/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml index 334f3f7..7e5b69f 100644 --- a/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml +++ b/1.3/Defs/PreceptDefs/Precepts_Pregnancy.xml @@ -101,7 +101,7 @@ Pregnancy_Respected_Pregnant - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant Thought_Situational
  • @@ -114,7 +114,7 @@ Pregnancy_Elevated_Pregnant - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant Thought_Situational
  • @@ -127,7 +127,7 @@ Pregnancy_Respected_Pregnant_Social - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social Thought_SituationalSocial
  • @@ -139,7 +139,7 @@ Pregnancy_Elevated_Pregnant_Social - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social Thought_SituationalSocial
  • @@ -151,7 +151,7 @@ Pregnancy_Horrible_Pregnant_Social - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social Thought_SituationalSocial
  • @@ -163,7 +163,7 @@ Pregnancy_Horrible_Pregnant - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant Thought_Situational
  • @@ -177,9 +177,10 @@ Pregnancy_Horrible_NonPregnant - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_NonPregnant Thought_Situational true + Female
  • @@ -191,8 +192,9 @@ Pregnancy_Horrible_NonPregnant_Social - RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social + RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_NonPregnant_Social Thought_SituationalSocial + Female
  • @@ -201,4 +203,4 @@ - + \ No newline at end of file diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs index 118d2bd..3631cdf 100644 --- a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs +++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant.cs @@ -1,29 +1,21 @@ using RimWorld; -using Verse; using rjw; +using Verse; -namespace RJWSexperience.Ideology.Ideology.Precept_Workers +namespace RJWSexperience.Ideology.PreceptWorkers { - /// - /// 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); - } - } + /// + /// 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) + { + return PregnancyHelper.GetPregnancy(p)?.Visible != true; + } + } } diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs index 68ed70b..d12f74a 100644 --- a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs +++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_NonPregnant_Social.cs @@ -1,28 +1,22 @@ using RimWorld; -using Verse; using rjw; +using Verse; -namespace RJWSexperience.Ideology.Ideology.Precept_Workers +namespace RJWSexperience.Ideology.PreceptWorkers { - /// - /// 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); - } - } + /// + /// 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_Social + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// The pawn about whom the thoughts are generated. + /// + protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn) + { + return PregnancyHelper.GetPregnancy(otherPawn)?.Visible != true; + } + } } diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs index fab5f90..ae3d917 100644 --- a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs +++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant.cs @@ -1,30 +1,21 @@ - -using RimWorld; -using Verse; +using RimWorld; using rjw; +using Verse; -namespace RJWSexperience.Ideology.Ideology.Precept_Workers +namespace RJWSexperience.Ideology.PreceptWorkers { - /// - /// 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); - } - } + /// + /// 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) + { + return PregnancyHelper.GetPregnancy(p)?.Visible == true; + } + } } diff --git a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs index b1cdaa0..c54b814 100644 --- a/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs +++ b/Source/IdeologyAddon/Ideology/PreceptWorkers/ThoughtWorker_Precept_Pregnant_Social.cs @@ -1,29 +1,22 @@ using RimWorld; -using Verse; using rjw; +using Verse; -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); - } - } +namespace RJWSexperience.Ideology.PreceptWorkers +{ + /// + /// 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_Social + { + /// Gets the current thought state of the given pawn. + /// The pawn for whom the thoughts are generated. + /// The pawn about whom the thoughts are generated. + /// + protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn) + { + return PregnancyHelper.GetPregnancy(otherPawn)?.Visible == true; + } + } }