mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Simple Age Check for the ConditionalStatAffecters
This commit is contained in:
parent
ae31f2df3b
commit
5920de6bbd
3 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,10 @@ namespace RJW_Genes
|
|||
|
||||
if (req.Thing is Pawn pawn)
|
||||
{
|
||||
// Do nothing if Pawn is Baby or Child (#25)
|
||||
if (!pawn.ageTracker.Adult)
|
||||
return false;
|
||||
|
||||
if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hardwired_progenity))
|
||||
{
|
||||
// This "middle" Conditional Stat Affecter only fires if the other one does not apply
|
||||
|
|
|
@ -25,6 +25,10 @@ namespace RJW_Genes
|
|||
|
||||
if (req.Thing is Pawn pawn)
|
||||
{
|
||||
// Do nothing if Pawn is Baby or Child (#25)
|
||||
if (!pawn.ageTracker.Adult)
|
||||
return false;
|
||||
|
||||
if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hardwired_progenity))
|
||||
{
|
||||
return pawn.relations.ChildrenCount == 0;
|
||||
|
|
|
@ -20,6 +20,10 @@ namespace RJW_Genes
|
|||
|
||||
if (req.Thing is Pawn pawn)
|
||||
{
|
||||
// Do nothing if Pawn is Baby or Child (#25)
|
||||
if (!pawn.ageTracker.Adult)
|
||||
return false;
|
||||
|
||||
if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hardwired_progenity))
|
||||
{
|
||||
return pawn.relations.ChildrenCount >= THRESHOLD_FOR_CHILDREN;
|
||||
|
|
Loading…
Reference in a new issue