53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System;
|
|
using PkmnLibSharp.Utilities;
|
|
|
|
namespace PkmnLibSharp.Battling
|
|
{
|
|
public class ItemUseScript : PointerWrapper
|
|
{
|
|
internal ItemUseScript(IntPtr ptr) : base(ptr){}
|
|
|
|
public bool IsItemUsable()
|
|
{
|
|
byte res = 0;
|
|
Creaturelib.Generated.ItemUseScript.IsItemUsable(Ptr, ref res).Assert();
|
|
return res == 1;
|
|
}
|
|
|
|
public bool IsPokemonUseItem()
|
|
{
|
|
byte res = 0;
|
|
Creaturelib.Generated.ItemUseScript.IsCreatureUseItem(Ptr, ref res).Assert();
|
|
return res == 1;
|
|
}
|
|
|
|
public bool IsUseValidForPokemon(Pokemon pokemon)
|
|
{
|
|
byte res = 0;
|
|
Creaturelib.Generated.ItemUseScript.IsUseValidForCreature(Ptr, pokemon.Ptr, ref res).Assert();
|
|
return res == 1;
|
|
}
|
|
|
|
public bool IsHoldable()
|
|
{
|
|
byte res = 0;
|
|
Creaturelib.Generated.ItemUseScript.IsHoldable(Ptr, ref res).Assert();
|
|
return res == 1;
|
|
}
|
|
|
|
public void OnUse()
|
|
{
|
|
Creaturelib.Generated.ItemUseScript.OnUse(Ptr);
|
|
}
|
|
|
|
public void OnPokemonUse(Pokemon pokemon)
|
|
{
|
|
Creaturelib.Generated.ItemUseScript.OnCreatureUse(Ptr, pokemon.Ptr);
|
|
}
|
|
|
|
protected override void DeletePtr()
|
|
{
|
|
Creaturelib.Generated.ItemUseScript.Destruct(Ptr);
|
|
}
|
|
}
|
|
} |