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++;
            }
        }
        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);
                    }
                }
            }
        }
Exemple #3
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);
                 }
             }
         }
     }
 }