private void onActorUseSkill(ref ActorSkillEventParam _prm)
 {
     if (this.localParams[1] == 1)
     {
         if (!this.sourceActor || this.sourceActor.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
         {
             return;
         }
         HeroWrapper heroWrapper = this.sourceActor.handle.ActorControl as HeroWrapper;
         if (heroWrapper == null || heroWrapper.GetCallActor() != _prm.src)
         {
             return;
         }
     }
     else if (_prm.src != this.sourceActor)
     {
         return;
     }
     if (this.localParams[0] == 0)
     {
         this.bTrigger = true;
     }
     else if ((this.localParams[0] & 1 << (int)_prm.slot) > 0)
     {
         this.bTrigger = true;
     }
 }
        public void ChangeGoldCoinInBattle(int changeValue, bool isIncome, bool floatDigit = false, Vector3 position = default(Vector3), bool isLastHit = false, PoolObjHandle <ActorRoot> target = default(PoolObjHandle <ActorRoot>))
        {
            int num = this.m_goldCoinInBattle;

            this.m_goldCoinInBattle += changeValue;
            if (changeValue > 0 && isIncome)
            {
                this.m_goldCoinIncomeInBattle   += changeValue;
                this.m_MaxGoldCoinIncomeInBattle = ((this.m_MaxGoldCoinIncomeInBattle > changeValue) ? this.m_MaxGoldCoinIncomeInBattle : changeValue);
            }
            DebugHelper.Assert(this.m_goldCoinInBattle >= 0, "Wo ri, zhe zenme keneng");
            bool        flag        = false;
            HeroWrapper heroWrapper = this.actorPtr.handle.ActorControl as HeroWrapper;

            if (heroWrapper != null)
            {
                PoolObjHandle <ActorRoot> callActor = heroWrapper.GetCallActor();
                if (callActor && callActor.handle.Visible && ActorHelper.IsHostCtrlActor(ref callActor))
                {
                    flag = true;
                }
            }
            if (floatDigit && changeValue > 0 && isIncome && ((this.actor.Visible && ActorHelper.IsHostCtrlActor(ref this.actorPtr)) || flag))
            {
                if (position.x == 0f && position.y == 0f && position.z == 0f)
                {
                    position = this.actor.myTransform.position;
                }
                Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(changeValue, isLastHit ? DIGIT_TYPE.ReceiveLastHitGoldCoinInBattle : DIGIT_TYPE.ReceiveGoldCoinInBattle, position);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", this.actorPtr, changeValue, isIncome, target);
        }
Beispiel #3
0
        public static string GetResourceName(ref PoolObjHandle <ActorRoot> _attack, string _resName, bool _bUseAdvanceSkin)
        {
            uint num;

            if (((_attack == 0) || (_attack.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) || (_attack.handle.ActorControl == null))
            {
                return(_resName);
            }
            HeroWrapper actorControl = (HeroWrapper)_attack.handle.ActorControl;

            if ((actorControl == null) || !actorControl.GetSkinCfgID(out num))
            {
                return(_resName);
            }
            int           length   = _resName.LastIndexOf('/');
            StringBuilder builder  = new StringBuilder(_resName);
            StringBuilder builder2 = new StringBuilder(actorControl.GetSkinEffectPath());

            if (length < 0)
            {
                return(_resName);
            }
            builder.Remove(0, length);
            builder2.Append(builder);
            if (_bUseAdvanceSkin)
            {
                int advanceSkinIndex = actorControl.GetAdvanceSkinIndex();
                if (advanceSkinIndex > 0)
                {
                    builder2.AppendFormat("_level{0}", advanceSkinIndex);
                }
            }
            return(builder2.ToString());
        }
Beispiel #4
0
        public static string GetResourceName(AGE.Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            uint            num;
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (((refParamObject == null) || (refParamObject.Originator == 0)) || ((refParamObject.Originator.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero) || (refParamObject.Originator.handle.ActorControl == null)))
            {
                return(_resName);
            }
            HeroWrapper actorControl = (HeroWrapper)refParamObject.Originator.handle.ActorControl;

            if ((actorControl == null) || !actorControl.GetSkinCfgID(out num))
            {
                return(_resName);
            }
            int           length   = _resName.LastIndexOf('/');
            StringBuilder builder  = new StringBuilder(_resName);
            StringBuilder builder2 = new StringBuilder(actorControl.GetSkinEffectPath());

            if (length < 0)
            {
                return(_resName);
            }
            builder.Remove(0, length);
            builder2.Append(builder);
            if (_bUseAdvanceSkin)
            {
                int advanceSkinIndex = actorControl.GetAdvanceSkinIndex();
                if (advanceSkinIndex > 0)
                {
                    builder2.AppendFormat("_level{0}", advanceSkinIndex);
                }
            }
            return(builder2.ToString());
        }
        private int GetHeroKillOrDeadState(ref PoolObjHandle <ActorRoot> target)
        {
            int result = 0;

            if (target)
            {
                HeroWrapper heroWrapper = target.handle.ActorControl as HeroWrapper;
                if (heroWrapper != null)
                {
                    if (heroWrapper.ContiKillNum > 0)
                    {
                        if (heroWrapper.ContiKillNum >= 7)
                        {
                            result = 7;
                        }
                        else
                        {
                            result = heroWrapper.ContiKillNum;
                        }
                    }
                    else if (heroWrapper.ContiDeadNum >= 7)
                    {
                        result = -7;
                    }
                    else
                    {
                        result = -heroWrapper.ContiDeadNum;
                    }
                }
            }
            return(result);
        }
Beispiel #6
0
 public void SetIndicatorToCallMonster()
 {
     if (this.skillSlot != null && this.skillSlot.Actor)
     {
         HeroWrapper heroWrapper = this.skillSlot.Actor.handle.ActorControl as HeroWrapper;
         if (heroWrapper != null && heroWrapper.hasCalledMonster)
         {
             if (this.guidePrefab != null)
             {
                 this.guidePrefab.transform.SetParent(heroWrapper.CallMonster.handle.myTransform);
                 this.guidePrefab.transform.localPosition = Vector3.zero;
             }
             if (this.guideWarnPrefab != null)
             {
                 this.guideWarnPrefab.transform.SetParent(heroWrapper.CallMonster.handle.myTransform);
                 this.guideWarnPrefab.transform.localPosition = Vector3.zero;
             }
             if (this.fixedPrefab != null)
             {
                 this.fixedPrefab.transform.SetParent(heroWrapper.CallMonster.handle.myTransform);
                 this.fixedPrefab.transform.localPosition = Vector3.zero;
             }
             if (this.fixedWarnPrefab != null)
             {
                 this.fixedWarnPrefab.transform.SetParent(heroWrapper.CallMonster.handle.myTransform);
                 this.fixedWarnPrefab.transform.localPosition = Vector3.zero;
             }
         }
     }
 }
        public static string GetResourceName(Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (refParamObject != null && refParamObject.Originator && refParamObject.Originator.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && refParamObject.Originator.get_handle().ActorControl != null)
            {
                HeroWrapper heroWrapper = (HeroWrapper)refParamObject.Originator.get_handle().ActorControl;
                uint        num;
                if (heroWrapper != null && heroWrapper.GetSkinCfgID(out num))
                {
                    int           num2           = _resName.LastIndexOf('/');
                    StringBuilder stringBuilder  = new StringBuilder(_resName);
                    StringBuilder stringBuilder2 = new StringBuilder(heroWrapper.GetSkinEffectPath());
                    if (num2 >= 0)
                    {
                        stringBuilder.Remove(0, num2);
                        stringBuilder2.Append(stringBuilder);
                        if (_bUseAdvanceSkin)
                        {
                            int advanceSkinIndex = heroWrapper.GetAdvanceSkinIndex();
                            if (advanceSkinIndex > 0)
                            {
                                stringBuilder2.AppendFormat("_level{0}", advanceSkinIndex);
                            }
                        }
                        return(stringBuilder2.ToString());
                    }
                }
            }
            return(_resName);
        }
 public static string GetResourceName(ref PoolObjHandle <ActorRoot> _attack, string _resName, bool _bUseAdvanceSkin)
 {
     if (_attack && _attack.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && _attack.get_handle().ActorControl != null)
     {
         HeroWrapper heroWrapper = (HeroWrapper)_attack.get_handle().ActorControl;
         uint        num;
         if (heroWrapper != null && heroWrapper.GetSkinCfgID(out num))
         {
             int           num2           = _resName.LastIndexOf('/');
             StringBuilder stringBuilder  = new StringBuilder(_resName);
             StringBuilder stringBuilder2 = new StringBuilder(heroWrapper.GetSkinEffectPath());
             if (num2 >= 0)
             {
                 stringBuilder.Remove(0, num2);
                 stringBuilder2.Append(stringBuilder);
                 if (_bUseAdvanceSkin)
                 {
                     int advanceSkinIndex = heroWrapper.GetAdvanceSkinIndex();
                     if (advanceSkinIndex > 0)
                     {
                         stringBuilder2.AppendFormat("_level{0}", advanceSkinIndex);
                     }
                 }
                 return(stringBuilder2.ToString());
             }
         }
     }
     return(_resName);
 }
        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++;
            }
        }
Beispiel #10
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            bool   flag   = curLvelContext != null && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt)) && player.Captain && player.Captain.get_handle().ActorControl is HeroWrapper)
            {
                HeroWrapper heroWrapper = (HeroWrapper)player.Captain.get_handle().ActorControl;
                heroWrapper.bGodMode = ((int)this.IsGodMode != 0);
            }
        }
Beispiel #11
0
 private bool GetCallMonster()
 {
     if (this.sourceActor && this.sourceActor.handle.ActorControl is HeroWrapper)
     {
         HeroWrapper heroWrapper = this.sourceActor.handle.ActorControl as HeroWrapper;
         if (heroWrapper.hasCalledMonster)
         {
             this.callMonster = heroWrapper.CallMonster;
             return(true);
         }
     }
     return(false);
 }
Beispiel #12
0
        public void ExecCommand(IFrameCommand cmd)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            bool   flag   = (curLvelContext != null) && curLvelContext.IsMobaMode();
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (((player != null) && ((flag && player.isGM) || (!flag && LobbyMsgHandler.isHostGMAcnt))) && ((player.Captain != 0) && (player.Captain.handle.ActorControl is HeroWrapper)))
            {
                HeroWrapper actorControl = (HeroWrapper)player.Captain.handle.ActorControl;
                actorControl.bGodMode = this.IsGodMode != 0;
            }
        }
 public void SetHostActorInfo(ref PoolObjHandle <ActorRoot> InHostActor, SkillSlotType InSpawnSkillSlot, bool bInCopyedHeroInfo, bool bSuicideWhenHostDead, bool bDrageToHostWhenTooFarAway, bool bUseHostValueProperty)
 {
     this.HostActor                 = InHostActor;
     this.SpawnSkillSlot            = InSpawnSkillSlot;
     this.isDisplayHeroInfo         = bInCopyedHeroInfo;
     this.suicideWhenHostDead       = bSuicideWhenHostDead;
     this.drageToHostWhenTooFarAway = bDrageToHostWhenTooFarAway;
     this.useHostValueProperty      = bUseHostValueProperty;
     if (this.HostActor)
     {
         if (this.suicideWhenHostDead)
         {
             this.HostActor.handle.ActorControl.eventActorDead += new ActorDeadEventHandler(this.OnActorDead);
         }
         HeroWrapper heroWrapper = this.HostActor.handle.ActorControl as HeroWrapper;
         if (heroWrapper != null)
         {
             heroWrapper.CallMonster = this.actorPtr;
         }
     }
 }
Beispiel #14
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);
                 }
             }
         }
     }
 }
Beispiel #15
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);
            }
        }
Beispiel #16
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++;
             }
         }
     }
 }
Beispiel #17
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;
             }
         }
     }
 }
Beispiel #19
0
        public uint GetHeroKilledIncome(HeroWrapper heroWrapper, enIncomeType incomeType)
        {
            if (heroWrapper == null)
            {
                return(0);
            }
            int             key       = 0;
            ResSoulAddition dataByKey = null;

            if (heroWrapper.ContiKillNum > 0)
            {
                if (heroWrapper.ContiKillNum >= 7)
                {
                    key = 7;
                }
                else
                {
                    key = heroWrapper.ContiKillNum;
                }
                dataByKey = GameDataMgr.soulAdditionDatabin.GetDataByKey(key);
            }
            else
            {
                if (heroWrapper.ContiDeadNum >= 7)
                {
                    key = -7;
                }
                else
                {
                    key = -heroWrapper.ContiDeadNum;
                }
                dataByKey = GameDataMgr.soulAdditionDatabin.GetDataByKey(key);
            }
            int iExpAddRate = 0x2710;

            if (dataByKey != null)
            {
                if (incomeType == enIncomeType.Soul)
                {
                    iExpAddRate = dataByKey.iExpAddRate;
                }
                else if (incomeType == enIncomeType.GoldCoinInBattle)
                {
                    iExpAddRate = dataByKey.iGoldCoinInBattleAddRate;
                }
            }
            int actorSoulLevel              = heroWrapper.actor.ValueComponent.actorSoulLevel;
            ResSoulLvlUpInfo info           = this.QuerySoulLvlUpInfo((uint)actorSoulLevel);
            uint             dwKilledExp    = 0;
            uint             dwExtraKillExp = 0;

            if (info != null)
            {
                if (incomeType == enIncomeType.Soul)
                {
                    dwKilledExp    = info.dwKilledExp;
                    dwExtraKillExp = info.dwExtraKillExp;
                }
                else if (incomeType == enIncomeType.GoldCoinInBattle)
                {
                    dwKilledExp    = info.wKillGoldCoinInBattle;
                    dwExtraKillExp = info.wExtraKillGoldCoinInBattle;
                }
            }
            uint num8 = (uint)((dwKilledExp * iExpAddRate) / ((ulong)0x2710L));

            if ((Singleton <BattleStatistic> .instance.GetCampScore(COM_PLAYERCAMP.COM_PLAYERCAMP_1) + Singleton <BattleStatistic> .instance.GetCampScore(COM_PLAYERCAMP.COM_PLAYERCAMP_2)) == 1)
            {
                num8 += dwExtraKillExp;
            }
            return(num8);
        }
        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);
                    }
                }
            }
        }
Beispiel #21
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);
        }