Exemplo n.º 1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="W" /> class.
 /// </summary>
 /// <param name="ireliaW">The irelia w.</param>
 public W(IreliaW ireliaW)
 {
     this.ireliaW = ireliaW;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public override void Load()
        {
            var superParent = new SuperParent(this.DisplayName);

            var orbwalkerModule = new OrbwalkerModule();

            orbwalkerModule.Load();

            var graphGeneratorModule = new GraphGeneratorModule(null);

            var pathfinderModule = new PathfinderModule();

            var damageCalculator = new DamageCalculatorParent();

            //var ireliaP = new IreliaP();
            var ireliaQ = new IreliaQ(graphGeneratorModule, pathfinderModule);

            graphGeneratorModule.IreliaQ = ireliaQ;
            var ireliaW = new IreliaW();
            var ireliaE = new IreliaE();
            var ireliaR = new IreliaR();

            var aa = new AutoAttacks();

            damageCalculator.Add(aa);
            damageCalculator.Add(ireliaQ);
            damageCalculator.Add(ireliaW);
            damageCalculator.Add(ireliaE);
            damageCalculator.Add(ireliaR);

            graphGeneratorModule.IreliaQ = ireliaQ;

            var spellInterrupterModule =
                new SpellInterrupterModule(new SpellInterrupter(ireliaE.Spell, sender => ireliaE.CanStun(sender)));

            var dashToMouseModule = new PathfindToMouseModule(ireliaQ);

            var spellParent = new SpellParent.SpellParent();

            spellParent.Add(new List <Base> {
                ireliaQ, ireliaW, ireliaE, ireliaR,
            });
            spellParent.Load();

            var comboParent = new OrbwalkingParent(
                "Combo",
                orbwalkerModule.OrbwalkerInstance,
                Orbwalking.OrbwalkingMode.Combo);

            var laneClearParent = new OrbwalkingParent(
                "LaneClear",
                orbwalkerModule.OrbwalkerInstance,
                Orbwalking.OrbwalkingMode.LaneClear);

            var lastHitParent = new OrbwalkingParent(
                "LastHit",
                orbwalkerModule.OrbwalkerInstance,
                Orbwalking.OrbwalkingMode.LastHit,
                Orbwalking.OrbwalkingMode.Mixed,
                Orbwalking.OrbwalkingMode.LaneClear);

            var mixedParent = new OrbwalkingParent(
                "Mixed",
                orbwalkerModule.OrbwalkerInstance,
                Orbwalking.OrbwalkingMode.Mixed);

            var drawingParent = new Parent("Drawings");

            comboParent.Add(
                new List <Base>
            {
                new Q(ireliaQ, damageCalculator).Guardian(new SpellMustBeReady(SpellSlot.Q)),
                new W(ireliaW, ireliaQ).Guardian(new SpellMustBeReady(SpellSlot.W)),
                new E(ireliaE).Guardian(new SpellMustBeReady(SpellSlot.E)).Guardian(new PlayerMustNotBeWindingUp()),
                new R(ireliaR, ireliaQ, damageCalculator).Guardian(new SpellMustBeReady(SpellSlot.R))
                .Guardian(new PlayerMustNotBeWindingUp())
            });

            laneClearParent.Add(
                new List <Base>
            {
                new LaneClear.W(ireliaW).Guardian(new SpellMustBeReady(SpellSlot.W)),
                new LaneClear.E(ireliaE).Guardian(new SpellMustBeReady(SpellSlot.E))
                .Guardian(new PlayerMustNotBeWindingUp())
            });

            lastHitParent.Add(
                new List <Base>
            {
                new LastHit.Q(ireliaQ).Guardian(new SpellMustBeReady(SpellSlot.Q)),
                new LastHit.E(ireliaE).Guardian(new SpellMustBeReady(SpellSlot.E))
                .Guardian(new PlayerMustNotBeWindingUp())
            });

            mixedParent.Add(
                new List <Base>
            {
                new Q(ireliaQ, damageCalculator).Guardian(new SpellMustBeReady(SpellSlot.Q)),
                new W(ireliaW, ireliaQ).Guardian(new SpellMustBeReady(SpellSlot.W)),
                new Mixed.E(ireliaE).Guardian(new SpellMustBeReady(SpellSlot.E))
                .Guardian(new PlayerMustNotBeWindingUp())
            });

            var module = new DamageDrawingParent("Damage Drawings");

            const byte defaultAlpha = 50 * 255 / 100;

            module.Add(
                new List <IDamageDrawing>
            {
                new DamageDrawingChild("Auto-Attacks", aa.GetDamage)
                {
                    Color = new Color(40, 175, 175)
                    {
                        A = defaultAlpha
                    },
                },
                new DamageDrawingChild("Q", ireliaQ.GetDamage)
                {
                    Color = new Color(25, 100, 125)
                    {
                        A = defaultAlpha
                    }
                },
                new DamageDrawingChild("W", ireliaW.GetDamage)
                {
                    Color = new Color(40, 175, 175)
                    {
                        A = defaultAlpha
                    }
                },
                new DamageDrawingChild("E", ireliaE.GetDamage)
                {
                    Color = new Color(255, 210, 95)
                    {
                        A = defaultAlpha
                    }
                },
                new DamageDrawingChild("R", ireliaR.GetDamage)
                {
                    Color = new Color(240, 150, 75)
                    {
                        A = defaultAlpha
                    }
                }
            });

            var spellRangeParent = new Parent("Ranges");

            spellRangeParent.Add(
                new List <Base>
            {
                new RangeDrawingChild(ireliaQ.Spell, "Q"),
                new RangeDrawingChild(ireliaE.Spell, "E"),
                new RangeDrawingChild(ireliaR.Spell, "R", true),
            });

            drawingParent.Add(new List <Base> {
                spellRangeParent, module
            });

            superParent.Add(
                new List <Base>
            {
                orbwalkerModule,
                spellParent,
                damageCalculator,
                pathfinderModule,
                graphGeneratorModule,
                comboParent,
                laneClearParent,
                lastHitParent,
                mixedParent,
                dashToMouseModule,
                spellInterrupterModule,
                drawingParent
            });

            superParent.Load();

            superParent.Menu.Style = FontStyle.Bold;
            superParent.Menu.Color = Color.Firebrick;
        }
Exemplo n.º 3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="W" /> class.
 /// </summary>
 /// <param name="ireliaW">Irelia W.</param>
 /// <param name="ireliaQ">Irelia Q</param>
 public W(IreliaW ireliaW, IreliaQ ireliaQ)
 {
     this.ireliaW = ireliaW;
     this.ireliaQ = ireliaQ;
 }
Exemplo n.º 4
0
        // The Composition Root of our software
        public override void Load()
        {
            var ireliaQ = new IreliaQ();
            var ireliaW = new IreliaW();
            var ireliaE = new IreliaE();
            var ireliaR = new IreliaR();

            var cacheFactory = new ProviderCacheFactory();

            var qUnitProvider = cacheFactory.Create(new QUnitProvider());
            var eUnitProvider = cacheFactory.Create(new EUnitProvider());
            var rVecProvider  = cacheFactory.Create(new RVectorProvider());

            // TODO: Client wrapped in a IProvider which finds a { Target, Vector }
            // TODO: Client which determines what combo to do

            var comboClient = new ActionClient <Action>(
                new HighestScoreWinsSelector <Action>(
                    new List <IQualifier <Action> >
            {
                new SpellQualifier <Action>(
                    new List <IScorer>
                {
                    new SpellStateScorer(new SpellStateConfiguration {
                        ReadyScore = 1
                    }, ireliaQ),
                    new BinaryScorer(new BinaryScorerConfiguration(1, 0),
                                     () => qUnitProvider.Get() != default(IUnit))
                },
                    new List <IScorer>
                {
                    // Damage { Done, Overkill, Team damage, Burst }, Movement { Inside skillshots, dodge, in enemies, away from enemies }, Health { Health after, Health before }
                    // Cooldown { Reset or too high }, Does it get me closer to valuable targets (lowlife, high prio), Is the enemy using a movement spell or more abstract,
                    // is the predicted enemy position far away or coming towards me, can I cancel abilities animations with it, does the new position favor other spells
                    // Does it proc AOE effects, such as Tiamat
                },
                    () => ireliaQ.Cast(qUnitProvider.Get())),
                new SpellQualifier <Action>(
                    new List <IScorer>
                {
                    new SpellStateScorer(new SpellStateConfiguration {
                        ReadyScore = 1
                    }, ireliaQ)
                },
                    new List <IScorer>
                {
                    // Damage { Done, Overkill, Team damage, Burst }, Health { Health after, Health before }, Cooldown { Reset or too high }, Enemies in range || path given,
                    // Can I cancel abilities animations with it
                },
                    () => ireliaW.Cast()),
                new SpellQualifier <Action>(
                    new List <IScorer>
                {
                    new SpellStateScorer(new SpellStateConfiguration {
                        ReadyScore = 1
                    }, ireliaQ)
                },
                    new List <IScorer>
                {
                    // Damage { Done, Overkill, Team damage, Burst }, Health { Health after, Health before }, Cooldown { Reset or too high }, Enemies in range || path given,
                    // Can I cancel abilities animations with it
                },
                    () => ireliaE.Cast(eUnitProvider.Get())),
                new SpellQualifier <Action>(
                    new List <IScorer>
                {
                    new SpellStateScorer(new SpellStateConfiguration {
                        ReadyScore = 1
                    }, ireliaQ)
                },
                    new List <IScorer>
                {
                    // Damage { Done, Overkill, Team damage, Burst }, Health { Health after, Health before }, Cooldown { Reset or too high }, Enemies in range || path given,
                    // Can I cancel abilities animations with it
                },
                    () => ireliaR.Cast(rVecProvider.Get())),
            }
                    ),
                action => action.Invoke());

            // TODO: Determine when to do Combo etc, through keys.

            // Fires the combo engine
            this.Api.Events.OnGameUpdate += (sender, args) => comboClient.Tick();

            // Resets the cache
            cacheFactory.Reset();
        }