Ejemplo n.º 1
0
        private bool IsAffected(AttackableUnit unit)
        {
            var flags = Flags; // SpellRecord.Flags?

            if (flags.HasFlag(SpellFlags.NotAffectSelf) && unit == Owner)
            {
                return(false);
            }
            if (!flags.HasFlag(SpellFlags.AffectAllSides))
            {
                if (!unit.IsFriendly(Owner) && !flags.HasFlag(SpellFlags.AffectEnemies))
                {
                    return(false);
                }
                if (unit.IsFriendly(Owner) && !flags.HasFlag(SpellFlags.AffectFriends))
                {
                    return(false);
                }
                if (unit.Team.Id == TeamId.NEUTRAL && flags.HasFlag(SpellFlags.AffectNeutral))
                {
                    return(true);
                }
            }
            if (flags.HasFlag(SpellFlags.AffectAllUnitTypes))
            {
                return(true);
            }
            if (unit is AITurret)
            {
                return(flags.HasFlag(SpellFlags.AffectTurrets));
            }
            if (unit is AIMinion)
            {
                return(flags.HasFlag(SpellFlags.AffectMinions));
            }
            if (unit is AIHero)
            {
                return(flags.HasFlag(SpellFlags.AffectHeroes));
            }
            return(false);
        }
Ejemplo n.º 2
0
 public override void ApplyEffects(AttackableUnit target, IMissile projectile)
 {
     if (target.IsFriendly(Owner))
     {
         // add as buff
     }
     else
     {
         var ap     = OwnerAPTotal * 1.25f;
         var damage = 25 + (Spell.Level * 45) + ap;
         target.InflictDamages(new Damages(Owner, target, damage, false, DamageType.DAMAGE_TYPE_MAGICAL, false));
     }
 }