Implement most pokeballs
All checks were successful
Build / Build (push) Successful in 1m2s

This commit is contained in:
2025-07-20 11:15:45 +02:00
parent db3f7f2403
commit 77d7b86a3c
19 changed files with 452 additions and 38 deletions

View File

@@ -17,13 +17,23 @@ public abstract class PokeballScript : ItemScript
/// <summary>
/// Returns the catch rate of the Pokéball against the given target Pokémon.
/// </summary>
public abstract byte GetCatchRate(IPokemon target);
public abstract void ChangeCatchRate(IPokemon target, ref byte catchRate);
public virtual void OnAfterSuccessfulCapture(IPokemon target)
{
// Default implementation does nothing.
// Override this method in derived classes to add custom behavior after a successful capture.
}
/// <inheritdoc />
public override void OnUseWithTarget(IPokemon target, EventHook eventHook)
{
var battleData = target.BattleData;
battleData?.Battle.AttempCapture(battleData.SideIndex, battleData.Position, Item);
var result = battleData?.Battle.AttempCapture(battleData.SideIndex, battleData.Position, Item);
if (result is { IsCaught: true })
{
OnAfterSuccessfulCapture(target);
}
}
}