feat: add combat and deleveling AI

This commit is contained in:
Иванов Иван
2024-08-15 17:23:24 +02:00
parent bdd026519f
commit 2943f7a50b
79 changed files with 61368 additions and 6746 deletions

View File

@@ -0,0 +1,28 @@
using Client.Application.Components;
using Client.Domain.Entities;
using Client.Domain.Service;
namespace Client.Domain.AI.State
{
public class AttackGuardState : BaseState
{
public AttackGuardState(AI ai) : base(ai)
{
}
protected override void DoExecute(WorldHandler worldHandler, Config config, AsyncPathMoverInterface asyncPathMover, Hero hero)
{
if (hero.Target == null)
{
return;
}
var skill = worldHandler.GetSkillById(config.Deleveling.SkillId);
if (skill != null && skill.IsReadyToUse && skill.Cost <= hero.VitalStats.Mp)
{
worldHandler.RequestUseSkill(skill.Id, true, false);
}
}
}
}