mirror of
https://github.com/zeldaret/botw
synced 2026-07-03 12:10:14 -04:00
match more ai::Query
This commit is contained in:
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user