rjw-sexperience-ideology/Source/IdeologyAddon/SexTame/JobDriver_LewdTrainFeed.cs
2025-01-27 21:36:30 +05:00

59 lines
No EOL
1.5 KiB
C#

using System.Collections.Generic;
using Verse;
using Verse.AI;
using RimWorld;
using rjw;
namespace RJWSexperience.Ideology
{
public class JobDriver_LewdTrainFeed : JobDriver_Train
{
protected override IEnumerable<Toil> MakeNewToils()
{
SetFinalizerJob(cond =>
cond == JobCondition.Succeeded
? JobMaker.MakeJob(RsiDefOf.Job.TrainLewd_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;
}
// Training to be handled by sex job
if (toil.debugName == nameof(Toils_Interpersonal.TryTrain))
{
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;
}
}
}
}