예제 #1
0
        public AbilityController(InputModel inputModel, IActiveAbility activeAbility)
        {
            _inputModel = inputModel;
            _inputModel.Ability().OnKeyPressed += ActivateAbility;

            _activeAbility = activeAbility;
        }
예제 #2
0
        public TrackSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.OnSight = menu.GetOrAdd(new MenuSwitcher("Use on sight", false));
            this.OnSight.SetTooltip("Use ability when target is visible");
            this.OnSight.AddTranslation(Lang.Ru, "Использовать сразу");
            this.OnSight.AddTooltipTranslation(Lang.Ru, "Использовать способность сразу, когда враг появляется в зоне видимости");
            this.OnSight.AddTranslation(Lang.Cn, "立即使用");
            this.OnSight.AddTooltipTranslation(Lang.Cn, "当目标出现在视线中时,立即使用该能力");

            this.OnAttack = menu.GetOrAdd(new MenuSwitcher("Use on attack"));
            this.OnAttack.SetTooltip("Use ability when hero is attacking");
            this.OnAttack.AddTranslation(Lang.Ru, "Использовать при атаке");
            this.OnAttack.AddTooltipTranslation(Lang.Ru, "Использовать способность, когда герой атакует");
            this.OnAttack.AddTranslation(Lang.Cn, "在攻击时使用");
            this.OnAttack.AddTooltipTranslation(Lang.Cn, "当英雄攻击时使用能力");

            this.HpThreshold = menu.GetOrAdd(new MenuSlider("HP% threshold (target)", 40, 1, 100));
            this.HpThreshold.SetTooltip("Use when target hp% is lower");
            this.HpThreshold.AddTranslation(Lang.Ru, "Порог ХП%");
            this.HpThreshold.AddTooltipTranslation(Lang.Ru, "Использовать способность, когда у врага меньше здоровья%");
            this.HpThreshold.AddTranslation(Lang.Cn, "生命值%(目标)");
            this.HpThreshold.AddTooltipTranslation(Lang.Cn, "当目标健康状况较差 % 时,使用能力");

            this.ForceInvisibility = menu.GetOrAdd(new MenuSwitcher("Force use (invisibility)"));
            this.ForceInvisibility.SetTooltip("Always use ability when enemy can become invisible");
            this.ForceInvisibility.AddTranslation(Lang.Ru, "Невидимость");
            this.ForceInvisibility.AddTooltipTranslation(Lang.Ru, "Использовать способность всегда, когда враг может стать невидимым");
            this.ForceInvisibility.AddTranslation(Lang.Cn, "隐身");
            this.ForceInvisibility.AddTooltipTranslation(Lang.Cn, "当敌人变得不可见时,总是使用能力");
        }
예제 #3
0
        private bool ShouldUseBreaker(IActiveAbility ability, Unit9 owner, Unit9 target)
        {
            if (!ability.UnitTargetCast || this.linkensSleeper.IsSleeping(target.Handle))
            {
                return(false);
            }

            if (target.IsUntargetable || !target.IsVisible || target.IsInvulnerable)
            {
                return(false);
            }

            if (owner.Abilities.OfType <IDisable>().Any(x => x.NoTargetCast && x.CanBeCasted() && x.CanHit(target)))
            {
                return(false);
            }

            if ((target.IsLinkensProtected && target.IsLotusProtected) || target.IsSpellShieldProtected)
            {
                return(this.shieldBreakerMenu.IsSpellShieldBreakerEnabled(ability.Name));
            }

            if (target.IsLinkensProtected && this.shieldBreakerMenu.IsLinkensBreakerEnabled(ability.Name))
            {
                return(true);
            }

            return(false);
        }
        // Token: 0x06000719 RID: 1817 RVA: 0x000218D8 File Offset: 0x0001FAD8
        protected virtual bool Attack(Unit9 target, [CanBeNull] ComboModeMenu comboMenu)
        {
            if (this.Owner.Name == "npc_dota_hero_rubick")
            {
                IActiveAbility activeAbility = (IActiveAbility)this.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.rubick_telekinesis);
                if (activeAbility != null && activeAbility.CanBeCasted(true) && comboMenu != null && comboMenu.IsAbilityEnabled(activeAbility))
                {
                    return(false);
                }
            }
            if (!this.UseOrbAbility(target, comboMenu) && !this.Owner.BaseUnit.Attack(target.BaseUnit))
            {
                return(false);
            }
            float num      = Game.Ping / 2000f + 0.06f;
            float turnTime = this.Owner.GetTurnTime(target.Position);
            float num2     = Math.Max(this.Owner.Distance(target) - this.Owner.GetAttackRange(target, 0f), 0f) / (float)this.Owner.BaseUnit.MovementSpeed;
            float num3     = turnTime + num2 + num;
            float num4     = this.Owner.GetAttackPoint(target);

            if (this.Owner.Abilities.Any((Ability9 x) => x.Id == AbilityId.item_echo_sabre && x.CanBeCasted(true)))
            {
                num4 *= 2.5f;
            }
            this.AttackSleeper.Sleep(this.Owner.GetAttackPoint(target) + this.Owner.GetAttackBackswing(target) + num3 - 0.1f);
            this.MoveSleeper.Sleep(num4 + num3 + 0.25f + this.Menu.AdditionalDelay / 1000f);
            return(true);
        }
        public CooldownAbility(IActiveAbility innerAbility, TimeSpan cooldown)
        {
            InnerAbility = innerAbility;
            _cooldown    = cooldown;

            TimeLeft = TimeSpan.Zero;
        }
예제 #6
0
        public IronTalonSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.Damage = menu.GetOrAdd(new MenuSlider("Minimal damage", 300, 100, 1000));
            this.Damage.AddTranslation(Lang.Ru, "Минимальный урон");
            this.Damage.AddTranslation(Lang.Cn, "最小伤害");
        }
 // Token: 0x060000BF RID: 191 RVA: 0x000028D3 File Offset: 0x00000AD3
 public bool IsAbilityEnabled(IActiveAbility ability)
 {
     if (ability.IsItem)
     {
         return(this.comboItemsToggler.IsEnabled(ability.Name));
     }
     return(this.comboAbilityToggler.IsEnabled(ability.Name));
 }
예제 #8
0
 public SpellStealAbility(IActiveAbility ability, GroupSettings settings)
     : base(ability)
 {
     this.settings = new SpellStealSettings(settings.Menu, ability);
     this.handler  = UpdateManager.CreateIngameUpdate(500, false, this.OnUpdate);
     EntityManager9.AbilityAdded += this.OnAbilityAdded;
     this.useInvisible            = settings.UseWhenInvisible;
 }
예제 #9
0
        public MidasSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.Experience = menu.GetOrAdd(new MenuSlider("Experience gain", 80, 0, 150));
            this.Experience.AddTranslation(Lang.Ru, "Получение опыта");
            this.Experience.AddTranslation(Lang.Cn, "获得经验");
        }
예제 #10
0
 public void DisableSelf()
 {
     activatable       = false;
     active            = false;
     associatedAbility = null;
     associatedIcon    = null;
     gameObject.SetActive(false);
 }
예제 #11
0
        public PhaseBootsSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.Distance = menu.GetOrAdd(new MenuSlider("Distance", 600, 100, 2000));
            this.Distance.SetTooltip("Use phase boots only when move distance is bigger");
            this.Distance.AddTranslation(Lang.Ru, "Дистанция");
            this.Distance.AddTooltipTranslation(Lang.Ru, "Использовать способность, если дистанция передвижения больше");
            this.Distance.AddTranslation(Lang.Cn, "距离");
            this.Distance.AddTooltipTranslation(Lang.Cn, "如果移动距离较长,则使用该能力");
        }
예제 #12
0
        public AttributeShiftStrengthGainSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.AutoBalance = menu.GetOrAdd(new MenuSwitcher("Auto balance"));
            this.AutoBalance.SetTooltip("Auto balance to maintain manually set hp amount");
            this.AutoBalance.AddTranslation(Lang.Ru, "Авто баланс");
            this.AutoBalance.AddTooltipTranslation(Lang.Ru, "Автоматически балансировать здоровье");
            this.AutoBalance.AddTranslation(Lang.Cn, "自动平衡");
            this.AutoBalance.AddTooltipTranslation(Lang.Cn, "自动平衡运行状况");
        }
예제 #13
0
 public void SetActiveAbility(IActiveAbility abilityObject)
 {
     associatedAbility = abilityObject;
     if (associatedAbility.CanBeUsed())
     {
         image.material = null;
         activatable    = true;
     }
     else
     {
         image.material = grayscaleMaterial;
     }
 }
예제 #14
0
        public DebuffSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.OnSight = menu.GetOrAdd(new MenuSwitcher("Use on sight", false));
            this.OnSight.SetTooltip("Use ability when target is visible");
            this.OnSight.AddTranslation(Lang.Ru, "Использовать сразу");
            this.OnSight.AddTooltipTranslation(Lang.Ru, "Использовать способность сразу, когда враг появляется в зоне видимости");
            this.OnSight.AddTranslation(Lang.Cn, "立即使用");
            this.OnSight.AddTooltipTranslation(Lang.Cn, "当目标出现在视线中时,立即使用该能力");

            this.OnAttack = menu.GetOrAdd(new MenuSwitcher("Use on attack"));
            this.OnAttack.SetTooltip("Use ability when hero is attacking");
            this.OnAttack.AddTranslation(Lang.Ru, "Использовать при атаке");
            this.OnAttack.AddTooltipTranslation(Lang.Ru, "Использовать способность, когда герой атакует");
            this.OnAttack.AddTranslation(Lang.Cn, "在攻击时使用");
            this.OnAttack.AddTooltipTranslation(Lang.Cn, "当英雄攻击时使用能力");

            this.SelfOnly = menu.GetOrAdd(new MenuSwitcher("Self only"));
            this.SelfOnly.SetTooltip("Use only when target is near your hero");
            this.SelfOnly.AddTranslation(Lang.Ru, "Только возле себя");
            this.SelfOnly.AddTooltipTranslation(Lang.Ru, "Использовать способность, только если враг возле вашего героя");
            this.SelfOnly.AddTranslation(Lang.Cn, "仅自己");
            this.SelfOnly.AddTooltipTranslation(Lang.Cn, "仅当目标靠近您的英雄时才使用");

            this.MaxCastRange = menu.GetOrAdd(new MenuSlider("Max cast range", 0, 0, 3000));
            this.MaxCastRange.SetTooltip("Use only when enemy is in range");
            this.MaxCastRange.AddTranslation(Lang.Ru, "Максимальная дистанция");
            this.MaxCastRange.AddTooltipTranslation(Lang.Ru, "Максимальная дистанция использования способности");
            this.MaxCastRange.AddTranslation(Lang.Cn, "最大距离");
            this.MaxCastRange.AddTooltipTranslation(Lang.Cn, "使用能力的最大距离");

            if (ability is IHasRadius && ability.CollisionTypes == CollisionTypes.None)
            {
                this.EnemiesCount = menu.GetOrAdd(new MenuSlider("Number of enemies", 1, 1, 5));
                this.EnemiesCount.SetTooltip("Use only when you can debuff equals/more enemies");
                this.EnemiesCount.AddTranslation(Lang.Ru, "Число врагов");
                this.EnemiesCount.AddTooltipTranslation(Lang.Ru, "Использовать способность, если попадет по больше или равно врагов");
                this.EnemiesCount.AddTranslation(Lang.Cn, "敌人数量");
                this.EnemiesCount.AddTooltipTranslation(Lang.Cn, "仅在附近有相等/更多敌人的情况下使用");
            }
            else
            {
                this.EnemiesCount = new MenuSlider("Number of enemies", 0, 0, 0);
            }

            this.heroes = menu.GetOrAdd(new MenuHeroToggler("Use on:", false, true));
            this.heroes.AddTranslation(Lang.Ru, "Использовать на:");
            this.heroes.AddTranslation(Lang.Cn, "用于:");
        }
예제 #15
0
        public AssassinateSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.MinCastRange = menu.GetOrAdd(new MenuSlider("Min cast range", 1000, 0, 3000));
            this.MinCastRange.SetTooltip("Use ability only when enemy distance is higher");
            this.MinCastRange.AddTranslation(Lang.Ru, "Минимальная дистанция");
            this.MinCastRange.AddTooltipTranslation(Lang.Ru, "Использовать способность только если враг находится дальше");
            this.MinCastRange.AddTranslation(Lang.Cn, "最小距离");
            this.MinCastRange.AddTooltipTranslation(Lang.Cn, "仅在敌人更远时使用技能");

            this.heroes = menu.GetOrAdd(new MenuHeroToggler("Use on:", false, true));
            this.heroes.AddTranslation(Lang.Ru, "Использовать на:");
            this.heroes.AddTranslation(Lang.Cn, "用于:");
        }
예제 #16
0
        public AutocastSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.MpThreshold = menu.GetOrAdd(new MenuSlider("MP% threshold", 50, 0, 100));
            this.MpThreshold.SetTooltip("Use ability when hero has more mp%");
            this.MpThreshold.AddTranslation(Lang.Ru, "Порог МП%");
            this.MpThreshold.AddTooltipTranslation(Lang.Ru, "Использовать способность, только если у героя больше маны%");
            this.MpThreshold.AddTranslation(Lang.Cn, "魔法值%");
            this.MpThreshold.AddTooltipTranslation(Lang.Cn, "只有当英雄有更多的法力 % 时,才使用该能力");

            this.heroes = menu.GetOrAdd(new MenuHeroToggler("Use on:", false, true));
            this.heroes.AddTranslation(Lang.Ru, "Использовать на:");
            this.heroes.AddTranslation(Lang.Cn, "用于:");
        }
예제 #17
0
 private void SetActiveUnitAbility(IActiveAbility ability)
 {
     if (!activeUnitAbilitySlot1.active)
     {
         activeUnitAbilitySlot1.SetIcon(ability);
         activeUnitAbilitySlot1.SetActiveAbility(ability);
     }
     else if (!activeUnitAbilitySlot2.active)
     {
         activeUnitAbilitySlot2.SetIcon(ability);
         activeUnitAbilitySlot2.SetActiveAbility(ability);
     }
     else if (!activeUnitAbilitySlot3.active)
     {
         activeUnitAbilitySlot3.SetIcon(ability);
         activeUnitAbilitySlot3.SetActiveAbility(ability);
     }
 }
예제 #18
0
        public LinkensBreakSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            this.BreakSpellShield = new MenuSwitcher("Break spell shield", false);
            //this.BreakSpellShield = menu.GetOrAdd(new MenuSwitcher("Break spell shield", false));
            //this.BreakSpellShield.SetTooltip("Break anti mage\'s spell shield");

            this.MaxCastRange = menu.GetOrAdd(new MenuSlider("Max cast range", 0, 0, 3000));
            this.MaxCastRange.SetTooltip("Use only when enemy is in range");
            this.MaxCastRange.AddTranslation(Lang.Ru, "Максимальная дистанция");
            this.MaxCastRange.AddTooltipTranslation(Lang.Ru, "Максимальная дистанция использования способности");
            this.MaxCastRange.AddTranslation(Lang.Cn, "最大距离");
            this.MaxCastRange.AddTooltipTranslation(Lang.Cn, "使用能力的最大距离");

            this.heroes = menu.GetOrAdd(new MenuHeroToggler("Use on:", false, true));
            this.heroes.AddTranslation(Lang.Ru, "Использовать на:");
            this.heroes.AddTranslation(Lang.Cn, "用于:");
        }
예제 #19
0
        public NukeSettings(Menu settings, IActiveAbility ability)
        {
            var menu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));

            if (!ability.UnitTargetCast)
            {
                this.OnImmobileOnly = menu.GetOrAdd(new MenuSwitcher("Use on immobile only", false));
                this.OnImmobileOnly.SetTooltip("Use ability only when target is stunned/rooted");
                this.OnImmobileOnly.AddTranslation(Lang.Ru, "Только на обездвиженных");
                this.OnImmobileOnly.AddTooltipTranslation(Lang.Ru, "Использовать способность только, если враг обездвижен");
                this.OnImmobileOnly.AddTranslation(Lang.Cn, "只有在固定");
                this.OnImmobileOnly.AddTooltipTranslation(Lang.Cn, "仅在敌人无法移动时使用技能");
            }
            else
            {
                this.OnImmobileOnly = new MenuSwitcher("Use on immobile only", false);
            }

            if (ability is IHasRadius)
            {
                this.EnemiesCount = menu.GetOrAdd(new MenuSlider("Enemy count", 1, 1, 5));
                this.EnemiesCount.SetTooltip("Use ability only when you will kill equals/more enemies");
                this.EnemiesCount.AddTranslation(Lang.Ru, "Число врагов");
                this.EnemiesCount.AddTooltipTranslation(Lang.Ru, "Использовать способность, если это убьет больше или равно врагов");
                this.EnemiesCount.AddTranslation(Lang.Cn, "敌人数量");
                this.EnemiesCount.AddTooltipTranslation(Lang.Cn, "仅在杀死等同/更多敌人时使用技能");
            }
            else
            {
                this.EnemiesCount = new MenuSlider("Enemy count", 0, 0, 0);
            }

            this.heroes = menu.GetOrAdd(new MenuHeroToggler("Use on:", false, true));
            this.heroes.AddTranslation(Lang.Ru, "Использовать на:");
            this.heroes.AddTranslation(Lang.Cn, "用于:");
        }
예제 #20
0
 public LinkensBreakAbility(IActiveAbility ability, GroupSettings settings)
     : base(ability)
 {
     this.settings      = new LinkensBreakSettings(settings.Menu, ability);
     this.activeAbility = (ActiveAbility)ability;
 }
예제 #21
0
 public void Clear()
 {
     activeUnit = null;
     playerTurn = false;
     currentlySelectedAbility = null;
 }
예제 #22
0
 private void OnAbilityDeselected(AbilityDeselectedEvent customEvent)
 {
     currentlySelectedAbility = null;
 }
예제 #23
0
 public DustOfAppearanceAbility(IActiveAbility ability, GroupSettings _)
     : base(ability)
 {
 }
예제 #24
0
 public HurricanePikeSpecial(IActiveAbility ability)
     : base(ability)
 {
 }
예제 #25
0
 public SpellStealSettings(Menu settings, IActiveAbility ability)
 {
     this.abilityMenu = settings.GetOrAdd(new Menu(ability.DisplayName, ability.Name).SetTexture(ability.Name));
 }
예제 #26
0
 public IronTalonAbility(IActiveAbility ability, GroupSettings settings)
     : base(ability)
 {
     this.ironTalon = (IronTalon)ability;
     this.settings  = new IronTalonSettings(settings.Menu, ability);
 }
예제 #27
0
 protected UsableAbility(IActiveAbility ability)
 {
     this.Ability     = ability;
     this.Owner       = ability.Owner;
     this.OwnerHandle = ability.Owner.Handle;
 }
예제 #28
0
 protected OldSpecialAbility(IActiveAbility ability)
     : base(ability)
 {
 }
예제 #29
0
 private void OnAbilitySelected(AbilitySelectedEvent customEvent)
 {
     currentlySelectedAbility = customEvent.Ability;
     playerTurn = true;
 }
예제 #30
0
 public MidasAbility(IActiveAbility ability, GroupSettings settings)
     : base(ability)
 {
     this.settings = new MidasSettings(settings.Menu, ability);
 }