Boss/GolemClimb: Implement GolemStandBreakState (#984)

This commit is contained in:
guymakinggames 2026-04-09 20:28:59 +01:00 committed by GitHub
parent c66e7d2401
commit a122077d04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 199 additions and 11 deletions

View file

@ -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':

View file

@ -0,0 +1,32 @@
#pragma once
#include <basis/seadTypes.h>
#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;
};

View file

@ -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<IUseGolemState> {
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);
};

View file

@ -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<IUseGolemState>(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;
}

View file

@ -0,0 +1,24 @@
#pragma once
#include "Library/Nerve/NerveStateBase.h"
class GolemClimbWeakPoint;
class GolemShoutState;
class IUseGolemState;
class GolemStandBreakState : public al::HostStateBase<IUseGolemState> {
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);

View file

@ -0,0 +1,47 @@
#pragma once
#include <math/seadMatrix.h>
#include <math/seadQuat.h>
#include <math/seadVector.h>
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;
};