using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "round")]
public class Round : Script
{
///
public override void OnAfterMove(IExecutingMove move)
{
var choiceQueue = move.Battle.ChoiceQueue;
if (choiceQueue is null)
{
return;
}
var otherRoundMoves = choiceQueue.Where(x => x is IMoveChoice mc && mc.ChosenMove.MoveData.Name == "round")
.Cast().ToList();
// We reverse the order here, as we're constantly pushing the choices to the front of the queue.
// By reversing the order, we ensure that the first choice is the one that is up next.
foreach (var otherRoundMove in otherRoundMoves.AsEnumerable().Reverse())
{
otherRoundMove.Volatile.Add(new RoundPowerBoost());
choiceQueue.MovePokemonChoiceNext(otherRoundMove.User);
}
}
}