Adds a lot more move effects
This commit is contained in:
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/BugBite.cs
Normal file
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/BugBite.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "bug_bite")]
|
||||
public class BugBite : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var user = move.User;
|
||||
var battleData = user.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var targetHeldItem = target.HeldItem;
|
||||
|
||||
if (targetHeldItem is not { Category: ItemCategory.Berry })
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
_ = target.SetHeldItem(null);
|
||||
targetHeldItem.RunItemScript(battleData.Battle.Library.ScriptResolver, user);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user