Exemple #1
0
 public override ActorRoot SelectTarget(SkillSlot UseSlot)
 {
     if (UseSlot.SlotType == SkillSlotType.SLOT_SKILL_4)
     {
         SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(UseSlot.Actor, UseSlot.Actor, 1);
         Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_ActorBeChosenAsTarget, ref prm);
     }
     return(UseSlot.Actor.handle);
 }
Exemple #2
0
 public void OnHitTrigger(ref SkillChooseTargetEventParam prm)
 {
     DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <uint, PlayerKDA> current     = enumerator.Current;
         IEnumerator <HeroKDA>          enumerator2 = current.Value.GetEnumerator();
         while (enumerator2.MoveNext())
         {
             enumerator2.Current.OnHitTrigger(ref prm);
         }
     }
 }
Exemple #3
0
 public void OnActorBeChosen(ref SkillChooseTargetEventParam prm)
 {
     DictionaryView <uint, PlayerKDA> .Enumerator enumerator = this.m_PlayerKDA.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <uint, PlayerKDA> current     = enumerator.get_Current();
         ListView <HeroKDA> .Enumerator enumerator2 = current.get_Value().GetEnumerator();
         while (enumerator2.MoveNext())
         {
             enumerator2.get_Current().OnActorBeChosen(ref prm);
         }
     }
 }
Exemple #4
0
 public void OnActorBeChosen(ref SkillChooseTargetEventParam prm)
 {
     if ((prm.src != 0) && (prm.src == this.actorHero))
     {
         if ((prm.atker != 0) && prm.src.handle.IsEnemyCamp(prm.atker.handle))
         {
             base.m_uiBeChosenAsAttackTargetNum++;
         }
         else
         {
             base.m_uiBeChosenAsHealTargetNum++;
         }
     }
 }
 public void OnActorBeChosen(ref SkillChooseTargetEventParam prm)
 {
     if (prm.src && prm.src == this.actorHero)
     {
         if (prm.atker && prm.src.handle.IsEnemyCamp(prm.atker.handle))
         {
             this.m_uiBeChosenAsAttackTargetNum += 1u;
         }
         else
         {
             this.m_uiBeChosenAsHealTargetNum += 1u;
         }
     }
 }
Exemple #6
0
 public void OnHitTrigger(ref SkillChooseTargetEventParam prm)
 {
     if ((((prm.atker != 0) && (prm.atker.handle.SkillControl != null)) && ((prm.atker.handle.SkillControl.stSkillStat != null) && (prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo != null))) && (prm.atker.handle.SkillControl.CurUseSkillSlot != null))
     {
         SKILLSTATISTICTINFO skillstatistictinfo = prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo[(int)prm.atker.handle.SkillControl.CurUseSkillSlot.SlotType];
         skillstatistictinfo.iHitCount = prm.iTargetCount;
         skillstatistictinfo.iTmpHitAllHurtCountIndex = 0;
         skillstatistictinfo.iTmpHitAllHurtTotal      = 0;
         skillstatistictinfo.iHitCountMax             = Math.Max(skillstatistictinfo.iHitCountMax, prm.iTargetCount);
         if (skillstatistictinfo.iHitCountMin == -1)
         {
             skillstatistictinfo.iHitCountMin = prm.iTargetCount;
         }
         else
         {
             skillstatistictinfo.iHitCountMin = Math.Min(skillstatistictinfo.iHitCountMin, prm.iTargetCount);
         }
     }
 }
Exemple #7
0
 public void OnHitTrigger(ref SkillChooseTargetEventParam prm)
 {
     if (prm.atker.handle.SkillControl.CurUseSkillSlot != null)
     {
         SkillSlot curUseSkillSlot = prm.atker.handle.SkillControl.CurUseSkillSlot;
         curUseSkillSlot.SkillStatistictInfo.iHitCount = prm.iTargetCount;
         curUseSkillSlot.SkillStatistictInfo.iTmpHitAllHurtCountIndex = 0;
         curUseSkillSlot.SkillStatistictInfo.iTmpHitAllHurtTotal      = 0;
         curUseSkillSlot.SkillStatistictInfo.iHitCountMax             = Math.Max(curUseSkillSlot.SkillStatistictInfo.iHitCountMax, prm.iTargetCount);
         if (curUseSkillSlot.SkillStatistictInfo.iHitCountMin == -1)
         {
             curUseSkillSlot.SkillStatistictInfo.iHitCountMin = prm.iTargetCount;
         }
         else
         {
             curUseSkillSlot.SkillStatistictInfo.iHitCountMin = Math.Min(curUseSkillSlot.SkillStatistictInfo.iHitCountMin, prm.iTargetCount);
         }
     }
 }
 public void OnHitTrigger(ref SkillChooseTargetEventParam prm)
 {
     if (prm.atker && prm.atker == this.actorHero && prm.atker.handle.SkillControl != null && prm.atker.handle.SkillControl.stSkillStat != null && prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo != null && prm.atker.handle.SkillControl.CurUseSkillSlot != null)
     {
         SKILLSTATISTICTINFO sKILLSTATISTICTINFO = prm.atker.handle.SkillControl.stSkillStat.SkillStatistictInfo[(int)prm.atker.handle.SkillControl.CurUseSkillSlot.SlotType];
         sKILLSTATISTICTINFO.iHitCount = prm.iTargetCount;
         sKILLSTATISTICTINFO.iTmpHitAllHurtCountIndex = 0;
         sKILLSTATISTICTINFO.iTmpHitAllHurtTotal      = 0;
         sKILLSTATISTICTINFO.iHitCountMax             = Math.Max(sKILLSTATISTICTINFO.iHitCountMax, prm.iTargetCount);
         if (sKILLSTATISTICTINFO.iHitCountMin == -1)
         {
             sKILLSTATISTICTINFO.iHitCountMin = prm.iTargetCount;
         }
         else
         {
             sKILLSTATISTICTINFO.iHitCountMin = Math.Min(sKILLSTATISTICTINFO.iHitCountMin, prm.iTargetCount);
         }
     }
 }
Exemple #9
0
        public ActorRoot GetLowestHpTarget(ActorRoot InActor, int srchR, TargetPriority priotity, uint filter, bool bEnemy = true, bool bWithMonsterNotInBattle = true)
        {
            List <ActorRoot> list  = new List <ActorRoot>();
            List <ActorRoot> list2 = new List <ActorRoot>();
            List <ActorRoot> list3 = new List <ActorRoot>();
            TargetPropertyLessEqualFilter filter2 = new TargetPropertyLessEqualFilter(list, ulong.MaxValue);
            TargetPropertyLessEqualFilter filter3 = new TargetPropertyLessEqualFilter(list2, ulong.MaxValue);
            TargetDistanceNearFilter      filter4 = new TargetDistanceNearFilter(ulong.MaxValue);

            if (bEnemy)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (i != InActor.TheActorMeta.ActorCamp)
                    {
                        List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i);

                        int num2 = campActors.Count;
                        for (int j = 0; j < num2; j++)
                        {
                            PoolObjHandle <ActorRoot> handle2 = campActors[j];
                            ActorRoot target = handle2.handle;
                            if ((((filter & (((int)1) << target.TheActorMeta.ActorType)) <= 0L) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) && InActor.CanAttack(target))
                            {
                                if (TypeSearchCondition.Fit(target, ActorTypeDef.Actor_Type_Hero))
                                {
                                    if (DistanceSearchCondition.Fit(target, InActor, srchR))
                                    {
                                        filter2.Searcher(target, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, new PropertyDelegate(TargetProperty.GetPropertyHpRate));
                                    }
                                }
                                else if (TypeSearchCondition.Fit(target, ActorTypeDef.Actor_Type_Organ))
                                {
                                    if (DistanceSearchCondition.Fit(target, InActor, srchR))
                                    {
                                        list3.Add(target);
                                    }
                                }
                                else if ((TypeSearchCondition.Fit(target, ActorTypeDef.Actor_Type_Monster) && TypeSearchCondition.FitWithJungleMonsterNotInBattle(target, bWithMonsterNotInBattle)) && DistanceSearchCondition.Fit(target, InActor, srchR))
                                {
                                    filter3.Searcher(target, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, new PropertyDelegate(TargetProperty.GetPropertyHpRate));
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > list5 = Singleton <GameObjMgr> .GetInstance().GetCampActors(InActor.TheActorMeta.ActorCamp);

                int num4 = list5.Count;
                for (int k = 0; k < num4; k++)
                {
                    PoolObjHandle <ActorRoot> handle3 = list5[k];
                    ActorRoot root2 = handle3.handle;
                    if ((((filter & (((int)1) << root2.TheActorMeta.ActorType)) <= 0L) && !root2.ActorControl.IsDeadState) && root2.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp))
                    {
                        if (TypeSearchCondition.Fit(root2, ActorTypeDef.Actor_Type_Hero))
                        {
                            if (DistanceSearchCondition.Fit(root2, InActor, srchR))
                            {
                                filter2.Searcher(root2, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, new PropertyDelegate(TargetProperty.GetPropertyHpRate));
                            }
                        }
                        else if (TypeSearchCondition.Fit(root2, ActorTypeDef.Actor_Type_Organ))
                        {
                            if (DistanceSearchCondition.Fit(root2, InActor, srchR))
                            {
                                list3.Add(root2);
                            }
                        }
                        else if (TypeSearchCondition.Fit(root2, ActorTypeDef.Actor_Type_Monster) && DistanceSearchCondition.Fit(root2, InActor, srchR))
                        {
                            filter3.Searcher(root2, RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, new PropertyDelegate(TargetProperty.GetPropertyHpRate));
                        }
                    }
                }
            }
            int num6  = (list.Count + list3.Count) + list2.Count;
            int count = list.Count;

            if (count > 0)
            {
                ActorRoot root3 = null;
                if (count == 1)
                {
                    root3 = list[0];
                }
                else
                {
                    root3 = filter4.Searcher(list.GetEnumerator(), InActor);
                }
                PoolObjHandle <ActorRoot> selfPtr = new PoolObjHandle <ActorRoot>();
                if (root3 != null)
                {
                    selfPtr = root3.SelfPtr;
                }
                SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(selfPtr, InActor.SelfPtr, num6);
                Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_ActorBeChosenAsTarget, ref prm);

                return(root3);
            }
            count = list3.Count;
            if (count > 0)
            {
                if (count == 1)
                {
                    return(list3[0]);
                }
                return(filter4.Searcher(list3.GetEnumerator(), InActor));
            }
            count = list2.Count;
            if (count <= 0)
            {
                return(null);
            }
            if (count == 1)
            {
                return(list2[0]);
            }
            return(filter4.Searcher(list2.GetEnumerator(), InActor));
        }