mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2026-06-18 19:35:58 +00:00
33 lines
784 B
C#
33 lines
784 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Verse;
|
|
|
|
namespace Rimworld_Animations
|
|
{
|
|
public class PawnTest_Hediff : BasePawnTest
|
|
{
|
|
public HediffDef hediffDef; //hediff you want to check for
|
|
float minSeverity = -1; //optional param; min severity the hediff needs to be
|
|
|
|
|
|
public override bool PawnTest(Pawn pawn)
|
|
{
|
|
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(hediffDef);
|
|
|
|
if (hediff != null)
|
|
{
|
|
if (minSeverity != -1)
|
|
{
|
|
return hediff.Severity > minSeverity;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|