示例#1
0
        internal override Boolean CalculatePath(GridSlot p_start, GridSlot p_target, List <GridSlot> p_pathBuffer)
        {
            if (!p_target.CheckForSummons())
            {
                AStarHelper <GridSlot> .Calculate(p_start, p_target, GameConfig.MaxSteps, m_owner, false, true, true, p_pathBuffer);

                return(p_pathBuffer.Count > 0);
            }
            List <GridSlot> list;

            if (Position.Distance(p_target.Position, LegacyLogic.Instance.WorldManager.Party.Position) <= 1.1f)
            {
                list = GetMeleeTargets(LegacyLogic.Instance.MapLoader.Grid, LegacyLogic.Instance.WorldManager.Party);
            }
            else
            {
                list = GetRangedTargets(LegacyLogic.Instance.MapLoader.Grid, LegacyLogic.Instance.WorldManager.Party);
            }
            if (list.FindAll(new Predicate <GridSlot>(FindSlotsWithSummons)).Count == list.Count)
            {
                return(base.CalculatePath(p_start, p_target, p_pathBuffer));
            }
            list.RemoveAll(new Predicate <GridSlot>(FindSlotsWithSummons));
            list.Sort(new Comparison <GridSlot>(DistSortAsc));
            AStarHelper <GridSlot> .Calculate(p_start, list[0], GameConfig.MaxSteps, m_owner, false, true, true, p_pathBuffer);

            list.Sort(new Comparison <GridSlot>(DistSortAsc));
            return(p_pathBuffer.Count > 0);
        }
示例#2
0
 protected Boolean FindSlotsWithSummons(GridSlot p_slot)
 {
     return(p_slot.CheckForSummons());
 }