예제 #1
0
        /// <summary>
        /// 装备对应品质
        /// </summary>
        /// <param name="qualityType"></param>
        /// <returns></returns>
        public static PriorityQuality UserEquPriorityQuality(QualityType qualityType)
        {
            PriorityQuality quality = new PriorityQuality();

            switch (qualityType)
            {
            case QualityType.BaiSe:
                quality = PriorityQuality.First;
                break;

            case QualityType.LanSe:
                quality = PriorityQuality.Three;
                break;

            case QualityType.ZiSe:
                quality = PriorityQuality.Four;
                break;

            case QualityType.HuangSe:
                quality = PriorityQuality.Five;
                break;

            case QualityType.HongSe:
                quality = PriorityQuality.Six;
                break;
            }
            return(quality);
        }
예제 #2
0
        /// <summary>
        /// 灵件先攻
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="_userItemID"></param>
        /// <returns></returns>
        public static int GeneralSparePriority(string userID, string _userItemID)
        {
            int      sparePriority = 0;
            GameUser user          = new GameDataCacheSet <GameUser>().FindKey(userID);

            if (user != null)
            {
                UserSparePart[] sparePartsArray = user.SparePartList.FindAll(m => m.UserItemID.Equals(_userItemID)).ToArray();
                foreach (UserSparePart sparePart in sparePartsArray)
                {
                    SparePartInfo partInfo = new ConfigCacheSet <SparePartInfo>().FindKey(sparePart.SparePartId);
                    if (partInfo != null)
                    {
                        SparePartQuality sparequality = partInfo.QualityType.ToEnum <SparePartQuality>();
                        PriorityQuality  quality      = UserSparePriorityQuality(sparequality);
                        int baseNum       = PriorityBaseNum(PriorityType.Spare, quality);
                        int effectNum     = PriorityEffectNum(PriorityType.Spare, quality);
                        var propertyArray = sparePart.Propertys;
                        foreach (SparePartProperty property in propertyArray)
                        {
                            if (property.AbilityType != AbilityType.Empty)
                            {
                                sparePriority += (MathUtils.Addition(baseNum, effectNum * property.ValueIndex));
                            }
                        }
                    }
                }
            }
            return(sparePriority);
        }
예제 #3
0
        /// <summary>
        /// 加成值
        /// </summary>
        /// <param name="priorityType"></param>
        /// <param name="priorityQuality"></param>
        /// <returns></returns>
        public static int PriorityEffectNum(PriorityType priorityType, PriorityQuality priorityQuality)
        {
            int          baseNum  = 0;
            PriorityInfo priority = new ConfigCacheSet <PriorityInfo>().FindKey(priorityType, priorityQuality);

            if (priority != null)
            {
                baseNum = priority.EffectNum;
            }
            return(baseNum);
        }
예제 #4
0
        /// <summary>
        /// 基础值
        /// </summary>
        /// <param name="priorityType"></param>
        /// <param name="priorityQuality"></param>
        /// <returns></returns>
        public static int PriorityBaseNum(PriorityType priorityType, PriorityQuality priorityQuality)
        {
            int          baseNum  = 0;
            PriorityInfo priority = new ShareCacheStruct <PriorityInfo>().FindKey(priorityType, priorityQuality);

            if (priority != null)
            {
                baseNum = priority.BaseNum;
            }
            return(baseNum);
        }
예제 #5
0
        /// <summary>
        /// 药剂先功
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="generalID"></param>
        /// <returns></returns>
        public static int GeneralMedicinePriority(string userID, int generalID)
        {
            int medicinePriority = 0;
            var medicineArray    = new GameDataCacheSet <GeneralMedicine>().FindAll(userID, m => m.GeneralID == generalID);

            foreach (GeneralMedicine medicine in medicineArray)
            {
                ItemBaseInfo itemInfo = new ConfigCacheSet <ItemBaseInfo>().FindKey(medicine.MedicineID);
                if (itemInfo != null)
                {
                    PriorityQuality quality = itemInfo.MedicineLv.ToInt().ToEnum <PriorityQuality>();
                    int             baseNum = PriorityBaseNum(PriorityType.Medicine, quality);
                    medicinePriority += baseNum;
                }
            }
            return(medicinePriority);
        }
예제 #6
0
        protected override object this[string index]
        {
            get
            {
                #region
                switch (index)
                {
                case "PriorityType": return(PriorityType);

                case "PriorityQuality": return(PriorityQuality);

                case "BaseNum": return(BaseNum);

                case "EffectNum": return(EffectNum);

                default: throw new ArgumentException(string.Format("PriorityInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
            set
            {
                #region
                switch (index)
                {
                case "PriorityType":
                    _PriorityType = value.ToEnum <PriorityType>();
                    break;

                case "PriorityQuality":
                    _PriorityQuality = value.ToEnum <PriorityQuality>();
                    break;

                case "BaseNum":
                    _BaseNum = value.ToShort();
                    break;

                case "EffectNum":
                    _EffectNum = value.ToShort();
                    break;

                default: throw new ArgumentException(string.Format("PriorityInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
        }
예제 #7
0
        /// <summary>
        /// 命运水晶
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="generalID"></param>
        /// <returns></returns>
        public static int GeneralCrystalPriority(string userID, int generalID)
        {
            int crystalPriority = 0;
            var package         = UserCrystalPackage.Get(userID);

            if (package != null)
            {
                List <UserCrystalInfo> userCrystalArray = package.CrystalPackage.FindAll(m => m.GeneralID.Equals(generalID));
                foreach (UserCrystalInfo crystal in userCrystalArray)
                {
                    PriorityQuality quality   = crystal.CrystalQuality.ToInt().ToEnum <PriorityQuality>();
                    int             baseNum   = PriorityBaseNum(PriorityType.Crystal, quality);
                    int             effectNum = crystal.CrystalLv >= 1 ? PriorityEffectNum(PriorityType.Crystal, quality) : 0;
                    crystalPriority += (MathUtils.Addition(baseNum, crystal.CrystalLv * effectNum));
                }
            }
            return(crystalPriority);
        }
예제 #8
0
        /// <summary>
        /// 装备先攻值
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="generalID"></param>
        /// <returns></returns>
        public static int GeneralEquPriority(string userID, int generalID)
        {
            int itemEquPriority = 0;
            var package         = UserItemPackage.Get(userID);
            List <UserItemInfo> userItemArray = package.ItemPackage.FindAll(m => m.GeneralID.Equals(generalID));

            foreach (UserItemInfo item in userItemArray)
            {
                ItemBaseInfo itemInfo = new ConfigCacheSet <ItemBaseInfo>().FindKey(item.ItemID);
                if (itemInfo != null)
                {
                    PriorityQuality quality   = UserEquPriorityQuality(itemInfo.QualityType); //itemInfo.QualityType.ToInt().ToEnum<PriorityQuality>();
                    int             baseNum   = PriorityBaseNum(PriorityType.Equ, quality);
                    int             effectNum = PriorityEffectNum(PriorityType.Equ, quality);
                    itemEquPriority += (MathUtils.Addition(baseNum, item.ItemLv * effectNum));
                    itemEquPriority += GeneralSparePriority(userID, item.UserItemID);
                }
            }
            return(itemEquPriority);
        }
예제 #9
0
        /// <summary>
        /// 零件对应品质
        /// </summary>
        /// <param name="qualityType"></param>
        /// <returns></returns>
        public static PriorityQuality UserSparePriorityQuality(SparePartQuality qualityType)
        {
            PriorityQuality quality = new PriorityQuality();

            switch (qualityType)
            {
            case SparePartQuality.LanSe:
                quality = PriorityQuality.Three;
                break;

            case SparePartQuality.ZiSe:
                quality = PriorityQuality.Four;
                break;

            case SparePartQuality.Yellow:
                quality = PriorityQuality.Five;
                break;
            }
            return(quality);
        }
예제 #10
0
 /// <summary>
 /// 零件对应品质
 /// </summary>
 /// <param name="qualityType"></param>
 /// <returns></returns>
 public static PriorityQuality UserSparePriorityQuality(SparePartQuality qualityType)
 {
     PriorityQuality quality = new PriorityQuality();
     switch (qualityType)
     {
         case SparePartQuality.LanSe:
             quality = PriorityQuality.Three;
             break;
         case SparePartQuality.ZiSe:
             quality = PriorityQuality.Four;
             break;
         case SparePartQuality.Yellow:
             quality = PriorityQuality.Five;
             break;
     }
     return quality;
 }
예제 #11
0
 /// <summary>
 /// 装备对应品质
 /// </summary>
 /// <param name="qualityType"></param>
 /// <returns></returns>
 public static PriorityQuality UserEquPriorityQuality(QualityType qualityType)
 {
     PriorityQuality quality = new PriorityQuality();
     switch (qualityType)
     {
         case QualityType.BaiSe:
             quality = PriorityQuality.First;
             break;
         case QualityType.LanSe:
             quality = PriorityQuality.Three;
             break;
         case QualityType.ZiSe:
             quality = PriorityQuality.Four;
             break;
         case QualityType.HuangSe:
             quality = PriorityQuality.Five;
             break;
         case QualityType.HongSe:
             quality = PriorityQuality.Six;
             break;
     }
     return quality;
 }
예제 #12
0
 /// <summary>
 /// 加成值
 /// </summary>
 /// <param name="priorityType"></param>
 /// <param name="priorityQuality"></param>
 /// <returns></returns>
 public static int PriorityEffectNum(PriorityType priorityType, PriorityQuality priorityQuality)
 {
     int baseNum = 0;
     PriorityInfo priority = new ShareCacheStruct<PriorityInfo>().FindKey(priorityType, priorityQuality);
     if (priority != null)
     {
         baseNum = priority.EffectNum;
     }
     return baseNum;
 }
예제 #13
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "PriorityType": return PriorityType;
             case "PriorityQuality": return PriorityQuality;
             case "BaseNum": return BaseNum;
             case "EffectNum": return EffectNum;
             default: throw new ArgumentException(string.Format("PriorityInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "PriorityType":
                 _PriorityType = value.ToEnum<PriorityType>();
                 break;
             case "PriorityQuality":
                 _PriorityQuality = value.ToEnum<PriorityQuality>();
                 break;
             case "BaseNum":
                 _BaseNum = value.ToShort();
                 break;
             case "EffectNum":
                 _EffectNum = value.ToShort();
                 break;
             default: throw new ArgumentException(string.Format("PriorityInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }
예제 #14
0
 /// <summary>
 /// 基础值
 /// </summary>
 /// <param name="priorityType"></param>
 /// <param name="priorityQuality"></param>
 /// <returns></returns>
 public static int PriorityBaseNum(PriorityType priorityType, PriorityQuality priorityQuality)
 {
     int baseNum = 0;
     PriorityInfo priority = new ConfigCacheSet<PriorityInfo>().FindKey(priorityType, priorityQuality);
     if (priority != null)
     {
         baseNum = priority.BaseNum;
     }
     return baseNum;
 }