query: Implement CheckDieCnt

This commit is contained in:
Léo Lam
2021-03-26 14:45:42 +01:00
parent 6888632132
commit 2cbe98381e
3 changed files with 14 additions and 4 deletions
+12 -2
View File
@@ -1,5 +1,6 @@
#include "Game/AI/Query/queryCheckDieCnt.h"
#include <evfl/query.h>
#include "KingSystem/GameData/gdtManager.h"
namespace uking::query {
@@ -7,9 +8,18 @@ CheckDieCnt::CheckDieCnt(const InitArg& arg) : ksys::act::ai::Query(arg) {}
CheckDieCnt::~CheckDieCnt() = default;
// FIXME: implement
int CheckDieCnt::doQuery() {
return -1;
auto* gdm = ksys::gdt::Manager::instance();
if (!gdm)
return 0;
sead::FixedSafeString<64> flag;
flag.format("%s_DeathCount", mActorName.cstr());
int count = 0;
if (!gdm->getParamBypassPerm().get().getS32(&count, flag))
return 0;
return count > *mCount;
}
void CheckDieCnt::loadParams(const evfl::QueryArg& arg) {