#include "../../src/Battling/Pokemon/Pokemon.hpp" #include "../Core.hpp" using namespace PkmnLib::Battling; export uint8_t PkmnLib_Pokemon_Construct( Pokemon*& out, const BattleLibrary* library, const PkmnLib::Library::PokemonSpecies* species, const PkmnLib::Library::PokemonForme* forme, uint8_t level, uint32_t experience, uint32_t uid, CreatureLib::Library::Gender gender, uint8_t coloring, const PkmnLib::Library::Item* heldItem, const char* nickname, bool hiddenAbility, uint8_t abilityIndex, CreatureLib::Battling::LearnedAttack* const* moves, size_t moveCount, uint8_t hpIv, uint8_t attIv, uint8_t defIv, uint8_t sAtIv, uint8_t sDeIv, uint8_t spIv, uint8_t hpEv, uint8_t attEv, uint8_t defEv, uint8_t sAtEv, uint8_t sDeEv, uint8_t spEv, const PkmnLib::Library::Nature* nature) { Try({ if (nickname == nullptr) { nickname = ""; } std::string nick(nickname); std::vector cMoves(moves, moves + moveCount); out = new Pokemon( library, species, forme, level, experience, uid, gender, coloring, heldItem, nick, CreatureLib::Library::TalentIndex(hiddenAbility, abilityIndex), cMoves, CreatureLib::Library::ClampedStatisticSet(hpIv, attIv, defIv, sAtIv, sDeIv, spIv), CreatureLib::Library::ClampedStatisticSet(hpEv, attEv, defEv, sAtEv, sDeEv, spEv), nature); }) }; export void PkmnLib_Pokemon_Destruct(const Pokemon* p) { delete p; } SIMPLE_GET_FUNC(Pokemon, IsShiny, bool) SIMPLE_GET_FUNC_SMART_PTR(Pokemon, GetNature, const PkmnLib::Library::Nature*) export uint8_t PkmnLib_Pokemon_GetIndividualValue(const Pokemon* p, CreatureLib::Library::Statistic stat) { return p->GetIndividualValue(stat); } export void PkmnLib_Pokemon_SetIndividualValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) { p->SetIndividualValue(stat, value); } export uint8_t PkmnLib_Pokemon_GetEffortValue(const Pokemon* p, CreatureLib::Library::Statistic stat) { return p->GetEffortValue(stat); } export void PkmnLib_Pokemon_SetEffortValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) { p->SetEffortValue(stat, value); } export uint8_t PkmnLib_Pokemon_SetStatus(Pokemon* p, const char* name) { Try(p->SetStatus(ArbUt::StringView(name))); }; export uint8_t PkmnLib_Pokemon_ClearStatus(Pokemon* p) { Try(p->ClearStatus()); }; export const char* PkmnLib_Pokemon_GetStatusName(Pokemon* p) { return p->GetStatusName().c_str(); } SIMPLE_GET_FUNC(Pokemon, GetFriendship, uint8_t) export void PkmnLib_Pokemon_SetFriendship(Pokemon* p, uint8_t value) { p->SetFriendship(value); } export void PkmnLib_Pokemon_ChangeFriendship(Pokemon* p, int8_t amount) { p->ChangeFriendship(amount); } export uint8_t PkmnLib_Pokemon_Evolve(Pokemon* p, const PkmnLib::Library::PokemonSpecies* species, const PkmnLib::Library::PokemonForme* forme) { Try(p->Evolve(species, forme);) }