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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user