diff --git a/data/uking_functions.csv b/data/uking_functions.csv index fdf08d2e..dcf6561e 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -91108,7 +91108,7 @@ 0x00000071011810a4,EntryFactoryBatcllist::newResource_,456, 0x000000710118126c,sub_710118126C,8, 0x0000007101181274,sub_7101181274,8, -0x000000710118127c,sub_710118127C,500, +0x000000710118127c,sub_710118127C,500,_ZN4ksys3res9AttClientC1Ev 0x0000007101181470,sub_7101181470,68, 0x00000071011814b4,sub_71011814B4,76, 0x0000007101181500,sub_7101181500,132, diff --git a/src/KingSystem/ActorSystem/CMakeLists.txt b/src/KingSystem/ActorSystem/CMakeLists.txt index a54d0e02..f11251c3 100644 --- a/src/KingSystem/ActorSystem/CMakeLists.txt +++ b/src/KingSystem/ActorSystem/CMakeLists.txt @@ -22,6 +22,8 @@ target_sources(uking PRIVATE actAiClass.h actAiParam.cpp actAiParam.h + actAttention.cpp + actAttention.h actBaseProc.cpp actBaseProc.h actBaseProcHandle.cpp diff --git a/src/KingSystem/ActorSystem/actAttention.cpp b/src/KingSystem/ActorSystem/actAttention.cpp new file mode 100644 index 00000000..001c72f2 --- /dev/null +++ b/src/KingSystem/ActorSystem/actAttention.cpp @@ -0,0 +1,9 @@ +#include "KingSystem/ActorSystem/actAttention.h" + +namespace ksys::act { + +SEAD_ENUM_IMPL(AttActionType) + +SEAD_ENUM_IMPL(AttPriorityType) + +} // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actAttention.h b/src/KingSystem/ActorSystem/actAttention.h new file mode 100644 index 00000000..bf7ed816 --- /dev/null +++ b/src/KingSystem/ActorSystem/actAttention.h @@ -0,0 +1,70 @@ +#pragma once + +#include + +namespace ksys::act { + +enum class AttType { + Action = 0, + Lock = 1, + SwordSearch = 2, + Attack = 3, + Appeal = 4, + JumpRide = 5, + NameBalloon = 6, + LookOnly = 7, + Invalid = 8, +}; + +// Make sure to update AttActionType if this is changed +enum class AttActionCode { + None = 0x1800000, + Talk, + Listen, + Awake, + Grab, + Open, + Pick, + Catch, + CheckCatch, + CatchWeapon, + Skin, + Sleep, + Sit, + Lumber, + Pushpull, + Read, + Check, + Boot, + BootPStop, + Leave, + Remind, + Buy, + Ride, + Wakeboard, + WakeboardRide, + RideRito, + RideZora, + Cook, + KillTime, + Display, + DisplayBow, + DisplayShield, + PickUp, + Pray, + PullOut, + Waterfall, + CommandWait, + CommandCome, + Thrust, + Put, + PickToEvent, + Dummy, +}; + +// clang-format off +SEAD_ENUM(AttActionType, None,Talk,Listen,Awake,Grab,Open,Pick,Catch,CheckCatch,CatchWeapon,Skin,Sleep,Sit,Lumber,Pushpull,Read,Check,Boot,BootPStop,Leave,Remind,Buy,Ride,Wakeboard,WakeboardRide,RideRito,RideZora,Cook,KillTime,Display,DisplayBow,DisplayShield,PickUp,Pray,PullOut,Waterfall,CommandWait,CommandCome,Thrust,Put,PickToEvent,Dummy) +SEAD_ENUM(AttPriorityType, Default,Enemy,Npc,Obj,ObjLow,ObjMiddle,ObjHigh,Bullet) +// clang-format on + +} // namespace ksys::act diff --git a/src/KingSystem/Resource/CMakeLists.txt b/src/KingSystem/Resource/CMakeLists.txt index 20742356..24bca8f6 100644 --- a/src/KingSystem/Resource/CMakeLists.txt +++ b/src/KingSystem/Resource/CMakeLists.txt @@ -134,6 +134,8 @@ target_sources(uking PRIVATE resResourceAS.h resResourceASList.cpp resResourceASList.h + resResourceAttClient.cpp + resResourceAttClient.h resResourceAttClientList.cpp resResourceAttClientList.h resResourceArchive.cpp diff --git a/src/KingSystem/Resource/resResourceAttClient.cpp b/src/KingSystem/Resource/resResourceAttClient.cpp new file mode 100644 index 00000000..2bbe4f26 --- /dev/null +++ b/src/KingSystem/Resource/resResourceAttClient.cpp @@ -0,0 +1,7 @@ +#include "KingSystem/Resource/resResourceAttClient.h" + +namespace ksys::res { + +AttClient::AttClient() : ParamIO("atcl", 0) {} + +} // namespace ksys::res diff --git a/src/KingSystem/Resource/resResourceAttClient.h b/src/KingSystem/Resource/resResourceAttClient.h new file mode 100644 index 00000000..808b8c81 --- /dev/null +++ b/src/KingSystem/Resource/resResourceAttClient.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include +#include +#include "KingSystem/ActorSystem/actAttention.h" +#include "KingSystem/Resource/resResource.h" +#include "KingSystem/Utils/ParamIO.h" +#include "KingSystem/Utils/Types.h" + +namespace ksys::res { + +class AttClient : public ParamIO, public Resource { + SEAD_RTTI_OVERRIDE(AttClient, Resource) +public: + struct Check {}; + + AttClient(); + ~AttClient() override; + + act::AttType getAttType() const { return mAttType; } + act::AttActionCode getActionCode() const { return mActionCode; } + act::AttPriorityType getPriorityType() const { return mPriorityType; } + const sead::SafeString& getPriorityTypeStr() const { return mPriorityTypeStr; } + const sead::Buffer& getChecks() const { return mChecks; } + + void doCreate_(u8*, u32, sead::Heap*) override {} + bool needsParse() const override { return true; } + bool parse_(u8* data, size_t size, sead::Heap* heap) override; + +private: + act::AttType mAttType = act::AttType::Action; + act::AttActionCode mActionCode = act::AttActionCode::None; + act::AttPriorityType mPriorityType = act::AttPriorityType::Default; + sead::FixedSafeString<32> mPriorityTypeStr; + agl::utl::ParameterObj mAttClientParamsObj; + agl::utl::Parameter> mAttTypeParam; + agl::utl::Parameter> mActionTypeParam; + agl::utl::Parameter> mPriorityTypeParam; + sead::Buffer mChecks; +}; +KSYS_CHECK_SIZE_NX150(AttClient, 0x428); + +} // namespace ksys::res