Deukhoofd 4385f0afaa
All checks were successful
Build / Build (push) Successful in 50s
More abilities
2025-06-13 12:56:47 +02:00

25 lines
967 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Normalize is an ability that changes all moves used by the Pokémon to Normal type.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Normalize_(Ability)">Bulbapedia - Normalize</see>
/// </summary>
[Script(ScriptCategory.Ability, "normalize")]
public class Normalize : Script
{
/// <inheritdoc />
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit,
ref TypeIdentifier? typeIdentifier)
{
if (move.Battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("normal", out var normalType))
typeIdentifier = normalType;
}
/// <inheritdoc />
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.GetHitData(target, hit).Type?.Name == "normal")
basePower = (ushort)(basePower * 1.2f); // Boost Normal-type moves by 30%
}
}