public static IElementalResistance Create(ElementalType elementalType, float amount) { ElementalResistance newElementalResistance = new ElementalResistance(elementalType, amount) { ResistanceInfo = { type = elementalType, value = amount } }; return(newElementalResistance); }
public void GrantsResistanceBasedOnEnergyType() { var sorcerer = CharacterTestTemplates.Sorcerer(); var elementalType = new ElementalType(); elementalType.EnergyType = "cold"; sorcerer.Add(elementalType); var resist = new ElementalResistance(); sorcerer.Add(resist); AssertCharacter.HasDamageResistance(sorcerer, "cold", 10); sorcerer.SetLevel(9); resist.LeveledUp(sorcerer.Components); AssertCharacter.HasDamageResistance(sorcerer, "cold", 20); }