public void OnCurrentPlayerChanged() { this.m_additionalOverloadedCrystalsOwedThisTurn = this.m_additionalOverloadedCrystalsOwedNextTurn; this.m_additionalOverloadedCrystalsOwedNextTurn = 0; if (this.m_additionalOverloadedCrystalsOwedThisTurn > 0) { this.m_overloadLocksAreShowing = true; } else { this.m_overloadLocksAreShowing = false; } for (int i = 0; i < this.m_permanentCrystals.Count; i++) { ManaCrystal crystal = this.m_permanentCrystals[i]; if (crystal.IsOverloaded()) { crystal.UnlockOverload(); } if (crystal.IsOwedForOverload()) { this.m_overloadLocksAreShowing = true; crystal.PayOverload(); } else if (this.m_additionalOverloadedCrystalsOwedThisTurn > 0) { crystal.PayOverload(); this.m_additionalOverloadedCrystalsOwedThisTurn--; } } }
public int GetSpendableManaCrystals() { int num = 0; for (int i = 0; i < this.m_temporaryCrystals.Count; i++) { ManaCrystal crystal = this.m_temporaryCrystals[i]; if (crystal.state == ManaCrystal.State.READY) { num++; } } for (int j = 0; j < this.m_permanentCrystals.Count; j++) { ManaCrystal crystal2 = this.m_permanentCrystals[j]; if ((crystal2.state == ManaCrystal.State.READY) && !crystal2.IsOverloaded()) { num++; } } return(num); }