feat: add max passable height to AI config

This commit is contained in:
Иванов Иван
2024-08-22 09:45:11 +02:00
parent d0baa5c21a
commit 936697defc
16 changed files with 46 additions and 39 deletions

View File

@@ -33,6 +33,7 @@ namespace Client.Domain.AI
public uint AttackDistanceBow { get; set; } = 500;
public bool UseOnlySkills { get; set; } = false;
public List<SkillCondition> SkillConditions { get; set; } = new List<SkillCondition>();
public byte MaxPassableHeight { get; set; } = 30;
public bool SpoilIfPossible { get; set; } = true;
public bool SpoilIsPriority { get; set; } = false;

View File

@@ -31,7 +31,7 @@ namespace Client.Domain.AI.State
config.Combat.Zone.Center.X,
config.Combat.Zone.Center.Y,
hero.Transform.Position.Z
));
), config.Combat.MaxPassableHeight);
}
}
}

View File

@@ -37,7 +37,7 @@ namespace Client.Domain.AI.State
if (routeNeedsToBeAdjusted || distance >= Helper.GetAttackDistanceByConfig(worldHandler, config, hero, target) || !asyncPathMover.Pathfinder.HasLineOfSight(hero.Transform.Position, target.Transform.Position))
{
targetPosition = target.Transform.Position.Clone() as Vector3;
asyncPathMover.MoveAsync(target.Transform.Position);
asyncPathMover.MoveAsync(target.Transform.Position, config.Combat.MaxPassableHeight);
}
}

View File

@@ -13,10 +13,9 @@ namespace Client.Domain.Service
{
public PathfinderInterface Pathfinder { get; }
public ObservableCollection<PathSegment> Path { get; }
public Task<bool> MoveAsync(Vector3 location, ushort maxPassableHeight);
public Task<bool> MoveAsync(Vector3 location);
public Task MoveUntilReachedAsync(Vector3 location);
public bool IsLocked { get; }
public void Unlock();
}
}

View File

@@ -10,7 +10,7 @@ namespace Client.Domain.Service
{
public interface PathfinderInterface
{
public List<PathSegment> FindPath(Vector3 start, Vector3 end);
public List<PathSegment> FindPath(Vector3 start, Vector3 end, ushort maxPassableHeight);
public bool HasLineOfSight(Vector3 start, Vector3 end);
}
}