public static int GetBonusSpells(GameObject caster, Stat castingClass, int spellLevel) { if (spellLevel == 0) { return(0); // No bonus spells for cantrips } var spellStat = GetSpellStat(castingClass); var spellStatMod = D20StatSystem.GetModifierForAbilityScore(caster.GetStat(spellStat)); if (spellStatMod >= spellLevel) { return(((spellStatMod - spellLevel) / 4) + 1); } else { return(0); } }
public override void Render() { var currentStatValue = _assignedValueGetter(); if (currentStatValue == -1) { _label.Visible = false; } else { _label.Visible = true; var modifier = D20StatSystem.GetModifierForAbilityScore(currentStatValue); if (modifier > 0) { _label.Text = "+" + modifier; } else { _label.Text = modifier.ToString(); } } base.Render(); }