Пример #1
0
 public Upgrade()
 {
     this.rarity     = Rarity.NO_RARITY;
     this.name       = string.Empty;
     this.cardText   = string.Empty;
     this.upgradeSet = UpgradeSet.Classic;
 }
Пример #2
0
        public bool CanUpgrade(UpgradeSet existingUpgrades)
        {
            if (_triggered)
            {
                return(false);
            }

            // Does the object / player have the prerequisite upgrades that trigger this upgrade?
            var triggered = _data.RequiresAllTriggers
                ? existingUpgrades.SetEquals(_data.TriggeredByHashSet)
                : existingUpgrades.Overlaps(_data.TriggeredByHashSet);

            if (!triggered)
            {
                return(false);
            }

            // Does the object / player have any upgrades that conflict with this upgrade?
            var conflicts = _data.RequiresAllConflictingTriggers
                ? existingUpgrades.SetEquals(_data.ConflictsWithHashSet)
                : existingUpgrades.Overlaps(_data.ConflictsWithHashSet);

            if (conflicts)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
    void Consume(UpgradeSet upgrade)
    {
        isConsumed = true;

        upgrade.AddPoints(value);

        Destroy(this);
        Destroy(toMove.gameObject);
    }
Пример #4
0
    void Consume(UpgradeSet upgrade)
    {
        isConsumed = true;

        upgrade.AddPoints(value);

        Destroy(this);
        Destroy(toMove.gameObject);
    }
Пример #5
0
 public Upgrade(UpgradeSet set, string name, int cost, int attack, int health, Rarity rarity, string cardText = "")
 {
     this.upgradeSet          = set;
     this.name                = name;
     this.rarity              = rarity;
     this.Cost                = cost;
     this.creatureData.attack = attack;
     this.creatureData.health = health;
     this.cardText            = cardText;
 }
 public static void ShuffleUpgrades(UpgradeSet upgradeSet)
 {
     for (int i = 0; i < upgradeSet.upgrades.Count; i++)
     {
         Upgrade temp        = upgradeSet.upgrades[i];
         int     randomIndex = Random.Range(i, upgradeSet.upgrades.Count);
         upgradeSet.upgrades[i]           = upgradeSet.upgrades[randomIndex];
         upgradeSet.upgrades[randomIndex] = temp;
     }
 }
Пример #7
0
        public void TryUpgrade(UpgradeSet completedUpgrades)
        {
            if (!CanUpgrade(completedUpgrades))
            {
                return;
            }

            _triggerUpgradeCallback();

            _triggered = true;
        }
    public void SetupButtons(UpgradeSet newUpgrades)
    {
        if (ButtonsActive)
        {
            PickRandomUpgrade();
            ShowAllButtons();
        }

        upgradeSet = newUpgrades;

        int i = 0;

        foreach (UpgradeButton button in buttons)
        {
            button.SetButtonUpgrade(upgradeSet.upgrades[i]);
            i++;
        }

        ShowAllButtons();
    }
Пример #9
0
 public void TryUpgrade(UpgradeSet completedUpgrades) => _upgradeLogic.TryUpgrade(completedUpgrades);
Пример #10
0
 public bool CanUpgrade(UpgradeSet existingUpgrades) => _upgradeLogic.CanUpgrade(existingUpgrades);
    private UpgradeSet GetUpgradeSet()
    {
        UpgradeSet result = new UpgradeSet(GetPositiveUpgrade(), GetNeutralUpgrade(), GetNegativeUpgrades());

        return(result);
    }
Пример #12
0
 public SetAttribute(UpgradeSet set = UpgradeSet.Classic)
 {
     Set = set;
 }