This commit is contained in:
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Hustle.cs
Normal file
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Hustle.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user