예제 #1
0
        public static IElementalResistance Create(ElementalType elementalType, float amount)
        {
            ElementalResistance newElementalResistance = new ElementalResistance(elementalType, amount)
            {
                ResistanceInfo = { type = elementalType, value = amount }
            };

            return(newElementalResistance);
        }
예제 #2
0
        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);
        }