Example #1
0
 public void AddKillInfo(KillDetailInfo info)
 {
     if (!MonoSingleton <Reconnection> .instance.isProcessingRelayRecover)
     {
         this.AddKillInfo(KillNotifyUT.Convert_DetailInfo_KillInfo(info));
     }
 }
Example #2
0
        private void PlayKillNotify(string KillerSrc, string VictimSrc, KillDetailInfoType Type, bool bSrcAllies, bool bSelfKillORKilled, ActorTypeDef actorType)
        {
            if (Type == KillDetailInfoType.Info_Type_AllDead)
            {
                Debug.Log("---KN 播团灭");
            }
            this.Show();
            UT.ResetTimer(this.hideTimer, false);
            string str = KillNotifyUT.GetSoundEvent(Type, bSrcAllies, bSelfKillORKilled, actorType);

            if (!string.IsNullOrEmpty(str))
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(str);
            }
            string animation = KillNotifyUT.GetAnimation(Type, bSrcAllies);

            if (!string.IsNullOrEmpty(animation) && (this.animatorScript != null))
            {
                this.animatorScript.PlayAnimator(animation);
            }
            KillNotifyUT.SetImageSprite(this.KillerImg, KillerSrc);
            if (string.IsNullOrEmpty(KillerSrc))
            {
                this.SetKillerShow(false);
            }
            else
            {
                this.SetKillerShow(true);
            }
            bool flag = (((((Type == KillDetailInfoType.Info_Type_DestroyTower) || (Type == KillDetailInfoType.Info_Type_DestroyBase)) || ((Type == KillDetailInfoType.Info_Type_AllDead) || (Type == KillDetailInfoType.Info_Type_RunningMan))) || (((Type == KillDetailInfoType.Info_Type_Reconnect) || (Type == KillDetailInfoType.Info_Type_Disconnect)) || ((Type == KillDetailInfoType.Info_Type_KillDragon) || (Type == KillDetailInfoType.Info_Type_Game_Start_Wel)))) || (((Type == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3) || (Type == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5)) || ((Type == KillDetailInfoType.Info_Type_Soldier_Activate) || (Type == KillDetailInfoType.Info_Type_KillBIGDRAGON)))) || (Type == KillDetailInfoType.Info_Type_KillBARON);

            this.SetVictimShow(!flag);
            KillNotifyUT.SetImageSprite(this.VictimImg, VictimSrc);
            this.IsPlaying = true;
        }
Example #3
0
 public static string GetHero_Icon(PoolObjHandle <ActorRoot> actor, bool bSmall = false)
 {
     if (!actor)
     {
         return(string.Empty);
     }
     return(KillNotifyUT.GetHero_Icon(ref actor.get_handle().TheActorMeta, bSmall));
 }
Example #4
0
        public static string GetHero_Icon(ActorRoot actor, bool bSmall)
        {
            string result = string.Empty;

            if (actor != null)
            {
                result = KillNotifyUT.GetHero_Icon(ref actor.TheActorMeta, bSmall);
            }
            return(result);
        }
Example #5
0
        public void AddKillInfo(KillDetailInfo info)
        {
            if (MonoSingleton <Reconnection> .get_instance().isProcessingRelayRecover)
            {
                return;
            }
            KillInfo killInfo = KillNotifyUT.Convert_DetailInfo_KillInfo(info);

            this.AddKillInfo(ref killInfo);
        }
Example #6
0
        public static string GetHero_Icon(ref ActorMeta actorMeta, bool bSmall = false)
        {
            string result = string.Empty;
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorServerData = default(ActorServerData);

            if (actorDataProvider != null && actorDataProvider.GetActorServerData(ref actorMeta, ref actorServerData))
            {
                result = KillNotifyUT.GetHero_Icon((uint)actorServerData.TheActorMeta.ConfigId, 0u, bSmall);
            }
            return(result);
        }
Example #7
0
        public static List <string> GetAllAnimations()
        {
            List <string> list   = new List <string>();
            Array         values = Enum.GetValues(typeof(KillDetailInfoType));

            for (int i = 0; i < values.get_Length(); i++)
            {
                KillDetailInfoType type      = (KillDetailInfoType)((int)values.GetValue(i));
                string             animation = KillNotifyUT.GetAnimation(type, true);
                if (!string.IsNullOrEmpty(animation))
                {
                    list.Add(animation);
                }
                animation = KillNotifyUT.GetAnimation(type, false);
                if (!string.IsNullOrEmpty(animation))
                {
                    list.Add(animation);
                }
            }
            return(list);
        }
Example #8
0
        public static KillInfo Convert_DetailInfo_KillInfo(KillDetailInfo detail)
        {
            KillDetailInfoType        killDetailInfoType = KillDetailInfoType.Info_Type_None;
            PoolObjHandle <ActorRoot> killer             = detail.Killer;
            PoolObjHandle <ActorRoot> victim             = detail.Victim;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            if (killer)
            {
                flag  = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ);
                flag2 = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster);
                flag3 = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero);
            }
            KillInfo result = default(KillInfo);

            result.KillerImgSrc             = (result.VictimImgSrc = string.Empty);
            result.MsgType                  = detail.Type;
            result.bPlayerSelf_KillOrKilled = detail.bPlayerSelf_KillOrKilled;
            result.actorType                = ((!killer) ? ActorTypeDef.Invalid : killer.get_handle().TheActorMeta.ActorType);
            result.bSrcAllies               = detail.bSelfCamp;
            result.assistImgSrc             = new string[4];
            if (flag2)
            {
                result.KillerImgSrc = KillNotify.monster_icon;
            }
            if (flag)
            {
                result.KillerImgSrc = KillNotify.building_icon;
            }
            if (flag3)
            {
                result.KillerImgSrc = KillNotifyUT.GetHero_Icon(detail.Killer, false);
            }
            if (killer)
            {
                if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
                {
                    result.KillerImgSrc = KillNotify.building_icon;
                }
                if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    MonsterWrapper monsterWrapper = killer.get_handle().AsMonster();
                    if (killer.get_handle().TheActorMeta.ConfigId == Singleton <BattleLogic> .get_instance().DragonId)
                    {
                        result.KillerImgSrc = KillNotify.dragon_icon;
                    }
                    else if (monsterWrapper.cfgInfo != null && monsterWrapper.cfgInfo.bMonsterType == 2)
                    {
                        result.KillerImgSrc = KillNotify.yeguai_icon;
                    }
                    else
                    {
                        result.KillerImgSrc = KillNotify.monster_icon;
                    }
                }
                if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    result.KillerImgSrc = KillNotifyUT.GetHero_Icon(killer, false);
                }
            }
            if (victim)
            {
                if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    result.VictimImgSrc = KillNotifyUT.GetHero_Icon(victim, false);
                }
                if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
                {
                    result.VictimImgSrc = KillNotify.building_icon;
                }
                if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && victim.get_handle().TheActorMeta.ConfigId == Singleton <BattleLogic> .get_instance().DragonId)
                {
                    result.VictimImgSrc = KillNotify.dragon_icon;
                }
            }
            if (detail.assistList != null && result.assistImgSrc != null)
            {
                for (int i = 0; i < detail.assistList.get_Count(); i++)
                {
                    uint num = detail.assistList.get_Item(i);
                    for (int j = 0; j < Singleton <GameObjMgr> .get_instance().HeroActors.get_Count(); j++)
                    {
                        if (num == Singleton <GameObjMgr> .get_instance().HeroActors.get_Item(j).get_handle().ObjID)
                        {
                            result.assistImgSrc[i] = KillNotifyUT.GetHero_Icon(Singleton <GameObjMgr> .get_instance().HeroActors.get_Item(j), false);
                        }
                    }
                }
            }
            if (detail.Type == KillDetailInfoType.Info_Type_Soldier_Boosted)
            {
                result.KillerImgSrc = ((!detail.bSelfCamp) ? KillNotify.red_soldier_icon : KillNotify.blue_soldier_icon);
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_Reconnect || detail.Type == KillDetailInfoType.Info_Type_RunningMan)
            {
                result.VictimImgSrc = string.Empty;
                return(result);
            }
            if (detail.HeroMultiKillType != killDetailInfoType)
            {
                result.MsgType = detail.HeroMultiKillType;
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_StopMultiKill)
            {
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_First_Kill)
            {
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_DestroyTower)
            {
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || detail.Type == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || detail.Type == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon)
            {
                if (flag2)
                {
                    result.KillerImgSrc = KillNotify.monster_icon;
                }
                if (flag)
                {
                    result.KillerImgSrc = KillNotify.building_icon;
                }
                if (flag3)
                {
                    result.KillerImgSrc = KillNotifyUT.GetHero_Icon(detail.Killer, false);
                }
                result.bSrcAllies = detail.bSelfCamp;
                return(result);
            }
            if (detail.bAllDead)
            {
                result.MsgType = KillDetailInfoType.Info_Type_AllDead;
                return(result);
            }
            if (detail.HeroContiKillType != killDetailInfoType)
            {
                result.MsgType = detail.HeroContiKillType;
                return(result);
            }
            if (detail.Type == KillDetailInfoType.Info_Type_Kill)
            {
                return(result);
            }
            return(result);
        }
Example #9
0
        private void PlayKillNotify(ref KillInfo killInfo)
        {
            string killerImgSrc = killInfo.KillerImgSrc;
            string victimImgSrc = killInfo.VictimImgSrc;

            string[]           assistImgSrc       = killInfo.assistImgSrc;
            KillDetailInfoType msgType            = killInfo.MsgType;
            bool         bSrcAllies               = killInfo.bSrcAllies;
            bool         bPlayerSelf_KillOrKilled = killInfo.bPlayerSelf_KillOrKilled;
            ActorTypeDef actorType = killInfo.actorType;
            string       spt       = (!bSrcAllies) ? KillNotify.red_assist_frame_icon : KillNotify.blue_assist_frame_icon;

            if (msgType == KillDetailInfoType.Info_Type_AllDead)
            {
                Debug.Log("---KN 播团灭");
            }
            this.Show();
            UT.ResetTimer(this.hideTimer, false);
            string soundEvent = KillNotifyUT.GetSoundEvent(msgType, bSrcAllies, bPlayerSelf_KillOrKilled, actorType);

            if (!string.IsNullOrEmpty(soundEvent))
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(soundEvent);
            }
            string animation = KillNotifyUT.GetAnimation(msgType, bSrcAllies);

            if (!string.IsNullOrEmpty(animation) && this.animatorScript != null)
            {
                this.animatorScript.PlayAnimator(animation);
            }
            KillNotifyUT.SetImageSprite(this.KillerImg, killerImgSrc);
            if (string.IsNullOrEmpty(killerImgSrc))
            {
                this.SetKillerShow(false);
            }
            else
            {
                this.SetKillerShow(true);
            }
            bool flag = msgType == KillDetailInfoType.Info_Type_DestroyTower || msgType == KillDetailInfoType.Info_Type_DestroyBase || msgType == KillDetailInfoType.Info_Type_AllDead || msgType == KillDetailInfoType.Info_Type_RunningMan || msgType == KillDetailInfoType.Info_Type_Reconnect || msgType == KillDetailInfoType.Info_Type_Disconnect || msgType == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || msgType == KillDetailInfoType.Info_Type_Game_Start_Wel || msgType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3 || msgType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5 || msgType == KillDetailInfoType.Info_Type_Soldier_Activate || msgType == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || msgType == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon;

            this.SetVictimShow(!flag);
            KillNotifyUT.SetImageSprite(this.VictimImg, victimImgSrc);
            int num = 0;

            if (assistImgSrc != null)
            {
                for (int i = 0; i < 4; i++)
                {
                    if (!string.IsNullOrEmpty(assistImgSrc[i]))
                    {
                        if (this.assistHeads[i].gameObject != null)
                        {
                            this.assistHeads[i].gameObject.CustomSetActive(true);
                        }
                        KillNotifyUT.SetImageSprite(this.assistHeads[i], assistImgSrc[i]);
                        KillNotifyUT.SetImageSprite(this.assistHeadFrames[i], spt);
                        num++;
                    }
                    else if (this.assistHeads[i].gameObject != null)
                    {
                        this.assistHeads[i].gameObject.CustomSetActive(false);
                    }
                }
            }
            this.assistList.CustomSetActive(num > 0);
            this.IsPlaying = true;
        }
        private void PlayKillNotify(ref KillInfo killInfo)
        {
            string killerImgSrc = killInfo.KillerImgSrc;
            string victimImgSrc = killInfo.VictimImgSrc;

            string[]           assistImgSrc       = killInfo.assistImgSrc;
            KillDetailInfoType killDetailInfoType = killInfo.MsgType;
            bool         bSrcAllies = killInfo.bSrcAllies;
            bool         bPlayerSelf_KillOrKilled = killInfo.bPlayerSelf_KillOrKilled;
            ActorTypeDef actorType = killInfo.actorType;
            string       spt       = bSrcAllies ? KillNotify.blue_assist_frame_icon : KillNotify.red_assist_frame_icon;

            this.Show();
            UT.ResetTimer(this.hideTimer, false);
            string soundEvent = KillNotifyUT.GetSoundEvent(killDetailInfoType, bSrcAllies, bPlayerSelf_KillOrKilled, actorType);

            if (!string.IsNullOrEmpty(soundEvent))
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(soundEvent);
            }
            string animation = KillNotifyUT.GetAnimation(killDetailInfoType, bSrcAllies);

            if (!string.IsNullOrEmpty(animation) && this.animatorScript != null)
            {
                this.animatorScript.PlayAnimator(animation);
            }
            KillNotifyUT.SetImageSprite(this.KillerImg, killerImgSrc);
            if (string.IsNullOrEmpty(killerImgSrc) || killInfo.bSuicide)
            {
                this.SetKillerShow(false);
            }
            else
            {
                this.SetKillerShow(true);
            }
            bool flag = killDetailInfoType == KillDetailInfoType.Info_Type_DestroyTower || killDetailInfoType == KillDetailInfoType.Info_Type_DestroyBase || killDetailInfoType == KillDetailInfoType.Info_Type_AllDead || killDetailInfoType == KillDetailInfoType.Info_Type_RunningMan || killDetailInfoType == KillDetailInfoType.Info_Type_Reconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Disconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || killDetailInfoType == KillDetailInfoType.Info_Type_Game_Start_Wel || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon || killDetailInfoType == KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide;

            this.SetVictimShow(!flag);
            KillNotifyUT.SetImageSprite(this.VictimImg, victimImgSrc);
            int num = 0;

            if (assistImgSrc != null && killDetailInfoType != KillDetailInfoType.Info_Type_AllDead)
            {
                for (int i = 0; i < 4; i++)
                {
                    if (!string.IsNullOrEmpty(assistImgSrc[i]))
                    {
                        if (this.assistHeads[i].gameObject != null)
                        {
                            this.assistHeads[i].gameObject.CustomSetActive(true);
                        }
                        KillNotifyUT.SetImageSprite(this.assistHeads[i], assistImgSrc[i]);
                        KillNotifyUT.SetImageSprite(this.assistHeadFrames[i], spt);
                        num++;
                    }
                    else if (this.assistHeads[i].gameObject != null)
                    {
                        this.assistHeads[i].gameObject.CustomSetActive(false);
                    }
                }
            }
            this.assistList.CustomSetActive(num > 0);
            this.IsPlaying = true;
            bool flag2 = false;

            if (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null && Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain&& Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle.ObjID == killInfo.killerObjID)
            {
                flag2 = true;
            }
            if ((killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey || killDetailInfoType == KillDetailInfoType.Info_Type_QuataryKill || killDetailInfoType == KillDetailInfoType.Info_Type_PentaKill || killDetailInfoType == KillDetailInfoType.Info_Type_TripleKill) && flag2)
            {
                if (killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey)
                {
                    killDetailInfoType = KillDetailInfoType.Info_Type_Legendary;
                }
                MonoSingleton <TGPSDKSys> .GetInstance().SendGameEvent2(killDetailInfoType);
            }
        }
Example #11
0
 public static string GetHero_Icon(ref ActorMeta actorMeta, bool bSmall = false)
 {
     return(KillNotifyUT.GetHero_Icon((uint)actorMeta.ConfigId, 0u, bSmall));
 }
        private void InitHeroPanelHeroInfo(uint uiObjId, Transform trHeroPanel, CHostHeroDamage objHostHeroDamage)
        {
            if (trHeroPanel == null || objHostHeroDamage == null)
            {
                return;
            }
            Transform transform = trHeroPanel.FindChild("PanelTop");

            if (transform)
            {
                int          num          = 0;
                string       text         = null;
                string       text2        = null;
                byte         b            = 0;
                byte         b2           = 0;
                ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num, ref b, ref b2))
                {
                    Transform transform2 = transform.FindChild("Imghead");
                    if (transform2)
                    {
                        Transform transform3 = transform2.FindChild("head");
                        if (transform3)
                        {
                            Image component = transform3.GetComponent <Image>();
                            if (component)
                            {
                                string prefabPath;
                                if (actorTypeDef == ActorTypeDef.Actor_Type_Hero)
                                {
                                    string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)num, 0u);
                                    prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + heroSkinPic;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Organ)
                                {
                                    prefabPath = KillNotifyUT.Convert_DetailInfo_KillInfo(new KillDetailInfo
                                    {
                                        Killer = Singleton <GameObjMgr> .instance.GetActor(uiObjId)
                                    }).KillerImgSrc;
                                }
                                else if (actorTypeDef == ActorTypeDef.Actor_Type_Monster)
                                {
                                    ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(num);
                                    if (dataCfgInfoByCurLevelDiff != null && !string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon))
                                    {
                                        prefabPath = dataCfgInfoByCurLevelDiff.szBossIcon;
                                    }
                                    else if (b2 == 1)
                                    {
                                        prefabPath = KillNotify.monster_icon;
                                    }
                                    else if (b == 7)
                                    {
                                        prefabPath = CHostHeroDeadInfo.m_dragon_icon_3v3;
                                    }
                                    else if (b == 9)
                                    {
                                        prefabPath = KillNotify.dragon_icon;
                                    }
                                    else if (b == 8)
                                    {
                                        prefabPath = CHostHeroDeadInfo.m_strDragonBig;
                                    }
                                    else
                                    {
                                        prefabPath = KillNotify.yeguai_icon;
                                    }
                                }
                                else
                                {
                                    prefabPath = KillNotify.monster_icon;
                                }
                                component.SetSprite(prefabPath, this.m_heroDeadInfoForm, true, false, false, false);
                            }
                        }
                    }
                    Transform transform4 = transform.FindChild("heroName");
                    if (transform4)
                    {
                        Text component2 = transform4.GetComponent <Text>();
                        if (component2)
                        {
                            string text3 = text;
                            if (!string.IsNullOrEmpty(text3))
                            {
                                int    num2  = text3.IndexOf('(');
                                string text4 = text3.Substring(num2 + 1, text3.get_Length() - num2 - 2);
                                component2.set_text(text4);
                            }
                        }
                    }
                    Transform transform5 = transform.FindChild("playerName");
                    if (transform5)
                    {
                        Text component3 = transform5.GetComponent <Text>();
                        if (component3)
                        {
                            if (!string.IsNullOrEmpty(text2))
                            {
                                component3.set_text(text2);
                                transform5.gameObject.CustomSetActive(true);
                            }
                            else
                            {
                                transform5.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                }
            }
        }