diff options
Diffstat (limited to 'src/Game/AI/Query')
| -rw-r--r-- | src/Game/AI/Query/queryBranchByDyeColor.cpp | 8 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckAppPoint.cpp | 6 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckAppShopSelect.cpp | 16 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckDyeShopSelect.cpp | 16 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckItemShopDecide.cpp | 11 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp | 12 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckItemShopSelectBuy.cpp | 11 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckMaterialValue.cpp | 11 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryCheckPlacedItemSaled.cpp | 12 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp | 14 | ||||
| -rw-r--r-- | src/Game/AI/Query/queryHasSetItem.cpp | 25 |
11 files changed, 108 insertions, 34 deletions
diff --git a/src/Game/AI/Query/queryBranchByDyeColor.cpp b/src/Game/AI/Query/queryBranchByDyeColor.cpp index 085367f0..30cfe43e 100644 --- a/src/Game/AI/Query/queryBranchByDyeColor.cpp +++ b/src/Game/AI/Query/queryBranchByDyeColor.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryBranchByDyeColor.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtCommonFlagsUtils.h" namespace uking::query { @@ -7,9 +8,12 @@ BranchByDyeColor::BranchByDyeColor(const InitArg& arg) : ksys::act::ai::Query(ar BranchByDyeColor::~BranchByDyeColor() = default; -// FIXME: implement int BranchByDyeColor::doQuery() { - return -1; + auto index = ksys::gdt::getFlag_ColorChange_MaterialIndex(); + if (index >= 1 && index <= 15) { + return index; + } + return 0; } void BranchByDyeColor::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckAppPoint.cpp b/src/Game/AI/Query/queryCheckAppPoint.cpp index 2cf9cceb..408b2139 100644 --- a/src/Game/AI/Query/queryCheckAppPoint.cpp +++ b/src/Game/AI/Query/queryCheckAppPoint.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckAppPoint.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtSpecialFlags.h" namespace uking::query { @@ -7,9 +8,10 @@ CheckAppPoint::CheckAppPoint(const InitArg& arg) : ksys::act::ai::Query(arg) {} CheckAppPoint::~CheckAppPoint() = default; -// FIXME: implement int CheckAppPoint::doQuery() { - return -1; + s32 reach = ksys::gdt::getS32ByKey("ReachPointActorDiscoverNum"); + s32 use = ksys::gdt::getS32ByKey("App_ExtendUsePoint"); + return reach - use > 1; } void CheckAppPoint::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckAppShopSelect.cpp b/src/Game/AI/Query/queryCheckAppShopSelect.cpp index 3aab27d1..62dddb08 100644 --- a/src/Game/AI/Query/queryCheckAppShopSelect.cpp +++ b/src/Game/AI/Query/queryCheckAppShopSelect.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckAppShopSelect.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,20 @@ CheckAppShopSelect::CheckAppShopSelect(const InitArg& arg) : ksys::act::ai::Quer CheckAppShopSelect::~CheckAppShopSelect() = default; -// FIXME: implement int CheckAppShopSelect::doQuery() { - return -1; + auto* gdm = ksys::gdt::Manager::instance(); + if (gdm != nullptr) { + int screen_type = -1; + if (gdm->getParam().get().getS32(&screen_type, "Shop_ScreenType")) { + if (screen_type == 15) { + return 0; + } + if (screen_type == 0) { + return 1; + } + } + } + return 1; } void CheckAppShopSelect::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckDyeShopSelect.cpp b/src/Game/AI/Query/queryCheckDyeShopSelect.cpp index d0cea451..02f6a7ed 100644 --- a/src/Game/AI/Query/queryCheckDyeShopSelect.cpp +++ b/src/Game/AI/Query/queryCheckDyeShopSelect.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckDyeShopSelect.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,20 @@ CheckDyeShopSelect::CheckDyeShopSelect(const InitArg& arg) : ksys::act::ai::Quer CheckDyeShopSelect::~CheckDyeShopSelect() = default; -// FIXME: implement int CheckDyeShopSelect::doQuery() { - return -1; + auto* gdm = ksys::gdt::Manager::instance(); + if (gdm != nullptr) { + int screen_type = -1; + if (gdm->getParam().get().getS32(&screen_type, "Shop_ScreenType") && (screen_type != 0)) { + if (screen_type == 9) { + return 0; + } + if (screen_type == 10) { + return 1; + } + } + } + return 2; } void CheckDyeShopSelect::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckItemShopDecide.cpp b/src/Game/AI/Query/queryCheckItemShopDecide.cpp index 1cf568fc..2026f83c 100644 --- a/src/Game/AI/Query/queryCheckItemShopDecide.cpp +++ b/src/Game/AI/Query/queryCheckItemShopDecide.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckItemShopDecide.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,15 @@ CheckItemShopDecide::CheckItemShopDecide(const InitArg& arg) : ksys::act::ai::Qu CheckItemShopDecide::~CheckItemShopDecide() = default; -// FIXME: implement int CheckItemShopDecide::doQuery() { - return -1; + bool decide = false; + auto* gdm = ksys::gdt::Manager::instance(); + if (gdm != nullptr) { + if (gdm->getParam().get().getBool(&decide, "Shop_IsDecide") && decide) { + return 1; + } + } + return 0; } void CheckItemShopDecide::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp b/src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp index 04f06191..71603937 100644 --- a/src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp +++ b/src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckItemShopPorchVacancy.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -8,9 +9,16 @@ CheckItemShopPorchVacancy::CheckItemShopPorchVacancy(const InitArg& arg) CheckItemShopPorchVacancy::~CheckItemShopPorchVacancy() = default; -// FIXME: implement int CheckItemShopPorchVacancy::doQuery() { - return -1; + auto* gdm = ksys::gdt::Manager::instance(); + if (gdm != nullptr) { + int item_state = -1; + if (gdm->getParam().get().getS32(&item_state, "Shop_CurrentItemState") && + (item_state == 7)) { + return 0; + } + } + return 1; } void CheckItemShopPorchVacancy::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckItemShopSelectBuy.cpp b/src/Game/AI/Query/queryCheckItemShopSelectBuy.cpp index 9d28802c..2122c7e8 100644 --- a/src/Game/AI/Query/queryCheckItemShopSelectBuy.cpp +++ b/src/Game/AI/Query/queryCheckItemShopSelectBuy.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckItemShopSelectBuy.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,15 @@ CheckItemShopSelectBuy::CheckItemShopSelectBuy(const InitArg& arg) : ksys::act:: CheckItemShopSelectBuy::~CheckItemShopSelectBuy() = default; -// FIXME: implement int CheckItemShopSelectBuy::doQuery() { - return -1; + auto* gdm = ksys::gdt::Manager::instance(); + if (gdm != nullptr) { + int screen_type = -1; + if (gdm->getParam().get().getS32(&screen_type, "Shop_ScreenType")) { + return screen_type != 1; + } + } + return 0; } void CheckItemShopSelectBuy::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckMaterialValue.cpp b/src/Game/AI/Query/queryCheckMaterialValue.cpp index 0b0c9924..64415f22 100644 --- a/src/Game/AI/Query/queryCheckMaterialValue.cpp +++ b/src/Game/AI/Query/queryCheckMaterialValue.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckMaterialValue.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,15 @@ CheckMaterialValue::CheckMaterialValue(const InitArg& arg) : ksys::act::ai::Quer CheckMaterialValue::~CheckMaterialValue() = default; -// FIXME: implement int CheckMaterialValue::doQuery() { - return -1; + int mat = 0; + auto* gdm = ksys::gdt::Manager::instance(); + if (!gdm) + return 0; + + gdm->getParamBypassPerm().get().getS32(&mat, "AllMaterialValue"); + + return mat > 0; } void CheckMaterialValue::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryCheckPlacedItemSaled.cpp b/src/Game/AI/Query/queryCheckPlacedItemSaled.cpp index 5abf174d..3930c9a6 100644 --- a/src/Game/AI/Query/queryCheckPlacedItemSaled.cpp +++ b/src/Game/AI/Query/queryCheckPlacedItemSaled.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckPlacedItemSaled.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtManager.h" namespace uking::query { @@ -7,9 +8,16 @@ CheckPlacedItemSaled::CheckPlacedItemSaled(const InitArg& arg) : ksys::act::ai:: CheckPlacedItemSaled::~CheckPlacedItemSaled() = default; -// FIXME: implement int CheckPlacedItemSaled::doQuery() { - return -1; + auto* gdm = ksys::gdt::Manager::instance(); + int state = 2; + if (gdm != nullptr) { + gdm->getParamBypassPerm().get().getS32(&state, "PlacedItemCountState"); + if (state == 3) { + state = 1; + } + } + return state; } void CheckPlacedItemSaled::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp b/src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp index faabedbc..0d712b49 100644 --- a/src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp +++ b/src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryHasItemDyeSpecifiedColor.h" #include <evfl/Query.h> +#include "KingSystem/GameData/gdtCommonFlagsUtils.h" namespace uking::query { @@ -8,9 +9,18 @@ HasItemDyeSpecifiedColor::HasItemDyeSpecifiedColor(const InitArg& arg) HasItemDyeSpecifiedColor::~HasItemDyeSpecifiedColor() = default; -// FIXME: implement int HasItemDyeSpecifiedColor::doQuery() { - return -1; + s32 state = ksys::gdt::getFlag_Shop_ItemState(); + switch (state) { + case 0: + case 9: + return 1; + case 8: + return 0; + default: + break; + } + return 0; } void HasItemDyeSpecifiedColor::loadParams(const evfl::QueryArg& arg) {} diff --git a/src/Game/AI/Query/queryHasSetItem.cpp b/src/Game/AI/Query/queryHasSetItem.cpp index 7b8ccd7d..6b5d0c89 100644 --- a/src/Game/AI/Query/queryHasSetItem.cpp +++ b/src/Game/AI/Query/queryHasSetItem.cpp @@ -8,22 +8,19 @@ HasSetItem::HasSetItem(const InitArg& arg) : ksys::act::ai::Query(arg) {} HasSetItem::~HasSetItem() = default; -// NON_MATCHING: temp duplication int HasSetItem::doQuery() { auto* gdm = ksys::gdt::Manager::instance(); - if (gdm == nullptr) - return 0; - - auto flag_type = gdm->getParam().get1().getBuffer()->getFlagType(mItemName); - - if (flag_type == ksys::gdt::FlagType::Bool) { - bool value = false; - if (gdm->getParamBypassPerm().get().getBool(&value, mItemName)) - return value; - } else if (flag_type == ksys::gdt::FlagType::S32) { - s32 value = 0; - if (gdm->getParamBypassPerm().get().getS32(&value, mItemName)) - return value >= *mCount; + if (gdm != nullptr) { + auto flag_type = gdm->getParam().get1().getBuffer()->getFlagType(mItemName); + if (flag_type == ksys::gdt::FlagType::Bool) { + bool value = false; + if (gdm->getParamBypassPerm().get().getBool(&value, mItemName)) + return value; + } else if (flag_type == ksys::gdt::FlagType::S32) { + s32 value = 0; + if (gdm->getParamBypassPerm().get().getS32(&value, mItemName)) + return value >= *mCount; + } } return 0; } |
