Move sextypes into precept xml
This commit is contained in:
parent
3557988f89
commit
d270674bef
|
@ -0,0 +1,10 @@
|
|||
using RimWorld;
|
||||
|
||||
namespace RJWSexperience.Ideology.Ideology
|
||||
{
|
||||
[DefOf]
|
||||
public static class IssueDefOf
|
||||
{
|
||||
[MayRequireIdeology] public static readonly IssueDef Sextype;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using RimWorld;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience.Ideology
|
||||
{
|
||||
public static class IssueUtility
|
||||
{
|
||||
private static readonly Dictionary<IssueDef, List<PreceptDef>> issuePrecepts = new Dictionary<IssueDef, List<PreceptDef>>();
|
||||
|
||||
public static List<PreceptDef> GetAllPrecepts(this IssueDef issue)
|
||||
{
|
||||
if (issuePrecepts.TryGetValue(issue, out List<PreceptDef> precepts))
|
||||
return precepts;
|
||||
|
||||
precepts = DefDatabase<PreceptDef>.AllDefsListForReading.FindAll(x => x.issue == issue);
|
||||
issuePrecepts.Add(issue, precepts);
|
||||
return precepts;
|
||||
}
|
||||
|
||||
public static Precept GetPreceptOfIssue(this Ideo ideo, IssueDef issue)
|
||||
{
|
||||
foreach (PreceptDef preceptDef in issue.GetAllPrecepts())
|
||||
{
|
||||
Precept precept = ideo.GetPrecept(preceptDef);
|
||||
if (precept != null)
|
||||
return precept;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience.Ideology
|
||||
{
|
||||
public class PreceptDefExtension_PreferSextype : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public HashSet<string> sextypes = new HashSet<string>();
|
||||
}
|
||||
}
|
|
@ -279,33 +279,18 @@ namespace RJWSexperience.Ideology
|
|||
if (!context.Inputs.IsRape && ideo != null) PreceptSextype(ideo, context.Inputs.Partner.GetStatValue(xxx.sex_drive_stat), ref __result, interaction);
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, PreceptDef> PreceptBySextype = new Dictionary<string, PreceptDef>
|
||||
{
|
||||
{ "Vaginal", VariousDefOf.Sex_VaginalOnly },
|
||||
{ "Anal", VariousDefOf.Sex_AnalOnly },
|
||||
{ "Rimming", VariousDefOf.Sex_AnalOnly },
|
||||
{ "Cunnilingus", VariousDefOf.Sex_OralOnly },
|
||||
{ "Fellatio", VariousDefOf.Sex_OralOnly },
|
||||
{ "Beakjob", VariousDefOf.Sex_OralOnly },
|
||||
{ "DoublePenetration", VariousDefOf.Sex_Promiscuous },
|
||||
{ "Scissoring", VariousDefOf.Sex_Promiscuous },
|
||||
{ "Sixtynine", VariousDefOf.Sex_Promiscuous },
|
||||
{ "Fisting", VariousDefOf.Sex_Promiscuous }
|
||||
};
|
||||
|
||||
public static void PreceptSextype(Ideo ideo, float sexdrive, ref float result, InteractionWithExtension interaction)
|
||||
{
|
||||
if (!PreceptBySextype.TryGetValue(interaction.Extension.rjwSextype, out PreceptDef preceptDef))
|
||||
Precept sextypePrecept = ideo.GetPreceptOfIssue(Ideology.IssueDefOf.Sextype);
|
||||
bool boostSextype = sextypePrecept.def.GetModExtension<PreceptDefExtension_PreferSextype>().sextypes.Contains(interaction.Extension.rjwSextype);
|
||||
|
||||
if (!boostSextype)
|
||||
return;
|
||||
|
||||
float mult = 8.0f * Math.Max(0.3f, 1 / Math.Max(0.01f, sexdrive));
|
||||
|
||||
if (ideo.HasPrecept(preceptDef))
|
||||
{
|
||||
result *= mult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(SexAppraiser), "would_fuck", new Type[] { typeof(Pawn), typeof(Pawn), typeof(bool), typeof(bool), typeof(bool) })]
|
||||
public static class RJW_Patch_would_fuck
|
||||
|
|
|
@ -45,7 +45,10 @@
|
|||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Ideology\GoodwillSituationWorker_MemeCompatibility.cs" />
|
||||
<Compile Include="Harmony.cs" />
|
||||
<Compile Include="Ideology\IssueDefOf.cs" />
|
||||
<Compile Include="Ideology\IssueUtility.cs" />
|
||||
<Compile Include="Ideology\Keyed.cs" />
|
||||
<Compile Include="Ideology\PreceptDefExtension_PreferSextype.cs" />
|
||||
<Compile Include="Ideology\PreceptDefExtension_MultipleMemesRequired.cs" />
|
||||
<Compile Include="Ideology\Rituals\JobGiver_GangbangConsensual.cs" />
|
||||
<Compile Include="Ideology\Rituals\LordJob_Rituals.cs" />
|
||||
|
@ -60,7 +63,7 @@
|
|||
<Compile Include="Ideology\Rituals\RitualOutcomeComps.cs" />
|
||||
<Compile Include="Ideology\Rituals\RitualRoles.cs" />
|
||||
<Compile Include="Ideology\StatParts.cs" />
|
||||
<Compile Include="Ideology\Utility.cs" />
|
||||
<Compile Include="Ideology\IdeoUtility.cs" />
|
||||
<Compile Include="Thoughts\ThoughtDefExtension_IncreaseRecord.cs" />
|
||||
<Compile Include="Thoughts\ThoughtDefExtension_StageFromOpinion.cs" />
|
||||
<Compile Include="Thoughts\Thought_IncreaseRecord.cs" />
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace RJWSexperience.Ideology
|
||||
{
|
||||
|
@ -51,12 +46,6 @@ namespace RJWSexperience.Ideology
|
|||
[MayRequireIdeology] public static readonly PreceptDef Rape_Disapproved = DefDatabase<PreceptDef>.GetNamed("Rape_Disapproved");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Rape_Acceptable = DefDatabase<PreceptDef>.GetNamed("Rape_Acceptable");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Rape_Honorable = DefDatabase<PreceptDef>.GetNamed("Rape_Honorable");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Sex_Free = DefDatabase<PreceptDef>.GetNamed("Sex_Free");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Sex_VaginalOnly = DefDatabase<PreceptDef>.GetNamed("Sex_VaginalOnly");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Sex_AnalOnly = DefDatabase<PreceptDef>.GetNamed("Sex_AnalOnly");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Sex_OralOnly = DefDatabase<PreceptDef>.GetNamed("Sex_OralOnly");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Sex_Promiscuous = DefDatabase<PreceptDef>.GetNamed("Sex_Promiscuous");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Incestuos_Free = DefDatabase<PreceptDef>.GetNamed("Incestuos_Free");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Incestuos_Disapproved = DefDatabase<PreceptDef>.GetNamed("Incestuos_Disapproved");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Incestuos_Forbidden = DefDatabase<PreceptDef>.GetNamed("Incestuos_Forbidden");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Incestuos_IncestOnly = DefDatabase<PreceptDef>.GetNamed("Incestuos_IncestOnly");
|
||||
|
@ -64,7 +53,6 @@ namespace RJWSexperience.Ideology
|
|||
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysMother = DefDatabase<PreceptDef>.GetNamed("BabyFaction_AlwaysMother");
|
||||
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysFather = DefDatabase<PreceptDef>.GetNamed("BabyFaction_AlwaysFather");
|
||||
[MayRequireIdeology] public static readonly PreceptDef BabyFaction_AlwaysColony = DefDatabase<PreceptDef>.GetNamed("BabyFaction_AlwaysColony");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Submissive_None = DefDatabase<PreceptDef>.GetNamed("Submissive_None");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Submissive_Male = DefDatabase<PreceptDef>.GetNamed("Submissive_Male");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Submissive_Female = DefDatabase<PreceptDef>.GetNamed("Submissive_Female");
|
||||
[MayRequireIdeology] public static readonly PreceptDef Necrophilia_Abhorrent = DefDatabase<PreceptDef>.GetNamed("Necrophilia_Abhorrent");
|
||||
|
|
|
@ -88,6 +88,13 @@
|
|||
<thought>Sex_Know_Promiscuous</thought>
|
||||
</li>
|
||||
</comps>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.PreceptDefExtension_PreferSextype">
|
||||
<sextypes>
|
||||
<li>Vaginal</li>
|
||||
</sextypes>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</PreceptDef>
|
||||
|
||||
<PreceptDef>
|
||||
|
@ -133,6 +140,14 @@
|
|||
<thought>Sex_Know_Promiscuous</thought>
|
||||
</li>
|
||||
</comps>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.PreceptDefExtension_PreferSextype">
|
||||
<sextypes>
|
||||
<li>Anal</li>
|
||||
<li>Rimming</li>
|
||||
</sextypes>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</PreceptDef>
|
||||
|
||||
<PreceptDef>
|
||||
|
@ -178,6 +193,15 @@
|
|||
<thought>Sex_Know_Promiscuous</thought>
|
||||
</li>
|
||||
</comps>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.PreceptDefExtension_PreferSextype">
|
||||
<sextypes>
|
||||
<li>Cunnilingus</li>
|
||||
<li>Fellatio</li>
|
||||
<li>Beakjob</li>
|
||||
</sextypes>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</PreceptDef>
|
||||
|
||||
<PreceptDef>
|
||||
|
@ -230,6 +254,16 @@
|
|||
<thought>Sex_Know_Promiscuous_Approval</thought>
|
||||
</li>
|
||||
</comps>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.Ideology.PreceptDefExtension_PreferSextype">
|
||||
<sextypes>
|
||||
<li>DoublePenetration</li>
|
||||
<li>Scissoring</li>
|
||||
<li>Sixtynine</li>
|
||||
<li>Fisting</li>
|
||||
</sextypes>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</PreceptDef>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue