namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Scrappy is an ability that allows the Pokémon to hit Ghost-type Pokémon with Normal- and Fighting-type moves. /// /// Bulbapedia - Scrappy /// [Script(ScriptCategory.Ability, "scrappy")] public class Scrappy : Script, IScriptChangeTypesForMove { /// public void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex, IList 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"); } }