Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:44:53 +09:30
commit f1fbbe67bb
1722 changed files with 165268 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
public class DialogRequirementPlayerHasItemRebirth : BaseDialogRequirement
{
public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo)
{
var count = 0;
if (string.IsNullOrEmpty(Value))
Value = "1";
float.TryParse(Value, out var flValue);
var uiforPlayer = LocalPlayerUI.GetUIForPlayer(player as EntityPlayerLocal);
var playerInventory = uiforPlayer.xui.PlayerInventory;
var item = ItemClass.GetItem(ID);
if (item != null)
{
count = playerInventory.Backpack.GetItemCount(item, -1, -1, false);
count += playerInventory.Toolbelt.GetItemCount(item, false, -1, -1);
if (flValue <= count)
return true;
}
return false;
}
}