diff options
| author | theo3 <arisstephenson2@gmail.com> | 2021-07-01 19:28:09 -0700 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2021-07-01 21:05:10 -0700 |
| commit | 60dd80779a92120c74e7bda9e1ccf2695e2c7c19 (patch) | |
| tree | 4d76dc03072740a41634893a9062d6a7e4626f68 /src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp | |
| parent | 112c1f987d3831df97f46c0f9e4ae977fba59484 (diff) | |
match some ai::Query
Diffstat (limited to 'src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp')
| -rw-r--r-- | src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp b/src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp index c38664ab..30f4e2bc 100644 --- a/src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp +++ b/src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp @@ -1,5 +1,7 @@ #include "Game/AI/Query/queryHasPouchItemByPouchCategory.h" #include <evfl/Query.h> +#include "Game/UI/uiPauseMenuDataMgr.h" +#include "KingSystem/ActorSystem/actTag.h" namespace uking::query { @@ -8,9 +10,44 @@ HasPouchItemByPouchCategory::HasPouchItemByPouchCategory(const InitArg& arg) HasPouchItemByPouchCategory::~HasPouchItemByPouchCategory() = default; -// FIXME: implement int HasPouchItemByPouchCategory::doQuery() { - return -1; + s32 result = 0; + using namespace ksys::act::tags; + + auto* pm = ui::PauseMenuDataMgr::instance(); + if (pm == nullptr) + return 1; + + switch (*mCategory) { + case 0: + result = pm->countItemsWithCategory(ui::PouchCategory::Sword); + break; + case 1: + result = pm->countItemsWithProfile("WeaponBow", false); + break; + case 2: + result = pm->countItemsWithTag(Arrow, false); + break; + case 3: + result = pm->countItemsWithCategory(ui::PouchCategory::Shield); + break; + case 4: + result = pm->countItemsWithCategory(ui::PouchCategory::Armor); + break; + case 5: + result = pm->countItemsWithCategory(ui::PouchCategory::Material); + break; + case 6: + result = pm->countItemsWithCategory(ui::PouchCategory::Food); + break; + case 7: + result = pm->countItemsWithCategory(ui::PouchCategory::KeyItem); + break; + default: + result = 0; + break; + } + return result < *mCount; } void HasPouchItemByPouchCategory::loadParams(const evfl::QueryArg& arg) { |
