diff --git a/data/file_list.yml b/data/file_list.yml index 5c618b21..c7f6bd00 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -14258,50 +14258,50 @@ Boss/GolemClimb/GolemStandBreakState.o: label: - _ZN20GolemStandBreakStateC1EPKcP14IUseGolemStateP15GolemShoutState - _ZN20GolemStandBreakStateC2EPKcP14IUseGolemStateP15GolemShoutState - status: NotDecompiled + status: Matching - offset: 0x07d4e8 size: 96 label: _ZN20GolemStandBreakState6appearEv - status: NotDecompiled + status: Matching - offset: 0x07d548 size: 16 label: _ZN20GolemStandBreakState4killEv - status: NotDecompiled + status: Matching - offset: 0x07d558 size: 108 label: _ZN20GolemStandBreakState9exeDamageEv - status: NotDecompiled + status: Matching - offset: 0x07d5c4 size: 124 label: _ZN20GolemStandBreakState8exeShoutEv - status: NotDecompiled + status: Matching - offset: 0x07d640 size: 112 label: _ZN20GolemStandBreakState10exeRecoverEv - status: NotDecompiled + status: Matching - offset: 0x07d6b0 size: 8 label: _ZN20GolemStandBreakState10startBreakEP19GolemClimbWeakPoint - status: NotDecompiled + status: Matching - offset: 0x07d6b8 size: 36 label: _ZN20GolemStandBreakStateD0Ev - status: NotDecompiled + status: Matching lazy: true - offset: 0x07d6dc size: 112 label: _ZNK12_GLOBAL__N_129GolemStandBreakStateNrvDamage7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x07d74c size: 128 label: _ZNK12_GLOBAL__N_128GolemStandBreakStateNrvShout7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x07d7cc size: 116 label: _ZNK12_GLOBAL__N_130GolemStandBreakStateNrvRecover7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true Boss/Koopa/Koopa.o: '.text': diff --git a/src/Boss/GolemClimb/GolemClimbWeakPoint.h b/src/Boss/GolemClimb/GolemClimbWeakPoint.h new file mode 100644 index 00000000..a52f0301 --- /dev/null +++ b/src/Boss/GolemClimb/GolemClimbWeakPoint.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include "Library/Obj/PartsModel.h" + +namespace al { +class LiveActor; +struct ActorInitInfo; +class HitSensor; +} // namespace al + +class GolemClimbWeakPoint : public al::PartsModel { +public: + GolemClimbWeakPoint(al::LiveActor*, const al::ActorInitInfo&, const char*, const char*, + const char*, const char*, const char*, bool, bool); + void appear() override; + void kill() override; + void exeWait(); + void exePanic(); + void exeDamage(); + void exeBreak(); + void exeBlowDown(); + void exeDemo(); + void setWait(); + void setPanic(); + void receiveMsgThrust(al::HitSensor*, al::HitSensor*); + void receiveMsgHipDrop(al::HitSensor*, al::HitSensor*); + void startBreak(); + void startDemo(const char*); + bool isBreak() const; +}; diff --git a/src/Boss/GolemClimb/GolemShoutState.h b/src/Boss/GolemClimb/GolemShoutState.h new file mode 100644 index 00000000..14f982a4 --- /dev/null +++ b/src/Boss/GolemClimb/GolemShoutState.h @@ -0,0 +1,20 @@ +#pragma once + +#include "Library/Nerve/NerveStateBase.h" + +namespace al { +class SensorMsg; +class HitSensor; +} // namespace al + +class IUseGolemState; + +class GolemShoutState : public al::HostStateBase { +public: + GolemShoutState(const char* name, IUseGolemState* golemState); + void appear() override; + void kill() override; + void control() override; + bool receiveMsg(const al::SensorMsg*, al::HitSensor* self, al::HitSensor* other); + void attackSensor(al::HitSensor* self, al::HitSensor* other); +}; diff --git a/src/Boss/GolemClimb/GolemStandBreakState.cpp b/src/Boss/GolemClimb/GolemStandBreakState.cpp new file mode 100644 index 00000000..e14c0380 --- /dev/null +++ b/src/Boss/GolemClimb/GolemStandBreakState.cpp @@ -0,0 +1,65 @@ +#include "Boss/GolemClimb/GolemStandBreakState.h" + +#include "Library/LiveActor/ActorActionFunction.h" +#include "Library/LiveActor/ActorMovementFunction.h" +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Nerve/NerveUtil.h" + +#include "Boss/GolemClimb/GolemClimbWeakPoint.h" +#include "Boss/GolemClimb/GolemShoutState.h" +#include "Boss/GolemClimb/IUseGolemState.h" + +namespace { +NERVE_IMPL(GolemStandBreakState, Damage); +NERVE_IMPL(GolemStandBreakState, Shout); +NERVE_IMPL(GolemStandBreakState, Recover); +NERVES_MAKE_NOSTRUCT(GolemStandBreakState, Damage, Shout, Recover); +} // namespace + +GolemStandBreakState::GolemStandBreakState(const char* name, IUseGolemState* golemState, + GolemShoutState* shoutState) + : al::HostStateBase(name, golemState), mShoutState(shoutState) { + initNerve(&Damage, 0); +} + +void GolemStandBreakState::appear() { + al::setVelocityZero(getHost()->getActor()); + al::startHitReaction(getHost()->getActor(), "弱点ヒット"); + al::setNerve(this, &Damage); + NerveStateBase::appear(); +} + +void GolemStandBreakState::kill() { + mWeakPoint = nullptr; + NerveStateBase::kill(); +} + +void GolemStandBreakState::exeDamage() { + if (al::isFirstStep(this)) { + mWeakPoint->startBreak(); + al::startAction(getHost()->getActor(), "StandDamageLast"); + } + if (mWeakPoint->isBreak()) + al::setNerve(this, &Shout); +} + +void GolemStandBreakState::exeShout() { + if (al::isFirstStep(this)) + mShoutState->appear(); + mShoutState->control(); + if (al::isStep(this, 120)) { + mShoutState->kill(); + al::setNerve(this, &Recover); + } +} + +void GolemStandBreakState::exeRecover() { + if (al::isFirstStep(this)) + al::startAction(getHost()->getActor(), "StandRecover"); + if (al::isActionEnd(getHost()->getActor())) + kill(); +} + +void GolemStandBreakState::startBreak(GolemClimbWeakPoint* weakPoint) { + mWeakPoint = weakPoint; +} diff --git a/src/Boss/GolemClimb/GolemStandBreakState.h b/src/Boss/GolemClimb/GolemStandBreakState.h new file mode 100644 index 00000000..4d14573d --- /dev/null +++ b/src/Boss/GolemClimb/GolemStandBreakState.h @@ -0,0 +1,24 @@ +#pragma once + +#include "Library/Nerve/NerveStateBase.h" + +class GolemClimbWeakPoint; +class GolemShoutState; +class IUseGolemState; + +class GolemStandBreakState : public al::HostStateBase { +public: + GolemStandBreakState(const char* name, IUseGolemState* golemState, GolemShoutState* shoutState); + void appear() override; + void kill() override; + void exeDamage(); + void exeShout(); + void exeRecover(); + void startBreak(GolemClimbWeakPoint* weakPoint); + +private: + GolemShoutState* mShoutState = nullptr; + GolemClimbWeakPoint* mWeakPoint = nullptr; +}; + +static_assert(sizeof(GolemStandBreakState) == 0x30); diff --git a/src/Boss/GolemClimb/IUseGolemState.h b/src/Boss/GolemClimb/IUseGolemState.h new file mode 100644 index 00000000..9917a272 --- /dev/null +++ b/src/Boss/GolemClimb/IUseGolemState.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include + +namespace al { +class LiveActor; +} + +class GolemClimbThrustPoint; +class GolemClimbWeakPoint; +class GolemJointIKRootCtrl; +class IUseDemoSkip; + +class IUseGolemState { +public: + virtual void updateLookAt() = 0; + virtual void throwSearchBomb() = 0; + virtual void throwReflectBomb() = 0; + virtual void throwTsukkun() = 0; + virtual void startDemo() = 0; + virtual void endDemo() = 0; + virtual void replaceDemoPlayer() = 0; + virtual al::LiveActor* getActor() = 0; + virtual al::LiveActor* getSkeleton() = 0; + virtual void getShoutPos(sead::Vector3f*) const = 0; + virtual GolemJointIKRootCtrl* getFootRootL() const = 0; + virtual GolemJointIKRootCtrl* getFootRootR() const = 0; + virtual GolemClimbThrustPoint* getThrustPointL() const = 0; + virtual GolemClimbThrustPoint* getThrustPointR() const = 0; + virtual GolemClimbWeakPoint* getWeakPoint(s32) const = 0; + virtual bool isPrepareShout() const = 0; + virtual void startShout() = 0; + virtual void endShout() = 0; + virtual IUseDemoSkip* getDemoSkip() = 0; + virtual void stampFoot(const sead::Vector3f&, const sead::Quatf&) = 0; + virtual void showDamageArea() = 0; + virtual void hideDamageArea() = 0; + virtual void setDamageAreaPose(const sead::Matrix34f&) = 0; + virtual bool isInFootL() = 0; + virtual bool isInFootR() = 0; + virtual bool isMoon() = 0; + virtual void updatePushSensor() = 0; + virtual void endPushSensor() = 0; + virtual bool tryNextPushSensor() const = 0; +};