First couple abilities implemented
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/BattleBond.cs
Normal file
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/BattleBond.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
[Script(ScriptCategory.Ability, "battle_bond")]
|
||||
public class BattleBond : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnOpponentFaints(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (move.User.Species.Name == "greninja" && move.User.Form.Name != "ash" &&
|
||||
move.User.Species.TryGetForm("ash", out var ashForm))
|
||||
{
|
||||
move.User.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User));
|
||||
move.User.ChangeForm(ashForm);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
if (move.UseMove.Name == "water_shuriken" && move.User.Form.Name == "ash")
|
||||
basePower = 20;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
if (choice.ChosenMove.MoveData.Name == "water_shuriken" && choice.User.Form.Name == "ash")
|
||||
{
|
||||
numberOfHits = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user