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) if (defExtension == null)
continue; continue;
if (defExtension.disable)
return -1f;
finalMultiplier *= defExtension.multiplier; finalMultiplier *= defExtension.multiplier;
} }
return finalMultiplier; return finalMultiplier;

View file

@ -11,7 +11,14 @@ namespace RJWSexperience.Ideology.Patches
{ {
public static void Postfix(Pawn pawn, ref float __result) public static void Postfix(Pawn pawn, ref float __result)
{ {
if (__result > 0f && pawn.Ideo != null) // ideo is null if don't have dlc 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); __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")] [SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public float multiplier = 1f; 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> <li>HumanPrimacy</li>
</associatedMemes> </associatedMemes>
<comps> <comps>
<li Class="PreceptComp_UnwillingToDo">
<eventDef>RSI_SexWithAnimal</eventDef>
</li>
<li Class="PreceptComp_SelfTookMemoryThought"> <li Class="PreceptComp_SelfTookMemoryThought">
<eventDef>RSI_SexWithVeneratedAnimal</eventDef> <eventDef>RSI_SexWithVeneratedAnimal</eventDef>
<thought>Bestiality_Abhorrent</thought> <thought>Bestiality_Abhorrent</thought>
@ -116,9 +119,6 @@
</li> </li>
</rules> </rules>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyBestialityMtb">
<disable>true</disable>
</li>
</modExtensions> </modExtensions>
</PreceptDef> </PreceptDef>