public void FillTalents() { TalentData data = new TalentData { Name = "Bash", TalentPrerequisites = new string[0], LevelRequirement = 1, TalentType = TalentType.Activated, ActivationCost = 5, AllowedClasses = new string[] { "Fighter" }, AttributeRequirements = new Dictionary <string, int>() { { "Strength", 10 } } }; DamageEffect effect = DamageEffect.FromDamageEffectData(new DamageEffectData { TargetType = SpellClasses.TargetType.Enemy, AttackType = AttackType.Health, DamageType = DamageType.Crushing, DieType = DieType.D8, Modifier = 2, Name = "Bash", NumberOfDice = 2 }); data.Effects.Add(effect); talentData.Add("Bash", data); data = new TalentData() { Name = "Below The Belt", TalentPrerequisites = new string[0], LevelRequirement = 1, TalentType = TalentType.Activated, ActivationCost = 5, AllowedClasses = new string[] { "Rogue" }, AttributeRequirements = new Dictionary <string, int>() { { "Dexterity", 10 } } }; effect = DamageEffect.FromDamageEffectData(new DamageEffectData() { TargetType = SpellClasses.TargetType.Enemy, AttackType = AttackType.Health, DamageType = DamageType.Piercing, DieType = DieType.D4, Modifier = 2, Name = "Below The Belt", NumberOfDice = 3 }); data.Effects.Add(effect); talentData.Add("Below The Belt", data); }
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 } } }; BaseEffect effect = DamageEffect.FromDamageEffectData(new DamageEffectData { Name = "Spark Jolt", TargetType = TargetType.Enemy, AttackType = AttackType.Health, DamageType = DamageType.Air, DieType = DieType.D6, NumberOfDice = 3, Modifier = 2 }); data.Effects.Add(effect); 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 } } }; BaseEffect healEffect = HealEffect.FromHealEffectData(new HealEffectData { Name = "Mend", TargetType = TargetType.Self, HealType = HealType.Health, DieType = DieType.D8, NumberOfDice = 2, Modifier = 2 }); data.Effects.Add(healEffect); spellData.Add("Mend", data); }
public static Spell FromSpellData(SpellData data) { Spell spell = new Spell { name = data.Name, levelRequirement = data.LevelRequirement, spellType = data.SpellType, activationCost = data.ActivationCost, coolDown = data.CoolDown, Range = data.Range, AreaOfEffect = data.AreaOfEffect, AngleOfEffect = data.AngleOfEffect, CastTime = data.CastTime }; foreach (string s in data.AllowedClasses) { spell.allowedClasses.Add(s.ToLower()); } foreach (string s in data.AttributeRequirements.Keys) { spell.attributeRequirements.Add( s.ToLower(), data.AttributeRequirements[s]); } foreach (string s in data.SpellPrerequisites) { spell.SpellPrerequisites.Add(s); } foreach (BaseEffectData s in data.Effects) { if (s is DamageEffectData damage) { spell.Effects.Add(DamageEffect.FromDamageEffectData(damage)); } if (s is HealEffectData heal) { spell.Effects.Add(HealEffect.FromHealEffectData(heal)); } } return(spell); }
public static Talent FromTalentData(TalentData data) { Talent talent = new Talent { name = data.Name, levelRequirement = data.LevelRequirement, talentType = data.TalentType, activationCost = data.ActivationCost, coolDown = data.CoolDown, Range = data.Range, AreaOfEffect = data.AreaOfEffect, AngleOfEffect = data.AngleOfEffect, CastTime = data.CastTime }; foreach (string s in data.AllowedClasses) { talent.allowedClasses.Add(s.ToLower()); } foreach (string s in data.AttributeRequirements.Keys) { talent.attributeRequirements.Add( s.ToLower(), data.AttributeRequirements[s]); } foreach (string s in data.TalentPrerequisites) { talent.talentPrerequisites.Add(s); } foreach (BaseEffectData s in data.Effects) { if (s is DamageEffectData damage) { talent.Effects.Add(DamageEffect.FromDamageEffectData(damage)); } if (s is HealEffectData heal) { talent.Effects.Add(HealEffect.FromHealEffectData(heal)); } } return(talent); }