Deukhoofd 6c13d20bf7
All checks were successful
Build / Build (push) Successful in 52s
Even more abilities
2025-06-14 11:30:56 +02:00

19 lines
692 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Protean is an ability that changes the Pokémon's type to the type of the move it is about to use.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Protean_(Ability)">Bulbapedia - Protean</see>
/// </summary>
[Script(ScriptCategory.Ability, "protean")]
public class Protean : Script
{
/// <inheritdoc />
public override void OnBeforeMove(IExecutingMove move)
{
if (move.User.Types.Count == 1 && move.User.Types[0] == move.UseMove.MoveType)
return;
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User));
move.User.SetTypes([move.UseMove.MoveType]);
}
}