query: Implement CheckDieCnt

This commit is contained in:
Léo Lam 2021-03-26 14:45:42 +01:00
parent 6888632132
commit 2cbe98381e
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
3 changed files with 14 additions and 4 deletions

View File

@ -37,7 +37,7 @@ query::CheckDeadHorseResistered:
query::CheckDeadlyQuestEscapeTiming:
status: pending
query::CheckDieCnt:
status: pending
status: done
query::CheckDistanceForWarp:
status: pending
query::CheckDistanceFromPlayer:

View File

@ -40651,7 +40651,7 @@
0x0000007100688d84,AI_Query_CheckDieCnt::ctor,76,_ZN5uking5query11CheckDieCntC1ERKN4ksys3act2ai5Query7InitArgE
0x0000007100688dd0,AI_Query_CheckDieCnt::dtor,20,_ZN5uking5query11CheckDieCntD1Ev
0x0000007100688de4,AI_Query_CheckDieCnt::dtorDelete,52,_ZN5uking5query11CheckDieCntD0Ev
0x0000007100688e18,AI_Query_CheckDieCnt::doQuery,252,
0x0000007100688e18,AI_Query_CheckDieCnt::doQuery,252,_ZN5uking5query11CheckDieCnt7doQueryEv
0x0000007100688f14,AI_Query_CheckDieCnt::m10,112,_ZN5uking5query11CheckDieCnt10loadParamsERKN4evfl8QueryArgE
0x0000007100688f84,AI_Query_CheckDieCnt::loadParams,100,_ZN5uking5query11CheckDieCnt10loadParamsEv
0x0000007100688fe8,AI_Query_CheckDieCnt::rtti1,204,_ZNK5uking5query11CheckDieCnt27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE

Can't render this file because it is too large.

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) {