private string GetExtraTopText() { DnDCharacter character = (DnDCharacter)AppStorage.Instance.CurrentCharacter; if (character.Classes.Count < mSelectedClass) { return(""); } DnDClassSoul soul = character.Classes[mSelectedClass]; if (soul.KnownSpells.Count < mSelectedRank) { return(""); } string result = "p / u"; if (soul.CanCastExtraSpell) { result += " / +"; } int prepared = soul.NumberOfPreparedMainSpells(mSelectedRank); int unused = soul.SpellsPerDay()[mSelectedRank] - prepared; result += "\n" + prepared + " / " + unused; if (soul.CanCastExtraSpell) { int extra = soul.NumberOfPreparedExtraSpells(mSelectedRank); result += " / " + extra; } return(result); }
public override void Update() { base.Update(); if (mSoul != null) { if (!mSoul.NeedsToPrepareSpells && mSelectedClass >= 0 && mSelectedRank >= 0) { int spellsPerDay = mSoul.SpellsPerDay()[mSelectedRank]; while (mSoul.MainSpells.Count < mSelectedRank) { mSoul.MainSpells.Add(new List <KeyValuePair <Spell, bool> >()); } if (mSoul.MainSpells[mSelectedRank].Count == spellsPerDay) { foreach (var button in mButtonList) { ViewUtility.EnableSimpleButton(button, false); } } } } }