Loads of work on capturing pokemon
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,9 +6,12 @@ export uint8_t PkmnLib_BattleLibrary_Construct(BattleLibrary*& out, PkmnLib::Lib
|
||||
StatCalculator* statCalculator, DamageLibrary* damageLibrary,
|
||||
ExperienceLibrary* experienceLibrary,
|
||||
PkmnLib::Battling::ScriptResolver* scriptResolver,
|
||||
MiscLibrary* miscLibrary) {
|
||||
MiscLibrary* miscLibrary, CaptureLibrary* captureLibrary) {
|
||||
Try(out = new BattleLibrary(staticLib, statCalculator, damageLibrary, experienceLibrary, scriptResolver,
|
||||
miscLibrary));
|
||||
miscLibrary, captureLibrary));
|
||||
}
|
||||
|
||||
export void PkmnLib_BattleLibrary_Destruct(BattleLibrary* p) { delete p; }
|
||||
|
||||
export uint8_t PkmnLib_CaptureLibrary_Construct(CaptureLibrary*& out) { Try(out = new CaptureLibrary()); }
|
||||
export void PkmnLib_CaptureLibrary_Destruct(CaptureLibrary* p) { delete p; }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../../src/Battling/EventHooks/CaptureAttemptEvent.hpp"
|
||||
#include "../../src/Battling/EventHooks/WeatherChangeEvent.hpp"
|
||||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
@@ -5,4 +6,13 @@ using namespace PkmnLib::Battling;
|
||||
export void PkmnLib_WeatherChangeEvent_Destruct(WeatherChangeEvent* p) { delete p; }
|
||||
export const char* PkmnLib_WeatherChangeEvent_GetWeatherName(WeatherChangeEvent* p) {
|
||||
return p->GetWeatherName().c_str();
|
||||
}
|
||||
|
||||
export void PkmnLib_CaptureAttemptEvent_Destruct(CaptureAttemptEvent* p) { delete p; }
|
||||
export const PkmnLib::Battling::Pokemon* PkmnLib_CaptureAttemptEvent_GetPokemon(CaptureAttemptEvent* p) {
|
||||
return p->GetPokemon();
|
||||
}
|
||||
export const PkmnLib::Battling::CaptureLibrary::CaptureResult
|
||||
PkmnLib_CaptureAttemptEvent_GetResult(CaptureAttemptEvent* p) {
|
||||
return p->GetResult();
|
||||
}
|
||||
@@ -30,6 +30,7 @@ PkmnLib_Pokemon_Construct(Pokemon*& out, const BattleLibrary* library, const Pkm
|
||||
export void PkmnLib_Pokemon_Destruct(const Pokemon* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(Pokemon, IsShiny, bool)
|
||||
SIMPLE_GET_FUNC(Pokemon, WasCaught, bool)
|
||||
SIMPLE_GET_FUNC_SMART_PTR(Pokemon, GetNature, const PkmnLib::Library::Nature*)
|
||||
|
||||
export u8 PkmnLib_Pokemon_GetIndividualValue(const Pokemon* p, CreatureLib::Library::Statistic stat) {
|
||||
@@ -55,4 +56,8 @@ export void PkmnLib_Pokemon_SetIsEgg(Pokemon* p, bool value) { p->SetIsEgg(value
|
||||
export u8 PkmnLib_Pokemon_Evolve(Pokemon* p, const PkmnLib::Library::PokemonSpecies* species,
|
||||
const PkmnLib::Library::PokemonForme* forme) {
|
||||
Try(p->Evolve(species, forme);)
|
||||
}
|
||||
|
||||
export u8 PkmnLib_Pokemon_AttemptCapture(Pokemon* p, PkmnLib::Library::Item* non_null catchItem) {
|
||||
Try(p->AttemptCapture(catchItem);)
|
||||
}
|
||||
Reference in New Issue
Block a user