using PkmnLib.Static; namespace PkmnLib.Plugin.Gen7.Scripts.Moves; [Script(ScriptCategory.Move, "power_swap")] public class PowerSwap : Script { /// public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) { var user = move.User; var eventBatchId = new EventBatchId(); var userAttack = user.StatBoost.Attack; var targetAttack = target.StatBoost.Attack; var userSpecialAttack = user.StatBoost.SpecialAttack; var targetSpecialAttack = target.StatBoost.SpecialAttack; user.ChangeStatBoost(Statistic.Attack, (sbyte)(targetAttack - userAttack), true, eventBatchId); user.ChangeStatBoost(Statistic.SpecialAttack, (sbyte)(targetSpecialAttack - userSpecialAttack), true, eventBatchId); target.ChangeStatBoost(Statistic.Attack, (sbyte)(userAttack - targetAttack), true, eventBatchId); target.ChangeStatBoost(Statistic.SpecialAttack, (sbyte)(userSpecialAttack - targetSpecialAttack), true, eventBatchId); } }