Adds a bunch of new evolution methods.

This commit is contained in:
Deukhoofd 2021-06-26 16:20:25 +02:00
parent 1f298cef08
commit 68e7dd5f08
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 48 additions and 7 deletions

View File

@ -9,6 +9,12 @@ export const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipEvolution(uint
const PokemonSpecies* into) { const PokemonSpecies* into) {
return EvolutionData::CreateFriendshipEvolution(friendship, into); return EvolutionData::CreateFriendshipEvolution(friendship, into);
} }
export const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipTimeEvolution(uint8_t friendship, TimeOfDay startTime,
TimeOfDay endTime,
const PokemonSpecies* into) {
return EvolutionData::CreateFriendshipTimeEvolution(friendship, startTime, endTime, into);
}
export const EvolutionData* PkmnLib_EvolutionData_CreateKnownMoveEvolution(const MoveData* move, export const EvolutionData* PkmnLib_EvolutionData_CreateKnownMoveEvolution(const MoveData* move,
const PokemonSpecies* into) { const PokemonSpecies* into) {
return EvolutionData::CreateKnownMoveEvolution(move, into); return EvolutionData::CreateKnownMoveEvolution(move, into);
@ -17,12 +23,19 @@ export const EvolutionData* PkmnLib_EvolutionData_CreateLocationEvolution(const
const PokemonSpecies* into) { const PokemonSpecies* into) {
return EvolutionData::CreateLocationEvolution(ArbUt::StringView(location), into); return EvolutionData::CreateLocationEvolution(ArbUt::StringView(location), into);
} }
export const EvolutionData* PkmnLib_EvolutionData_CreateTimeEvolution(TimeOfDay time, const PokemonSpecies* into) { export const EvolutionData* PkmnLib_EvolutionData_CreateTimeEvolution(TimeOfDay startTime, TimeOfDay endTime,
return EvolutionData::CreateTimeEvolution(time, into); const PokemonSpecies* into) {
return EvolutionData::CreateTimeEvolution(startTime, endTime, into);
} }
export const EvolutionData* PkmnLib_EvolutionData_CreateItemEvolution(const Item* item, const PokemonSpecies* into) { export const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemEvolution(const Item* item,
const PokemonSpecies* into) {
return EvolutionData::CreateHeldItemEvolution(item, into); return EvolutionData::CreateHeldItemEvolution(item, into);
} }
export const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemTimeEvolution(const Item* item, TimeOfDay startTime,
TimeOfDay endTime,
const PokemonSpecies* into) {
return EvolutionData::CreateHeldItemTimeEvolution(item, startTime, endTime, into);
}
export const EvolutionData* PkmnLib_EvolutionData_CreateGenderBasedEvolution(CreatureLib::Library::Gender gender, export const EvolutionData* PkmnLib_EvolutionData_CreateGenderBasedEvolution(CreatureLib::Library::Gender gender,
uint8_t level, uint8_t level,
const PokemonSpecies* into) { const PokemonSpecies* into) {

View File

@ -13,6 +13,18 @@ const EvolutionData* EvolutionData::CreateHeldItemEvolution(const Item* item, co
return new EvolutionData(EvolutionMethod::HoldsItem, {new CreatureLib::Library::EffectParameter(item->GetName())}, return new EvolutionData(EvolutionMethod::HoldsItem, {new CreatureLib::Library::EffectParameter(item->GetName())},
into); into);
} }
const EvolutionData* EvolutionData::CreateHeldItemTimeEvolution(const Item* item, TimeOfDay startTime,
TimeOfDay endTime, const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::HoldsItemTime,
{
new CreatureLib::Library::EffectParameter(item->GetName()),
new CreatureLib::Library::EffectParameter((i64)startTime),
new CreatureLib::Library::EffectParameter((i64)endTime),
},
into);
}
const EvolutionData* EvolutionData::CreateItemUseEvolution(const Item* item, const PokemonSpecies* into) { const EvolutionData* EvolutionData::CreateItemUseEvolution(const Item* item, const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::EvolutionItemUse, return new EvolutionData(EvolutionMethod::EvolutionItemUse,
{new CreatureLib::Library::EffectParameter(item->GetName())}, into); {new CreatureLib::Library::EffectParameter(item->GetName())}, into);

View File

@ -32,17 +32,33 @@ namespace PkmnLib::Library {
return new EvolutionData(EvolutionMethod::HighFriendship, return new EvolutionData(EvolutionMethod::HighFriendship,
{new CreatureLib::Library::EffectParameter((int64_t)friendship)}, into); {new CreatureLib::Library::EffectParameter((int64_t)friendship)}, into);
} }
static inline const EvolutionData* CreateFriendshipTimeEvolution(uint8_t friendship, TimeOfDay startTime,
TimeOfDay endTime,
const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::HighFriendshipTime,
{new CreatureLib::Library::EffectParameter((int64_t)friendship),
new CreatureLib::Library::EffectParameter((int64_t)startTime),
new CreatureLib::Library::EffectParameter((int64_t)endTime)},
into);
}
static const EvolutionData* CreateKnownMoveEvolution(const MoveData* move, const PokemonSpecies* into); static const EvolutionData* CreateKnownMoveEvolution(const MoveData* move, const PokemonSpecies* into);
static inline const EvolutionData* CreateLocationEvolution(const ArbUt::StringView& location, static inline const EvolutionData* CreateLocationEvolution(const ArbUt::StringView& location,
const PokemonSpecies* into) { const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::LocationBased, return new EvolutionData(EvolutionMethod::LocationBased,
{new CreatureLib::Library::EffectParameter(location)}, into); {new CreatureLib::Library::EffectParameter(location)}, into);
} }
static inline const EvolutionData* CreateTimeEvolution(TimeOfDay time, const PokemonSpecies* into) { static inline const EvolutionData* CreateTimeEvolution(TimeOfDay startTime, TimeOfDay endTime,
const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::TimeBased, return new EvolutionData(EvolutionMethod::TimeBased,
{new CreatureLib::Library::EffectParameter((int64_t)time)}, into); {
new CreatureLib::Library::EffectParameter((int64_t)startTime),
new CreatureLib::Library::EffectParameter((int64_t)endTime),
},
into);
} }
static const EvolutionData* CreateHeldItemEvolution(const Item* item, const PokemonSpecies* into); static const EvolutionData* CreateHeldItemEvolution(const Item* item, const PokemonSpecies* into);
static const EvolutionData* CreateHeldItemTimeEvolution(const Item* item, TimeOfDay startTime,
TimeOfDay endTime, const PokemonSpecies* into);
static inline const EvolutionData* CreateGenderBasedEvolution(CreatureLib::Library::Gender gender, static inline const EvolutionData* CreateGenderBasedEvolution(CreatureLib::Library::Gender gender,
uint8_t level, const PokemonSpecies* into) { uint8_t level, const PokemonSpecies* into) {
return new EvolutionData(EvolutionMethod::IsGenderAndLevel, return new EvolutionData(EvolutionMethod::IsGenderAndLevel,

View File

@ -2,8 +2,8 @@
#define PKMNLIB_EVOLUTIONMETHOD_HPP #define PKMNLIB_EVOLUTIONMETHOD_HPP
namespace PkmnLib::Library { namespace PkmnLib::Library {
ENUM(EvolutionMethod, uint8_t, Level, HighFriendship, KnownMove, LocationBased, TimeBased, HoldsItem, ENUM(EvolutionMethod, uint8_t, Level, HighFriendship, HighFriendshipTime, KnownMove, LocationBased, TimeBased,
IsGenderAndLevel, EvolutionItemUse, EvolutionItemUseWithGender, Trade, TradeWithHeldItem, HoldsItem, HoldsItemTime, IsGenderAndLevel, EvolutionItemUse, EvolutionItemUseWithGender, Trade, TradeWithHeldItem,
TradeWithSpecificPokemon, Custom) TradeWithSpecificPokemon, Custom)
} }