當前位置: 首頁>>代碼示例>>C#>>正文


C# Ability.GetHitDelay方法代碼示例

本文整理匯總了C#中Ability.GetHitDelay方法的典型用法代碼示例。如果您正苦於以下問題:C# Ability.GetHitDelay方法的具體用法?C# Ability.GetHitDelay怎麽用?C# Ability.GetHitDelay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ability的用法示例。


在下文中一共展示了Ability.GetHitDelay方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Cast

        public static bool Cast(Ability ability, Unit target, string name)
        {
            if (name == "pudge_rot" && Utils.SleepCheck("rotToggle"))
            {
                if (!ability.IsToggled)
                {
                    ability.ToggleAbility();
                    Utils.Sleep(500, "rotToggle");
                    return true;
                }

                return false;
            }

            if (name == "templar_assassin_psionic_trap")
            {
                var modifier = target.FindModifier("modifier_templar_assassin_trap_slow");
                if (modifier != null && modifier.RemainingTime > ability.GetHitDelay(target, name))
                {
                    return false;
                }

                if (TemplarAssasinUseTrap(target))
                {
                    return false;
                }

                var casted = ability.CastSkillShot(target, MyHeroInfo.Position, name);
                if (casted)
                {
                    DelayAction.Add(
                        new DelayActionItem(
                            (int)ability.GetHitDelay(target, name) * 1000 + 700, 
                            delegate { TemplarAssasinUseTrap(target); }, 
                            CancellationToken.None));
                }

                return casted;
            }

            return ability.CastStun(
                target, 
                1, 
                abilityName: name, 
                soulRing: SoulRing.Check(ability) ? MyAbilities.SoulRing : null);
        }
開發者ID:Ray0fHope,項目名稱:EnsageSharp,代碼行數:46,代碼來源:Slow.cs

示例2: Killsteal

 public static bool Killsteal(Ability ability, Hero target, string name)
 {
     return AbilityDamage.CalculateDamage(ability, AbilityMain.Me, target) >= target.Health
            && target.CanDie(name)
            && (!target.IsInvul() || Utils.ChainStun(target, ability.GetHitDelay(target), null, true, name));
 }
開發者ID:Ray0fHope,項目名稱:EnsageSharp,代碼行數:6,代碼來源:CastingChecks.cs

示例3: ChainStun

 public static bool ChainStun(Ability ability, Hero target, string name)
 {
     return Utils.ChainStun(target, ability.GetHitDelay(target), null, true, name);
 }
開發者ID:Ray0fHope,項目名稱:EnsageSharp,代碼行數:4,代碼來源:CastingChecks.cs

示例4: Cast

 public static bool Cast(Hero target, Ability ability)
 {
     return
         target.Spellbook.Spells.Any(x => x.IsInAbilityPhase && x.FindCastPoint() > ability.GetHitDelay(target))
         || (target.IsChanneling() && !target.GetChanneledAbility().Name.Contains("item"));
 }
開發者ID:Ray0fHope,項目名稱:EnsageSharp,代碼行數:6,代碼來源:CastingChecks.cs


注:本文中的Ability.GetHitDelay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。