示例#1
0
        public override bool TakeAction()
        {
            PlayerEpigraphLogic pe = new PlayerEpigraphLogic();

            pe.SetUser(m_UserId);
            int         curLevel = pe.GetLevel();
            PlayerLogic p        = new PlayerLogic();

            p.SetUser(m_UserId);

            if (p.MyPlayer.Level < GameConfigs.GetInt("Epigraph_Required_Level_" + curLevel))
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "your level is not reached require";
                return(false);
            }
            pe.UnlockSlot();
            foreach (var epigraph in pe.GetEpigraphs())
            {
                PBEpigraphInfo epInfo = new PBEpigraphInfo();
                epInfo.Type  = epigraph.Type;
                epInfo.Level = epigraph.Level;
                m_ResponsePacket.Epigraphs.Add(epInfo);
            }
            return(true);
        }
示例#2
0
        public override bool TakeAction()
        {
            PlayerEpigraphLogic pe = new PlayerEpigraphLogic();

            pe.SetUser(m_UserId);
            PlayerPackageLogic pp = new PlayerPackageLogic();

            pp.SetUser(m_UserId);
            if (m_RequestPacket.DressedEpigraph != null)
            {
                int type  = m_RequestPacket.DressedEpigraph.Type;
                int level = m_RequestPacket.DressedEpigraph.Level;
                if (!pp.DeductEpigraph(type, level))
                {
                    ErrorCode = (int)ErrorType.RequireNotMet;
                    ErrorInfo = "you do not have this epigraph";
                    return(false);
                }
                pe.DressEpigraph(type, level, m_RequestPacket.Index);
                m_ResponsePacket.Index           = m_RequestPacket.Index;
                m_ResponsePacket.DressedEpigraph = m_RequestPacket.DressedEpigraph;
                return(true);
            }
            else if (m_RequestPacket.UndressedEpigraph != null)
            {
                int type  = m_RequestPacket.UndressedEpigraph.Type;
                int level = m_RequestPacket.UndressedEpigraph.Level;
                if (!pe.UndressEpigraph(type, level, m_RequestPacket.Index))
                {
                    ErrorCode = (int)ErrorType.RequireNotMet;
                    ErrorInfo = "you do not have this epigraph";
                    return(false);
                }
                pp.AddEpigraph(type, level);
                m_ResponsePacket.Index             = m_RequestPacket.Index;
                m_ResponsePacket.UndressedEpigraph = m_RequestPacket.UndressedEpigraph;
                return(true);
            }
            else
            {
                int type  = m_RequestPacket.UndressedEpigraph.Type;
                int level = m_RequestPacket.UndressedEpigraph.Level;
                if (!pe.UndressEpigraph(type, level, m_RequestPacket.Index))
                {
                    ErrorCode = (int)ErrorType.RequireNotMet;
                    ErrorInfo = "you do not have this epigraph";
                    return(false);
                }
                pe.DressEpigraph(type, level, m_RequestPacket.Index);
                m_ResponsePacket.Index             = m_RequestPacket.Index;
                m_ResponsePacket.DressedEpigraph   = m_RequestPacket.DressedEpigraph;
                m_ResponsePacket.UndressedEpigraph = m_RequestPacket.UndressedEpigraph;
                return(true);
            }
        }
示例#3
0
        public override bool TakeAction()
        {
            PlayerEpigraphLogic pe = new PlayerEpigraphLogic();

            pe.SetUser(m_UserId);
            foreach (var epigraph in pe.GetEpigraphs())
            {
                PBEpigraphInfo epInfo = new PBEpigraphInfo();
                epInfo.Type  = epigraph.Type;
                epInfo.Level = epigraph.Level;
                m_ResponsePacket.Epigraphs.Add(epInfo);
            }
            return(true);
        }
示例#4
0
 public bool GetNewEpigraph(int type, out ItemListItem item)
 {
     item = null;
     PlayerEpigraphLogic pe = new PlayerEpigraphLogic();
     pe.SetUser(m_UserId);
     if (m_Package.Epigraphs.ContainsKey(type) || pe.HasEpigraph(type))
     {
         DTEpigraph dataRow = CacheSet.EpigraphTable.GetData(type);
         item = new ItemListItem() { Id = dataRow.PieceId, Count = dataRow.PieceCount };
         AddInventory(item);
         return false;
     }
     else
     {
         AddEpigraph(type, 1);
         return true;
     }
 }