public void BuffUpdate() { for (int i = 0; i < Buffs.Count(); ++i) { Buffs[i].Duration--; if (Buffs[i].Duration == 0) { Buffs.Remove(Buffs[i]); } } }
/// <summary> /// Cleanses by BuffType on player /// </summary> private static void BuffTypeCleansing() { //MASSIVE TODO: Check if the buff is "stuns, roots, taunts, fears, silences and slows" before using Mikaels //Player Cleansing if (OneReady()) { var buffCount = Buffs.Count(buff => ObjectManager.Player.HasBuffOfType(buff) && BuffTypeEnabled(buff)); if (buffCount >= MenuHelper.GetSliderValue("com.idzlucian.cleanser.bufftype.minbuffs")) { CastCleanseItem(ObjectManager.Player); } } //Ally Cleansing if (!MichaelReady()) { return; } var allies = ObjectManager.Player.GetAlliesInRange(600f); var highestAlly = ObjectManager.Player; var highestCount = 0; foreach (var ally in allies) { var allyBCount = Buffs.Count(buff => ally.HasBuffOfType(buff) && BuffTypeEnabled(buff)); if (allyBCount > highestCount && allyBCount >= MenuHelper.GetSliderValue("com.idzlucian.cleanser.bufftype.minbuffs") && MenuHelper.IsMenuEnabled("com.idzlucian.cleanser.allies.useon." + ally.ChampionName)) { highestCount = allyBCount; highestAlly = ally; } } if (!highestAlly.IsMe) { CastCleanseItem(highestAlly); } }