More abilities
All checks were successful
Build / Build (push) Successful in 49s

This commit is contained in:
2025-06-09 15:24:37 +02:00
parent 074f92bfc0
commit 1579d46671
23 changed files with 480 additions and 41 deletions

View File

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