예제 #1
0
        private static RuneInfo CheckRuneInfo(Rune info)
        {
            var rRarity = info.Rank;
            var rSub1   = 0;
            var rSub2   = 0;
            var rSub3   = 0;
            var rSub4   = 0;

            if (rRarity >= 2)
            {
                rSub1 = info.SecEff[0][0];
            }
            if (rRarity >= 3)
            {
                rSub2 = info.SecEff[1][0];
            }
            if (rRarity >= 4)
            {
                rSub3 = info.SecEff[2][0];
            }
            if (rRarity >= 5)
            {
                rSub4 = info.SecEff[3][0];
            }

            var runeInfo = new RuneInfo {
                Rarity   = (RuneRarity)rRarity,
                Slot     = info.SlotNo,
                Stars    = info.Class,
                MainStat = (RuneStat)info.PriEff[0],
                SubStat  = (RuneStat)info.PrefixEff[0],
                Sub1     = (RuneStat)rSub1,
                Sub2     = (RuneStat)rSub2,
                Sub3     = (RuneStat)rSub3,
                Sub4     = (RuneStat)rSub4
            };

            return(runeInfo);
        }
예제 #2
0
        private static bool SmartRuneShouldSell(RuneInfo rune, Smartrune config)
        {
            if (config.Minstars > rune.Stars)
            {
                return(true);
            }

            if (rune.Stars == 6)
            {
                if (rune.Rarity < config.Minrarity6)
                {
                    return(true);
                }
            }
            else
            {
                if (rune.Rarity < config.Minrarity5)
                {
                    return(true);
                }
            }

            if (rune.Rarity == RuneRarity.Legend)
            {
                return(false);
            }

            if (rune.Slot == 2 || rune.Slot == 4 || rune.Slot == 6)
            {
                if (rune.MainStat == RuneStat.Spd)
                {
                    if (config.Min2Spd > rune.Stars)
                    {
                        return(true);
                    }
                }
                else
                {
                    if (config.Min246 > rune.Stars)
                    {
                        return(true);
                    }
                }

                if (rune.MainStat == RuneStat.AtkFlat ||
                    rune.MainStat == RuneStat.DefFlat ||
                    rune.MainStat == RuneStat.HpFlat ||
                    rune.MainStat == RuneStat.Resistance)
                {
                    return(true);
                }

                // TODO: FIX THIS PART ON THE CONFIG FILE
                if (rune.Stars == 6 && rune.Rarity >= RuneRarity.Hero)
                {
                    return(false);
                }
            }

            var found      = false;
            var properMain = config.Runepattern.Any(i => i.Main == rune.MainStat);

            foreach (var pat in config.Runepattern)
            {
                if (properMain && pat.Main != rune.MainStat)
                {
                    continue;
                }

                var d  = 0;
                var dm = 0;

                if (pat.Sub1 != RuneStat.None)
                {
                    dm++;
                    if (rune.Sub1 == pat.Sub1)
                    {
                        d++;
                    }
                    else if (rune.Sub2 == pat.Sub1)
                    {
                        d++;
                    }
                    else if (rune.Sub3 == pat.Sub1)
                    {
                        d++;
                    }
                    else if (rune.Sub4 == pat.Sub1)
                    {
                        d++;
                    }
                }
                if (pat.Sub2 != RuneStat.None)
                {
                    dm++;
                    if (rune.Sub1 == pat.Sub2)
                    {
                        d++;
                    }
                    else if (rune.Sub2 == pat.Sub2)
                    {
                        d++;
                    }
                    else if (rune.Sub3 == pat.Sub2)
                    {
                        d++;
                    }
                    else if (rune.Sub4 == pat.Sub2)
                    {
                        d++;
                    }
                }
                if (pat.Sub3 != RuneStat.None)
                {
                    dm++;
                    if (rune.Sub1 == pat.Sub3)
                    {
                        d++;
                    }
                    else if (rune.Sub2 == pat.Sub3)
                    {
                        d++;
                    }
                    else if (rune.Sub3 == pat.Sub3)
                    {
                        d++;
                    }
                    else if (rune.Sub4 == pat.Sub3)
                    {
                        d++;
                    }
                }

                if (dm == d && d != 0)
                {
                    found = true;
                    break;
                }
            }
            return(!found);
        }