Added a Gene to tame and train animals with Sex

This commit is contained in:
Vegapnk 2024-05-31 17:28:11 +02:00
parent 79895f352e
commit 5fe252bd67
5 changed files with 76 additions and 2 deletions

View file

@ -82,7 +82,7 @@
<defName>rjw_genes_mating_call</defName>
<label>Mating Call</label>
<description>This gene allows to call nearby animals and invite them for mating.</description>
<iconPath>Genes/Icons/Cocoon</iconPath>
<iconPath>UI/Abilities/AnimalBerserkPulse</iconPath>
<displayOrderInCategory>65</displayOrderInCategory>
<abilities>
<li>rjw_genes_ability_mating_call</li>

View file

@ -126,4 +126,15 @@
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef ParentName="SpecialBase">
<defName>rjw_genes_sex_tamer</defName>
<label>Sexual Tamer</label>
<labelShortAdj>sextamer</labelShortAdj>
<description>Bestiality has a chance to tame animals or advance their training.</description>
<iconPath>UI/Abilities/AnimalBerserkPulse</iconPath>
<displayOrderInCategory>14</displayOrderInCategory>
<biostatCpx>2</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
</Defs>

View file

@ -69,7 +69,12 @@ namespace RJW_Genes
public static readonly GeneDef rjw_genes_mechbreeder;
public static readonly GeneDef rjw_genes_zoophile;
public static readonly GeneDef rjw_genes_fertile_anus;
// Cum
public static readonly GeneDef rjw_genes_mating_call;
public static readonly GeneDef rjw_genes_fervent_ovipositor;
public static readonly GeneDef rjw_genes_insectbreeder;
public static readonly GeneDef rjw_genes_insectincubator;
// Cum
public static readonly GeneDef rjw_genes_no_cum;
public static readonly GeneDef rjw_genes_much_cum;
public static readonly GeneDef rjw_genes_very_much_cum;
@ -97,6 +102,8 @@ namespace RJW_Genes
public static readonly GeneDef rjw_genes_aphrodisiac_pheromones;
public static readonly GeneDef rjw_genes_sexual_mytosis;
public static readonly GeneDef rjw_genes_hormonal_saliva;
public static readonly GeneDef rjw_genes_cocoonweaver;
public static readonly GeneDef rjw_genes_sex_tamer;
// Cosmetic
public static readonly GeneDef rjw_genes_succubus_tail;

View file

@ -0,0 +1,55 @@
using HarmonyLib;
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using static RJWSexperience.RsDefOf;
namespace RJW_Genes
{
[HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))]
public static class Patch_SexualTamer
{
public static void Postfix(SexProps props)
{
// ShortCuts: Exit Early if Pawn or Partner are null (can happen with Masturbation or other nieche-cases)
if (props == null || props.pawn == null || !props.hasPartner())
return;
// Exit for non Animals or Animal on Animal
if (!(props.pawn.IsAnimal() || props.partner.IsAnimal() ) )
return;
Pawn animal = props.pawn.IsAnimal() ? props.pawn : props.partner;
Pawn human = props.pawn.IsAnimal() ? props.partner : props.pawn;
if (human.genes.HasActiveGene(GeneDefOf.rjw_genes_sex_tamer))
{
// Case 1: Wild Animal - Try to Tame
if (animal.AnimalOrWildMan() && animal.Faction == null)
{
if(RJW_Genes_Settings.rjw_genes_detailed_debug)
ModLog.Message($"{human} is a sextamer with bestiality on wild animal {animal} - trying to recruit");
human.interactions.TryInteractWith(animal, InteractionDefOf.TameAttempt);
}
// Case 2: Colony Animal - Try to Train
else if (animal.Faction == human.Faction && animal.training != null)
{
if (RJW_Genes_Settings.rjw_genes_detailed_debug)
ModLog.Message($"{human} is a sextamer with bestiality on colony animal {animal} - trying to train");
var trainable = animal.training.NextTrainableToTrain();
animal.training.Train(trainable, human);
}
}
}
}
}

View file

@ -170,6 +170,7 @@
<Compile Include="Genes\Special\Patches\Patch_AgeDrain.cs" />
<Compile Include="Genes\Special\Patches\Patch_HormonalSaliva.cs" />
<Compile Include="Genes\Special\Patches\Patch_OrgasmMytosis.cs" />
<Compile Include="Genes\Special\Patches\Patch_SexualTamer.cs" />
<Compile Include="Genes\Special\Thoughts\ThoughtWorker_Aphrodisiac_Pheromones_Social.cs" />
<Compile Include="LetterDefOf.cs" />
<Compile Include="Interactions\SuccubusTailjob\CompAbility_SexInteractionRequirements.cs" />