Compare commits

...

2 commits

Author SHA1 Message Date
amevarashi
355d409eb6 Removed "not obedient" social thought for raping a slave 2022-11-23 20:12:13 +05:00
amevarashi
d33fa5e3ea Moved manual romance rules into XML 2022-11-23 19:42:47 +05:00
5 changed files with 46 additions and 22 deletions

View file

@ -111,6 +111,15 @@
<displayOrderInIssue>60</displayOrderInIssue>
<displayOrderInImpact>1000</displayOrderInImpact>
<defaultSelectionWeight>100</defaultSelectionWeight>
<modExtensions>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_Incest">
<allowManualRomanceOnlyFor>
<li>CloseRelative</li>
<li>FarRelative</li>
<li>NotRelated</li>
</allowManualRomanceOnlyFor>
</li>
</modExtensions>
</PreceptDef>
<PreceptDef>
@ -157,6 +166,12 @@
</li>
</rules>
</li>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_Incest">
<allowManualRomanceOnlyFor>
<li>FarRelative</li>
<li>NotRelated</li>
</allowManualRomanceOnlyFor>
</li>
</modExtensions>
</PreceptDef>
@ -275,6 +290,12 @@
</li>
</rules>
</li>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_Incest">
<allowManualRomanceOnlyFor>
<li>CloseRelative</li>
<li>FarRelative</li>
</allowManualRomanceOnlyFor>
</li>
</modExtensions>
</PreceptDef>

View file

@ -76,11 +76,11 @@
<thought>BeenRaped_NotSubmissive</thought>
<gender>Female</gender>
</li>
<li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<!--<li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<eventDef>RSI_RapedSlave</eventDef>
<thought>Raped_Know_NotBeingSubmissive</thought>
<doersGender>Male</doersGender>
</li>
</li>-->
</comps>
</PreceptDef>
@ -140,11 +140,11 @@
<thought>BeenRaped_NotSubmissive</thought>
<gender>Male</gender>
</li>
<li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<!--<li Class="RJWSexperience.Ideology.Precepts.Comp_KnowsMemoryThought_Gendered">
<eventDef>RSI_RapedSlave</eventDef>
<thought>Raped_Know_NotBeingSubmissive</thought>
<doersGender>Female</doersGender>
</li>
</li>-->
</comps>
</PreceptDef>

View file

@ -53,6 +53,7 @@
<Compile Include="Harmony.cs" />
<Compile Include="HistoryEvents\ArgsNamesCustom.cs" />
<Compile Include="Keyed.cs" />
<Compile Include="Precepts\DefExtension_Incest.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_GenitalSize.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Social.cs" />
<Compile Include="PreceptWorkers\ThoughtWorker_Precept_NonPregnant.cs" />
@ -98,7 +99,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">
<Version>1.4.3542</Version>
<Version>1.4.3555</Version>
</PackageReference>
<PackageReference Include="Lib.Harmony">
<Version>2.2.2</Version>

View file

@ -80,29 +80,15 @@ namespace RJWSexperience.Ideology.Patches
public static bool RsiIncestuous(Pawn one, Pawn two)
{
PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos);
var allowManualRomanceOnlyFor = incestuousPrecept?.GetModExtension<DefExtension_Incest>()?.allowManualRomanceOnlyFor;
BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two);
if (incestuousPrecept == null ||
incestuousPrecept == RsiPreceptDefOf.Incestuos_Disapproved ||
incestuousPrecept == RsiPreceptDefOf.Incestuos_Forbidden)
if (allowManualRomanceOnlyFor == null)
{
return relationDegree < BloodRelationDegree.NotRelated;
}
else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_Free)
{
return false;
}
else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_Disapproved_CloseOnly)
{
return relationDegree == BloodRelationDegree.CloseRelative;
}
else if (incestuousPrecept == RsiPreceptDefOf.Incestuos_IncestOnly)
{
return relationDegree == BloodRelationDegree.NotRelated;
}
// Modded incestuous precept?
return true;
return !allowManualRomanceOnlyFor.Contains(relationDegree);
}
}
}

View file

@ -0,0 +1,16 @@
using RJWSexperience.Ideology.Filters;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Verse;
namespace RJWSexperience.Ideology.Precepts
{
/// <summary>
/// Special Def extension for the Incestuous issue precepts
/// </summary>
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Def loader")]
public class DefExtension_Incest : DefModExtension
{
public List<BloodRelationDegree> allowManualRomanceOnlyFor;
}
}