namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Protean is an ability that changes the Pokémon's type to the type of the move it is about to use.
///
/// Bulbapedia - Protean
///
[Script(ScriptCategory.Ability, "protean")]
public class Protean : Script, IScriptOnBeforeMove
{
///
public 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]);
}
}