Compare commits

...

7 Commits

Author SHA1 Message Date
amevarashi 075260f091 Fix folders and namespaces (except for the Rituals) 2022-10-14 21:35:31 +05:00
amevarashi 17a8264b49 Flip GenitalSize_Disapproved_Social stages 2022-10-14 21:18:24 +05:00
amevarashi 8da97c4833 Refactor genital size ThoughtWorkers to use ThoughtDefExtension_StageFromValue 2022-10-14 21:09:19 +05:00
amevarashi 5db34c0c1f Refactor ThoughtDefExtension_StageFromOpinion 2022-10-14 20:57:17 +05:00
amevarashi eda7261968 Sort out the pregnancy precepts 2022-10-14 19:29:11 +05:00
amevarashi c00a872b81 Fix load errors 2022-10-11 21:00:48 +05:00
amevarashi 4949c3694b Make masochists not immune to "not obedient" penalty 2022-10-10 20:15:44 +05:00
61 changed files with 299 additions and 428 deletions

View File

@ -86,7 +86,7 @@
<impact>Low</impact>
<displayOrderInIssue>50</displayOrderInIssue>
<label>horrible</label>
<description>Being Pregnant is unclean. Take care and stay pure. </description>
<description>Being Pregnant is unclean. Take care and stay pure.</description>
<comps>
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_Pregnant</thought>
@ -94,7 +94,6 @@
<li Class="PreceptComp_SituationalThought">
<thought>Pregnancy_Horrible_Pregnant_Social</thought>
</li>
<comps>
</comps>
</PreceptDef>
@ -102,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>
@ -115,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>
@ -128,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>
@ -140,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>
@ -152,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>
@ -164,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>
@ -178,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>
@ -192,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>
@ -202,4 +203,4 @@
</stages>
</ThoughtDef>
</Defs>
</Defs>

View File

@ -288,7 +288,7 @@
<defName>Sex_Promiscuous</defName>
<durationDays>1</durationDays>
<stackLimit>1</stackLimit>
<thoughtClass>RJWSexperience.Thought_IncreaseRecord</thoughtClass>
<thoughtClass>RJWSexperience.Ideology.Thought_IncreaseRecord</thoughtClass>
<stages>
<li>
<label>promiscuous sex</label>
@ -297,7 +297,7 @@
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.ThoughtDefExtension_IncreaseRecord" MayRequire="rjw.sexperience">
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_IncreaseRecord" MayRequire="rjw.sexperience">
<recordDef>Lust</recordDef>
<increment>3.0</increment>
</li>

View File

@ -63,7 +63,7 @@
<ThoughtDef>
<defName>GenitalSize_Approved</defName>
<thoughtClass>Thought_Situational</thoughtClass>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Approved</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_GenitalSize</workerClass>
<stages>
<li>
<label>Despised Genitalsize</label>
@ -91,11 +91,24 @@
<baseMoodEffect>+10</baseMoodEffect>
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<!-- 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) -->
<minimumValueforStage>
<li>0</li>
<li>0.2</li>
<li>0.4</li>
<li>0.6</li>
<li>0.8</li>
</minimumValueforStage>
</li>
</modExtensions>
</ThoughtDef>
<ThoughtDef>
<defName>GenitalSize_Disapproved</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_GenitalSize</workerClass>
<thoughtClass>Thought_Situational</thoughtClass>
<stages>
<li>
@ -124,13 +137,26 @@
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<!-- 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) -->
<minimumValueforStage>
<li>0</li>
<li>0.2</li>
<li>0.4</li>
<li>0.6</li>
<li>0.8</li>
</minimumValueforStage>
</li>
</modExtensions>
</ThoughtDef>
<!-- Social-Thoughts (Opinion)-->
<ThoughtDef>
<defName>GenitalSize_Approved_Social</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Approved_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_GenitalSize_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
@ -146,27 +172,48 @@
<baseOpinionOffset>+5</baseOpinionOffset>
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<!-- We have 3 stages, which map directly to genitalia severity:
Unfavorable(<0.4), Normal(>0.4&&<0.6), Favorable(>0.6) -->
<minimumValueforStage>
<li>0</li>
<li>0.4</li>
<li>0.6</li>
</minimumValueforStage>
</li>
</modExtensions>
</ThoughtDef>
<ThoughtDef>
<defName>GenitalSize_Disapproved_Social</defName>
<workerClass>RJWSexperience.Ideology.ThoughtWorker_Precept_GenitalSize_Disapproved_Social</workerClass>
<workerClass>RJWSexperience.Ideology.PreceptWorkers.ThoughtWorker_Precept_GenitalSize_Social</workerClass>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<stages>
<li>
<label>Unwanted Genitals</label>
<baseOpinionOffset>-5</baseOpinionOffset>
<label>Favorable Genitals</label>
<baseOpinionOffset>+5</baseOpinionOffset>
</li>
<li>
<label>Normal Genitals</label>
<baseOpinionOffset>0</baseOpinionOffset>
</li>
<li>
<label>Favorable Genitals</label>
<baseOpinionOffset>+5</baseOpinionOffset>
<label>Unwanted Genitals</label>
<baseOpinionOffset>-5</baseOpinionOffset>
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<!-- We have 3 stages, which map directly to genitalia severity:
Favorable(<0.4), Normal(>0.4&&<0.6), Unfavorable(>0.6) -->
<minimumValueforStage>
<li>0</li>
<li>0.4</li>
<li>0.6</li>
</minimumValueforStage>
</li>
</modExtensions>
</ThoughtDef>
</Defs>

View File

@ -194,9 +194,6 @@
<durationDays>15</durationDays>
<stackLimit>100</stackLimit>
<stackLimitForSameOtherPawn>3</stackLimitForSameOtherPawn>
<nullifyingTraits>
<li>Masochist</li>
</nullifyingTraits>
<stages>
<li>
<label>not obedient</label>

View File

@ -270,7 +270,7 @@
<ThoughtDef>
<defName>Virgin_Precious_Taken</defName>
<thoughtClass>RJWSexperience.Thought_Opinionbased</thoughtClass>
<thoughtClass>RJWSexperience.Ideology.Thought_Opinionbased</thoughtClass>
<durationDays>7</durationDays>
<stackLimit>1</stackLimit>
<stages>
@ -296,7 +296,7 @@
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.ThoughtDefExtension_StageFromOpinion">
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<minimumValueforStage>
<li>-100</li>
<li>-50</li>
@ -309,7 +309,7 @@
<ThoughtDef>
<defName>Virgin_Shameful_Taken</defName>
<thoughtClass>RJWSexperience.Thought_Opinionbased</thoughtClass>
<thoughtClass>RJWSexperience.Ideology.Thought_Opinionbased</thoughtClass>
<durationDays>7</durationDays>
<stackLimit>1</stackLimit>
<stages>
@ -330,7 +330,7 @@
</li>
</stages>
<modExtensions>
<li Class="RJWSexperience.ThoughtDefExtension_StageFromOpinion">
<li Class="RJWSexperience.Ideology.ThoughtDefExtension_StageFromValue">
<minimumValueforStage>
<li>-100</li>
<li>0</li>

View File

@ -1,31 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,32 +0,0 @@
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

@ -1,28 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,28 +0,0 @@
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

@ -1,30 +0,0 @@

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

@ -1,29 +0,0 @@
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

@ -1,54 +0,0 @@
using RimWorld;
using Verse;
namespace RJWSexperience.Ideology
{
public class Thought_IncreaseRecord : Thought_Recordbased
{
protected float recordIncrement;
public override void ExposeData()
{
base.ExposeData();
Scribe_Values.Look(ref recordIncrement, "recordIncrement", recordIncrement, true);
}
public override void ThoughtInterval()
{
base.ThoughtInterval();
if (recordIncrement != 0)
{
pawn.records.AddTo(RecordDef, recordIncrement);
recordIncrement = 0;
}
}
public override bool TryMergeWithExistingMemory(out bool showBubble)
{
ThoughtHandler thoughts = pawn.needs.mood.thoughts;
if (thoughts.memories.NumMemoriesInGroup(this) >= def.stackLimit)
{
Thought_IncreaseRecord thought_Memory = (Thought_IncreaseRecord)thoughts.memories.OldestMemoryInGroup(this);
if (thought_Memory != null)
{
showBubble = (thought_Memory.age > thought_Memory.def.DurationTicks / 2);
thought_Memory.Merged();
return true;
}
}
showBubble = true;
return false;
}
public override void Init()
{
base.Init();
recordIncrement = Def.increment;
}
protected virtual void Merged()
{
age = 0;
recordIncrement += Def.increment;
}
}
}

View File

@ -1,38 +0,0 @@
using RimWorld;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace RJWSexperience.Ideology
{
/// <summary>
/// ThoughtDef using opinion
/// </summary>
public class ThoughtDef_Opinionbased : ThoughtDef
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<float> minimumValueforStage = new List<float>();
}
/// <summary>
/// Thought class using record.
/// </summary>
public class Thought_Opinionbased : Thought_Memory
{
protected ThoughtDef_Opinionbased Def => (ThoughtDef_Opinionbased)def;
protected List<float> MinimumValueforStage => Def.minimumValueforStage;
public override int CurStageIndex
{
get
{
float value = 0f;
if (otherPawn != null) value = pawn.relations?.OpinionOf(otherPawn) ?? 0f;
for (int i = MinimumValueforStage.Count - 1; i > 0; i--)
{
if (MinimumValueforStage[i] < value) return i;
}
return 0;
}
}
}
}

View File

@ -32,7 +32,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="RJW">
<HintPath>..\..\..\rjw-vegapnk\1.3\Assemblies\RJW.dll</HintPath>
<HintPath>..\..\..\rjw\1.3\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
@ -43,55 +44,53 @@
<ItemGroup>
<Compile Include="DebugAction.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Ideology\HistoryEvents\DefExtension_SecondaryEvents.cs" />
<Compile Include="Ideology\HistoryEvents\DefExtension_EventOverrides.cs" />
<Compile Include="Ideology\HistoryEvents\TwoPawnEventRule.cs" />
<Compile Include="Ideology\InteractionDefExtension_HistoryEvents.cs" />
<Compile Include="Ideology\GoodwillSituationWorker_MemeCompatibility.cs" />
<Compile Include="HistoryEvents\DefExtension_SecondaryEvents.cs" />
<Compile Include="HistoryEvents\DefExtension_EventOverrides.cs" />
<Compile Include="HistoryEvents\TwoPawnEventRule.cs" />
<Compile Include="InteractionDefExtension_HistoryEvents.cs" />
<Compile Include="GoodwillSituationWorker_MemeCompatibility.cs" />
<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" />
<Compile Include="Ideology\SinglePawnFilter.cs" />
<Compile Include="Ideology\Precepts\Comp_SelfTookMemoryThought_Gendered.cs" />
<Compile Include="Ideology\Precepts\Comp_KnowsMemoryThought_Gendered.cs" />
<Compile Include="Ideology\HistoryEvents\HistoryEventDefExtensionMethods.cs" />
<Compile Include="Ideology\Patches\RJW_Patch_ChancePerHour.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyMtb.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyFappinMtb.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyRapeCPMtb.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyNecroMtb.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyBestialityMtb.cs" />
<Compile Include="Ideology\Precepts\DefExtension_ModifyPreference.cs" />
<Compile Include="Ideology\Precepts\DefExtension_MultipleMemesRequired.cs" />
<Compile Include="Ideology\Rituals\JobGiver_GangbangConsensual.cs" />
<Compile Include="Ideology\Rituals\LordJob_Rituals.cs" />
<Compile Include="Ideology\Patches\RJW_Patch_Ideo.cs" />
<Compile Include="Ideology\Patches\Sexperience_Patch.cs" />
<Compile Include="HistoryEvents\ArgsNamesCustom.cs" />
<Compile Include="Keyed.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_GenitalSize.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Social.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_NonPregnant.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_NonPregnant_Social.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_Pregnant.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_Pregnant_Social.cs" />
<Compile Include="RelationFilter.cs" />
<Compile Include="RsiHistoryEventDefOf.cs" />
<Compile Include="TwoPawnFilter.cs" />
<Compile Include="SinglePawnFilter.cs" />
<Compile Include="Precepts\Comp_SelfTookMemoryThought_Gendered.cs" />
<Compile Include="Precepts\Comp_KnowsMemoryThought_Gendered.cs" />
<Compile Include="HistoryEvents\HistoryEventDefExtensionMethods.cs" />
<Compile Include="Patches\RJW_Patch_ChancePerHour.cs" />
<Compile Include="Precepts\DefExtension_ModifyMtb.cs" />
<Compile Include="Precepts\DefExtension_ModifyFappinMtb.cs" />
<Compile Include="Precepts\DefExtension_ModifyRapeCPMtb.cs" />
<Compile Include="Precepts\DefExtension_ModifyNecroMtb.cs" />
<Compile Include="Precepts\DefExtension_ModifyBestialityMtb.cs" />
<Compile Include="Precepts\DefExtension_ModifyPreference.cs" />
<Compile Include="Precepts\DefExtension_MultipleMemesRequired.cs" />
<Compile Include="Rituals\JobGiver_GangbangConsensual.cs" />
<Compile Include="Rituals\LordJob_Rituals.cs" />
<Compile Include="Patches\RJW_Patch_Ideo.cs" />
<Compile Include="Patches\Sexperience_Patch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Ideology\Patches\Rimworld_Patch.cs" />
<Compile Include="Ideology\Rituals\JobGiver_DrugOrgy.cs" />
<Compile Include="Ideology\Rituals\JobGiver_GangbangVictim.cs" />
<Compile Include="Ideology\Rituals\RitualBehaviorWorkers.cs" />
<Compile Include="Ideology\Rituals\RitualOutcomeComps.cs" />
<Compile Include="Ideology\Rituals\RitualRoles.cs" />
<Compile Include="Ideology\StatParts.cs" />
<Compile Include="Ideology\IdeoUtility.cs" />
<Compile Include="Patches\Rimworld_Patch.cs" />
<Compile Include="Rituals\JobGiver_DrugOrgy.cs" />
<Compile Include="Rituals\JobGiver_GangbangVictim.cs" />
<Compile Include="Rituals\RitualBehaviorWorkers.cs" />
<Compile Include="Rituals\RitualOutcomeComps.cs" />
<Compile Include="Rituals\RitualRoles.cs" />
<Compile Include="StatParts.cs" />
<Compile Include="IdeoUtility.cs" />
<Compile Include="Thoughts\ThoughtDefExtension_IncreaseRecord.cs" />
<Compile Include="Thoughts\ThoughtDefExtension_StageFromOpinion.cs" />
<Compile Include="Thoughts\ThoughtDefExtension_StageFromValue.cs" />
<Compile Include="Thoughts\Thought_IncreaseRecord.cs" />
<Compile Include="Thoughts\Thought_Opinionbased.cs" />
<Compile Include="Ideology\VariousDefOf.cs" />
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">

View File

@ -1,6 +1,6 @@
using Verse;
namespace RJWSexperience
namespace RJWSexperience.Ideology
{
public static class Keyed
{

View File

@ -0,0 +1,34 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
{
public class ThoughtWorker_Precept_GenitalSize : ThoughtWorker_Precept
{
private ThoughtDefExtension_StageFromValue stageFromValue;
protected ThoughtDefExtension_StageFromValue StageFromValue
{
get
{
if (stageFromValue == null)
{
stageFromValue = def.GetModExtension<ThoughtDefExtension_StageFromValue>();
}
return stageFromValue;
}
}
protected override ThoughtState ShouldHaveThought(Pawn p)
{
if (p != null && Genital_Helper.get_AllPartsHediffList(p).Count > 0)
{
float bestSize = IdeoUtility.getGenitalSize(p);
return ThoughtState.ActiveAtStage(StageFromValue.GetStageIndex(bestSize));
}
// This might can happen if the pawn has no genitalia ... maybe?
return ThoughtState.Inactive;
}
}
}

View File

@ -0,0 +1,35 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
{
public class ThoughtWorker_Precept_GenitalSize_Social : ThoughtWorker_Precept_Social
{
private ThoughtDefExtension_StageFromValue stageFromValue;
protected ThoughtDefExtension_StageFromValue StageFromValue
{
get
{
if (stageFromValue == null)
{
stageFromValue = def.GetModExtension<ThoughtDefExtension_StageFromValue>();
}
return stageFromValue;
}
}
// Important Note: For the Social Worker, we measure otherPawns genitalia
protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
{
if (otherPawn != null && Genital_Helper.get_AllPartsHediffList(otherPawn).Count > 0)
{
float bestSize = IdeoUtility.getGenitalSize(otherPawn);
return ThoughtState.ActiveAtStage(StageFromValue.GetStageIndex(bestSize));
}
// This might can happen if the pawn has no genitalia ... maybe?
return ThoughtState.Inactive;
}
}
}

View File

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

View File

@ -0,0 +1,22 @@
using RimWorld;
using rjw;
using Verse;
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_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

@ -0,0 +1,21 @@
using RimWorld;
using rjw;
using Verse;
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)
{
return PregnancyHelper.GetPregnancy(p)?.Visible == true;
}
}
}

View File

@ -0,0 +1,22 @@
using RimWorld;
using rjw;
using Verse;
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;
}
}
}

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience
namespace RJWSexperience.Ideology
{
public class ThoughtDefExtension_IncreaseRecord : DefModExtension
{

View File

@ -2,13 +2,26 @@
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience
namespace RJWSexperience.Ideology
{
public class ThoughtDefExtension_StageFromOpinion : DefModExtension
public class ThoughtDefExtension_StageFromValue : DefModExtension
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<float> minimumValueforStage = new List<float>();
public int GetStageIndex(float value)
{
for (int i = minimumValueforStage.Count - 1; i > 0; i--)
{
if (minimumValueforStage[i] < value)
{
return i;
}
}
return 0;
}
public override IEnumerable<string> ConfigErrors()
{
foreach (string error in base.ConfigErrors())

View File

@ -1,6 +1,6 @@
using RimWorld;
namespace RJWSexperience
namespace RJWSexperience.Ideology
{
/// <summary>
/// Increments record every time the thought is added

View File

@ -1,22 +1,21 @@
using RimWorld;
using System.Collections.Generic;
using Verse;
namespace RJWSexperience
namespace RJWSexperience.Ideology
{
public class Thought_Opinionbased : Thought_Memory
{
private List<float> minimumValueforStage;
private ThoughtDefExtension_StageFromValue stageFromValue;
protected List<float> MinimumValueforStage
protected ThoughtDefExtension_StageFromValue StageFromValue
{
get
{
if (minimumValueforStage == null)
if (stageFromValue == null)
{
minimumValueforStage = def.GetModExtension<ThoughtDefExtension_StageFromOpinion>().minimumValueforStage;
stageFromValue = def.GetModExtension<ThoughtDefExtension_StageFromValue>();
}
return minimumValueforStage;
return stageFromValue;
}
}
@ -47,16 +46,7 @@ namespace RJWSexperience
}
float value = pawn.relations?.OpinionOf(otherPawn) ?? 0f;
for (int i = MinimumValueforStage.Count - 1; i > 0; i--)
{
if (MinimumValueforStage[i] < value)
{
SetForcedStage(i);
return;
}
}
SetForcedStage(0);
SetForcedStage(StageFromValue.GetStageIndex(value));
}
}
}

View File

@ -22,9 +22,6 @@ namespace RJWSexperience.Ideology
[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;
//[MayRequireIdeology] public static readonly PreceptDef Proselyzing_By_Sex;
}
}