private bool CanAfford() { ManaRestriction restriction = GetManaRestriction(); if (restriction != null) { return(action.Actor.Stats["Mana"].Value >= restriction.Amount); } return(true); }
private void RefreshManaCost() { // Show mana restriction if there is one ManaRestriction restriction = GetManaRestriction(); bool hasManaRestriction = restriction != null; ManaCost.SetActive(hasManaRestriction); if (hasManaRestriction) { // Set text and colour ManaCostText.text = restriction.Amount.ToString(); ManaCostText.color = CanAfford() ? canAffordColour : cantAffordColour; } }
public override void Setup(IBattleActionElement element) { ManaRestriction manaRestriction = element as ManaRestriction; text.text = manaRestriction.Amount.ToString(); }