Added a fervent Ovipositor Gene, making much more eggs

This commit is contained in:
Vegapnk 2023-04-27 20:28:30 +02:00
parent 1d9041a11f
commit e62dcd23ee
4 changed files with 91 additions and 37 deletions

View File

@ -13,19 +13,18 @@
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_zoophile</defName>
<label>Zoophile</label>
<displayCategory>rjw_genes_breeding</displayCategory>
<description>Xenotypes with this Gene are Zoophile.</description>
<iconPath>Genes/Icons/Zoophile</iconPath>
<displayOrderInCategory>54</displayOrderInCategory>
<forcedTraits>
<li>
<def>Zoophile</def>
</li>
</forcedTraits>
</GeneDef>
<GeneDef>
<defName>rjw_genes_zoophile</defName>
<label>Zoophile</label>
<displayCategory>rjw_genes_breeding</displayCategory>
<description>Xenotypes with this Gene are Zoophile.</description>
<iconPath>Genes/Icons/Zoophile</iconPath>
<displayOrderInCategory>54</displayOrderInCategory>
<forcedTraits>
<li>
<def>Zoophile</def>
</li>
</forcedTraits>
</GeneDef>
</Defs>

View File

@ -166,28 +166,40 @@
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_insectincubator</defName>
<label>InsectIncubator</label>
<geneClass>RJW_Genes.Gene_InsectIncubator</geneClass>
<description>Pawns with this gene are able to host more insect eggs, hatch them faster and fertilize any inserted egg.</description>
<iconPath>Genes/Icons/More_Egg_Space</iconPath>
<displayOrderInCategory>52</displayOrderInCategory>
<displayCategory>rjw_genes_hive</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_insectbreeder</defName>
<label>InsectBreeder</label>
<description>Pawns with this gene are able to fertilize eggs with any fertile penis.</description>
<iconPath>World/WorldObjects/Expanding/Insects</iconPath>
<displayOrderInCategory>53</displayOrderInCategory>
<displayCategory>rjw_genes_hive</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_insectincubator</defName>
<label>Insect Incubator</label>
<geneClass>RJW_Genes.Gene_InsectIncubator</geneClass>
<description>Pawns with this gene are able to hold more insect eggs.</description>
<iconPath>Genes/Icons/More_Egg_Space</iconPath>
<displayOrderInCategory>52</displayOrderInCategory>
<displayCategory>rjw_genes_hive</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_insectbreeder</defName>
<label>Insect Breeder</label>
<description>Pawns with this gene are able to fertilize eggs with any fertile penis.</description>
<iconPath>World/WorldObjects/Expanding/Insects</iconPath>
<displayOrderInCategory>53</displayOrderInCategory>
<displayCategory>rjw_genes_hive</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_fervent_ovipositor</defName>
<label>Fervent Ovipositor</label>
<geneClass>RJW_Genes.Gene_FerventOvipositor</geneClass>
<description>Pawns that have a female (egg producing) ovipositor produce eggs at drastically increased speed.</description>
<iconPath>World/WorldObjects/Expanding/Insects</iconPath>
<displayOrderInCategory>55</displayOrderInCategory>
<displayCategory>rjw_genes_hive</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef>
</Defs>

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using rjw;
namespace RJW_Genes
{
/// <summary>
/// Manages the rjw_genes_fervent_ovipositor to grow eggs much faster.
///
/// TODO: Move the Multiplier into XML
/// TODO: This gene only works after the first egg, the first egg for two new pawns spawns at the same time (strange).
/// </summary>
public class Gene_FerventOvipositor : Gene
{
const int MULTIPLIER = 3; // Tick 3 times as much, making a pawn with this Gene Produce Eggs 4 times as fast as the normal.
public override void Tick()
{
base.Tick();
if (pawn == null) return;
Hediff_PartBaseNatural OvipositorF = (Hediff_PartBaseNatural) pawn.health.hediffSet.GetFirstHediffOfDef(rjw.Genital_Helper.ovipositorF);
if (OvipositorF == null) return;
OvipositorF.nextEggTick = Math.Max(OvipositorF.nextEggTick - MULTIPLIER, -1);
// DevNote: I first had a for-loop calling OviPositorF.tick(), but I fear that would be a performance sink.
// Also, it would double other aspects as well, such as bleeding out through your insect-PP or dropping out the eggs.
}
}
}

View File

@ -44,6 +44,7 @@
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
<Compile Include="Genes\Breeding\PatchMechBirth.cs" />
<Compile Include="Genes\Hive\Defs\HiveOffspringChanceDef.cs" />
<Compile Include="Genes\Hive\Genes\Gene_FerventOvipositor.cs" />
<Compile Include="Genes\Hive\Genes\Gene_InsectIncubator.cs" />
<Compile Include="Genes\Hive\Patches\Patch_InsectBreeder_EggFertilization.cs" />
<Compile Include="Genes\Hive\Patches\Patch_InsectIncubator_PregnancyHelper.cs" />