void update_list() { SkillList.BeginUpdate(); SkillList.Items.Clear(); List <ListViewItem> items = new List <ListViewItem>(); foreach (SkillData sd in fSkills) { ListViewItem lvi = new ListViewItem(sd.SkillName); lvi.SubItems.Add((sd.Level >= 0) ? "+" + sd.Level.ToString() : sd.Level.ToString()); lvi.SubItems.Add((sd.Ability >= 0) ? "+" + sd.Ability.ToString() : sd.Ability.ToString()); lvi.SubItems.Add(sd.Trained ? "+5" : ""); if (sd.Misc != 0) { lvi.SubItems.Add((sd.Misc >= 0) ? "+" + sd.Misc.ToString() : sd.Misc.ToString()); } else { lvi.SubItems.Add(""); } lvi.SubItems.Add((sd.Total >= 0) ? "+" + sd.Total.ToString() : sd.Total.ToString()); if (!sd.Show) { lvi.ForeColor = SystemColors.GrayText; lvi.UseItemStyleForSubItems = false; } lvi.Tag = sd; items.Add(lvi); } SkillList.Items.AddRange(items.ToArray()); SkillList.EndUpdate(); }
void update_skills() { int level = (int)LevelBox.Value; SkillList.BeginUpdate(); SkillList.Items.Clear(); ListViewItem lvi_easy = SkillList.Items.Add("Easy"); lvi_easy.SubItems.Add(AI.GetSkillDC(Difficulty.Easy, level).ToString()); ListViewItem lvi_moderate = SkillList.Items.Add("Moderate"); lvi_moderate.SubItems.Add(AI.GetSkillDC(Difficulty.Moderate, level).ToString()); ListViewItem lvi_hard = SkillList.Items.Add("Hard"); lvi_hard.SubItems.Add(AI.GetSkillDC(Difficulty.Hard, level).ToString()); SkillList.EndUpdate(); DamageList.BeginUpdate(); DamageList.Items.Clear(); DamageList.ShowGroups = false; ListViewItem lvi_damage = DamageList.Items.Add("Against a single target"); lvi_damage.SubItems.Add(Statistics.NormalDamage(level)); lvi_damage.Group = DamageList.Groups[0]; ListViewItem lvi_multiple = DamageList.Items.Add("Against multiple targets"); lvi_multiple.SubItems.Add(Statistics.MultipleDamage(level)); lvi_multiple.Group = DamageList.Groups[0]; DamageList.EndUpdate(); }
void update_list() { int level = (int)LevelBox.Value; int aid_another = 10 + (level / 2); string normal = Statistics.NormalDamage(level); string multiple = Statistics.MultipleDamage(level); string minion = Statistics.MinionDamage(level).ToString(); SkillList.BeginUpdate(); SkillList.Items.Clear(); #region Skill DCs ListViewItem lvi_easy = SkillList.Items.Add("Easy"); lvi_easy.SubItems.Add("DC " + AI.GetSkillDC(Difficulty.Easy, level)); lvi_easy.Group = SkillList.Groups[0]; ListViewItem lvi_moderate = SkillList.Items.Add("Moderate"); lvi_moderate.SubItems.Add("DC " + AI.GetSkillDC(Difficulty.Moderate, level)); lvi_moderate.Group = SkillList.Groups[0]; ListViewItem lvi_hard = SkillList.Items.Add("Hard"); lvi_hard.SubItems.Add("DC " + AI.GetSkillDC(Difficulty.Hard, level)); lvi_hard.Group = SkillList.Groups[0]; #endregion #region Aid Another ListViewItem lvi_aid = SkillList.Items.Add("Aid Another"); lvi_aid.SubItems.Add("DC " + aid_another); lvi_aid.Group = SkillList.Groups[1]; #endregion #region Damage ListViewItem lvi_damage = SkillList.Items.Add("Against a single target"); lvi_damage.SubItems.Add(normal); lvi_damage.Tag = DiceExpression.Parse(normal); lvi_damage.Group = SkillList.Groups[2]; ListViewItem lvi_multiple = SkillList.Items.Add("Against multiple targets"); lvi_multiple.SubItems.Add(multiple); lvi_multiple.Tag = DiceExpression.Parse(multiple); lvi_multiple.Group = SkillList.Groups[2]; ListViewItem lvi_minion = SkillList.Items.Add("From a minion"); lvi_minion.SubItems.Add(minion); lvi_minion.Tag = DiceExpression.Parse(minion); lvi_minion.Group = SkillList.Groups[2]; #endregion #region Monster Knowledge ListViewItem lvi_aberrant = SkillList.Items.Add("Aberrant"); lvi_aberrant.SubItems.Add("Dungeoneering"); lvi_aberrant.Group = SkillList.Groups[3]; ListViewItem lvi_elemental = SkillList.Items.Add("Elemental"); lvi_elemental.SubItems.Add("Arcana"); lvi_elemental.Group = SkillList.Groups[3]; ListViewItem lvi_fey = SkillList.Items.Add("Fey"); lvi_fey.SubItems.Add("Arcana"); lvi_fey.Group = SkillList.Groups[3]; ListViewItem lvi_immortal = SkillList.Items.Add("Immortal"); lvi_immortal.SubItems.Add("Religion"); lvi_immortal.Group = SkillList.Groups[3]; ListViewItem lvi_natural = SkillList.Items.Add("Natural"); lvi_natural.SubItems.Add("Nature"); lvi_natural.Group = SkillList.Groups[3]; ListViewItem lvi_shadow = SkillList.Items.Add("Shadow"); lvi_shadow.SubItems.Add("Arcana"); lvi_shadow.Group = SkillList.Groups[3]; ListViewItem lvi_undead = SkillList.Items.Add("Undead keyword"); lvi_undead.SubItems.Add("Religion"); lvi_undead.Group = SkillList.Groups[3]; #endregion SkillList.EndUpdate(); }