コード例 #1
0
        public List <Units> GetListOfRecentlySensedOpponents(Relation relation, TargetTag tagType = TargetTag.All, bool isVisibile = true, bool isCheckTaunted = false, SortType sortType = SortType.None, FindType findType = FindType.None, object param = null)
        {
            this.target_units.Clear();
            bool flag = false;

            for (int i = 0; i < this.m_MemoryId.Count; i++)
            {
                int          num          = this.m_MemoryId[i];
                MemoryRecord memoryRecord = this.m_MemoryMap[num];
                if (memoryRecord != null)
                {
                    if (!isVisibile || memoryRecord.bWithingFOV)
                    {
                        Units unit = MapManager.Instance.GetUnit(num);
                        if (unit == null || !unit.isLive)
                        {
                            this.m_MemoryMap[num] = null;
                        }
                        else if (relation == Relation.Hostility)
                        {
                            if (TeamManager.CanAttack(this.m_Owner, unit))
                            {
                                if (isCheckTaunted && unit.ChaoFeng.IsInState)
                                {
                                    this.target_units.Clear();
                                    this.target_units.Add(unit);
                                    flag = true;
                                    break;
                                }
                                if (TagManager.CheckTag(unit, tagType))
                                {
                                    this.target_units.Add(unit);
                                }
                            }
                        }
                        else if (relation == Relation.Companion && TeamManager.CanAssist(this.m_Owner, unit))
                        {
                            if (TagManager.CheckTag(unit, tagType))
                            {
                                this.target_units.Add(unit);
                            }
                        }
                    }
                }
            }
            if (!flag)
            {
                if (sortType != SortType.None)
                {
                    FindTargetHelper.SortTargets(this.m_Owner, sortType, ref this.target_units);
                }
                if (findType != FindType.None)
                {
                    FindTargetHelper.FilterTargetsRef(this.m_Owner, ref this.target_units, findType, param);
                }
            }
            return(this.target_units);
        }
コード例 #2
0
 protected override bool doAction()
 {
     if (this.skillData == null)
     {
         return(false);
     }
     string[] array = this.skillData.hit_actions;
     if (base.unit.HitActions != null)
     {
         array = base.unit.HitActions;
     }
     if (array != null)
     {
         for (int i = 0; i < array.Length; i++)
         {
             string text  = array[i];
             string text2 = (this.skillData.friend_hit_actions == null || this.skillData.friend_hit_actions.Length <= i) ? array[i] : this.skillData.friend_hit_actions[i];
             for (int j = 0; j < this.targetUnits.Count; j++)
             {
                 if (!(this.targetUnits[j] == null))
                 {
                     string perform_id;
                     if (TeamManager.CanAssist(base.unit, this.targetUnits[j]))
                     {
                         perform_id = text2;
                     }
                     else
                     {
                         perform_id = text;
                     }
                     this.AddAction(ActionManager.Hit(this.skillKey, perform_id, this.targetUnits[j], base.unit));
                 }
             }
         }
     }
     for (int k = 0; k < this.targetUnits.Count; k++)
     {
         this.DoEventDispatch(this.skillKey, this.targetUnits[k], base.unit);
     }
     base.unit.HitActions = null;
     if (this.skill != null)
     {
         this.skill.OnSkillHitBegin(this);
     }
     return(true);
 }