Пример #1
0
        private Inventory GetLoot(Area arena, int level)
        {
            long                score = Modifiers.CurrentScore;
            Inventory           loot  = new Inventory();
            LootTables <string> lt    = new LootTables <string>(arena.loot, Program.rng);

            for (; score > 0; score -= 100)
            {
                if (Program.Chance(score))
                {
                    Item item;
                    if (Program.Chance(10))
                    {
                        item = Item.CreateRune(1);
                    }
                    else if (arena.ValidTable(arena.loot))
                    {
                        item = Item.LoadItem(lt.GetItem(out _).Trim());
                        item.Scale(level);
                    }
                    else
                    {
                        item = Item.RandomGear(level * 5, true);
                    }

                    loot.Add(item, 1, -1);

                    if (Program.Chance(20))
                    {
                        loot.Add(Item.CreateRepairKit(1), 1, -1);
                    }
                }
            }

            return(loot);
        }