2020-06-18 22:52:44 +10:00
|
|
|
using Content.Server.AI.WorldState;
|
|
|
|
|
using Content.Server.AI.WorldState.States.Inventory;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Weapon.Melee.Components;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
|
|
|
|
namespace Content.Server.AI.Utility.Considerations.Combat.Melee
|
|
|
|
|
{
|
|
|
|
|
public sealed class MeleeWeaponEquippedCon : Consideration
|
|
|
|
|
{
|
2020-07-08 09:37:35 +10:00
|
|
|
protected override float GetScore(Blackboard context)
|
2020-06-18 22:52:44 +10:00
|
|
|
{
|
2021-12-20 15:20:27 +01:00
|
|
|
var equipped = context.GetState<EquippedEntityState>().GetValue();
|
|
|
|
|
|
|
|
|
|
if (equipped == null)
|
|
|
|
|
{
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return IoCManager.Resolve<IEntityManager>().HasComponent<MeleeWeaponComponent>(equipped) ? 1.0f : 0.0f;
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|