コード例 #1
0
        public static int[] SelectStone(Json_GachaExcite[] json, int rare)
        {
            int maxValue = 0;

            foreach (Json_GachaExcite jsonGachaExcite in json)
            {
                if (rare == jsonGachaExcite.fields.rarity)
                {
                    maxValue += jsonGachaExcite.fields.weight;
                }
            }
            int num1 = new Random().Next(maxValue);
            int num2 = 0;

            foreach (Json_GachaExcite jsonGachaExcite in json)
            {
                if (rare == jsonGachaExcite.fields.rarity)
                {
                    num2 += jsonGachaExcite.fields.weight;
                    if (num1 < num2)
                    {
                        return new int[3]
                               {
                                   GachaExciteMaster.ColorString2Int(jsonGachaExcite.fields.color1),
                                   GachaExciteMaster.ColorString2Int(jsonGachaExcite.fields.color2),
                                   GachaExciteMaster.ColorString2Int(jsonGachaExcite.fields.color3)
                               }
                    }
                    ;
                }
            }
            return(new int[3] {
                1, 1, 1
            });
        }
コード例 #2
0
        public static int[] CalcExcitesForDrop(GachaDropData a_drop)
        {
            int rare = 0;

            if (a_drop != null)
            {
                rare = a_drop.Rare;
            }
            return(GachaExciteMaster.SelectStone(JSONParser.parseJSONArray <Json_GachaExcite>(AssetManager.LoadTextData("Data/gacha/stone_animation_pattern")), rare));
        }
コード例 #3
0
        public static int[] CalcExcites(List <GachaDropData> a_drops)
        {
            int num = 1;

            using (List <GachaDropData> .Enumerator enumerator = a_drops.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GachaDropData current = enumerator.Current;
                    if (current != null)
                    {
                        num = Math.Max(num, current.Rare);
                    }
                }
            }
            return(GachaExciteMaster.Select(JSONParser.parseJSONArray <Json_GachaExcite>(AssetManager.LoadTextData("Data/gacha/animation_pattern")), num));
        }