Merge branch 'WildWalker' into dev

This commit is contained in:
Vegapnk 2024-06-04 17:01:48 +02:00
commit 23e143c381
16 changed files with 374 additions and 5 deletions

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<AbilityDef>
<defName>rjw_genes_ability_mating_call</defName>
<label>Mating Call</label>
<description>Calls nearby animals to breed me.</description>
<iconPath>UI/Abilities/AnimalBerserkPulse</iconPath>
<displayGizmoWhileUndrafted>true</displayGizmoWhileUndrafted>
<disableGizmoWhileUndrafted>false</disableGizmoWhileUndrafted>
<casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
<statBases>
<Ability_Duration>50</Ability_Duration>
<Ability_EffectRadius>0</Ability_EffectRadius>
</statBases>
<displayOrder>410</displayOrder>
<!-- 30k Ticks = 12h -->
<cooldownTicksRange>30000</cooldownTicksRange>
<verbProperties>
<warmupTime>5</warmupTime>
<verbClass>Verb_CastAbility</verbClass>
<targetParams>
<canTargetHumans>False</canTargetHumans>
<canTargetMechs>False</canTargetMechs>
<canTargetAnimals>True</canTargetAnimals>
<canTargetLocations>True</canTargetLocations>
</targetParams>
</verbProperties>
<comps>
<li Class="CompProperties_AbilityFleckOnTarget">
<fleckDef>PsycastPsychicEffect</fleckDef>
</li>
<li Class="RJW_Genes.CompProperties_AbilityMatingCall">
<calldistance>40</calldistance>
</li>
<li Class="CompProperties_AbilityGiveHediff">
<compClass>CompAbilityEffect_GiveHediff</compClass>
<hediffDef>Hediff_Submitting</hediffDef>
<onlyApplyToSelf>True</onlyApplyToSelf>
</li>
</comps>
<confirmationDialogText>Being Bred is not an easy business.\nThis might lead to a broken pawn, torn genitalia and hybrid-pregnancies.\nMaybe this is what you want.\nThe pawn will `submit` and e.g. Insects might cocoon him.\n\nAre you sure to proceed?</confirmationDialogText>
</AbilityDef>
</Defs>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<AbilityDef>
<defName>rjw_genes_ability_pheromone_spit</defName>
<label>pheromone spit</label>
<description>Spit a condensed ball of animal pheromones to mark a target. Nearby Animals will try to breed the target. This means all animals - hostile, friendly and wild.</description>
<iconPath>UI/Abilities/PiercingSpine</iconPath>
<cooldownTicksRange>3000</cooldownTicksRange>
<displayOrder>201</displayOrder>
<aiCanUse>true</aiCanUse>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>11</range>
<warmupTime>1.2</warmupTime>
<soundCast>PiercingSpine_Launch</soundCast>
<targetParams>
<canTargetHumans>True</canTargetHumans>
<canTargetMechs>False</canTargetMechs>
<canTargetAnimals>False</canTargetAnimals>
<canTargetLocations>False</canTargetLocations>
</targetParams>
</verbProperties>
<comps>
<li Class="RJW_Genes.CompProperties_AbilityPheromoneSpit">
<calldistance>25</calldistance>
</li>
</comps>
</AbilityDef>
</Defs>

View file

@ -77,4 +77,38 @@
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef ParentName="BreedingBase">
<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>UI/Abilities/AnimalBerserkPulse</iconPath>
<displayOrderInCategory>65</displayOrderInCategory>
<abilities>
<li>rjw_genes_ability_mating_call</li>
</abilities>
<descriptionHyperlinks>
<AbilityDef>rjw_genes_ability_mating_call</AbilityDef>
</descriptionHyperlinks>
<biostatCpx>2</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef ParentName="BreedingBase">
<defName>rjw_genes_pheromone_spit</defName>
<label>Pheromone Spit</label>
<description>This gene allows to mark targets for breeding, enticing nearby animals for a ride.</description>
<iconPath>UI/Abilities/AnimalBerserkPulse</iconPath>
<displayOrderInCategory>66</displayOrderInCategory>
<abilities>
<li>rjw_genes_ability_pheromone_spit</li>
</abilities>
<descriptionHyperlinks>
<AbilityDef>rjw_genes_ability_pheromone_spit</AbilityDef>
</descriptionHyperlinks>
<biostatCpx>2</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
</Defs>

View file

@ -132,4 +132,15 @@
</modExtensions>
</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,36 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse.Sound;
using Verse;
using RimWorld.Planet;
using rjw;
using HarmonyLib;
using Verse.AI;
namespace RJW_Genes
{
public class CompAbilityEffect_MatingCall : CompAbilityEffect
{
bool fired = false;
private new CompProperties_AbilityMatingCall Props
{
get
{
return (CompProperties_AbilityMatingCall)this.props;
}
}
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
ModLog.Message($"{this.parent.pawn} is casting MatingCall");
AnimalBreedingHelper.DoAnimalBreedingPulse(this.parent.pawn, Props.calldistance);
}
}
}

View file

@ -0,0 +1,31 @@
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using Verse.AI;
namespace RJW_Genes
{
public class CompAbilityEffect_PheromoneSpit : CompAbilityEffect
{
bool fired = false;
private new CompProperties_AbilityPheromoneSpit Props
{
get
{
return (CompProperties_AbilityPheromoneSpit)this.props;
}
}
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
AnimalBreedingHelper.DoAnimalBreedingPulse(target.Pawn, Props.calldistance);
}
}
}

View file

@ -0,0 +1,20 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RJW_Genes
{
public class CompProperties_AbilityMatingCall : CompProperties_AbilityEffect
{
public int calldistance;
public CompProperties_AbilityMatingCall()
{
this.compClass = typeof(CompAbilityEffect_MatingCall);
}
}
}

View file

@ -0,0 +1,18 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RJW_Genes {
public class CompProperties_AbilityPheromoneSpit : CompProperties_AbilityEffect
{
public int calldistance;
public CompProperties_AbilityPheromoneSpit()
{
this.compClass = typeof(CompAbilityEffect_PheromoneSpit);
}
}
}

View file

@ -0,0 +1,70 @@
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse.AI;
using Verse;
namespace RJW_Genes
{
public class AnimalBreedingHelper
{
/// <summary>
/// Finds animals in a distance around a pawn, and schedules a breeding job.
/// This is done regardless of the animals genitalia at the moment.
/// This function has no checks if the Pawn is hostile, downed, etc., such checks must be done upstream!
/// </summary>
/// <param name="toBeBred">The pawn that will be target of breeding animals</param>
/// <param name="pulse_distance">The range around the pawn for which animals will be triggered.</param>
public static void DoAnimalBreedingPulse(Pawn toBeBred, int pulse_distance, bool ends_manhunter = true)
{
IEnumerable<Pawn> animals = GetAnimalsInRange(toBeBred.Map, toBeBred.Position, pulse_distance);
int breeder_counter = 0;
foreach (Pawn animal in animals)
{
if (ends_manhunter)
EndManHunter(animal);
ForceBreedingJob(toBeBred, animal);
breeder_counter++;
}
ModLog.Message($"{breeder_counter} of {animals.Count()} Animals in range are trying to breed {toBeBred}");
}
private static IEnumerable<Pawn> GetAnimalsInRange(Map map, IntVec3 position, int distance)
{
IEnumerable<Pawn> animals =
map.mapPawns
.AllPawnsSpawned
.Where<Pawn>((Func<Pawn, bool>)(p =>
p.IsNonMutantAnimal
&& p.Position.InHorDistOf(position, distance)
&& xxx.is_healthy_enough(p))
);
return animals;
}
private static void ForceBreedingJob(Pawn toBeBred, Pawn animal)
{
// Stopping all Jobs in this way is a bit heavy - but as it's only about Animals this should be fine.
animal.jobs.CaptureAndClearJobQueue();
animal.jobs.StopAll();
Job job = JobMaker.MakeJob(xxx.animalBreed, toBeBred);
animal.jobs.TryTakeOrderedJob(job);
}
private static void EndManHunter(Pawn animal)
{
if (animal.MentalState != null && (animal.MentalState.def == MentalStateDefOf.Manhunter || animal.MentalState.def == MentalStateDefOf.ManhunterPermanent))
{
animal?.MentalState?.RecoverFromState();
}
}
}
}

View file

@ -0,0 +1,57 @@
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() || props.partner == null)
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;
// Another Short Sanity Check
if (animal == null || human == null ) return;
if (human.genes == null) return;
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 (human.Faction != null && 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

@ -66,8 +66,13 @@
<Compile Include="Common\ModLog.cs" />
<Compile Include="Common\Defs\TickIntervalExtension.cs" />
<Compile Include="Common\Patches\PatchImplants.cs" />
<Compile Include="Genes\Breeding\Gene_FerventOvipositor.cs" />
<Compile Include="Genes\Breeding\Gene_InsectIncubator.cs" />
<Compile Include="Genes\Breeding\Abilities\CompAbilityEffect_MatingCall.cs" />
<Compile Include="Genes\Breeding\Abilities\CompAbilityEffect_PheromoneSpit.cs" />
<Compile Include="Genes\Breeding\Abilities\CompProperties_AbilityMatingCall.cs" />
<Compile Include="Genes\Breeding\Abilities\CompProperties_AbilityPheromoneSpit.cs" />
<Compile Include="Genes\Breeding\AnimalBreedingHelper.cs" />
<Compile Include="Genes\Breeding\Genes\Gene_FerventOvipositor.cs" />
<Compile Include="Genes\Breeding\Genes\Gene_InsectIncubator.cs" />
<Compile Include="Genes\Damage\Gene_Elasticity.cs" />
<Compile Include="Genes\Life_Force\Events\SuccubusVisit\IncidentWorker_SuccubusVisit.cs" />
<Compile Include="Genes\Life_Force\Events\SuccubusVisit\LordJob_SuccubusVisit.cs" />
@ -78,8 +83,8 @@
<Compile Include="Common\Patches\PatchGetParents.cs" />
<Compile Include="Common\Patches\PatchPregnancyHelper.cs" />
<Compile Include="GeneDefOf.cs" />
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
<Compile Include="Genes\Breeding\PatchMechBirth.cs" />
<Compile Include="Genes\Breeding\Genes\Gene_MechBreeder.cs" />
<Compile Include="Genes\Breeding\Patches\PatchMechBirth.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_Femboy.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_UdderBreasts.cs" />
<Compile Include="Genes\Gender\Defs\GenderFluidExtension.cs" />
@ -172,6 +177,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" />