mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Boss/GolemClimb: Implement GolemDownBreakState
This commit is contained in:
parent
b6f947c559
commit
e53883687f
|
|
@ -13865,50 +13865,50 @@ Boss/GolemClimb/GolemDownBreakState.o:
|
|||
label:
|
||||
- _ZN19GolemDownBreakStateC1EPKcP14IUseGolemStateP15GolemShoutState
|
||||
- _ZN19GolemDownBreakStateC2EPKcP14IUseGolemStateP15GolemShoutState
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078dec
|
||||
size: 96
|
||||
label: _ZN19GolemDownBreakState6appearEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078e4c
|
||||
size: 60
|
||||
label: _ZN19GolemDownBreakState4killEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078e88
|
||||
size: 104
|
||||
label: _ZN19GolemDownBreakState9exeDamageEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078ef0
|
||||
size: 124
|
||||
label: _ZN19GolemDownBreakState8exeShoutEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078f6c
|
||||
size: 144
|
||||
label: _ZN19GolemDownBreakState10exeRecoverEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x078ffc
|
||||
size: 12
|
||||
label: _ZN19GolemDownBreakState10startBreakEP19GolemClimbWeakPointPKcS3_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x079008
|
||||
size: 36
|
||||
label: _ZN19GolemDownBreakStateD0Ev
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
lazy: true
|
||||
- offset: 0x07902c
|
||||
size: 108
|
||||
label: _ZNK12_GLOBAL__N_128GolemDownBreakStateNrvDamage7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x079098
|
||||
size: 128
|
||||
label: _ZNK12_GLOBAL__N_127GolemDownBreakStateNrvShout7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x079118
|
||||
size: 148
|
||||
label: _ZNK12_GLOBAL__N_129GolemDownBreakStateNrvRecover7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
Boss/GolemClimb/GolemFunction.o:
|
||||
'.text':
|
||||
|
|
|
|||
72
src/Boss/GolemClimb/GolemDownBreakState.cpp
Normal file
72
src/Boss/GolemClimb/GolemDownBreakState.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#include "Boss/GolemClimb/GolemDownBreakState.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(GolemDownBreakState, Damage);
|
||||
NERVE_IMPL(GolemDownBreakState, Shout);
|
||||
NERVE_IMPL(GolemDownBreakState, Recover);
|
||||
NERVES_MAKE_NOSTRUCT(GolemDownBreakState, Damage, Shout, Recover);
|
||||
} // namespace
|
||||
|
||||
GolemDownBreakState::GolemDownBreakState(const char* name, IUseGolemState* golemState,
|
||||
GolemShoutState* shoutState)
|
||||
: al::HostStateBase<IUseGolemState>(name, golemState), mShoutState(shoutState) {
|
||||
initNerve(&Damage, 0);
|
||||
}
|
||||
|
||||
void GolemDownBreakState::appear() {
|
||||
al::setVelocityZero(getHost()->getActor());
|
||||
al::startHitReaction(getHost()->getActor(), "弱点ヒット");
|
||||
al::setNerve(this, &Damage);
|
||||
NerveStateBase::appear();
|
||||
}
|
||||
|
||||
void GolemDownBreakState::kill() {
|
||||
mWeakPoint = nullptr;
|
||||
mDamageActionName = nullptr;
|
||||
mRecoverActionName = nullptr;
|
||||
getHost()->endPushSensor();
|
||||
NerveStateBase::kill();
|
||||
}
|
||||
|
||||
void GolemDownBreakState::exeDamage() {
|
||||
if (al::isFirstStep(this)) {
|
||||
mWeakPoint->startBreak();
|
||||
al::startAction(getHost()->getActor(), mDamageActionName);
|
||||
}
|
||||
if (mWeakPoint->isBreak())
|
||||
al::setNerve(this, &Shout);
|
||||
}
|
||||
|
||||
void GolemDownBreakState::exeShout() {
|
||||
if (al::isFirstStep(this))
|
||||
mShoutState->appear();
|
||||
mShoutState->control();
|
||||
if (al::isStep(this, 120)) {
|
||||
mShoutState->kill();
|
||||
al::setNerve(this, &Recover);
|
||||
}
|
||||
}
|
||||
|
||||
void GolemDownBreakState::exeRecover() {
|
||||
if (al::isFirstStep(this))
|
||||
al::startAction(getHost()->getActor(), mRecoverActionName);
|
||||
getHost()->updatePushSensor();
|
||||
if (al::isActionEnd(getHost()->getActor()) && getHost()->tryNextPushSensor())
|
||||
kill();
|
||||
}
|
||||
|
||||
void GolemDownBreakState::startBreak(GolemClimbWeakPoint* weakPoint, const char* damageActionName,
|
||||
const char* recoverActionName) {
|
||||
mWeakPoint = weakPoint;
|
||||
mDamageActionName = damageActionName;
|
||||
mRecoverActionName = recoverActionName;
|
||||
}
|
||||
27
src/Boss/GolemClimb/GolemDownBreakState.h
Normal file
27
src/Boss/GolemClimb/GolemDownBreakState.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/Nerve/NerveStateBase.h"
|
||||
|
||||
class GolemClimbWeakPoint;
|
||||
class GolemShoutState;
|
||||
class IUseGolemState;
|
||||
|
||||
class GolemDownBreakState : public al::HostStateBase<IUseGolemState> {
|
||||
public:
|
||||
GolemDownBreakState(const char* name, IUseGolemState* golemState, GolemShoutState* shoutState);
|
||||
void appear() override;
|
||||
void kill() override;
|
||||
void exeDamage();
|
||||
void exeShout();
|
||||
void exeRecover();
|
||||
void startBreak(GolemClimbWeakPoint* weakPoint, const char* damageActionName,
|
||||
const char* recoverActionName);
|
||||
|
||||
private:
|
||||
GolemShoutState* mShoutState = nullptr;
|
||||
GolemClimbWeakPoint* mWeakPoint = nullptr;
|
||||
const char* mDamageActionName = nullptr;
|
||||
const char* mRecoverActionName = nullptr;
|
||||
};
|
||||
|
||||
static_assert(sizeof(GolemDownBreakState) == 0x40);
|
||||
Loading…
Reference in a new issue