예제 #1
0
        private CItemInfo CreateNumericalItemInfo(ItemNumerical_Type numType)
        {
            string strPic  = "";
            string strName = "";

            switch (numType)
            {
            case ItemNumerical_Type.Money:
                strPic  = GOLDTICKET_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Goods_Gold");
                break;

            case ItemNumerical_Type.MCoin:
                strPic  = MCOINTICKET_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Goods_Mcoin");
                break;

            case ItemNumerical_Type.MBCoin:
                strPic  = MBINDTICKET_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Goods_MbindCoin");
                break;

            case ItemNumerical_Type.EXP:
                strPic  = EXP_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Quest_Exp");
                break;

            case ItemNumerical_Type.Honor:
                strPic  = HONOR_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Quest_Honor");
                break;

            case ItemNumerical_Type.Contribution:
                strPic  = CONTRIBUTION_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("DanceGroup_ShopContribution");
                break;

            case ItemNumerical_Type.VipValue:
                strPic  = VIPVALUE_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Quest_VipValue");
                break;

            case ItemNumerical_Type.Intimacy:
                strPic  = INTIMACY_SPRITE_NAME;
                strName = SystemTips.GetTipsContent("Quest_Intimacy");
                break;

            default:
                return(null);
            }

            CItemInfo itemInfo = new CItemInfo();

            itemInfo.m_strIcon   = strPic;
            itemInfo.m_strName   = strName;
            itemInfo.m_anType[0] = (byte)ItemClass_Type.ItemClassType_Numerical;
            itemInfo.m_anType[1] = (byte)numType;

            return(itemInfo);
        }
예제 #2
0
        public string GetItemName(uint itemid)
        {
            CItemInfo itemInfo = GetByID(itemid);

            if (itemInfo != null)
            {
                return(itemInfo.m_strName);
            }

            return(null);
        }
예제 #3
0
        /// <summary>
        /// 获取时尚值
        /// </summary>
        /// <param name="nType">物品ID</param>
        /// <returns></returns>
        public uint GetFashionValueById(uint nType)
        {
            uint      res  = 0;
            CItemInfo info = GetByID(nType);

            if (info != null)
            {
                res = info.m_Fashion;
            }

            return(res);
        }
예제 #4
0
        //public string GetItemNameAndCount(uint itemid, ushort count, int matune)
        //{
        //    StringBuilder info = new StringBuilder();

        //    bool needcount = true;
        //    if(count == 0 && matune == 0)
        //    {
        //        needcount = false;
        //    }

        //    CItemInfo itemInfo = GetByID(itemid);
        //    if(itemInfo != null)
        //    {
        //        if(needcount)
        //        {
        //            StringBuilder tempStr = new StringBuilder();

        //            if(itemInfo.IsExpandable())
        //            {
        //                tempStr.Append(count.ToString());
        //                tempStr.Append(SystemTips.GetTipsContent("ItemBag_Unit"));

        //                info.Append(SystemTips.GetTipsContent("SpecialMall_ItemInfo", new string[]{"", itemInfo.m_strName, tempStr.ToString()}));
        //            }
        //            else
        //            {
        //                if(matune >= 0)
        //                {
        //                    if(matune == 0)
        //                    {
        //                        matune = itemInfo.m_nMatune;
        //                    }

        //                    GameTime gt = new GameTime(matune);

        //                    if (gt.Day > 0)
        //                    {
        //                        tempStr.Append(gt.Day.ToString());
        //                        tempStr.Append(SystemTips.GetTipsContent("ItemBag_Day"));
        //                    }
        //                    if (gt.Hour > 0)
        //                    {
        //                        tempStr.Append(gt.Hour.ToString());
        //                        tempStr.Append(SystemTips.GetTipsContent("ItemBag_Hour"));
        //                    }
        //                    if (gt.Minute > 0)
        //                    {
        //                        tempStr.Append(gt.Minute.ToString());
        //                        tempStr.Append(SystemTips.GetTipsContent("ItemBag_Minute"));
        //                    }
        //                }
        //                else if(matune == -1)
        //                {
        //                    tempStr.Append(SystemTips.GetTipsContent("ItemBag_Forever"));
        //                }

        //                info.Append(SystemTips.GetTipsContent("SpecialMall_ItemInfo", new string[]{"", itemInfo.m_strName, tempStr.ToString()}));
        //            }
        //        }
        //        else
        //        {
        //            info.Append(itemInfo.m_strName);
        //        }
        //    }

        //    return info.ToString();
        //}

        /// <summary>
        /// 获取特效等级
        /// </summary>
        /// <param name="nType">物品ID</param>
        /// <returns></returns>
        public int GetEffectLevelById(uint nType)
        {
            int       res  = 0;
            CItemInfo info = GetByID(nType);

            if (info != null)
            {
                res = info.m_EffectLevel;
            }

            return(res);
        }
예제 #5
0
        private Dictionary <byte, uint> m_dicEffectStoneInfo = new Dictionary <byte, uint>();           // 光效石属性

        /// <summary>
        /// 初始化数值类道具虚拟数据;
        /// </summary>
        public CItemInfoManager()
        {
            for (int i = (int)ItemNumerical_Type.None; i < (int)ItemNumerical_Type.Max; i++)
            {
                ItemNumerical_Type eKey   = (ItemNumerical_Type)i;
                CItemInfo          gtItem = CreateNumericalItemInfo(eKey);
                if (gtItem != null)
                {
                    s_ItemInfoMap_Numerical.Add(eKey, gtItem);
                }
            }
        }
예제 #6
0
        void RegistItemInfo(CItemInfo iteminfo)
        {
            if (iteminfo != null && iteminfo.m_nType > 0)
            {
                if (s_ItemInfoMap.Contains(iteminfo.m_nType))
                {
                    //Debug.Log("RegistItemInfo Duplicate,nType:" + iteminfo.m_nType);
                    s_ItemInfoMap.Remove(iteminfo.m_nType);
                }

                s_ItemInfoMap.Add(iteminfo.m_nType, iteminfo);
            }
        }
예제 #7
0
        bool ParseFile(XQFileStream file)
        {
            if (file != null && file.IsOpen())
            {
                UInt16 usNumber = 0;
                file.ReadUShort(ref usNumber);

                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CItemInfo iteminfo = new CItemInfo();
                    iteminfo.Load(ref file);
                    RegistItemInfo(iteminfo);
                }

                // 额外时尚值 客户端不使用
                List <PlaceFashionInfo> m_PlaceFashionList = new List <PlaceFashionInfo>();
                _Load <PlaceFashionInfo>(file, m_PlaceFashionList);

                // 光效石属性
                XQDataLoadHelper.LoadToDic <byte, uint>(ref m_dicEffectStoneInfo, file, XQDataLoadHelper.ReadByte, XQDataLoadHelper.ReadUInt, false);

                // skin
                usNumber = 0;
                file.ReadUShort(ref usNumber);

                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CSkinInfo skinInfo = new CSkinInfo();
                    skinInfo.Load(ref file);
                    AddSkinInfo(skinInfo);
                }

                //Item animation
                file.ReadUShort(ref usNumber);
                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CItemAniInfo itemAniInfo = new CItemAniInfo();
                    itemAniInfo.Load(ref file);
                    AddItemAniInfo(itemAniInfo);
                }

                file.Close();
                s_ItemInfoMap.Sort();
                s_SkinInfoMap.Sort();
                s_ItemAniInfoMap.Sort();
                return(true);
            }
            return(false);
        }