rjw-genes/Source/Genes/Life_Force/IngestionOutcomeDoer_LifeForceOffset.cs

25 lines
711 B
C#
Raw Normal View History

using RimWorld;
2022-12-29 19:42:39 +00:00
using Verse;
namespace RJW_Genes
{
/// <summary>
/// This class checks for pawns with LifeForce and Cumeater Gene to add Fertilin when eating cum (the Item from RJW-Sexperience).
/// </summary>
2022-12-29 19:42:39 +00:00
public class IngestionOutcomeDoer_LifeForceOffset : IngestionOutcomeDoer
{
public const float DEFAULT_FERTILIN_PER_UNIT = 1f;
public float FertilinPerUnit = 1f;
2022-12-29 19:42:39 +00:00
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
if (GeneUtility.HasLifeForce(pawn) && GeneUtility.IsCumEater(pawn))
2022-12-29 19:42:39 +00:00
{
float num = ingested.stackCount * this.FertilinPerUnit / 100;
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(pawn), num);
2022-12-29 19:42:39 +00:00
}
}
2022-12-29 19:42:39 +00:00
}
}