Upload from upload_mods.ps1
This commit is contained in:
17
Scripts/Requirements/RoundsInHoldingItem.cs
Normal file
17
Scripts/Requirements/RoundsInHoldingItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using KFCommonUtilityLib.Scripts.StaticManagers;
|
||||
|
||||
public class RoundsInHoldingItem : RoundsInMagazineBase
|
||||
{
|
||||
public override bool IsValid(MinEventParams _params)
|
||||
{
|
||||
if (!ParamsValid(_params))
|
||||
return false;
|
||||
|
||||
ItemValue holdingItemValue = _params.Self.inventory.holdingItemItemValue;
|
||||
if (holdingItemValue.IsEmpty() || !(holdingItemValue.ItemClass.Actions[MultiActionManager.GetActionIndexForEntity(_params.Self)] is ItemActionRanged))
|
||||
return false;
|
||||
|
||||
return RequirementBase.compareValues((float)(roundsBeforeShot ? holdingItemValue.Meta + 1 : holdingItemValue.Meta), operation, value) ^ invert;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user