Ejemplo n.º 1
0
    public void RestockTrinkets()
    {
        Trinkets.Clear();
        var trinketList = DarkestDungeonManager.Data.Items["trinket"].Values.Cast <Trinket>().ToList();

        for (int i = 0; i < TrinketSlots; i++)
        {
            var rarity     = RandomSolver.ChooseByRandom(RarityTable).RarityId;
            var rarityList = trinketList.FindAll(item => item.RarityId == rarity);
            Trinkets.Add(rarityList[UnityEngine.Random.Range(0, rarityList.Count)]);
        }
        Trinkets.Sort((x, y) => y.PurchasePrice.CompareTo(x.PurchasePrice));
    }
Ejemplo n.º 2
0
    public override void InitializeBuilding(Dictionary <string, UpgradePurchases> purchases)
    {
        base.InitializeBuilding(purchases);

        Trinkets.Clear();

        for (int i = DiscountUpgrades.Count - 1; i >= 0; i--)
        {
            if (purchases[DiscountUpgrades[i].TreeId].PurchasedUpgrades.Contains(DiscountUpgrades[i].UpgradeCode))
            {
                Discount += DiscountUpgrades[i].Percent;
            }
        }

        for (int i = TrinketSlotUpgrades.Count - 1; i >= 0; i--)
        {
            if (purchases[TrinketSlotUpgrades[i].TreeId].PurchasedUpgrades.Contains(TrinketSlotUpgrades[i].UpgradeCode))
            {
                TrinketSlots = TrinketSlotUpgrades[i].NumberOfSlots;
                break;
            }
        }
    }