Ejemplo n.º 1
0
        public int Absorb(int absorbAmount, DamageSchoolMask schools)
        {
            if (absorbAmount <= 0 || this.SpellEffect != null &&
                this.Spell.AttributesExD.HasFlag((Enum)SpellAttributesExD.CannotBeAbsorbed))
            {
                return(0);
            }
            if (schools.HasAnyFlag(this.UsedSchool))
            {
                int num = Math.Min(this.Damage, absorbAmount);
                absorbAmount  -= num;
                this.Absorbed += num;
            }

            return(absorbAmount);
        }
Ejemplo n.º 2
0
        public int Absorb(int absorbAmount, DamageSchoolMask schools)
        {
            if (absorbAmount <= 0)
            {
                return(0);
            }

            if (SpellEffect != null && Spell.AttributesExD.HasFlag(SpellAttributesExD.CannotBeAbsorbed))
            {
                return(0);
            }

            if (schools.HasAnyFlag(UsedSchool))
            {
                var value = Math.Min(Damage, absorbAmount);
                absorbAmount -= value;
                Absorbed     += value;
            }
            return(absorbAmount);
        }
Ejemplo n.º 3
0
		public int Absorb(int absorbAmount, DamageSchoolMask schools)
		{
			if (absorbAmount <= 0)
			{
				return 0;
			}

			if (SpellEffect != null && Spell.AttributesExD.HasFlag(SpellAttributesExD.CannotBeAbsorbed))
			{
				return 0;
			}

			if (schools.HasAnyFlag(UsedSchool))
			{
				var value = Math.Min(Damage, absorbAmount);
				absorbAmount -= value;
				Absorbed += value;
			}
			return absorbAmount;
		}