Upload from upload_mods.ps1
This commit is contained in:
155
Scripts/Requirements/CVarCompareRebirth.cs
Normal file
155
Scripts/Requirements/CVarCompareRebirth.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class CVarCompareRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
protected static bool CompareValues(float _valueA, RequirementBase.OperationTypes _operation, float _valueB)
|
||||
{
|
||||
bool result = false; ;
|
||||
|
||||
switch (_operation)
|
||||
{
|
||||
case RequirementBase.OperationTypes.Equals:
|
||||
case RequirementBase.OperationTypes.EQ:
|
||||
case RequirementBase.OperationTypes.E:
|
||||
result = _valueA == _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") == _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
case RequirementBase.OperationTypes.NotEquals:
|
||||
case RequirementBase.OperationTypes.NEQ:
|
||||
case RequirementBase.OperationTypes.NE:
|
||||
result = _valueA != _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") != _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
case RequirementBase.OperationTypes.Less:
|
||||
case RequirementBase.OperationTypes.LessThan:
|
||||
case RequirementBase.OperationTypes.LT:
|
||||
result = _valueA < _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") < _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
case RequirementBase.OperationTypes.Greater:
|
||||
case RequirementBase.OperationTypes.GreaterThan:
|
||||
case RequirementBase.OperationTypes.GT:
|
||||
result = _valueA > _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") > _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
case RequirementBase.OperationTypes.LessOrEqual:
|
||||
case RequirementBase.OperationTypes.LessThanOrEqualTo:
|
||||
case RequirementBase.OperationTypes.LTE:
|
||||
result = _valueA <= _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") <= _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
case RequirementBase.OperationTypes.GreaterOrEqual:
|
||||
case RequirementBase.OperationTypes.GreaterThanOrEqualTo:
|
||||
case RequirementBase.OperationTypes.GTE:
|
||||
result = _valueA >= _valueB;
|
||||
//Log.Out("CVarCompareRebirth-CompareValues _valueA (" + _valueA + ") >= _valueB (" + _valueB + "): " + result);
|
||||
|
||||
return result;
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
//Log.Out("CVarCompareRebirth-IsValid fullValue: " + fullValue);
|
||||
|
||||
foreach (var requirement in fullValue.Split(','))
|
||||
{
|
||||
//Log.Out("CVarCompareRebirth-IsValid requirement: " + requirement);
|
||||
float value = 0;
|
||||
if (requirement.StartsWith("@"))
|
||||
{
|
||||
value = _params.Self.Buffs.GetCustomVar(this.refCvarName, 0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = float.Parse(requirement);
|
||||
}
|
||||
|
||||
//Log.Out("CVarCompareRebirth-IsValid value: " + value);
|
||||
|
||||
//Log.Out("CVarCompareRebirth-IsValid this.target.Buffs.GetCustomVar(cvarName): " + this.target.Buffs.GetCustomVar(cvarName));
|
||||
|
||||
bool result = CompareValues(this.target.Buffs.GetCustomVar(cvarName), this.operation, value);
|
||||
|
||||
//Log.Out("CVarCompareRebirth-IsValid result: " + result);
|
||||
|
||||
flag = flag || result;
|
||||
}
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !flag;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("cvar.{0} {1} {2}", this.cvarName, this.operation.ToStringCached<RequirementBase.OperationTypes>(), this.value.ToCultureInvariantString()));
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<RequirementBase.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "value")
|
||||
{
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.useCVar = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
fullValue = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "invert")
|
||||
{
|
||||
this.invert = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "target")
|
||||
{
|
||||
this.targetType = EnumUtils.Parse<TargetedCompareRequirementBase.TargetTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "cvar")
|
||||
{
|
||||
cvarName = _attribute.Value;
|
||||
cvarNameHash = cvarName.GetHashCode();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected string cvarName;
|
||||
protected int cvarNameHash;
|
||||
protected string fullValue;
|
||||
}
|
||||
44
Scripts/Requirements/CanAttackExecute.cs
Normal file
44
Scripts/Requirements/CanAttackExecute.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Audio;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class CanAttackExecute : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("CanAttackExecute-IsValid START");
|
||||
if (!base.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("CanAttackExecute-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = RebirthUtilities.CanAttackExecute(target);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("CanAttackExecute-IsValid 2, result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
//Log.Out("CanAttackExecute-IsValid 3, !result: " + !result);
|
||||
return !result;
|
||||
}
|
||||
|
||||
/*public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null && name == "buff")
|
||||
{
|
||||
this.buffName = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}*/
|
||||
|
||||
//private string buffName;
|
||||
}
|
||||
38
Scripts/Requirements/CanConsume.cs
Normal file
38
Scripts/Requirements/CanConsume.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
public class CanConsume : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool flag = true;
|
||||
|
||||
if (_params.ItemValue.ItemClass != null)
|
||||
{
|
||||
if (_params.ItemValue.ItemClass.HasAnyTags(FastTags<TagGroup.Global>.Parse("medical")))
|
||||
{
|
||||
global::EntityAlive holdingEntity = _params.ItemActionData.invData.holdingEntity;
|
||||
|
||||
string itemName = _params.ItemValue.ItemClass.GetItemName();
|
||||
|
||||
//Log.Out("CanConsume-IsValid itemName: " + itemName);
|
||||
|
||||
if (!RebirthUtilities.CanHeal(itemName, holdingEntity, holdingEntity))
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
171
Scripts/Requirements/CanIncreaseGeneticPerkRebirth.cs
Normal file
171
Scripts/Requirements/CanIncreaseGeneticPerkRebirth.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class CanIncreaseGeneticPerkRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !flag;
|
||||
}
|
||||
|
||||
EntityPlayer primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
float hasShades = 0;
|
||||
float lvlGenetics = 0;
|
||||
float lvlPerk = 0;
|
||||
|
||||
hasShades = 0;
|
||||
if (RebirthUtilities.HasEquippedItem(primaryPlayer as EntityPlayerLocal, shadeName))
|
||||
{
|
||||
hasShades = 1;
|
||||
}
|
||||
lvlGenetics = RebirthVariables.localConstants["$varFuriousRamsay" + geneticName + "Lvl"];
|
||||
ProgressionValue perkProgressionValue = primaryPlayer.Progression.GetProgressionValue(perkName);
|
||||
lvlPerk = perkProgressionValue.Level;
|
||||
|
||||
/*Log.Out("CanIncreaseGeneticPerkRebirth-IsValid hasShades: " + hasShades);
|
||||
Log.Out("CanIncreaseGeneticPerkRebirth-IsValid lvlGenetics: " + lvlGenetics);
|
||||
Log.Out("CanIncreaseGeneticPerkRebirth-IsValid lvlPerk: " + lvlPerk);
|
||||
Log.Out("CanIncreaseGeneticPerkRebirth-IsValid perkIncrement: " + perkIncrement);*/
|
||||
|
||||
int maxLevel = perkProgressionValue.ProgressionClass.MaxLevel;
|
||||
|
||||
if (maxLevel < 10 || (perkName == "perkMeleeDamage" || perkName == "perkDodge"))
|
||||
{
|
||||
maxLevel = maxLevel - 1;
|
||||
}
|
||||
if (maxLevel == 10 && (perkName != "perkMeleeDamage" && perkName != "perkDodge"))
|
||||
{
|
||||
maxLevel = maxLevel - 2;
|
||||
}
|
||||
|
||||
if (perkProgressionValue.Level >= maxLevel)
|
||||
{
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttMaxLevelReached").Replace("{perkName}", Localization.Get(perkName + "Name")), string.Empty, "ui_denied", null);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hasShades > 0)
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 1");
|
||||
if (lvlGenetics >= (lvlPerk * perkIncrement) + perkIncrement)
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 2");
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 3");
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("tt" + geneticName + "Low"), string.Empty, "ui_denied", null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 4");
|
||||
if (lvlGenetics >= (lvlPerk * perkIncrement) + perkIncrement)
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 5");
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanIncreaseGeneticPerkRebirth-IsValid 6");
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("tt" + geneticName + "Low"), string.Empty, "ui_denied", null);
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("cvar.{0} {1} {2}", this.cvarName, this.operation.ToStringCached<RequirementBase.OperationTypes>(), this.value.ToCultureInvariantString()));
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<RequirementBase.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "value")
|
||||
{
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.useCVar = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
fullValue = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "invert")
|
||||
{
|
||||
this.invert = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "target")
|
||||
{
|
||||
this.targetType = EnumUtils.Parse<TargetedCompareRequirementBase.TargetTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "cvar")
|
||||
{
|
||||
cvarName = _attribute.Value;
|
||||
cvarNameHash = cvarName.GetHashCode();
|
||||
return true;
|
||||
}
|
||||
else if (localName == "perkColor")
|
||||
{
|
||||
perkColor = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "perkName")
|
||||
{
|
||||
perkName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "geneticName")
|
||||
{
|
||||
geneticName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "shadeName")
|
||||
{
|
||||
shadeName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "perkIncrement")
|
||||
{
|
||||
perkIncrement = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected string geneticName;
|
||||
protected string perkName;
|
||||
protected string cvarName;
|
||||
protected string perkColor;
|
||||
protected string shadeName;
|
||||
protected int cvarNameHash;
|
||||
protected int perkIncrement;
|
||||
protected string fullValue;
|
||||
}
|
||||
49
Scripts/Requirements/CannotShapeCopyRotate.cs
Normal file
49
Scripts/Requirements/CannotShapeCopyRotate.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
public class CannotShapeCopyRotate : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("CannotShapeCopyRotate-IsValid START");
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
//Log.Out("CannotShapeCopyRotate-IsValid INVALID");
|
||||
return false;
|
||||
}
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool flag = true;
|
||||
|
||||
if (_params.Self.inventory.holdingItemItemValue.ItemClass is ItemClassBlock && _params.Self.inventory.holdingItemItemValue.ItemClass.GetItemName().ToLower().Contains("shapes:"))
|
||||
{
|
||||
//Log.Out("CannotShapeCopyRotate-IsValid CAN COPY AND ROTATE");
|
||||
/*if (_params.Self is EntityPlayerLocal player)
|
||||
{
|
||||
BlockValue blockValue = player.HitInfo.hit.blockValue;
|
||||
|
||||
if (blockValue.ischild)
|
||||
{
|
||||
blockValue = player.world.GetBlock(blockValue.Block.multiBlockPos.GetParentPos(player.HitInfo.hit.blockPos, blockValue));
|
||||
}
|
||||
|
||||
if (blockValue.Block.shape != null)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}*/
|
||||
flag = false;
|
||||
}
|
||||
|
||||
//Log.Out("CannotShapeCopyRotate-IsValid false: " + false);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
43
Scripts/Requirements/CheckDismemberChance.cs
Normal file
43
Scripts/Requirements/CheckDismemberChance.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class CheckDismemberChance : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("CheckDismemberChance-IsValid START");
|
||||
if (!base.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("CheckDismemberChance-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
|
||||
string itemName = this.target.inventory.holdingItem.Name;
|
||||
|
||||
//Log.Out("CheckDismemberChance-IsValid itemName: " + itemName);
|
||||
|
||||
ItemClass itemClass = ItemClass.GetItem(itemName, false).ItemClass;
|
||||
|
||||
List<string> tagNames = itemClass.ItemTags.GetTagNames();
|
||||
|
||||
ItemValue itemRanged = ItemClass.GetItem(itemClass.GetItemName(), false);
|
||||
|
||||
ItemActionRanged myAction = (ItemActionRanged)itemClass.Actions[0];
|
||||
ItemActionData _actionData = this.target.inventory.holdingItemData.actionData[0];
|
||||
ItemActionRanged.ItemActionDataRanged itemActionDataRanged = (ItemActionRanged.ItemActionDataRanged)_actionData;
|
||||
|
||||
float myDelay = 60f / EffectManager.GetValue(PassiveEffects.RoundsPerMinute, itemActionDataRanged.invData.itemValue, 60f / itemActionDataRanged.OriginalDelay, this.target);
|
||||
|
||||
//Log.Out("CheckDismemberChance-IsValid myDelay: " + myDelay);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("CheckDismemberChance-IsValid 2, result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
//Log.Out("CheckDismemberChance-IsValid 3, result: " + !result);
|
||||
return !result;
|
||||
}
|
||||
}
|
||||
19
Scripts/Requirements/DayRebirth.cs
Normal file
19
Scripts/Requirements/DayRebirth.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
public class DayRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ulong worldTime = GameManager.Instance.World.worldTime;
|
||||
ValueTuple<int, int, int> valueTuple = GameUtils.WorldTimeToElements(worldTime);
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !RequirementBase.compareValues(valueTuple.Item1, this.operation, (int)this.value);
|
||||
}
|
||||
return RequirementBase.compareValues(valueTuple.Item1, this.operation, (int)this.value);
|
||||
}
|
||||
}
|
||||
77
Scripts/Requirements/GeneticsCompareRebirth.cs
Normal file
77
Scripts/Requirements/GeneticsCompareRebirth.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class GeneticsCompareRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int level = (int)RebirthVariables.localVariables["$varFuriousRamsay" + genetic + "PercUnit"];
|
||||
|
||||
//Log.Out("GeneticsCompareRebirth-IsValid level: " + level);
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !RequirementBase.compareValues(level, this.operation, this.value);
|
||||
}
|
||||
return RequirementBase.compareValues(level, this.operation, this.value);
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
|
||||
|
||||
list.Add(string.Format("cvar.{0} {1} {2}", genetic, this.operation.ToStringCached<RequirementBase.OperationTypes>(), this.value.ToCultureInvariantString()));
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "operation")
|
||||
{
|
||||
this.operation = EnumUtils.Parse<RequirementBase.OperationTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "value")
|
||||
{
|
||||
if (_attribute.Value.StartsWith("@"))
|
||||
{
|
||||
this.useCVar = true;
|
||||
this.refCvarName = _attribute.Value.Substring(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = StringParsers.ParseFloat(_attribute.Value, 0, -1, NumberStyles.Any);
|
||||
}
|
||||
fullValue = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "invert")
|
||||
{
|
||||
this.invert = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "target")
|
||||
{
|
||||
this.targetType = EnumUtils.Parse<TargetedCompareRequirementBase.TargetTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (localName == "genetic")
|
||||
{
|
||||
genetic = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected string genetic;
|
||||
protected string fullValue;
|
||||
}
|
||||
26
Scripts/Requirements/HNPOn.cs
Normal file
26
Scripts/Requirements/HNPOn.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
public class HNPOn : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
bool optionHNP = RebirthVariables.customHordeNight;
|
||||
if (optionHNP)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
28
Scripts/Requirements/HNPTurboOn.cs
Normal file
28
Scripts/Requirements/HNPTurboOn.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
public class HNPTurboOn : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
bool optionHNP = RebirthVariables.customHordeNight;
|
||||
bool optionHNPTurbo = RebirthVariables.customHordeNightTurbo;
|
||||
|
||||
if (optionHNP && optionHNPTurbo)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
35
Scripts/Requirements/HasBonus.cs
Normal file
35
Scripts/Requirements/HasBonus.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class HasBonus : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("HasBonus-IsValid START");
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool flag = false;
|
||||
|
||||
ItemValue itemValue = _params.ItemValue;
|
||||
|
||||
if (itemValue != null && itemValue.ItemClass != null)
|
||||
{
|
||||
if (itemValue != null &&
|
||||
itemValue.HasMetadata("bonus") &&
|
||||
itemValue.HasMetadata("level") &&
|
||||
itemValue.HasMetadata("type") &&
|
||||
itemValue.HasMetadata("active"))
|
||||
{
|
||||
if ((int)itemValue.GetMetadata("active") > 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
60
Scripts/Requirements/HasBonusSpecific.cs
Normal file
60
Scripts/Requirements/HasBonusSpecific.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Globalization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class HasBonusSpecific : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("HasBonusSpecific-IsValid START");
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool flag = false;
|
||||
|
||||
ItemValue itemValue = _params.ItemValue;
|
||||
|
||||
if (itemValue != null && itemValue.ItemClass != null)
|
||||
{
|
||||
if (itemValue != null &&
|
||||
itemValue.HasMetadata("bonus") &&
|
||||
itemValue.HasMetadata("level") &&
|
||||
itemValue.HasMetadata("type") &&
|
||||
itemValue.HasMetadata("active"))
|
||||
{
|
||||
if (bonus == (string)itemValue.GetMetadata("bonus") &&
|
||||
level == (int)itemValue.GetMetadata("level"))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "bonus")
|
||||
{
|
||||
bonus = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else if (localName == "level")
|
||||
{
|
||||
level = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected string bonus;
|
||||
protected int level;
|
||||
}
|
||||
62
Scripts/Requirements/HasBuffLike.cs
Normal file
62
Scripts/Requirements/HasBuffLike.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class HasBuffLike : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("HasBuffLike-IsValid START");
|
||||
if (!base.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("HasBuffLike-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
|
||||
//Log.Out("HasBuffLike-IsValid this.buffName: " + this.buffName);
|
||||
|
||||
var buffs = this.buffName.Split(',');
|
||||
for (int x = 0; x < buffs.Length; x++)
|
||||
{
|
||||
//Log.Out("HasBuffLike-IsValid buffs[x]: " + buffs[x]);
|
||||
if (RebirthUtilities.HasBuffLike(this.target, buffs[x]))
|
||||
{
|
||||
//Log.Out("HasBuffLike-IsValid IS LIKE");
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("HasBuffLike-IsValid 2, result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
//Log.Out("HasBuffLike-IsValid 3, result: " + !result);
|
||||
return !result;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null && name == "buff")
|
||||
{
|
||||
this.buffName = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("Target does {0}have buff '{1}'", this.invert ? "NOT " : "", this.buffName));
|
||||
}
|
||||
|
||||
private string buffName;
|
||||
}
|
||||
61
Scripts/Requirements/HasBuffRebirth.cs
Normal file
61
Scripts/Requirements/HasBuffRebirth.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class HasBuffRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("HasBuffRebirth-IsValid START");
|
||||
if (!base.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("HasBuffRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
|
||||
//Log.Out("HasBuffRebirth-IsValid this.buffName: " + this.buffName);
|
||||
|
||||
var buffs = this.buffName.Split(',');
|
||||
for (int x = 0; x < buffs.Length; x++)
|
||||
{
|
||||
//Log.Out("HasBuffRebirth-IsValid buffs[x]: " + buffs[x]);
|
||||
if (this.target.Buffs.HasBuff(buffs[x]))
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("HasBuffRebirth-IsValid 2, result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
//Log.Out("HasBuffRebirth-IsValid 3, result: " + !result);
|
||||
return !result;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null && name == "buff")
|
||||
{
|
||||
this.buffName = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("Target does {0}have buff '{1}'", this.invert ? "NOT " : "", this.buffName));
|
||||
}
|
||||
|
||||
private string buffName;
|
||||
}
|
||||
41
Scripts/Requirements/HasBuffSDX.cs
Normal file
41
Scripts/Requirements/HasBuffSDX.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class HasBuffSDX : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("Entity Name: " + this.target.EntityName);
|
||||
return this.target.Buffs.HasBuff(this.buffName);
|
||||
}
|
||||
return !this.target.Buffs.HasBuff(this.buffName);
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null && name == "buff")
|
||||
{
|
||||
this.buffName = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("Target does {0}have buff '{1}'", this.invert ? "NOT " : "", this.buffName));
|
||||
}
|
||||
|
||||
private string buffName;
|
||||
}
|
||||
47
Scripts/Requirements/HasCurrentOrder.cs
Normal file
47
Scripts/Requirements/HasCurrentOrder.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class HasCurrentOrder : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAliveV2 entityAlive = this.target as EntityAliveV2;
|
||||
if (entityAlive == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasCurrentOrder = entityAlive.Buffs.GetCustomVar("CurrentOrder") == this.order;
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return HasCurrentOrder;
|
||||
}
|
||||
return !HasCurrentOrder;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "order")
|
||||
{
|
||||
this.order = int.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private int order;
|
||||
}
|
||||
66
Scripts/Requirements/IsAttachedToEntitySDX.cs
Normal file
66
Scripts/Requirements/IsAttachedToEntitySDX.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsAttachedToEntitySDX : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Entity vehicle;
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool hasTags = false;
|
||||
|
||||
bool attachedToEntity = me.AttachedToEntity != null;
|
||||
|
||||
if (attachedToEntity)
|
||||
{
|
||||
vehicle = me.AttachedToEntity;
|
||||
hasTags = vehicle.HasAnyTags(this.tagsToCompare);
|
||||
//Log.Out("IsAttachedToEntitySDX-hasTags (Vehicle): " + vehicle.EntityTags);
|
||||
}
|
||||
|
||||
//Log.Out("IsAttachedToEntitySDX-attachedToEntity: " + attachedToEntity);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return hasTags && attachedToEntity;
|
||||
}
|
||||
return (!hasTags && attachedToEntity);
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "tags")
|
||||
{
|
||||
this.tagsToCompare = FastTags<TagGroup.Global>.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (name != null && name == "target")
|
||||
{
|
||||
this.targetType = EnumUtils.Parse<TargetedCompareRequirementBase.TargetTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("Is {0}Attached To Entity", this.invert ? "NOT " : ""));
|
||||
}
|
||||
|
||||
private FastTags<TagGroup.Global> tagsToCompare;
|
||||
|
||||
}
|
||||
36
Scripts/Requirements/IsBlocked.cs
Normal file
36
Scripts/Requirements/IsBlocked.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
public class IsBlocked : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("IsBlocked-IsValid START");
|
||||
|
||||
if (_params == null)
|
||||
{
|
||||
//Log.Out("IsBlocked-IsValid NO PARAMETERS");
|
||||
}
|
||||
|
||||
if (_params.Self == null)
|
||||
{
|
||||
//Log.Out("IsBlocked-IsValid NO TARGET");
|
||||
}
|
||||
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool flag = false;
|
||||
|
||||
if (me.moveHelper.IsBlocked)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
//Log.Out("IsBlocked-IsValid flag: " + flag);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
67
Scripts/Requirements/IsClassAvailableRebirth.cs
Normal file
67
Scripts/Requirements/IsClassAvailableRebirth.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsClassAvailableRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("IsClassAvailableRebirth-IsValid START");
|
||||
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
//Log.Out("IsClassAvailableRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (RebirthUtilities.ScenarioSkip() || _params.Self.world.IsEditor() || GameUtils.IsWorldEditor())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
foreach (string classID in this.classID.Split(','))
|
||||
{
|
||||
flag = RebirthUtilities.IsClassActive(_params.Self, StringParsers.ParseFloat(classID));
|
||||
//Log.Out("IsClassAvailableRebirth-IsValid flag: " + flag);
|
||||
if (flag)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("IsClassAvailableRebirth-IsValid flag: " + flag);
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !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 == "perkName")
|
||||
{
|
||||
this.perkName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
if (name == "classID")
|
||||
{
|
||||
this.classID = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private string perkName;
|
||||
private string classID;
|
||||
}
|
||||
26
Scripts/Requirements/IsHired.cs
Normal file
26
Scripts/Requirements/IsHired.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class IsHired : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive entityAlive = this.target as EntityAlive;
|
||||
if (entityAlive == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isHired = entityAlive.Buffs.HasCustomVar("$Leader");
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return isHired;
|
||||
}
|
||||
return !isHired;
|
||||
}
|
||||
}
|
||||
21
Scripts/Requirements/IsInPOIRebirth.cs
Normal file
21
Scripts/Requirements/IsInPOIRebirth.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
public class IsInPOIRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool result = false;
|
||||
|
||||
result = RebirthUtilities.IsIndoors(me);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return !result;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
26
Scripts/Requirements/IsPlayerMale.cs
Normal file
26
Scripts/Requirements/IsPlayerMale.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
public class IsPlayerMale : TargetedCompareRequirementBase
|
||||
{
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive me = _params.Self;
|
||||
|
||||
bool flag = false;
|
||||
|
||||
if (me.EntityClass.entityClassName == "playerMale")
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
return !flag;
|
||||
}
|
||||
|
||||
}
|
||||
57
Scripts/Requirements/IsScenario.cs
Normal file
57
Scripts/Requirements/IsScenario.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsScenario : RequirementBase
|
||||
{
|
||||
public override bool ParamsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("IsScenario-IsValid START");
|
||||
|
||||
if (_params == null)
|
||||
{
|
||||
//Log.Out("IsScenario-IsValid NO PARAMETERS");
|
||||
}
|
||||
|
||||
if (_params.Self == null)
|
||||
{
|
||||
//Log.Out("IsScenario-IsValid NO TARGET");
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
//Log.Out("IsScenario-IsValid scenario: " + scenario);
|
||||
//Log.Out("IsScenario-IsValid RebirthVariables.customScenario: " + RebirthVariables.customScenario);
|
||||
|
||||
if (scenario.ToLower() == RebirthVariables.customScenario.ToLower())
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
//Log.Out("IsScenario-IsValid this.invert: " + this.invert);
|
||||
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("IsScenario-IsValid flag: " + flag);
|
||||
return flag;
|
||||
}
|
||||
|
||||
//Log.Out("IsScenario-IsValid !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 && name == "scenario")
|
||||
{
|
||||
this.scenario = _attribute.Value.ToLower();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private string scenario;
|
||||
}
|
||||
25
Scripts/Requirements/IsSleeping.cs
Normal file
25
Scripts/Requirements/IsSleeping.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class IsSleeping : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityAlive entityAlive = this.target as EntityAlive;
|
||||
if (entityAlive == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Log.Out("IsSleeping entityAlive.IsSleeping: " + entityAlive.IsSleeping);
|
||||
if (!this.invert)
|
||||
{
|
||||
return entityAlive.IsSleeping;
|
||||
}
|
||||
return !entityAlive.IsSleeping;
|
||||
}
|
||||
}
|
||||
36
Scripts/Requirements/IsWeaponAvailableRebirth.cs
Normal file
36
Scripts/Requirements/IsWeaponAvailableRebirth.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class IsWeaponAvailableRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
//Log.Out("IsWeaponAvailableRebirth-IsValid 0");
|
||||
return false;
|
||||
}
|
||||
|
||||
return RebirthUtilities.IsWeaponAvailable(_params.Self, float.Parse(classID));
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "classID")
|
||||
{
|
||||
this.classID = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private string perkName;
|
||||
private string classID;
|
||||
}
|
||||
60
Scripts/Requirements/NPCs/CanMindControl.cs
Normal file
60
Scripts/Requirements/NPCs/CanMindControl.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
public class CanMindControl : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_params.Self is EntityAliveV2)
|
||||
{
|
||||
EntityAliveV2 entitySource = _params.Self as EntityAliveV2;
|
||||
|
||||
if (entitySource.LeaderUtils.Owner)
|
||||
{
|
||||
ProgressionValue progressionValue = entitySource.LeaderUtils.Owner.Progression.GetProgressionValue("FuriousRamsayPerkBlackMagic");
|
||||
int progressionLevel = progressionValue.Level;
|
||||
|
||||
if (this.value == 1)
|
||||
{
|
||||
if (progressionLevel < 4)
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 1");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 1b");
|
||||
}
|
||||
}
|
||||
else if (this.value == 2)
|
||||
{
|
||||
if (progressionLevel >= 4 && progressionLevel < 7)
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 2");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 2b");
|
||||
}
|
||||
}
|
||||
else if (this.value == 3)
|
||||
{
|
||||
if (progressionLevel >= 7)
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 3");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("CanMindControl-IsValid 3b");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
29
Scripts/Requirements/NPCs/HasLeaderRebirth.cs
Normal file
29
Scripts/Requirements/NPCs/HasLeaderRebirth.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
public class HasLeaderRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("HasLeaderRebirth-IsValid START");
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("HasLeaderRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
var entity = _params.Self as EntityAliveV2;
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
//Log.Out("HasLeaderRebirth-IsValid entity: " + entity.EntityClass.entityClassName);
|
||||
foreach (RebirthManager.hireInfo hire in RebirthManager.playerHires)
|
||||
{
|
||||
if (hire.hireID == entity.entityId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
14
Scripts/Requirements/NPCs/IsLeaderRebirth.cs
Normal file
14
Scripts/Requirements/NPCs/IsLeaderRebirth.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
public class IsLeaderRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("IsLeaderRebirth-IsValid START");
|
||||
if (!this.ParamsValid(_params))
|
||||
{
|
||||
//Log.Out("IsLeaderRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
|
||||
return (int)_params.Self.Buffs.GetCustomVar("$Leader") == this.target.entityId;
|
||||
}
|
||||
}
|
||||
95
Scripts/Requirements/PlayerLevelRebirth.cs
Normal file
95
Scripts/Requirements/PlayerLevelRebirth.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class PlayerLevelRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.target.Progression == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int level = this.target.Progression.GetLevel();
|
||||
|
||||
if (this.useCVar && this.refCvarName.EndsWith("_Cst"))
|
||||
{
|
||||
this.value = RebirthVariables.localConstants[this.refCvarName];
|
||||
//Log.Out("PlayerLevelRebirth-IsValid this.value: " + this.value);
|
||||
}
|
||||
|
||||
bool flag = RequirementBase.compareValues((float)level, this.operation, this.value);
|
||||
|
||||
if (this.invert)
|
||||
{
|
||||
return !flag;
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
EntityPlayer primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
switch (keyName)
|
||||
{
|
||||
case null:
|
||||
return flag;
|
||||
case "GTLevel15":
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttGTLevel15"), string.Empty, "ui_denied", null);
|
||||
return flag;
|
||||
case "GTLevel30":
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttGTLevel30"), string.Empty, "ui_denied", null);
|
||||
return flag;
|
||||
case "GTLevel45":
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttGTLevel45"), string.Empty, "ui_denied", null);
|
||||
return flag;
|
||||
case "GTLevel60":
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttGTLevel60"), string.Empty, "ui_denied", null);
|
||||
return flag;
|
||||
case "GTLevel75":
|
||||
GameManager.ShowTooltip(primaryPlayer as EntityPlayerLocal, Localization.Get("ttGTLevel75"), string.Empty, "ui_denied", null);
|
||||
return flag;
|
||||
default:
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
list.Add(string.Format("Player level {0} {1} {2}", this.invert ? "NOT" : "", this.operation.ToStringCached<RequirementBase.OperationTypes>(), this.value.ToCultureInvariantString()));
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "target")
|
||||
{
|
||||
this.targetType = EnumUtils.Parse<TargetedCompareRequirementBase.TargetTypes>(_attribute.Value, true);
|
||||
return true;
|
||||
}
|
||||
else if (name == "key")
|
||||
{
|
||||
keyName = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected string keyName;
|
||||
}
|
||||
15
Scripts/Requirements/RequirementGore.cs
Normal file
15
Scripts/Requirements/RequirementGore.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
public class RequirementGore : RequirementBase
|
||||
{
|
||||
public override bool ParamsValid(MinEventParams _params)
|
||||
{
|
||||
string optionGore = RebirthVariables.customGore;
|
||||
bool isSinglePlayer = SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer;
|
||||
|
||||
if (isSinglePlayer && optionGore == "bloodsplatter")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
161
Scripts/Requirements/RequirementIsBetweenTimesRebirth.cs
Normal file
161
Scripts/Requirements/RequirementIsBetweenTimesRebirth.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class RequirementIsBetweenTimesRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
string strValue = "";
|
||||
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ulong worldTime = GameManager.Instance.World.worldTime;
|
||||
ValueTuple<int, int, int> valueTuple = GameUtils.WorldTimeToElements(worldTime);
|
||||
|
||||
int hour = valueTuple.Item2;
|
||||
int minutes = valueTuple.Item3;
|
||||
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour: " + hour);
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, minutes: " + minutes);
|
||||
|
||||
string[] array = strValue.Split(new char[]
|
||||
{
|
||||
','
|
||||
});
|
||||
|
||||
int numHour1 = 0;
|
||||
int numMinutes1 = 0;
|
||||
int numHour2 = 0;
|
||||
int numMinutes2 = 0;
|
||||
|
||||
bool bOutside = false;
|
||||
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
numHour1 = Int16.Parse(array[0]);
|
||||
}
|
||||
if (i == 1)
|
||||
{
|
||||
numMinutes1 = Int16.Parse(array[1]);
|
||||
}
|
||||
if (i == 2)
|
||||
{
|
||||
numHour2 = Int16.Parse(array[2]);
|
||||
}
|
||||
if (i == 3)
|
||||
{
|
||||
numMinutes2 = Int16.Parse(array[3]);
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numHour1: " + numHour1);
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numMinutes1: " + numMinutes1);
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numHour2: " + numHour2);
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numMinutes2: " + numMinutes2);
|
||||
|
||||
if (numHour1 > numHour2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numHour2 > numHour1");
|
||||
bOutside = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((numHour1 == numHour2))
|
||||
{
|
||||
if (numMinutes1 > numMinutes2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, numMinutes1 > numMinutes2");
|
||||
bOutside = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
|
||||
if (!bOutside)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, NOT bOutside");
|
||||
if (numHour1 < hour && hour < numHour2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour > numHour1 && hour < numHour2");
|
||||
flag = true;
|
||||
}
|
||||
else if (hour == numHour1 && hour == numHour2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour1 && hour == numHour2");
|
||||
if (minutes >= numMinutes1 && minutes <= numMinutes2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, minutes >= numMinutes1 && minutes <= numMinutes2");
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else if (hour == numHour1 && minutes >= numMinutes1)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour1 && minutes >= numMinutes1");
|
||||
flag = true;
|
||||
}
|
||||
else if (hour == numHour2 && minutes <= numMinutes2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour2 && minutes <= numMinutes2");
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, bOutside");
|
||||
if (hour > numHour1 || hour < numHour2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour < numHour1 || hour > numHour2");
|
||||
flag = true;
|
||||
}
|
||||
else if (hour == numHour1 && hour == numHour2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour1 && hour == numHour2");
|
||||
if (minutes <= numMinutes2 || minutes >= numMinutes1)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, minutes <= numMinutes2 || minutes >= numMinutes1");
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else if (hour == numHour1 && minutes >= numMinutes1)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour1 && minutes >= numMinutes1");
|
||||
flag = true;
|
||||
}
|
||||
else if (hour == numHour2 && minutes <= numMinutes2)
|
||||
{
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, hour == numHour2 && minutes <= numMinutes2");
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Log.Out("RequirementIsBetweenTimesRebirth-IsValid, flag: " + flag);
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
var flag = base.ParseXAttribute(_attribute);
|
||||
if (flag) return true;
|
||||
var name = _attribute.Name;
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
else if (name == "Value")
|
||||
{
|
||||
strValue = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Scripts/Requirements/RequirementIsBloodMoon.cs
Normal file
7
Scripts/Requirements/RequirementIsBloodMoon.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
public class IsBloodMoon : RequirementBase
|
||||
{
|
||||
public override bool ParamsValid(MinEventParams _params)
|
||||
{
|
||||
return RebirthVariables.isHordeNight;
|
||||
}
|
||||
}
|
||||
8
Scripts/Requirements/RequirementIsntBloodMoon.cs
Normal file
8
Scripts/Requirements/RequirementIsntBloodMoon.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
public class IsntBloodMoon : RequirementBase
|
||||
{
|
||||
public override bool ParamsValid(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("RequirementIsntBloodMoon-ParamsValid RebirthVariables.isHordeNight: " + RebirthVariables.isHordeNight);
|
||||
return !RebirthVariables.isHordeNight;
|
||||
}
|
||||
}
|
||||
66
Scripts/Requirements/TriggerHasTagsRebirth.cs
Normal file
66
Scripts/Requirements/TriggerHasTagsRebirth.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class TriggerHasTagsRebirth : TargetedCompareRequirementBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
/*Log.Out("TriggerHasTagsRebirth-IsValid this.currentItemTags: " + this.currentItemTags);
|
||||
Log.Out("TriggerHasTagsRebirth-IsValid _params.Tags: " + _params.Tags);
|
||||
Log.Out("TriggerHasTagsRebirth-IsValid _params.BlockValue.Block.Tags: " + _params.BlockValue.Block.Tags);*/
|
||||
|
||||
if (!base.IsValid(_params))
|
||||
{
|
||||
//Log.Out("TriggerHasTagsRebirth-IsValid 1");
|
||||
return false;
|
||||
}
|
||||
bool flag;
|
||||
if (!this.hasAllTags)
|
||||
{
|
||||
//Log.Out("TriggerHasTagsRebirth-IsValid 2");
|
||||
flag = _params.BlockValue.Block.Tags.Test_AnySet(this.currentItemTags);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("TriggerHasTagsRebirth-IsValid 3");
|
||||
flag = _params.BlockValue.Block.Tags.Test_AllSet(this.currentItemTags);
|
||||
}
|
||||
if (!this.invert)
|
||||
{
|
||||
//Log.Out("TriggerHasTagsRebirth-IsValid 4 flag: " + flag);
|
||||
return flag;
|
||||
}
|
||||
//Log.Out("TriggerHasTagsRebirth-IsValid 5 flag: " + flag);
|
||||
return !flag;
|
||||
}
|
||||
|
||||
public override void GetInfoStrings(ref List<string> list)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ParseXAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string name = _attribute.Name.LocalName;
|
||||
if (name != null)
|
||||
{
|
||||
if (name == "tags")
|
||||
{
|
||||
this.currentItemTags = FastTags<TagGroup.Global>.Parse(_attribute.Value);
|
||||
return true;
|
||||
}
|
||||
if (name == "has_all_tags")
|
||||
{
|
||||
this.hasAllTags = StringParsers.ParseBool(_attribute.Value, 0, -1, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private FastTags<TagGroup.Global> currentItemTags;
|
||||
private bool hasAllTags;
|
||||
}
|
||||
13
Scripts/Requirements/ZombieParticlesEnabled.cs
Normal file
13
Scripts/Requirements/ZombieParticlesEnabled.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
public class ZombieParticlesEnabled : RequirementBase
|
||||
{
|
||||
public override bool ParamsValid(MinEventParams _params)
|
||||
{
|
||||
string optionZombieParticles = RebirthVariables.customZombieParticles;
|
||||
bool isHordeNight = RebirthUtilities.IsHordeNight();
|
||||
|
||||
bool flag = optionZombieParticles == "on";
|
||||
bool flag2 = optionZombieParticles == "nohordenight" && !isHordeNight;
|
||||
|
||||
return flag || flag2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user