using PkmnLib.Dynamic.Models; using PkmnLib.Dynamic.ScriptHandling; using PkmnLib.Dynamic.ScriptHandling.Registry; namespace PkmnLib.Plugin.Gen7.Moves; /// /// The user helps the target and makes it use its move right after the user. /// /// /// The target will move next on the current turn, ignoring priority. After You bypasses accuracy checks to always hit, /// unless the target is in the semi-invulnerable turn of a move such as Dig or Fly. It fails if the target has already /// moved on the same turn. After You ignores the effects of Quash. /// After You fails if the order remains the same after using After You. /// [Script(ScriptCategory.Move, "after_you")] public class AfterYou : Script { /// public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) { var queue = move.User.BattleData!.Battle.ChoiceQueue; if (queue == null) return; // If the queue doesn't change, the move fails if (!queue.MovePokemonChoiceNext(target)) { move.GetHitData(target, hit).Fail(); } } }