43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using PkmnLibSharp.Utilities;
|
|
|
|
namespace PkmnLibSharp.Battling
|
|
{
|
|
public class MiscLibrary : PointerWrapper
|
|
{
|
|
internal MiscLibrary(IntPtr ptr) : base(ptr)
|
|
{
|
|
}
|
|
public MiscLibrary() : base(Pkmnlib.Generated.MiscLibrary.Construct())
|
|
{
|
|
}
|
|
|
|
public bool IsCritical(IntPtr move, Pokemon target, byte hitNumber)
|
|
{
|
|
byte b = 0;
|
|
Creaturelibbattling.Generated.MiscLibrary.IsCritical(ref b, Ptr, move, target.Ptr, hitNumber).Assert();
|
|
return b == MarshalHelper.True;
|
|
}
|
|
|
|
public bool CanFlee(IntPtr switchChoice)
|
|
{
|
|
byte b = 0;
|
|
Creaturelibbattling.Generated.MiscLibrary.CanFlee(ref b, Ptr, switchChoice).Assert();
|
|
return b == MarshalHelper.True;
|
|
}
|
|
|
|
public IntPtr ReplacementAttack(Pokemon user, byte sideTarget, byte creatureTarget)
|
|
{
|
|
var b = IntPtr.Zero;
|
|
Creaturelibbattling.Generated.MiscLibrary.ReplacementAttack(ref b, Ptr, user.Ptr, sideTarget, creatureTarget)
|
|
.Assert();
|
|
return b;
|
|
}
|
|
|
|
|
|
protected override void DeletePtr()
|
|
{
|
|
Pkmnlib.Generated.MiscLibrary.Destruct(Ptr);
|
|
}
|
|
}
|
|
} |