Upload from upload_mods.ps1
This commit is contained in:
28
Scripts/Requirements/IsActionUnlocked.cs
Normal file
28
Scripts/Requirements/IsActionUnlocked.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using KFCommonUtilityLib;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsActionUnlocked : TargetedCompareRequirementBase
|
||||
{
|
||||
protected int actionIndex;
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
return base.IsValid(_params) &&
|
||||
((actionIndex == 0 ||
|
||||
(_params.ItemActionData?.invData?.actionData?[0] is IModuleContainerFor<ActionModuleAlternative.AlternativeData> alt
|
||||
&& alt.Instance.IsActionUnlocked(actionIndex))) ^ invert);
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
if (base.ParseXAttribute(_attribute))
|
||||
return true;
|
||||
|
||||
if (_attribute.Name == "index")
|
||||
{
|
||||
actionIndex = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user