Esempio n. 1
0
        private void onActorDead(ref DefaultGameEventParam prm)
        {
            NONHERO_STATISTIC_INFO nonhero_statistic_info;
            DictionaryView <uint, NONHERO_STATISTIC_INFO> view;

            this.doDestroyStat(prm.src, prm.orignalAtker);
            if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                HeroWrapper actorControl = prm.src.handle.ActorControl as HeroWrapper;
                if (actorControl.IsKilledByHero())
                {
                    CampInfo campInfoByCamp           = null;
                    PoolObjHandle <ActorRoot> inAtker = new PoolObjHandle <ActorRoot>(null);
                    if (actorControl.LastHeroAtker != 0)
                    {
                        campInfoByCamp = this.GetCampInfoByCamp(actorControl.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                        inAtker        = actorControl.LastHeroAtker;
                    }
                    else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
                    {
                        campInfoByCamp = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                        inAtker        = prm.orignalAtker;
                    }
                    if ((campInfoByCamp != null) && (inAtker != 0))
                    {
                        campInfoByCamp.IncCampScore(prm.src, inAtker);
                        uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(0x6d).dwConfValue;
                        campInfoByCamp.IncHeadPoints((int)dwConfValue, prm.src, inAtker);
                    }
                }
            }
            else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                MonsterWrapper wrapper2 = prm.src.handle.ActorControl as MonsterWrapper;
                if (wrapper2.IsKilledByHero())
                {
                    CampInfo info2 = this.GetCampInfoByCamp(wrapper2.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(info2 != null);
                    if (info2 != null)
                    {
                        info2.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
                else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
                {
                    CampInfo info3 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(info3 != null);
                    if (info3 != null)
                    {
                        info3.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
            }
            if (((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out view) && view.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info)))
            {
                nonhero_statistic_info.uiTotalDeadNum++;
            }
        }
Esempio n. 2
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 actorControl         = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> killer = new PoolObjHandle <ActorRoot>();
         bool flag = false;
         if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
         {
             flag   = true;
             killer = prm.orignalAtker;
         }
         else if (actorControl.IsKilledByHero())
         {
             flag   = true;
             killer = actorControl.LastHeroAtker;
         }
         if (flag)
         {
             if (killer == this.actorHero)
             {
                 base.m_numKill++;
             }
             else
             {
                 base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, killer);
             }
         }
     }
     else if ((prm.orignalAtker != 0) && (prm.orignalAtker == this.actorHero))
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 base.m_numKillMonster++;
                 MonsterWrapper wrapper2 = prm.src.handle.AsMonster();
                 if ((wrapper2 != null) && (wrapper2.cfgInfo != null))
                 {
                     if (wrapper2.cfgInfo.bSoldierType == 7)
                     {
                         base.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 9)
                     {
                         base.m_numKillDragon++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 8)
                     {
                         base.m_numKillBaron++;
                         Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_DRAGON_KILL_CHANGED);
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 base.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 base.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))
             {
                 base.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 base.m_numDestroyBase++;
             }
         }
     }
 }
Esempio n. 3
0
 public void OnActorDead(ref DefaultGameEventParam prm)
 {
     if (object.ReferenceEquals(prm.src.handle, this.actorHero.handle))
     {
         base.recordDead(prm.src, prm.orignalAtker);
     }
     else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         HeroWrapper actorControl         = prm.src.handle.ActorControl as HeroWrapper;
         PoolObjHandle <ActorRoot> killer = new PoolObjHandle <ActorRoot>();
         bool flag = false;
         if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
         {
             flag   = true;
             killer = prm.orignalAtker;
         }
         else if (actorControl.IsKilledByHero())
         {
             flag   = true;
             killer = actorControl.LastHeroAtker;
         }
         if (flag)
         {
             if (object.ReferenceEquals(killer.handle, this.actorHero.handle))
             {
                 base.m_numKill++;
             }
             base.recordAssist(prm.src, prm.orignalAtker, this.actorHero, killer);
         }
     }
     else if ((prm.orignalAtker != 0) && object.ReferenceEquals(prm.orignalAtker.handle, this.actorHero.handle))
     {
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             if (prm.src.handle.ActorControl.GetActorSubType() == 2)
             {
                 base.m_numKillMonster++;
                 MonsterWrapper wrapper2 = prm.src.handle.AsMonster();
                 if ((wrapper2 != null) && (wrapper2.cfgInfo != null))
                 {
                     if (wrapper2.cfgInfo.bSoldierType == 7)
                     {
                         base.m_numKillDragon++;
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 9)
                     {
                         base.m_numKillDragon++;
                     }
                     else if (wrapper2.cfgInfo.bSoldierType == 8)
                     {
                         base.m_numKillBaron++;
                     }
                 }
             }
             else if (prm.src.handle.ActorControl.GetActorSubType() == 1)
             {
                 base.m_numKillSoldier++;
             }
             if (prm.src.handle.TheActorMeta.ConfigId != prm.src.handle.TheActorMeta.EnCId)
             {
                 base.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))
             {
                 base.m_numKillOrgan++;
             }
             else if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 2)
             {
                 base.m_numDestroyBase++;
             }
         }
     }
 }
 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;
             }
         }
     }
 }
        private void onActorDead(ref GameDeadEventParam prm)
        {
            if (prm.bImmediateRevive)
            {
                return;
            }
            this.doDestroyStat(prm.src, prm.orignalAtker);
            if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                HeroWrapper heroWrapper = prm.src.handle.ActorControl as HeroWrapper;
                CampInfo    campInfo    = null;
                PoolObjHandle <ActorRoot> poolObjHandle = new PoolObjHandle <ActorRoot>(null);
                if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    campInfo      = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                    poolObjHandle = prm.orignalAtker;
                }
                else if (heroWrapper.IsKilledByHero() && heroWrapper.LastHeroAtker)
                {
                    campInfo      = this.GetCampInfoByCamp(heroWrapper.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                    poolObjHandle = heroWrapper.LastHeroAtker;
                }
                if (campInfo != null && poolObjHandle)
                {
                    campInfo.IncCampScore(prm.src, poolObjHandle);
                    uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(109u).dwConfValue;
                    campInfo.IncHeadPoints((int)dwConfValue, prm.src, poolObjHandle);
                }
            }
            else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                MonsterWrapper monsterWrapper = prm.src.handle.ActorControl as MonsterWrapper;
                if (monsterWrapper.IsKilledByHero())
                {
                    CampInfo campInfoByCamp = this.GetCampInfoByCamp(monsterWrapper.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(campInfoByCamp != null);
                    if (campInfoByCamp != null)
                    {
                        campInfoByCamp.IncHeadPoints(monsterWrapper.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
                else if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    CampInfo campInfoByCamp2 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                    DebugHelper.Assert(campInfoByCamp2 != null);
                    if (campInfoByCamp2 != null)
                    {
                        campInfoByCamp2.IncHeadPoints(monsterWrapper.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                    }
                }
            }
            DictionaryView <uint, NONHERO_STATISTIC_INFO> dictionaryView;
            NONHERO_STATISTIC_INFO nONHERO_STATISTIC_INFO;

            if (prm.src && prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out dictionaryView) && dictionaryView.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nONHERO_STATISTIC_INFO))
            {
                nONHERO_STATISTIC_INFO.uiTotalDeadNum += 1u;
            }
            if (prm.atker && prm.src && prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
            {
                OrganWrapper organWrapper = prm.src.handle.ActorControl as OrganWrapper;
                if (organWrapper != null && organWrapper.cfgInfo.bOrganType == 1)
                {
                    CampInfo campInfoByCamp3 = this.GetCampInfoByCamp(prm.atker.handle.TheActorMeta.ActorCamp);
                    if (campInfoByCamp3 != null)
                    {
                        campInfoByCamp3.destoryTowers++;
                        Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_TOWER_DESTROY_CHANGED);
                    }
                }
            }
        }
Esempio n. 6
0
        private KillDetailInfo OnActorDeathd(ref GameDeadEventParam param)
        {
            KillDetailInfo            killDetailInfo     = null;
            KillDetailInfoType        killDetailInfoType = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroMultiKillType  = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroContiKillType  = KillDetailInfoType.Info_Type_None;
            PoolObjHandle <ActorRoot> poolObjHandle      = default(PoolObjHandle <ActorRoot>);
            PoolObjHandle <ActorRoot> poolObjHandle2     = default(PoolObjHandle <ActorRoot>);
            List <uint>           list = new List <uint>();
            DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(param.src, param.atker, ref param.orignalAtker, ref param.logicAtker);
            HeroWrapper           heroWrapper           = null;
            HeroWrapper           heroWrapper2          = null;
            bool   flag       = false;
            bool   flag2      = false;
            bool   flag3      = false;
            Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            DebugHelper.Assert(hostPlayer != null, "Fatal error in OnActorDeadthd, HostPlayer is null!");
            if (hostPlayer != null)
            {
                DebugHelper.Assert(hostPlayer.Captain, "Fatal error in OnActorDeadthd, Captain is null!");
            }
            bool bSelfCamp = hostPlayer.PlayerCamp == defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorCamp;
            uint objID     = hostPlayer.Captain.handle.ObjID;
            bool bPlayerSelf_KillOrKilled = objID == defaultGameEventParam.src.handle.ObjID || objID == defaultGameEventParam.orignalAtker.handle.ObjID;
            bool flag4 = defaultGameEventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero;
            bool flag5 = defaultGameEventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ;
            byte actorSubSoliderType = defaultGameEventParam.src.handle.ActorControl.GetActorSubSoliderType();
            bool flag6 = false;
            bool flag7 = false;
            bool flag8 = false;

            if (defaultGameEventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && actorSubSoliderType == 8)
            {
                flag6 = true;
            }
            else if (defaultGameEventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && actorSubSoliderType == 9)
            {
                flag7 = true;
            }
            else if (defaultGameEventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && actorSubSoliderType == 7)
            {
                flag8 = true;
            }
            PoolObjHandle <ActorRoot> src            = defaultGameEventParam.src;
            PoolObjHandle <ActorRoot> poolObjHandle3 = defaultGameEventParam.orignalAtker;

            if (flag4)
            {
                heroWrapper  = (defaultGameEventParam.src.handle.ActorControl as HeroWrapper);
                heroWrapper2 = (defaultGameEventParam.orignalAtker.handle.ActorControl as HeroWrapper);
                if (defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    if (defaultGameEventParam.orignalAtker.handle.ObjID == objID)
                    {
                        bPlayerSelf_KillOrKilled = true;
                    }
                    flag      = true;
                    bSelfCamp = (hostPlayer.PlayerCamp == defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorCamp);
                }
                else if (heroWrapper.IsKilledByHero())
                {
                    flag           = true;
                    poolObjHandle3 = heroWrapper.LastHeroAtker;
                    heroWrapper2   = (heroWrapper.LastHeroAtker.handle.ActorControl as HeroWrapper);
                    if (poolObjHandle3.handle.ObjID == objID)
                    {
                        bPlayerSelf_KillOrKilled = true;
                    }
                    bSelfCamp = (hostPlayer.PlayerCamp == poolObjHandle3.handle.TheActorMeta.ActorCamp);
                }
                else if (defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
                {
                    flag2     = true;
                    flag      = false;
                    bSelfCamp = (hostPlayer.PlayerCamp == defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorCamp);
                }
                else if (defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    flag3     = true;
                    flag      = false;
                    bSelfCamp = (hostPlayer.PlayerCamp == defaultGameEventParam.orignalAtker.handle.TheActorMeta.ActorCamp);
                }
                if (flag4 && flag)
                {
                    heroWrapper2.ContiDeadNum = 0;
                    heroWrapper2.ContiKillNum++;
                    if (heroWrapper2.IsInMultiKill())
                    {
                        heroWrapper2.MultiKillNum++;
                    }
                    else
                    {
                        heroWrapper2.MultiKillNum = 1;
                    }
                    heroWrapper2.UpdateLastKillTime();
                }
            }
            if (flag4 && flag)
            {
                if (src && src.handle.ActorControl != null)
                {
                    List <KeyValuePair <uint, ulong> > .Enumerator enumerator = src.handle.ActorControl.hurtSelfActorList.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        KeyValuePair <uint, ulong> current = enumerator.get_Current();
                        if (current.get_Key() != poolObjHandle3.handle.ObjID)
                        {
                            List <uint> list2 = list;
                            KeyValuePair <uint, ulong> current2 = enumerator.get_Current();
                            list2.Add(current2.get_Key());
                        }
                    }
                }
                if (poolObjHandle3 && poolObjHandle3.handle.ActorControl != null)
                {
                    List <KeyValuePair <uint, ulong> > .Enumerator enumerator2 = poolObjHandle3.handle.ActorControl.helpSelfActorList.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        KeyValuePair <uint, ulong> current3 = enumerator2.get_Current();
                        if (current3.get_Key() != poolObjHandle3.handle.ObjID)
                        {
                            List <uint> list3 = list;
                            KeyValuePair <uint, ulong> current4 = enumerator2.get_Current();
                            list3.Add(current4.get_Key());
                        }
                    }
                }
                for (int i = 0; i < list.get_Count() - 1; i++)
                {
                    for (int j = i + 1; j < list.get_Count(); j++)
                    {
                        if (list.get_Item(i) == list.get_Item(j))
                        {
                            list.RemoveAt(j);
                            j--;
                        }
                    }
                }
                bool flag9 = false;
                if (heroWrapper2.MultiKillNum == 2)
                {
                    flag9             = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_DoubleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_DoubleKill, ref defaultGameEventParam);
                }
                else if (heroWrapper2.MultiKillNum == 3)
                {
                    flag9             = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_TripleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_TripleKill, ref defaultGameEventParam);
                }
                else if (heroWrapper2.MultiKillNum == 4)
                {
                    flag9             = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_QuataryKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_QuataryKill, ref defaultGameEventParam);
                }
                else if (heroWrapper2.MultiKillNum >= 5)
                {
                    flag9             = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_PentaKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_PentaKill, ref defaultGameEventParam);
                }
                if (flag9 && killDetailInfo == null)
                {
                    killDetailInfo = this._create(poolObjHandle3, src, list, killDetailInfoType, heroMultiKillType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false);
                }
            }
            if (flag4 && flag && heroWrapper.ContiKillNum >= 3)
            {
                if (heroWrapper.ContiKillNum >= 7)
                {
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_OdysseyBeStopped, ref defaultGameEventParam);
                }
                if (killDetailInfo == null)
                {
                    killDetailInfo = this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_StopMultiKill, heroMultiKillType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false);
                }
            }
            if (flag4 && flag && !this.bFristBlood)
            {
                this.bFristBlood = true;
                return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_First_Kill, heroMultiKillType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false));
            }
            if (flag5 && (defaultGameEventParam.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || defaultGameEventParam.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4))
            {
                KillDetailInfo killDetailInfo2 = this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_DestroyTower, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false);
                if (defaultGameEventParam.src.handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0)
                {
                    Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo2);

                    return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_Soldier_Boosted, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false));
                }
                return(killDetailInfo2);
            }
            else
            {
                if (flag4 && flag)
                {
                    bool flag10 = false;
                    if (heroWrapper2.ContiKillNum == 3)
                    {
                        flag10            = true;
                        heroContiKillType = KillDetailInfoType.Info_Type_MonsterKill;
                    }
                    else if (heroWrapper2.ContiKillNum == 4)
                    {
                        flag10            = true;
                        heroContiKillType = KillDetailInfoType.Info_Type_DominateBattle;
                    }
                    else if (heroWrapper2.ContiKillNum == 5)
                    {
                        flag10            = true;
                        heroContiKillType = KillDetailInfoType.Info_Type_Legendary;
                    }
                    else if (heroWrapper2.ContiKillNum == 6)
                    {
                        flag10            = true;
                        heroContiKillType = KillDetailInfoType.Info_Type_TotalAnnihilat;
                    }
                    else if (heroWrapper2.ContiKillNum >= 7)
                    {
                        flag10            = true;
                        heroContiKillType = KillDetailInfoType.Info_Type_Odyssey;
                        Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_Odyssey, ref defaultGameEventParam);
                    }
                    if (flag10 && killDetailInfo == null)
                    {
                        killDetailInfo = this._create(poolObjHandle3, src, list, killDetailInfoType, killDetailInfoType, heroContiKillType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false);
                    }
                }
                if (flag4 && this.IsAllDead(ref defaultGameEventParam.src))
                {
                    KillDetailInfo arg = this._create(poolObjHandle3, src, list, killDetailInfoType, killDetailInfoType, killDetailInfoType, bSelfCamp, true, bPlayerSelf_KillOrKilled, false);
                    Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, arg);
                }
                if (killDetailInfo != null)
                {
                    return(killDetailInfo);
                }
                if (flag4 && (flag || flag2 || flag3))
                {
                    return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_Kill, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, false));
                }
                if (flag8)
                {
                    return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_Kill_3V3_Dragon, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, param.bSuicide));
                }
                if (flag7)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int>(EventID.BATTLE_DATAANL_DRAGON_KILLED, poolObjHandle3, 0);

                    return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, param.bSuicide));
                }
                if (flag6)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int>(EventID.BATTLE_DATAANL_DRAGON_KILLED, poolObjHandle3, 1);

                    return(this._create(poolObjHandle3, src, list, KillDetailInfoType.Info_Type_Kill_5V5_BigDragon, killDetailInfoType, killDetailInfoType, bSelfCamp, false, bPlayerSelf_KillOrKilled, param.bSuicide));
                }
                return(null);
            }
        }
Esempio n. 7
0
        private KillDetailInfo OnActorDeathd(ref GameDeadEventParam param)
        {
            KillDetailInfo            info = null;
            KillDetailInfoType        type = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroMultiKillType = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroContiKillType = KillDetailInfoType.Info_Type_None;
            PoolObjHandle <ActorRoot> victim            = new PoolObjHandle <ActorRoot>();
            PoolObjHandle <ActorRoot> killer            = new PoolObjHandle <ActorRoot>();
            DefaultGameEventParam     prm = new DefaultGameEventParam(param.src, param.atker, ref param.orignalAtker);
            HeroWrapper actorControl      = null;
            HeroWrapper wrapper2          = null;
            bool        flag       = false;
            bool        flag2      = false;
            bool        flag3      = false;
            bool        flag4      = false;
            bool        flag5      = false;
            bool        flag6      = false;
            Player      hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            DebugHelper.Assert(hostPlayer != null, "Fatal error in OnActorDeadthd, HostPlayer is null!");
            if (hostPlayer != null)
            {
                DebugHelper.Assert((bool)hostPlayer.Captain, "Fatal error in OnActorDeadthd, Captain is null!");
            }
            bool bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
            bool flag8     = false;
            uint objID     = hostPlayer.Captain.handle.ObjID;

            flag8 = (objID == prm.src.handle.ObjID) || (objID == prm.orignalAtker.handle.ObjID);
            flag  = prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero;
            flag2 = prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ;
            flag3 = (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) && (prm.src.handle.TheActorMeta.ConfigId == Singleton <BattleLogic> .instance.DragonId);
            byte actorSubSoliderType = prm.src.handle.ActorControl.GetActorSubSoliderType();
            bool flag9  = false;
            bool flag10 = false;

            switch (actorSubSoliderType)
            {
            case 8:
                flag9 = true;
                flag3 = false;
                break;

            case 9:
                flag10 = true;
                flag3  = false;
                break;
            }
            victim = prm.src;
            killer = prm.orignalAtker;
            if (flag)
            {
                actorControl = prm.src.handle.ActorControl as HeroWrapper;
                wrapper2     = prm.orignalAtker.handle.ActorControl as HeroWrapper;
                if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    if (prm.orignalAtker.handle.ObjID == objID)
                    {
                        flag8 = true;
                    }
                    flag4     = true;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                else if (actorControl.IsKilledByHero())
                {
                    flag4    = true;
                    killer   = actorControl.LastHeroAtker;
                    wrapper2 = actorControl.LastHeroAtker.handle.ActorControl as HeroWrapper;
                    if (killer.handle.ObjID == objID)
                    {
                        flag8 = true;
                    }
                    bSelfCamp = hostPlayer.PlayerCamp == killer.handle.TheActorMeta.ActorCamp;
                }
                else if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
                {
                    flag5     = true;
                    flag4     = false;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                else if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    flag6     = true;
                    flag4     = false;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                if (flag && flag4)
                {
                    wrapper2.ContiDeadNum = 0;
                    wrapper2.ContiKillNum++;
                    if (wrapper2.IsInMultiKill())
                    {
                        wrapper2.MultiKillNum++;
                    }
                    else
                    {
                        wrapper2.MultiKillNum = 1;
                    }
                    wrapper2.UpdateLastKillTime();
                }
            }
            if (flag && flag4)
            {
                bool flag11 = false;
                if (wrapper2.MultiKillNum == 2)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_DoubleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_DoubleKill, ref prm);
                }
                else if (wrapper2.MultiKillNum == 3)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_TripleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_TripleKill, ref prm);
                }
                else if (wrapper2.MultiKillNum == 4)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_QuataryKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_QuataryKill, ref prm);
                }
                else if (wrapper2.MultiKillNum >= 5)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_PentaKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_PentaKill, ref prm);
                }
                if (flag11 && (info == null))
                {
                    info = this._create(killer, victim, type, heroMultiKillType, type, bSelfCamp, false, flag8);
                }
            }
            if ((flag && flag4) && (actorControl.ContiKillNum >= 3))
            {
                if (actorControl.ContiKillNum >= 7)
                {
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_OdysseyBeStopped, ref prm);
                }
                if (info == null)
                {
                    info = this._create(killer, victim, KillDetailInfoType.Info_Type_StopMultiKill, heroMultiKillType, type, bSelfCamp, false, flag8);
                }
            }
            if ((flag && flag4) && !this.bFristBlood)
            {
                this.bFristBlood = true;
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_First_Kill, heroMultiKillType, type, bSelfCamp, false, flag8));
            }
            if (flag2 && ((prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1) || (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4)))
            {
                KillDetailInfo info2 = this._create(killer, victim, KillDetailInfoType.Info_Type_DestroyTower, type, type, bSelfCamp, false, flag8);
                if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0)
                {
                    Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, info2);

                    return(this._create(killer, victim, KillDetailInfoType.Info_Type_Soldier_Boosted, type, type, bSelfCamp, false, flag8));
                }
                return(info2);
            }
            if (flag && flag4)
            {
                bool flag12 = false;
                if (wrapper2.ContiKillNum == 3)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_MonsterKill;
                }
                else if (wrapper2.ContiKillNum == 4)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_DominateBattle;
                }
                else if (wrapper2.ContiKillNum == 5)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_Legendary;
                }
                else if (wrapper2.ContiKillNum == 6)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_TotalAnnihilat;
                }
                else if (wrapper2.ContiKillNum >= 7)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_Odyssey;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_Odyssey, ref prm);
                }
                if (flag12 && (info == null))
                {
                    info = this._create(killer, victim, type, type, heroContiKillType, bSelfCamp, false, flag8);
                }
            }
            if (info != null)
            {
                return(info);
            }
            if (flag && ((flag4 || flag5) || flag6))
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_Kill, type, type, bSelfCamp, false, flag8));
            }
            if (flag && this.IsAllDead(ref prm.src))
            {
                KillDetailInfo info3 = this._create(killer, victim, type, type, type, bSelfCamp, true, flag8);
                Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, info3);
            }
            if (flag3)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillDragon, type, type, bSelfCamp, false, flag8));
            }
            if (flag10)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillBIGDRAGON, type, type, bSelfCamp, false, flag8));
            }
            if (flag9)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillBARON, type, type, bSelfCamp, false, flag8));
            }
            return(null);
        }
Esempio n. 8
0
 private void onActorDead(ref GameDeadEventParam prm)
 {
     if (!prm.bImmediateRevive)
     {
         NONHERO_STATISTIC_INFO nonhero_statistic_info;
         DictionaryView <uint, NONHERO_STATISTIC_INFO> view;
         this.doDestroyStat(prm.src, prm.orignalAtker);
         if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
         {
             HeroWrapper actorControl          = prm.src.handle.ActorControl as HeroWrapper;
             CampInfo    campInfoByCamp        = null;
             PoolObjHandle <ActorRoot> inAtker = new PoolObjHandle <ActorRoot>(null);
             if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
             {
                 campInfoByCamp = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                 inAtker        = prm.orignalAtker;
             }
             else if (actorControl.IsKilledByHero() && (actorControl.LastHeroAtker != 0))
             {
                 campInfoByCamp = this.GetCampInfoByCamp(actorControl.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                 inAtker        = actorControl.LastHeroAtker;
             }
             if ((campInfoByCamp != null) && (inAtker != 0))
             {
                 campInfoByCamp.IncCampScore(prm.src, inAtker);
                 uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0x6d).dwConfValue;
                 campInfoByCamp.IncHeadPoints((int)dwConfValue, prm.src, inAtker);
             }
         }
         else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
         {
             MonsterWrapper wrapper2 = prm.src.handle.ActorControl as MonsterWrapper;
             if (wrapper2.IsKilledByHero())
             {
                 CampInfo info2 = this.GetCampInfoByCamp(wrapper2.LastHeroAtker.handle.TheActorMeta.ActorCamp);
                 DebugHelper.Assert(info2 != null);
                 if (info2 != null)
                 {
                     info2.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                 }
             }
             else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
             {
                 CampInfo info3 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp);
                 DebugHelper.Assert(info3 != null);
                 if (info3 != null)
                 {
                     info3.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker);
                 }
             }
         }
         if (((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out view) && view.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info)))
         {
             nonhero_statistic_info.uiTotalDeadNum++;
         }
         if (((prm.atker != 0) && (prm.src != 0)) && (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ))
         {
             OrganWrapper wrapper3 = prm.src.handle.ActorControl as OrganWrapper;
             if ((wrapper3 != null) && (wrapper3.cfgInfo.bOrganType == 1))
             {
                 CampInfo info4 = this.GetCampInfoByCamp(prm.atker.handle.TheActorMeta.ActorCamp);
                 if (info4 != null)
                 {
                     info4.destoryTowers++;
                     Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_TOWER_DESTROY_CHANGED);
                 }
             }
         }
     }
 }