Refactor Virginity precepts

This commit is contained in:
amevarashi 2022-07-08 22:48:57 +05:00
parent df4b55c460
commit b0f6e1d5b7
6 changed files with 90 additions and 96 deletions

View File

@ -15,9 +15,9 @@ namespace RJWSexperience.Ideology
if (ModLister.HasActiveModWithName("RJW Sexperience")) if (ModLister.HasActiveModWithName("RJW Sexperience"))
{ {
harmony.Patch(AccessTools.Method("RJWSexperience.RJWUtility:ThrowVirginHIstoryEvent"), harmony.Patch(AccessTools.Method("RJWSexperience.RJWUtility:ThrowVirginHistoryEvent"),
prefix: null, prefix: null,
postfix: new HarmonyMethod(typeof(Sexperience_Patch_ThrowVirginHIstoryEvent), nameof(Sexperience_Patch_ThrowVirginHIstoryEvent.Postfix)) postfix: new HarmonyMethod(typeof(Sexperience_Patch_ThrowVirginHistoryEvent), nameof(Sexperience_Patch_ThrowVirginHistoryEvent.Postfix))
); );
} }
} }

View File

@ -1,34 +1,21 @@
using RimWorld; using rjw;
using rjw;
using RJWSexperience.Ideology.HistoryEvents;
using Verse; using Verse;
namespace RJWSexperience.Ideology.Patches namespace RJWSexperience.Ideology.Patches
{ {
public static class Sexperience_Patch_ThrowVirginHIstoryEvent public static class Sexperience_Patch_ThrowVirginHistoryEvent
{ {
public static void Postfix(Pawn pawn, Pawn partner, SexProps props, int degree) public static void Postfix(Pawn exVirgin, Pawn partner, SexProps props, int degree)
{ {
string tag = ""; const int femaleAfterSurgery = 1;
if (props.isRape && pawn != props.pawn)
{
tag += Tag.BeenRaped;
}
if (!pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, partner))
{
tag += Tag.NotSpouse;
}
if (pawn.gender == Gender.Male) if (props.isRape && exVirgin == props.partner)
{ VariousDefOf.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner);
if (degree > 1) Find.HistoryEventsManager.RecordEvent(VariousDefOf.Virgin_TakenM.CreateTaggedEvent(pawn, tag + Tag.Gender(pawn), partner));
Find.HistoryEventsManager.RecordEvent(VariousDefOf.Virgin_TookM.CreateTaggedEvent(partner, tag + Tag.Gender(pawn), pawn)); if (degree != femaleAfterSurgery)
} VariousDefOf.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner);
else
{ VariousDefOf.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin);
if (degree > 1) Find.HistoryEventsManager.RecordEvent(VariousDefOf.Virgin_TakenF.CreateTaggedEvent(pawn, tag + Tag.Gender(pawn), partner));
Find.HistoryEventsManager.RecordEvent(VariousDefOf.Virgin_TookF.CreateTaggedEvent(partner, tag + Tag.Gender(pawn), pawn));
}
} }
} }
} }

View File

@ -24,10 +24,9 @@ namespace RJWSexperience.Ideology
[MayRequireIdeology] public static readonly HistoryEventDef RSI_NonIncestuosMarriage; [MayRequireIdeology] public static readonly HistoryEventDef RSI_NonIncestuosMarriage;
[MayRequireIdeology] public static readonly HistoryEventDef RSI_NonIncestuosSex; [MayRequireIdeology] public static readonly HistoryEventDef RSI_NonIncestuosSex;
[MayRequireIdeology] public static readonly HistoryEventDef SexWithCorpse; [MayRequireIdeology] public static readonly HistoryEventDef SexWithCorpse;
[MayRequireIdeology] public static readonly HistoryEventDef Virgin_TakenF; [MayRequireIdeology] public static readonly HistoryEventDef RSI_VirginTaken;
[MayRequireIdeology] public static readonly HistoryEventDef Virgin_TakenM; [MayRequireIdeology] public static readonly HistoryEventDef RSI_VirginStolen;
[MayRequireIdeology] public static readonly HistoryEventDef Virgin_TookF; [MayRequireIdeology] public static readonly HistoryEventDef RSI_TookVirgin;
[MayRequireIdeology] public static readonly HistoryEventDef Virgin_TookM;
[MayRequireIdeology] public static readonly PreceptDef Bestiality_OnlyVenerated; [MayRequireIdeology] public static readonly PreceptDef Bestiality_OnlyVenerated;
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysFather; [MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysFather;
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysColony; [MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysColony;

View File

@ -91,7 +91,7 @@ namespace RJWSexperience
} }
if (removedDegree != null) if (removedDegree != null)
RJWUtility.ThrowVirginHIstoryEvent(pawn, partner, props, (int)removedDegree); RJWUtility.ThrowVirginHistoryEvent(pawn, partner, props, (int)removedDegree);
} }
} }
} }

View File

@ -15,12 +15,12 @@ namespace RJWSexperience
/// For ideo patch /// For ideo patch
/// </summary> /// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1163:Unused parameter.", Justification = "All parameters are needed for the ideology patch")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1163:Unused parameter.", Justification = "All parameters are needed for the ideology patch")]
public static void ThrowVirginHIstoryEvent(Pawn pawn, Pawn partner, SexProps props, int degree) public static void ThrowVirginHistoryEvent(Pawn exVirgin, Pawn partner, SexProps props, int degree)
{ {
//for non-ideo //for non-ideo
if (partner.Ideo == null) if (partner.Ideo == null)
{ {
partner.needs?.mood?.thoughts?.memories.TryGainMemory(xxx.took_virginity, pawn); partner.needs?.mood?.thoughts?.memories.TryGainMemory(xxx.took_virginity, exVirgin);
} }
} }

View File

@ -14,23 +14,37 @@
</IssueDef> </IssueDef>
<HistoryEventDef> <HistoryEventDef>
<defName>Virgin_TakenF</defName> <defName>RSI_VirginTaken</defName>
<label>virgin taken</label> <label>virgin taken</label>
<modExtensions>
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentSecondaryEvents">
<generationRules>
<li>
<filter>
<hasNoneOfRelations>
<li>Spouse</li>
</hasNoneOfRelations>
</filter>
<historyEventDef>RSI_VirginTakenNotSpouse</historyEventDef>
</li>
</generationRules>
</li>
</modExtensions>
</HistoryEventDef> </HistoryEventDef>
<HistoryEventDef> <HistoryEventDef>
<defName>Virgin_TakenM</defName> <defName>RSI_TookVirgin</defName>
<label>virgin taken</label> <label>took virgin</label>
</HistoryEventDef> </HistoryEventDef>
<HistoryEventDef> <HistoryEventDef>
<defName>Virgin_TookF</defName> <defName>RSI_VirginStolen</defName>
<label>virgin took</label> <label>virgin stolen</label>
</HistoryEventDef> </HistoryEventDef>
<HistoryEventDef> <HistoryEventDef>
<defName>Virgin_TookM</defName> <defName>RSI_VirginTakenNotSpouse</defName>
<label>virgin took</label> <label>virgin was taken by a stranger</label>
</HistoryEventDef> </HistoryEventDef>
<!-- Precepts --> <!-- Precepts -->
@ -67,19 +81,18 @@
<displayOrderInImpact>1000</displayOrderInImpact> <displayOrderInImpact>1000</displayOrderInImpact>
<defaultSelectionWeight>80</defaultSelectionWeight> <defaultSelectionWeight>80</defaultSelectionWeight>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginStolen</eventDef>
<thought>Virgin_Precious_Taken_Forcefully</thought> <thought>Virgin_Precious_Taken_Forcefully</thought>
<tag>BeenRaped</tag> <gender>Female</gender>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Precious_Taken</thought> <thought>Virgin_Precious_Taken</thought>
<tag>BeenRaped</tag> <gender>Female</gender>
<exclusive>true</exclusive>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>Virgin_TookF</eventDef> <eventDef>RSI_TookVirgin</eventDef>
<thought>TookVirginity</thought> <thought>TookVirginity</thought>
</li> </li>
</comps> </comps>
@ -95,19 +108,18 @@
<displayOrderInImpact>1000</displayOrderInImpact> <displayOrderInImpact>1000</displayOrderInImpact>
<defaultSelectionWeight>1</defaultSelectionWeight> <defaultSelectionWeight>1</defaultSelectionWeight>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginStolen</eventDef>
<thought>Virgin_Precious_Taken_Forcefully</thought> <thought>Virgin_Precious_Taken_Forcefully</thought>
<tag>BeenRaped</tag> <gender>Male</gender>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Precious_Taken</thought> <thought>Virgin_Precious_Taken</thought>
<tag>BeenRaped</tag> <gender>Male</gender>
<exclusive>true</exclusive>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>Virgin_TookM</eventDef> <eventDef>RSI_TookVirgin</eventDef>
<thought>TookVirginity</thought> <thought>TookVirginity</thought>
</li> </li>
</comps> </comps>
@ -132,24 +144,23 @@
<li>MaleSupremacy</li> <li>MaleSupremacy</li>
</associatedMemes> </associatedMemes>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginStolen</eventDef>
<thought>Virgin_Precious_Taken_Forcefully</thought> <thought>Virgin_Precious_Taken_Forcefully</thought>
<tag>BeenRaped</tag> <gender>Female</gender>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Precious_Taken</thought> <thought>Virgin_Precious_Taken</thought>
<tag>BeenRaped</tag> <gender>Female</gender>
<exclusive>true</exclusive>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_KnowsMemoryThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginTakenNotSpouse</eventDef>
<thought>Virgin_OnlyForSpouse_Know_Taken</thought> <thought>Virgin_OnlyForSpouse_Know_Taken</thought>
<tag>Female, NotSpouse</tag> <doersGender>Female</doersGender>
</li> </li>
<li Class="PreceptComp_SelfTookMemoryThought"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>Virgin_TookF</eventDef> <eventDef>RSI_TookVirgin</eventDef>
<thought>TookVirginity</thought> <thought>TookVirginity</thought>
</li> </li>
</comps> </comps>
@ -174,24 +185,23 @@
<li>FemaleSupremacy</li> <li>FemaleSupremacy</li>
</associatedMemes> </associatedMemes>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginStolen</eventDef>
<thought>Virgin_Precious_Taken_Forcefully</thought> <thought>Virgin_Precious_Taken_Forcefully</thought>
<tag>BeenRaped</tag> <gender>Male</gender>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Precious_Taken</thought> <thought>Virgin_Precious_Taken</thought>
<tag>BeenRaped</tag> <gender>Male</gender>
<exclusive>true</exclusive>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_KnowsMemoryThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginTakenNotSpouse</eventDef>
<thought>Virgin_OnlyForSpouse_Know_Taken</thought> <thought>Virgin_OnlyForSpouse_Know_Taken</thought>
<tag>Male, NotSpouse</tag> <doersGender>Male</doersGender>
</li> </li>
<li Class="PreceptComp_SelfTookMemoryThought"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>Virgin_TookM</eventDef> <eventDef>RSI_TookVirgin</eventDef>
<thought>TookVirginity</thought> <thought>TookVirginity</thought>
</li> </li>
</comps> </comps>
@ -210,11 +220,10 @@
<li>FemaleSupremacy</li> <li>FemaleSupremacy</li>
</associatedMemes> </associatedMemes>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenF</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Shameful_Taken</thought> <thought>Virgin_Shameful_Taken</thought>
<tag>BeenRaped</tag> <gender>Female</gender>
<exclusive>true</exclusive>
</li> </li>
</comps> </comps>
</PreceptDef> </PreceptDef>
@ -232,11 +241,10 @@
<li>MaleSupremacy</li> <li>MaleSupremacy</li>
</associatedMemes> </associatedMemes>
<comps> <comps>
<li Class="RJWSexperience.Ideology.Precepts.PreceptComp_SelfTookThoughtTagged"> <li Class="RJWSexperience.Ideology.Precepts.Comp_SelfTookMemoryThought_Gendered">
<eventDef>Virgin_TakenM</eventDef> <eventDef>RSI_VirginTaken</eventDef>
<thought>Virgin_Shameful_Taken</thought> <thought>Virgin_Shameful_Taken</thought>
<tag>BeenRaped</tag> <gender>Male</gender>
<exclusive>true</exclusive>
</li> </li>
</comps> </comps>
</PreceptDef> </PreceptDef>
@ -250,8 +258,8 @@
<stackLimit>1</stackLimit> <stackLimit>1</stackLimit>
<stages> <stages>
<li> <li>
<label>Lost virginity</label> <label>Virginity stolen</label>
<description>I lost my virginity forcefully.</description> <description>My virginity was taken forcefully.</description>
<baseMoodEffect>-10</baseMoodEffect> <baseMoodEffect>-10</baseMoodEffect>
<baseOpinionOffset>-200</baseOpinionOffset> <baseOpinionOffset>-200</baseOpinionOffset>
</li> </li>
@ -265,17 +273,17 @@
<stackLimit>1</stackLimit> <stackLimit>1</stackLimit>
<stages> <stages>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>I am no longer virgin.</description> <description>I am no longer virgin.</description>
<baseMoodEffect>-5</baseMoodEffect> <baseMoodEffect>-5</baseMoodEffect>
</li> </li>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>I am no longer virgin.</description> <description>I am no longer virgin.</description>
<baseMoodEffect>-3</baseMoodEffect> <baseMoodEffect>-3</baseMoodEffect>
</li> </li>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>I am no longer virgin.</description> <description>I am no longer virgin.</description>
<baseMoodEffect>-1</baseMoodEffect> <baseMoodEffect>-1</baseMoodEffect>
</li> </li>
@ -304,17 +312,17 @@
<stackLimit>1</stackLimit> <stackLimit>1</stackLimit>
<stages> <stages>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>Finally!</description> <description>Finally!</description>
<baseMoodEffect>5</baseMoodEffect> <baseMoodEffect>5</baseMoodEffect>
</li> </li>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>Finally!</description> <description>Finally!</description>
<baseMoodEffect>10</baseMoodEffect> <baseMoodEffect>10</baseMoodEffect>
</li> </li>
<li> <li>
<label>Lost virginity by {0}</label> <label>Lost virginity to {0}</label>
<description>Finally!</description> <description>Finally!</description>
<baseMoodEffect>20</baseMoodEffect> <baseMoodEffect>20</baseMoodEffect>
</li> </li>