private void InitGearLevelAchievementProgress(TrackingAchievement achievement)
        {
            PlayerPackageLogic pp = new PlayerPackageLogic();

            pp.SetUser(m_UserId);
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_UserId);
            int       progress = 0;
            GearLogic g        = new GearLogic();

            foreach (var hero in ph.GetHeroList())
            {
                foreach (var gear in hero.Value.Gears)
                {
                    g.SetGear(gear.Value);
                    if (g.MyGear.Level >= achievement.Params[0])
                    {
                        progress++;
                    }
                }
            }
            foreach (var gear in pp.MyPackage.Gears)
            {
                g.SetGear(gear.Key);
                if (g.MyGear.Level >= achievement.Params[0])
                {
                    progress++;
                }
            }
            achievement.Progress = progress;
        }
Example #2
0
        public override bool TakeAction()
        {
            // TODO: Add code here.
            GearLogic gearlogic = new GearLogic();

            gearlogic.SetGear(m_RequestPacket.GearId);
            PlayerLogic player = new PlayerLogic();

            player.SetUser(m_UserId);
            if (gearlogic.MyGear.Level >= player.MyPlayer.Level)
            {
                ErrorCode = (int)ErrorType.CannotOpenChance;
                ErrorInfo = "Can not upgrade,gear reached max level.";
                return(false);
            }
            int targetLevel;

            if (m_RequestPacket.IsUpToMax)
            {
                targetLevel = player.MyPlayer.Level;
            }
            else
            {
                targetLevel = gearlogic.MyGear.Level + 1;
            }
            int totalcost = gearlogic.GetLevelUpCost(targetLevel);

            if (!player.DeductCoin(totalcost))
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "Can not upgrade, coin not enough.";
                return(false);
            }
            gearlogic.GearLevelUp(targetLevel, m_UserId);
            if (m_RequestPacket.HeroType > 0)
            {
                PlayerHeroLogic ph = new PlayerHeroLogic();
                ph.SetUser(m_UserId).SetHero(m_RequestPacket.HeroType);
                ph.RefreshMight();
                var heroInfo = ph.GetHeroInfo();
                m_ResponsePacket.HeroInfo = new PBLobbyHeroInfo()
                {
                    Type  = heroInfo.HeroType,
                    Might = heroInfo.Might
                };
            }
            m_ResponsePacket.LevelUpedGear = new PBGearInfo()
            {
                Id    = m_RequestPacket.GearId,
                Level = gearlogic.MyGear.Level
            };
            m_ResponsePacket.PlayerInfo = new PBPlayerInfo()
            {
                Id   = m_UserId,
                Coin = player.MyPlayer.Coin
            };
            return(true);
        }
Example #3
0
        public override bool TakeAction()
        {
            GearLogic gear = new GearLogic();

            gear.SetGear(m_RequestPacket.GearId);
            int materialId             = CacheSet.GearTable.GetData(gear.MyGear.TypeId).StrengthenItemId;
            PlayerPackageLogic package = new PlayerPackageLogic();

            package.SetUser(m_UserId);
            if (!package.DeductInventory(new ItemListItem()
            {
                Id = materialId, Count = 1
            }))
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "Not enough material";
                return(false);
            }
            if (!gear.Strengthen(m_UserId))
            {
                m_ResponsePacket.ItemInfo = new PBItemInfo()
                {
                    Type  = materialId,
                    Count = package.MyPackage.Inventories[materialId]
                };
                m_ResponsePacket.LevelUpedGear = null;
                m_ResponsePacket.HeroInfo      = null;
                return(true);
            }

            if (m_RequestPacket.HeroType > 0)
            {
                PlayerHeroLogic ph = new PlayerHeroLogic();
                ph.SetUser(m_UserId).SetHero(m_RequestPacket.HeroType);
                ph.RefreshMight();
                var heroInfo = ph.GetHeroInfo();
                m_ResponsePacket.HeroInfo = new PBLobbyHeroInfo()
                {
                    Type  = heroInfo.HeroType,
                    Might = heroInfo.Might
                };
            }
            m_ResponsePacket.ItemInfo = new PBItemInfo()
            {
                Type  = materialId,
                Count = package.MyPackage.Inventories[materialId]
            };
            m_ResponsePacket.LevelUpedGear = new PBGearInfo()
            {
                Id              = m_RequestPacket.GearId,
                Type            = gear.MyGear.TypeId,
                Level           = gear.MyGear.Level,
                StrengthenLevel = gear.MyGear.StrengthenLevel
            };
            return(true);
        }
Example #4
0
        private void SetResponseData(PlayerChess playerChess)
        {
            m_ResponsePacket.GotCoin       = playerChess.GotCoin;
            m_ResponsePacket.GotMoney      = playerChess.GotMoney;
            m_ResponsePacket.GotStarEnergy = playerChess.GotStarEnergy;
            foreach (var item in playerChess.GotItems)
            {
                m_ResponsePacket.GotItems.Add(new PBItemInfo()
                {
                    Type = item.Key, Count = item.Value
                });
            }
            GearLogic gears = new GearLogic();

            foreach (int gearId in playerChess.GotGears)
            {
                gears.SetGear(gearId);
                m_ResponsePacket.GotGears.Add(new PBGearInfo()
                {
                    Id = gears.MyGear.Id, Level = gears.MyGear.Level, Type = gears.MyGear.TypeId
                });
            }
            SoulLogic souls = new SoulLogic();

            foreach (int soulId in playerChess.GotSouls)
            {
                souls.SetSoul(soulId);
                m_ResponsePacket.GotSouls.Add(new PBSoulInfo()
                {
                    Id = souls.MySoul.Id, Type = souls.MySoul.TypeId
                });
            }
            foreach (int epigraphId in playerChess.GotEpigraphs)
            {
                m_ResponsePacket.GotEpigraphs.Add(new PBEpigraphInfo()
                {
                    Level = 1, Type = epigraphId
                });
            }
            foreach (var heroHP in playerChess.HP)
            {
                m_ResponsePacket.HeroStatus.Add(new PBLobbyHeroStatus()
                {
                    Type = heroHP.Key, CurHP = heroHP.Value
                });
            }
            m_ResponsePacket.PlayCount  = playerChess.Count;
            m_ResponsePacket.Anger      = playerChess.Anger;
            m_ResponsePacket.TokenCount = playerChess.Token;
            m_ResponsePacket.Width      = GameConsts.PlayerChess.ChessBoardWidth;
            PlayerLogic player = new PlayerLogic();

            foreach (var chessField in playerChess.ChessBoard)
            {
                PBChessField cf = new PBChessField();
                cf.Color = chessField.Color == ChessFieldColor.Empty || chessField.Color == ChessFieldColor.EmptyGray || chessField.Color == ChessFieldColor.RewardGray ?
                           (int)ChessFieldColor.EmptyGray : (int)chessField.Color;
                if (chessField.Color == ChessFieldColor.Empty || chessField.Color == ChessFieldColor.EmptyGray || chessField.Color == ChessFieldColor.RewardGray)
                {
                    var curField = chessField as RewardChessField;
                    cf.IsOpened = curField.IsOpened;
                    if (!cf.IsOpened)
                    {
                        cf.IsFree = curField.IsFree;
                        if (cf.IsFree)
                        {
                            cf.Parent = curField.ParentId;
                        }
                    }
                }
                else
                {
                    var curField = chessField as BattleChessField;
                    player.SetUser(curField.EnemyPlayerId);
                    cf.IsOpened = curField.IsOpened;
                    if (cf.IsOpened)
                    {
                        cf.FreeCount = curField.Count;
                        cf.Children.AddRange(curField.ChildrenId);
                    }
                }
                m_ResponsePacket.ChessBoard.Add(cf);
            }
            if (playerChess.MyTeam != null)
            {
                m_ResponsePacket.HeroTeam.AddRange(playerChess.MyTeam);
            }
        }
Example #5
0
        public override bool TakeAction()
        {
            if (m_RequestPacket.TakeOffGearId == 0 && m_RequestPacket.PutOnGearId == 0)
            {
                ErrorCode = (int)ErrorType.CannotOpenChance;
                ErrorInfo = "invalid param";
                return(false);
            }
            PlayerPackageLogic package = new PlayerPackageLogic();

            package.SetUser(m_UserId);
            GearLogic       gear       = new GearLogic();
            PlayerHeroLogic playerHero = new PlayerHeroLogic();

            playerHero.SetUser(m_UserId);
            GearType position;

            if (m_RequestPacket.PutOnGearId == 0)
            {
                playerHero.SetHero(m_RequestPacket.TakeOffHeroId);
                gear.SetGear(m_RequestPacket.TakeOffGearId);
                DTGear geardata = CacheSet.GearTable.GetData(gear.MyGear.TypeId);
                position = (GearType)geardata.Type;
                if (playerHero.GetHeroInfo().Gears[position] != m_RequestPacket.TakeOffGearId)
                {
                    ErrorCode = (int)ErrorType.CannotOpenChance;
                    ErrorInfo = "wrong take off gear ID";
                    return(false);
                }
                package.AddGear(m_RequestPacket.TakeOffGearId, gear.MyGear.TypeId);
            }
            else if (m_RequestPacket.TakeOffGearId == 0)
            {
                playerHero.SetHero(m_RequestPacket.PutOnHeroId);
                gear.SetGear(m_RequestPacket.PutOnGearId);
                DTGear geardata = CacheSet.GearTable.GetData(gear.MyGear.TypeId);
                position = (GearType)geardata.Type;
                if (m_RequestPacket.TakeOffHeroId == 0)
                {
                    if (!package.MyPackage.Gears.ContainsKey(m_RequestPacket.PutOnGearId))
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong put on gear ID";
                        return(false);
                    }
                    package.DeductGear(m_RequestPacket.PutOnGearId);
                }
                else
                {
                    if (playerHero.MyHeros.Heros[m_RequestPacket.TakeOffHeroId].Gears[position] != m_RequestPacket.PutOnGearId)
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong put on gear ID";
                        return(false);
                    }
                    playerHero.SetHero(m_RequestPacket.TakeOffHeroId);
                    playerHero.WearGear(position, 0);
                    playerHero.SetHero(m_RequestPacket.PutOnHeroId);
                }
            }
            else
            {
                playerHero.SetHero(m_RequestPacket.PutOnHeroId);
                gear.SetGear(m_RequestPacket.PutOnGearId);
                DTGear geardata = CacheSet.GearTable.GetData(gear.MyGear.TypeId);
                position = (GearType)geardata.Type;
                if (m_RequestPacket.TakeOffHeroId == 0)
                {
                    if (!package.MyPackage.Gears.ContainsKey(m_RequestPacket.PutOnGearId))
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong put on gear ID";
                        return(false);
                    }
                    if (playerHero.MyHeros.Heros[m_RequestPacket.PutOnHeroId].Gears[position] != m_RequestPacket.TakeOffGearId)
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong take off gear ID";
                        return(false);
                    }
                    package.DeductGear(m_RequestPacket.PutOnGearId);
                }
                else
                {
                    if (playerHero.MyHeros.Heros[m_RequestPacket.TakeOffHeroId].Gears[position] != m_RequestPacket.PutOnGearId)
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong put on gear ID";
                        return(false);
                    }
                    if (playerHero.MyHeros.Heros[m_RequestPacket.PutOnHeroId].Gears[position] != m_RequestPacket.TakeOffGearId)
                    {
                        ErrorCode = (int)ErrorType.CannotOpenChance;
                        ErrorInfo = "wrong take off gear ID";
                        return(false);
                    }
                    playerHero.SetHero(m_RequestPacket.TakeOffHeroId);
                    playerHero.WearGear(position, 0);
                    playerHero.SetHero(m_RequestPacket.PutOnHeroId);
                }
                package.AddGear(m_RequestPacket.TakeOffGearId, gear.MyGear.TypeId);
            }
            playerHero.WearGear(position, m_RequestPacket.PutOnGearId);
            m_ResponsePacket.PutOnGearId   = m_RequestPacket.PutOnGearId;
            m_ResponsePacket.TakeOffGearId = m_RequestPacket.TakeOffGearId;
            if (m_RequestPacket.PutOnHeroId > 0)
            {
                m_ResponsePacket.PutOnHeroInfo = new PBLobbyHeroInfo()
                {
                    Type  = m_RequestPacket.PutOnHeroId,
                    Might = playerHero.SetHero(m_RequestPacket.PutOnHeroId).GetHeroInfo().Might
                };
            }
            if (m_RequestPacket.TakeOffHeroId > 0)
            {
                m_ResponsePacket.TakeOffHeroInfo = new PBLobbyHeroInfo()
                {
                    Type  = m_RequestPacket.TakeOffHeroId,
                    Might = playerHero.SetHero(m_RequestPacket.TakeOffHeroId).GetHeroInfo().Might
                };
            }
            return(true);
        }
Example #6
0
        public override bool TakeAction()
        {
            PlayerLogic p = new PlayerLogic();

            p.SetUser(m_RequestPacket.EnemyPlayerId);
            ArenaRankLogic ar = new ArenaRankLogic();

            m_ResponsePacket.EnemyInfo            = new PBArenaPlayerAndTeamInfo();
            m_ResponsePacket.EnemyInfo.PlayerInfo = new PBPlayerInfo()
            {
                Id           = p.MyPlayer.Id,
                Name         = p.MyPlayer.Name,
                PortraitType = p.MyPlayer.PortraitType,
                Level        = p.MyPlayer.Level,
            };
            m_ResponsePacket.EnemyInfo.Rank = ar.GetPlayerRank(m_RequestPacket.EnemyPlayerId);
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_RequestPacket.EnemyPlayerId);
            HeroTeamLogic ht = new HeroTeamLogic();

            ht.SetUser(m_RequestPacket.EnemyPlayerId);
            GearLogic gear = new GearLogic();
            SoulLogic soul = new SoulLogic();

            foreach (int heroId in ht.GetTeam())
            {
                if (heroId == 0)
                {
                    continue;
                }
                ph.SetHero(heroId);
                Hero            heroInfo = ph.GetHeroInfo();
                PBLobbyHeroInfo pbhero   = new PBLobbyHeroInfo()
                {
                    Type  = heroInfo.HeroType,
                    Level = heroInfo.HeroLv,
                    ConsciousnessLevel = heroInfo.ConsciousnessLevel,
                    ElevationLevel     = heroInfo.ElevationLevel,
                    StarLevel          = heroInfo.HeroStarLevel,
                };
                pbhero.SkillLevels.AddRange(heroInfo.SkillLevels);
                foreach (var equipedGear in heroInfo.Gears)
                {
                    gear.SetGear(equipedGear.Value);
                    PBGearInfo heroGear = new PBGearInfo()
                    {
                        Id              = gear.MyGear.Id,
                        Type            = gear.MyGear.TypeId,
                        Level           = gear.MyGear.Level,
                        StrengthenLevel = gear.MyGear.StrengthenLevel
                    };
                    pbhero.GearInfo.Add(heroGear);
                }
                foreach (var equipedSoul in heroInfo.Souls)
                {
                    soul.SetSoul(equipedSoul.Value);
                    PBSoulInfo heroSoul = new PBSoulInfo()
                    {
                        Id   = soul.MySoul.Id,
                        Type = soul.MySoul.TypeId
                    };
                    pbhero.SoulInfo.Add(heroSoul);
                }
                m_ResponsePacket.EnemyInfo.HeroTeam.Add(pbhero);
            }
            return(true);
        }
Example #7
0
        public override bool TakeAction()
        {
            IList <int> heroes;

            if (m_RequestPacket.HeroTypes.Count == 0)
            {
                HeroTeamLogic ht = new HeroTeamLogic();
                ht.SetUser(m_UserId);
                heroes = ht.GetTeam();
            }
            else
            {
                heroes = m_RequestPacket.HeroTypes;
            }
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_RequestPacket.PlayerId);
            GearLogic gear = new GearLogic();
            SoulLogic soul = new SoulLogic();

            foreach (int heroId in heroes)
            {
                if (heroId == 0)
                {
                    continue;
                }
                ph.SetHero(heroId);
                Hero            heroInfo = ph.GetHeroInfo();
                PBLobbyHeroInfo pbhero   = new PBLobbyHeroInfo()
                {
                    Type  = heroInfo.HeroType,
                    Level = heroInfo.HeroLv,
                    ConsciousnessLevel = heroInfo.ConsciousnessLevel,
                    ElevationLevel     = heroInfo.ElevationLevel,
                    StarLevel          = heroInfo.HeroStarLevel,
                };
                foreach (var equipedGear in heroInfo.Gears)
                {
                    gear.SetGear(equipedGear.Value);
                    PBGearInfo heroGear = new PBGearInfo()
                    {
                        Id              = gear.MyGear.Id,
                        Type            = gear.MyGear.TypeId,
                        Level           = gear.MyGear.Level,
                        StrengthenLevel = gear.MyGear.StrengthenLevel
                    };
                    pbhero.GearInfo.Add(heroGear);
                }
                foreach (var equipedSoul in heroInfo.Souls)
                {
                    soul.SetSoul(equipedSoul.Value);
                    PBSoulInfo heroSoul = new PBSoulInfo()
                    {
                        Id   = soul.MySoul.Id,
                        Type = soul.MySoul.TypeId
                    };
                    pbhero.SoulInfo.Add(heroSoul);
                }
                m_ResponsePacket.Heroes.Add(pbhero);
            }
            m_ResponsePacket.PlayerId = m_RequestPacket.PlayerId;
            return(true);
        }
Example #8
0
        public override bool TakeAction()
        {
            PlayerLogic player = new PlayerLogic();

            player.SetUser(m_RequestPacket.PlayerId);
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_RequestPacket.PlayerId);
            m_ResponsePacket.Player = new PBPlayerInfo()
            {
                Id              = player.MyPlayer.Id,
                Name            = player.MyPlayer.Name,
                VipLevel        = player.MyPlayer.VIPLevel,
                Level           = player.MyPlayer.Level,
                PlayerHeroCount = ph.MyHeros.Heros.Count,
                Might           = player.MyPlayer.Might,
                DisplayId       = player.MyPlayer.UUID
            };
            PlayerFriendsLogic pf = new PlayerFriendsLogic();

            pf.SetUser(m_RequestPacket.PlayerId);
            var friends = pf.GetFriends();

            if (friends.ContainsKey(m_UserId))
            {
                m_ResponsePacket.IsMyFriend = true;
            }
            else
            {
                m_ResponsePacket.IsMyFriend = false;
            }

            HeroTeamLogic ht = new HeroTeamLogic();

            ht.SetUser(m_RequestPacket.PlayerId);
            GearLogic g = new GearLogic();
            SoulLogic s = new SoulLogic();

            foreach (int heroType in ht.MyHeroTeam.Team)
            {
                if (heroType == 0)
                {
                    continue;
                }
                var hero     = ph.SetHero(heroType).GetHeroInfo();
                var heroInfo = new PBLobbyHeroInfo()
                {
                    Type  = hero.HeroType,
                    Level = hero.HeroLv,
                    ConsciousnessLevel = hero.ConsciousnessLevel,
                    ElevationLevel     = hero.ElevationLevel,
                    StarLevel          = hero.HeroStarLevel,
                    Might = hero.Might,
                };
                heroInfo.SkillLevels.AddRange(hero.SkillLevels);
                foreach (var gear in hero.Gears)
                {
                    g.SetGear(gear.Value);
                    heroInfo.GearInfo.Add(new PBGearInfo()
                    {
                        Id              = g.MyGear.Id,
                        Type            = g.MyGear.TypeId,
                        Level           = g.MyGear.Level,
                        StrengthenLevel = g.MyGear.StrengthenLevel
                    });
                }
                foreach (var soul in hero.Souls)
                {
                    s.SetSoul(soul.Value);
                    heroInfo.SoulInfo.Add(new PBSoulInfo()
                    {
                        Id   = s.MySoul.Id,
                        Type = s.MySoul.TypeId,
                    });
                }
                m_ResponsePacket.HeroTeam.Add(heroInfo);
            }
            return(true);
        }
Example #9
0
        public override bool TakeAction()
        {
            Transaction t      = new Transaction();
            PlayerLogic player = new PlayerLogic();

            player.SetUser(m_UserId);
            PlayerPackageLogic package = new PlayerPackageLogic();

            package.SetUser(m_UserId);
            GearLogic gear = new GearLogic();

            gear.SetGear(m_RequestPacket.GearId[0]);
            int quality = CacheSet.GearTable.GetData(gear.MyGear.TypeId).Quality;

            t.DumpEntity(package.MyPackage);
            t.DumpEntity(player.MyPlayer);
            int costCoin = gear.GetComposeCost(quality);

            if (quality == (int)GearQuality.Orange)
            {
                t.RollBack();
                ErrorCode = (int)ErrorType.CannotOpenChance;
                ErrorInfo = "wrong gearId";
                return(false);
            }

            if (!player.DeductCoin(costCoin))
            {
                t.RollBack();
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "You don't have enough Coin";
                return(false);
            }
            foreach (int gearId in m_RequestPacket.GearId)
            {
                gear.SetGear(gearId);
                if (quality != CacheSet.GearTable.GetData(gear.MyGear.TypeId).Quality)
                {
                    t.RollBack();
                    ErrorCode = (int)ErrorType.CannotOpenChance;
                    ErrorInfo = "wrong gearId";
                    return(false);
                }
                if (!package.DeductGear(gearId))
                {
                    t.RollBack();
                    ErrorCode = (int)ErrorType.RequireNotMet;
                    ErrorInfo = "You don't have enough Gear";
                    return(false);
                }
                gear.RemoveGear();
            }
            int position = 0;

            if (m_RequestPacket.HasItemId && m_RequestPacket.ItemId != 0)
            {
                if (!package.DeductInventory(new ItemListItem()
                {
                    Id = m_RequestPacket.ItemId, Count = 1
                }))
                {
                    t.RollBack();
                    ErrorCode = (int)ErrorType.RequireNotMet;
                    ErrorInfo = "You don't have enough Item";
                    return(false);
                }
                position = int.Parse(CacheSet.ItemTable.GetData(m_RequestPacket.ItemId).FunctionParams);
                m_ResponsePacket.ItemInfo = new PBItemInfo()
                {
                    Type = m_RequestPacket.ItemId, Count = package.MyPackage.Inventories[m_RequestPacket.ItemId]
                };
            }
            m_ResponsePacket.PlayerInfo = new PBPlayerInfo()
            {
                Id   = player.MyPlayer.Id,
                Coin = player.MyPlayer.Coin
            };
            m_ResponsePacket.RemovedGears.AddRange(m_RequestPacket.GearId);
            Gears newGear = gear.GetComposeResult(quality, position, m_UserId);

            if (newGear == null)
            {
                return(true);
            }
            package.AddGear(newGear.Id, newGear.TypeId);
            m_ResponsePacket.NewGear = new PBGearInfo()
            {
                Id    = newGear.Id,
                Type  = newGear.TypeId,
                Level = newGear.Level
            };
            return(true);
        }
Example #10
0
        public override bool TakeAction()
        {
            PlayerChessLogic playerChess = new PlayerChessLogic();

            playerChess.SetUser(m_UserId);
            if (!(playerChess.MyChess.ChessBoard[m_RequestPacket.ChessFieldIndex] is BattleChessField))
            {
                m_ResponsePacket.Success = false;
                return(true);
            }
            BattleChessField targetField = playerChess.MyChess.ChessBoard[m_RequestPacket.ChessFieldIndex] as BattleChessField;

            m_ResponsePacket.Anger = targetField.EnemyAnger;
            PlayerLogic player = new PlayerLogic();

            player.SetUser(targetField.EnemyPlayerId);
            m_ResponsePacket.EnemyInfo = new PBPlayerInfo()
            {
                Id    = player.MyPlayer.Id,
                Name  = player.MyPlayer.Name,
                Level = player.MyPlayer.Level,
                Might = player.MyPlayer.Might,
            };
            GearLogic gearlogic = new GearLogic();
            int       i         = 0;

            foreach (var hero in targetField.EnemyPlayerHeroTeam)
            {
                PBLobbyHeroInfo enemyHero = new PBLobbyHeroInfo()
                {
                    Type               = hero.HeroType,
                    Level              = hero.HeroLv,
                    StarLevel          = hero.HeroStarLevel,
                    ConsciousnessLevel = hero.ConsciousnessLevel,
                    ElevationLevel     = hero.ElevationLevel,
                };
                enemyHero.SkillLevels.AddRange(hero.SkillLevels);

                foreach (var gear in hero.Gears)
                {
                    gearlogic.SetGear(gear.Value);
                    PBGearInfo enemyGear = new PBGearInfo()
                    {
                        Id    = gearlogic.MyGear.Id,
                        Type  = gearlogic.MyGear.TypeId,
                        Level = gearlogic.MyGear.Level
                    };
                    enemyHero.GearInfo.Add(enemyGear);
                }
                if (targetField.EnemyHeroHP.Count > i)
                {
                    PBLobbyHeroStatus enemyStatus = new PBLobbyHeroStatus()
                    {
                        Type  = hero.HeroType,
                        CurHP = targetField.EnemyHeroHP[i]
                    };
                    m_ResponsePacket.HeroesStatus.Add(enemyStatus);
                }
                m_ResponsePacket.HeroesInfo.Add(enemyHero);
                m_ResponsePacket.ChessFieldIndex = m_RequestPacket.ChessFieldIndex;
                i++;
            }
            m_ResponsePacket.Success = true;
            return(true);
        }