PkmnLibRSharp/PkmnLibRSharp/StaticData/Nature.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2022-09-18 16:02:27 +00:00
using PkmnLibSharp.Utils;
using Interface = PkmnLibSharp.FFI.StaticData.Nature;
namespace PkmnLibSharp.StaticData
{
public class Nature : HandleType
2022-09-18 16:02:27 +00:00
{
protected Nature(FFIHandle handle) : base(handle)
2022-09-18 16:02:27 +00:00
{
}
public static Nature Create(Statistic increasedStat, Statistic decreasedStat, float increaseModifier = 1.1f,
float decreaseModifier = 0.9f)
2022-10-01 13:39:33 +00:00
{
var handle = Interface.nature_new(increasedStat, decreasedStat, increaseModifier, decreaseModifier);
return Resolver.Instance.ResolveNature(handle.Resolve());
2022-10-01 13:39:33 +00:00
}
2022-09-18 16:02:27 +00:00
public static Nature NeutralNature()
{
return Create(Statistic.HP, Statistic.HP, 1f, 1f);
2022-09-18 16:02:27 +00:00
}
private Statistic? _increasedStat;
2022-09-18 16:02:27 +00:00
public Statistic IncreasedStat
{
get { return _increasedStat ??= Interface.nature_increased_stat(Handle); }
2022-09-18 16:02:27 +00:00
}
private Statistic? _decreasedStat;
2022-09-18 16:02:27 +00:00
public Statistic DecreasedStat
{
get { return _decreasedStat ??= Interface.nature_decreased_stat(Handle); }
2022-09-18 16:02:27 +00:00
}
public float GetStatModifier(Statistic statistic)
{
return Interface.nature_get_stat_modifier(Handle, statistic);
2022-10-08 11:42:30 +00:00
}
2022-09-18 16:02:27 +00:00
}
}