Surprisingly, more moves
This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/PsychUp.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/PsychUp.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "psych_up")]
|
||||
public class PsychUp : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var targetStats = target.StatBoost;
|
||||
var userStats = move.User.StatBoost;
|
||||
foreach (Statistic stat in Enum.GetValues(typeof(Statistic)))
|
||||
{
|
||||
var targetStat = targetStats.GetStatistic(stat);
|
||||
var userStat = userStats.GetStatistic(stat);
|
||||
if (targetStat != userStat)
|
||||
{
|
||||
userStats.SetStatistic(stat, targetStat);
|
||||
}
|
||||
}
|
||||
move.User.RecalculateBoostedStats();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user