Add Friendship

This commit is contained in:
Deukhoofd 2020-08-08 17:09:01 +02:00
parent 69ab7b197c
commit 00167ecbb4
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 17 additions and 2 deletions

View File

@ -14,7 +14,7 @@ namespace PkmnLibSharp.Battling
{ {
Library = new BattleLibrary(Creaturelib.Generated.Creature.GetLibrary(ptr)); Library = new BattleLibrary(Creaturelib.Generated.Creature.GetLibrary(ptr));
} }
public Pokemon(BattleLibrary library, Species species, Forme forme, public Pokemon(BattleLibrary library, Species species, Forme forme,
byte level, uint experience, uint uid, byte level, uint experience, uint uid,
Gender gender, byte coloring, Item? heldItem, string? nickname, bool hiddenAbility, Gender gender, byte coloring, Item? heldItem, string? nickname, bool hiddenAbility,
@ -33,8 +33,9 @@ namespace PkmnLibSharp.Battling
{ {
Library = library; Library = library;
} }
public BattleLibrary Library { get; private set; } public BattleLibrary Library { get; private set; }
public Species Species public Species Species
{ {
get get
@ -47,6 +48,7 @@ namespace PkmnLibSharp.Battling
return _species; return _species;
} }
} }
public Forme Forme public Forme Forme
{ {
get get
@ -59,6 +61,7 @@ namespace PkmnLibSharp.Battling
return _forme; return _forme;
} }
} }
public Species? DisplaySpecies public Species? DisplaySpecies
{ {
get get
@ -72,6 +75,7 @@ namespace PkmnLibSharp.Battling
} }
set => Creaturelib.Generated.Creature.SetDisplaySpecies(Ptr, value?.Ptr ?? IntPtr.Zero); set => Creaturelib.Generated.Creature.SetDisplaySpecies(Ptr, value?.Ptr ?? IntPtr.Zero);
} }
public Forme? DisplayForme public Forme? DisplayForme
{ {
get get
@ -85,6 +89,7 @@ namespace PkmnLibSharp.Battling
} }
set => Creaturelib.Generated.Creature.SetDisplayVariant(Ptr, value?.Ptr ?? IntPtr.Zero); set => Creaturelib.Generated.Creature.SetDisplayVariant(Ptr, value?.Ptr ?? IntPtr.Zero);
} }
public byte Level => Creaturelib.Generated.Creature.GetLevel(Ptr); public byte Level => Creaturelib.Generated.Creature.GetLevel(Ptr);
public uint Experience => Creaturelib.Generated.Creature.GetExperience(Ptr); public uint Experience => Creaturelib.Generated.Creature.GetExperience(Ptr);
public Gender Gender => (Gender) Creaturelib.Generated.Creature.GetGender(Ptr); public Gender Gender => (Gender) Creaturelib.Generated.Creature.GetGender(Ptr);
@ -92,6 +97,11 @@ namespace PkmnLibSharp.Battling
public bool IsShiny => Pkmnlib.Generated.Pokemon.IsShiny(Ptr) == 1; public bool IsShiny => Pkmnlib.Generated.Pokemon.IsShiny(Ptr) == 1;
public uint CurrentHealth => Creaturelib.Generated.Creature.GetCurrentHealth(Ptr); public uint CurrentHealth => Creaturelib.Generated.Creature.GetCurrentHealth(Ptr);
public uint MaxHealth => Creaturelib.Generated.Creature.GetMaxHealth(Ptr); public uint MaxHealth => Creaturelib.Generated.Creature.GetMaxHealth(Ptr);
public byte Friendship
{
get => Pkmnlib.Generated.Pokemon.GetFriendship(Ptr);
set => Pkmnlib.Generated.Pokemon.SetFriendship(Ptr, value);
}
public string? ActiveAbility public string? ActiveAbility
{ {
@ -330,6 +340,11 @@ namespace PkmnLibSharp.Battling
Pkmnlib.Generated.Pokemon.ClearStatus(Ptr); Pkmnlib.Generated.Pokemon.ClearStatus(Ptr);
} }
public void ChangeFriendship(sbyte amount)
{
Pkmnlib.Generated.Pokemon.ChangeFriendship(Ptr, amount);
}
private Species? _displaySpecies; private Species? _displaySpecies;
private Forme? _displayForme; private Forme? _displayForme;
private Species? _species; private Species? _species;