summaryrefslogtreecommitdiff
path: root/src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp')
-rw-r--r--src/Game/AI/Query/queryHasPouchItemByPouchCategory.cpp41
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) {