rjw-genes/Source/Genes/Life_Force/ThinkNodes/ThinkNode_ConditionalCannotInteract.cs
2023-01-22 09:06:28 +01:00

22 lines
629 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using Verse.AI;
namespace RJW_Genes
{
public class ThinkNode_ConditionalCannotInteract : ThinkNode_Conditional
{
protected override bool Satisfied(Pawn pawn)
{
Pawn target = pawn.mindState.duty.focus.Pawn;
if (target == null)
{
return true;
}
return (target.jobs != null && target.jobs.curDriver.asleep) || !pawn.CanReach(target, PathEndMode.InteractionCell, Danger.Deadly);
}
}
}