ksys/res: Implement GParamList Npc

This commit is contained in:
Léo Lam 2020-09-20 01:40:21 +02:00
parent c0eec2b1c8
commit 80c8d2f762
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
4 changed files with 57 additions and 2 deletions

View File

@ -89,6 +89,7 @@ add_executable(uking
src/KingSystem/Resource/GeneralParamList/resGParamListObjectLiftable.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectLumberjackTree.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectMasterSword.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectNpc.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectPlayer.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectRod.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectRupee.h

View File

@ -89092,7 +89092,7 @@
0x0000007101196eec,BgparamlistObjectCureItem::ctor,456,_ZN4ksys3res24GParamListObjectCureItemC2Ev
0x00000071011970b4,BgparamlistObjectCookSpice::ctor,476,_ZN4ksys3res25GParamListObjectCookSpiceC2Ev
0x0000007101197290,BgparamlistObjectLumberjackTree::ctor,664,_ZN4ksys3res30GParamListObjectLumberjackTreeC2Ev
0x0000007101197528,BgparamlistObjectNpc::ctor,1232,
0x0000007101197528,BgparamlistObjectNpc::ctor,1232,_ZN4ksys3res19GParamListObjectNpcC2Ev
0x00000071011979f8,BgparamlistObjectNpcEquipment::ctor,1960,
0x00000071011981a0,BgparamlistObjectZora::ctor,508,
0x000000710119839c,BgparamlistObjectTraveler::ctor,29996,_ZN4ksys3res24GParamListObjectTravelerC1Ev
@ -89183,7 +89183,7 @@
0x00000071011a7d40,sub_71011A7D40,12,_ZNK4ksys3res24GParamListObjectCureItem7getNameEv
0x00000071011a7d4c,sub_71011A7D4C,12,_ZNK4ksys3res25GParamListObjectCookSpice7getNameEv
0x00000071011a7d58,sub_71011A7D58,12,_ZNK4ksys3res30GParamListObjectLumberjackTree7getNameEv
0x00000071011a7d64,sub_71011A7D64,12,
0x00000071011a7d64,sub_71011A7D64,12,_ZNK4ksys3res19GParamListObjectNpc7getNameEv
0x00000071011a7d70,sub_71011A7D70,12,
0x00000071011a7d7c,sub_71011A7D7C,12,
0x00000071011a7d88,sub_71011A7D88,12,_ZNK4ksys3res24GParamListObjectTraveler7getNameEv

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

View File

@ -0,0 +1,52 @@
#pragma once
#include <agl/Utils/aglParameter.h>
#include "KingSystem/Resource/GeneralParamList/resGParamListObject.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::res {
class GParamListObjectNpc : public GParamListObject {
public:
GParamListObjectNpc();
const char* getName() const override { return "Npc"; }
agl::utl::Parameter<bool> mIsReactNakedPlayer;
agl::utl::Parameter<bool> mUseAutoLabel;
agl::utl::Parameter<bool> mIsOffPodFromWeapon;
agl::utl::Parameter<bool> mIsRunRainWhenGoToSleep;
agl::utl::Parameter<bool> mIsWalkUnderShelterFromRain;
agl::utl::Parameter<bool> mIsSlowWalkOnSandAndSnow;
agl::utl::Parameter<bool> mIsAlwaysCounterPlayerAttack;
agl::utl::Parameter<bool> mIsNotTurnDetect;
agl::utl::Parameter<bool> mIsNotEscapeFromTerror;
agl::utl::Parameter<s32> mTolerantTime;
agl::utl::Parameter<s32> mTolerantCount;
agl::utl::Parameter<s32> mCounterRate;
agl::utl::Parameter<sead::SafeString> mChangeSearchModeFlagName;
agl::utl::Parameter<sead::SafeString> mOnFlagWhenDelete;
agl::utl::Parameter<sead::SafeString> mOffFlagWhenDelete;
};
KSYS_CHECK_SIZE_NX150(GParamListObjectNpc, 0x230);
inline GParamListObjectNpc::GParamListObjectNpc() {
auto* const obj = &mObj;
mIsReactNakedPlayer.init(false, "IsReactNakedPlayer", "", obj);
mUseAutoLabel.init(true, "UseAutoLabel", "", obj);
mIsOffPodFromWeapon.init(false, "IsOffPodFromWeapon", "", obj);
mIsRunRainWhenGoToSleep.init(true, "IsRunRainWhenGoToSleep", "", obj);
mIsWalkUnderShelterFromRain.init(true, "IsWalkUnderShelterFromRain", "", obj);
mIsSlowWalkOnSandAndSnow.init(false, "IsSlowWalkOnSandAndSnow", "", obj);
mIsAlwaysCounterPlayerAttack.init(false, "IsAlwaysCounterPlayerAttack", "", obj);
mIsNotTurnDetect.init(false, "IsNotTurnDetect", "", obj);
mIsNotEscapeFromTerror.init(false, "IsNotEscapeFromTerror", "", obj);
mTolerantTime.init(20, "TolerantTime", "", obj);
mTolerantCount.init(10, "TolerantCount", "", obj);
mCounterRate.init(30, "CounterRate", "", obj);
mChangeSearchModeFlagName.init("", "ChangeSearchModeFlagName", "", obj);
mOnFlagWhenDelete.init("", "OnFlagWhenDelete", "", obj);
mOffFlagWhenDelete.init("", "OffFlagWhenDelete", "", obj);
}
} // namespace ksys::res

View File

@ -28,6 +28,7 @@
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectLiftable.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectLumberjackTree.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectMasterSword.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectNpc.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectPlayer.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectRod.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectRupee.h"
@ -116,6 +117,7 @@ bool GParamList::parse_(u8* data, size_t, sead::Heap* heap) {
add<GParamListObjType::CookSpice>(archive.getRootList(), "CookSpice", heap, dummy_list);
add<GParamListObjType::LumberjackTree>(archive.getRootList(), "LumberjackTree", heap,
dummy_list);
add<GParamListObjType::Npc>(archive.getRootList(), "Npc", heap, dummy_list);
// TODO: the rest