protected override bool AbilityControl(CHero target, CAbility ability) { var concussiveShot = Abilities.ConcussiveShot; if (ability == concussiveShot && target != concussiveShot.TargetHit) { return(true); } return(false); }
public static float SpellAmplification(this CAbility ability) { var owner = ability.Owner; if (owner == null) { return(0.0f); } return(owner.GetSpellAmplification()); }
protected override float GetMagicalDamage(CAbility ability, CHero hero, float magicalDamageReduction, float magicalCurrentHealth, bool canHitActive) { var mysticFlare = (ability as MysticFlare); if (mysticFlare != null) { if (!canHitActive) { return(DamageHelpers.GetSpellDamage(mysticFlare.GetTotalDamage(hero), magicalDamageReduction - 1)); } return(0); } return(ability.GetDamage(hero, magicalDamageReduction - 1, magicalCurrentHealth)); }
// TODO REWORK protected bool CanBeCasted(CAbility ability) { if (!ability.IsReady) { return(false); } var owner = ability.Owner; var isItem = ability is CItem; if (owner.IsStunned() || isItem && owner.IsMuted() || !isItem && owner.IsSilenced()) { return(false); } return(true); }
protected override bool IsHitTime(CHero target, CAbility ability) { if (ability == Abilities.Ethereal) { return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}")); } if (ability == Abilities.ConcussiveShot) { return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}")); } if (ability == Abilities.ArcaneBolt) { return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}")); } return(false); }
public static float GetDamageReduction(this CAbility ability, Unit target, DamageType damageType) { // TODO: modifiers if ((damageType & DamageType.HealthRemoval) == DamageType.HealthRemoval) { return(0.0f); } var reduction = 0.0f; switch (damageType) { case DamageType.Magical: reduction = target.MagicDamageResist; break; case DamageType.Physical: reduction = target.DamageResist; break; } return(reduction); }
protected virtual float GetMagicalDamage(CAbility ability, Hero hero, float magicalDamageReduction, float magicalCurrentHealth, bool canHitActive) { return(ability.GetDamage(hero, magicalDamageReduction - 1, magicalCurrentHealth)); }
protected virtual float PureDamageHealth(CAbility ability, Hero hero, float pureDamageReduction, float health, float pureDamage) { return(0); }
protected virtual bool IsHitTime(Hero hero, CAbility ability) { return(false); }
protected virtual bool AbilityControl(Hero hero, CAbility ability) { return(false); }
public static float GetDamageReduction(this CAbility ability, Unit target) { return(GetDamageReduction(ability, target, ability.DamageType)); }