From 2cbe98381ef88f206196690f221d20f8a6b0eab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 26 Mar 2021 14:45:42 +0100 Subject: query: Implement CheckDieCnt --- src/Game/AI/Query/queryCheckDieCnt.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Game/AI/Query/queryCheckDieCnt.cpp') diff --git a/src/Game/AI/Query/queryCheckDieCnt.cpp b/src/Game/AI/Query/queryCheckDieCnt.cpp index 82444bd4..865cee1c 100644 --- a/src/Game/AI/Query/queryCheckDieCnt.cpp +++ b/src/Game/AI/Query/queryCheckDieCnt.cpp @@ -1,5 +1,6 @@ #include "Game/AI/Query/queryCheckDieCnt.h" #include +#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) { -- cgit v1.2.3