Exemplo n.º 1
0
 public void OnGroupLeft(long oldGroup)
 {
     for (int num = m_allies.Count - 1; num >= 0; num--)
     {
         FightPlayerInfo fightPlayerInfo = m_allies[num];
         RemoveAlly(fightPlayerInfo);
         m_allies.Remove(fightPlayerInfo);
     }
 }
Exemplo n.º 2
0
        public void AddPlayer(FightPlayerInfo player)
        {
            MatchmakingPlayerElement matchmakingPlayerElement = FirstFreeElement();

            if (matchmakingPlayerElement != null)
            {
                matchmakingPlayerElement.SetPlayer(player);
                matchmakingPlayerElement.SetState(MatchmakingPlayerElement.InviteState.Normal);
            }
            UpdateInviteResearch();
        }
Exemplo n.º 3
0
        private void OnInvitationDeclined(FightPlayerInfo player)
        {
            MatchmakingPlayerElement matchmakingPlayerElement = FindElement(player.Uid);

            if (matchmakingPlayerElement != null)
            {
                matchmakingPlayerElement.SetState(MatchmakingPlayerElement.InviteState.Normal);
                UpdateInviteResearch();
            }
            onInvitationDeclined?.Invoke(player);
        }
Exemplo n.º 4
0
 private bool PlayerListContain(IList <FightPlayerInfo> players, long id)
 {
     for (int i = 0; i < players.Count; i++)
     {
         FightPlayerInfo fightPlayerInfo = players[i];
         if (id == fightPlayerInfo.Uid)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 5
0
 public void ReceiveInvitationResult(long uid, bool result)
 {
     if (!result)
     {
         MatchmakingPlayerElement matchmakingPlayerElement = FindElement(uid);
         if (matchmakingPlayerElement != null && matchmakingPlayerElement.state == MatchmakingPlayerElement.InviteState.Invited_By_Me)
         {
             FightPlayerInfo player = matchmakingPlayerElement.player;
             MatchmakingPopupHandler.instance.ShowMessage(MatchmakingPopupHandler.MessageType.InvitationFail, player);
             matchmakingPlayerElement.SetState(MatchmakingPlayerElement.InviteState.Normal);
             UpdateInviteResearch();
         }
     }
 }
Exemplo n.º 6
0
        public void InitFightData()
        {
            List <FightHeroInfo> fightHeroInfoList = new List <FightHeroInfo>();

            for (int i = 0, count = heros.Count; i < count; i++)
            {
                FirstFightCharacterData ffcd = heros[i];
                if (ffcd.isRole)
                {
                    PlayerInfo playerInfo = new PlayerInfo((uint)ffcd.id);
                    playerInfo.advanceLevel = ffcd.starLevel;
                    PlayerFightProtoData pfpd = new PlayerFightProtoData();
                    pfpd.posIndex  = (int)ffcd.formationPosition;
                    pfpd.attr      = new HeroAttrProtoData();
                    pfpd.attr.hp   = (int)ffcd.hp;
                    pfpd.attr.hpUp = (int)ffcd.hp;
                    FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(playerInfo, pfpd);
                    FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                }
                else
                {
                    HeroInfo heroInfo = new HeroInfo(ffcd.id);
                    heroInfo.advanceLevel = ffcd.starLevel;
                    HeroFightProtoData hfpd = new HeroFightProtoData();
                    hfpd.posIndex  = (int)ffcd.formationPosition;
                    hfpd.attr      = new HeroAttrProtoData();
                    hfpd.attr.hp   = (int)ffcd.hp;
                    hfpd.attr.hpUp = (int)ffcd.hp;
                    FightHeroInfo fightHeroInfo = new FightHeroInfo(heroInfo, hfpd);
                    fightHeroInfoList.Add(fightHeroInfo);
                }
            }
            FightProxy.instance.SetFightHeroInfoList(fightHeroInfoList);
            List <FightHeroInfo> enemyFightHeroInfoList = new List <FightHeroInfo>();

            for (int i = 0, count = enemies.Count; i < count; i++)
            {
                FirstFightCharacterData ffcd = enemies[i];
                HeroInfo heroInfo            = new HeroInfo(ffcd.id);
                heroInfo.advanceLevel = ffcd.starLevel;
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex  = (int)ffcd.formationPosition;
                hfpd.attr      = new HeroAttrProtoData();
                hfpd.attr.hp   = (int)ffcd.hp;
                hfpd.attr.hpUp = (int)ffcd.hp;
                FightHeroInfo fightHeroInfo = new FightHeroInfo(heroInfo, hfpd);
                enemyFightHeroInfoList.Add(fightHeroInfo);
            }
            FightProxy.instance.SetEnemyFightHeroInfoList(enemyFightHeroInfoList);
        }
 public void SetPlayer([CanBeNull] FightPlayerInfo player)
 {
     m_player = player;
     if (player != null)
     {
         m_name.SetText(player.Info.Nickname);
         m_name.get_gameObject().SetActive(true);
         SetState(InviteState.Normal);
     }
     else
     {
         SetState(InviteState.Empty);
     }
 }
Exemplo n.º 8
0
        public void InvitationReceiveFrom(FightPlayerInfo player)
        {
            MatchmakingPlayerElement matchmakingPlayerElement = FindElement(player.Uid);

            if (matchmakingPlayerElement != null)
            {
                matchmakingPlayerElement.SetState(MatchmakingPlayerElement.InviteState.Invite_Me);
                UpdateInviteResearch();
            }
            MatchmakingPopupHandler.instance.ShowMessage(MatchmakingPopupHandler.MessageType.InvitationReceived, player, delegate
            {
                OnInvitationDeclined(player);
            }, delegate
            {
                OnInvitationAccepted(player);
            });
        }
Exemplo n.º 9
0
        private void RemoveAlly(FightPlayerInfo player)
        {
            MatchmakingPopupHandler.instance.ShowMessage(MatchmakingPopupHandler.MessageType.PlayerLeaveGroup, player);
            int num = 1;

            while (true)
            {
                if (num < m_playerPanels.Length)
                {
                    if (m_playerPanels[num].playerId == player.Uid)
                    {
                        break;
                    }
                    num++;
                    continue;
                }
                return;
            }
            m_playerPanels[num].SetEmpty(tween: true);
        }
Exemplo n.º 10
0
        private void AddAlly(FightPlayerInfo player)
        {
            int num = 1;

            while (true)
            {
                if (num < m_playerPanels.Length)
                {
                    if (m_playerPanels[num].isEmpty)
                    {
                        break;
                    }
                    num++;
                    continue;
                }
                return;
            }
            Tuple <SquadDefinition, SquadFakeData> squadDataByWeaponId = GetSquadDataByWeaponId(player.WeaponId.Value);

            m_playerPanels[num].Set(player, player.Level, squadDataByWeaponId.Item2, tween: true);
        }
Exemplo n.º 11
0
 public void OnGroupModified(long playerId, IList <FightPlayerInfo> players)
 {
     for (int num = m_allies.Count - 1; num >= 0; num--)
     {
         FightPlayerInfo fightPlayerInfo = m_allies[num];
         if (!PlayerListContain(players, fightPlayerInfo.Uid))
         {
             RemoveAlly(fightPlayerInfo);
             m_allies.Remove(fightPlayerInfo);
         }
     }
     for (int i = 0; i < players.Count; i++)
     {
         FightPlayerInfo fightPlayerInfo2 = players[i];
         if (playerId != fightPlayerInfo2.Uid && !PlayerListContain(m_allies, fightPlayerInfo2.Uid))
         {
             AddAlly(fightPlayerInfo2);
             m_allies.Add(fightPlayerInfo2);
         }
     }
     m_playerInvitationPanel.RemoveAllReceivedInvitations();
     m_playerInvitationPanel.SetInvitationsLocked(m_allies.Count + 1 >= m_playerPanels.Length);
     InactivityHandler.UpdateActivity();
 }
Exemplo n.º 12
0
 private void OnCancelInvitationClick(MatchmakingPlayerElement element, FightPlayerInfo player)
 {
     element.SetState(MatchmakingPlayerElement.InviteState.Normal);
     UpdateInviteResearch();
     onInvitationCanceled?.Invoke(player);
 }
Exemplo n.º 13
0
 private void OnSendInvitationClick(MatchmakingPlayerElement element, FightPlayerInfo player)
 {
     element.SetState(MatchmakingPlayerElement.InviteState.Invited_By_Me);
     UpdateInviteResearch();
     onInvitationSend?.Invoke(player);
 }
Exemplo n.º 14
0
 public void Set(FightPlayerInfo player, int level, SquadFakeData fakeData, bool tween = false)
 {
     playerId = player.Uid;
     Set(player.Info.Nickname, level, fakeData, tween);
 }
Exemplo n.º 15
0
 private void OnInvitationAccepted(FightPlayerInfo player)
 {
     onInvitationAccepted?.Invoke(player);
 }
Exemplo n.º 16
0
        public void ClickSkillDisplayHandler()
        {
            //			Logic.UI.Tips.View.CommonAutoDestroyTipsView.Open("暂未开放");
            //			return;
            Dictionary <RoleAttributeType, RoleAttribute> attrDic = RoleUtil.CalcRoleAttributesDic(_roleInfo);

            if (_roleInfo is PlayerInfo)
            {
                PlayerFightProtoData pfpd = new PlayerFightProtoData();
                pfpd.posIndex        = 5;
                pfpd.attr            = new HeroAttrProtoData();
                pfpd.attr.hpUp       = pfpd.attr.hp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                pfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                pfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                pfpd.attr.normal_def = pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                pfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                pfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                pfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                pfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                pfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                pfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                pfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                pfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                pfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                pfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                pfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                pfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                pfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //pfpd.attr.hit = 100;
                FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(_roleInfo as PlayerInfo, pfpd);
                FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                FightProxy.instance.SetFightHeroInfoList(new List <FightHeroInfo>());
            }
            else
            {
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex        = 5;
                hfpd.attr            = new HeroAttrProtoData();
                hfpd.attr.hp         = hfpd.attr.hpUp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                hfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                hfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                hfpd.attr.normal_def = hfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                hfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                hfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                hfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                hfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                hfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                hfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                hfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                hfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                hfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                hfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                hfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                hfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                hfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //hfpd.attr.hit = 100;
                FightHeroInfo        fightHeroInfo = new FightHeroInfo(_roleInfo as HeroInfo, hfpd);
                List <FightHeroInfo> heroInfoList  = new List <FightHeroInfo>();
                heroInfoList.Add(fightHeroInfo);
                FightProxy.instance.SetFightHeroInfoList(heroInfoList);
            }
            //enemy
            HeroInfo           enemyHero = new HeroInfo(HeroData.HeroDataDictionary.First().Key);
            HeroFightProtoData ehfpd     = new HeroFightProtoData();

            ehfpd.posIndex = 5;
            ehfpd.attr     = new HeroAttrProtoData();
            ehfpd.attr.hp  = ehfpd.attr.hpUp = 100000;
            //			ehfpd.attr.magic_atk = 1;
            //			ehfpd.attr.normal_atk = 1;
            ehfpd.attr.speed = 25;
            FightHeroInfo        efightHeroInfo = new FightHeroInfo(enemyHero, ehfpd);
            List <FightHeroInfo> eheroInfoList  = new List <FightHeroInfo>();

            eheroInfoList.Add(efightHeroInfo);
            FightProxy.instance.SetEnemyFightHeroInfoList(eheroInfoList);


            UI.UIMgr.instance.Close(Logic.UI.EUISortingLayer.MainUI);
            FightController.instance.fightType = Logic.Enums.FightType.SkillDisplay;
            Logic.UI.LoadGame.Controller.LoadGameController.instance.SetDelayTime(0.5f, LoadFinishedCallback);
        }
Exemplo n.º 17
0
        public static void ClickIllustrationSkillDisplayHandler(LuaTable roleInfoLuaTable, bool isPlayer)
        {
            RoleInfo _roleInfo = null;

            if (isPlayer)
            {
                _roleInfo = new PlayerInfo(roleInfoLuaTable);
            }
            else
            {
                _roleInfo = new HeroInfo(roleInfoLuaTable);
            }
            Dictionary <RoleAttributeType, RoleAttribute> attrDic = RoleUtil.CalcRoleAttributesDic(_roleInfo);

            if (_roleInfo is PlayerInfo)
            {
                PlayerFightProtoData pfpd = new PlayerFightProtoData();
                pfpd.posIndex        = 5;
                pfpd.attr            = new HeroAttrProtoData();
                pfpd.attr.hpUp       = pfpd.attr.hp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                pfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                pfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                pfpd.attr.normal_def = pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                pfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                pfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                pfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                pfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                pfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                pfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                pfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                pfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                pfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                pfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                pfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                pfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                pfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //pfpd.attr.hit = 100;
                FightPlayerInfo fightPlayerInfo = new FightPlayerInfo(_roleInfo as PlayerInfo, pfpd);
                FightProxy.instance.SetFightPlayerInfo(fightPlayerInfo);
                FightProxy.instance.SetFightHeroInfoList(new List <FightHeroInfo>());
            }
            else
            {
                HeroFightProtoData hfpd = new HeroFightProtoData();
                hfpd.posIndex        = 5;
                hfpd.attr            = new HeroAttrProtoData();
                hfpd.attr.hp         = hfpd.attr.hpUp = (int)attrDic.GetValue(RoleAttributeType.HP).value;
                hfpd.attr.magic_atk  = (int)attrDic.GetValue(RoleAttributeType.MagicAtk).value;
                hfpd.attr.normal_atk = (int)attrDic.GetValue(RoleAttributeType.NormalAtk).value;
                hfpd.attr.normal_def = hfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.Normal_Def).value;
                //pfpd.attr.magic_def = (int)attrDic.GetValue(RoleAttributeType.m).value;
                hfpd.attr.speed         = (int)attrDic.GetValue(RoleAttributeType.Speed).value;
                hfpd.attr.hit           = (int)attrDic.GetValue(RoleAttributeType.Hit).value;
                hfpd.attr.dodge         = (int)attrDic.GetValue(RoleAttributeType.Dodge).value;
                hfpd.attr.crit          = (int)attrDic.GetValue(RoleAttributeType.Crit).value;
                hfpd.attr.anti_crit     = (int)attrDic.GetValue(RoleAttributeType.AntiCrit).value;
                hfpd.attr.block         = (int)attrDic.GetValue(RoleAttributeType.Block).value;
                hfpd.attr.anti_block    = (int)attrDic.GetValue(RoleAttributeType.AntiBlock).value;
                hfpd.attr.counter_atk   = (int)attrDic.GetValue(RoleAttributeType.CounterAtk).value;
                hfpd.attr.crit_hurt_add = (int)attrDic.GetValue(RoleAttributeType.CritHurtAdd).value;
                hfpd.attr.crit_hurt_dec = (int)attrDic.GetValue(RoleAttributeType.CritHurtDec).value;
                hfpd.attr.armor         = (int)attrDic.GetValue(RoleAttributeType.Armor).value;
                hfpd.attr.damage_add    = (int)attrDic.GetValue(RoleAttributeType.DamageAdd).value;
                hfpd.attr.damage_dec    = (int)attrDic.GetValue(RoleAttributeType.DamageDec).value;
                //hfpd.attr.hit = 100;
                FightHeroInfo        fightHeroInfo = new FightHeroInfo(_roleInfo as HeroInfo, hfpd);
                List <FightHeroInfo> heroInfoList  = new List <FightHeroInfo>();
                heroInfoList.Add(fightHeroInfo);
                FightProxy.instance.SetFightHeroInfoList(heroInfoList);
            }
            //enemy
            HeroInfo           enemyHero = new HeroInfo(HeroData.HeroDataDictionary.First().Key);
            HeroFightProtoData ehfpd     = new HeroFightProtoData();

            ehfpd.posIndex = 5;
            ehfpd.attr     = new HeroAttrProtoData();
            ehfpd.attr.hp  = ehfpd.attr.hpUp = 100000;
            //			ehfpd.attr.magic_atk = 1;
            //			ehfpd.attr.normal_atk = 1;
            ehfpd.attr.speed = 25;
            FightHeroInfo        efightHeroInfo = new FightHeroInfo(enemyHero, ehfpd);
            List <FightHeroInfo> eheroInfoList  = new List <FightHeroInfo>();

            eheroInfoList.Add(efightHeroInfo);
            FightProxy.instance.SetEnemyFightHeroInfoList(eheroInfoList);


            UIMgr.instance.CloseLayerBelow(Logic.UI.EUISortingLayer.FlyWord);
            FightController.instance.fightType = Logic.Enums.FightType.SkillDisplay;
            Logic.UI.LoadGame.Controller.LoadGameController.instance.SetDelayTime(0.5f, () =>
            {
                FightController.instance.ReadyFight();
            });
        }