// 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);
        }
Esempio n. 2
0
        public AutocastAbility(OrbAbility orbAbility, GroupSettings settings)
            : base(orbAbility)
        {
            this.OrbAbility    = orbAbility;
            this.settings      = new AutocastSettings(settings.Menu, orbAbility);
            this.groupSettings = settings;

            this.autocastHandler = UpdateManager.Subscribe(this.AutocastOnUpdate, 0, false);
            this.groupSettings.GroupEnabled.ValueChange += this.EnabledOnPropertyChanged;
        }