This commit is contained in:
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Protean.cs
Normal file
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Protean.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user