Exemplo n.º 1
0
        public static BakedCupcake GetPrediction(CupcakeIngredients input)
        {
            if (!Initialized)
            {
                throw new InvalidOperationException("Cupcake Prediction isn't initialized!");
            }

            var x = input.ToXIngredient();
            var y = input.ToYIngredient();

            var predictedX = xmodel.Predict(x);
            var predictedY = ymodel.Predict(y);

            return new BakedCupcake(predictedX.BakedX, predictedY.BakedY);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Fired when a unit takes damage.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="AttackableUnitDamageEventArgs" /> instance containing the event data.</param>
        private static void Obj_AI_Base_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
        {
            Game.PrintChat("ONDDAMAGE");
            if (args.SourceNetworkId != ObjectManager.Player.NetworkId)
            {
                Game.PrintChat("not me");
                return;
            }

            var spell = new Spell(SpellSlot.Unknown, lastSpellCast.CastRangeDisplayOverride);
            spell.SetSkillshot(
                lastSpellCast.CastFrame / 30f,
                Math.Abs(lastSpellCast.LineWidth) < float.Epsilon ? lastSpellCast.CastRadius : lastSpellCast.LineWidth,
                lastSpellCast.MissileSpeed,
                lastSpellCast.HaveHitBone,
                SkillshotType.SkillshotLine);

            var ingredients = new CupcakeIngredients(
                ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(args.TargetNetworkId),
                spell);

            ingredients.Waypoints = targetWaypoints;

            var x = ingredients.ToXIngredient();
            var y = ingredients.ToYIngredient();

            x.BakedX = lastSpellLocation.X;
            y.BakedY = lastSpellLocation.Y;

            pan.X.Add(x);
            pan.Y.Add(y);

            SaveJson();
        }