示例#1
0
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            var damagingChakrams = this.chakrams.Count(x => comboModeMenu.IsAbilityEnabled(x.Ability) && x.IsDamaging(targetManager));
            var returnChakram    = this.chakrams.Find(
                x => comboModeMenu.IsAbilityEnabled(x.Ability) && x.ShouldReturnChakram(targetManager, damagingChakrams));

            if (returnChakram?.Return() == true)
            {
                return(true);
            }

            var abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbility(this.whirlingDeath))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.hex))
            {
                return(true);
            }

            if (abilityHelper.UseAbilityIfCondition(this.blink, this.timberChain, this.whirlingDeath))
            {
                if (abilityHelper.CanBeCasted(this.whirlingDeath, false, false))
                {
                    abilityHelper.ForceUseAbility(this.whirlingDeath, true);
                }

                return(true);
            }

            if (abilityHelper.UseAbility(this.shiva))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.bladeMail, 400))
            {
                return(true);
            }

            if (abilityHelper.UseAbilityIfCondition(this.timberChain, this.blink))
            {
                return(true);
            }

            var chakram = this.chakrams.Find(x => x.Ability.CanBeCasted());

            if (abilityHelper.UseAbility(chakram))
            {
                return(true);
            }

            return(false);
        }
示例#2
0
文件: Leshrac.cs 项目: vana41203/O9K
        public override bool Orbwalk(Unit9 target, bool attack, bool move, ComboModeMenu comboMenu = null)
        {
            if (target?.IsMagicImmune != true &&
                ((comboMenu?.IsAbilityEnabled(this.lightning.Ability) == true && this.lightning.Ability.CanBeCasted()) ||
                 (comboMenu?.IsAbilityEnabled(this.splitEarth.Ability) == true && this.splitEarth.Ability.CanBeCasted())))
            {
                attack = false;
            }

            return(base.Orbwalk(target, attack, move, comboMenu));
        }
示例#3
0
        // Token: 0x06000274 RID: 628 RVA: 0x000104E4 File Offset: 0x0000E6E4
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            int     damagingChakrams = this.chakrams.Count((Chakram x) => comboModeMenu.IsAbilityEnabled(x.Ability) && x.IsDamaging(targetManager));
            Chakram chakram          = this.chakrams.Find((Chakram x) => comboModeMenu.IsAbilityEnabled(x.Ability) && x.ShouldReturnChakram(targetManager, damagingChakrams));

            if (chakram != null && chakram.Return())
            {
                return(true);
            }
            AbilityHelper abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbility(this.whirlingDeath, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.hex, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbilityIfCondition(this.blink, new UsableAbility[]
            {
                this.timberChain,
                this.whirlingDeath
            }))
            {
                if (abilityHelper.CanBeCasted(this.whirlingDeath, false, false, true, true))
                {
                    abilityHelper.ForceUseAbility(this.whirlingDeath, true, true);
                }
                return(true);
            }
            if (abilityHelper.UseAbility(this.shiva, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.bladeMail, 400f))
            {
                return(true);
            }
            if (abilityHelper.UseAbilityIfCondition(this.timberChain, new UsableAbility[]
            {
                this.blink
            }))
            {
                return(true);
            }
            Chakram ability = this.chakrams.Find((Chakram x) => x.Ability.CanBeCasted(true));

            return(abilityHelper.UseAbility(ability, true));
        }
示例#4
0
        protected virtual bool Attack(Unit9 target, [CanBeNull] ComboModeMenu comboMenu)
        {
            if (this.Owner.Name == nameof(HeroId.npc_dota_hero_rubick))
            {
                //hack
                var q = (IActiveAbility)this.Owner.Abilities.FirstOrDefault(x => x.Id == AbilityId.rubick_telekinesis);
                if (q?.CanBeCasted() == true && comboMenu?.IsAbilityEnabled(q) == true)
                {
                    return(false);
                }
            }

            if (!this.UseOrbAbility(target, comboMenu) && !this.Owner.BaseUnit.Attack(target.BaseUnit))
            {
                return(false);
            }

            var ping     = (Game.Ping / 2000) + 0.06f;
            var turnTime = this.Owner.GetTurnTime(target.Position);
            var distance = Math.Max(this.Owner.Distance(target) - this.Owner.GetAttackRange(target), 0) / this.Owner.BaseUnit.MovementSpeed;
            var delay    = turnTime + distance + ping;

            var attackPoint = this.Owner.GetAttackPoint(target);

            if (this.Owner.Abilities.Any(x => x.Id == AbilityId.item_echo_sabre && x.CanBeCasted()))
            {
                attackPoint *= 2.5f;
            }

            this.AttackSleeper.Sleep((this.Owner.GetAttackPoint(target) + this.Owner.GetAttackBackswing(target) + delay) - 0.1f);
            this.MoveSleeper.Sleep(attackPoint + delay + 0.25f + (this.Menu.AdditionalDelay / 1000f));

            return(true);
        }
        // Token: 0x0600071F RID: 1823 RVA: 0x00021D64 File Offset: 0x0001FF64
        protected virtual bool UseOrbAbility(Unit9 target, ComboModeMenu comboMenu)
        {
            if (!this.Owner.CanUseAbilities)
            {
                return(false);
            }
            OrbAbility orbAbility = this.Owner.Abilities.OfType <OrbAbility>().FirstOrDefault(delegate(OrbAbility x)
            {
                ComboModeMenu comboMenu2 = comboMenu;
                return(comboMenu2 != null && comboMenu2.IsAbilityEnabled(x) && !x.Enabled && x.CanBeCasted(true) && x.CanHit(target));
            });

            if (orbAbility != null)
            {
                if (string.IsNullOrEmpty(orbAbility.OrbModifier))
                {
                    return(orbAbility.UseAbility(target, false, false));
                }
                if ((double)Game.RawGameTime < (double)this.orbHitTime - 0.1)
                {
                    return(false);
                }
                Modifier modifier = target.GetModifier(orbAbility.OrbModifier);
                if (((modifier != null) ? modifier.RemainingTime : 0f) <= (this.Owner.GetAttackPoint(target) + this.Owner.Distance(target) / (float)this.Owner.ProjectileSpeed) * 2f + this.Owner.GetAttackBackswing(target))
                {
                    this.orbHitTime = Game.RawGameTime + orbAbility.GetHitTime(target);
                    return(orbAbility.UseAbility(target, false, false));
                }
            }
            return(false);
        }
 // Token: 0x0600064D RID: 1613 RVA: 0x0001EAEC File Offset: 0x0001CCEC
 public override bool Orbwalk(Unit9 target, bool attack, bool move, ComboModeMenu comboMenu = null)
 {
     if (target != null)
     {
         if (comboMenu != null && comboMenu.IsAbilityEnabled(this.stomp.Ability) && this.stomp.Ability.CanBeCasted(true))
         {
             return(base.Move(target.GetPredictedPosition(1f)));
         }
         if (!this.damagedUnits.Contains(target))
         {
             return(base.Move(target.Position));
         }
         Unit9 unit = (from x in this.moveUnits
                       where x.IsValid && x.IsAlive && x.Distance(base.Owner) < 1000f
                       orderby x.IsHero descending, x.Distance(base.Owner)
                       select x).FirstOrDefault <Unit9>();
         if (unit != null)
         {
             return(base.Move(unit.Position));
         }
         ActiveAbility activeAbility = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.elder_titan_return_spirit) as ActiveAbility;
         if (activeAbility != null && activeAbility.CanBeCasted(true) && activeAbility.UseAbility(false, false))
         {
             base.OrbwalkSleeper.Sleep(3f);
             return(true);
         }
     }
     return(base.Orbwalk(target, attack, move, comboMenu));
 }
示例#7
0
        // Token: 0x060005EE RID: 1518 RVA: 0x0001DB44 File Offset: 0x0001BD44
        protected override bool UseOrbAbility(Unit9 target, ComboModeMenu comboMenu)
        {
            if (!base.Owner.CanUseAbilities)
            {
                return(false);
            }
            ActiveAbility ability = this.tidebringer.Ability;

            return(comboMenu != null && comboMenu.IsAbilityEnabled(ability) && (ability.CanBeCasted(true) && ability.CanHit(target) && ability.UseAbility(target, false, false)));
        }
 // Token: 0x0600089C RID: 2204 RVA: 0x00026F68 File Offset: 0x00025168
 public override bool CanBeCasted(ComboModeMenu menu)
 {
     if (menu.IsAbilityEnabled(base.Ability))
     {
         return(false);
     }
     if (base.AbilitySleeper.IsSleeping(base.Ability.Handle) || base.OrbwalkSleeper.IsSleeping(base.Ability.Owner.Handle))
     {
         return(false);
     }
     if (this.shadowRealm.Casted)
     {
         return(base.Ability.Owner.CanAttack(null, 0f));
     }
     return(base.Ability.CanBeCasted(true));
 }
示例#9
0
        protected virtual bool UseOrbAbility(Unit9 target, ComboModeMenu comboMenu)
        {
            if (!this.Owner.CanUseAbilities)
            {
                return(false);
            }

            var orbAbility = this.Owner.Abilities.OfType <OrbAbility>()
                             .FirstOrDefault(x => comboMenu?.IsAbilityEnabled(x) == true && !x.Enabled && x.CanBeCasted() && x.CanHit(target));

            if (orbAbility != null)
            {
                return(orbAbility.UseAbility(target));
            }

            return(false);
        }
示例#10
0
        public virtual bool CanBeCasted(ComboModeMenu menu)
        {
            if (!menu.IsAbilityEnabled(this.Ability))
            {
                return(false);
            }

            if (this.AbilitySleeper.IsSleeping(this.Ability.Handle) || this.OrbwalkSleeper.IsSleeping(this.Ability.Owner.Handle))
            {
                return(false);
            }

            if (!this.Ability.CanBeCasted())
            {
                return(false);
            }

            return(true);
        }
示例#11
0
        protected override bool UseOrbAbility(Unit9 target, ComboModeMenu comboMenu)
        {
            if (!this.Owner.CanUseAbilities)
            {
                return(false);
            }

            var orb = this.tidebringer.Ability;

            if (comboMenu?.IsAbilityEnabled(orb) != true)
            {
                return(false);
            }

            if (orb.CanBeCasted() && orb.CanHit(target) && orb.UseAbility(target))
            {
                return(true);
            }

            return(false);
        }
示例#12
0
        public override bool Orbwalk(Unit9 target, bool attack, bool move, ComboModeMenu comboMenu = null)
        {
            if (target != null)
            {
                if (comboMenu?.IsAbilityEnabled(this.stomp.Ability) == true && this.stomp.Ability.CanBeCasted())
                {
                    return(this.Move(target.GetPredictedPosition(1f)));
                }

                if (this.damagedUnits.Contains(target))
                {
                    var moveTarget = this.moveUnits.Where(x => x.IsValid && x.IsAlive && x.Distance(this.Owner) < 1000)
                                     .OrderByDescending(x => x.IsHero)
                                     .ThenBy(x => x.Distance(this.Owner))
                                     .FirstOrDefault();

                    if (moveTarget != null)
                    {
                        return(this.Move(moveTarget.Position));
                    }

                    var spiritReturn =
                        this.Owner.Abilities.FirstOrDefault(x => x.Id == AbilityId.elder_titan_return_spirit) as ActiveAbility;

                    if (spiritReturn?.CanBeCasted() == true && spiritReturn.UseAbility())
                    {
                        this.OrbwalkSleeper.Sleep(3f);
                        return(true);
                    }
                }
                else
                {
                    return(this.Move(target.Position));
                }
            }

            return(base.Orbwalk(target, attack, move, comboMenu));
        }
示例#13
0
文件: Phoenix.cs 项目: vana41203/O9K
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            var abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbilityIfCondition(this.dive, this.nova))
            {
                if (abilityHelper.CanBeCasted(this.shiva, false))
                {
                    this.shiva.ForceUseAbility(targetManager, this.ComboSleeper);
                }

                return(true);
            }

            if (!comboModeMenu.IsHarassCombo)
            {
                if (this.dive.AutoStop(targetManager))
                {
                    this.ComboSleeper.Sleep(0.1f);
                    return(true);
                }
            }

            if (abilityHelper.UseAbility(this.veil))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.hex))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.halberd))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.atos))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.urn))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.vessel))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.spirits))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.shiva))
            {
                return(true);
            }

            if (abilityHelper.CanBeCasted(this.nova, false) && (this.dive.IsFlying || this.Owner.Distance(targetManager.Target) < 600))
            {
                var spiritsCount = this.Owner.GetModifier("modifier_phoenix_fire_spirit_count")?.StackCount ?? 0;
                var enemies      = targetManager.EnemyHeroes.Where(x => x.Distance(this.Owner) < this.spirits.Ability.CastRange).ToList();
                var count        = Math.Min(spiritsCount, enemies.Count);

                for (var i = 0; i < count; i++)
                {
                    this.spirits.Ability.UseAbility(enemies[i], HitChance.Low, i != 0);
                }

                if (count > 0)
                {
                    this.ComboSleeper.Sleep(0.2f);
                    return(true);
                }

                if ((this.Owner.Distance(targetManager.Target) < 600 ||
                     (this.dive.CastPosition != Vector3.Zero &&
                      this.Owner.Distance(this.dive.CastPosition) < this.nova.Ability.CastRange)) &&
                    abilityHelper.UseAbility(this.nova))
                {
                    return(true);
                }
            }

            if (!this.dive.IsFlying &&
                (!abilityHelper.CanBeCasted(this.spirits) || this.Owner.HasModifier("modifier_phoenix_fire_spirit_count")))
            {
                if (comboModeMenu.IsAbilityEnabled(this.ray.Ability))
                {
                    if (this.ray.AutoControl(targetManager, this.ComboSleeper, 0.6f))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
示例#14
0
 // Token: 0x06000869 RID: 2153 RVA: 0x00026388 File Offset: 0x00024588
 public virtual bool CanBeCasted(ComboModeMenu menu)
 {
     return(menu.IsAbilityEnabled(this.Ability) && !this.AbilitySleeper.IsSleeping(this.Ability.Handle) && !this.OrbwalkSleeper.IsSleeping(this.Ability.Owner.Handle) && this.Ability.CanBeCasted(true));
 }
示例#15
0
        // Token: 0x06000275 RID: 629 RVA: 0x00010644 File Offset: 0x0000E844
        public override void EndCombo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            base.EndCombo(targetManager, comboModeMenu);
            IEnumerable <Chakram> source = this.chakrams;

            Func <Chakram, bool> < > 9__0;
            Func <Chakram, bool> predicate;

            if ((predicate = < > 9__0) == null)
            {
                predicate = (< > 9__0 = ((Chakram x) => x.ReturnChakram.CanBeCasted(true) && comboModeMenu.IsAbilityEnabled(x.Ability)));
            }
            foreach (Chakram chakram in source.Where(predicate))
            {
                chakram.Return();
            }
        }
        // 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);
        }
示例#17
0
        // Token: 0x06000453 RID: 1107 RVA: 0x000176F0 File Offset: 0x000158F0
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            AbilityHelper abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbilityIfCondition(this.dive, new UsableAbility[]
            {
                this.nova
            }))
            {
                if (abilityHelper.CanBeCasted(this.shiva, false, true, true, true))
                {
                    this.shiva.ForceUseAbility(targetManager, base.ComboSleeper);
                }
                return(true);
            }
            if (!comboModeMenu.IsHarassCombo && this.dive.AutoStop(targetManager))
            {
                base.ComboSleeper.Sleep(0.1f);
                return(true);
            }
            if (abilityHelper.UseAbility(this.veil, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.hex, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.halberd, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.atos, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.urn, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.vessel, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.spirits, true))
            {
                return(true);
            }
            if (abilityHelper.UseAbility(this.shiva, true))
            {
                return(true);
            }
            if (abilityHelper.CanBeCasted(this.nova, false, true, true, true) && (this.dive.IsFlying || base.Owner.Distance(targetManager.Target) < 600f))
            {
                Modifier     modifier = base.Owner.GetModifier("modifier_phoenix_fire_spirit_count");
                int          val      = (modifier != null) ? modifier.StackCount : 0;
                List <Unit9> list     = (from x in targetManager.EnemyHeroes
                                         where x.Distance(base.Owner) < this.spirits.Ability.CastRange
                                         select x).ToList <Unit9>();
                int num = Math.Min(val, list.Count);
                for (int i = 0; i < num; i++)
                {
                    this.spirits.Ability.UseAbility(list[i], 1, i != 0, false);
                }
                if (num > 0)
                {
                    base.ComboSleeper.Sleep(0.2f);
                    return(true);
                }
                if ((base.Owner.Distance(targetManager.Target) < 600f || (this.dive.CastPosition != Vector3.Zero && base.Owner.Distance(this.dive.CastPosition) < this.nova.Ability.CastRange)) && abilityHelper.UseAbility(this.nova, true))
                {
                    return(true);
                }
            }
            return(!this.dive.IsFlying && (!abilityHelper.CanBeCasted(this.spirits, true, true, true, true) || base.Owner.HasModifier("modifier_phoenix_fire_spirit_count")) && comboModeMenu.IsAbilityEnabled(this.ray.Ability) && this.ray.AutoControl(targetManager, base.ComboSleeper, 0.6f));
        }
示例#18
0
        public override void EndCombo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            base.EndCombo(targetManager, comboModeMenu);

            foreach (var chakram in this.chakrams.Where(x => x.ReturnChakram.CanBeCasted() && comboModeMenu.IsAbilityEnabled(x.Ability)))
            {
                chakram.Return();
            }
        }