Support for Bide

This commit is contained in:
2025-01-11 14:08:04 +01:00
parent ecdc9c7654
commit 83b316ad53
6 changed files with 160 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Dynamic.ScriptHandling.Registry;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "bestow")]
public class Bestow : Script
{
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var user = move.User;
var userHeldItem = user.HeldItem;
var targetHeldItem = target.HeldItem;
if (userHeldItem == null || targetHeldItem != null)
{
move.GetHitData(target, hit).Fail();
return;
}
_ = target.SetHeldItem(userHeldItem);
}
}