More moves
This commit is contained in:
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/PowerSwap.cs
Normal file
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/PowerSwap.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "power_swap")]
|
||||
public class PowerSwap : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user