namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Battle Bond is an ability exclusive to Greninja. When Greninja with this ability knocks out a Pokémon, it transforms into Ash-Greninja. /// In its Ash-Greninja form, Water Shuriken's base power is increased to 20 and it always hits 3 times. /// /// Bulbapedia - Battle Bond /// [Script(ScriptCategory.Ability, "battle_bond")] public class BattleBond : Script, IScriptChangeNumberOfHits, IScriptOnOpponentFaints, IScriptChangeBasePower { /// public void OnOpponentFaints(IExecutingMove move, IBattlePokemon target, byte hit) { if (move.User.Species.Name == SpeciesNames.Greninja && move.User.Form.Name != FormNames.Ash && move.User.Species.TryGetForm(FormNames.Ash, out var ashForm)) { move.User.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User)); move.User.ChangeForm(ashForm); } } /// public void ChangeBasePower(IExecutingMove move, IBattlePokemon target, byte hit, ref ushort basePower) { if (move.UseMove.Name == MoveNames.WaterShuriken && move.User.Form.Name == FormNames.Ash) basePower = 20; } /// public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits) { if (choice.ChosenMove.MoveData.Name == MoveNames.WaterShuriken && choice.User.Form.Name == FormNames.Ash) { numberOfHits = 3; } } }