41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using PkmnLibSharp.Utils;
|
|
using Interface = PkmnLibSharp.FFI.StaticData.Nature;
|
|
|
|
namespace PkmnLibSharp.StaticData
|
|
{
|
|
public class Nature : HandleType
|
|
{
|
|
protected Nature(FFIHandle handle) : base(handle)
|
|
{
|
|
}
|
|
|
|
public static Nature Create(Statistic increasedStat, Statistic decreasedStat, float increaseModifier = 1.1f,
|
|
float decreaseModifier = 0.9f)
|
|
{
|
|
var handle = Interface.nature_new(increasedStat, decreasedStat, increaseModifier, decreaseModifier);
|
|
return Resolver.Instance.ResolveNature(handle.Resolve());
|
|
}
|
|
|
|
public static Nature NeutralNature()
|
|
{
|
|
return Create(Statistic.HP, Statistic.HP, 1f, 1f);
|
|
}
|
|
|
|
private Statistic? _increasedStat;
|
|
public Statistic IncreasedStat
|
|
{
|
|
get { return _increasedStat ??= Interface.nature_increased_stat(Handle); }
|
|
}
|
|
|
|
private Statistic? _decreasedStat;
|
|
public Statistic DecreasedStat
|
|
{
|
|
get { return _decreasedStat ??= Interface.nature_decreased_stat(Handle); }
|
|
}
|
|
|
|
public float GetStatModifier(Statistic statistic)
|
|
{
|
|
return Interface.nature_get_stat_modifier(Handle, statistic);
|
|
}
|
|
}
|
|
} |