mirror of
https://github.com/zeldaret/botw
synced 2026-06-24 17:03:19 -04:00
AiAction and AiClass getters and setter functions
This commit is contained in:
@@ -4,4 +4,8 @@ namespace ksys::act::ai {
|
||||
|
||||
Action::Action(const ClassArg& arg) : ActionBase(arg) {}
|
||||
|
||||
bool Action::isAction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ksys::act::ai
|
||||
|
||||
@@ -11,8 +11,9 @@ public:
|
||||
|
||||
virtual void enter() {}
|
||||
virtual void loadParams() {}
|
||||
|
||||
virtual void oneShot() {}
|
||||
|
||||
bool isAction() override;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(Action, 0x20);
|
||||
|
||||
|
||||
@@ -5,4 +5,22 @@ namespace ksys::act::ai {
|
||||
ActionBase::ActionBase(const ClassArg& arg)
|
||||
: mActor{arg.actor}, mDefinitionIdx{u16(arg.definitionIdx)}, mRootIdx{u8(arg.rootIdx)} {}
|
||||
|
||||
bool ActionBase::isFinished() {
|
||||
return mStatus.isOn(Status::Finished);
|
||||
}
|
||||
|
||||
bool ActionBase::isFailed() {
|
||||
return mStatus.isOn(Status::Failed);
|
||||
}
|
||||
|
||||
void ActionBase::setFinished() {
|
||||
mStatus.set(Status::Finished);
|
||||
mStatus.reset(Status::Failed);
|
||||
}
|
||||
|
||||
void ActionBase::setFailed() {
|
||||
mStatus.set(Status::Failed);
|
||||
mStatus.reset(Status::Finished);
|
||||
}
|
||||
|
||||
} // namespace ksys::act::ai
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
|
||||
#include <prim/seadTypedBitFlag.h>
|
||||
#include "KingSystem/ActorSystem/actActor.h"
|
||||
#include "KingSystem/ActorSystem/actAiParam.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
@@ -23,8 +24,24 @@ public:
|
||||
ActionBase(const ClassArg& arg);
|
||||
virtual ~ActionBase() = default;
|
||||
|
||||
virtual bool isAction();
|
||||
|
||||
enum class Status : u8 {
|
||||
Finished = 1,
|
||||
Failed = 2,
|
||||
_4 = 4,
|
||||
TriggerAction = 8,
|
||||
DynamicParamChild = 0x10,
|
||||
_20 = 0x20,
|
||||
_40 = 0x40,
|
||||
_80 = 0x80,
|
||||
};
|
||||
|
||||
protected:
|
||||
bool isFinished();
|
||||
bool isFailed();
|
||||
void setFinished();
|
||||
void setFailed();
|
||||
|
||||
template <typename T>
|
||||
void getParamStatic(ParamRef<T>* value, const sead::SafeString& key);
|
||||
@@ -33,7 +50,7 @@ protected:
|
||||
ParamPack mParams;
|
||||
u16 mDefinitionIdx;
|
||||
u8 mRootIdx;
|
||||
u8 mStatus = 0;
|
||||
sead::TypedBitFlag<Status, u8> mStatus;
|
||||
u16 mClassIdx;
|
||||
u16 mPrevClassIdx;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user