mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
32 lines
669 B
C#
32 lines
669 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using Verse;
|
|
using RimWorld;
|
|
using Verse.AI;
|
|
|
|
namespace RJW_Genes
|
|
{
|
|
public class LifeForceMentalBreakWorker : MentalBreakWorker
|
|
{
|
|
public override bool BreakCanOccur(Pawn pawn)
|
|
{
|
|
if (pawn.Spawned && base.BreakCanOccur(pawn))
|
|
{
|
|
if (!GeneUtility.HasLifeForce(pawn))
|
|
{
|
|
return false;
|
|
}
|
|
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
|
if( gene.Resource.Value <= 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|