2020-07-18 22:51:56 -07:00
|
|
|
|
using Content.Server.AI.WorldState;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
using Content.Server.AI.WorldState.States;
|
2021-06-09 22:19:39 +02:00
|
|
|
|
using Content.Shared.ActionBlocker;
|
2021-06-19 10:03:24 +02:00
|
|
|
|
using Content.Shared.Movement;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.AI.Utility.Considerations.ActionBlocker
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed class CanMoveCon : Consideration
|
|
|
|
|
|
{
|
2020-07-08 09:37:35 +10:00
|
|
|
|
protected override float GetScore(Blackboard context)
|
2020-06-18 22:52:44 +10:00
|
|
|
|
{
|
|
|
|
|
|
var self = context.GetState<SelfState>().GetValue();
|
2021-03-16 15:50:20 +01:00
|
|
|
|
|
2021-12-26 15:32:45 +13:00
|
|
|
|
if (!EntitySystem.Get<ActionBlockerSystem>().CanMove(self))
|
2020-06-18 22:52:44 +10:00
|
|
|
|
{
|
|
|
|
|
|
return 0.0f;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 1.0f;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|