bool MeeleAttacker.IBaseUser.IsInRange(MeeleAttacker attacker, IEntity target) { if (target is IBuilding building) { IntRect rect = building.Rectangle; rect.Top += 1; rect.Bottom -= 2; rect.Left += 1; rect.Right -= 2; return(rect.Contains(Unit.XZPosition)); } return(Vector3.Distance(target.Position, Unit.Position) < 1.5); }
void Attack(MeeleAttacker attacker, IEntity target) { target.HitBy(Unit, 10); }
void TargetInRange(MeeleAttacker attacker, IEntity target) { walker.Stop(); }
void TargetLost(MeeleAttacker attacker) { attacker.SearchForTarget = true; }