31 lines
635 B
C#
31 lines
635 B
C#
public class DialogRequirementPlayerHasCVarRebirth : BaseDialogRequirement
|
|
{
|
|
public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo)
|
|
{
|
|
|
|
if (string.IsNullOrEmpty(Value))
|
|
{
|
|
if (player.Buffs.HasCustomVar(ID))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
float.TryParse(Value, out var flValue);
|
|
|
|
if (player.Buffs.HasCustomVar(ID))
|
|
{
|
|
float numCVar = player.Buffs.GetCustomVar(ID);
|
|
|
|
if (numCVar == flValue)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|