Example #1
0
        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);
        }
Example #2
0
        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
            };

            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 (string s in data.Effects)
            {
                talent.Effects.Add(s);
            }
            return(talent);
        }
Example #3
0
        public static Talent FromTalentData(TalentData data)
        {
            Talent talent = new Talent();

            talent.name = data.Name;

            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);

            talent.levelRequirement = data.LevelRequirement;
            talent.talentType = data.TalentType;
            talent.activationCost = data.ActivationCost;

            foreach (string s in data.Effects)
                talent.Effects.Add(s);

            return talent;
        }
Example #4
0
        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);
        }