Esempio n. 1
0
        //-------------------------------------------SpellDamage()----------------------------------------------

        static float SpellDamage(Obj_AI_Base target, SpellSlot slot)
        {
            switch (slot)
            {
            case SpellSlot.Q:
                if (!Q.IsReady())
                {
                    return(0);
                }

                if (Item.HasItem(ItemId.Trinity_Force) && ((Trinity.IsReady() && !Player.HasBuff("sheen")) || Player.HasBuff("sheen")))
                {
                    return(Player.CalculateDamageOnUnit(target, DamageType.Physical, new float[] { 20, 50, 80, 110, 140 }[Q.Level - 1] +Player.TotalAttackDamage + 2 * Player.BaseAttackDamage, true, true));
                }
                if (Item.HasItem(ItemId.Sheen) && ((Sheen.IsReady() && !Player.HasBuff("sheen")) || Player.HasBuff("sheen")))
                {
                    return(Player.CalculateDamageOnUnit(target, DamageType.Physical, new float[] { 20, 50, 80, 110, 140 }[Q.Level - 1] +Player.TotalAttackDamage + Player.BaseAttackDamage, true, true));
                }
                return(Player.CalculateDamageOnUnit(target, DamageType.Physical, new float[] { 20, 50, 80, 110, 140 }[Q.Level - 1] +Player.TotalAttackDamage, true, true));

            case SpellSlot.W:
                return(Player.CalculateDamageOnUnit(target, DamageType.True, 15 * W.Level, true, true));

            case SpellSlot.E:
                return(Player.CalculateDamageOnUnit(target, DamageType.Magical, 40 * (E.Level + 1), true, true));

            case SpellSlot.R:
                return(Player.CalculateDamageOnUnit(target, DamageType.Physical, (40 * (R.Level + 1)) + Player.TotalMagicalDamage / 2 + Player.FlatPhysicalDamageMod * 0.6f));

            default:
                return(0);
            }
        }
Esempio n. 2
0
        private static float TwistedFateDamage(AIHeroClient target)
        {
            var   Qdamage = (float)Player.GetSpellDamage(target, Q.Slot);
            var   Wdamage = (float)Player.GetSpellDamage(target, W.Slot);
            float x       = 0;

            if ((W.IsReady() || HasACard != "none") && Q.IsReady())
            {
                if ((Player.Mana >= Q.Instance.SData.Mana + W.Instance.SData.Mana) || (Player.Mana >= Q.Instance.SData.Mana && HasACard != "none"))
                {
                    x = x + Qdamage + Wdamage;
                }
                else if (Player.Mana >= Q.Instance.SData.Mana)
                {
                    x = x + Qdamage;
                }
                else if (Player.Mana >= W.Instance.SData.Mana || HasACard != "none")
                {
                    x = x + Wdamage;
                }
            }
            else if (Q.IsReady())
            {
                x = x + Qdamage;
            }
            else if (W.IsReady() || HasACard != "none")
            {
                x = x + Wdamage;
            }
            if (LichBane.IsReady())
            {
                x = x + (float)Player.CalcDamage(target, Damage.DamageType.Magical, 0.75 * Player.BaseAttackDamage + 0.5 * Player.FlatMagicDamageMod);
            }
            else if (TrinityForce.IsReady())
            {
                x = x + (float)Player.CalcDamage(target, Damage.DamageType.Magical, 2 * Player.BaseAttackDamage);
            }
            else if (IcebornGauntlet.IsReady())
            {
                x = x + (float)Player.CalcDamage(target, Damage.DamageType.Magical, 1.25 * Player.BaseAttackDamage);
            }
            else if (Sheen.IsReady())
            {
                x = x + (float)Player.CalcDamage(target, Damage.DamageType.Magical, 1 * Player.BaseAttackDamage);
            }
            if (LudensEcho.IsReady())
            {
                x = x + (float)Player.CalcDamage(target, Damage.DamageType.Magical, 100 + 0.1 * Player.FlatMagicDamageMod);
            }
            x = x + (float)Player.GetAutoAttackDamage(target, true);
            return(x);
        }
Esempio n. 3
0
        private double GetBonusDmg(Obj_AI_Base Target)
        {
            double DmgItem = 0;

            if (Sheen.IsOwned() && ((Sheen.IsReady() && W.IsReady()) || Player.HasBuff("Sheen")) && Player.BaseAttackDamage > DmgItem)
            {
                DmgItem = Player.BaseAttackDamage;
            }
            if (Trinity.IsOwned() && ((Trinity.IsReady() && W.IsReady()) || Player.HasBuff("Sheen")) && Player.BaseAttackDamage * 2 > DmgItem)
            {
                DmgItem = Player.BaseAttackDamage * 2;
            }
            return(((W.IsReady() || Player.HasBuff("JaxEmpowerTwo")) ? W.GetDamage(Target) : 0) + (RCount == 2 ? R.GetDamage(Target) : 0) + Player.GetAutoAttackDamage(Target, true) + Player.CalcDamage(Target, Damage.DamageType.Physical, DmgItem));
        }
Esempio n. 4
0
        private double GetBonusDmg(Obj_AI_Base Target)
        {
            double DmgItem = 0;

            if (Sheen.IsOwned() && ((Sheen.IsReady() && Q.IsReady()) || Player.HasBuff("Sheen")) && Player.BaseAttackDamage > DmgItem)
            {
                DmgItem = Player.BaseAttackDamage;
            }
            if (Iceborn.IsOwned() && ((Iceborn.IsReady() && Q.IsReady()) || Player.HasBuff("ItemFrozenFist")) && Player.BaseAttackDamage * 1.25 > DmgItem)
            {
                DmgItem = Player.BaseAttackDamage * 1.25;
            }
            if (Trinity.IsOwned() && ((Trinity.IsReady() && Q.IsReady()) || Player.HasBuff("Sheen")) && Player.BaseAttackDamage * 2 > DmgItem)
            {
                DmgItem = Player.BaseAttackDamage * 2;
            }
            return((Q.IsReady() ? Q.GetDamage(Target) : 0) + Player.GetAutoAttackDamage(Target, Q.IsReady() ? false : true) + Player.CalcDamage(Target, Damage.DamageType.Physical, DmgItem));
        }
Esempio n. 5
0
        private static double GetBonusDmg(Obj_AI_Base target)
        {
            var dmgItem = 0d;

            if (Sheen.IsOwned() && (Sheen.IsReady() || Player.HasBuff("Sheen")))
            {
                dmgItem = Player.BaseAttackDamage;
            }
            if (Iceborn.IsOwned() && (Iceborn.IsReady() || Player.HasBuff("ItemFrozenFist")))
            {
                dmgItem = Player.BaseAttackDamage * 1.25;
            }
            if (Trinity.IsOwned() && (Trinity.IsReady() || Player.HasBuff("Sheen")))
            {
                dmgItem = Player.BaseAttackDamage * 2;
            }
            return((Q.IsReady() ? Q.GetDamage(target) : 0) + Player.GetAutoAttackDamage(target, true) +
                   (dmgItem > 0 ? Player.CalcDamage(target, Damage.DamageType.Physical, dmgItem) : 0));
        }
Esempio n. 6
0
        private static double GetBonusDmg(Obj_AI_Base target)
        {
            var dmgItem = 0d;

            if (Sheen.IsOwned() && (Sheen.IsReady() || Player.HasBuff("Sheen")))
            {
                dmgItem = Player.BaseAttackDamage;
            }
            if (Trinity.IsOwned() && (Trinity.IsReady() || Player.HasBuff("Sheen")))
            {
                dmgItem = Player.BaseAttackDamage * 2;
            }
            var dmgR  = 0d;
            var pBuff = Player.GetBuffCount("JaxRelentlessAssaultAS");

            if (R.Level > 0 && !(target is Obj_AI_Turret) && (pBuff == 2 || pBuff >= 5))
            {
                dmgR = R.GetDamage(target);
            }
            return(dmgR + (W.IsReady() || HaveW ? W.GetDamage(target) : 0) + Player.GetAutoAttackDamage(target, true) +
                   (dmgItem > 0 ? Player.CalcDamage(target, Damage.DamageType.Physical, dmgItem) : 0));
        }
Esempio n. 7
0
        private double GetBonusDmg(Obj_AI_Base target)
        {
            double dmgItem = 0;

            if (Sheen.IsOwned() && (Sheen.IsReady() || Player.HasBuff("Sheen")) && Player.BaseAttackDamage > dmgItem)
            {
                dmgItem = Player.BaseAttackDamage;
            }
            if (Trinity.IsOwned() && (Trinity.IsReady() || Player.HasBuff("Sheen")) &&
                Player.BaseAttackDamage * 2 > dmgItem)
            {
                dmgItem = Player.BaseAttackDamage * 2;
            }
            double dmgR  = 0;
            var    pBuff = Player.Buffs.FirstOrDefault(i => i.DisplayName == "JaxRelentlessAssaultAS");

            if (R.Level > 0 && !(target is Obj_AI_Turret) && pBuff != null && (pBuff.Count == 2 || pBuff.Count >= 5))
            {
                dmgR = R.GetDamage(target);
            }
            return(dmgR + (W.IsReady() || HaveW ? W.GetDamage(target) : 0) + Player.GetAutoAttackDamage(target, true) +
                   (dmgItem > 0 ? Player.CalcDamage(target, Damage.DamageType.Physical, dmgItem) : 0));
        }
Esempio n. 8
0
        public void ComputeScatteringFunctions(SurfaceInteraction si,
                                               IObjectArena arena,
                                               TransportMode mode,
                                               bool allowMultipleLobes)
        {
            BumpMap?.Bump(si);

            si.BSDF.Initialize(si);

            // Diffuse
            var c = Color.Evaluate(si).Clamp();
            var metallicWeight = Metallic.Evaluate(si);
            var e             = Eta.Evaluate(si);
            var strans        = SpecTrans.Evaluate(si);
            var diffuseWeight = (1f - metallicWeight) * (1f - strans);
            var dt            = DiffTrans.Evaluate(si) / 2f;
            var rough         = Roughness.Evaluate(si);
            var lum           = c.YComponent();
            var Ctint         = lum > 0f ? c / lum : Spectrum.One;

            if (diffuseWeight > 0f)
            {
                if (IsThin)
                {
                    var flat = Flatness.Evaluate(si);
                    si.BSDF.Add(arena.Create <DisneyDiffuse>().Initialize(diffuseWeight * (1f - flat) * (1 - dt) * c));
                    si.BSDF.Add(arena.Create <DisneyFakeSS>().Initialize(diffuseWeight * flat * (1f - dt) * c, rough));
                }
                else
                {
                    var sd = ScatterDistance.Evaluate(si);
                    if (sd.IsBlack())
                    {
                        si.BSDF.Add(arena.Create <DisneyDiffuse>().Initialize(diffuseWeight * c));
                    }
                    else
                    {
                        // The line below was the original code but produces some odd results.
                        si.BSDF.Add(arena.Create <SpecularTransmission>().Initialize(Spectrum.One, 1f, e, mode));
                        si.BSSRDF = arena.Create <DisneyBSSRDF>().Initialize(diffuseWeight * c, sd, si, e, this, mode);
                    }
                }

                // Retro-reflection.
                si.BSDF.Add(arena.Create <DisneyRetro>().Initialize(diffuseWeight * c, rough));

                // Sheen
                var sheenWeight = Sheen.Evaluate(si);
                if (sheenWeight > 0f)
                {
                    var stint  = SheenTint.Evaluate(si);
                    var Csheen = Spectrum.Lerp(Spectrum.One, Ctint, stint);
                    si.BSDF.Add(arena.Create <DisneySheen>().Initialize(diffuseWeight * sheenWeight * Csheen));
                }
            }

            // Microfacet distribution
            var aspect = Sqrt(1f - Anisotropic.Evaluate(si) * 0.9f);
            var ax     = Max(0.001f, Sqr(rough) / aspect);
            var ay     = Max(0.001f, Sqr(rough) * aspect);
            var dist   = arena.Create <DisneyMicrofacetDistribution>().Initialize(ax, ay);

            // Specular = Trowbridge-Reitz with modified Fresnel function.
            var specTint = SpecularTint.Evaluate(si);
            var Cspec0   = Spectrum.Lerp(SchlickR0FromEta(e) * Spectrum.Lerp(Spectrum.One, Ctint, specTint), c,
                                         metallicWeight);
            var fresnel = arena.Create <DisneyFresnel>().Initialize(Cspec0, metallicWeight, e);

            si.BSDF.Add(arena.Create <MicrofacetReflection>().Initialize(c, dist, fresnel));

            // Clearcoat
            var cc = Clearcoat.Evaluate(si);

            if (cc > 0f)
            {
                si.BSDF.Add(arena.Create <DisneyClearcoat>()
                            .Initialize(cc, Lerp(0.1f, 0.001f, ClearcoatGloss.Evaluate(si))));
            }

            // BTDF
            if (strans > 0f)
            {
                // Walter et al's model, with the provided transmissive term scaled
                // by sqrt(color), so that after two refractions, we're back to the
                // provided color.
                var T = strans * c.Sqrt();
                if (IsThin)
                {
                    var rScaled    = (0.65f * e - 0.35f) * rough;
                    var atx        = Max(0.001f, Sqr(rScaled) / aspect);
                    var aty        = Max(0.001f, Sqr(rScaled) * aspect);
                    var scaledDist = arena.Create <TrowbridgeReitzDistribution>().Initialize(atx, aty);
                    si.BSDF.Add(arena.Create <MicrofacetTransmission>().Initialize(T, scaledDist, 1f, e, mode));
                }
                else
                {
                    si.BSDF.Add(arena.Create <MicrofacetTransmission>().Initialize(T, dist, 1f, e, mode));
                }
            }

            if (IsThin)
            {
                si.BSDF.Add(arena.Create <LambertianTransmission>().Initialize(dt * c));
            }
        }