diff --git a/data/file_list.yml b/data/file_list.yml index 0e7a7041..3e1ce136 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -12417,80 +12417,80 @@ Boss/GiantWanderBoss/GiantWanderBossStateAttack.o: label: - _ZN26GiantWanderBossStateAttackC1EPN2al9LiveActorE - _ZN26GiantWanderBossStateAttackC2EPN2al9LiveActorE - status: NotDecompiled + status: Matching - offset: 0x06af24 size: 16 label: _ZN26GiantWanderBossStateAttack6appearEv - status: NotDecompiled + status: Matching - offset: 0x06af34 size: 68 label: _ZN26GiantWanderBossStateAttack4killEv - status: NotDecompiled + status: Matching - offset: 0x06af78 size: 16 label: _ZN26GiantWanderBossStateAttack15startWithBulletEP21GiantWanderBossBullet - status: NotDecompiled + status: Matching - offset: 0x06af88 size: 24 label: _ZN26GiantWanderBossStateAttack23startWithMineFirstPhaseEP19GiantWanderBossMine - status: NotDecompiled + status: Matching - offset: 0x06afa0 size: 24 label: _ZN26GiantWanderBossStateAttack19startWithMineEscapeEP19GiantWanderBossMine - status: NotDecompiled + status: Matching - offset: 0x06afb8 size: 24 label: _ZN26GiantWanderBossStateAttack22startWithMineLongRangeEP19GiantWanderBossMine - status: NotDecompiled + status: Matching - offset: 0x06afd0 size: 128 label: _ZN26GiantWanderBossStateAttack13exeAttackSignEv - status: NotDecompiled + status: Matching - offset: 0x06b050 size: 132 label: _ZN26GiantWanderBossStateAttack17exeAttackSignWaitEv - status: NotDecompiled + status: Matching - offset: 0x06b0d4 size: 128 label: _ZN26GiantWanderBossStateAttack14exeAttackStartEv - status: NotDecompiled + status: Matching - offset: 0x06b154 size: 192 label: _ZN26GiantWanderBossStateAttack9exeAttackEv - status: NotDecompiled + status: Matching - offset: 0x06b214 size: 88 label: _ZN26GiantWanderBossStateAttack12exeAttackEndEv - status: NotDecompiled + status: Matching - offset: 0x06b26c size: 36 label: _ZN26GiantWanderBossStateAttackD0Ev - status: NotDecompiled + status: Matching lazy: true - offset: 0x06b290 size: 8 label: _ZNK12_GLOBAL__N_139GiantWanderBossStateAttackNrvAttackSign7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x06b298 size: 8 label: _ZNK12_GLOBAL__N_143GiantWanderBossStateAttackNrvAttackSignWait7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x06b2a0 size: 8 label: _ZNK12_GLOBAL__N_140GiantWanderBossStateAttackNrvAttackStart7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x06b2a8 size: 8 label: _ZNK12_GLOBAL__N_135GiantWanderBossStateAttackNrvAttack7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x06b2b0 size: 92 label: _ZNK12_GLOBAL__N_138GiantWanderBossStateAttackNrvAttackEnd7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true Boss/GiantWanderBoss/GiantWanderBossStateEscape.o: '.text': diff --git a/src/Boss/GiantWanderBoss/GiantWanderBossBullet.h b/src/Boss/GiantWanderBoss/GiantWanderBossBullet.h new file mode 100644 index 00000000..71bb7b93 --- /dev/null +++ b/src/Boss/GiantWanderBoss/GiantWanderBossBullet.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +#include "Library/LiveActor/LiveActor.h" + +namespace al { +struct ActorInitInfo; +class HitSensor; +class SensorMsg; +} // namespace al + +class GiantWanderBossBullet : public al::LiveActor { +public: + GiantWanderBossBullet(const char*); + + void init(const al::ActorInitInfo&) override; + void appear() override; + void kill() override; + void control() override; + void attackSensor(al::HitSensor* self, al::HitSensor* other) override; + bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other, + al::HitSensor* self) override; + void appearAttach(const sead::Matrix34f*, const sead::Vector3f*, bool); + void startLaunch(); + bool isLaunched() const; + void exeAppearAttach(); + void exeFly(); + void resetPositionByAnim(); + void checkCollideAndSendMsg(); + +private: + u8 _108[0x78]; +}; + +static_assert(sizeof(GiantWanderBossBullet) == 0x180); diff --git a/src/Boss/GiantWanderBoss/GiantWanderBossMine.h b/src/Boss/GiantWanderBoss/GiantWanderBossMine.h new file mode 100644 index 00000000..6d02966f --- /dev/null +++ b/src/Boss/GiantWanderBoss/GiantWanderBossMine.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include + +#include "Library/LiveActor/LiveActor.h" + +namespace al { +struct ActorInitInfo; +class HitSensor; +class SensorMsg; +} // namespace al + +class GiantWanderBossMine : public al::LiveActor { +public: + GiantWanderBossMine(const char*); + + void init(const al::ActorInitInfo&) override; + void appear() override; + void kill() override; + void control() override; + void attackSensor(al::HitSensor* self, al::HitSensor* other) override; + bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other, + al::HitSensor* self) override; + void appearAttach(const sead::Matrix34f*, const sead::Vector3f*); + bool isLaunched() const; + bool isEnableLaunch() const; + bool isAttach() const; + void startLaunchForOnGlass(const sead::Vector3f&); + void startLaunchForFirstPhase(); + void startLaunchForEscape(); + void startLaunchForLongRange(); + void exeAppearAttach(); + void exeFlyDown(); + void resetPositionByAnim(); + void checkCollideAndSendMsg(); + void exeFlyParabolic(); + void exeSignExplosion(); + void exeExplosion(); + void exeDie(); + +private: + u8 _108[0xe8]; +}; + +static_assert(sizeof(GiantWanderBossMine) == 0x1f0); diff --git a/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.cpp b/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.cpp new file mode 100644 index 00000000..85502684 --- /dev/null +++ b/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.cpp @@ -0,0 +1,157 @@ +#include "Boss/GiantWanderBoss/GiantWanderBossStateAttack.h" + +#include "Library/LiveActor/ActorActionFunction.h" +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Nerve/NerveUtil.h" + +#include "Boss/GiantWanderBoss/GiantWanderBossBullet.h" +#include "Boss/GiantWanderBoss/GiantWanderBossMine.h" + +namespace { +NERVE_IMPL(GiantWanderBossStateAttack, AttackSign) +NERVE_IMPL(GiantWanderBossStateAttack, AttackSignWait) +NERVE_IMPL(GiantWanderBossStateAttack, AttackStart) +NERVE_IMPL(GiantWanderBossStateAttack, Attack) +NERVE_IMPL(GiantWanderBossStateAttack, AttackEnd) + +NERVES_MAKE_NOSTRUCT(GiantWanderBossStateAttack, AttackSign, AttackSignWait, AttackStart, Attack, + AttackEnd) +} // namespace + +GiantWanderBossStateAttack::GiantWanderBossStateAttack(al::LiveActor* actor) + : al::ActorStateBase("徘徊ボス攻撃", actor) { + initNerve(&AttackSign, 0); +} + +void GiantWanderBossStateAttack::appear() { + NerveStateBase::appear(); + al::setNerve(this, &AttackSign); +} + +void GiantWanderBossStateAttack::kill() { + NerveStateBase::kill(); + + if (mBullet) + mBullet->startLaunch(); + + if (mMine) + mMine->startLaunchForFirstPhase(); +} + +void GiantWanderBossStateAttack::startWithBullet(GiantWanderBossBullet* bullet) { + mBullet = bullet; + mMine = nullptr; + al::setNerve(this, &AttackSign); +} + +void GiantWanderBossStateAttack::startWithMineFirstPhase(GiantWanderBossMine* mine) { + mBullet = nullptr; + mMine = mine; + mMineAttackType = 1; + al::setNerve(this, &AttackSign); +} + +void GiantWanderBossStateAttack::startWithMineEscape(GiantWanderBossMine* mine) { + mBullet = nullptr; + mMine = mine; + mMineAttackType = 2; + al::setNerve(this, &AttackSign); +} + +void GiantWanderBossStateAttack::startWithMineLongRange(GiantWanderBossMine* mine) { + mBullet = nullptr; + mMine = mine; + mMineAttackType = 3; + al::setNerve(this, &AttackSign); +} + +void GiantWanderBossStateAttack::exeAttackSign() { + if (al::isFirstStep(this)) { + al::startAction(mActor, "AttackSign"); + + if (mMine) + al::startAction(mMine, "AttackSign"); + + if (mBullet) + al::startAction(mBullet, "AttackSign"); + } + + if (al::isActionEnd(mActor)) + al::setNerve(this, &AttackSignWait); +} + +void GiantWanderBossStateAttack::exeAttackSignWait() { + if (al::isFirstStep(this)) { + al::startAction(mActor, "AttackSignWait"); + + if (mMine) + al::startAction(mMine, "AttackSignWait"); + + if (mBullet) + al::startAction(mBullet, "AttackSignWait"); + } + + if (al::isGreaterEqualStep(this, 30)) + al::setNerve(this, &AttackStart); +} + +void GiantWanderBossStateAttack::exeAttackStart() { + if (al::isFirstStep(this)) { + al::startAction(mActor, "AttackStart"); + + if (mMine) + al::startAction(mMine, "AttackStart"); + + if (mBullet) + al::startAction(mBullet, "AttackStart"); + } + + if (al::isActionEnd(mActor)) + al::setNerve(this, &Attack); +} + +void GiantWanderBossStateAttack::exeAttack() { + if (al::isFirstStep(this)) { + al::startAction(mActor, "Attack"); + + if (mBullet) { + mBullet->startLaunch(); + mBullet = nullptr; + } else { + GiantWanderBossMine** mine; + + switch (mMineAttackType) { + case 3: + mine = &mMine; + mMine->startLaunchForLongRange(); + break; + case 1: + mine = &mMine; + mMine->startLaunchForFirstPhase(); + break; + case 2: + mine = &mMine; + mMine->startLaunchForEscape(); + break; + default: + mine = &mMine; + break; + } + + *mine = nullptr; + } + } + + if (al::isActionEnd(mActor)) + al::setNerve(this, &AttackEnd); +} + +void GiantWanderBossStateAttack::exeAttackEnd() { + if (al::isFirstStep(this)) + al::startAction(mActor, "AttackEnd"); + + if (al::isActionEnd(mActor)) { + al::NerveStateBase* state = this; + state->kill(); + } +} diff --git a/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.h b/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.h new file mode 100644 index 00000000..abbe3200 --- /dev/null +++ b/src/Boss/GiantWanderBoss/GiantWanderBossStateAttack.h @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include "Library/Nerve/NerveStateBase.h" + +namespace al { +class LiveActor; +} // namespace al + +class GiantWanderBossBullet; +class GiantWanderBossMine; + +class GiantWanderBossStateAttack : public al::ActorStateBase { +public: + GiantWanderBossStateAttack(al::LiveActor* actor); + + void appear() override; + void kill() override; + void startWithBullet(GiantWanderBossBullet* bullet); + void startWithMineFirstPhase(GiantWanderBossMine* mine); + void startWithMineEscape(GiantWanderBossMine* mine); + void startWithMineLongRange(GiantWanderBossMine* mine); + void exeAttackSign(); + void exeAttackSignWait(); + void exeAttackStart(); + void exeAttack(); + void exeAttackEnd(); + + al::LiveActor* getActor() const { return mActor; } + +private: + GiantWanderBossBullet* mBullet = nullptr; + GiantWanderBossMine* mMine = nullptr; + s32 mMineAttackType = 0; +}; + +static_assert(sizeof(GiantWanderBossStateAttack) == 0x38);