﻿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;
        }
    }
}

1.5/Source/Animations/PawnTests/PawnTest_Hediff.cs