mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Rename HistoryEventDef mod extensions
This commit is contained in:
parent
b2e368bbe6
commit
baed7acc4c
9 changed files with 18 additions and 18 deletions
|
@ -4,9 +4,9 @@ using Verse;
|
|||
|
||||
namespace RJWSexperience.Ideology.HistoryEvents
|
||||
{
|
||||
public class DefExtension_PartnerDependentOverrides : DefModExtension
|
||||
public class DefExtension_EventOverrides : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public List<PartnerDependentRule> overrideRules = new List<PartnerDependentRule>();
|
||||
public List<TwoPawnEventRule> overrideRules = new List<TwoPawnEventRule>();
|
||||
}
|
||||
}
|
|
@ -4,9 +4,9 @@ using Verse;
|
|||
|
||||
namespace RJWSexperience.Ideology.HistoryEvents
|
||||
{
|
||||
public class DefExtension_PartnerDependentSecondaryEvents : DefModExtension
|
||||
public class DefExtension_SecondaryEvents : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public List<PartnerDependentRule> generationRules = new List<PartnerDependentRule>();
|
||||
public List<TwoPawnEventRule> generationRules = new List<TwoPawnEventRule>();
|
||||
}
|
||||
}
|
|
@ -7,11 +7,11 @@ namespace RJWSexperience.Ideology.HistoryEvents
|
|||
{
|
||||
public static void RecordEventWithPartner(this HistoryEventDef def, Pawn pawn, Pawn partner)
|
||||
{
|
||||
DefExtension_PartnerDependentSecondaryEvents secondaryEvents = def.GetModExtension<DefExtension_PartnerDependentSecondaryEvents>();
|
||||
DefExtension_SecondaryEvents secondaryEvents = def.GetModExtension<DefExtension_SecondaryEvents>();
|
||||
|
||||
if (secondaryEvents != null)
|
||||
{
|
||||
foreach (PartnerDependentRule rule in secondaryEvents.generationRules)
|
||||
foreach (TwoPawnEventRule rule in secondaryEvents.generationRules)
|
||||
{
|
||||
if (rule.Applies(pawn, partner))
|
||||
rule.historyEventDef.RecordEventWithPartner(pawn, partner);
|
||||
|
@ -28,12 +28,12 @@ namespace RJWSexperience.Ideology.HistoryEvents
|
|||
|
||||
public static HistoryEvent CreateEventWithPartner(this HistoryEventDef def, Pawn pawn, Pawn partner)
|
||||
{
|
||||
DefExtension_PartnerDependentOverrides overrides = def.GetModExtension<DefExtension_PartnerDependentOverrides>();
|
||||
DefExtension_EventOverrides overrides = def.GetModExtension<DefExtension_EventOverrides>();
|
||||
|
||||
if (overrides == null)
|
||||
return new HistoryEvent(def, pawn.Named(HistoryEventArgsNames.Doer), partner.Named(ArgsNamesCustom.Partner));
|
||||
|
||||
foreach (PartnerDependentRule rule in overrides.overrideRules)
|
||||
foreach (TwoPawnEventRule rule in overrides.overrideRules)
|
||||
{
|
||||
if (rule.Applies(pawn, partner))
|
||||
return rule.historyEventDef.CreateEventWithPartner(pawn, partner);
|
||||
|
|
|
@ -4,7 +4,7 @@ using Verse;
|
|||
|
||||
namespace RJWSexperience.Ideology.HistoryEvents
|
||||
{
|
||||
public class PartnerDependentRule
|
||||
public class TwoPawnEventRule
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public HistoryEventDef historyEventDef;
|
|
@ -43,9 +43,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Ideology\HistoryEvents\DefExtension_PartnerDependentSecondaryEvents.cs" />
|
||||
<Compile Include="Ideology\HistoryEvents\DefExtension_PartnerDependentOverrides.cs" />
|
||||
<Compile Include="Ideology\HistoryEvents\PartnerDependentRule.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="Harmony.cs" />
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<defName>RSI_SexWithAnimal</defName>
|
||||
<label>sex with animal</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentSecondaryEvents">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_SecondaryEvents">
|
||||
<generationRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<defName>RSI_NonIncestuosMarriage</defName>
|
||||
<label>Non-incestuos marriage</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentOverrides">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_EventOverrides">
|
||||
<overrideRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
@ -85,7 +85,7 @@
|
|||
<defName>RSI_NonIncestuosSex</defName>
|
||||
<label>Non-incestuos sex</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentOverrides">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_EventOverrides">
|
||||
<overrideRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<defName>RSI_Raped</defName>
|
||||
<label>raped</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentOverrides">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_EventOverrides">
|
||||
<overrideRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<defName>RSI_WasRaped</defName>
|
||||
<label>was raped</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentOverrides">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_EventOverrides">
|
||||
<overrideRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<defName>RSI_VirginTaken</defName>
|
||||
<label>virgin taken</label>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_PartnerDependentSecondaryEvents">
|
||||
<li Class="RJWSexperience.Ideology.HistoryEvents.DefExtension_SecondaryEvents">
|
||||
<generationRules>
|
||||
<li>
|
||||
<filter>
|
||||
|
|
Loading…
Reference in a new issue