Example #1
0
 public void OnEventAboutToTrigger(RuleSpellResistanceCheck evt)
 {
     foreach (UnitEntityData unitEntityData in GameHelper.GetTargetsAround(this.Owner.Unit.Position, (float)this.Radius, true, false))
     {
         if ((unitEntityData.Descriptor.HasFact(this.AlliedSpellcasterFact) || (bool)this.Owner.State.Features.SoloTactics) && unitEntityData != this.Owner.Unit && !unitEntityData.IsEnemy(this.Owner.Unit) &&
             hasSpell(unitEntityData.Descriptor, evt.Ability))
         {
             evt.AdditionalSpellPenetration += 2;
             break;
         }
     }
 }
Example #2
0
        public void OnEventAboutToTrigger(RuleSpellResistanceCheck evt)
        {
            var spell = Param.GetValueOrDefault().Blueprint;

            if (evt.Ability != spell && evt.Ability?.Parent != spell)
            {
                return;
            }

            // Double spell penetration bonus.
            foreach (var fact in Owner.Progression.Features.Enumerable)
            {
                var blueprint = fact.Blueprint;
                if (blueprint == MagicFeats.spellPenetration ||
                    blueprint == MagicFeats.spellPenetrationGreater)
                {
                    foreach (var c in fact.SelectComponents <SpellPenetrationBonus>())
                    {
                        c.OnEventAboutToTrigger(evt);
                    }
                }
            }
        }
Example #3
0
 public void OnEventDidTrigger(RuleSpellResistanceCheck evt)
 {
 }