diff --git a/data/file_list.yml b/data/file_list.yml index 900aa3d4a..6fc71da30 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -15928,53 +15928,53 @@ Boss/Koopa/KoopaCappyEyes2D.o: - offset: 0x08ac50 size: 120 label: _ZN16KoopaCappyEyes2DC2EPKc - status: NotDecompiled + status: Matching - offset: 0x08acc8 size: 132 label: _ZN16KoopaCappyEyes2DC1EPKc - status: NotDecompiled + status: Matching - offset: 0x08ad4c size: 56 label: _ZN16KoopaCappyEyes2D4initERKN2al13ActorInitInfoE - status: NotDecompiled + status: Matching - offset: 0x08ad84 size: 44 label: _ZN16KoopaCappyEyes2D6appearEv - status: NotDecompiled + status: Matching - offset: 0x08adb0 size: 68 label: _ZN16KoopaCappyEyes2D9disappearEv - status: NotDecompiled + status: Matching - offset: 0x08adf4 size: 12 label: _ZNK16KoopaCappyEyes2D19isPlayingAppearAnimEv - status: NotDecompiled + status: Matching - offset: 0x08ae00 size: 64 label: _ZN16KoopaCappyEyes2D9exeAppearEv - status: NotDecompiled + status: Matching - offset: 0x08ae40 size: 60 label: _ZN16KoopaCappyEyes2D7exeWaitEv - status: NotDecompiled + status: Matching - offset: 0x08ae7c size: 88 label: _ZN16KoopaCappyEyes2D12exeDisappearEv - status: NotDecompiled + status: Matching - offset: 0x08aed4 size: 68 label: _ZNK12_GLOBAL__N_125KoopaCappyEyes2DNrvAppear7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x08af18 size: 92 label: _ZNK12_GLOBAL__N_128KoopaCappyEyes2DNrvDisappear7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x08af74 size: 64 label: _ZNK12_GLOBAL__N_123KoopaCappyEyes2DNrvWait7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true Boss/Koopa/KoopaCapScaleAnimator.o: '.text': diff --git a/src/Boss/Koopa/KoopaCappyEyes2D.cpp b/src/Boss/Koopa/KoopaCappyEyes2D.cpp new file mode 100644 index 000000000..3ee95f562 --- /dev/null +++ b/src/Boss/Koopa/KoopaCappyEyes2D.cpp @@ -0,0 +1,53 @@ +#include "Boss/Koopa/KoopaCappyEyes2D.h" + +#include "Library/LiveActor/ActorActionFunction.h" +#include "Library/LiveActor/ActorInitUtil.h" +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Nerve/NerveUtil.h" + +namespace { +NERVE_IMPL(KoopaCappyEyes2D, Appear) +NERVE_IMPL(KoopaCappyEyes2D, Disappear) +NERVE_IMPL(KoopaCappyEyes2D, Wait) + +NERVES_MAKE_NOSTRUCT(KoopaCappyEyes2D, Appear, Disappear, Wait) +} // namespace + +KoopaCappyEyes2D::KoopaCappyEyes2D(const char* name) : al::PartsModel(name) {} + +void KoopaCappyEyes2D::init(const al::ActorInitInfo& info) { + al::initNerve(this, &Appear, 0); + makeActorDead(); +} + +void KoopaCappyEyes2D::appear() { + al::LiveActor::appear(); + al::setNerve(this, &Appear); +} + +void KoopaCappyEyes2D::disappear() { + if (!al::isNerve(this, &Disappear)) + al::setNerve(this, &Disappear); +} + +bool KoopaCappyEyes2D::isPlayingAppearAnim() const { + return al::isNerve(this, &Appear); +} + +void KoopaCappyEyes2D::exeAppear() { + if (al::isFirstStep(this)) + al::startAction(this, "Appear"); + al::setNerveAtActionEnd(this, &Wait); +} + +void KoopaCappyEyes2D::exeWait() { + if (al::isFirstStep(this)) + al::startAction(this, "Wait"); +} + +void KoopaCappyEyes2D::exeDisappear() { + if (al::isFirstStep(this)) + al::startAction(this, "Disappear"); + if (al::isActionEnd(this)) + kill(); +} diff --git a/src/Boss/Koopa/KoopaCappyEyes2D.h b/src/Boss/Koopa/KoopaCappyEyes2D.h new file mode 100644 index 000000000..ec7f3bd19 --- /dev/null +++ b/src/Boss/Koopa/KoopaCappyEyes2D.h @@ -0,0 +1,20 @@ +#pragma once + +#include "Library/Obj/PartsModel.h" + +class KoopaCappyEyes2D : public al::PartsModel { +public: + KoopaCappyEyes2D(const char* name); + + void init(const al::ActorInitInfo& info) override; + void appear() override; + + void disappear(); + bool isPlayingAppearAnim() const; + + void exeAppear(); + void exeWait(); + void exeDisappear(); +}; + +static_assert(sizeof(KoopaCappyEyes2D) == 0x148);