Exemplo n.º 1
0
        public Kunkka(Unit9 owner, MultiSleeper abilitySleeper, Sleeper orbwalkSleeper, ControllableUnitMenu menu)
            : base(owner, abilitySleeper, orbwalkSleeper, menu)
        {
            this.playerHandle = owner.BaseOwner.Handle;

            this.ComboAbilities = new Dictionary <AbilityId, Func <ActiveAbility, UsableAbility> >
            {
                { AbilityId.kunkka_torrent, x => this.torrent = new Torrent(x) },
                { AbilityId.kunkka_tidebringer, x => this.tidebringer = new TargetableAbility(x) },
                { AbilityId.kunkka_x_marks_the_spot, x => this.xMark = new XMark(x) },
                { AbilityId.kunkka_return, x => this.xReturn = new UntargetableAbility(x) },
                { AbilityId.kunkka_ghostship, x => this.ship = new Ghostship(x) },

                { AbilityId.item_phase_boots, x => this.phase = new SpeedBuffAbility(x) },
                { AbilityId.item_armlet, x => this.armlet = new BuffAbility(x) },
                { AbilityId.item_blink, x => this.blink = new BlinkAbility(x) },
                { AbilityId.item_swift_blink, x => this.blink = new BlinkAbility(x) },
                { AbilityId.item_arcane_blink, x => this.blink = new BlinkAbility(x) },
                { AbilityId.item_overwhelming_blink, x => this.blink = new BlinkAbility(x) },
            };

            this.ancientCamps = Context9.JungleManager.JungleCamps.Where(x => x.IsAncient).Select(x => x.CreepsPosition).ToArray();

            ParticleManager.ParticleAdded += OnParticleAdded;
            ModifierManager.ModifierAdded += OnModifierAdded;
            OrderManager.OrderAdding      += OnOrderAdding;
        }
Exemplo n.º 2
0
        // Token: 0x060005EB RID: 1515 RVA: 0x0001D728 File Offset: 0x0001B928
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            if (comboModeMenu.IsHarassCombo)
            {
                return(false);
            }
            AbilityHelper abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.CanBeCasted(this.blink, true, true, true, true) && !abilityHelper.CanBeCasted(this.xReturn, true, true, true, true))
            {
                float blinkToEnemyRange = 0f;
                if (!abilityHelper.CanBeCasted(this.xMark, true, true, true, true))
                {
                    if (abilityHelper.CanBeCasted(this.xMark, false, true, true, true))
                    {
                        blinkToEnemyRange = Math.Min(this.xMark.Ability.CastRange - 100f, Math.Max(base.Owner.Distance(targetManager.Target) - this.xMark.Ability.CastRange, 0f));
                    }
                    if (abilityHelper.UseAbility(this.blink, 500f, blinkToEnemyRange))
                    {
                        return(true);
                    }
                }
            }
            if (abilityHelper.UseAbilityIfAny(this.xMark, new UsableAbility[]
            {
                this.torrent,
                this.ship
            }))
            {
                base.ComboSleeper.ExtendSleep(0.1f);
                base.OrbwalkSleeper.ExtendSleep(0.1f);
                return(true);
            }
            if (abilityHelper.CanBeCasted(this.xReturn, true, true, true, true))
            {
                if (!this.xMark.Position.IsZero)
                {
                    if (abilityHelper.CanBeCasted(this.ship, false, true, true, true) && this.ship.UseAbility(this.xMark.Position, targetManager, base.ComboSleeper))
                    {
                        return(true);
                    }
                    if (abilityHelper.CanBeCasted(this.torrent, false, true, true, true) && this.torrent.UseAbility(this.xMark.Position, targetManager, base.ComboSleeper))
                    {
                        return(true);
                    }
                    if (!this.torrent.ShouldReturn(this.xReturn.Ability, this.xMark.Position))
                    {
                        Ghostship ghostship = this.ship;
                        if (ghostship == null || !ghostship.ShouldReturn(this.xReturn.Ability, this.xMark.Position))
                        {
                            goto IL_220;
                        }
                    }
                    if (abilityHelper.UseAbility(this.xReturn, true))
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (abilityHelper.UseAbility(this.torrent, true))
                {
                    return(true);
                }
                if (abilityHelper.UseAbility(this.ship, true))
                {
                    return(true);
                }
            }
IL_220:
            return(abilityHelper.UseAbility(this.armlet, 400f) || abilityHelper.UseAbility(this.phase, true));
        }