Deukhoofd 1b9d137bb0
All checks were successful
Build / Build (push) Successful in 50s
Surprisingly, more abilities
2025-06-14 13:37:58 +02:00

32 lines
870 B
C#

using PkmnLib.Dynamic.BattleFlow;
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
public class SpotlightEffect : Script
{
private readonly byte _position;
private readonly IBattleSide _side;
public SpotlightEffect(IBattleSide side, byte position)
{
_side = side;
_position = position;
}
/// <inheritdoc />
public override void ChangeIncomingTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
{
if (!TargetResolver.IsValidTarget(_side.Index, _position, moveChoice.ChosenMove.MoveData.Target,
moveChoice.User))
return;
if (_side.Pokemon[_position] == null)
return;
targets = [_side.Pokemon[_position]!];
}
/// <inheritdoc />
public override void OnEndTurn(IScriptSource owner, IBattle battle)
{
RemoveSelf();
}
}