PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Belch.cs

20 lines
533 B
C#
Raw Normal View History

2025-01-10 12:45:29 +00:00
using System.Linq;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Static;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
public class Belch : Script
{
/// <inheritdoc />
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
{
var battleData = choice.User.BattleData;
if (battleData == null)
return;
if (battleData.ConsumedItems.All(x => x.Category != ItemCategory.Berry))
prevent = true;
}
}