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); }
public void ModifyResistance(Enums.Elements element, int change) { if (element == Enums.Elements.None) { return; } _resistances[element] += change; }
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; }
protected ElementalEmpowerTalent(string name, string descrpition, Enums.Elements element, int empowerPoints) : base(name, descrpition, element) { EmpowerPoints = empowerPoints; }
protected ElementalResistanceTalent(string name, string descrpition, Enums.Elements element, int resistance) : base(name, descrpition, element) { Resistance = resistance; }