namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Parental Bond is an ability that allows the Pokémon to hit twice with most moves.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Parental_Bond_(Ability)">Bulbapedia - Parental Bond</see>
/// </summary>
[Script(ScriptCategory.Ability, "parental_bond")]
public class ParentalBond : Script, IScriptChangeNumberOfHits, IScriptChangeBasePower
{
    /// <inheritdoc />
    public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
    {
        if (numberOfHits == 1)
            numberOfHits = 2;
    }

    /// <inheritdoc />
    public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
    {
        if (hit == 1)
            basePower = (ushort)(basePower / 4);
    }
}