public Upgrade() { this.rarity = Rarity.NO_RARITY; this.name = string.Empty; this.cardText = string.Empty; this.upgradeSet = UpgradeSet.Classic; }
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); }
void Consume(UpgradeSet upgrade) { isConsumed = true; upgrade.AddPoints(value); Destroy(this); Destroy(toMove.gameObject); }
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; } }
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(); }
public void TryUpgrade(UpgradeSet completedUpgrades) => _upgradeLogic.TryUpgrade(completedUpgrades);
public bool CanUpgrade(UpgradeSet existingUpgrades) => _upgradeLogic.CanUpgrade(existingUpgrades);
private UpgradeSet GetUpgradeSet() { UpgradeSet result = new UpgradeSet(GetPositiveUpgrade(), GetNeutralUpgrade(), GetNegativeUpgrades()); return(result); }
public SetAttribute(UpgradeSet set = UpgradeSet.Classic) { Set = set; }