private void OnActorDead(ref GameDeadEventParam prm)
        {
            PoolObjHandle <ActorRoot> src = prm.src;
            PoolObjHandle <ActorRoot> ptr = prm.orignalAtker;

            if (!src || !ptr || prm.bImmediateRevive || prm.bSuicide)
            {
                return;
            }
            if (this.bSoulGrow)
            {
                if (src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
                {
                    EyeWrapper eyeWrapper = src.handle.ActorControl as EyeWrapper;
                    if (eyeWrapper == null || eyeWrapper.bLifeTimeOver)
                    {
                        return;
                    }
                }
                if (src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    if (ptr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
                    {
                        CallActorWrapper callActorWrapper = ptr.handle.ActorControl as CallActorWrapper;
                        if (callActorWrapper != null)
                        {
                            ptr = callActorWrapper.GetHostActor();
                        }
                    }
                    else if (ptr.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && src.handle.ActorControl.IsKilledByHero())
                    {
                        ptr = src.handle.ActorControl.LastHeroAtker;
                    }
                }
                if (ptr)
                {
                    this.OnActorDeadIncomeSoul(ref src, ref ptr);
                    if (ptr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
                    {
                        this.OnActorDeadIncomeGoldCoinInBattle(ref src, ref ptr);
                    }
                }
            }
            if (!this.bPvpMode)
            {
                this.OnMonsterDeadGold(ref prm);
            }
        }
Пример #2
0
 private static PoolObjHandle <ActorRoot> FindEyeTarget(List <PoolObjHandle <ActorRoot> > _srcList)
 {
     if (_srcList.get_Count() == 0)
     {
         return(default(PoolObjHandle <ActorRoot>));
     }
     if (_srcList.get_Count() == 1)
     {
         return(_srcList.get_Item(0));
     }
     _srcList.Sort(delegate(PoolObjHandle <ActorRoot> a, PoolObjHandle <ActorRoot> b)
     {
         EyeWrapper eyeWrapper  = (EyeWrapper)a.get_handle().ActorControl;
         EyeWrapper eyeWrapper2 = (EyeWrapper)b.get_handle().ActorControl;
         int lifeTime           = eyeWrapper.LifeTime;
         int lifeTime2          = eyeWrapper2.LifeTime;
         int targetHpRate       = HitTriggerDurationContext.GetTargetHpRate(a);
         int targetHpRate2      = HitTriggerDurationContext.GetTargetHpRate(b);
         if (targetHpRate < targetHpRate2)
         {
             return(-1);
         }
         if (targetHpRate > targetHpRate2)
         {
             return(1);
         }
         if (lifeTime > lifeTime2)
         {
             return(-1);
         }
         if (lifeTime < lifeTime2)
         {
             return(1);
         }
         return(0);
     });
     return(_srcList.get_Item(0));
 }
Пример #3
0
        private void OnActorDead(ref GameDeadEventParam prm)
        {
            PoolObjHandle <ActorRoot> src           = prm.src;
            PoolObjHandle <ActorRoot> poolObjHandle = prm.orignalAtker;

            if (!src || !poolObjHandle || prm.bImmediateRevive)
            {
                return;
            }
            if (this.bSoulGrow)
            {
                if (src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
                {
                    EyeWrapper eyeWrapper = src.get_handle().ActorControl as EyeWrapper;
                    if (eyeWrapper == null || eyeWrapper.bLifeTimeOver)
                    {
                        return;
                    }
                }
                if (src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && poolObjHandle.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && src.get_handle().ActorControl.IsKilledByHero())
                {
                    poolObjHandle = src.get_handle().ActorControl.LastHeroAtker;
                }
                if (poolObjHandle)
                {
                    this.OnActorDeadIncomeSoul(ref src, ref poolObjHandle);
                    if (poolObjHandle.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || src.get_handle().TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
                    {
                        this.OnActorDeadIncomeGoldCoinInBattle(ref src, ref poolObjHandle);
                    }
                }
            }
            if (!this.bPvpMode)
            {
                this.OnMonsterDeadGold(ref prm);
            }
        }
Пример #4
0
 public void OnActorDead(ref GameDeadEventParam prm)
 {
     if (prm.src == this.actorHero)
     {
         base.recordDead(prm.src, prm.orignalAtker);
     }
     else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         HeroWrapper heroWrapper = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
         bool flag = false;
         if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
         {
             flag          = true;
             poolObjHandle = prm.orignalAtker;
         }
         else if (heroWrapper.IsKilledByHero())
         {
             flag          = true;
             poolObjHandle = heroWrapper.LastHeroAtker;
         }
         if (flag)
         {
             if (poolObjHandle == this.actorHero)
             {
                 this.m_numKill++;
                 if (!this.actorHero.handle.ActorAgent.IsAutoAI())
                 {
                     this.m_stJudgeStat.KillNum = this.m_stJudgeStat.KillNum + 1;
                 }
                 if (this.actorHero.handle.ValueComponent.actorHp * 100 / this.actorHero.handle.ValueComponent.actorHpTotal <= 10)
                 {
                     this.m_iKillHeroUnderTenPercent += 1u;
                 }
             }
             else
             {
                 base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, poolObjHandle);
             }
         }
     }
     else if (prm.orignalAtker && prm.orignalAtker == this.actorHero)
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 this.m_numKillMonster++;
                 MonsterWrapper monsterWrapper = prm.src.handle.AsMonster();
                 if (monsterWrapper != null && monsterWrapper.cfgInfo != null)
                 {
                     if (monsterWrapper.cfgInfo.bSoldierType == 7)
                     {
                         this.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 9)
                     {
                         this.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 8)
                     {
                         this.m_numKillBaron++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 10)
                     {
                         this.m_numKillBlueBa++;
                     }
                     else if (monsterWrapper.cfgInfo.bSoldierType == 11)
                     {
                         this.m_numKillRedBa++;
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 this.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 this.m_numKillFakeMonster++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
         {
             if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4)
             {
                 this.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 this.m_numDestroyBase++;
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
         {
             EyeWrapper eyeWrapper = prm.src.handle.ActorControl as EyeWrapper;
             if (eyeWrapper != null && !eyeWrapper.bLifeTimeOver)
             {
                 this.scanEyeCnt += 1u;
             }
         }
     }
 }