Boss/FireBlower: Implement FireBlowerCap

This commit is contained in:
guymakinggames 2026-04-21 22:17:58 +01:00
parent b6f947c559
commit 1d972048b6
4 changed files with 124 additions and 15 deletions

View file

@ -11107,66 +11107,66 @@ Boss/FireBlower/FireBlowerCap.o:
- offset: 0x05de48
size: 132
label: _ZN13FireBlowerCapC2Ev
status: NotDecompiled
status: Matching
- offset: 0x05decc
size: 136
label: _ZN13FireBlowerCapC1Ev
status: NotDecompiled
status: Matching
- offset: 0x05df54
size: 160
label: _ZN13FireBlowerCap7initCapEPN2al9LiveActorERKNS0_13ActorInitInfoE
status: NotDecompiled
status: Matching
- offset: 0x05dff4
size: 52
label: _ZN13FireBlowerCap6appearEv
status: NotDecompiled
status: Matching
- offset: 0x05e028
size: 56
label: _ZN13FireBlowerCap9disappearEPKN2al9HitSensorES3_
status: NotDecompiled
status: Matching
- offset: 0x05e060
size: 88
label: _ZN13FireBlowerCap9exeAppearEv
status: NotDecompiled
status: Matching
- offset: 0x05e0b8
size: 60
label: _ZN13FireBlowerCap7exeWaitEv
status: NotDecompiled
status: Matching
- offset: 0x05e0f4
size: 52
label: _ZN13FireBlowerCap22appearResetAttackStartEv
status: NotDecompiled
status: Matching
- offset: 0x05e128
size: 60
label: _ZN13FireBlowerCap19exeResetAttackStartEv
status: NotDecompiled
status: Matching
- offset: 0x05e164
size: 60
label: _ZN13FireBlowerCap12exeDisappearEv
status: NotDecompiled
status: Matching
- offset: 0x05e1a0
size: 16
label: _ZNK13FireBlowerCap11isDisappearEv
status: NotDecompiled
status: Matching
- offset: 0x05e1b0
size: 64
label: _ZNK12_GLOBAL__N_123FireBlowerCapNrvCapWait7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x05e1f0
size: 64
label: _ZNK12_GLOBAL__N_128FireBlowerCapNrvCapDisappear7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x05e230
size: 92
label: _ZNK12_GLOBAL__N_125FireBlowerCapNrvCapAppear7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x05e28c
size: 64
label: _ZNK12_GLOBAL__N_135FireBlowerCapNrvCapResetAttackStart7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x05e2cc
size: 68

View file

@ -33,6 +33,8 @@ public:
void offSyncAppearAndHide();
void onSyncAppearAndHide();
void setPoseUpdate(bool isUpdate) { mIsUpdate = isUpdate; }
private:
LiveActor* mParentModel = nullptr;
const sead::Matrix34f* mJointMtx = nullptr;

View file

@ -0,0 +1,77 @@
#include "Boss/FireBlower/FireBlowerCap.h"
#include "Library/LiveActor/ActorActionFunction.h"
#include "Library/LiveActor/ActorInitUtil.h"
#include "Library/Movement/EnemyStateBlowDown.h"
#include "Library/Nerve/NerveSetupUtil.h"
#include "Library/Nerve/NerveUtil.h"
namespace {
NERVE_IMPL_(FireBlowerCap, CapWait, Wait)
NERVE_IMPL_(FireBlowerCap, CapDisappear, Disappear)
NERVE_IMPL_(FireBlowerCap, CapAppear, Appear)
NERVE_IMPL_(FireBlowerCap, CapResetAttackStart, ResetAttackStart)
NERVES_MAKE_NOSTRUCT(FireBlowerCap, CapAppear, CapResetAttackStart, CapWait, CapDisappear)
static al::EnemyStateBlowDownParam sFireBlowerCapBlowDownParam =
al::EnemyStateBlowDownParam("Disappear", 18.0f, 35.0f, 1.0f, 0.9f, 120, true);
} // namespace
FireBlowerCap::FireBlowerCap() : al::PartsModel("FireBlowerCap") {}
void FireBlowerCap::initCap(al::LiveActor* actor, const al::ActorInitInfo& initInfo) {
initPartsFixFile(actor, initInfo, "FireBlowerCap", nullptr, "Cap");
al::initNerve(this, &CapWait, 1);
mStateBlowDown = new al::EnemyStateBlowDown(this, &sFireBlowerCapBlowDownParam, "吹き飛び状態");
al::initNerveState(this, mStateBlowDown, &CapDisappear, "帽子吹き飛び挙動");
makeActorAlive();
}
void FireBlowerCap::appear() {
setPoseUpdate(true);
al::LiveActor::appear();
al::setNerve(this, &CapAppear);
}
void FireBlowerCap::disappear(const al::HitSensor* sourceSensor,
const al::HitSensor* targetSensor) {
setPoseUpdate(false);
mStateBlowDown->start(sourceSensor, targetSensor);
al::setNerve(this, &CapDisappear);
}
void FireBlowerCap::exeAppear() {
if (al::isFirstStep(this))
al::startAction(this, "Appear");
if (al::isActionEnd(this))
al::setNerve(this, &CapWait);
}
void FireBlowerCap::exeWait() {
if (al::isFirstStep(this))
al::startAction(this, "Wait");
}
void FireBlowerCap::appearResetAttackStart() {
setPoseUpdate(true);
al::LiveActor::appear();
al::setNerve(this, &CapResetAttackStart);
}
void FireBlowerCap::exeResetAttackStart() {
if (al::isFirstStep(this))
al::startAction(this, "ResetAttackStart");
}
void FireBlowerCap::exeDisappear() {
if (al::updateNerveState(this))
kill();
}
bool FireBlowerCap::isDisappear() const {
return al::isNerve(this, &CapDisappear);
}

View file

@ -0,0 +1,30 @@
#pragma once
#include "Library/Obj/PartsModel.h"
namespace al {
struct ActorInitInfo;
class EnemyStateBlowDown;
class HitSensor;
class LiveActor;
} // namespace al
class FireBlowerCap : public al::PartsModel {
public:
FireBlowerCap();
void initCap(al::LiveActor* actor, const al::ActorInitInfo& initInfo);
void appear() override;
void disappear(const al::HitSensor* sourceSensor, const al::HitSensor* targetSensor);
void exeAppear();
void exeWait();
void appearResetAttackStart();
void exeResetAttackStart();
void exeDisappear();
bool isDisappear() const;
private:
al::EnemyStateBlowDown* mStateBlowDown = nullptr;
};
static_assert(sizeof(FireBlowerCap) == 0x150);