mirror of https://github.com/zeldaret/botw.git
ksys/act: Start adding Ai
This commit is contained in:
parent
610e627e25
commit
bf5be970dc
|
@ -17,6 +17,8 @@
|
||||||
0x00000071024C1600,_ZTVN3agl3utl9ParameterIN4sead15FixedSafeStringILi64EEEEE
|
0x00000071024C1600,_ZTVN3agl3utl9ParameterIN4sead15FixedSafeStringILi64EEEEE
|
||||||
0x00000071024C16A0,_ZTVN3agl3utl9ParameterIN4sead15FixedSafeStringILi256EEEEE
|
0x00000071024C16A0,_ZTVN3agl3utl9ParameterIN4sead15FixedSafeStringILi256EEEEE
|
||||||
0x00000071024C1740,_ZTVN3agl3utl9ParameterIN4sead14SafeStringBaseIcEEEE
|
0x00000071024C1740,_ZTVN3agl3utl9ParameterIN4sead14SafeStringBaseIcEEEE
|
||||||
|
0x00000071024D8D58,_ZTVN4ksys3act2ai10ActionBaseE
|
||||||
|
0x0000007102513268,_ZTVN4ksys3act2ai2AiE
|
||||||
0x00000071025F75B0,pfnc_nvnDeviceBuilderSetDefaults
|
0x00000071025F75B0,pfnc_nvnDeviceBuilderSetDefaults
|
||||||
0x00000071025F75B8,pfnc_nvnDeviceBuilderSetFlags
|
0x00000071025F75B8,pfnc_nvnDeviceBuilderSetFlags
|
||||||
0x00000071025F75C0,pfnc_nvnDeviceInitialize
|
0x00000071025F75C0,pfnc_nvnDeviceInitialize
|
||||||
|
|
|
|
@ -1322,13 +1322,13 @@
|
||||||
0x000000710004c1d8,AI_AIOrActionBase::ret1_0,8,_ZN4ksys3act2ai10ActionBase3m18Ev
|
0x000000710004c1d8,AI_AIOrActionBase::ret1_0,8,_ZN4ksys3act2ai10ActionBase3m18Ev
|
||||||
0x000000710004c1e0,AI_AIOrActionBase::m19_null,4,_ZN4ksys3act2ai10ActionBase3m19Ev
|
0x000000710004c1e0,AI_AIOrActionBase::m19_null,4,_ZN4ksys3act2ai10ActionBase3m19Ev
|
||||||
0x000000710004c1e4,AI_AIOrActionBase::ret0_0,8,_ZN4ksys3act2ai10ActionBase3m22Ev
|
0x000000710004c1e4,AI_AIOrActionBase::ret0_0,8,_ZN4ksys3act2ai10ActionBase3m22Ev
|
||||||
0x000000710004c1ec,AI_AIOrActionBase::ret0_1,8,_ZN4ksys3act2ai10ActionBase3m24Ev
|
0x000000710004c1ec,AI_AIOrActionBase::ret0_1,8,_ZNK4ksys3act2ai10ActionBase14getNumChildrenEv
|
||||||
0x000000710004c1f4,AI_AIOrActionBase::ret1_1,8,_ZN4ksys3act2ai10ActionBase3m25Ev
|
0x000000710004c1f4,AI_AIOrActionBase::ret1_1,8,_ZN4ksys3act2ai10ActionBase3m25Ev
|
||||||
0x000000710004c1fc,AI_AIOrActionBase::ret0_5,8,_ZNK4ksys3act2ai10ActionBase15getCurrentChildEv
|
0x000000710004c1fc,AI_AIOrActionBase::ret0_5,8,_ZNK4ksys3act2ai10ActionBase15getCurrentChildEv
|
||||||
0x000000710004c204,AI_ActionBase::isAction,8,_ZNK4ksys3act2ai6Action8isActionEv
|
0x000000710004c204,AI_ActionBase::isAction,8,_ZNK4ksys3act2ai6Action8isActionEv
|
||||||
0x000000710004c20c,AI_AIOrActionBase::m28,16,_ZN4ksys3act2ai10ActionBase7reenterEPS2_
|
0x000000710004c20c,AI_AIOrActionBase::m28,16,_ZN4ksys3act2ai10ActionBase7reenterEPS2_
|
||||||
0x000000710004c21c,AI_AIOrActionBase::m29_null,4,_ZN4ksys3act2ai10ActionBase9postLeaveEv
|
0x000000710004c21c,AI_AIOrActionBase::m29_null,4,_ZN4ksys3act2ai10ActionBase9postLeaveEv
|
||||||
0x000000710004c220,AI_AIOrActionBase::ret0_6,8,_ZNK4ksys3act2ai10ActionBase9getActionEi
|
0x000000710004c220,AI_AIOrActionBase::ret0_6,8,_ZNK4ksys3act2ai10ActionBase8getChildEi
|
||||||
0x000000710004c228,sub_710004C228,140,
|
0x000000710004c228,sub_710004C228,140,
|
||||||
0x000000710004c2b4,sub_710004C2B4,140,
|
0x000000710004c2b4,sub_710004C2B4,140,
|
||||||
0x000000710004c340,AI_Action_AnimeDrivenTurn::ctor,104,
|
0x000000710004c340,AI_Action_AnimeDrivenTurn::ctor,104,
|
||||||
|
@ -20064,11 +20064,11 @@
|
||||||
0x00000071002f6548,AI_AI_ActorWaterDepthSelect::m4,36,
|
0x00000071002f6548,AI_AI_ActorWaterDepthSelect::m4,36,
|
||||||
0x00000071002f656c,AI_AI_ActorWaterDepthSelect::m5,36,
|
0x00000071002f656c,AI_AI_ActorWaterDepthSelect::m5,36,
|
||||||
0x00000071002f6590,AI_AI_ActorWaterDepthSelect::m6,36,
|
0x00000071002f6590,AI_AI_ActorWaterDepthSelect::m6,36,
|
||||||
0x00000071002f65b4,AI_AIBase::m24,8,
|
0x00000071002f65b4,AI_AIBase::m24,8,_ZNK4ksys3act2ai2Ai14getNumChildrenEv
|
||||||
0x00000071002f65bc,AI_AIBase::isAction,8,
|
0x00000071002f65bc,AI_AIBase::isAction,8,_ZNK4ksys3act2ai2Ai8isActionEv
|
||||||
0x00000071002f65c4,AI_AIBase::m29,8,
|
0x00000071002f65c4,AI_AIBase::m29,8,_ZN4ksys3act2ai2Ai9postLeaveEv?
|
||||||
0x00000071002f65cc,AI_AIBase::m30,28,
|
0x00000071002f65cc,AI_AIBase::m30,28,_ZNK4ksys3act2ai2Ai8getChildEi
|
||||||
0x00000071002f65e8,AI_AIBase::handlePendingChildChange,12,
|
0x00000071002f65e8,AI_AIBase::handlePendingChildChange,12,_ZN4ksys3act2ai2Ai25handlePendingChildChange_Ev
|
||||||
0x00000071002f65f4,AI_AI_AddBasicLinkOn::ctor,104,
|
0x00000071002f65f4,AI_AI_AddBasicLinkOn::ctor,104,
|
||||||
0x00000071002f665c,AI_AI_AddBasicLinkOn::dtor,88,
|
0x00000071002f665c,AI_AI_AddBasicLinkOn::dtor,88,
|
||||||
0x00000071002f66b4,sub_71002F66B4,64,
|
0x00000071002f66b4,sub_71002F66B4,64,
|
||||||
|
@ -22848,7 +22848,7 @@
|
||||||
0x0000007100367694,AI_AI_DragonDropItemTargetRootAI::dtorDelete,36,
|
0x0000007100367694,AI_AI_DragonDropItemTargetRootAI::dtorDelete,36,
|
||||||
0x00000071003676b8,AI_AI_DragonDropItemTargetRootAI::rtti1,288,
|
0x00000071003676b8,AI_AI_DragonDropItemTargetRootAI::rtti1,288,
|
||||||
0x00000071003677d8,AI_AI_DragonDropItemTargetRootAI::rtti2,92,
|
0x00000071003677d8,AI_AI_DragonDropItemTargetRootAI::rtti2,92,
|
||||||
0x0000007100367834,AI_AIBase::calc,4,
|
0x0000007100367834,AI_AIBase::calc,4,_ZN4ksys3act2ai2Ai5calc_Ev
|
||||||
0x0000007100367838,AI_AI_DragonElecRoot::ctor,48,
|
0x0000007100367838,AI_AI_DragonElecRoot::ctor,48,
|
||||||
0x0000007100367868,j_AI_AIDragonRoot::dtor,4,
|
0x0000007100367868,j_AI_AIDragonRoot::dtor,4,
|
||||||
0x000000710036786c,AI_AI_DragonElecRoot::dtorDelete,36,
|
0x000000710036786c,AI_AI_DragonElecRoot::dtorDelete,36,
|
||||||
|
@ -92253,13 +92253,13 @@
|
||||||
0x00000071011dde80,sub_71011DDE80,8,
|
0x00000071011dde80,sub_71011DDE80,8,
|
||||||
0x00000071011dde88,sub_71011DDE88,48,
|
0x00000071011dde88,sub_71011DDE88,48,
|
||||||
0x00000071011ddeb8,sub_71011DDEB8,92,
|
0x00000071011ddeb8,sub_71011DDEB8,92,
|
||||||
0x00000071011ddf14,AI_AIBase::ctor,64,
|
0x00000071011ddf14,AI_AIBase::ctor,64,_ZN4ksys3act2ai2AiC1ERKNS1_10ActionBase7InitArgE
|
||||||
0x00000071011ddf54,AI_AIBase::dtor,84,
|
0x00000071011ddf54,AI_AIBase::dtor,84,_ZN4ksys3act2ai2AiD1Ev
|
||||||
0x00000071011ddfa8,AI_AIBase::dtorDelete,92,
|
0x00000071011ddfa8,AI_AIBase::dtorDelete,92,_ZN4ksys3act2ai2AiD0Ev
|
||||||
0x00000071011de004,AI_AIBase::m25,132,
|
0x00000071011de004,AI_AIBase::m25,132,
|
||||||
0x00000071011de088,AI_AIBase::initChildStates,580,
|
0x00000071011de088,AI_AIBase::initChildStates,580,
|
||||||
0x00000071011de2cc,AI_AIBase::x_0,340,
|
0x00000071011de2cc,AI_AIBase::x_0,340,
|
||||||
0x00000071011de420,AI_AIBase::calcRecursively,156,
|
0x00000071011de420,AI_AIBase::calcRecursively,156,_ZN4ksys3act2ai2Ai4calcEv
|
||||||
0x00000071011de4bc,AI_AIBase::x,76,
|
0x00000071011de4bc,AI_AIBase::x,76,
|
||||||
0x00000071011de508,sub_71011DE508,276,
|
0x00000071011de508,sub_71011DE508,276,
|
||||||
0x00000071011de61c,sub_71011DE61C,24,
|
0x00000071011de61c,sub_71011DE61C,24,
|
||||||
|
@ -92268,16 +92268,16 @@
|
||||||
0x00000071011de7b4,AI_AIBase::doChangeState,440,
|
0x00000071011de7b4,AI_AIBase::doChangeState,440,
|
||||||
0x00000071011de96c,AI_AIBase::changeState,96,
|
0x00000071011de96c,AI_AIBase::changeState,96,
|
||||||
0x00000071011de9cc,AI_AIBase::m28,400,
|
0x00000071011de9cc,AI_AIBase::m28,400,
|
||||||
0x00000071011deb5c,AI_AIBase::m6,72,
|
0x00000071011deb5c,AI_AIBase::m6,72,_ZNK4ksys3act2ai2Ai10isFlag4SetEv
|
||||||
0x00000071011deba4,AI_AIBase::getCurrentChildState,52,
|
0x00000071011deba4,AI_AIBase::getCurrentChildState,52,_ZNK4ksys3act2ai2Ai15getCurrentChildEv
|
||||||
0x00000071011debd8,AI_AIBase::isState,196,
|
0x00000071011debd8,AI_AIBase::isState,196,
|
||||||
0x00000071011dec9c,ai::ActorAI::checkAction,188,
|
0x00000071011dec9c,ai::ActorAI::checkAction,188,
|
||||||
0x00000071011ded58,sub_71011DED58,24,
|
0x00000071011ded58,sub_71011DED58,24,_ZN4ksys3act2ai2Ai14updateChildIdxEt
|
||||||
0x00000071011ded70,AI_AIBase::m22,116,
|
0x00000071011ded70,AI_AIBase::m22,116,
|
||||||
0x00000071011dede4,AI_AIBase::m31,224,
|
0x00000071011dede4,AI_AIBase::m31,224,
|
||||||
0x00000071011deec4,AI_AIBase::m23,216,
|
0x00000071011deec4,AI_AIBase::m23,216,
|
||||||
0x00000071011def9c,AI_AIBase::rtti1,204,
|
0x00000071011def9c,AI_AIBase::rtti1,204,_ZNK4ksys3act2ai2Ai27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
|
||||||
0x00000071011df068,AI_AIBase::rtti2,92,
|
0x00000071011df068,AI_AIBase::rtti2,92,_ZNK4ksys3act2ai2Ai18getRuntimeTypeInfoEv
|
||||||
0x00000071011df0c4,ai::AIs::ctor,28,
|
0x00000071011df0c4,ai::AIs::ctor,28,
|
||||||
0x00000071011df0e0,sub_71011DF0E0,4,
|
0x00000071011df0e0,sub_71011DF0E0,4,
|
||||||
0x00000071011df0e4,sub_71011DF0E4,200,
|
0x00000071011df0e4,sub_71011DF0E4,200,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -25,6 +25,8 @@ target_sources(uking PRIVATE
|
||||||
actAiAction.h
|
actAiAction.h
|
||||||
actAiActionBase.cpp
|
actAiActionBase.cpp
|
||||||
actAiActionBase.h
|
actAiActionBase.h
|
||||||
|
actAiAi.cpp
|
||||||
|
actAiAi.h
|
||||||
actAiClassDef.cpp
|
actAiClassDef.cpp
|
||||||
actAiClassDef.h
|
actAiClassDef.h
|
||||||
actAiParam.cpp
|
actAiParam.cpp
|
||||||
|
|
|
@ -31,8 +31,8 @@ public:
|
||||||
const char* getName() const;
|
const char* getName() const;
|
||||||
bool init(sead::Heap* heap, bool load_map_or_tree_params);
|
bool init(sead::Heap* heap, bool load_map_or_tree_params);
|
||||||
|
|
||||||
virtual bool isFinished() const;
|
|
||||||
virtual bool isFailed() const;
|
virtual bool isFailed() const;
|
||||||
|
virtual bool isFinished() const;
|
||||||
virtual bool isFlag4Set() const;
|
virtual bool isFlag4Set() const;
|
||||||
|
|
||||||
virtual bool m7() { return false; }
|
virtual bool m7() { return false; }
|
||||||
|
@ -52,13 +52,13 @@ public:
|
||||||
virtual void getCurrentName(sead::BufferedSafeString* name, ActionBase* parent) const;
|
virtual void getCurrentName(sead::BufferedSafeString* name, ActionBase* parent) const;
|
||||||
virtual void* m22() { return nullptr; }
|
virtual void* m22() { return nullptr; }
|
||||||
virtual void getParams(ParamNameTypePairs* pairs, bool update_use_count) const;
|
virtual void getParams(ParamNameTypePairs* pairs, bool update_use_count) const;
|
||||||
virtual s32 m24() { return 0; }
|
virtual s32 getNumChildren() const { return 0; }
|
||||||
virtual bool m25() { return true; }
|
virtual bool m25() { return true; }
|
||||||
virtual ActionBase* getCurrentChild() const { return nullptr; }
|
virtual ActionBase* getCurrentChild() const { return nullptr; }
|
||||||
virtual bool isAction() const = 0;
|
virtual bool isAction() const = 0;
|
||||||
virtual bool reenter(ActionBase* other) { return reenter_(other, false); }
|
virtual bool reenter(ActionBase* other) { return reenter_(other, false); }
|
||||||
virtual void postLeave() {}
|
virtual void postLeave() {}
|
||||||
virtual ActionBase* getAction(s32 idx) const { return nullptr; }
|
virtual ActionBase* getChild(s32 idx) const { return nullptr; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum class Flag : u8 {
|
enum class Flag : u8 {
|
||||||
|
@ -83,8 +83,6 @@ protected:
|
||||||
u16 mDefinitionIdx;
|
u16 mDefinitionIdx;
|
||||||
u8 mRootIdx;
|
u8 mRootIdx;
|
||||||
sead::TypedBitFlag<Flag> mFlags;
|
sead::TypedBitFlag<Flag> mFlags;
|
||||||
u16 mClassIdx;
|
|
||||||
u16 mPrevClassIdx;
|
|
||||||
};
|
};
|
||||||
KSYS_CHECK_SIZE_NX150(ActionBase, 0x20);
|
KSYS_CHECK_SIZE_NX150(ActionBase, 0x20);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include "KingSystem/ActorSystem/actAiAi.h"
|
||||||
|
|
||||||
|
namespace ksys::act::ai {
|
||||||
|
|
||||||
|
Ai::Ai(const ActionBase::InitArg& arg) : ActionBase(arg) {}
|
||||||
|
|
||||||
|
Ai::~Ai() {
|
||||||
|
mChildren.freeBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ai::calc() {
|
||||||
|
calc_();
|
||||||
|
|
||||||
|
auto* child = getCurrentChild();
|
||||||
|
if (child)
|
||||||
|
child->calc();
|
||||||
|
|
||||||
|
if (mPendingChildIdx != InvalidIdx && mChildIdx != mPendingChildIdx) {
|
||||||
|
handlePendingChildChange_();
|
||||||
|
auto* new_child = getCurrentChild();
|
||||||
|
if (new_child)
|
||||||
|
new_child->calc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Ai::isFlag4Set() const {
|
||||||
|
auto* child = getCurrentChild();
|
||||||
|
if (child)
|
||||||
|
return child->isFlag4Set();
|
||||||
|
|
||||||
|
return mFlags.isOn(Flag::_4);
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionBase* Ai::getCurrentChild() const {
|
||||||
|
if (mChildIdx == InvalidIdx)
|
||||||
|
return nullptr;
|
||||||
|
return mChildren[mChildIdx];
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ai::updateChildIdx(u16 new_idx) {
|
||||||
|
const auto prev_idx = mChildIdx;
|
||||||
|
mChildIdx = new_idx;
|
||||||
|
mPrevChildIdx = prev_idx;
|
||||||
|
mPendingChildIdx = InvalidIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::act::ai
|
|
@ -0,0 +1,45 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <container/seadBuffer.h>
|
||||||
|
#include "KingSystem/ActorSystem/actAiActionBase.h"
|
||||||
|
|
||||||
|
namespace ksys::act::ai {
|
||||||
|
|
||||||
|
class Ai : public ActionBase {
|
||||||
|
SEAD_RTTI_OVERRIDE(Ai, ActionBase)
|
||||||
|
public:
|
||||||
|
explicit Ai(const InitArg& arg);
|
||||||
|
~Ai() override;
|
||||||
|
|
||||||
|
bool isFlag4Set() const override;
|
||||||
|
bool reenter_(ActionBase* other, bool x) override;
|
||||||
|
void calc() override;
|
||||||
|
void* m22() override;
|
||||||
|
void getParams(ParamNameTypePairs* pairs, bool update_use_count) const override;
|
||||||
|
s32 getNumChildren() const override { return mChildren.size(); }
|
||||||
|
bool m25() override;
|
||||||
|
ActionBase* getCurrentChild() const override;
|
||||||
|
bool isAction() const override { return false; }
|
||||||
|
bool reenter(ActionBase* other) override;
|
||||||
|
void postLeave() override { updateChildIdx(InvalidIdx); }
|
||||||
|
ActionBase* getChild(s32 idx) const override { return mChildren[idx]; }
|
||||||
|
virtual const char* getPreviousName();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void calc_() {}
|
||||||
|
virtual void handlePendingChildChange_() { changeChildState(mPendingChildIdx); }
|
||||||
|
void updateChildIdx(u16 new_idx);
|
||||||
|
void changeChildState(u16 idx, InlineParamPack* params = nullptr);
|
||||||
|
|
||||||
|
static constexpr u16 InvalidIdx = 0xffff;
|
||||||
|
|
||||||
|
// TODO: give better names to these variables
|
||||||
|
u16 mChildIdx = InvalidIdx;
|
||||||
|
u16 mPrevChildIdx = InvalidIdx;
|
||||||
|
u16 mPendingChildIdx = InvalidIdx;
|
||||||
|
u16 mNewChildIdx = InvalidIdx;
|
||||||
|
sead::Buffer<ActionBase*> mChildren;
|
||||||
|
};
|
||||||
|
KSYS_CHECK_SIZE_NX150(Ai, 0x38);
|
||||||
|
|
||||||
|
} // namespace ksys::act::ai
|
Loading…
Reference in New Issue