From d7091eb132b2ef265352f0363d909320a4020075 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:11:20 -0400 Subject: [PATCH 01/79] Add files via upload AirOctaFlyUp::handleMessage_ ok, AirOctaFlyUp::loadParams_ not ok with a difference of 0 --- data/uking_functions.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 690f660a5..82ce1e9ce 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20248,8 +20248,8 @@ Address,Quality,Size,Name 0x00000071002fb3b8,U,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fb468,U,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev 0x00000071002fb8c4,U,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev -0x00000071002fb974,O,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev -0x00000071002fba18,U,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE +0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev +0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE 0x00000071002fbb34,O,000288,_ZNK5uking2ai12AirOctaFlyUp27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002fbc54,O,000092,_ZNK5uking2ai12AirOctaFlyUp18getRuntimeTypeInfoEv 0x00000071002fbcb0,U,000052,AI_AI_AirOctaReaction::ctor From efa72cb4612db92c239532c0ff0ecf9f7a3934b0 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:24:19 -0400 Subject: [PATCH 02/79] AirOctaFlyUp::handleMessage ok, AirOctaFlyUp::leave_ not ok with a difference of 0 --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 28 +++++++++++++++++++++++++--- src/Game/AI/AI/aiAirOctaFlyUp.h | 24 +++++++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 3b46b3377..722dda1e3 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,6 +1,8 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" +#include "Game/DLC/aocHardModeManager.h" +#include "KingSystem/Utils/Thread/Message.h" -namespace uking::ai { +namespace uking::ai{ AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} @@ -10,8 +12,27 @@ bool AirOctaFlyUp::init_(sead::Heap* heap) { return ksys::act::ai::Ai::init_(heap); } +bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { + if (message.getType().value == 0x80000c8) { + u32* user_data = static_cast(message.getUserData()); + auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a); + if (!data_mgr) { + return true; + } + if (user_data != nullptr) { + if (*user_data == 3) { + Ai::changeChild( "終了"); //END IN JAPANESE + } else if (*user_data == 4) { + ActionBase::setFinished(); + } + } + return true; + } + return false; +} + void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - ksys::act::ai::Ai::enter_(params); + ksys::act::ai::Ai::enter_(); } void AirOctaFlyUp::leave_() { @@ -24,4 +45,5 @@ void AirOctaFlyUp::loadParams_() { getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); } -} // namespace uking::ai + // namespace uking::ai +} diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 26c682b51..03f11793a 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,19 +1,32 @@ #pragma once #include "KingSystem/ActorSystem/actAiAi.h" - +#include "KingSystem/ActorSystem/actBaseProcLink.h" namespace uking::ai { +class AirOctaDataMgr { + SEAD_RTTI_BASE(AirOctaDataMgr) + +public: + ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } + +private: + /* 0x08 */ char unk_00[0x10]; + /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; + +}; class AirOctaFlyUp : public ksys::act::ai::Ai { SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) + friend uking::ai::AirOctaDataMgr; public: explicit AirOctaFlyUp(const InitArg& arg); ~AirOctaFlyUp() override; - + bool handleMessage_(const ksys::Message& message) override; bool init_(sead::Heap* heap) override; void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; + void getRuntimeTypeInfo(); protected: // static_param at offset 0x38 @@ -21,7 +34,12 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { // dynamic_param at offset 0x40 float* mTargetDistance_d{}; // aitree_variable at offset 0x48 - void* mAirOctaDataMgr_a{}; + // for whatever reason, removing getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); and replacing it with + // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference of 0 and make + // handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from nonmatching to matching and + // making another function go from matching to not really unmatching is still net progress + // getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); + AirOctaDataMgr** mAirOctaDataMgr_a{}; }; } // namespace uking::ai From ee7f19e1d5ffdd0a2e3fc78d2ef6af1192bc2b98 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:28:42 -0400 Subject: [PATCH 03/79] AirOctaFlyUp::handleMessage ok, AirOctaFlyUp::leave_ not ok with a difference of 0 --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 722dda1e3..fddfcec5d 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -2,7 +2,7 @@ #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" -namespace uking::ai{ +namespace uking::ai { AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} @@ -32,7 +32,7 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - ksys::act::ai::Ai::enter_(); + ksys::act::ai::Ai::enter_(params); } void AirOctaFlyUp::leave_() { @@ -45,5 +45,5 @@ void AirOctaFlyUp::loadParams_() { getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); } - // namespace uking::ai -} +} // namespace uking::ai + From 6c1892d5cf616279cdec25c1218fc6ac652120a1 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:30:04 -0400 Subject: [PATCH 04/79] AirOctaFlyUp::handleMessage ok, AirOctaFlyUp::leave_ not ok with a difference of 0 --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 2 +- src/Game/AI/AI/aiAirOctaFlyUp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index fddfcec5d..bc51100c7 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -45,5 +45,5 @@ void AirOctaFlyUp::loadParams_() { getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); } -} // namespace uking::ai +} // namespace uking::ai diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 03f11793a..84313c869 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -21,6 +21,7 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { public: explicit AirOctaFlyUp(const InitArg& arg); ~AirOctaFlyUp() override; + bool handleMessage_(const ksys::Message& message) override; bool init_(sead::Heap* heap) override; void enter_(ksys::act::ai::InlineParamPack* params) override; From 8d099f9009d348044fa9fe91af40ad6ec3df6edc Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 13:49:40 -0400 Subject: [PATCH 05/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 2 +- src/Game/AI/AI/aiAirOctaFlyUp.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index bc51100c7..1b950708e 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -45,5 +45,5 @@ void AirOctaFlyUp::loadParams_() { getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); } -} // namespace uking::ai +} // namespace uking::ai diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 84313c869..de758ba91 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -21,13 +21,12 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { public: explicit AirOctaFlyUp(const InitArg& arg); ~AirOctaFlyUp() override; - + bool handleMessage_(const ksys::Message& message) override; bool init_(sead::Heap* heap) override; void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; - void getRuntimeTypeInfo(); protected: // static_param at offset 0x38 From 777733979e29b5610a14b88621c2b08e86f5d329 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:15:03 -0400 Subject: [PATCH 06/79] sub_71002FB17C added to AirOctaFlyUp --- data/uking_functions.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 82ce1e9ce..12f99d5c8 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20236,7 +20236,7 @@ Address,Quality,Size,Name 0x00000071002fae08,O,000288,_ZNK5uking2ai19AirOctaBurnReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002faf28,O,000092,_ZNK5uking2ai19AirOctaBurnReaction18getRuntimeTypeInfoEv 0x00000071002faf84,U,000504, -0x00000071002fb17c,U,000044, +0x00000071002fb17c,U,000044,uking::ai::AirOctaFlyUp::sub_71002fb17c 0x00000071002fb1a8,U,000048, 0x00000071002fb1d8,U,000340, 0x00000071002fb32c,U,000020, @@ -20245,7 +20245,7 @@ Address,Quality,Size,Name 0x00000071002fb388,O,000004,_ZN5uking2ai12AirOctaFlyUpD1Ev 0x00000071002fb38c,O,000036,_ZN5uking2ai12AirOctaFlyUpD0Ev 0x00000071002fb3b0,O,000008,_ZN5uking2ai12AirOctaFlyUp5init_EPN4sead4HeapE -0x00000071002fb3b8,U,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE +0x00000071002fb3b8,O,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fb468,U,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev 0x00000071002fb8c4,U,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev 0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev @@ -20272,7 +20272,7 @@ Address,Quality,Size,Name 0x00000071002fc204,U,000072,_ZN5uking2ai11AirOctaRootD1Ev 0x00000071002fc24c,U,000080,_ZN5uking2ai11AirOctaRootD0Ev 0x00000071002fc29c,U,000348,_ZN5uking2ai11AirOctaRoot5init_EPN4sead4HeapE -0x00000071002fc3f8,U,000168,_ZN5uking2ai11AirOctaRoot6enter_EPN4ksys3act2ai15InlineParamPackE +0x00000071002fc3f8,W,000168,_ZN5uking2ai11AirOctaRoot6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fc4a0,U,000004,_ZN5uking2ai11AirOctaRoot5calc_Ev 0x00000071002fc4a4,O,000004,_ZN5uking2ai11AirOctaRoot6leave_Ev 0x00000071002fc4a8,O,000064,_ZN5uking2ai11AirOctaRoot11loadParams_Ev @@ -50760,7 +50760,7 @@ Address,Quality,Size,Name 0x000000710080e634,O,000288,_ZNK5uking6action18PlayerSetWakeUpMtx27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x000000710080e754,O,000092,_ZNK5uking6action18PlayerSetWakeUpMtx18getRuntimeTypeInfoEv 0x000000710080e7b0,U,000060,AI_Action_PlayerShieldRideMove::ctor -0x000000710080e7ec,U,001604,_ZN5uking6action20PlayerShieldRideMove6enter_EPN4ksys3act2ai15InlineParamPackE +0x000000710080e7ec,W,001604,_ZN5uking6action20PlayerShieldRideMove6enter_EPN4ksys3act2ai15InlineParamPackE 0x000000710080ee30,U,005808,_ZN5uking6action20PlayerShieldRideMove5calc_Ev 0x00000071008104e0,U,000392,_ZN5uking6action20PlayerShieldRideMove6leave_Ev 0x0000007100810668,O,000296,_ZN5uking6action20PlayerShieldRideMove11loadParams_Ev From 83b506516099ff5a2bfa12eeea2fa803b69a7cfd Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:22:00 -0400 Subject: [PATCH 07/79] AirOctaFlyUp::enter ok had to make a dummy variable in order to get a variable at 0x114 in AirOctaDataMgr, and also had to make function sub_71002FB17C so enter_ could still call it. loadParams_ still doesnt match with a difference of 0. Will look into sub_71002FB17C and the missing variables soon. --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 13 ++++++++++++- src/Game/AI/AI/aiAirOctaFlyUp.h | 14 ++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 1b950708e..72d91cd94 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,6 +1,9 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" +#include "KingSystem/ActorSystem/actAiParam.h" +#include "KingSystem/ActorSystem/actAiInlineParam.h" +#include "KingSystem/ActorSystem/actActor.h" namespace uking::ai { @@ -32,12 +35,20 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - ksys::act::ai::Ai::enter_(params); + if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ + data_mgr->unk_114 = 0; + data_mgr->sub_71002FB17C(); + } + auto &mtx = getActor()->getMtx(); + AirOctaY = mtx(1, 3); + ksys::act::ai::Ai::changeChild("開始"); + } void AirOctaFlyUp::leave_() { ksys::act::ai::Ai::leave_(); } +float sub_71002FB17C(); void AirOctaFlyUp::loadParams_() { getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index de758ba91..2fcaec559 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -2,17 +2,18 @@ #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" +#include "KingSystem/ActorSystem/actActor.h" namespace uking::ai { class AirOctaDataMgr { SEAD_RTTI_BASE(AirOctaDataMgr) public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - -private: + void sub_71002FB17C(); /* 0x08 */ char unk_00[0x10]; /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; - + char placeFiller[0xEC]; + /*0x114 */ u32 unk_114; }; class AirOctaFlyUp : public ksys::act::ai::Ai { @@ -27,19 +28,20 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; - + float sub_71002FB17C(); protected: // static_param at offset 0x38 const float* mFlyUpDuration_s{}; // dynamic_param at offset 0x40 float* mTargetDistance_d{}; // aitree_variable at offset 0x48 - // for whatever reason, removing getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); and replacing it with + // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference of 0 and make // handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from nonmatching to matching and // making another function go from matching to not really unmatching is still net progress - // getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); + // void* mAirOctaDataMgr_a AirOctaDataMgr** mAirOctaDataMgr_a{}; + float AirOctaY{}; }; } // namespace uking::ai From 0024e0092302fd8d5b4576de19ccc0c667edf0cd Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:25:28 -0400 Subject: [PATCH 08/79] fixed errata --- data/uking_functions.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 12f99d5c8..e19b55955 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20272,7 +20272,7 @@ Address,Quality,Size,Name 0x00000071002fc204,U,000072,_ZN5uking2ai11AirOctaRootD1Ev 0x00000071002fc24c,U,000080,_ZN5uking2ai11AirOctaRootD0Ev 0x00000071002fc29c,U,000348,_ZN5uking2ai11AirOctaRoot5init_EPN4sead4HeapE -0x00000071002fc3f8,W,000168,_ZN5uking2ai11AirOctaRoot6enter_EPN4ksys3act2ai15InlineParamPackE +0x00000071002fc3f8,U,000168,_ZN5uking2ai11AirOctaRoot6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fc4a0,U,000004,_ZN5uking2ai11AirOctaRoot5calc_Ev 0x00000071002fc4a4,O,000004,_ZN5uking2ai11AirOctaRoot6leave_Ev 0x00000071002fc4a8,O,000064,_ZN5uking2ai11AirOctaRoot11loadParams_Ev @@ -50760,7 +50760,7 @@ Address,Quality,Size,Name 0x000000710080e634,O,000288,_ZNK5uking6action18PlayerSetWakeUpMtx27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x000000710080e754,O,000092,_ZNK5uking6action18PlayerSetWakeUpMtx18getRuntimeTypeInfoEv 0x000000710080e7b0,U,000060,AI_Action_PlayerShieldRideMove::ctor -0x000000710080e7ec,W,001604,_ZN5uking6action20PlayerShieldRideMove6enter_EPN4ksys3act2ai15InlineParamPackE +0x000000710080e7ec,U,001604,_ZN5uking6action20PlayerShieldRideMove6enter_EPN4ksys3act2ai15InlineParamPackE 0x000000710080ee30,U,005808,_ZN5uking6action20PlayerShieldRideMove5calc_Ev 0x00000071008104e0,U,000392,_ZN5uking6action20PlayerShieldRideMove6leave_Ev 0x0000007100810668,O,000296,_ZN5uking6action20PlayerShieldRideMove11loadParams_Ev From 95ee9b929c2d68d1a479b491b93fd3a6004d86b8 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:30:03 -0400 Subject: [PATCH 09/79] removed excess includes --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 72d91cd94..03d12752a 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,9 +1,8 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" -#include "KingSystem/ActorSystem/actAiParam.h" -#include "KingSystem/ActorSystem/actAiInlineParam.h" -#include "KingSystem/ActorSystem/actActor.h" + + namespace uking::ai { From 2fa00f2eb829f70be4b8102d14c993af9e4440da Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:44:27 -0400 Subject: [PATCH 10/79] AirOctaFlyUp::leave OK --- data/uking_functions.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index e19b55955..fc2383158 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20247,7 +20247,7 @@ Address,Quality,Size,Name 0x00000071002fb3b0,O,000008,_ZN5uking2ai12AirOctaFlyUp5init_EPN4sead4HeapE 0x00000071002fb3b8,O,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fb468,U,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev -0x00000071002fb8c4,U,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev +0x00000071002fb8c4,O,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev 0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev 0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE 0x00000071002fbb34,O,000288,_ZNK5uking2ai12AirOctaFlyUp27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE From e71e29de5fac9e0806f1eb529e4de5ee557fe68d Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:45:58 -0400 Subject: [PATCH 11/79] AirOctaFlyUp::leave OK --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 7 ++++++- src/Game/AI/AI/aiAirOctaFlyUp.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 03d12752a..5c16d7155 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -45,8 +45,13 @@ void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { } void AirOctaFlyUp::leave_() { - ksys::act::ai::Ai::leave_(); + if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ + data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; + data_mgr->unk_114 = 0; + return data_mgr->sub_71002FB17C(); + } } + float sub_71002FB17C(); void AirOctaFlyUp::loadParams_() { diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 2fcaec559..99fbe6c5d 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -14,6 +14,7 @@ class AirOctaDataMgr { /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; char placeFiller[0xEC]; /*0x114 */ u32 unk_114; + /*0x118 */ float unk_118; }; class AirOctaFlyUp : public ksys::act::ai::Ai { From bbb6c6a4f134ea4380e2bc31147615aa0890d0d6 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:50:27 -0400 Subject: [PATCH 12/79] removed unnecessary return --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 5c16d7155..332c4fe5c 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -48,7 +48,7 @@ void AirOctaFlyUp::leave_() { if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; data_mgr->unk_114 = 0; - return data_mgr->sub_71002FB17C(); + data_mgr->sub_71002FB17C(); } } From 5df3ff43d338e7ef8d884443aa17f867994230ec Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:46:52 -0400 Subject: [PATCH 13/79] sub_71002fb17c OK --- data/uking_functions.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index fc2383158..4a929ef37 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20236,7 +20236,7 @@ Address,Quality,Size,Name 0x00000071002fae08,O,000288,_ZNK5uking2ai19AirOctaBurnReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002faf28,O,000092,_ZNK5uking2ai19AirOctaBurnReaction18getRuntimeTypeInfoEv 0x00000071002faf84,U,000504, -0x00000071002fb17c,U,000044,uking::ai::AirOctaFlyUp::sub_71002fb17c +0x00000071002fb17c,O,000044,_ZN5uking14AirOctaDataMgr14sub_71002fb17cEv 0x00000071002fb1a8,U,000048, 0x00000071002fb1d8,U,000340, 0x00000071002fb32c,U,000020, @@ -20258,7 +20258,7 @@ Address,Quality,Size,Name 0x00000071002fbd0c,O,000008,_ZN5uking2ai15AirOctaReaction5init_EPN4sead4HeapE 0x00000071002fbd14,U,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fbd40,U,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev -0x00000071002fbd44,O,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev +0x00000071002fbd44,U,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev 0x00000071002fbd48,U,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev 0x00000071002fbd9c,U,000132,uking::ai::AirOctaReaction::m34 0x00000071002fbe20,U,000008,uking::ai::AirOctaReaction::m35 From 2b44d041c3de6f54615e70e657583ce68a7ea8d1 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:48:30 -0400 Subject: [PATCH 14/79] AirOctaDataMgr temporarily moved to /Game --- src/Game/AirOctaDataMgrTemp.cpp | 10 ++++++++++ src/Game/AirOctaDataMgrTemp.h | 23 +++++++++++++++++++++++ src/Game/CMakeLists.txt | 3 +++ 3 files changed, 36 insertions(+) create mode 100644 src/Game/AirOctaDataMgrTemp.cpp create mode 100644 src/Game/AirOctaDataMgrTemp.h diff --git a/src/Game/AirOctaDataMgrTemp.cpp b/src/Game/AirOctaDataMgrTemp.cpp new file mode 100644 index 000000000..5f5c1e099 --- /dev/null +++ b/src/Game/AirOctaDataMgrTemp.cpp @@ -0,0 +1,10 @@ +#include "Game/AirOctaDataMgrTemp.h" + +namespace uking { + +float AirOctaDataMgr::sub_71002fb17c(){ + float result = unk_f0 + unk_110 + unk_114 + unk_118 + unk_11c; + unk_fc = result; + return result; +} +} \ No newline at end of file diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h new file mode 100644 index 000000000..3f2c08de6 --- /dev/null +++ b/src/Game/AirOctaDataMgrTemp.h @@ -0,0 +1,23 @@ +#pragma once +#include "KingSystem/ActorSystem/actActor.h" +namespace uking { +class AirOctaDataMgr { + SEAD_RTTI_BASE(AirOctaDataMgr) + //friend uking::ai::AI::AirOctaFlyUp; +public: + ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } + float sub_71002fb17c(); + /* 0x08 */ char unk_00[0x10]; + /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; + char placeFiller[0xC8]; + /*0xf0 */ float unk_f0; + char placeFiller2[0x8]; + /*0xfc*/ float unk_fc; + char placeFiller3[0x10]; + /*0x110*/ float unk_110; + /*0x114 */ float unk_114; + /*0x118 */ float unk_118; + /*0x11c */ float unk_11c; + +}; +} \ No newline at end of file diff --git a/src/Game/CMakeLists.txt b/src/Game/CMakeLists.txt index 917593820..6a7482e03 100644 --- a/src/Game/CMakeLists.txt +++ b/src/Game/CMakeLists.txt @@ -6,6 +6,8 @@ add_subdirectory(DLC) add_subdirectory(UI) target_sources(uking PRIVATE + AirOctaDataMgrTemp.h + AirOctaDataMgrTemp.cpp gameItemUtils.cpp gameItemUtils.h gamePlayReport.cpp @@ -16,4 +18,5 @@ target_sources(uking PRIVATE gameStageInfo.h E3Mgr.cpp E3Mgr.h + ) From d5f6f43eb5d254d695ef16b92fe7193972a77933 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:49:36 -0400 Subject: [PATCH 15/79] AirOctaDataMgr temporarily moved to /Game --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 9 +++------ src/Game/AI/AI/aiAirOctaFlyUp.h | 20 +++++--------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 332c4fe5c..32eec845a 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,7 +1,7 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" - +#include "Game/AirOctaDataMgrTemp.h" namespace uking::ai { @@ -36,24 +36,21 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ data_mgr->unk_114 = 0; - data_mgr->sub_71002FB17C(); + data_mgr->sub_71002fb17c(); } auto &mtx = getActor()->getMtx(); AirOctaY = mtx(1, 3); ksys::act::ai::Ai::changeChild("開始"); - } void AirOctaFlyUp::leave_() { if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; data_mgr->unk_114 = 0; - data_mgr->sub_71002FB17C(); + data_mgr->sub_71002fb17c(); } } -float sub_71002FB17C(); - void AirOctaFlyUp::loadParams_() { getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); getDynamicParam(&mTargetDistance_d, "TargetDistance"); diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 99fbe6c5d..f849a0d7f 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -3,23 +3,13 @@ #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" #include "KingSystem/ActorSystem/actActor.h" +#include "Game/AirOctaDataMgrTemp.h" namespace uking::ai { -class AirOctaDataMgr { - SEAD_RTTI_BASE(AirOctaDataMgr) -public: - ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - void sub_71002FB17C(); - /* 0x08 */ char unk_00[0x10]; - /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; - char placeFiller[0xEC]; - /*0x114 */ u32 unk_114; - /*0x118 */ float unk_118; -}; - -class AirOctaFlyUp : public ksys::act::ai::Ai { +class AirOctaFlyUp : + public ksys::act::ai::Ai { SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) - friend uking::ai::AirOctaDataMgr; + friend uking::AirOctaDataMgr; public: explicit AirOctaFlyUp(const InitArg& arg); ~AirOctaFlyUp() override; @@ -29,7 +19,7 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; - float sub_71002FB17C(); + protected: // static_param at offset 0x38 const float* mFlyUpDuration_s{}; From ba5bbdb3dc3795511dec207ce8debde8f5abb49b Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:24:08 -0400 Subject: [PATCH 16/79] changed from float to void --- src/Game/AirOctaDataMgrTemp.cpp | 4 ++-- src/Game/AirOctaDataMgrTemp.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Game/AirOctaDataMgrTemp.cpp b/src/Game/AirOctaDataMgrTemp.cpp index 5f5c1e099..26965d079 100644 --- a/src/Game/AirOctaDataMgrTemp.cpp +++ b/src/Game/AirOctaDataMgrTemp.cpp @@ -2,9 +2,9 @@ namespace uking { -float AirOctaDataMgr::sub_71002fb17c(){ +void AirOctaDataMgr::sub_71002fb17c(){ float result = unk_f0 + unk_110 + unk_114 + unk_118 + unk_11c; unk_fc = result; - return result; + return; } } \ No newline at end of file diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h index 3f2c08de6..7491de106 100644 --- a/src/Game/AirOctaDataMgrTemp.h +++ b/src/Game/AirOctaDataMgrTemp.h @@ -6,7 +6,7 @@ class AirOctaDataMgr { //friend uking::ai::AI::AirOctaFlyUp; public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - float sub_71002fb17c(); + void sub_71002fb17c(); /* 0x08 */ char unk_00[0x10]; /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; char placeFiller[0xC8]; From 8acc27911fd651d1ec695f757bfc4a343729f5bc Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:30:38 -0400 Subject: [PATCH 17/79] Create .AS --- src/KingSystem/ActorSystem/.AS | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/KingSystem/ActorSystem/.AS diff --git a/src/KingSystem/ActorSystem/.AS b/src/KingSystem/ActorSystem/.AS new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/KingSystem/ActorSystem/.AS @@ -0,0 +1 @@ + From d0f7a3072a1dbdcea9bbf045a13c6171062b4537 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:30:59 -0400 Subject: [PATCH 18/79] Delete .AS --- src/KingSystem/ActorSystem/.AS | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/KingSystem/ActorSystem/.AS diff --git a/src/KingSystem/ActorSystem/.AS b/src/KingSystem/ActorSystem/.AS deleted file mode 100644 index 8b1378917..000000000 --- a/src/KingSystem/ActorSystem/.AS +++ /dev/null @@ -1 +0,0 @@ - From 26db64bf5403b02aacc7d949df0754a1de3166c2 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:31:22 -0400 Subject: [PATCH 19/79] Create ASList.cpp --- src/KingSystem/ActorSystem/AS/ASList.cpp | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/KingSystem/ActorSystem/AS/ASList.cpp diff --git a/src/KingSystem/ActorSystem/AS/ASList.cpp b/src/KingSystem/ActorSystem/AS/ASList.cpp new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/KingSystem/ActorSystem/AS/ASList.cpp @@ -0,0 +1 @@ + From e7cebb49777f4c5ea6da87dd762b846493ed7c70 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:32:17 -0400 Subject: [PATCH 20/79] making ASList have a file of its own; doing this now so i dont forget --- src/KingSystem/ActorSystem/AS/ASList.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/KingSystem/ActorSystem/AS/ASList.h diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h new file mode 100644 index 000000000..8fe2da1af --- /dev/null +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -0,0 +1,7 @@ +#pragma once +namespace ksys::as { +class ASList{ +public: +void sub_710115b070(ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +}; +} From ead424d6a5929fc225c5eee08473cf01babf6115 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:32:54 -0400 Subject: [PATCH 21/79] moved ASList to its own file --- src/KingSystem/ActorSystem/actActor.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h index ce14c73a2..87b41aa7a 100644 --- a/src/KingSystem/ActorSystem/actActor.h +++ b/src/KingSystem/ActorSystem/actActor.h @@ -18,6 +18,7 @@ #include "KingSystem/Map/mapMubinIter.h" #include "KingSystem/Utils/AtomicLongBitFlag.h" #include "KingSystem/Utils/Thread/ActorMessageTransceiver.h" +#include "KingSystem/ActorSystem/AS/ASList.h" namespace gsys { class Model; @@ -25,9 +26,7 @@ class Model; namespace ksys { -namespace as { -class ASList; -} // namespace as + namespace map { class Object; @@ -137,6 +136,7 @@ class Actor : public BaseProc, public ActorMessageTransceiver::IHandler { const ActorParam* getParam() const { return mActorParam; } map::Object* getMapObject() const { return mMapObject; } const map::MubinIter& getMapObjIter() const { return mMapObjIter; } + as::ASList* getASList() const { return mASList; } const sead::Matrix34f& getMtx() const { return mMtx; } const sead::Vector3f& getVelocity() const { return mVelocity; } @@ -145,7 +145,9 @@ class Actor : public BaseProc, public ActorMessageTransceiver::IHandler { phys::RigidBody* getMainBody() const { return mMainBody; } phys::RigidBody* getTgtBody() const { return mTgtBody; } - const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.getId(); } +const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.getId(); } + void sendMessage(const MesTransceiverId& dest, const MessageType& type, void* user_data, + bool ack); f32 getDeleteDistance() const { return sead::Mathf::sqrt(sead::Mathf::clampMin(mDeleteDistanceSq, 0.0f)); From 20ff981a16bee43e65b12a739e43194fb10b54da Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:33:21 -0400 Subject: [PATCH 22/79] Add files via upload --- src/KingSystem/ActorSystem/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/CMakeLists.txt b/src/KingSystem/ActorSystem/CMakeLists.txt index 79574c50b..cffbda11c 100644 --- a/src/KingSystem/ActorSystem/CMakeLists.txt +++ b/src/KingSystem/ActorSystem/CMakeLists.txt @@ -9,9 +9,11 @@ target_sources(uking PRIVATE Awareness/actAwarenessInstance.cpp Awareness/actAwarenessInstance.h + LOD/actLodState.cpp LOD/actLodState.h - + AS/ASList.h + AS/ASList.cpp Profiles/actPlayerBase.cpp Profiles/actPlayerBase.h Profiles/actRopeBase.cpp From b6971ccf3e950e3fb255ff2f4f4d8b17bf6273fe Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:49:08 -0400 Subject: [PATCH 23/79] Add files via upload --- src/KingSystem/ActorSystem/actActorConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorConstDataAccess.h b/src/KingSystem/ActorSystem/actActorConstDataAccess.h index b78e9fbce..06d24d9df 100644 --- a/src/KingSystem/ActorSystem/actActorConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorConstDataAccess.h @@ -126,6 +126,6 @@ class ActorConstDataAccess : public ActorLinkConstDataAccess { }; KSYS_CHECK_SIZE_NX150(ActorConstDataAccess, 0x18); -bool acquireActor(BaseProcLink* link, ActorConstDataAccess* accessor); +bool acquireActor(BaseProcLink* link, ActorLinkConstDataAccess* accessor); } // namespace ksys::act From 1773dcab555297221de2ec0e4e332c1bd1ae3cb2 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:51:19 -0400 Subject: [PATCH 24/79] hopefully the table is correct now --- src/Game/AirOctaDataMgrTemp.cpp | 5 ++--- src/Game/AirOctaDataMgrTemp.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Game/AirOctaDataMgrTemp.cpp b/src/Game/AirOctaDataMgrTemp.cpp index 26965d079..70017bce1 100644 --- a/src/Game/AirOctaDataMgrTemp.cpp +++ b/src/Game/AirOctaDataMgrTemp.cpp @@ -1,10 +1,9 @@ #include "Game/AirOctaDataMgrTemp.h" - +#include "KingSystem/System/VFRValue.h" namespace uking { void AirOctaDataMgr::sub_71002fb17c(){ float result = unk_f0 + unk_110 + unk_114 + unk_118 + unk_11c; - unk_fc = result; - return; + unk_fc.y = result; } } \ No newline at end of file diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h index 7491de106..d641f7a0b 100644 --- a/src/Game/AirOctaDataMgrTemp.h +++ b/src/Game/AirOctaDataMgrTemp.h @@ -1,20 +1,22 @@ #pragma once #include "KingSystem/ActorSystem/actActor.h" namespace uking { -class AirOctaDataMgr { - SEAD_RTTI_BASE(AirOctaDataMgr) +class AirOctaDataMgr { + public: static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() { static const sead::RuntimeTypeInfo::Root typeInfo; return &typeInfo; } static bool checkDerivedRuntimeTypeInfoStatic( const sead::RuntimeTypeInfo::Interface* typeInfo) { const sead::RuntimeTypeInfo::Interface* clsTypeInfo = AirOctaDataMgr::getRuntimeTypeInfoStatic(); return typeInfo == clsTypeInfo; } virtual bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) const { return checkDerivedRuntimeTypeInfoStatic(typeInfo); } virtual const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const { return getRuntimeTypeInfoStatic(); } //friend uking::ai::AI::AirOctaFlyUp; public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } void sub_71002fb17c(); - /* 0x08 */ char unk_00[0x10]; + /* 0x08 */ ksys::act::BaseProcLink unk_00; /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; - char placeFiller[0xC8]; + char placeFiller[36]; + /*0x3f */ float unk_3f; + char placeFiller2[158]; /*0xf0 */ float unk_f0; - char placeFiller2[0x8]; - /*0xfc*/ float unk_fc; - char placeFiller3[0x10]; - /*0x110*/ float unk_110; + char placeFiller3[4]; + sead::Vector3f unk_fc; + char placeFiller4[12]; + /*0x110 */ float unk_110; /*0x114 */ float unk_114; /*0x118 */ float unk_118; /*0x11c */ float unk_11c; From bc039919de088b8f8f5eba5988471032bde2dd0c Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:51:56 -0400 Subject: [PATCH 25/79] calc_ is almost done --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 61 +++++++++++++++++++++++++++---- src/Game/AI/AI/aiAirOctaFlyUp.h | 15 ++++++-- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 32eec845a..83bef6131 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -2,7 +2,8 @@ #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" #include "Game/AirOctaDataMgrTemp.h" - +#include "KingSystem/System/VFRValue.h" +#include "KingSystem/System/VFR.h" namespace uking::ai { @@ -13,11 +14,57 @@ AirOctaFlyUp::~AirOctaFlyUp() = default; bool AirOctaFlyUp::init_(sead::Heap* heap) { return ksys::act::ai::Ai::init_(heap); } +void sub_710115b070(ksys::as::ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +void AirOctaFlyUp::calc_(){ + if (auto* data_mgr = getDataMgr()) { + // I added VFR::getDeltaFrame and changed VFR::getDeltaTime to refer to mDeltaTimes array. + auto deltaTime = ksys::VFR::instance()->getDeltaTime(); + mElapsedTime += deltaTime; + auto v11 = sead::Mathf::min( 1.0f, mElapsedTime / *mFlyUpDuration_s); + auto v12 = v11 * 2.f; + auto v13 = (v11 * 2.f) - 1.f; + auto v14 = v12 < 1.f ? sead::Mathf::exp(v13 * 10.f) : 2.f - sead::Mathf::exp(v13 * -10.f); + auto v15 = v14 * 0.5f; + data_mgr->unk_114 = v15 * *mTargetDistance_d; + data_mgr->sub_71002fb17c(); + u32 y_ = *(u32*)&(getActor()->getMtx().m[1][3]); + if (isCurrentChild("終了")) { // "End" + if (!mIsEnded) { + auto currentChild = getCurrentChild(); + if (currentChild->isFinished() || currentChild->isFailed() ){ + auto ASList = getActor()->getASList(); + if (ASList){ + sub_710115b070(ASList, -1.f, -1.f, "Wait", 0, 0, true); + } + mIsEnded = true; + } else if (!mIsEnded) { + return; + } + } + + if ((v15 >= 1.f && *(float*)&y_ >= getDataMgr()->unk_fc.y) || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->unk_00, &linkData)) { + UserData = 3; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &UserData, false); + } + } + } else if (*(float*)&y_ - AirOctaY >= *mTargetDistance_d * 0.9f || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->unk_00, &linkData)) { + UserData = 2; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &UserData, false); + } + } + } +} + + bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { if (message.getType().value == 0x80000c8) { u32* user_data = static_cast(message.getUserData()); - auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a); + auto* data_mgr = getDataMgr(); if (!data_mgr) { return true; } @@ -34,20 +81,20 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ + if (auto* data_mgr = getDataMgr()){ data_mgr->unk_114 = 0; - data_mgr->sub_71002fb17c(); + data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); } - auto &mtx = getActor()->getMtx(); + auto &mtx = mActor->getMtx(); AirOctaY = mtx(1, 3); ksys::act::ai::Ai::changeChild("開始"); } void AirOctaFlyUp::leave_() { - if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ + if (auto* data_mgr = getDataMgr()){ data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; data_mgr->unk_114 = 0; - data_mgr->sub_71002fb17c(); + data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); } } diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index f849a0d7f..ac16f8de6 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -7,8 +7,8 @@ namespace uking::ai { class AirOctaFlyUp : - public ksys::act::ai::Ai { - SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) + public ksys::act::ai::Ai { + public: static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() { static const sead::RuntimeTypeInfo::Derive typeInfo; return &typeInfo; } static bool checkDerivedRuntimeTypeInfoStatic( const sead::RuntimeTypeInfo::Interface* typeInfo) { const sead::RuntimeTypeInfo::Interface* clsTypeInfo = AirOctaFlyUp::getRuntimeTypeInfoStatic(); if (typeInfo == clsTypeInfo) return true; return ksys::act::ai::Ai::checkDerivedRuntimeTypeInfoStatic(typeInfo); } bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) const override { return checkDerivedRuntimeTypeInfoStatic(typeInfo); } const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const override { return getRuntimeTypeInfoStatic(); } friend uking::AirOctaDataMgr; public: explicit AirOctaFlyUp(const InitArg& arg); @@ -19,8 +19,13 @@ class AirOctaFlyUp : void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; - + void calc_() override; + //probably somewhere else, but it has to exist somewhere to get calc_ working + //void sub_710115b070(ksys::as::ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); protected: + // Added + uking::AirOctaDataMgr *getDataMgr() { return sead::DynamicCast(*mAirOctaDataMgr_a); } + // static_param at offset 0x38 const float* mFlyUpDuration_s{}; // dynamic_param at offset 0x40 @@ -33,6 +38,10 @@ class AirOctaFlyUp : // void* mAirOctaDataMgr_a AirOctaDataMgr** mAirOctaDataMgr_a{}; float AirOctaY{}; + float mElapsedTime; + u32 UserData; + bool mIsEnded; + }; } // namespace uking::ai From c385453f760a341d143916c690f66c6299dc5463 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:18:40 -0400 Subject: [PATCH 26/79] Add files via upload --- src/KingSystem/ActorSystem/AS/ASList.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h index 8fe2da1af..6df1d7cdb 100644 --- a/src/KingSystem/ActorSystem/AS/ASList.h +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -2,6 +2,6 @@ namespace ksys::as { class ASList{ public: -void sub_710115b070(ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +void sub_710115b070( f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); }; } From a748269673f282333dda01aa9da5bb100d08a07b Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 1 Jul 2023 18:28:45 -0400 Subject: [PATCH 27/79] adding these so i can get the function on the latest commit --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 6 +++--- src/Game/AI/AI/aiAirOctaFlyUp.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 83bef6131..8a31c5774 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -4,7 +4,7 @@ #include "Game/AirOctaDataMgrTemp.h" #include "KingSystem/System/VFRValue.h" #include "KingSystem/System/VFR.h" - +#include "KingSystem/ActorSystem/AS/ASList.h" namespace uking::ai { AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} @@ -14,7 +14,7 @@ AirOctaFlyUp::~AirOctaFlyUp() = default; bool AirOctaFlyUp::init_(sead::Heap* heap) { return ksys::act::ai::Ai::init_(heap); } -void sub_710115b070(ksys::as::ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); + void AirOctaFlyUp::calc_(){ if (auto* data_mgr = getDataMgr()) { // I added VFR::getDeltaFrame and changed VFR::getDeltaTime to refer to mDeltaTimes array. @@ -34,7 +34,7 @@ void AirOctaFlyUp::calc_(){ if (currentChild->isFinished() || currentChild->isFailed() ){ auto ASList = getActor()->getASList(); if (ASList){ - sub_710115b070(ASList, -1.f, -1.f, "Wait", 0, 0, true); + ASList->sub_710115b070( -1.f, -1.f, "Wait", 0, 0, true); } mIsEnded = true; } else if (!mIsEnded) { diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index ac16f8de6..c1f675d76 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -25,7 +25,6 @@ class AirOctaFlyUp : protected: // Added uking::AirOctaDataMgr *getDataMgr() { return sead::DynamicCast(*mAirOctaDataMgr_a); } - // static_param at offset 0x38 const float* mFlyUpDuration_s{}; // dynamic_param at offset 0x40 From 051f83f430ef0db101eb7c625eeed39e9a8344b8 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 1 Jul 2023 18:33:26 -0400 Subject: [PATCH 28/79] Add files via upload --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index 18d2a4b44..01de4a824 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -2,6 +2,7 @@ #include #include +#include "KingSystem/Utils/Thread/MessageTransceiverId.h" namespace ksys { @@ -36,6 +37,8 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } + const MesTransceiverId * getMessageTransceiverId(); + protected: friend class ActorConstDataAccess; friend class BaseProc; From d5412a0b24dd08b4a3ba707ad40bc70038b59db2 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 15:14:55 -0400 Subject: [PATCH 29/79] hopefully this will fix some errors --- src/Game/AirOctaDataMgrTemp.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h index d641f7a0b..4fb203d4a 100644 --- a/src/Game/AirOctaDataMgrTemp.h +++ b/src/Game/AirOctaDataMgrTemp.h @@ -1,8 +1,12 @@ #pragma once +#include "KingSystem/ActorSystem/actAiAi.h" +#include "KingSystem/ActorSystem/actBaseProcLink.h" #include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actActor.h" +#include "Game/AI/AI/aiAirOctaRoot.h" namespace uking { class AirOctaDataMgr { - public: static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() { static const sead::RuntimeTypeInfo::Root typeInfo; return &typeInfo; } static bool checkDerivedRuntimeTypeInfoStatic( const sead::RuntimeTypeInfo::Interface* typeInfo) { const sead::RuntimeTypeInfo::Interface* clsTypeInfo = AirOctaDataMgr::getRuntimeTypeInfoStatic(); return typeInfo == clsTypeInfo; } virtual bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) const { return checkDerivedRuntimeTypeInfoStatic(typeInfo); } virtual const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const { return getRuntimeTypeInfoStatic(); } + SEAD_RTTI_BASE(AirOctaDataMgr) //friend uking::ai::AI::AirOctaFlyUp; public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } From 49511e160f92c1d850711ba4b0f64209e912c9ba Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:06:39 -0400 Subject: [PATCH 30/79] updated --- data/uking_functions.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 583ea9eac..1503fd92f 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -190,7 +190,7 @@ Address,Quality,Size,Name 0x0000007100003140,U,000852,BeamBase::reflectMaybe 0x0000007100003494,U,000880, 0x0000007100003804,U,000096, -0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_20ActorConstDataAccessE +0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_24ActorLinkConstDataAccessE 0x000000710000395c,U,000132, 0x00000071000039e0,U,000316, 0x0000007100003b1c,U,000280, @@ -20246,7 +20246,7 @@ Address,Quality,Size,Name 0x00000071002fb38c,O,000036,_ZN5uking2ai12AirOctaFlyUpD0Ev 0x00000071002fb3b0,O,000008,_ZN5uking2ai12AirOctaFlyUp5init_EPN4sead4HeapE 0x00000071002fb3b8,O,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE -0x00000071002fb468,U,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev +0x00000071002fb468,m,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev 0x00000071002fb8c4,O,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev 0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev 0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE @@ -20258,7 +20258,7 @@ Address,Quality,Size,Name 0x00000071002fbd0c,O,000008,_ZN5uking2ai15AirOctaReaction5init_EPN4sead4HeapE 0x00000071002fbd14,U,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fbd40,U,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev -0x00000071002fbd44,U,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev +0x00000071002fbd44,O,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev 0x00000071002fbd48,U,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev 0x00000071002fbd9c,U,000132,uking::ai::AirOctaReaction::m34 0x00000071002fbe20,U,000008,uking::ai::AirOctaReaction::m35 From 4c901440598f6fda3c80861d12f7c0a1abd5b24e Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:07:50 -0400 Subject: [PATCH 31/79] Add files via upload From adf4703d1d0a1b5e45d6c03b7856acc8b6cf9076 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:08:20 -0400 Subject: [PATCH 32/79] Add files via upload --- src/Game/AirOctaDataMgrTemp.cpp | 7 +++---- src/Game/AirOctaDataMgrTemp.h | 17 +++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/Game/AirOctaDataMgrTemp.cpp b/src/Game/AirOctaDataMgrTemp.cpp index 70017bce1..9e14847ee 100644 --- a/src/Game/AirOctaDataMgrTemp.cpp +++ b/src/Game/AirOctaDataMgrTemp.cpp @@ -1,9 +1,8 @@ #include "Game/AirOctaDataMgrTemp.h" -#include "KingSystem/System/VFRValue.h" namespace uking { -void AirOctaDataMgr::sub_71002fb17c(){ +void AirOctaDataMgr::sub_71002fb17c() { float result = unk_f0 + unk_110 + unk_114 + unk_118 + unk_11c; unk_fc.y = result; -} -} \ No newline at end of file +} +} // namespace uking \ No newline at end of file diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h index 4fb203d4a..0b31c1fa6 100644 --- a/src/Game/AirOctaDataMgrTemp.h +++ b/src/Game/AirOctaDataMgrTemp.h @@ -1,29 +1,22 @@ #pragma once -#include "KingSystem/ActorSystem/actAiAi.h" -#include "KingSystem/ActorSystem/actBaseProcLink.h" #include "KingSystem/ActorSystem/actActor.h" -#include "KingSystem/ActorSystem/actActor.h" -#include "Game/AI/AI/aiAirOctaRoot.h" namespace uking { class AirOctaDataMgr { SEAD_RTTI_BASE(AirOctaDataMgr) - //friend uking::ai::AI::AirOctaFlyUp; public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } void sub_71002fb17c(); - /* 0x08 */ ksys::act::BaseProcLink unk_00; - /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; - char placeFiller[36]; + /* 0x08 */ ksys::act::BaseProcLink mBaseProcLink; + char placeFiller[52]; /*0x3f */ float unk_3f; - char placeFiller2[158]; + char placeFiller2[158]; /*0xf0 */ float unk_f0; char placeFiller3[4]; sead::Vector3f unk_fc; - char placeFiller4[12]; + char placeFiller4[12]; /*0x110 */ float unk_110; /*0x114 */ float unk_114; /*0x118 */ float unk_118; /*0x11c */ float unk_11c; - }; -} \ No newline at end of file +} // namespace uking \ No newline at end of file From 739d1e06a88fb70cd03e3354f3949cc3b70d40e1 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:10:24 -0400 Subject: [PATCH 33/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 68 +++++++++++++++---------------- src/Game/AI/AI/aiAirOctaFlyUp.h | 31 +++++++------- 2 files changed, 49 insertions(+), 50 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 8a31c5774..beb5282c3 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,10 +1,9 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" -#include "Game/DLC/aocHardModeManager.h" -#include "KingSystem/Utils/Thread/Message.h" #include "Game/AirOctaDataMgrTemp.h" -#include "KingSystem/System/VFRValue.h" -#include "KingSystem/System/VFR.h" +#include "Game/DLC/aocHardModeManager.h" #include "KingSystem/ActorSystem/AS/ASList.h" +#include "KingSystem/System/VFR.h" +#include "KingSystem/Utils/Thread/Message.h" namespace uking::ai { AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} @@ -14,54 +13,56 @@ AirOctaFlyUp::~AirOctaFlyUp() = default; bool AirOctaFlyUp::init_(sead::Heap* heap) { return ksys::act::ai::Ai::init_(heap); } - -void AirOctaFlyUp::calc_(){ +// NON_MATCHING: one add should be a sub, and one str should be a stur +void AirOctaFlyUp::calc_() { if (auto* data_mgr = getDataMgr()) { // I added VFR::getDeltaFrame and changed VFR::getDeltaTime to refer to mDeltaTimes array. auto deltaTime = ksys::VFR::instance()->getDeltaTime(); mElapsedTime += deltaTime; - auto v11 = sead::Mathf::min( 1.0f, mElapsedTime / *mFlyUpDuration_s); + auto v11 = sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s); auto v12 = v11 * 2.f; auto v13 = (v11 * 2.f) - 1.f; auto v14 = v12 < 1.f ? sead::Mathf::exp(v13 * 10.f) : 2.f - sead::Mathf::exp(v13 * -10.f); auto v15 = v14 * 0.5f; data_mgr->unk_114 = v15 * *mTargetDistance_d; data_mgr->sub_71002fb17c(); - u32 y_ = *(u32*)&(getActor()->getMtx().m[1][3]); - if (isCurrentChild("終了")) { // "End" + u32 y = *(u32*)&(getActor()->getMtx().m[1][3]); + if (isCurrentChild("終了")) { // "End" if (!mIsEnded) { auto currentChild = getCurrentChild(); - if (currentChild->isFinished() || currentChild->isFailed() ){ + if (currentChild->isFinished() || currentChild->isFailed()) { auto ASList = getActor()->getASList(); - if (ASList){ - ASList->sub_710115b070( -1.f, -1.f, "Wait", 0, 0, true); + if (ASList) { + ASList->sub_710115b070(-1.f, -1.f, "Wait", 0, 0, true); } mIsEnded = true; } else if (!mIsEnded) { return; } - } + } - if ((v15 >= 1.f && *(float*)&y_ >= getDataMgr()->unk_fc.y) || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + if ((v15 >= 1.f && *(float*)&y >= getDataMgr()->unk_fc.y) || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->unk_00, &linkData)) { - UserData = 3; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &UserData, false); + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 3; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, + &mUserData, false); } } - } else if (*(float*)&y_ - AirOctaY >= *mTargetDistance_d * 0.9f || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + } else if (*(float*)&y - AirOctaY >= *mTargetDistance_d * 0.9f || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->unk_00, &linkData)) { - UserData = 2; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &UserData, false); + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 2; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, + false); } } } } - - -bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { +bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { if (message.getType().value == 0x80000c8) { u32* user_data = static_cast(message.getUserData()); auto* data_mgr = getDataMgr(); @@ -70,7 +71,7 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } if (user_data != nullptr) { if (*user_data == 3) { - Ai::changeChild( "終了"); //END IN JAPANESE + Ai::changeChild("終了"); // END IN JAPANESE } else if (*user_data == 4) { ActionBase::setFinished(); } @@ -81,20 +82,20 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - if (auto* data_mgr = getDataMgr()){ - data_mgr->unk_114 = 0; - data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); + if (auto* data_mgr = getDataMgr()) { + data_mgr->unk_114 = 0; + data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); } - auto &mtx = mActor->getMtx(); + auto& mtx = mActor->getMtx(); AirOctaY = mtx(1, 3); ksys::act::ai::Ai::changeChild("開始"); } void AirOctaFlyUp::leave_() { - if (auto* data_mgr = getDataMgr()){ - data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; - data_mgr->unk_114 = 0; - data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); + if (auto* data_mgr = getDataMgr()) { + data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; + data_mgr->unk_114 = 0; + data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); } } @@ -105,4 +106,3 @@ void AirOctaFlyUp::loadParams_() { } } // namespace uking::ai - diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index c1f675d76..694b3e8e6 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,15 +1,15 @@ #pragma once +#include "Game/AI/AI/aiAirOctaRoot.h" +#include "Game/AirOctaDataMgrTemp.h" +#include "KingSystem/ActorSystem/actActor.h" #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" -#include "KingSystem/ActorSystem/actActor.h" -#include "Game/AirOctaDataMgrTemp.h" namespace uking::ai { -class AirOctaFlyUp : - public ksys::act::ai::Ai { - public: static const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfoStatic() { static const sead::RuntimeTypeInfo::Derive typeInfo; return &typeInfo; } static bool checkDerivedRuntimeTypeInfoStatic( const sead::RuntimeTypeInfo::Interface* typeInfo) { const sead::RuntimeTypeInfo::Interface* clsTypeInfo = AirOctaFlyUp::getRuntimeTypeInfoStatic(); if (typeInfo == clsTypeInfo) return true; return ksys::act::ai::Ai::checkDerivedRuntimeTypeInfoStatic(typeInfo); } bool checkDerivedRuntimeTypeInfo(const sead::RuntimeTypeInfo::Interface* typeInfo) const override { return checkDerivedRuntimeTypeInfoStatic(typeInfo); } const sead::RuntimeTypeInfo::Interface* getRuntimeTypeInfo() const override { return getRuntimeTypeInfoStatic(); } +class AirOctaFlyUp : public ksys::act::ai::Ai { friend uking::AirOctaDataMgr; + public: explicit AirOctaFlyUp(const InitArg& arg); ~AirOctaFlyUp() override; @@ -20,27 +20,26 @@ class AirOctaFlyUp : void leave_() override; void loadParams_() override; void calc_() override; - //probably somewhere else, but it has to exist somewhere to get calc_ working - //void sub_710115b070(ksys::as::ASList *this_, f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); + protected: - // Added - uking::AirOctaDataMgr *getDataMgr() { return sead::DynamicCast(*mAirOctaDataMgr_a); } + uking::AirOctaDataMgr* getDataMgr() { + return sead::DynamicCast(*mAirOctaDataMgr_a); + } // static_param at offset 0x38 const float* mFlyUpDuration_s{}; // dynamic_param at offset 0x40 float* mTargetDistance_d{}; // aitree_variable at offset 0x48 - // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with - // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference of 0 and make - // handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from nonmatching to matching and - // making another function go from matching to not really unmatching is still net progress - // void* mAirOctaDataMgr_a + // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with + // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference + // of 0 and make handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from + // nonmatching to matching and making another function go from matching to not really unmatching + // is still net progress void* mAirOctaDataMgr_a AirOctaDataMgr** mAirOctaDataMgr_a{}; float AirOctaY{}; float mElapsedTime; - u32 UserData; + u32 mUserData; bool mIsEnded; - }; } // namespace uking::ai From 726f5bb3477bd00e75757af43c28bfc340885a2e Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:16:37 -0400 Subject: [PATCH 34/79] Add files via upload --- src/KingSystem/ActorSystem/actActorConstDataAccess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp b/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp index c3061e903..755748a7f 100644 --- a/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp +++ b/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp @@ -406,7 +406,7 @@ bool ActorConstDataAccess::horseTargetedIsCircularMoveAlways() const { return gparam->getHorseTargetedInfo()->mIsCircularMoveAlways.ref(); } -bool acquireActor(BaseProcLink* link, ActorConstDataAccess* accessor) { +bool acquireActor(BaseProcLink* link, ActorLinkConstDataAccess* accessor) { return link->getProcInContext([accessor](BaseProc* proc, bool valid) { if (!proc) { if (!valid) From 177289e31375e025090c90a5e861170a7f9e760f Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:17:04 -0400 Subject: [PATCH 35/79] Add files via upload --- data/uking_functions.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 1503fd92f..1510b0e6b 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20250,8 +20250,8 @@ Address,Quality,Size,Name 0x00000071002fb8c4,O,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev 0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev 0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE -0x00000071002fbb34,O,000288,_ZNK5uking2ai12AirOctaFlyUp27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE -0x00000071002fbc54,O,000092,_ZNK5uking2ai12AirOctaFlyUp18getRuntimeTypeInfoEv +0x00000071002fbb34,O,000288, +0x00000071002fbc54,O,000092, 0x00000071002fbcb0,U,000052,AI_AI_AirOctaReaction::ctor 0x00000071002fbce4,O,000004,_ZN5uking2ai15AirOctaReactionD1Ev 0x00000071002fbce8,O,000036,_ZN5uking2ai15AirOctaReactionD0Ev From 2bb7c1ee40a060cc487de0475bc81eec2d6fc247 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:18:51 -0400 Subject: [PATCH 36/79] Add files via upload --- data/uking_functions.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 1510b0e6b..75ad29ef5 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20250,8 +20250,8 @@ Address,Quality,Size,Name 0x00000071002fb8c4,O,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev 0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev 0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE -0x00000071002fbb34,O,000288, -0x00000071002fbc54,O,000092, +0x00000071002fbb34,U,000288, +0x00000071002fbc54,U,000092, 0x00000071002fbcb0,U,000052,AI_AI_AirOctaReaction::ctor 0x00000071002fbce4,O,000004,_ZN5uking2ai15AirOctaReactionD1Ev 0x00000071002fbce8,O,000036,_ZN5uking2ai15AirOctaReactionD0Ev From 81d91bda56ee3f7d2b01ec470203c11943cec2d6 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:26:10 -0400 Subject: [PATCH 37/79] changed some names also probably has some functions marked wrong because i checked them or worked on them but not for this commit From 38306f2b0f0159bd87f4bcc84f2c128c1617780e Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:26:33 -0400 Subject: [PATCH 38/79] Delete AirOctaDataMgrTemp.cpp --- src/Game/AirOctaDataMgrTemp.cpp | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/Game/AirOctaDataMgrTemp.cpp diff --git a/src/Game/AirOctaDataMgrTemp.cpp b/src/Game/AirOctaDataMgrTemp.cpp deleted file mode 100644 index 9e14847ee..000000000 --- a/src/Game/AirOctaDataMgrTemp.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Game/AirOctaDataMgrTemp.h" -namespace uking { - -void AirOctaDataMgr::sub_71002fb17c() { - float result = unk_f0 + unk_110 + unk_114 + unk_118 + unk_11c; - unk_fc.y = result; -} -} // namespace uking \ No newline at end of file From 99e5d12261dd6b79e2c09725ecbe15444a9cb322 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:26:44 -0400 Subject: [PATCH 39/79] Delete AirOctaDataMgrTemp.h --- src/Game/AirOctaDataMgrTemp.h | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/Game/AirOctaDataMgrTemp.h diff --git a/src/Game/AirOctaDataMgrTemp.h b/src/Game/AirOctaDataMgrTemp.h deleted file mode 100644 index 0b31c1fa6..000000000 --- a/src/Game/AirOctaDataMgrTemp.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include "KingSystem/ActorSystem/actActor.h" -namespace uking { -class AirOctaDataMgr { - SEAD_RTTI_BASE(AirOctaDataMgr) -public: - ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - void sub_71002fb17c(); - /* 0x08 */ ksys::act::BaseProcLink mBaseProcLink; - char placeFiller[52]; - /*0x3f */ float unk_3f; - char placeFiller2[158]; - /*0xf0 */ float unk_f0; - char placeFiller3[4]; - sead::Vector3f unk_fc; - char placeFiller4[12]; - /*0x110 */ float unk_110; - /*0x114 */ float unk_114; - /*0x118 */ float unk_118; - /*0x11c */ float unk_11c; -}; -} // namespace uking \ No newline at end of file From 05ab4f525f5db890851586dea91fc63b8dd26cee Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:27:35 -0400 Subject: [PATCH 40/79] Add files via upload --- src/Game/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Game/CMakeLists.txt b/src/Game/CMakeLists.txt index 6a7482e03..917593820 100644 --- a/src/Game/CMakeLists.txt +++ b/src/Game/CMakeLists.txt @@ -6,8 +6,6 @@ add_subdirectory(DLC) add_subdirectory(UI) target_sources(uking PRIVATE - AirOctaDataMgrTemp.h - AirOctaDataMgrTemp.cpp gameItemUtils.cpp gameItemUtils.h gamePlayReport.cpp @@ -18,5 +16,4 @@ target_sources(uking PRIVATE gameStageInfo.h E3Mgr.cpp E3Mgr.h - ) From 447c9856a12374487334f64db6868b84b002b806 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:31:11 -0400 Subject: [PATCH 41/79] updated versions of these --- src/Game/AI/AI/CMakeLists.txt | 2 + src/Game/AI/AI/aiAirOctaFlyUp.cpp | 118 +++++++++++++++--------------- src/Game/AI/AI/aiAirOctaFlyUp.h | 10 +-- 3 files changed, 66 insertions(+), 64 deletions(-) diff --git a/src/Game/AI/AI/CMakeLists.txt b/src/Game/AI/AI/CMakeLists.txt index 7db107d67..761209f10 100644 --- a/src/Game/AI/AI/CMakeLists.txt +++ b/src/Game/AI/AI/CMakeLists.txt @@ -1857,6 +1857,8 @@ target_sources(uking PRIVATE aiRideHorseAI.h aiRitoHeroSoulGiftRoot.cpp aiRitoHeroSoulGiftRoot.h + AirOcta/AirOctaDataMgr.cpp + AirOcta/AirOctaDataMgr.h aiRodEnemyFindPlayer.cpp aiRodEnemyFindPlayer.h aiRodRoot.cpp diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index beb5282c3..b428988b0 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,9 +1,13 @@ +#include "Game/AI/AI/aiAirOctaRoot.h" #include "Game/AI/AI/aiAirOctaFlyUp.h" -#include "Game/AirOctaDataMgrTemp.h" -#include "Game/DLC/aocHardModeManager.h" +#include "KingSystem/ActorSystem/actActorConstDataAccess.h" #include "KingSystem/ActorSystem/AS/ASList.h" #include "KingSystem/System/VFR.h" #include "KingSystem/Utils/Thread/Message.h" +#include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actAiAi.h" +#include "KingSystem/ActorSystem/actBaseProcLink.h" + namespace uking::ai { AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} @@ -13,78 +17,76 @@ AirOctaFlyUp::~AirOctaFlyUp() = default; bool AirOctaFlyUp::init_(sead::Heap* heap) { return ksys::act::ai::Ai::init_(heap); } -// NON_MATCHING: one add should be a sub, and one str should be a stur +// NON_MATCHING: stack for the sendMessage() message, type that y is casted to void AirOctaFlyUp::calc_() { - if (auto* data_mgr = getDataMgr()) { - // I added VFR::getDeltaFrame and changed VFR::getDeltaTime to refer to mDeltaTimes array. - auto deltaTime = ksys::VFR::instance()->getDeltaTime(); - mElapsedTime += deltaTime; - auto v11 = sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s); - auto v12 = v11 * 2.f; - auto v13 = (v11 * 2.f) - 1.f; - auto v14 = v12 < 1.f ? sead::Mathf::exp(v13 * 10.f) : 2.f - sead::Mathf::exp(v13 * -10.f); - auto v15 = v14 * 0.5f; - data_mgr->unk_114 = v15 * *mTargetDistance_d; - data_mgr->sub_71002fb17c(); - u32 y = *(u32*)&(getActor()->getMtx().m[1][3]); - if (isCurrentChild("終了")) { // "End" - if (!mIsEnded) { - auto currentChild = getCurrentChild(); - if (currentChild->isFinished() || currentChild->isFailed()) { - auto ASList = getActor()->getASList(); - if (ASList) { - ASList->sub_710115b070(-1.f, -1.f, "Wait", 0, 0, true); - } - mIsEnded = true; - } else if (!mIsEnded) { - return; - } - } - - if ((v15 >= 1.f && *(float*)&y >= getDataMgr()->unk_fc.y) || - mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { - ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { - mUserData = 3; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, - &mUserData, false); + auto* data_mgr = getDataMgr(); + if (!data_mgr) { + return; + } + auto deltaTime = ksys::VFR::instance()->getDeltaTime(); + mElapsedTime += deltaTime; + auto smallest_time = sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s); + auto smallest_time2 = smallest_time * 2.f; + auto smallest_time3 = (smallest_time * 2.f) - 1.f; + auto smallest_time4 = smallest_time2 < 1.f ? sead::Mathf::exp(smallest_time3 * 10.f) : 2.f - sead::Mathf::exp(smallest_time3 * -10.f); + auto smallest_time5 = smallest_time4 * 0.5f; + data_mgr->unk_114 = smallest_time5 * *mTargetDistance_d; + data_mgr->ChangeOctasYheightMaybe(); + auto y = getActor()->getMtx().m[1][3]; + if (isCurrentChild("終了")) { // "End" + if (!mIsEnded) { + auto currentChild = getCurrentChild(); + if (currentChild->isFinished() || currentChild->isFailed()) { + auto ASList = getActor()->getASList(); + if (ASList) { + ASList->DelayStateChangeMaybe(-1.f, -1.f, "Wait", 0, 0, true); } + mIsEnded = true; + } else if (!mIsEnded) { + return; } - } else if (*(float*)&y - AirOctaY >= *mTargetDistance_d * 0.9f || - mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + } + if ((smallest_time5 >= 1.f && y >= getDataMgr()->vec_F8.y) || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 3; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, false); + } + } + } else if (y - AirOctaY >= *mTargetDistance_d * 0.9f || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { ksys::act::ActorConstDataAccess linkData; if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { mUserData = 2; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, - false); + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, false); } } - } } bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { - if (message.getType().value == 0x80000c8) { - u32* user_data = static_cast(message.getUserData()); - auto* data_mgr = getDataMgr(); - if (!data_mgr) { - return true; - } - if (user_data != nullptr) { - if (*user_data == 3) { - Ai::changeChild("終了"); // END IN JAPANESE - } else if (*user_data == 4) { - ActionBase::setFinished(); - } - } + if (message.getType().value != 0x80000c8) { + return false; + } + u32* user_data = static_cast(message.getUserData()); + auto* data_mgr = getDataMgr(); + if (!data_mgr) { return true; } - return false; + if (user_data == nullptr) { + return true; + } + if (*user_data == 3) { + Ai::changeChild("終了"); // END IN JAPANESE + } else if (*user_data == 4) { + ActionBase::setFinished(); + } + return true; } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { if (auto* data_mgr = getDataMgr()) { data_mgr->unk_114 = 0; - data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); + data_mgr->ChangeOctasYheightMaybe(); } auto& mtx = mActor->getMtx(); AirOctaY = mtx(1, 3); @@ -93,9 +95,9 @@ void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { void AirOctaFlyUp::leave_() { if (auto* data_mgr = getDataMgr()) { - data_mgr->unk_118 = *mTargetDistance_d + data_mgr->unk_118; + data_mgr->unk_118 += *mTargetDistance_d; data_mgr->unk_114 = 0; - data_mgr->uking::AirOctaDataMgr::sub_71002fb17c(); + data_mgr->ChangeOctasYheightMaybe(); } } diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 694b3e8e6..791279011 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,13 +1,11 @@ #pragma once -#include "Game/AI/AI/aiAirOctaRoot.h" -#include "Game/AirOctaDataMgrTemp.h" -#include "KingSystem/ActorSystem/actActor.h" -#include "KingSystem/ActorSystem/actAiAi.h" -#include "KingSystem/ActorSystem/actBaseProcLink.h" +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" + namespace uking::ai { class AirOctaFlyUp : public ksys::act::ai::Ai { + SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) friend uking::AirOctaDataMgr; public: @@ -22,7 +20,7 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { void calc_() override; protected: - uking::AirOctaDataMgr* getDataMgr() { + AirOctaDataMgr* getDataMgr() const { return sead::DynamicCast(*mAirOctaDataMgr_a); } // static_param at offset 0x38 From f3b4d4bdd5790a7cb35ed85d1fab8f5771988554 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:32:09 -0400 Subject: [PATCH 42/79] Create AirOctaDataMgr.cpp --- src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp @@ -0,0 +1 @@ + From 5c976448d8c3790b48f56bcbf10080ecbc9056b4 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:32:29 -0400 Subject: [PATCH 43/79] Add files via upload --- src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp | 9 ++++- src/Game/AI/AI/AirOcta/AirOctaDataMgr.h | 43 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/Game/AI/AI/AirOcta/AirOctaDataMgr.h diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp index 8b1378917..e064ad95e 100644 --- a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp @@ -1 +1,8 @@ - +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" +namespace uking { + +void AirOctaDataMgr::ChangeOctasYheightMaybe() { + float result = vec_EC.y + unk_110 + unk_114 + unk_118 + unk_11c; + vec_F8.y = result; +} +} // namespace uking \ No newline at end of file diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h new file mode 100644 index 000000000..462ae3a05 --- /dev/null +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h @@ -0,0 +1,43 @@ +#pragma once + +#include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actAiClassDef.h" +#include +#include + +namespace uking { +class AirOctaDataMgr { + SEAD_RTTI_BASE(AirOctaDataMgr) +public: + ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } + void ChangeOctasYheightMaybe(); + + struct MessageData { + u32 unk_00; + u64 unk_08; + }; + + /* 0x08 */ ksys::act::BaseProcLink mBaseProcLink; + /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink2; + /* 0x28 */ void* unk_28{}; + /* 0x30 */ u32 unk_30{}; + /* 0x34 */ sead::Vector3f unk_34{sead::Vector3f::zero}; + /* 0x40 */ void* unk_40{}; + /* 0x48 */ u32 unk_48{}; + /* 0x4C */ sead::Vector3f unk_4C{sead::Vector3f::zero}; + /* 0x58 */ sead::FixedObjArray obj_arr; + /* 0xD8 */ u16 unk_D8{}; + /* 0xDA */ bool unk_DA{}; + /* 0xDC */ u32 unk_DC; + /* 0xE0 */ sead::Vector3f vec_E0{sead::Vector3f::zero}; + /* 0xEC */ sead::Vector3f vec_EC{sead::Vector3f::zero}; + /* 0xF8 */ sead::Vector3f vec_F8{sead::Vector3f::zero}; + /*0x104 */ sead::Vector3f vec_104{sead::Vector3f::zero}; + /*0x110 */ float unk_110; + /*0x114 */ float unk_114; + /*0x118 */ float unk_118; + /*0x11c */ float unk_11c; + /*0x120 */ u32 mFlags; + +}; +} // namespace uking \ No newline at end of file From c86a858548bfd39c108c8a364c673f91ceb5a0aa Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:34:49 -0400 Subject: [PATCH 44/79] Add files via upload --- src/KingSystem/ActorSystem/AS/ASList.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h index 6df1d7cdb..f7b15a375 100644 --- a/src/KingSystem/ActorSystem/AS/ASList.h +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -1,7 +1,10 @@ #pragma once +#include "KingSystem/ActorSystem/actActor.h" namespace ksys::as { class ASList{ public: -void sub_710115b070( f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +void DelayStateChangeMaybe( f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +bool GoLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& SafeString, u32 a2) ; }; -} + +} //namespace ksys::as From dc57fb50e673c39af043c92e76944e7202a524bd Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:35:18 -0400 Subject: [PATCH 45/79] Add files via upload --- src/KingSystem/ActorSystem/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/KingSystem/ActorSystem/CMakeLists.txt b/src/KingSystem/ActorSystem/CMakeLists.txt index cffbda11c..307975d0f 100644 --- a/src/KingSystem/ActorSystem/CMakeLists.txt +++ b/src/KingSystem/ActorSystem/CMakeLists.txt @@ -1,4 +1,7 @@ target_sources(uking PRIVATE + AS/ASList.h + AS/ASList.cpp + Attention/actAttention.cpp Attention/actAttention.h @@ -12,8 +15,7 @@ target_sources(uking PRIVATE LOD/actLodState.cpp LOD/actLodState.h - AS/ASList.h - AS/ASList.cpp + Profiles/actPlayerBase.cpp Profiles/actPlayerBase.h Profiles/actRopeBase.cpp From 3c6f24c0b2a012800647ba6ee2be8233a742ded9 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:36:25 -0400 Subject: [PATCH 46/79] Add files via upload --- src/KingSystem/ActorSystem/actActor.h | 11 ++++++----- .../ActorSystem/actActorConstDataAccess.cpp | 2 +- src/KingSystem/ActorSystem/actActorConstDataAccess.h | 2 +- .../ActorSystem/actActorLinkConstDataAccess.h | 5 ++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h index 87b41aa7a..2b9e41313 100644 --- a/src/KingSystem/ActorSystem/actActor.h +++ b/src/KingSystem/ActorSystem/actActor.h @@ -18,15 +18,16 @@ #include "KingSystem/Map/mapMubinIter.h" #include "KingSystem/Utils/AtomicLongBitFlag.h" #include "KingSystem/Utils/Thread/ActorMessageTransceiver.h" -#include "KingSystem/ActorSystem/AS/ASList.h" - +#include "Game/Damage/dmgDamageManagerBase.h" namespace gsys { class Model; } // namespace gsys namespace ksys { - +namespace as { +class ASList; +} //namespace as namespace map { class Object; @@ -265,7 +266,7 @@ const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.get virtual void onPlacementObjReset(); virtual void getAtk(); virtual void m126(); - virtual void getDamageMgr(); + virtual uking::dmg::DamageManagerBase* getDamageMgr(); virtual void m128(); virtual void m129(); virtual void getPlayerRideInfo(); @@ -289,7 +290,7 @@ const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.get sead::Atomic& get68f() { return _68f; } float get6f0() const { return _6f0; } - + uking::dmg::DamageManagerBase* getDamageMgrDerived(); void emitBasicSigOn(); void emitBasicSigOff(); bool checkBasicSig() const; diff --git a/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp b/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp index 755748a7f..c3061e903 100644 --- a/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp +++ b/src/KingSystem/ActorSystem/actActorConstDataAccess.cpp @@ -406,7 +406,7 @@ bool ActorConstDataAccess::horseTargetedIsCircularMoveAlways() const { return gparam->getHorseTargetedInfo()->mIsCircularMoveAlways.ref(); } -bool acquireActor(BaseProcLink* link, ActorLinkConstDataAccess* accessor) { +bool acquireActor(BaseProcLink* link, ActorConstDataAccess* accessor) { return link->getProcInContext([accessor](BaseProc* proc, bool valid) { if (!proc) { if (!valid) diff --git a/src/KingSystem/ActorSystem/actActorConstDataAccess.h b/src/KingSystem/ActorSystem/actActorConstDataAccess.h index 06d24d9df..b78e9fbce 100644 --- a/src/KingSystem/ActorSystem/actActorConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorConstDataAccess.h @@ -126,6 +126,6 @@ class ActorConstDataAccess : public ActorLinkConstDataAccess { }; KSYS_CHECK_SIZE_NX150(ActorConstDataAccess, 0x18); -bool acquireActor(BaseProcLink* link, ActorLinkConstDataAccess* accessor); +bool acquireActor(BaseProcLink* link, ActorConstDataAccess* accessor); } // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index 01de4a824..ea0482113 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -2,10 +2,9 @@ #include #include -#include "KingSystem/Utils/Thread/MessageTransceiverId.h" namespace ksys { - +struct MesTransceiverId; namespace act { class BaseProc; @@ -37,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - const MesTransceiverId * getMessageTransceiverId(); + MesTransceiverId* getMessageTransceiverId(); protected: friend class ActorConstDataAccess; From 89c167ba57000981b7a2527141868c1993900848 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:40:08 -0400 Subject: [PATCH 47/79] Add files via upload --- data/uking_functions.csv | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 75ad29ef5..6c00e6e6f 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -190,7 +190,7 @@ Address,Quality,Size,Name 0x0000007100003140,U,000852,BeamBase::reflectMaybe 0x0000007100003494,U,000880, 0x0000007100003804,U,000096, -0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_24ActorLinkConstDataAccessE +0x0000007100003864,O,000248,ksys::act::acquireActor 0x000000710000395c,U,000132, 0x00000071000039e0,U,000316, 0x0000007100003b1c,U,000280, @@ -20236,7 +20236,7 @@ Address,Quality,Size,Name 0x00000071002fae08,O,000288,_ZNK5uking2ai19AirOctaBurnReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002faf28,O,000092,_ZNK5uking2ai19AirOctaBurnReaction18getRuntimeTypeInfoEv 0x00000071002faf84,U,000504, -0x00000071002fb17c,O,000044,_ZN5uking14AirOctaDataMgr14sub_71002fb17cEv +0x00000071002fb17c,O,000044,_ZN5uking14AirOctaDataMgr23ChangeOctasYheightMaybeEv 0x00000071002fb1a8,U,000048, 0x00000071002fb1d8,U,000340, 0x00000071002fb32c,U,000020, @@ -20256,13 +20256,13 @@ Address,Quality,Size,Name 0x00000071002fbce4,O,000004,_ZN5uking2ai15AirOctaReactionD1Ev 0x00000071002fbce8,O,000036,_ZN5uking2ai15AirOctaReactionD0Ev 0x00000071002fbd0c,O,000008,_ZN5uking2ai15AirOctaReaction5init_EPN4sead4HeapE -0x00000071002fbd14,U,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE -0x00000071002fbd40,U,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev +0x00000071002fbd14,O,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE +0x00000071002fbd40,O,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev 0x00000071002fbd44,O,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev -0x00000071002fbd48,U,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev -0x00000071002fbd9c,U,000132,uking::ai::AirOctaReaction::m34 -0x00000071002fbe20,U,000008,uking::ai::AirOctaReaction::m35 -0x00000071002fbe28,U,000316,uking::ai::AirOctaReaction::m42 +0x00000071002fbd48,W,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev +0x00000071002fbd9c,O,000132,_ZN5uking2ai15AirOctaReaction3m34Emj +0x00000071002fbe20,O,000008,_ZN5uking2ai15AirOctaReaction3m35EmjcPN4ksys3act2ai15InlineParamPackE +0x00000071002fbe28,O,000316,_ZN5uking2ai15AirOctaReaction3m42EPN4ksys3act2ai15InlineParamPackE 0x00000071002fbf64,O,000008,_ZNK5uking2ai15AirOctaReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002fbf6c,O,000092,_ZNK5uking2ai15AirOctaReaction18getRuntimeTypeInfoEv 0x00000071002fbfc8,U,000008,uking::ai::EnemyDefaultReaction::m36 @@ -45194,7 +45194,7 @@ Address,Quality,Size,Name 0x00000071006dfe4c,O,000500,_ZN5uking3dmg17DamageManagerBase11applyDamageERi 0x00000071006e0040,O,000204,_ZN5uking3dmg17DamageManagerBase21handleDamageForPlayerEPjS2_S2_S2_S2_ 0x00000071006e010c,O,000072,_ZN5uking3dmg17DamageManagerBase9addDamageEliiiiii -0x00000071006e0154,U,000004,DamageMgrBase::isSlowTime +0x00000071006e0154,W,000004,_ZN5uking3dmg17DamageManagerBase10isSlowTimeEv 0x00000071006e0158,U,000324,DamageMgrBase::m29 0x00000071006e029c,U,002296,DamageMgrBase::m30 0x00000071006e0b94,O,000056,_ZN5uking3dmg17DamageManagerBase9getDamageEv From 3637223415849bc5f756564b7b274d9b7ae98b0d Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:42:41 -0400 Subject: [PATCH 48/79] got rid of irrelevant changes --- data/uking_functions.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 6c00e6e6f..df71a574c 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20256,13 +20256,13 @@ Address,Quality,Size,Name 0x00000071002fbce4,O,000004,_ZN5uking2ai15AirOctaReactionD1Ev 0x00000071002fbce8,O,000036,_ZN5uking2ai15AirOctaReactionD0Ev 0x00000071002fbd0c,O,000008,_ZN5uking2ai15AirOctaReaction5init_EPN4sead4HeapE -0x00000071002fbd14,O,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE -0x00000071002fbd40,O,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev +0x00000071002fbd14,U,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE +0x00000071002fbd40,U,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev 0x00000071002fbd44,O,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev 0x00000071002fbd48,W,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev -0x00000071002fbd9c,O,000132,_ZN5uking2ai15AirOctaReaction3m34Emj -0x00000071002fbe20,O,000008,_ZN5uking2ai15AirOctaReaction3m35EmjcPN4ksys3act2ai15InlineParamPackE -0x00000071002fbe28,O,000316,_ZN5uking2ai15AirOctaReaction3m42EPN4ksys3act2ai15InlineParamPackE +0x00000071002fbd9c,U,000132,_ZN5uking2ai15AirOctaReaction3m34Emj +0x00000071002fbe20,U,000008,_ZN5uking2ai15AirOctaReaction3m35EmjcPN4ksys3act2ai15InlineParamPackE +0x00000071002fbe28,U,000316,_ZN5uking2ai15AirOctaReaction3m42EPN4ksys3act2ai15InlineParamPackE 0x00000071002fbf64,O,000008,_ZNK5uking2ai15AirOctaReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002fbf6c,O,000092,_ZNK5uking2ai15AirOctaReaction18getRuntimeTypeInfoEv 0x00000071002fbfc8,U,000008,uking::ai::EnemyDefaultReaction::m36 @@ -45194,7 +45194,7 @@ Address,Quality,Size,Name 0x00000071006dfe4c,O,000500,_ZN5uking3dmg17DamageManagerBase11applyDamageERi 0x00000071006e0040,O,000204,_ZN5uking3dmg17DamageManagerBase21handleDamageForPlayerEPjS2_S2_S2_S2_ 0x00000071006e010c,O,000072,_ZN5uking3dmg17DamageManagerBase9addDamageEliiiiii -0x00000071006e0154,W,000004,_ZN5uking3dmg17DamageManagerBase10isSlowTimeEv +0x00000071006e0154,U,000004,_ZN5uking3dmg17DamageManagerBase10isSlowTimeEv 0x00000071006e0158,U,000324,DamageMgrBase::m29 0x00000071006e029c,U,002296,DamageMgrBase::m30 0x00000071006e0b94,O,000056,_ZN5uking3dmg17DamageManagerBase9getDamageEv From a054cf05c382e9a45ba5d9dc25620850dae0d799 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:44:43 -0400 Subject: [PATCH 49/79] Add files via upload --- data/uking_functions.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index df71a574c..9a213b8b7 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -190,7 +190,7 @@ Address,Quality,Size,Name 0x0000007100003140,U,000852,BeamBase::reflectMaybe 0x0000007100003494,U,000880, 0x0000007100003804,U,000096, -0x0000007100003864,O,000248,ksys::act::acquireActor +0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_24ActorConstDataAccessE 0x000000710000395c,U,000132, 0x00000071000039e0,U,000316, 0x0000007100003b1c,U,000280, From a4e8492e07b99af22d313d52df16ee8c8eaac670 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 19:47:36 -0400 Subject: [PATCH 50/79] maybe it will work now?????????? --- data/uking_functions.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 9a213b8b7..60a6d514f 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -190,7 +190,7 @@ Address,Quality,Size,Name 0x0000007100003140,U,000852,BeamBase::reflectMaybe 0x0000007100003494,U,000880, 0x0000007100003804,U,000096, -0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_24ActorConstDataAccessE +0x0000007100003864,O,000248,_ZN4ksys3act12acquireActorEPNS0_12BaseProcLinkEPNS0_20ActorConstDataAccessE 0x000000710000395c,U,000132, 0x00000071000039e0,U,000316, 0x0000007100003b1c,U,000280, From dc5569db745cd56fe73077e725ec6b16f57b9b8e Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:21:48 -0400 Subject: [PATCH 51/79] hopefully its a const member function now? --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index ea0482113..2c42a666d 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -36,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - MesTransceiverId* getMessageTransceiverId(); + MesTransceiverId* const getMessageTransceiverId(); protected: friend class ActorConstDataAccess; From d295d3b766ec74b2bc7d0d0c3c49dd3d3a778474 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:23:00 -0400 Subject: [PATCH 52/79] Add files via upload --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index 2c42a666d..95f84d9a8 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -36,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - MesTransceiverId* const getMessageTransceiverId(); + const MesTransceiverId* const getMessageTransceiverId(); protected: friend class ActorConstDataAccess; From 24ad964189f913a8e7b2893489107c0a4a97d4e5 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:24:30 -0400 Subject: [PATCH 53/79] Add files via upload --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index 95f84d9a8..f04f4bf67 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -36,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - const MesTransceiverId* const getMessageTransceiverId(); + const MesTransceiverId* getMessageTransceiverId(); protected: friend class ActorConstDataAccess; From 6e56e833944df4cf2cbc9b303d4fc9bd1736b039 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:41:04 -0400 Subject: [PATCH 54/79] Add files via upload --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index f04f4bf67..396c7a39c 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -36,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - const MesTransceiverId* getMessageTransceiverId(); + MesTransceiverId* getMessageTransceiverId() const; protected: friend class ActorConstDataAccess; From 668fd37f6167a9a74cca08f828e92c4be2791e3d Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:26:11 -0400 Subject: [PATCH 55/79] made names more descriptive the names are probably less accurate now though, i just looked at what the function seemed to be using them for --- src/KingSystem/ActorSystem/AS/ASList.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h index f7b15a375..d81d855f6 100644 --- a/src/KingSystem/ActorSystem/AS/ASList.h +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -3,7 +3,7 @@ namespace ksys::as { class ASList{ public: -void DelayStateChangeMaybe( f32 a2, f32 a3, const sead::SafeString& a4, int a5, int a6, bool a7); +void StartAnimationMaybe( f32 a2, f32 a3, const sead::SafeString& animation_ASDefine, int buffer_size, int string_length, bool a7); bool GoLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& SafeString, u32 a2) ; }; From 3af853b4d56ae27163eef46f37f96a6567151c31 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:26:48 -0400 Subject: [PATCH 56/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index b428988b0..de1ca27f7 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -39,7 +39,7 @@ void AirOctaFlyUp::calc_() { if (currentChild->isFinished() || currentChild->isFailed()) { auto ASList = getActor()->getASList(); if (ASList) { - ASList->DelayStateChangeMaybe(-1.f, -1.f, "Wait", 0, 0, true); + ASList->StartAnimationMaybe(-1.f, -1.f, "Wait", 0, 0, true); } mIsEnded = true; } else if (!mIsEnded) { From 38b1fae104a761f4139c5014a9e0b3c6e1e6eca5 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:43:20 -0400 Subject: [PATCH 57/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 7 ++++--- src/Game/AI/AI/aiAirOctaFlyUp.h | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index de1ca27f7..ea042e374 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,12 +1,13 @@ #include "Game/AI/AI/aiAirOctaRoot.h" #include "Game/AI/AI/aiAirOctaFlyUp.h" +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" +#include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actAiAi.h" +#include "KingSystem/ActorSystem/actBaseProcLink.h" #include "KingSystem/ActorSystem/actActorConstDataAccess.h" #include "KingSystem/ActorSystem/AS/ASList.h" #include "KingSystem/System/VFR.h" #include "KingSystem/Utils/Thread/Message.h" -#include "KingSystem/ActorSystem/actActor.h" -#include "KingSystem/ActorSystem/actAiAi.h" -#include "KingSystem/ActorSystem/actBaseProcLink.h" namespace uking::ai { diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 791279011..bff5cdcdc 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,12 +1,11 @@ #pragma once -#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" - -namespace uking::ai { - +namespace uking { +class AirOctaDataMgr; +namespace ai { class AirOctaFlyUp : public ksys::act::ai::Ai { SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) - friend uking::AirOctaDataMgr; + friend AirOctaDataMgr; public: explicit AirOctaFlyUp(const InitArg& arg); @@ -39,5 +38,5 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { u32 mUserData; bool mIsEnded; }; - +} } // namespace uking::ai From 665357f944b61ba71d44237b0dac2e5749a12178 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 10 Jul 2023 22:53:38 -0400 Subject: [PATCH 58/79] undoing the forward declaration so it will compile --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 1 - src/Game/AI/AI/aiAirOctaFlyUp.h | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index ea042e374..5587a0c2a 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,6 +1,5 @@ #include "Game/AI/AI/aiAirOctaRoot.h" #include "Game/AI/AI/aiAirOctaFlyUp.h" -#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" #include "KingSystem/ActorSystem/actActor.h" #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index bff5cdcdc..791279011 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,11 +1,12 @@ #pragma once -namespace uking { -class AirOctaDataMgr; -namespace ai { +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" + +namespace uking::ai { + class AirOctaFlyUp : public ksys::act::ai::Ai { SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) - friend AirOctaDataMgr; + friend uking::AirOctaDataMgr; public: explicit AirOctaFlyUp(const InitArg& arg); @@ -38,5 +39,5 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { u32 mUserData; bool mIsEnded; }; -} + } // namespace uking::ai From e33e9b017058c8c16fe0419691392fca68cc2c69 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:19:54 -0500 Subject: [PATCH 59/79] Add files via upload --- src/KingSystem/ActorSystem/AS/ASList.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h index d81d855f6..b0eb0653f 100644 --- a/src/KingSystem/ActorSystem/AS/ASList.h +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -3,8 +3,10 @@ namespace ksys::as { class ASList{ public: -void StartAnimationMaybe( f32 a2, f32 a3, const sead::SafeString& animation_ASDefine, int buffer_size, int string_length, bool a7); -bool GoLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& SafeString, u32 a2) ; +void startAnimationMaybe( f32 a2, f32 a3, const sead::SafeString& animation, int a5, int a6, bool a7); +bool goLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& a2, u32 a3); // x_8 +s64 x_2(u32 a1, int a2, bool m, u32 a4); +u8 sub_710115D3B8(); }; } //namespace ksys::as From ab469a27fb97393d2043e4d92d107ca347fd83b5 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:21:54 -0500 Subject: [PATCH 60/79] Add files via upload --- src/Game/AI/aiAirOctaFlyUp.cpp | 112 +++++++++++++++++++++++++++++++++ src/Game/AI/aiAirOctaFlyUp.h | 43 +++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 src/Game/AI/aiAirOctaFlyUp.cpp create mode 100644 src/Game/AI/aiAirOctaFlyUp.h diff --git a/src/Game/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/aiAirOctaFlyUp.cpp new file mode 100644 index 000000000..3c542f0bb --- /dev/null +++ b/src/Game/AI/aiAirOctaFlyUp.cpp @@ -0,0 +1,112 @@ +#include "Game/AI/AI/aiAirOctaFlyUp.h" +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" +#include "Game/AI/AI/aiAirOctaRoot.h" +#include "KingSystem/ActorSystem/AS/ASList.h" +#include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actActorConstDataAccess.h" +#include "KingSystem/ActorSystem/actAiAi.h" +#include "KingSystem/ActorSystem/actBaseProcLink.h" +#include "KingSystem/System/VFR.h" +#include "KingSystem/Utils/Thread/Message.h" + +namespace uking::ai { + +AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} + +AirOctaFlyUp::~AirOctaFlyUp() = default; + +bool AirOctaFlyUp::init_(sead::Heap* heap) { + return ksys::act::ai::Ai::init_(heap); +} +// NON_MATCHING: stack for the sendMessage() message, type that y is casted to +void AirOctaFlyUp::calc_() { + auto* data_mgr = getDataMgr(); + if (!data_mgr) { + return; + } + auto dt = ksys::VFR::instance()->getDeltaTime(); + mElapsedTime += dt; + auto min = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_cycles = min < 1.f ? sead::Mathf::exp((min * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((min * 2.f) - 1.f * -10.f); + data_mgr->unk_114 = fly_up_cycles * 0.5f * *mTargetDistance_d; + data_mgr->changeOctasYheightMaybe(); + auto y = getActor()->getMtx().m[1][3]; + if (isCurrentChild("終了")) { // "End" + if (!mIsEnded) { + auto currentChild = getCurrentChild(); + if (currentChild->isFinished() || currentChild->isFailed()) { + auto as_list = getActor()->getASList(); + if (as_list) { + as_list->startAnimationMaybe(-1.f, -1.f, "Wait", 0, 0, true); + } + mIsEnded = true; + } else if (!mIsEnded) { + return; + } + } + if ((fly_up_cycles * 0.5f >= 1.f && y >= getDataMgr()->vec_F8.y) || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 3; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, + false); + } + } + } else if (y - AirOctaY >= *mTargetDistance_d * 0.9f || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 2; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, + false); + } + } +} + +bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { + if (message.getType().value != 0x80000c8) { + return false; + } + u32* user_data = static_cast(message.getUserData()); + auto* data_mgr = getDataMgr(); + if (!data_mgr) { + return true; + } + if (user_data == nullptr) { + return true; + } + if (*user_data == 3) { + Ai::changeChild("終了"); // Ended + } else if (*user_data == 4) { + ActionBase::setFinished(); + } + return true; +} + +void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { + if (auto* data_mgr = getDataMgr()) { + data_mgr->unk_114 = 0; + data_mgr->changeOctasYheightMaybe(); + } + auto& mtx = mActor->getMtx(); + AirOctaY = mtx(1, 3); + ksys::act::ai::Ai::changeChild("開始"); +} + +void AirOctaFlyUp::leave_() { + if (auto* data_mgr = getDataMgr()) { + data_mgr->unk_118 += *mTargetDistance_d; + data_mgr->unk_114 = 0; + data_mgr->changeOctasYheightMaybe(); + } +} + +void AirOctaFlyUp::loadParams_() { + getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); + getDynamicParam(&mTargetDistance_d, "TargetDistance"); + getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); +} + +} // namespace uking::ai diff --git a/src/Game/AI/aiAirOctaFlyUp.h b/src/Game/AI/aiAirOctaFlyUp.h new file mode 100644 index 000000000..e4a950da7 --- /dev/null +++ b/src/Game/AI/aiAirOctaFlyUp.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" +#include "KingSystem/ActorSystem/actAiAi.h" +namespace uking::ai { + +class AirOctaFlyUp : public ksys::act::ai::Ai { + SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) + friend uking::AirOctaDataMgr; + +public: + explicit AirOctaFlyUp(const InitArg& arg); + ~AirOctaFlyUp() override; + + bool handleMessage_(const ksys::Message& message) override; + bool init_(sead::Heap* heap) override; + void enter_(ksys::act::ai::InlineParamPack* params) override; + void leave_() override; + void loadParams_() override; + void calc_() override; + +protected: + AirOctaDataMgr* getDataMgr() const { + return sead::DynamicCast(*mAirOctaDataMgr_a); + } + // static_param at offset 0x38 + const float* mFlyUpDuration_s{}; + // dynamic_param at offset 0x40 + float* mTargetDistance_d{}; + // aitree_variable at offset 0x48 + // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with + // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference + // of 0 and make handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from + // nonmatching to matching and making another function go from matching to not really unmatching + // is still net progress void* mAirOctaDataMgr_a + AirOctaDataMgr** mAirOctaDataMgr_a{}; + float AirOctaY{}; + float mElapsedTime; + u32 mUserData; + bool mIsEnded; +}; + +} // namespace uking::ai From 77297901e6efedb7f1aed9cef46b374fe518728f Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:22:44 -0500 Subject: [PATCH 61/79] Add files via upload --- src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp | 2 +- src/Game/AI/AI/AirOcta/AirOctaDataMgr.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp index e064ad95e..bd6ab882d 100644 --- a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.cpp @@ -1,7 +1,7 @@ #include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" namespace uking { -void AirOctaDataMgr::ChangeOctasYheightMaybe() { +void AirOctaDataMgr::changeOctasYheightMaybe() { float result = vec_EC.y + unk_110 + unk_114 + unk_118 + unk_11c; vec_F8.y = result; } diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h index 462ae3a05..8ea1feb07 100644 --- a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h @@ -10,11 +10,11 @@ class AirOctaDataMgr { SEAD_RTTI_BASE(AirOctaDataMgr) public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - void ChangeOctasYheightMaybe(); + void changeOctasYheightMaybe(); - struct MessageData { - u32 unk_00; - u64 unk_08; + struct MessageData { + u32 unk_00; + u64 unk_08; }; /* 0x08 */ ksys::act::BaseProcLink mBaseProcLink; From b5e5dfe0c717f14ea5b65ed8bcd509a4f77b56b1 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:27:16 -0400 Subject: [PATCH 62/79] Delete src/Game/AI/aiAirOctaFlyUp.cpp --- src/Game/AI/aiAirOctaFlyUp.cpp | 112 --------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 src/Game/AI/aiAirOctaFlyUp.cpp diff --git a/src/Game/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/aiAirOctaFlyUp.cpp deleted file mode 100644 index 3c542f0bb..000000000 --- a/src/Game/AI/aiAirOctaFlyUp.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "Game/AI/AI/aiAirOctaFlyUp.h" -#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" -#include "Game/AI/AI/aiAirOctaRoot.h" -#include "KingSystem/ActorSystem/AS/ASList.h" -#include "KingSystem/ActorSystem/actActor.h" -#include "KingSystem/ActorSystem/actActorConstDataAccess.h" -#include "KingSystem/ActorSystem/actAiAi.h" -#include "KingSystem/ActorSystem/actBaseProcLink.h" -#include "KingSystem/System/VFR.h" -#include "KingSystem/Utils/Thread/Message.h" - -namespace uking::ai { - -AirOctaFlyUp::AirOctaFlyUp(const InitArg& arg) : ksys::act::ai::Ai(arg) {} - -AirOctaFlyUp::~AirOctaFlyUp() = default; - -bool AirOctaFlyUp::init_(sead::Heap* heap) { - return ksys::act::ai::Ai::init_(heap); -} -// NON_MATCHING: stack for the sendMessage() message, type that y is casted to -void AirOctaFlyUp::calc_() { - auto* data_mgr = getDataMgr(); - if (!data_mgr) { - return; - } - auto dt = ksys::VFR::instance()->getDeltaTime(); - mElapsedTime += dt; - auto min = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; - auto fly_up_cycles = min < 1.f ? sead::Mathf::exp((min * 2.f) - 1.f * 10.f) : - 2.f - sead::Mathf::exp((min * 2.f) - 1.f * -10.f); - data_mgr->unk_114 = fly_up_cycles * 0.5f * *mTargetDistance_d; - data_mgr->changeOctasYheightMaybe(); - auto y = getActor()->getMtx().m[1][3]; - if (isCurrentChild("終了")) { // "End" - if (!mIsEnded) { - auto currentChild = getCurrentChild(); - if (currentChild->isFinished() || currentChild->isFailed()) { - auto as_list = getActor()->getASList(); - if (as_list) { - as_list->startAnimationMaybe(-1.f, -1.f, "Wait", 0, 0, true); - } - mIsEnded = true; - } else if (!mIsEnded) { - return; - } - } - if ((fly_up_cycles * 0.5f >= 1.f && y >= getDataMgr()->vec_F8.y) || - mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { - ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { - mUserData = 3; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, - false); - } - } - } else if (y - AirOctaY >= *mTargetDistance_d * 0.9f || - mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { - ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { - mUserData = 2; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, - false); - } - } -} - -bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { - if (message.getType().value != 0x80000c8) { - return false; - } - u32* user_data = static_cast(message.getUserData()); - auto* data_mgr = getDataMgr(); - if (!data_mgr) { - return true; - } - if (user_data == nullptr) { - return true; - } - if (*user_data == 3) { - Ai::changeChild("終了"); // Ended - } else if (*user_data == 4) { - ActionBase::setFinished(); - } - return true; -} - -void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - if (auto* data_mgr = getDataMgr()) { - data_mgr->unk_114 = 0; - data_mgr->changeOctasYheightMaybe(); - } - auto& mtx = mActor->getMtx(); - AirOctaY = mtx(1, 3); - ksys::act::ai::Ai::changeChild("開始"); -} - -void AirOctaFlyUp::leave_() { - if (auto* data_mgr = getDataMgr()) { - data_mgr->unk_118 += *mTargetDistance_d; - data_mgr->unk_114 = 0; - data_mgr->changeOctasYheightMaybe(); - } -} - -void AirOctaFlyUp::loadParams_() { - getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); - getDynamicParam(&mTargetDistance_d, "TargetDistance"); - getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); -} - -} // namespace uking::ai From 73b3f832d2332fa31984bc9eab0d193681641a85 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:27:29 -0400 Subject: [PATCH 63/79] Delete src/Game/AI/aiAirOctaFlyUp.h --- src/Game/AI/aiAirOctaFlyUp.h | 43 ------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 src/Game/AI/aiAirOctaFlyUp.h diff --git a/src/Game/AI/aiAirOctaFlyUp.h b/src/Game/AI/aiAirOctaFlyUp.h deleted file mode 100644 index e4a950da7..000000000 --- a/src/Game/AI/aiAirOctaFlyUp.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" -#include "KingSystem/ActorSystem/actAiAi.h" -namespace uking::ai { - -class AirOctaFlyUp : public ksys::act::ai::Ai { - SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) - friend uking::AirOctaDataMgr; - -public: - explicit AirOctaFlyUp(const InitArg& arg); - ~AirOctaFlyUp() override; - - bool handleMessage_(const ksys::Message& message) override; - bool init_(sead::Heap* heap) override; - void enter_(ksys::act::ai::InlineParamPack* params) override; - void leave_() override; - void loadParams_() override; - void calc_() override; - -protected: - AirOctaDataMgr* getDataMgr() const { - return sead::DynamicCast(*mAirOctaDataMgr_a); - } - // static_param at offset 0x38 - const float* mFlyUpDuration_s{}; - // dynamic_param at offset 0x40 - float* mTargetDistance_d{}; - // aitree_variable at offset 0x48 - // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with - // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference - // of 0 and make handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from - // nonmatching to matching and making another function go from matching to not really unmatching - // is still net progress void* mAirOctaDataMgr_a - AirOctaDataMgr** mAirOctaDataMgr_a{}; - float AirOctaY{}; - float mElapsedTime; - u32 mUserData; - bool mIsEnded; -}; - -} // namespace uking::ai From edab6cbddd994768acd8a2103fa0d6777c572738 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:27:56 -0500 Subject: [PATCH 64/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 72 ++++++++++++++++--------------- src/Game/AI/AI/aiAirOctaFlyUp.h | 2 +- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 5587a0c2a..3c542f0bb 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,10 +1,11 @@ -#include "Game/AI/AI/aiAirOctaRoot.h" #include "Game/AI/AI/aiAirOctaFlyUp.h" +#include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" +#include "Game/AI/AI/aiAirOctaRoot.h" +#include "KingSystem/ActorSystem/AS/ASList.h" #include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actActorConstDataAccess.h" #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" -#include "KingSystem/ActorSystem/actActorConstDataAccess.h" -#include "KingSystem/ActorSystem/AS/ASList.h" #include "KingSystem/System/VFR.h" #include "KingSystem/Utils/Thread/Message.h" @@ -21,46 +22,47 @@ bool AirOctaFlyUp::init_(sead::Heap* heap) { void AirOctaFlyUp::calc_() { auto* data_mgr = getDataMgr(); if (!data_mgr) { - return; + return; } - auto deltaTime = ksys::VFR::instance()->getDeltaTime(); - mElapsedTime += deltaTime; - auto smallest_time = sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s); - auto smallest_time2 = smallest_time * 2.f; - auto smallest_time3 = (smallest_time * 2.f) - 1.f; - auto smallest_time4 = smallest_time2 < 1.f ? sead::Mathf::exp(smallest_time3 * 10.f) : 2.f - sead::Mathf::exp(smallest_time3 * -10.f); - auto smallest_time5 = smallest_time4 * 0.5f; - data_mgr->unk_114 = smallest_time5 * *mTargetDistance_d; - data_mgr->ChangeOctasYheightMaybe(); + auto dt = ksys::VFR::instance()->getDeltaTime(); + mElapsedTime += dt; + auto min = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_cycles = min < 1.f ? sead::Mathf::exp((min * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((min * 2.f) - 1.f * -10.f); + data_mgr->unk_114 = fly_up_cycles * 0.5f * *mTargetDistance_d; + data_mgr->changeOctasYheightMaybe(); auto y = getActor()->getMtx().m[1][3]; if (isCurrentChild("終了")) { // "End" if (!mIsEnded) { auto currentChild = getCurrentChild(); if (currentChild->isFinished() || currentChild->isFailed()) { - auto ASList = getActor()->getASList(); - if (ASList) { - ASList->StartAnimationMaybe(-1.f, -1.f, "Wait", 0, 0, true); + auto as_list = getActor()->getASList(); + if (as_list) { + as_list->startAnimationMaybe(-1.f, -1.f, "Wait", 0, 0, true); } mIsEnded = true; } else if (!mIsEnded) { return; } } - if ((smallest_time5 >= 1.f && y >= getDataMgr()->vec_F8.y) || - mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { - ksys::act::ActorConstDataAccess linkData; - if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { - mUserData = 3; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, false); - } - } - } else if (y - AirOctaY >= *mTargetDistance_d * 0.9f || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + if ((fly_up_cycles * 0.5f >= 1.f && y >= getDataMgr()->vec_F8.y) || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { ksys::act::ActorConstDataAccess linkData; if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { - mUserData = 2; - getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, false); + mUserData = 3; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, + false); } } + } else if (y - AirOctaY >= *mTargetDistance_d * 0.9f || + mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { + ksys::act::ActorConstDataAccess linkData; + if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { + mUserData = 2; + getActor()->sendMessage(*linkData.getMessageTransceiverId(), 0x80000C8, &mUserData, + false); + } + } } bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { @@ -75,18 +77,18 @@ bool AirOctaFlyUp::handleMessage_(const ksys::Message& message) { if (user_data == nullptr) { return true; } - if (*user_data == 3) { - Ai::changeChild("終了"); // END IN JAPANESE - } else if (*user_data == 4) { - ActionBase::setFinished(); - } - return true; + if (*user_data == 3) { + Ai::changeChild("終了"); // Ended + } else if (*user_data == 4) { + ActionBase::setFinished(); + } + return true; } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { if (auto* data_mgr = getDataMgr()) { data_mgr->unk_114 = 0; - data_mgr->ChangeOctasYheightMaybe(); + data_mgr->changeOctasYheightMaybe(); } auto& mtx = mActor->getMtx(); AirOctaY = mtx(1, 3); @@ -97,7 +99,7 @@ void AirOctaFlyUp::leave_() { if (auto* data_mgr = getDataMgr()) { data_mgr->unk_118 += *mTargetDistance_d; data_mgr->unk_114 = 0; - data_mgr->ChangeOctasYheightMaybe(); + data_mgr->changeOctasYheightMaybe(); } } diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index 791279011..e4a950da7 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -1,7 +1,7 @@ #pragma once #include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" - +#include "KingSystem/ActorSystem/actAiAi.h" namespace uking::ai { class AirOctaFlyUp : public ksys::act::ai::Ai { From 72ac0ba3264897faed706d91b1f2bdcc35918b76 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:32:06 -0500 Subject: [PATCH 65/79] Add files via upload --- data/uking_functions.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 60a6d514f..8b4dc1fa2 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20236,7 +20236,7 @@ Address,Quality,Size,Name 0x00000071002fae08,O,000288,_ZNK5uking2ai19AirOctaBurnReaction27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x00000071002faf28,O,000092,_ZNK5uking2ai19AirOctaBurnReaction18getRuntimeTypeInfoEv 0x00000071002faf84,U,000504, -0x00000071002fb17c,O,000044,_ZN5uking14AirOctaDataMgr23ChangeOctasYheightMaybeEv +0x00000071002fb17c,O,000044,_ZN5uking14AirOctaDataMgr23changeOctasYheightMaybeEv 0x00000071002fb1a8,U,000048, 0x00000071002fb1d8,U,000340, 0x00000071002fb32c,U,000020, From b66c16f84c520a4e30a3dd84de468e28b6eb7372 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:24:33 -0500 Subject: [PATCH 66/79] removed include and replaced with forward declare --- src/Game/AI/AI/aiAirOctaFlyUp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index e4a950da7..4f548a0ec 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -2,8 +2,9 @@ #include "Game/AI/AI/AirOcta/AirOctaDataMgr.h" #include "KingSystem/ActorSystem/actAiAi.h" -namespace uking::ai { - +namespace uking { +class AirOctaDataMgr; +namespace ai { class AirOctaFlyUp : public ksys::act::ai::Ai { SEAD_RTTI_OVERRIDE(AirOctaFlyUp, ksys::act::ai::Ai) friend uking::AirOctaDataMgr; @@ -40,4 +41,5 @@ class AirOctaFlyUp : public ksys::act::ai::Ai { bool mIsEnded; }; -} // namespace uking::ai +} // namespace ai +} // namespace uking From e1561aa3cbdbf1b9e1193e1bf793e263775920a4 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 18 Oct 2023 19:36:18 -0400 Subject: [PATCH 67/79] Add files via upload --- src/KingSystem/ActorSystem/actActor.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h index 2b9e41313..6bd2f65da 100644 --- a/src/KingSystem/ActorSystem/actActor.h +++ b/src/KingSystem/ActorSystem/actActor.h @@ -18,11 +18,15 @@ #include "KingSystem/Map/mapMubinIter.h" #include "KingSystem/Utils/AtomicLongBitFlag.h" #include "KingSystem/Utils/Thread/ActorMessageTransceiver.h" -#include "Game/Damage/dmgDamageManagerBase.h" + namespace gsys { class Model; } // namespace gsys +namespace uking::dmg{ +class DamageManagerBase; +} // namespace uking::dmg + namespace ksys { namespace as { @@ -232,11 +236,11 @@ const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.get virtual void m90(); virtual void m91(); virtual void m92(); - virtual void m93(); + virtual void m93(int a1, float a2); virtual void m94(); virtual void m95(); virtual void m96(); - virtual void getChemicalStuff(); + virtual Chemical* getChemicalStuff(); virtual void getWeapons(); virtual void getArmors(); virtual void m100(); From b87c223178a8aed8a9808b9aefed82c8088aef8f Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 18 Oct 2023 19:44:33 -0400 Subject: [PATCH 68/79] fixed naming issues --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 3c542f0bb..2a89eb819 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -26,10 +26,10 @@ void AirOctaFlyUp::calc_() { } auto dt = ksys::VFR::instance()->getDeltaTime(); mElapsedTime += dt; - auto min = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; - auto fly_up_cycles = min < 1.f ? sead::Mathf::exp((min * 2.f) - 1.f * 10.f) : - 2.f - sead::Mathf::exp((min * 2.f) - 1.f * -10.f); - data_mgr->unk_114 = fly_up_cycles * 0.5f * *mTargetDistance_d; + auto fly_up_cycles = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_multiplier = fly_up_cycles < 1.f ? sead::Mathf::exp((fly_up_cycles * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((fly_up_cycles * 2.f) - 1.f * -10.f); + data_mgr->unk_114 = fly_up_multiplier * 0.5f * *mTargetDistance_d; data_mgr->changeOctasYheightMaybe(); auto y = getActor()->getMtx().m[1][3]; if (isCurrentChild("終了")) { // "End" @@ -45,7 +45,7 @@ void AirOctaFlyUp::calc_() { return; } } - if ((fly_up_cycles * 0.5f >= 1.f && y >= getDataMgr()->vec_F8.y) || + if ((fly_up_multiplier * 0.5f >= 1.f && y >= getDataMgr()->vec_F8.y) || mElapsedTime >= (*mFlyUpDuration_s * 3.0f)) { ksys::act::ActorConstDataAccess linkData; if (ksys::act::acquireActor(&getDataMgr()->mBaseProcLink, &linkData)) { From f7a35d4195dd1c33957b95fcf73d8197b9b4a175 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:18:59 -0400 Subject: [PATCH 69/79] Add files via upload --- src/KingSystem/ActorSystem/actActor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h index 6bd2f65da..6648cea95 100644 --- a/src/KingSystem/ActorSystem/actActor.h +++ b/src/KingSystem/ActorSystem/actActor.h @@ -294,7 +294,6 @@ const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.get sead::Atomic& get68f() { return _68f; } float get6f0() const { return _6f0; } - uking::dmg::DamageManagerBase* getDamageMgrDerived(); void emitBasicSigOn(); void emitBasicSigOff(); bool checkBasicSig() const; From 21c3b20e783a2235c4f042fe5404b05795028bcd Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:27:48 -0400 Subject: [PATCH 70/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 2a89eb819..dae3bfe52 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -26,9 +26,9 @@ void AirOctaFlyUp::calc_() { } auto dt = ksys::VFR::instance()->getDeltaTime(); mElapsedTime += dt; - auto fly_up_cycles = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; - auto fly_up_multiplier = fly_up_cycles < 1.f ? sead::Mathf::exp((fly_up_cycles * 2.f) - 1.f * 10.f) : - 2.f - sead::Mathf::exp((fly_up_cycles * 2.f) - 1.f * -10.f); + auto fly_up_peaks = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_multiplier = fly_up_peaks < 1.f ? sead::Mathf::exp((fly_up_peaks * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((fly_up_peaks * 2.f) - 1.f * -10.f); data_mgr->unk_114 = fly_up_multiplier * 0.5f * *mTargetDistance_d; data_mgr->changeOctasYheightMaybe(); auto y = getActor()->getMtx().m[1][3]; From 2f16a2caa4ac4bde3d557783d30d131920e844ce Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:32:18 -0400 Subject: [PATCH 71/79] Add files via upload --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index dae3bfe52..e64ad312d 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -26,9 +26,9 @@ void AirOctaFlyUp::calc_() { } auto dt = ksys::VFR::instance()->getDeltaTime(); mElapsedTime += dt; - auto fly_up_peaks = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; - auto fly_up_multiplier = fly_up_peaks < 1.f ? sead::Mathf::exp((fly_up_peaks * 2.f) - 1.f * 10.f) : - 2.f - sead::Mathf::exp((fly_up_peaks * 2.f) - 1.f * -10.f); + auto fly_up_turning_pts = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_multiplier = fly_up_turning_pts < 1.f ? sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * -10.f); data_mgr->unk_114 = fly_up_multiplier * 0.5f * *mTargetDistance_d; data_mgr->changeOctasYheightMaybe(); auto y = getActor()->getMtx().m[1][3]; From 2fcb9de67c444501a6deda679797eafd54260b4f Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:40:35 -0400 Subject: [PATCH 72/79] made it a const that returns a const --- src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h index 396c7a39c..c17eadb8c 100644 --- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h +++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.h @@ -36,7 +36,7 @@ class ActorLinkConstDataAccess { bool hasProc() const { return mProc != nullptr; } - MesTransceiverId* getMessageTransceiverId() const; + const MesTransceiverId* getMessageTransceiverId() const; protected: friend class ActorConstDataAccess; From b7b865c2cf99dcf0004066b69c0d2160681b41cf Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:56:55 -0400 Subject: [PATCH 73/79] changed wip status of functions --- data/uking_functions.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 8b4dc1fa2..b66ed8d92 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -20246,9 +20246,9 @@ Address,Quality,Size,Name 0x00000071002fb38c,O,000036,_ZN5uking2ai12AirOctaFlyUpD0Ev 0x00000071002fb3b0,O,000008,_ZN5uking2ai12AirOctaFlyUp5init_EPN4sead4HeapE 0x00000071002fb3b8,O,000176,_ZN5uking2ai12AirOctaFlyUp6enter_EPN4ksys3act2ai15InlineParamPackE -0x00000071002fb468,m,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev +0x00000071002fb468,M,001116,_ZN5uking2ai12AirOctaFlyUp5calc_Ev 0x00000071002fb8c4,O,000176,_ZN5uking2ai12AirOctaFlyUp6leave_Ev -0x00000071002fb974,W,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev +0x00000071002fb974,M,000164,_ZN5uking2ai12AirOctaFlyUp11loadParams_Ev 0x00000071002fba18,O,000284,_ZN5uking2ai12AirOctaFlyUp14handleMessage_ERKN4ksys7MessageE 0x00000071002fbb34,U,000288, 0x00000071002fbc54,U,000092, @@ -20259,7 +20259,7 @@ Address,Quality,Size,Name 0x00000071002fbd14,U,000044,_ZN5uking2ai15AirOctaReaction6enter_EPN4ksys3act2ai15InlineParamPackE 0x00000071002fbd40,U,000004,_ZN5uking2ai15AirOctaReaction5calc_Ev 0x00000071002fbd44,O,000004,_ZN5uking2ai15AirOctaReaction6leave_Ev -0x00000071002fbd48,W,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev +0x00000071002fbd48,M,000084,_ZN5uking2ai15AirOctaReaction11loadParams_Ev 0x00000071002fbd9c,U,000132,_ZN5uking2ai15AirOctaReaction3m34Emj 0x00000071002fbe20,U,000008,_ZN5uking2ai15AirOctaReaction3m35EmjcPN4ksys3act2ai15InlineParamPackE 0x00000071002fbe28,U,000316,_ZN5uking2ai15AirOctaReaction3m42EPN4ksys3act2ai15InlineParamPackE From 7752540acd525b72e0388fc8d4f5b910aa081c62 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:20:37 -0400 Subject: [PATCH 74/79] hopefully formatting is good now --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index e64ad312d..7f7b1b0db 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -26,9 +26,11 @@ void AirOctaFlyUp::calc_() { } auto dt = ksys::VFR::instance()->getDeltaTime(); mElapsedTime += dt; - auto fly_up_turning_pts = (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; - auto fly_up_multiplier = fly_up_turning_pts < 1.f ? sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * 10.f) : - 2.f - sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * -10.f); + auto fly_up_turning_pts = + (sead::Mathf::min(1.0f, mElapsedTime / *mFlyUpDuration_s) * 2.f) - 1.f; + auto fly_up_multiplier = fly_up_turning_pts < 1.f ? + sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * 10.f) : + 2.f - sead::Mathf::exp((fly_up_turning_pts * 2.f) - 1.f * -10.f); data_mgr->unk_114 = fly_up_multiplier * 0.5f * *mTargetDistance_d; data_mgr->changeOctasYheightMaybe(); auto y = getActor()->getMtx().m[1][3]; @@ -102,7 +104,7 @@ void AirOctaFlyUp::leave_() { data_mgr->changeOctasYheightMaybe(); } } - +// NON_MATCHING: addresses that variables are loaded from void AirOctaFlyUp::loadParams_() { getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); getDynamicParam(&mTargetDistance_d, "TargetDistance"); From f04babc3717fb6cfc90cc110f30e313ccc286c76 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:24:29 -0400 Subject: [PATCH 75/79] this time? --- src/Game/AI/AI/AirOcta/AirOctaDataMgr.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h index 8ea1feb07..cb5af3864 100644 --- a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h @@ -1,9 +1,10 @@ #pragma once +#include +#include #include "KingSystem/ActorSystem/actActor.h" #include "KingSystem/ActorSystem/actAiClassDef.h" -#include -#include + namespace uking { class AirOctaDataMgr { @@ -13,8 +14,8 @@ class AirOctaDataMgr { void changeOctasYheightMaybe(); struct MessageData { - u32 unk_00; - u64 unk_08; + u32 unk_00; + u64 unk_08; }; /* 0x08 */ ksys::act::BaseProcLink mBaseProcLink; @@ -38,6 +39,5 @@ class AirOctaDataMgr { /*0x118 */ float unk_118; /*0x11c */ float unk_11c; /*0x120 */ u32 mFlags; - }; } // namespace uking \ No newline at end of file From ddd0025f2c677060c2676e9e644b0e9adfdc2861 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:26:04 -0400 Subject: [PATCH 76/79] idek --- src/Game/AI/AI/AirOcta/AirOctaDataMgr.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h index cb5af3864..9a681470a 100644 --- a/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h +++ b/src/Game/AI/AI/AirOcta/AirOctaDataMgr.h @@ -5,7 +5,6 @@ #include "KingSystem/ActorSystem/actActor.h" #include "KingSystem/ActorSystem/actAiClassDef.h" - namespace uking { class AirOctaDataMgr { SEAD_RTTI_BASE(AirOctaDataMgr) From e4079866e99aed8eefb7a9ce45a6bc562e63ac55 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:27:57 -0400 Subject: [PATCH 77/79] Add files via upload --- src/KingSystem/ActorSystem/actActor.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h index 6648cea95..fbd6d41d5 100644 --- a/src/KingSystem/ActorSystem/actActor.h +++ b/src/KingSystem/ActorSystem/actActor.h @@ -23,15 +23,15 @@ namespace gsys { class Model; } // namespace gsys -namespace uking::dmg{ +namespace uking::dmg { class DamageManagerBase; -} // namespace uking::dmg +} // namespace uking::dmg namespace ksys { namespace as { class ASList; -} //namespace as +} // namespace as namespace map { class Object; @@ -150,7 +150,7 @@ class Actor : public BaseProc, public ActorMessageTransceiver::IHandler { phys::RigidBody* getMainBody() const { return mMainBody; } phys::RigidBody* getTgtBody() const { return mTgtBody; } -const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.getId(); } + const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.getId(); } void sendMessage(const MesTransceiverId& dest, const MessageType& type, void* user_data, bool ack); @@ -294,6 +294,7 @@ const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.get sead::Atomic& get68f() { return _68f; } float get6f0() const { return _6f0; } + void emitBasicSigOn(); void emitBasicSigOff(); bool checkBasicSig() const; From b4b6841b2680d51b5a44d03583c4e5a5da2db6fe Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:30:10 -0400 Subject: [PATCH 78/79] Add files via upload From c2f717c8e166978d6bf0c933c82d899a2c7b4e52 Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:30:57 -0400 Subject: [PATCH 79/79] Add files via upload --- src/KingSystem/ActorSystem/AS/ASList.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/KingSystem/ActorSystem/AS/ASList.h b/src/KingSystem/ActorSystem/AS/ASList.h index b0eb0653f..b413d2de1 100644 --- a/src/KingSystem/ActorSystem/AS/ASList.h +++ b/src/KingSystem/ActorSystem/AS/ASList.h @@ -1,12 +1,13 @@ #pragma once #include "KingSystem/ActorSystem/actActor.h" namespace ksys::as { -class ASList{ +class ASList { public: -void startAnimationMaybe( f32 a2, f32 a3, const sead::SafeString& animation, int a5, int a6, bool a7); -bool goLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& a2, u32 a3); // x_8 -s64 x_2(u32 a1, int a2, bool m, u32 a4); -u8 sub_710115D3B8(); + void startAnimationMaybe(f32 a2, f32 a3, const sead::SafeString& animation, int a5, int a6, + bool a7); + bool goLimpFromHeadShotMaybe(u32 a1, const sead::SafeString& a2, u32 a3); // x_8 + s64 x_2(u32 a1, int a2, bool m, u32 a4); + u8 sub_710115D3B8(); }; -} //namespace ksys::as +} // namespace ksys::as