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,33 @@
using System.Linq;
public class DialogRequirementHasCurrentOrder : BaseDialogRequirement
{
public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo)
{
EntityAliveV2 myEntity = (EntityAliveV2)talkingTo;
if (myEntity != null)
{
// Split the Value string by commas, parse each part to an integer, and create a list
var values = Value.Split(',')
.Select(v => int.Parse(v.Trim()))
.ToList();
// Get the CurrentOrder from myEntity
int currentOrder = (int)myEntity.Buffs.GetCustomVar("CurrentOrder");
// Check if CurrentOrder is one of the values
if (values.Contains(currentOrder))
{
//Log.Out("DialogRequirementHasCurrentOrder-CheckRequirement true");
return true;
}
}
//Log.Out("DialogRequirementHasCurrentOrder-CheckRequirement false");
return false;
}
}