public void FillSpellData() { SpellData data = new SpellData() { Name = "Spark Jolt", SpellPrerequisites = new string[0], SpellType = SpellType.Activated, LevelRequirement = 1, ActivationCost = 8, AllowedClasses = new string[] { "Wizard" }, AttributeRequirements = new Dictionary <string, int>() { { "Magic", 10 } } }; DamageEffectData effect = new DamageEffectData { Name = "Spark Jolt", AttackType = AttackType.Health, DamageType = DamageType.Air, DieType = DieType.D6, NumberOfDice = 3, Modifier = 2 }; data.Effects = new string[] { effect.ToString() }; spellData.Add("Spark Jolt", data); data = new SpellData() { Name = "Mend", SpellPrerequisites = new string[0], SpellType = SpellType.Activated, LevelRequirement = 1, ActivationCost = 6, AllowedClasses = new string[] { "Priest" }, AttributeRequirements = new Dictionary <string, int>() { { "Magic", 10 } } }; HealEffectData healEffect = new HealEffectData() { Name = "Mend", HealType = HealType.Health, DieType = DieType.D8, NumberOfDice = 2, Modifier = 2 }; data.Effects = new string[] { healEffect.ToString() }; spellData.Add("Mend", data); }
private void BtnOK_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbName.Text)) { MessageBox.Show("You must enter the name for the effect."); return; } if (rbDamage.Checked) { DamageEffectData data = new DamageEffectData(); data.Name = tbName.Text; data.TargetType = (TargetType)Enum.Parse(typeof(TargetType), cboTarget.SelectedItem.ToString()); data.DamageType = (DamageType)Enum.Parse(typeof(DamageType), cboDamage.SelectedItem.ToString()); data.DieType = (DieType)Enum.Parse(typeof(DieType), cboDieType.SelectedIndex.ToString()); data.NumberOfDice = (int)sbNumOfDice.Value; data.Modifier = (int)sbModifier.Value; BaseEffectData = data; } else { HealEffectData data = new HealEffectData(); data.Name = tbName.Text; data.TargetType = (TargetType)Enum.Parse(typeof(TargetType), cboTarget.SelectedItem.ToString()); data.DieType = (DieType)Enum.Parse(typeof(DieType), cboDieType.SelectedIndex.ToString()); data.NumberOfDice = (int)sbNumOfDice.Value; data.Modifier = (int)sbModifier.Value; BaseEffectData = data; } Close(); }
public HealEffect(HealEffectData data, List <Validator> validators) : base(data, validators) { this.data = data; }