24 lines
588 B
C#
24 lines
588 B
C#
|
using PkmnLib.Dynamic.Models;
|
||
|
using PkmnLib.Static;
|
||
|
|
||
|
namespace PkmnLib.Dynamic.ScriptHandling;
|
||
|
|
||
|
public abstract class PokeballScript : ItemScript
|
||
|
{
|
||
|
/// <inheritdoc />
|
||
|
protected PokeballScript(IItem item) : base(item)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public abstract byte GetCatchRate(IPokemon target);
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
public override void OnUseWithTarget(IPokemon target)
|
||
|
{
|
||
|
var battleData = target.BattleData;
|
||
|
if (battleData == null)
|
||
|
return;
|
||
|
|
||
|
battleData.Battle.AttempCapture(battleData.SideIndex, battleData.Position, Item);
|
||
|
}
|
||
|
}
|