Implementation of Pokeballs
This commit is contained in:
24
PkmnLib.Dynamic/ScriptHandling/PokeballScript.cs
Normal file
24
PkmnLib.Dynamic/ScriptHandling/PokeballScript.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user