diff --git a/RJWSexperience/RJWSexperience/Harmony.cs b/RJWSexperience/RJWSexperience/Harmony.cs index aa0f5f8..4fd6743 100644 --- a/RJWSexperience/RJWSexperience/Harmony.cs +++ b/RJWSexperience/RJWSexperience/Harmony.cs @@ -1,6 +1,11 @@ using HarmonyLib; using System.Reflection; using Verse; +using rjw.Modules.Interactions.Internals.Implementation; +using rjw.Modules.Interactions.Rules.PartKindUsageRules; +using System.Collections.Generic; +using rjw; +using RJWSexperience.Logs; namespace RJWSexperience { @@ -11,6 +16,17 @@ namespace RJWSexperience { var har = new Harmony("RJW_Sexperience"); har.PatchAll(Assembly.GetExecutingAssembly()); + + InjectIntoRjwInteractionServices(); + } + + public static void InjectIntoRjwInteractionServices() + { + var log = LogManager.GetLogger("StaticConstructorOnStartup"); + + List partKindUsageRules = Unprivater.GetProtectedValue>("_partKindUsageRules", typeof(PartPreferenceDetectorService)); + partKindUsageRules.Add(new Interactions.CumAddictPartKindUsageRule()); + log.Message("Added 1 rule to PartPreferenceDetectorService._partKindUsageRules"); } } } diff --git a/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs b/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs new file mode 100644 index 0000000..dccbc88 --- /dev/null +++ b/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs @@ -0,0 +1,31 @@ +using rjw.Modules.Interactions.Contexts; +using rjw.Modules.Interactions.Enums; +using rjw.Modules.Interactions.Rules.PartKindUsageRules; +using rjw.Modules.Shared; +using System.Collections.Generic; + +namespace RJWSexperience.Interactions +{ + public class CumAddictPartKindUsageRule : IPartPreferenceRule + { + public IEnumerable> ModifiersForDominant(InteractionContext context) + { + if (context.Internals.Dominant.Pawn.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false) + { + // Cum addicts are really eager to use mouth + yield return new Weighted(Multipliers.DoubledPlus, LewdablePartKind.Mouth); + } + } + + public IEnumerable> ModifiersForSubmissive(InteractionContext context) + { + Logs.LogManager.GetLogger().Warning($"Called for {context.Internals.Submissive.Pawn.NameShortColored}"); + + if (context.Internals.Submissive.Pawn.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false) + { + // Cum addicts are really eager to use mouth + yield return new Weighted(Multipliers.DoubledPlus, LewdablePartKind.Mouth); + } + } + } +} diff --git a/RJWSexperience/RJWSexperience/RJWSexperience.csproj b/RJWSexperience/RJWSexperience/RJWSexperience.csproj index 7bfcf8b..c1dbf36 100644 --- a/RJWSexperience/RJWSexperience/RJWSexperience.csproj +++ b/RJWSexperience/RJWSexperience/RJWSexperience.csproj @@ -75,6 +75,7 @@ + @@ -93,8 +94,9 @@ - - + + +