public void AddBuff(Bufftype buff)
        {
            int count       = 0;
            int firstserial = 0;
            var temp        = BuffChecker.Check(buff);

            for (int i = 0; i < Buffs.Count; i++)
            {
                if (Buffs[i].Bufftype.Equals(buff))
                {
                    count++;
                    if (count == 1)
                    {
                        firstserial = i;
                    }
                    if (count == 2)
                    {
                        Buffs[firstserial].RemoveBuff(this);
                        Buffs.RemoveAt(firstserial);
                        firstserial = 0;
                        count       = 0;
                    }
                }
            }
            Buffs.Add(temp);
            temp.GetBuff(this);
            Debug.Log("Buffco" + BuffCo.MoveSpeed);
        }
示例#2
0
        public static PlayerBuff Check(Bufftype bufftype)
        {
            switch (bufftype)
            {
            case    Bufftype.Speedup:
                return(new SpeedupBuff());

            case    Bufftype.Shield:
                return(new ShieldBuff());
            }
            return(new PlayerBuff());
        }
示例#3
0
    //this function will set the type of effects that this beneficial effect will be
    public void SetBeneficialEffects(string Effect)
    {
        switch (Effect)
        {
        case ("Defence"):
        {
            BeneficialEffect = Bufftype.DefenceBuff;
            break;
        }

        case ("Attack"):
        {
            BeneficialEffect = Bufftype.AttackBuff;
            break;
        }

        case ("CritRate"):
        {
            BeneficialEffect = Bufftype.CritRateBuff;
            break;
        }

        case ("Accuracy"):
        {
            BeneficialEffect = Bufftype.AccuracyBuff;
            break;
        }

        case ("Shield"):
        {
            BeneficialEffect = Bufftype.ShieldBuff;
            break;
        }

        case ("Immunity"):
        {
            BeneficialEffect = Bufftype.ImmunityBuff;
            break;
        }
        }
    }
示例#4
0
    // this function will set the type of effects that this harmful effects will be
    public void SetHarmfulEffect(string Effect)
    {
        switch (Effect)
        {
        case ("Defence"):
        {
            HarmfulEffect = Bufftype.DefenceDeBuff;
            break;
        }

        case ("Attack"):
        {
            HarmfulEffect = Bufftype.AttackDeBuff;
            break;
        }

        case ("CritRate"):
        {
            HarmfulEffect = Bufftype.CritRateDeBuff;
            break;
        }

        case ("Miss"):
        {
            HarmfulEffect = Bufftype.MissDeBuff;
            break;
        }

        case ("Shield"):
        {
            HarmfulEffect = Bufftype.ShieldDeBuff;
            break;
        }

        case ("Immunity"):
        {
            HarmfulEffect = Bufftype.ImmunityDeBuff;
            break;
        }
        }
    }
示例#5
0
文件: Buff.cs 项目: GilDuath/Asvargr
 public Buff(Bufftype bufftype, int bufvalue, int bufstack)
 {
     this.buffType  = bufftype;
     this.buffStack = bufstack;    //
     this.buffValue = bufvalue;
 }
示例#6
0
        private static void OnUpdate(EventArgs args)
        {
            #region Offensive

            if (!Humanizer.Limiter.CheckDelay($"{Humanizer.DelayItemBase}Slider.ItemDelay"))
            {
                return;
            }

            Humanizer.Limiter.UseTick($"{Humanizer.DelayItemBase}Slider.ItemDelay");

            var target = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Physical);
            if (target == null)
            {
                return;
            }

            var inCombo = CommonOrbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo;

            if (SMenu.Item(_MenuOffensiveItemBase + "Boolean.Bork").GetValue <bool>() && Items.HasItem(Structures.Items.Offensive.Botrk.Id))
            // If enabled and has item
            {
                if (Structures.Items.Offensive.Botrk.IsReady())
                {
                    if (
                        target.IsValidTarget(Player.AttackRange + Player.BoundingRadius) || Player.HealthPercent < SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp.Player").GetValue <Slider>().Value)
                    {
                        // In auto Range or about to die
                        if (SMenu.Item(_MenuOffensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() && inCombo &&
                            target.HealthPercent < SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MaxHp").GetValue <Slider>().Value
                            //in combo and target hp less then
                            ||
                            !SMenu.Item(_MenuOffensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() &&
                            target.HealthPercent < SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp").GetValue <Slider>().Value
                            //not in combo but target HP less then
                            ||
                            (Player.HealthPercent <
                             SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp.Player").GetValue <Slider>().Value))
                        //Player hp less then
                        {
                            Items.UseItem(Structures.Items.Offensive.Botrk.Id, target);
                            return;
                        }
                    }
                }
            }

            if (SMenu.Item(_MenuOffensiveItemBase + "Boolean.Bork").GetValue <bool>() && Items.HasItem(Structures.Items.Offensive.Cutless.Id))
            // If enabled and has item
            {
                if (Structures.Items.Offensive.Cutless.IsReady())
                {
                    if (
                        target.IsValidTarget(Player.AttackRange +
                                             Player.BoundingRadius) ||
                        Player.HealthPercent <
                        SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp.Player").GetValue <Slider>().Value)
                    {
                        // In auto Range or about to die
                        if (SMenu.Item(_MenuOffensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() && inCombo &&
                            target.HealthPercent <
                            SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MaxHp").GetValue <Slider>().Value
                            //in combo and target hp less then
                            ||
                            !SMenu.Item(_MenuOffensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() &&
                            target.HealthPercent <
                            SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp").GetValue <Slider>().Value
                            //not in combo but target HP less then
                            ||
                            (Player.HealthPercent <
                             SMenu.Item(_MenuOffensiveItemBase + "Slider.Bork.MinHp.Player").GetValue <Slider>().Value))
                        //Player hp less then
                        {
                            Items.UseItem(Structures.Items.Offensive.Cutless.Id, target);
                            return;
                        }
                    }
                }
            }

            if (SMenu.Item(_MenuOffensiveItemBase + "Boolean.Youmuu").GetValue <bool>() && Items.HasItem(Structures.Items.Offensive.GhostBlade.Id))
            // If enabled and has item
            {
                if (Structures.Items.Offensive.GhostBlade.IsReady() &&
                    target.IsValidTarget(Player.AttackRange + Player.BoundingRadius))
                // Is ready and target is in auto range
                {
                    if (inCombo)
                    {
                        Items.UseItem(Structures.Items.Offensive.GhostBlade.Id);
                        return;
                    }
                }
            }

            #endregion

            #region Defensive

            if (SMenu.Item(_MenuDefensiveItemBase + "Boolean.QSS").GetValue <bool>() && Items.HasItem(Structures.Items.Defensive.Qss.Id))
            {
                if (SMenu.Item(_MenuDefensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() && inCombo ||
                    !SMenu.Item(_MenuDefensiveItemBase + "Boolean.ComboOnly").GetValue <bool>())
                {
                    if (Structures.Items.Defensive.Qss.IsReady())
                    {
                        foreach (var buff in Bufftype.Where(buff => SMenu.Item(_MenuDefensiveItemBase + "Boolean.QSS." + buff).GetValue <bool>()))
                        {
                            if (Player.HasBuffOfType(buff))
                            {
                                LeagueSharp.Common.Utility.DelayAction.Add(SMenu.Item(_MenuDefensiveItemBase + "Slider.QSS.Delay").GetValue <Slider>().Value, () => Items.UseItem(Structures.Items.Defensive.Qss.Id));
                            }
                        }
                    }
                }
            }


            if (SMenu.Item(_MenuDefensiveItemBase + "Boolean.Merc").GetValue <bool>() && Items.HasItem(Structures.Items.Defensive.Merc.Id))
            {
                if (SMenu.Item(_MenuDefensiveItemBase + "Boolean.ComboOnly").GetValue <bool>() && inCombo ||
                    !SMenu.Item(_MenuDefensiveItemBase + "Boolean.ComboOnly").GetValue <bool>())
                {
                    if (Structures.Items.Defensive.Merc.IsReady())
                    {
                        foreach (var buff in Bufftype.Where(buff => SMenu.Item(_MenuDefensiveItemBase + "Boolean.Merc." + buff).GetValue <bool>()))
                        {
                            if (Player.HasBuffOfType(buff))
                            {
                                LeagueSharp.Common.Utility.DelayAction.Add(SMenu.Item(_MenuDefensiveItemBase + "Slider.Merc.Delay").GetValue <Slider>().Value, () => Items.UseItem(Structures.Items.Defensive.Qss.Id));
                            }
                        }
                    }
                }
            }

            #endregion
        }