namespace PkmnLib.Plugin.Gen7.Scripts.Moves; /// /// Implements the secondary effect of Parting Shot, which lowers the target's Attack and Special Attack by one stage each, /// then forces the user to switch out if at least one stat change was successful. /// [Script(ScriptCategory.Move, "parting_shot")] public class PartingShot : Script { /// public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) { var battleData = move.User.BattleData; if (battleData == null) return; var evtBatch = new EventBatchId(); var attackChanged = target.ChangeStatBoost(Statistic.Attack, -1, false, evtBatch); var specialAttackChanged = target.ChangeStatBoost(Statistic.SpecialAttack, -1, false, evtBatch); if (attackChanged || specialAttackChanged) { battleData.BattleSide.SwapPokemon(battleData.Position, null); } } }