Implements a bunch more moves

This commit is contained in:
2025-03-08 14:39:50 +01:00
parent 8f262cb4a6
commit 77f1ab243b
33 changed files with 935 additions and 57 deletions

View File

@@ -0,0 +1,26 @@
using System;
using PkmnLib.Static;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "heart_swap")]
public class HeartSwap : Script
{
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
EventBatchId eventBatchId = new();
var userStats = move.User.StatBoost;
var targetStats = target.StatBoost;
foreach (Statistic stat in Enum.GetValues(typeof(Statistic)))
{
var userStat = userStats.GetStatistic(stat);
var targetStat = targetStats.GetStatistic(stat);
if (userStat == targetStat)
continue;
move.User.ChangeStatBoost(stat, (sbyte)(userStat - targetStat), true, eventBatchId);
target.ChangeStatBoost(stat, (sbyte)(targetStat - userStat), false, eventBatchId);
}
}
}