Ejemplo n.º 1
0
        public List <eOption> GetList(eGrade grade, int lv = 25)
        {
            if (lv <= 25)
            {
                switch (grade)
                {
                case eGrade.Legend: return(list_LegendSet_GoldEnchant_under25.ToList());

                case eGrade.Set: return(list_LegendSet_GoldEnchant_under25.ToList());

                default: return(list_Normal_GoldEnchant.ToList());
                }
            }
            else
            {
                switch (grade)
                {
                case eGrade.Legend: return(list_LegendSet_GoldEnchant_under70.ToList());

                case eGrade.Set: return(list_LegendSet_GoldEnchant_under70.ToList());

                default: return(list_Normal_GoldEnchant.ToList());
                }
            }
        }
Ejemplo n.º 2
0
        private int GetOptionCount(eGrade grade, eBeyond beyond = eBeyond.None)
        {
            if (beyond == eBeyond.Mythic)
            {
                return(5);
            }
            else
            {
                switch (grade)
                {
                case eGrade.None: return(0);

                case eGrade.Normal: return(1);

                case eGrade.Magic: return(2);

                case eGrade.Rare: return(3);

                case eGrade.Epic: return(4);

                case eGrade.Legend: return(4);

                case eGrade.Set: return(4);

                default:
                    return(0);
                }
            }
        }
        public void GetItemWithBoss(fmDropItem fdi, eOption selecedOpt, out rdItem item)
        {
            int    lv    = fdi.Lv;
            eGrade grade = fdi.Grade;
            eParts parts = fdi.Parts;

            item         = new rdItem();
            item.Lv      = lv;
            item.Grade   = grade;
            item.Parts   = parts;
            item.BaseOpt = new List <rdOption>();
            item.AddOpts = new List <rdOption>();



            GetBaseOpt(item);


            List <eOption> temp = GetList(eGrade.Normal, parts, lv);

            int cnt = GetOptionCount(grade);

            //Console.WriteLine(cnt);
            for (int i = 0; i < cnt; ++i)
            {
                int hit = m_random.Next(0, temp.Count);

                eOption   kind = temp.ElementAt(hit);
                eOptGrade cc   = (eOptGrade)((int)kind >> 8);

                rdOption option = new rdOption(i + 1, false, GetOptGrade(kind), kind, GetValue(lv, kind));
                item.AddOpts.Add(option);
                temp.RemoveAt(hit);
                if (cc == eOptGrade.Normal)
                {
                    eOption remove = (eOption)((int)kind + ((int)eOptGrade.Normal << 8));
                    temp.Remove(remove);
                }
                else if (cc == eOptGrade.Epic)
                {
                    eOption remove = (eOption)((int)kind - ((int)eOptGrade.Normal << 8));
                    temp.Remove(remove);
                }
                // eOptCategory
            }

            if (eGrade.Legend <= grade)
            {
                eOptGrade optGrade = GetLegendSetOptGrade(grade);
                //Console.WriteLine(optGrade);
                eOption  kind   = selecedOpt;
                rdOption option = new rdOption(cnt + 1, false, optGrade, kind, GetValue(lv, kind));
                item.AddOpts.Add(option);
            }
        }
Ejemplo n.º 4
0
        public void BuyItem(Random lordRandom, eGrade grade, int lv, out fmDropItem item)
        {
            int    cnt   = m_parts.Count;
            int    hit   = lordRandom.Next(0, cnt);
            eParts parts = m_parts.ElementAt(hit);

            item = new fmDropItem
            {
                Lv    = lv,
                Grade = grade,
                Parts = parts
            };
        }
Ejemplo n.º 5
0
 public eOptGrade GetLegendSetOptGrade(eGrade grade)
 {
     if (grade == eGrade.Legend)
     {
         return(eOptGrade.Legend);
     }
     else if (grade == eGrade.Set)
     {
         return(eOptGrade.Set);
     }
     else
     {
         return(eOptGrade.Normal);
     }
 }
        public bool Gocha(eGrade grade, int hit)
        {
            if (false == m_dic.ContainsKey(grade))
            {
                return(false);
            }

            //Logger.Debug("{0} / {1} / {2}", grade, hit, m_dic[grade]);

            if (hit < m_dic[grade])
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 7
0
        public List <eOption> GetList(eGrade grade, eParts parts, int lv)
        {
            Dictionary <int, Dictionary <eParts, List <eOption> > > dic = null;

            if (eGrade.Legend == grade)
            {
                dic = m_optList[grade];
            }
            else if (eGrade.Set == grade)
            {
                dic = m_optList[grade];
            }
            else
            {
                dic = m_optList[eGrade.Normal];
            }

            int rangeLv = GetRangeLv(lv);

            if (true == dic.ContainsKey(rangeLv))
            {
                //Logger.Debug("dic.ContainsKey(rangeLv) {0},{1},{2}", grade, parts, lv);
                if (true == dic[rangeLv].ContainsKey(parts))
                {
                    Logger.Debug("grade{0}/dic[{1}].CKey({2})/lv{3}", grade, rangeLv, parts, lv);
                    return(dic[rangeLv][parts].ToList());
                }
                else
                {
                    Logger.Error("2-GetList {0},{1},{2},{3}", grade, parts, lv, rangeLv);
                }
            }
            else
            {
                Logger.Error("1-GetList {0},{1},{2},{3}", grade, parts, lv, rangeLv);
            }

            return(dic[1][parts].ToList());

            //if (false == m_optList.ContainsKey(rangeLv))
            //    return null;

            //if (false == m_optList[rangeLv].ContainsKey(parts))
            //    return null;

            //return m_optList[rangeLv][parts].ToList();
        }
Ejemplo n.º 8
0
        public void GetItemOnCombineCube(eParts parts, int lv, out fmDropItem item)
        {
            Random lordRandom = new Random();

            item = null;
            eGrade grade       = eGrade.None;
            eParts selectParts = eParts.None;

            {
                int hit = lordRandom.Next(0, 100);
                if (hit < 49)
                {
                    selectParts = parts;
                }
            }

            if (selectParts == eParts.None)
            {
                int cnt = m_parts.Count;
                int hit = lordRandom.Next(0, cnt);
                selectParts = m_parts.ElementAt(hit);
            }

            {
                int hit = lordRandom.Next(0, 100);
                if (hit <= 70)
                {
                    grade = eGrade.Legend;
                }
                else
                {
                    grade = eGrade.Set;
                }
            }

            item = new fmDropItem
            {
                Lv    = lv,
                Grade = grade,
                Parts = selectParts
            };
        }
Ejemplo n.º 9
0
        public eErrorCode CreateMythic(eOption selectOpt, eElement element, ref rdItem mythicItem)
        {
            rdOption keepOpt = null;

            foreach (var node in mythicItem.AddOpts)
            {
                if (eOptGrade.Legend == node.Grade || eOptGrade.Set == node.Grade)
                {
                    keepOpt = node;
                }
            }

            if (null == keepOpt)
            {
                return(eErrorCode.Error);
            }

            int    lv    = mythicItem.Lv;
            eGrade grade = mythicItem.Grade;
            eParts parts = mythicItem.Parts;

            if (parts != eParts.Weapon)
            {
                if (selectOpt == eOption.None)
                {
                    return(eErrorCode.Params_InvalidParam);
                }
            }

            int changeCode = 0;

            if (parts == eParts.Weapon)
            {
                if (false == ChangeWeaponImageCode(eBeyond.Mythic, mythicItem.Code, out changeCode))
                {
                    Logger.Error("Failed. CreateMythic {0} / {1} / {2}", parts, mythicItem.Code, selectOpt);
                    return(eErrorCode.Server_TableError);
                }
            }
            else
            {
                if (false == ChangePartsImageCode(eBeyond.Mythic, mythicItem.Parts, selectOpt, out changeCode))
                {
                    Logger.Error("Failed. CreateMythic {0} / {1} / {2}", parts, mythicItem.Code, selectOpt);
                    return(eErrorCode.Params_InvalidParam);
                }
            }

            mythicItem.Code   = changeCode;
            mythicItem.Beyond = eBeyond.Mythic;
            mythicItem.AddOpts.Clear();
            mythicItem.BaseOpt.Clear();

            if (parts == eParts.Weapon)
            {
                float min   = 0;
                float max   = 0;
                float speed = 0;
                GetWeapon(lv, out min, out max, out speed);
                {
                    eOption  select = eOption.BWDMin;
                    rdOption option = new rdOption(1, false, eOptGrade.Normal, select, min);
                    mythicItem.BaseOpt.Add(option);
                }
                {
                    eOption  select = eOption.BWDMax;
                    rdOption option = new rdOption(2, false, eOptGrade.Normal, select, max);
                    mythicItem.BaseOpt.Add(option);
                }
                {
                    eOption  select = eOption.AS;
                    rdOption option = new rdOption(3, false, eOptGrade.Normal, select, speed);
                    mythicItem.BaseOpt.Add(option);
                }
                {
                    eOption  select = eOption.Element;
                    float    value  = (float)element;
                    rdOption option = new rdOption(4, false, eOptGrade.Normal, select, value);
                    mythicItem.BaseOpt.Add(option);
                }
            }
            else
            {
                float value = 0f;
                GetBaseValue(mythicItem.Lv, selectOpt, out value);
                rdOption option = new rdOption(1, false, eOptGrade.Normal, selectOpt, value);
                mythicItem.BaseOpt.Add(option);
            }

            List <eOption> temp = GetAncientOptList(parts);

            int cnt = GetOptionCount(grade, eBeyond.Mythic);

            for (int i = 0; i < cnt; ++i)
            {
                int hit = m_random.Next(0, temp.Count);

                eOption kind = temp.ElementAt(hit);

                rdOption option = new rdOption(i + 1, false, GetOptGrade(kind), kind, GetAncientValue(lv, kind));
                mythicItem.AddOpts.Add(option);

                temp.RemoveAt(hit);
            }

            {
                keepOpt.Index = mythicItem.AddOpts.Count + 1;
                mythicItem.AddOpts.Add(keepOpt);
            }

            return(eErrorCode.Success);
        }
Ejemplo n.º 10
0
        public eErrorCode UpToAncient(ref rdItem remeltItem)
        {
            rdOption keepOpt = null;

            foreach (var node in remeltItem.AddOpts)
            {
                if (eOptGrade.Legend == node.Grade || eOptGrade.Set == node.Grade)
                {
                    keepOpt = node;
                }
            }

            if (null == keepOpt)
            {
                return(eErrorCode.Error);
            }


            int    lv    = remeltItem.Lv;
            eGrade grade = remeltItem.Grade;
            eParts parts = remeltItem.Parts;

            bool bChanged   = false;
            int  changeCode = 0;

            //if (parts == eParts.Jewel)
            //{
            //    bChanged = true;
            //    changeCode = remeltItem.Code;
            //}
            //else
            if (parts == eParts.Weapon)
            {
                bChanged = ChangeWeaponImageCode(eBeyond.Ancient, remeltItem.Code, out changeCode);
            }
            else
            {
                bChanged = ChangePartsImageCode(eBeyond.Ancient, parts, remeltItem.BaseOpt.ElementAt(0).Kind, out changeCode);
            }

            if (false == bChanged)
            {
                Logger.Error("Failed. UpToAncient {0} / {1} / {2}", parts, remeltItem.Code, remeltItem.BaseOpt.ElementAt(0).Kind);
                return(eErrorCode.Server_TableError);
            }

            remeltItem.Code = changeCode;
            remeltItem.AddOpts.Clear();

            List <eOption> temp = GetAncientOptList(parts);

            int cnt = GetOptionCount(grade);

            for (int i = 0; i < cnt; ++i)
            {
                int hit = m_random.Next(0, temp.Count);

                eOption kind = temp.ElementAt(hit);

                rdOption option = new rdOption(i + 1, false, GetOptGrade(kind), kind, GetAncientValue(lv, kind));
                remeltItem.AddOpts.Add(option);

                temp.RemoveAt(hit);
            }

            {
                remeltItem.AddOpts.Add(keepOpt);
            }

            remeltItem.Beyond = eBeyond.Ancient;

            return(eErrorCode.Success);
        }
Ejemplo n.º 11
0
        private eOption GetLegendSetOption(eGrade grade, eParts parts, int lv)
        {
            List <eOption> temp = GetList(grade, parts, lv);

            return(temp.ElementAt(m_random.Next(0, temp.Count)));
        }
Ejemplo n.º 12
0
 private List <eOption> GetList(eGrade grade, eParts parts, int lv)
 {
     return(m_dropOptList.GetList(grade, parts, lv));
 }