using System.Collections.Generic; using Verse; using Verse.AI; using RimWorld; using rjw; namespace RJWSexperience.Ideology { public class JobDriver_LewdTameFeed : JobDriver_Tame { protected override IEnumerable MakeNewToils() { SetFinalizerJob(cond => cond == JobCondition.Succeeded ? JobMaker.MakeJob(RsiDefOf.Job.TameLewd_Lovin, Animal) : null); bool skipping = false; foreach (var toil in base.MakeNewToils()) { // Base has two sets of toils for feeding, which each begin with a toil named 'FeedToils'. // Since we only want to feed once, we skip everything between the two. if (toil.debugName == "FeedToils") { skipping = !skipping; } // Hold off on setting last interact time until sex is finished if (skipping || toil.debugName == nameof(Toils_Interpersonal.SetLastInteractTime)) { continue; } // Recruitment and roping work to be handled by sex job if (toil.debugName == "TryRecruit") { break; } // Replace talk to animal interaction with RJW's one if (toil.debugName == "TalkToAnimal" && Rand.Chance(0.5f)) { toil.initAction = delegate { if (xxx.can_fuck(Animal)) { pawn.interactions.TryInteractWith(Animal, RsiDefOf.Interaction.AnimalSexTameChatMale); } else { pawn.interactions.TryInteractWith(Animal, RsiDefOf.Interaction.AnimalSexTameChatFemale); } }; } yield return toil; } } } }