Sort out the pregnancy precepts

This commit is contained in:
amevarashi 2022-10-14 19:29:11 +05:00
parent c00a872b81
commit eda7261968
5 changed files with 79 additions and 107 deletions

View file

@ -101,7 +101,7 @@
<ThoughtDef>
<defName>Pregnancy_Respected_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
@ -114,7 +114,7 @@
<ThoughtDef>
<defName>Pregnancy_Elevated_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
@ -127,7 +127,7 @@
<ThoughtDef>
<defName>Pregnancy_Respected_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
@ -139,7 +139,7 @@
<ThoughtDef>
<defName>Pregnancy_Elevated_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
@ -151,7 +151,7 @@
<ThoughtDef>
<defName>Pregnancy_Horrible_Pregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
@ -163,7 +163,7 @@
<ThoughtDef>
<defName>Pregnancy_Horrible_Pregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_Pregnant</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_Pregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
@ -177,9 +177,10 @@
<!-- Thoughts: Not Pregnant -->
<ThoughtDef>
<defName>Pregnancy_Horrible_NonPregnant</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_NonPregnant</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<doNotApplyToQuestLodgers>true</doNotApplyToQuestLodgers>
<gender>Female</gender>
<stages>
<li>
<label>not pregnant</label>
@ -191,8 +192,9 @@
<ThoughtDef>
<defName>Pregnancy_Horrible_NonPregnant_Social</defName>
<workerClass>RJWSexperience.Ideology.Ideology.Precept_Workers.ThoughtWorker_Precept_NonPregnant_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_NonPregnant_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<gender>Female</gender>
<stages>
<li>
<label>unfertilized</label>
@ -201,4 +203,4 @@
</stages>
</ThoughtDef>
</Defs>
</Defs>

View file

@ -1,29 +1,21 @@
using RimWorld;
using Verse;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
namespace RJWSexperience.Ideology.PreceptWorkers
{
/// <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);
}
}
/// <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)
{
return PregnancyHelper.GetPregnancy(p)?.Visible != true;
}
}
}

View file

@ -1,28 +1,22 @@
using RimWorld;
using Verse;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
namespace RJWSexperience.Ideology.PreceptWorkers
{
/// <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);
}
}
/// <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_Social
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <param name="otherPawn">The pawn about whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
{
return PregnancyHelper.GetPregnancy(otherPawn)?.Visible != true;
}
}
}

View file

@ -1,30 +1,21 @@

using RimWorld;
using Verse;
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.Ideology.Precept_Workers
namespace RJWSexperience.Ideology.PreceptWorkers
{
/// <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);
}
}
/// <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)
{
return PregnancyHelper.GetPregnancy(p)?.Visible == true;
}
}
}

View file

@ -1,29 +1,22 @@
using RimWorld;
using Verse;
using rjw;
using Verse;
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);
}
}
namespace RJWSexperience.Ideology.PreceptWorkers
{
/// <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_Social
{
/// <summary>Gets the current thought state of the given pawn.</summary>
/// <param name="p">The pawn for whom the thoughts are generated.</param>
/// <param name="otherPawn">The pawn about whom the thoughts are generated.</param>
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
{
return PregnancyHelper.GetPregnancy(otherPawn)?.Visible == true;
}
}
}