Esempio n. 1
0
        public bool BeCooperationTarget(PeEntity target)
        {
            for (int i = 0; i < mCooperationLists.Count; i++)
            {
                AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
                if (atk == null)
                {
                    continue;
                }

                if (atk.HasBeTarget(target))
                {
                    atk.SetAtkTarget(target);
                    return(true);
                }
            }

            for (int i = 0; i < mCooperationLists.Count; i++)
            {
                AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
                if (atk == null)
                {
                    continue;
                }

                if (atk.CanBeTarget(target))
                {
                    atk.AddAktTarget(target);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public void AddNewMemberAtkCooperation(PeEntity member)
        {
            AtkCooperation atk = new AtkCooperation(2, 1);

            member.target.SetEnityCanAttack(true);
            //atk.onCooperationEnd += CooperationEnd;
            atk.AddMember(member);
            mCooperationLists.Add(atk);
        }
Esempio n. 3
0
        public bool ChangeCooperTarget(AtkCooperation cooper, PeEntity target)
        {
            if (cooper == null)
            {
                return(false);
            }

            cooper.AddAktTarget(target);
            return(true);
        }
Esempio n. 4
0
        public List <PeEntity> GetAtkMemberByTarget(PeEntity target)
        {
            AtkCooperation atk = GetAtkCooperByTarget(target);

            if (atk == null)
            {
                return(null);
            }

            return(atk.GetAtkCooperMembers());
        }
Esempio n. 5
0
 public AtkCooperation GetAtkCooperByMember(PeEntity member)
 {
     for (int i = 0; i < mCooperationLists.Count; i++)
     {
         AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
         if (atk != null && atk.ContainMember(member))
         {
             return(atk);
         }
     }
     return(null);
 }
Esempio n. 6
0
 public AtkCooperation GetAtkCooperByTarget(PeEntity target)
 {
     for (int i = 0; i < mCooperationLists.Count; i++)
     {
         AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
         if (atk != null && atk.HasBeTarget(target))
         {
             return(atk);
         }
     }
     return(null);
 }
Esempio n. 7
0
 public void OnAtkTargetLost(PeEntity entity)
 {
     for (int i = 0; i < mCooperationLists.Count; i++)
     {
         AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
         if (atk != null)
         {
             atk.OnAtkTargetLost(entity);
         }
     }
     if (entity != null)
     {
         if (mAtkTargets.Contains(entity))
         {
             RemoveAtkTarget(entity);
         }
     }
 }
Esempio n. 8
0
        public void DissolveTheline(PeEntity target)
        {
            AtkCooperation atk = GetAtkCooperByTarget(target);

            if (target != null)
            {
                if (mAtkTargets.Contains(target))
                {
                    RemoveAtkTarget(target);
                }
            }
            if (atk != null)
            {
                List <PeEntity> lists = atk.GetCooperMembers();
                RemoveOut(lists);
                mCooperationLists.Remove(atk);
                atk.DissolveCooper();
            }
        }
Esempio n. 9
0
        public void AddNewTargetAtkCooperation(PeEntity target)
        {
            if (target != null && target.monsterProtoDb != null)
            {
                int num;
                if (target.monsterProtoDb.AtkDb.mNumber != 0)
                {
                    num = target.monsterProtoDb.AtkDb.mNumber;
                }
                else
                {
                    num = CSNpcTeam.CsNpcNumber;
                }

                AtkCooperation atk = new AtkCooperation(num, 1);
                atk.AddAktTarget(target);
                mCooperationLists.Add(atk);
            }
        }
Esempio n. 10
0
        public void OnAtkTargetDestroy(SkillSystem.SkEntity entity)
        {
            for (int i = 0; i < mCooperationLists.Count; i++)
            {
                AtkCooperation atk = mCooperationLists[i] as AtkCooperation;
                if (atk != null)
                {
                    atk.OnAtkTargetDestroy(entity);
                }
            }
            PeEntity target = entity.GetComponent <PeEntity>();

            if (target != null)
            {
                if (mAtkTargets.Contains(target))
                {
                    RemoveAtkTarget(target);
                }
            }
        }
Esempio n. 11
0
        public void  OnAtkTargetDeath(SkillSystem.SkEntity skSelf, SkillSystem.SkEntity skCaster)
        {
            PeEntity       target = skSelf.GetComponent <PeEntity>();
            AtkCooperation atk    = GetAtkCooperByTarget(target);

            if (target != null)
            {
                if (mAtkTargets.Contains(target))
                {
                    RemoveAtkTarget(target);
                }
            }
            if (atk != null)
            {
                List <PeEntity> lists = atk.GetCooperMembers();
                RemoveOut(lists);
                mCooperationLists.Remove(atk);
                atk.DissolveCooper();
            }
        }