public static long ElementalResistance(long resistance, long damage) { if (resistance > 0) { double rawReduction = Exponential.Armor(resistance) / 100; int dmgReduction = Convert.ToInt32(damage * rawReduction); damage -= dmgReduction; return(damage); } else { double rawReduction = Exponential.Armor(-resistance) / 100; int dmgReduction = Convert.ToInt32(damage * rawReduction); damage += dmgReduction; return(damage); } }
public async Task CalcArmor(int armor) { await DUtils.Replydb(Context, Exponential.Armor(armor).ToString() + "% Damage resistance"); }