Add disable flag for abhorrent precepts

This commit is contained in:
amevarashi 2022-06-23 09:40:33 +05:00
parent 4d919c86d2
commit b5e1dcc38b
5 changed files with 14 additions and 6 deletions

View file

@ -61,9 +61,15 @@ namespace RJWSexperience.Ideology
float finalMultiplier = 1f; float finalMultiplier = 1f;
for (int i = 0; i < ideo.PreceptsListForReading.Count; i++) for (int i = 0; i < ideo.PreceptsListForReading.Count; i++)
{ {
float? multiplier = ideo.PreceptsListForReading[i].def.GetModExtension<T>()?.multiplier; T defExtension = ideo.PreceptsListForReading[i].def.GetModExtension<T>();
if (multiplier != null)
finalMultiplier *= (float)multiplier; if (defExtension == null)
continue;
if (defExtension.disable)
return -1f;
finalMultiplier *= defExtension.multiplier;
} }
return finalMultiplier; return finalMultiplier;
} }

View file

@ -7,5 +7,7 @@ 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

@ -79,7 +79,7 @@
</rules> </rules>
</li> </li>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyBestialityMtb"> <li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyBestialityMtb">
<multiplier>5.0</multiplier> <disable>true</disable>
</li> </li>
</modExtensions> </modExtensions>
</PreceptDef> </PreceptDef>

View file

@ -39,7 +39,7 @@
</comps> </comps>
<modExtensions> <modExtensions>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyNecroMtb"> <li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyNecroMtb">
<multiplier>8.0</multiplier> <disable>true</disable>
</li> </li>
</modExtensions> </modExtensions>
</PreceptDef> </PreceptDef>

View file

@ -91,7 +91,7 @@
</comps> </comps>
<modExtensions> <modExtensions>
<li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyRapeCPMtb"> <li Class="RJWSexperience.Ideology.Precepts.DefExtension_ModifyRapeCPMtb">
<multiplier>3.0</multiplier> <disable>true</disable>
</li> </li>
</modExtensions> </modExtensions>
</PreceptDef> </PreceptDef>