using PkmnLib.Static.Moves; namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Hustle is an ability that increases the Pokémon's Attack by 50% but lowers the accuracy of its physical moves. /// /// Bulbapedia - Hustle /// [Script(ScriptCategory.Ability, "hustle")] public class Hustle : Script, IScriptChangeOffensiveStatValue, IScriptChangeAccuracy { /// public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat, ImmutableStatisticSet targetStats, Statistic stat, ref uint value) { if (stat != Statistic.Attack) return; value = value.MultiplyOrMax(1.5f); } /// public void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy) { if (executingMove.UseMove.Category == MoveCategory.Physical) { modifiedAccuracy = (int)(modifiedAccuracy * 0.8f); } } }