protected UsableAbility(Ability ability, AbilityType type, AbilityCastTarget target) { Sleeper = new Sleeper(); Type = type; if (ability == null) { //Gold spender return; } Ability = ability; CastPoint = (float)ability.FindCastPoint(); Name = ability.Name; Handle = ability.Handle; IsItem = ability is Item; ClassID = ability.ClassID; IgnoresLinkensSphere = ability.IsAbilityBehavior(AbilityBehavior.NoTarget) || ability.IsAbilityBehavior(AbilityBehavior.AreaOfEffect); PiercesMagicImmunity = ability.PiercesMagicImmunity(); CanBeUsedOnEnemy = target.HasFlag(AbilityCastTarget.Enemy) || type == AbilityType.Disable; CanBeUsedOnAlly = target.HasFlag(AbilityCastTarget.Ally); Debugger.WriteLine("///////// UsableAbility // " + Name); Debugger.WriteLine("// Type: " + Type); Debugger.WriteLine("// Cast point: " + CastPoint); Debugger.WriteLine("// Cast range: " + Ability.GetRealCastRange()); Debugger.WriteLine("// Ignores linkens sphere: " + IgnoresLinkensSphere); Debugger.WriteLine("// Pierces magic immunity: " + PiercesMagicImmunity); Debugger.WriteLine("// Can be used on ally: " + CanBeUsedOnAlly); Debugger.WriteLine("// Can be used on enemy: " + CanBeUsedOnEnemy); }
protected EvadableAbility(Ability ability) { AbilityOwner = (Unit)ability.Owner; OwnerHandle = AbilityOwner.Handle; Handle = ability.Handle; Ability = ability; CastPoint = (float)ability.FindCastPoint(); Name = ability.Name; OwnerClassID = AbilityOwner.ClassID; IsDisable = ability.IsDisable() || ability.IsSilence(); PiercesMagicImmunity = ability.PiercesMagicImmunity(); CreateTime = Game.RawGameTime; if (IsDisable) { DisableAbilities.AddRange(DisableAbilityNames); BlinkAbilities.AddRange(BlinkAbilityNames); } Debugger.WriteLine("///////// Evadable ability // " + GetType().Name + " (" + Name + ")"); Debugger.WriteLine("// Cast point: " + CastPoint); Debugger.WriteLine("// Owner: " + AbilityOwner.GetName()); Debugger.WriteLine("// Is disable: " + IsDisable); Debugger.WriteLine("// Pierces Magic Immunity: " + PiercesMagicImmunity); }