This commit is contained in:
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Scrappy.cs
Normal file
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Scrappy.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Scrappy is an ability that allows the Pokémon to hit Ghost-type Pokémon with Normal- and Fighting-type moves.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Scrappy_(Ability)">Bulbapedia - Scrappy</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "scrappy")]
|
||||
public class Scrappy : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
IList<TypeIdentifier> types)
|
||||
{
|
||||
var hitType = executingMove.GetHitData(target, hitIndex).Type;
|
||||
if (hitType?.Name != "normal" && hitType?.Name != "fighting")
|
||||
return;
|
||||
if (types.Any(x => x.Name == "ghost"))
|
||||
types.RemoveAll(x => x.Name == "ghost");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user