diff --git a/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs b/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs index dccbc88..1b59cab 100644 --- a/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs +++ b/RJWSexperience/RJWSexperience/Interactions/CumAddictPartKindUsageRule.cs @@ -1,8 +1,12 @@ -using rjw.Modules.Interactions.Contexts; +using RimWorld; +using rjw.Modules.Interactions.Contexts; using rjw.Modules.Interactions.Enums; using rjw.Modules.Interactions.Rules.PartKindUsageRules; using rjw.Modules.Shared; +using RJWSexperience.Logs; using System.Collections.Generic; +using System.Linq; +using Verse; namespace RJWSexperience.Interactions { @@ -10,22 +14,62 @@ namespace RJWSexperience.Interactions { 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); - } + if (context.Internals.Submissive.Parts.Penises.Any()) + return GetForCumAddict(context.Internals.Dominant.Pawn); + + if (AddictionUtility.IsAddicted(context.Internals.Submissive.Pawn, VariousDefOf.Cum)) + return GetForPartner(); + + return Enumerable.Empty>(); } public IEnumerable> ModifiersForSubmissive(InteractionContext context) { - Logs.LogManager.GetLogger().Warning($"Called for {context.Internals.Submissive.Pawn.NameShortColored}"); + if (context.Internals.Dominant.Parts.Penises.Any()) + return GetForCumAddict(context.Internals.Submissive.Pawn); - if (context.Internals.Submissive.Pawn.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false) + if (AddictionUtility.IsAddicted(context.Internals.Dominant.Pawn, VariousDefOf.Cum)) + return GetForPartner(); + + return Enumerable.Empty>(); + } + + /// + /// Addict wants to use mouth + /// + private IEnumerable> GetForCumAddict(Pawn pawn) + { + var log = LogManager.GetLogger(); + log.Message($"Called for {pawn.NameShortColored}"); + + if (!(pawn.needs.TryGetNeed(VariousDefOf.Chemical_Cum) is Need_Chemical cumNeed)) + yield break; + + log.Message($"{pawn.NameShortColored} is cum addict, current desire level: {cumNeed.CurCategory}"); + + yield return new Weighted(Multipliers.DoubledPlus, LewdablePartKind.Mouth); + + // In dire need also they are also refuse to use other orifices + switch (cumNeed.CurCategory) { - // Cum addicts are really eager to use mouth - yield return new Weighted(Multipliers.DoubledPlus, LewdablePartKind.Mouth); + case DrugDesireCategory.Desire: + yield return new Weighted(Multipliers.VeryRare, LewdablePartKind.Anus); + yield return new Weighted(Multipliers.VeryRare, LewdablePartKind.Vagina); + break; + + case DrugDesireCategory.Withdrawal: + yield return new Weighted(Multipliers.Never, LewdablePartKind.Anus); + yield return new Weighted(Multipliers.Never, LewdablePartKind.Vagina); + break; } } + + /// + /// Addict asks partner to use penis + /// + private IEnumerable> GetForPartner() + { + yield return new Weighted(Multipliers.Common, LewdablePartKind.Penis); + } } }