public bool HasDebuff(string debuff) { if (Debuffs == null || Debuffs.Count == 0) { return(false); } return(Debuffs.Any(i => i.Has(debuff))); }
public bool Tick() { Auras = GetAuras(); if (Auras == null || Auras.Length == 0) { return(false); } if (Buffs != null) { if (BuffsToKeepActive?.Count > 0) { foreach (KeyValuePair <string, CastFunction> keyValuePair in BuffsToKeepActive) { if (!Buffs.Any(e => e.SpellId != 0 && e.Name.Equals(keyValuePair.Key, StringComparison.OrdinalIgnoreCase)) && keyValuePair.Value()) { return(true); } } } if (Buffs.Length > 0 && DispellBuffs != null) { DispellBuffs(); } } if (Debuffs != null) { if (DebuffsToKeepActive?.Count > 0) { foreach (KeyValuePair <string, CastFunction> keyValuePair in DebuffsToKeepActive) { if (!Debuffs.Any(e => e.SpellId != 0 && e.Name.Equals(keyValuePair.Key, StringComparison.OrdinalIgnoreCase)) && keyValuePair.Value()) { return(true); } } } if (Debuffs.Length > 0 && DispellDebuffs != null) { // DispellDebuffs(); } } return(false); }
public bool Tick(bool forceUpdate = false) { if (DateTime.Now - LastBuffUpdate > MinUpdateTime || forceUpdate) { Buffs = GetBuffs(); Debuffs = GetDebuffs(); LastBuffUpdate = DateTime.Now; } if (BuffsToKeepActive?.Count > 0 && Buffs != null) { foreach (KeyValuePair <string, CastFunction> keyValuePair in BuffsToKeepActive) { if (!Buffs.Any(e => e.Equals(keyValuePair.Key, StringComparison.OrdinalIgnoreCase))) { if (keyValuePair.Value.Invoke()) { return(true); } } } } if (Buffs?.Count > 0 && DispellBuffs != null) { DispellBuffs.Invoke(); } if (DebuffsToKeepActive?.Count > 0 && Debuffs != null) { foreach (KeyValuePair <string, CastFunction> keyValuePair in DebuffsToKeepActive) { if (!Debuffs.Any(e => e.Equals(keyValuePair.Key, StringComparison.OrdinalIgnoreCase))) { if (keyValuePair.Value.Invoke()) { return(true); } } } } if (Debuffs?.Count > 0 && DispellDebuffs != null) { DispellDebuffs.Invoke(); } return(false); }