2020-04-17 19:02:17 +00:00
|
|
|
#include "../../src/Library/Items/Item.hpp"
|
2020-07-04 13:50:30 +00:00
|
|
|
#include <Arbutils/StringView.hpp>
|
2020-04-17 19:02:17 +00:00
|
|
|
#include "../Core.hpp"
|
|
|
|
using namespace PkmnLib::Library;
|
|
|
|
|
|
|
|
export Item* PkmnLib_Item_Construct(const char* name, CreatureLib::Library::ItemCategory category,
|
|
|
|
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
|
2021-03-07 16:09:30 +00:00
|
|
|
const char* effectName, CreatureLib::Library::EffectParameter* effectParameters[],
|
2022-02-19 13:04:43 +00:00
|
|
|
size_t effectParameterCount, const char* battleTriggerEffectName,
|
|
|
|
CreatureLib::Library::EffectParameter* battleTriggerEffectParameters[],
|
|
|
|
size_t battleTriggerEffectParameterCount, const char* flags[], size_t flagsCount,
|
2021-03-07 16:09:30 +00:00
|
|
|
uint8_t flingPower) {
|
2020-04-17 19:02:17 +00:00
|
|
|
std::unordered_set<uint32_t> conversedFlags(flagsCount);
|
|
|
|
for (size_t i = 0; i < flagsCount; i++) {
|
2020-07-04 13:50:30 +00:00
|
|
|
conversedFlags.insert(ArbUt::StringView::CalculateHash(flags[i]));
|
2020-04-17 19:02:17 +00:00
|
|
|
}
|
|
|
|
|
2021-03-07 16:09:30 +00:00
|
|
|
return new Item(
|
|
|
|
ArbUt::StringView(name), category, battleCategory, price,
|
|
|
|
new CreatureLib::Library::SecondaryEffect(100, effectName,
|
|
|
|
ArbUt::List<CreatureLib::Library::EffectParameter*>(
|
|
|
|
effectParameters, effectParameters + effectParameterCount)),
|
2022-02-19 13:04:43 +00:00
|
|
|
new CreatureLib::Library::SecondaryEffect(
|
|
|
|
100, battleTriggerEffectName,
|
|
|
|
ArbUt::List<CreatureLib::Library::EffectParameter*>(
|
|
|
|
battleTriggerEffectParameters, battleTriggerEffectParameters + battleTriggerEffectParameterCount)),
|
|
|
|
|
2021-03-07 16:09:30 +00:00
|
|
|
conversedFlags, flingPower);
|
2020-04-17 19:02:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export void PkmnLib_Item_Destruct(const Item* p) { delete p; }
|
|
|
|
|
2020-07-07 13:54:25 +00:00
|
|
|
SIMPLE_GET_FUNC(Item, GetFlingPower, uint8_t)
|