Merge branch 'master' into buckle-locker-fix-1262

This commit is contained in:
DrSmugleaf
2020-07-08 15:35:20 +02:00
121 changed files with 1116 additions and 772 deletions

View File

@@ -1,4 +1,3 @@
using Content.Server.AI.Utility.Curves;
using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States;
using Content.Server.AI.WorldState.States.Hands;
@@ -9,9 +8,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
{
public class CanPutTargetInHandsCon : Consideration
{
public CanPutTargetInHandsCon(IResponseCurve curve) : base(curve) {}
public override float GetScore(Blackboard context)
protected override float GetScore(Blackboard context)
{
// First check if target in inventory already
// If not then check if we have a free hand
@@ -22,9 +19,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
return 0.0f;
}
var inventory = context.GetState<InventoryState>().GetValue();
foreach (var item in inventory)
foreach (var item in context.GetState<EnumerableInventoryState>().GetValue())
{
if (item == target)
{

View File

@@ -1,4 +1,3 @@
using Content.Server.AI.Utility.Curves;
using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States;
using Content.Server.AI.WorldState.States.Inventory;
@@ -8,11 +7,8 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
{
public class TargetInOurInventoryCon : Consideration
{
public TargetInOurInventoryCon(IResponseCurve curve) : base(curve) {}
public override float GetScore(Blackboard context)
protected override float GetScore(Blackboard context)
{
var inventory = context.GetState<InventoryState>().GetValue();
var target = context.GetState<TargetEntityState>().GetValue();
if (target == null || !target.HasComponent<ItemComponent>())
@@ -20,7 +16,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory
return 0.0f;
}
foreach (var item in inventory)
foreach (var item in context.GetState<EnumerableInventoryState>().GetValue())
{
if (item == target)
{