AI combat, misc AI improvements, characters can't get stuck inside doors
This commit is contained in:
@@ -32,6 +32,8 @@ namespace Barotrauma
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
Character.ClearInputs();
|
||||
|
||||
steeringManager = Character.AnimController.CurrentHull == null ? outdoorsSteeringManager : indoorsSteeringManager;
|
||||
|
||||
if (updateObjectiveTimer>0.0f)
|
||||
@@ -45,15 +47,14 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
objectiveManager.DoCurrentObjective(deltaTime);
|
||||
|
||||
//if (Character.Controlled != null)
|
||||
//{
|
||||
// steeringManager.SteeringSeek(Character.Controlled.Position);
|
||||
//}
|
||||
|
||||
|
||||
Character.AnimController.IgnorePlatforms = (-Character.AnimController.TargetMovement.Y > Math.Abs(Character.AnimController.TargetMovement.X));
|
||||
|
||||
if (Math.Abs(Character.AnimController.TargetMovement.X) > 0.1f && !Character.AnimController.InWater)
|
||||
if (Character.IsKeyDown(InputType.Aim))
|
||||
{
|
||||
Character.AnimController.TargetDir = Character.CursorPosition.X > Character.Position.X ? Direction.Right : Direction.Left;
|
||||
}
|
||||
else if (Math.Abs(Character.AnimController.TargetMovement.X) > 0.1f && !Character.AnimController.InWater)
|
||||
{
|
||||
Character.AnimController.TargetDir = Character.AnimController.TargetMovement.X > 0.0f ? Direction.Right : Direction.Left;
|
||||
}
|
||||
@@ -64,6 +65,14 @@ namespace Barotrauma
|
||||
steeringManager.Update(moveSpeed);
|
||||
}
|
||||
|
||||
public override void OnAttacked(IDamageable attacker, float amount)
|
||||
{
|
||||
var enemy = attacker as Character;
|
||||
if (enemy == null) return;
|
||||
|
||||
objectiveManager.AddObjective(new AIObjectiveCombat(Character, enemy));
|
||||
}
|
||||
|
||||
public void SetOrder(Order order, string option)
|
||||
{
|
||||
objectiveManager.SetOrder(order, option);
|
||||
|
||||
Reference in New Issue
Block a user