Implements a bunch more moves

This commit is contained in:
2025-03-08 14:39:50 +01:00
parent 8f262cb4a6
commit 77f1ab243b
33 changed files with 935 additions and 57 deletions

View File

@@ -0,0 +1,41 @@
using PkmnLib.Plugin.Gen7.Scripts.Utils;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "ice_ball")]
public class IceBallEffect : Script
{
private readonly IPokemon _owner;
private readonly StringKey _moveName;
public int TurnCount { get; set; }
public IceBallEffect(IPokemon owner, StringKey moveName)
{
_owner = owner;
_moveName = moveName;
TurnCount = 0;
}
/// <inheritdoc />
public override void ForceTurnSelection(byte sideIndex, byte position, ref ITurnChoice? choice)
{
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
choice = TurnChoiceHelper.CreateMoveChoice(_owner, _moveName, opposingSideIndex, position);
}
/// <inheritdoc />
public override void OnMoveMiss(IExecutingMove move, IPokemon target)
{
RemoveSelf();
}
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
if (TurnCount < 5)
TurnCount++;
else
RemoveSelf();
}
}