Upload from upload_mods.ps1
This commit is contained in:
67
Scripts/Requirements/IsOptionValidRebirth.cs
Normal file
67
Scripts/Requirements/IsOptionValidRebirth.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsOptionValidRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("IsOptionValidRebirth-IsValid this.optionType: " + this.optionType);
|
||||
//Log.Out("IsOptionValidRebirth-IsValid this.optionName: " + this.optionName);
|
||||
//Log.Out("IsOptionValidRebirth-IsValid this.optionValue: " + this.optionValue);
|
||||
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
//Log.Out("IsOptionValidRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
bool flag = RebirthUtilities.IsOptionAvailable(this.optionType, this.optionName, this.optionValue);
|
||||
|
||||
if (GameUtils.IsPlaytesting())
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
|
||||
//Log.Out("IsOptionValidRebirth-IsValid BEFORE flag: " + flag);
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
//Log.Out("IsOptionValidRebirth-IsValid INVERTED");
|
||||
return !flag;
|
||||
}
|
||||
|
||||
//Log.Out("IsOptionValidRebirth-IsValid AFTER flag: " + flag);
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "option_type")
|
||||
{
|
||||
this.optionType = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
if (name == "option_name")
|
||||
{
|
||||
this.optionName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (name == "option_value")
|
||||
{
|
||||
this.optionValue = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private string optionType;
|
||||
private string optionName;
|
||||
private string optionValue;
|
||||
}
|
||||
Reference in New Issue
Block a user