// This loads non-spell abilities. public void LoadAbility(Ability values) { AbilityNameTextBox.Text = values.Title; DescriptionTextBox.Text = values.Description; NewAbility = values; NewAbility.isSpell = false; }
// This loads spells. public void LoadSpell(Ability values) { NewAbility = values; tabControl1.SelectedIndex = 1; string[] spellValues = values.Description.Split('|'); SpellClass.Text = spellValues[0]; SpellCastingAbility.Text = spellValues[1]; SpellcastingLevel.Value = Convert.ToInt32(spellValues[2]); if (spellValues[3] == "Innate") { InnateCheckbox.Checked = true; } else { Spellslot1.Value = Convert.ToInt32(spellValues[4].Split(',')[0]); Spellslot2.Value = Convert.ToInt32(spellValues[4].Split(',')[1]); Spellslot3.Value = Convert.ToInt32(spellValues[4].Split(',')[2]); Spellslot4.Value = Convert.ToInt32(spellValues[4].Split(',')[3]); Spellslot5.Value = Convert.ToInt32(spellValues[4].Split(',')[4]); Spellslot6.Value = Convert.ToInt32(spellValues[4].Split(',')[5]); Spellslot7.Value = Convert.ToInt32(spellValues[4].Split(',')[6]); Spellslot8.Value = Convert.ToInt32(spellValues[4].Split(',')[7]); Spellslot9.Value = Convert.ToInt32(spellValues[4].Split(',')[8]); } foreach (string item in spellValues[5].Split(',')) { if (!String.IsNullOrWhiteSpace(item) || !String.IsNullOrEmpty(item)) { SpellList.Items.Add(item.Replace(':', '|')); } } }
public void LoadAttack(Ability values) { AttackAbilityNameField.Text = values.Title; AttackAbilityDescriptionField.Text = values.Description; NewAbility = values; NewAbility.isDamage = false; }
private void button1_Click(object sender, EventArgs e) { this.NewAbility = new Ability(); NewAbility.Title = textBox1.Text; NewAbility.Description = richTextBox1.Text; this.Close(); }
private void Save(object sender, EventArgs e) { this.NewAbility = new Ability(); NewAbility.Title = AbilityNameTextBox.Text; NewAbility.Description = DescriptionTextBox.Text; NewAbility.isDamage = false; this.Close(); }
// Loads abilities. public void LoadAction(Ability values) { AttackAbilityNameField.Text = values.Title; AttackAbilityDescriptionField.Text = values.Description; NewAbility = values; NewAbility.isDamage = false; NewAbility.isSpell = false; tabControl1.SelectedIndex = 1; }
private void button1_Click(object sender, EventArgs e) { this.NewAttack = new Attack( comboBox1.Text, numericUpDown1.Value.ToString(), comboBox2.Text, (int)numericUpDown2.Value, textBox3.Text, textBox1.Text); NewAttack.Title = textBox2.Text; this.Close(); }
private void AddSavedTrait_FormClosing(object sender, FormClosingEventArgs e) { try { switch (tabControl1.SelectedIndex) { case 0: foreach (OGL_Ability _ability in OGLContent.OGL_Abilities) { if (_ability.OGL_Creature == comboBox5.Text && _ability.Title == comboBox1.Text) { ability = _ability; } } break; case 1: foreach (OGL_Ability _action in OGLContent.OGL_Actions) { if (_action.OGL_Creature == comboBox5.Text && _action.Title == comboBox2.Text) { action = _action; } } break; case 2: foreach (OGL_Ability _reaction in OGLContent.OGL_Reactions) { if (_reaction.OGL_Creature == comboBox5.Text && _reaction.Title == comboBox3.Text) { reaction = _reaction; } } break; case 3: foreach (OGL_Legendary _legendary in OGLContent.OGL_Legendary) { if (_legendary.OGL_Creature == comboBox5.Text && _legendary.Title == comboBox4.Text) { legendary = _legendary; } } break; } } catch { ability = null; action = null; reaction = null; legendary = null; } }
// Loads attacks. public void LoadAttack(Ability values) { NewAttack = values; AttackNameField.Text = values.Title; foreach (string item in AttackTypeDropdown.Items) { if (values.attack._Attack == item) { AttackTypeDropdown.SelectedItem = item; } } AttackBonusUpDown.Value = Convert.ToInt32(values.attack.Bonus); ReachUpDown.Value = values.attack.Reach; RangeUpDownClose.Value = values.attack.RangeClose; RangeUpDownFar.Value = values.attack.RangeFar; AttackTargetField.Text = values.attack.Target; foreach (string item in HitDiceType.Items) { if (item.Split('d')[1].Contains(values.attack.HitDiceSize.ToString())) { HitDiceType.SelectedItem = item; } } HitNumberOfDice.Value = values.attack.HitDiceNumber; HitDiceBonusDamage.Value = values.attack.HitDamageBonus; foreach (string item in HitDamageType.Items) { if (item.Contains(values.attack.HitDamageType)) { HitDamageType.SelectedItem = item; } } HitDamageEffect.Text = values.attack.HitText; NewAttack = values; NewAttack.isDamage = true; NewAttack.isSpell = false; }
private void button1_Click(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { this.NewAttack = new Attack( comboBox1.Text, numericUpDown1.Value.ToString(), comboBox2.Text, (int)numericUpDown2.Value, textBox3.Text, textBox1.Text); NewAttack.Title = textBox2.Text; NewAttack.isDamage = true; } else if (tabControl1.SelectedIndex == 1) { this.NewAbility = new Ability(); NewAbility.Title = textBox4.Text; NewAbility.Description = richTextBox1.Text; NewAbility.isDamage = false; } this.Close(); }
private void FillActionOnTabChange(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 1) { try { Ability Attack = new Ability(); Attack.attack = new Attack( AttackTypeDropdown.Text, AttackBonusUpDown.Value.ToString(), (int)ReachUpDown.Value, (int)RangeUpDownClose.Value, (int)RangeUpDownFar.Value, AttackTargetField.Text, AverageDamage((int)HitNumberOfDice.Value, HitDiceType.Text, (int)HitDiceBonusDamage.Value), (int)HitNumberOfDice.Value, diceSize(HitDiceType.Text), (int)HitDiceBonusDamage.Value, HitDamageType.Text, HitDamageEffect.Text); Attack.Title = AttackNameField.Text; Attack.isDamage = true; Attack.isSpell = false; AttackAbilityDescriptionField.Text = Attack.attack.TextDescribe().Replace("*", ""); AttackAbilityNameField.Text = Attack.attack._Attack; } catch { } } if (tabControl1.SelectedIndex == 2) { int numberOfAttacks = 0; foreach (Ability attack in Monster._Actions) { if (attack.isDamage) { numberOfAttacks++; } } multiAttackDescription.Text = "The " + Monster.CreatureName + " makes " + numberOfAttacks + " attacks."; } }
private void button1_Click(object sender, EventArgs e) { ability = null; action = null; legendary = null; reaction = null; OGLCreatureAdd = comboBox5.Text; this.Close(); }
public void LoadAbility(Ability values) { AbilityNameTextBox.Text = values.Title; DescriptionTextBox.Text = values.Description; }
public void LoadAbility(Ability values) { textBox1.Text = values.Title; richTextBox1.Text = values.Description; }
// This saves the ability based on which tab is currently selected. private void Save(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { this.NewAbility = new Ability(); NewAbility.Title = AbilityNameTextBox.Text; NewAbility.Description = DescriptionTextBox.Text; NewAbility.isDamage = false; NewAbility.isSpell = false; } else { this.NewAbility = new Ability(); string spellText = ""; if (InnateCheckbox.Checked) { spellText = ToDescription_Innate(); } else { spellText = ToDescription_NotInnate(); } NewAbility.Title = SpellClass.Text + " Spellcasting"; NewAbility.Description = spellText; NewAbility.isSpell = true; NewAbility.isDamage = false; } this.Close(); }
// Loads reactions public void LoadReaction(Ability values) { NewReaction = values; ReactionName.Text = values.Title; ReactionDescription.Text = values.Description; NewReaction.isDamage = false; NewReaction.isSpell = false; tabControl1.SelectedIndex = 2; }
private void FillActionOnTabChange(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 1) { try { Ability Attack = new Ability(); Attack.attack = new Attack( AttackTypeDropdown.Text, AttackBonusUpDown.Value.ToString(), (int)ReachUpDown.Value, (int)RangeUpDownClose.Value, (int)RangeUpDownFar.Value, AttackTargetField.Text, AverageDamage((int)HitNumberOfDice.Value, HitDiceType.Text, (int)HitDiceBonusDamage.Value), (int)HitNumberOfDice.Value, diceSize(HitDiceType.Text), (int)HitDiceBonusDamage.Value, HitDamageType.Text, HitDamageEffect.Text); Attack.Title = AttackNameField.Text; Attack.isDamage = true; Attack.isSpell = false; AttackAbilityDescriptionField.Text = Attack.attack.TextDescribe().Replace("*", ""); AttackAbilityNameField.Text = Attack.attack._Attack; } catch { } } }
// Saves the ability or attack based on the selected tab. private void Save(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) { this.NewAttack = new Ability(); this.NewAttack.attack = new Attack( AttackTypeDropdown.Text, AttackBonusUpDown.Value.ToString(), (int)ReachUpDown.Value, (int)RangeUpDownClose.Value, (int)RangeUpDownFar.Value, AttackTargetField.Text, AverageDamage((int)HitNumberOfDice.Value, HitDiceType.Text, (int)HitDiceBonusDamage.Value), (int)HitNumberOfDice.Value, diceSize(HitDiceType.Text), (int)HitDiceBonusDamage.Value, HitDamageType.Text, HitDamageEffect.Text); NewAttack.Title = AttackNameField.Text; NewAttack.isDamage = true; NewAttack.isSpell = false; } else if (tabControl1.SelectedIndex == 1) { this.NewAbility = new Ability(); NewAbility.Title = AttackAbilityNameField.Text; NewAbility.Description = AttackAbilityDescriptionField.Text; NewAbility.isDamage = false; NewAbility.isSpell = false; } else if (tabControl1.SelectedIndex == 2) { this.NewAbility = new Ability(); NewAbility.Title = "Multiattack"; NewAbility.Description = multiAttackDescription.Text; NewAbility.isDamage = false; NewAbility.isSpell = false; } else if (tabControl1.SelectedIndex == 3) { this.NewReaction = new Ability(); NewReaction.Title = ReactionName.Text; NewReaction.Description = ReactionDescription.Text; NewReaction.isDamage = false; NewReaction.isSpell = false; } this.Close(); }
public static void AddReaction(Ability target) { _Reactions.Add(target); }
public static void AddAction(Ability target) { _Actions.Add(target); }
public static void AddAbility(Ability target) { _Abilities.Add(target); }