Example #1
0
 public override void OnTurnOff()
 {
     if (this.m_AppliedId != null)
     {
         UnitPartSpellResistance unitPartSpellResistance = base.Owner.Get <UnitPartSpellResistance>();
         if (unitPartSpellResistance != null)
         {
             unitPartSpellResistance.Remove(this.m_AppliedId.Value);
         }
         this.m_AppliedId = null;
     }
     base.OnTurnOff();
 }
Example #2
0
        public override void OnRecalculate()
        {
            base.OnRecalculate();
            if (this.m_AppliedId != null)
            {
                UnitPartSpellResistance unitPartSpellResistance = base.Owner.Get <UnitPartSpellResistance>();
                if (unitPartSpellResistance != null)
                {
                    unitPartSpellResistance.Remove(this.m_AppliedId.Value);
                }
                this.m_AppliedId = null;
            }
            int SR = this.Calc() + (unit.HasFact(SpellResistance.exploitHigher) ? 11 : 6);

            m_AppliedId = new int?(unit.Ensure <UnitPartSpellResistance>().AddResistance(SR, null, null));
        }