コード例 #1
0
        public static void DropItem(Rectangle Area, params Drop[] Drops)
        {
            List <Drop> Sh = new List <Drop>();

            Drops
            .ToList()
            .ForEach(drop => {
                for (int index = 0; index < drop.Chance; index++)
                {
                    Sh.Add(drop);
                }
            });
            Drop DroppedItem = Sh[Main.rand.Next(Sh.Count)];

            Item.NewItem((int)Area.X, (int)Area.Y, Area.Height, Area.Width, DroppedItem.Item, DroppedItem.Count);
        }