Files
zzz_REBIRTH__Utils/Scripts/Requirements/HasBuffSDX.cs
2025-06-04 16:44:53 +09:30

42 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Xml.Linq;
public class HasBuffSDX : TargetedCompareRequirementBase
{
public override bool IsValid(MinEventParams _params)
{
if (!base.ParamsValid(_params))
{
return false;
}
if (!this.invert)
{
//Log.Out("Entity Name: " + this.target.EntityName);
return this.target.Buffs.HasBuff(this.buffName);
}
return !this.target.Buffs.HasBuff(this.buffName);
}
public override bool ParseXAttribute(XAttribute _attribute)
{
bool flag = base.ParseXAttribute(_attribute);
if (!flag)
{
string name = _attribute.Name.LocalName;
if (name != null && name == "buff")
{
this.buffName = _attribute.Value.ToLower();
return true;
}
}
return flag;
}
public override void GetInfoStrings(ref List<string> list)
{
list.Add(string.Format("Target does {0}have buff '{1}'", this.invert ? "NOT " : "", this.buffName));
}
private string buffName;
}