Exemple #1
0
        public int ResistedDamage(int damage, Enums.Elements element = Enums.Elements.None)
        {
            if (element == Enums.Elements.None)
            {
                return(damage);
            }

            var resistance = _resistances[element];

            if (resistance == 0)
            {
                return(damage);
            }

            if (resistance == 100)
            {
                return(0);
            }

            var resistedDamage = (int)Math.Floor((decimal)(damage * (resistance / 100)));

            if (resistance < 100)
            {
                return((int)Math.Floor((decimal)(damage - resistedDamage)));
            }

            return(-resistedDamage);
        }
Exemple #2
0
        public void ModifyResistance(Enums.Elements element, int change)
        {
            if (element == Enums.Elements.None)
            {
                return;
            }

            _resistances[element] += change;
        }
Exemple #3
0
        protected TalentBase(string name, string description, Enums.Elements element = Enums.Elements.None)
        {
            Requierments = new List <TalentBase>();
            IdName       = GetType().Name;
            Name         = name;
            Description  = description;
            IsActive     = false;
            TalentTree.Talents.Add(IdName, this);

            TalentManager.Talents[element].Add(IdName);
        }
 protected ElementalTalentBase(string name, string description, Enums.Elements element) : base(name, description, element)
 {
     Element = element;
 }
Exemple #5
0
 protected ElementalEmpowerTalent(string name, string descrpition, Enums.Elements element, int empowerPoints) : base(name, descrpition, element)
 {
     EmpowerPoints = empowerPoints;
 }
Exemple #6
0
 protected ElementalResistanceTalent(string name, string descrpition, Enums.Elements element, int resistance) : base(name, descrpition, element)
 {
     Resistance = resistance;
 }