Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/Dialog/DialogRequirementNotHasBuffRebirth.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

35 lines
818 B
C#

using System.Linq;
public class DialogRequirementNotHasBuffRebirth : BaseDialogRequirement
{
public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo)
{
var matches = -1;
// If there's more than one buff listed, loop around, recording how many we match.
string[] array = Value.Split(new char[]
{
','
});
if (Value.Contains(","))
{
matches = array.Count(t => player.Buffs.HasBuff(t));
if (matches > 0)
return false;
return true;
}
else
{
// If no operator, just check if we have it
if (!player.Buffs.HasBuff(Value))
{
return true;
}
}
return false;
}
}