feat: add check for line of sight for range and skill attacks

This commit is contained in:
Иванов Иван
2024-08-18 17:32:29 +02:00
parent abadf90d4a
commit 5f19cc1f76
11 changed files with 50 additions and 34 deletions

View File

@@ -47,11 +47,11 @@ namespace Client.Domain.AI
if (isEnabled && worldHandler.Hero != null)
{
states[currentState].Execute();
foreach (var transition in locator.Get(Type).Build())
foreach (var transition in locator.Get(Type).Build(worldHandler, config, asyncPathMover))
{
if (transition.fromStates.ContainsKey(BaseState.Type.Any) && transition.toState != currentState || transition.fromStates.ContainsKey(currentState))
{
if (transition.predicate(worldHandler, config, states[currentState]))
if (transition.predicate(states[currentState]))
{
states[currentState].OnLeave();
currentState = transition.toState;