mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Started on Progenity Gene
This commit is contained in:
parent
56f8c2b6b2
commit
ae31f2df3b
7 changed files with 156 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
|||
using RimWorld;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class ConditionalStatAffecter_VeryManyChildren : ConditionalStatAffecter
|
||||
{
|
||||
public override string Label => (string)"StatsReport_VeryManyChildren".Translate();
|
||||
|
||||
public const int THRESHOLD_FOR_CHILDREN = 8;
|
||||
|
||||
public override bool Applies(StatRequest req)
|
||||
{
|
||||
if (req == null || req.Thing == null || !req.Thing.Spawned) return false;
|
||||
|
||||
if (req.Thing is Pawn pawn)
|
||||
{
|
||||
if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hardwired_progenity))
|
||||
{
|
||||
return pawn.relations.ChildrenCount >= THRESHOLD_FOR_CHILDREN;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue