Added new HTN operations and preconditions (#27486)

* Added new HTN operations & preconditions

* Ok I forgot about partial

* Namespace pierce the skies

* Some fixes, debug and new operators

* Bruh git eat my files
This commit is contained in:
Tornado Tech
2024-05-08 19:18:03 +10:00
committed by GitHub
parent 29860a0cf7
commit 31491775e5
14 changed files with 401 additions and 8 deletions

View File

@@ -0,0 +1,17 @@
namespace Content.Server.NPC.HTN.Preconditions.Math;
public sealed partial class KeyFloatLessPrecondition : HTNPrecondition
{
[Dependency] private readonly IEntityManager _entManager = default!;
[DataField(required: true)]
public string Key = string.Empty;
[DataField(required: true)]
public float Value;
public override bool IsMet(NPCBlackboard blackboard)
{
return blackboard.TryGetValue<float>(Key, out var value, _entManager) && value < Value;
}
}