feat: add combat and deleveling AI
This commit is contained in:
28
Client/Domain/AI/State/AttackGuardState.cs
Normal file
28
Client/Domain/AI/State/AttackGuardState.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user