Move disable Mtb functionality to PreceptComp_UnwillingToDo

This commit is contained in:
amevarashi 2022-07-08 19:37:10 +05:00
parent 6941293212
commit 85ed241217
4 changed files with 12 additions and 10 deletions

View File

@ -43,9 +43,6 @@ namespace RJWSexperience.Ideology
if (defExtension == null)
continue;
if (defExtension.disable)
return -1f;
finalMultiplier *= defExtension.multiplier;
}
return finalMultiplier;

View File

@ -11,8 +11,15 @@ namespace RJWSexperience.Ideology.Patches
{
public static void Postfix(Pawn pawn, ref float __result)
{
if (__result > 0f && pawn.Ideo != null) // ideo is null if don't have dlc
__result *= IdeoUtility.GetPreceptsMtbMultiplier<DefExtension_ModifyBestialityMtb>(pawn.Ideo);
if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc
return;
if (!VariousDefOf.RSI_SexWithAnimal.CreateEvent(pawn).DoerWillingToDo())
{
__result = -2f;
return;
}
__result *= IdeoUtility.GetPreceptsMtbMultiplier<DefExtension_ModifyBestialityMtb>(pawn.Ideo);
}
}

View File

@ -7,7 +7,5 @@ namespace RJWSexperience.Ideology.Precepts
{
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public float multiplier = 1f;
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public bool disable = false;
}
}

View File

@ -88,6 +88,9 @@
<li>HumanPrimacy</li>
</associatedMemes>
<comps>
<li Class="PreceptComp_UnwillingToDo">
<eventDef>RSI_SexWithAnimal</eventDef>
</li>
<li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>RSI_SexWithVeneratedAnimal</eventDef>
<thought>Bestiality_Abhorrent</thought>
@ -116,9 +119,6 @@
</li>
</rules>
</li>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyBestialityMtb">
<disable>true</disable>
</li>
</modExtensions>
</PreceptDef>