2020-07-08 09:37:35 +10:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-06-18 22:52:44 +10:00
|
|
|
using Content.Server.AI.Operators.Sequences;
|
|
|
|
|
using Content.Server.AI.Utility.Considerations;
|
2020-07-11 23:09:37 +10:00
|
|
|
using Content.Server.AI.Utility.Considerations.Containers;
|
2020-06-18 22:52:44 +10:00
|
|
|
using Content.Server.AI.Utility.Considerations.Inventory;
|
2020-08-12 06:01:55 +10:00
|
|
|
using Content.Server.AI.Utility.Considerations.Movement;
|
2020-06-18 22:52:44 +10:00
|
|
|
using Content.Server.AI.WorldState;
|
|
|
|
|
using Content.Server.AI.WorldState.States;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-07-08 09:37:35 +10:00
|
|
|
using Robust.Shared.IoC;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
|
|
|
|
namespace Content.Server.AI.Utility.Actions.Clothing.Gloves
|
|
|
|
|
{
|
|
|
|
|
public sealed class PickUpGloves : UtilityAction
|
|
|
|
|
{
|
2021-03-16 15:50:20 +01:00
|
|
|
public IEntity Target { get; set; } = default!;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
|
|
|
|
public override void SetupOperators(Blackboard context)
|
|
|
|
|
{
|
2021-02-20 17:37:17 +11:00
|
|
|
ActionOperators = new GoPickupEntitySequence(Owner, Target).Sequence;
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateBlackboard(Blackboard context)
|
|
|
|
|
{
|
|
|
|
|
base.UpdateBlackboard(context);
|
2021-02-20 17:37:17 +11:00
|
|
|
context.GetState<TargetEntityState>().SetValue(Target);
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
2021-02-20 17:37:17 +11:00
|
|
|
|
2020-07-08 09:37:35 +10:00
|
|
|
protected override IReadOnlyCollection<Func<float>> GetConsiderations(Blackboard context)
|
|
|
|
|
{
|
|
|
|
|
var considerationsManager = IoCManager.Resolve<ConsiderationsManager>();
|
2020-06-18 22:52:44 +10:00
|
|
|
|
2020-07-08 09:37:35 +10:00
|
|
|
return new[]
|
|
|
|
|
{
|
2020-08-12 06:01:55 +10:00
|
|
|
considerationsManager.Get<CanPutTargetInInventoryCon>()
|
2020-07-08 09:37:35 +10:00
|
|
|
.BoolCurve(context),
|
2020-08-12 06:01:55 +10:00
|
|
|
considerationsManager.Get<TargetDistanceCon>()
|
|
|
|
|
.PresetCurve(context, PresetCurve.Distance),
|
|
|
|
|
considerationsManager.Get<TargetAccessibleCon>()
|
2020-07-11 23:09:37 +10:00
|
|
|
.BoolCurve(context),
|
2020-07-08 09:37:35 +10:00
|
|
|
};
|
|
|
|
|
}
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
|
|
|
|
}
|