示例#1
0
        public static Dictionary <DataStoreIDCrystarium, string> GetDisplayNames(DataStoreWDB <DataStoreCrystarium, DataStoreIDCrystarium> crystarium)
        {
            Dictionary <DataStoreIDCrystarium, string> names = new Dictionary <DataStoreIDCrystarium, string>();
            List <DataStoreIDCrystarium> ids = crystarium.IdList.Skip(4).ToList();

            ids.Sort((a, b) => a.CompareTo(b));

            int val = 0, node = 0;

            for (int i = 0; i < crystarium.DataList.Count; i++)
            {
                val++;
                if (i == 0 || ids[i].Node != ids[i - 1].Node)
                {
                    node++;
                }
                if (i > 0)
                {
                    if (ids[i].Stage > ids[i - 1].Stage || ids[i].Prefix != ids[i - 1].Prefix)
                    {
                        val  = 1;
                        node = 1;
                    }
                }

                string dispName = $"{node}";
                if (ids[i].SubNode > 0)
                {
                    int highestSub    = ids.Where(id => id.Prefix == ids[i].Prefix && id.Stage == ids[i].Stage && id.Node == ids[i].Node).Select(id => id.SubNode).Max();
                    int highestSubSub = ids.Where(id => id.Prefix == ids[i].Prefix && id.Stage == ids[i].Stage && id.Node == ids[i].Node).Select(id => id.SubSubNode).Max();
                    if (highestSub > 1 || highestSubSub <= 1)
                    {
                        dispName += $"-{ids[i].SubNode}";
                    }
                    if (highestSubSub > 1)
                    {
                        dispName += $"-{ids[i].SubSubNode}";
                    }
                }

                names.Add(ids[i], dispName);
            }
            return(names);
        }
示例#2
0
        public List <Ability> GetAbilitiesAvailable(int stage, DataStoreWDB <DataStoreCrystarium, DataStoreIDCrystarium> crystarium, bool leader, bool skytank)
        {
            if (stage == 0)
            {
                List <Ability> list = new List <Ability>();
                list.Add(Abilities.Attack);
                if (Character == Character.Snow)
                {
                    list.Add(Abilities.HandGrenade);
                }
                return(list);
            }

            return(crystarium.DataList.Where(c => c.Stage <= stage && RolesAvailable.Contains(c.Role) && c.Type == CrystariumType.Ability).Select(c => Abilities.GetAbility(Character.ToString().ToLower(), c))
                   .Where(a => RolesAvailable.Contains(a.Role) && a.Starting).Select(a =>
            {
                if (skytank)
                {
                    if (a == Abilities.Attack && Character != Character.Lightning)
                    {
                        return Abilities.Ruin;
                    }
                    if (a == Abilities.Flamestrike)
                    {
                        return Abilities.Fire;
                    }
                    if (a == Abilities.Aquastrike)
                    {
                        return Abilities.Water;
                    }
                    if (a == Abilities.Froststrike)
                    {
                        return Abilities.Blizzard;
                    }
                    if (a == Abilities.Sparkstrike)
                    {
                        return Abilities.Thunder;
                    }
                }
                return a;
            }).ToList());
        }