Boss/Koopa: Implement KoopaFireBeamGround (#983)

This commit is contained in:
guymakinggames 2026-04-09 11:33:42 +01:00 committed by GitHub
parent 4f8518a772
commit c66e7d2401
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 88 additions and 11 deletions

View file

@ -16599,48 +16599,48 @@ Boss/Koopa/KoopaFireBeamGround.o:
- offset: 0x092324
size: 120
label: _ZN19KoopaFireBeamGroundC2EPKc
status: NotDecompiled
status: Matching
- offset: 0x09239c
size: 132
label: _ZN19KoopaFireBeamGroundC1EPKc
status: NotDecompiled
status: Matching
- offset: 0x092420
size: 112
label: _ZN19KoopaFireBeamGround4initERKN2al13ActorInitInfoE
status: NotDecompiled
status: Matching
- offset: 0x092490
size: 44
label: _ZN19KoopaFireBeamGround10appearSignEv
status: NotDecompiled
status: Matching
- offset: 0x0924bc
size: 44
label: _ZN19KoopaFireBeamGround6appearEv
status: NotDecompiled
status: Matching
- offset: 0x0924e8
size: 100
label: _ZN19KoopaFireBeamGround12attackSensorEPN2al9HitSensorES2_
status: NotDecompiled
status: Matching
- offset: 0x09254c
size: 8
label: _ZN19KoopaFireBeamGround10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
status: NotDecompiled
status: Matching
- offset: 0x092554
size: 60
label: _ZN19KoopaFireBeamGround13exeAppearSignEv
status: NotDecompiled
status: Matching
- offset: 0x092590
size: 60
label: _ZN19KoopaFireBeamGround7exeWaitEv
status: NotDecompiled
status: Matching
- offset: 0x0925cc
size: 64
label: _ZNK12_GLOBAL__N_132KoopaFireBeamGroundNrvAppearSign7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x09260c
size: 64
label: _ZNK12_GLOBAL__N_126KoopaFireBeamGroundNrvWait7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
Boss/Koopa/KoopaFlag.o:
'.text':

View file

@ -0,0 +1,56 @@
#include "Boss/Koopa/KoopaFireBeamGround.h"
#include "Library/LiveActor/ActorActionFunction.h"
#include "Library/LiveActor/ActorInitUtil.h"
#include "Library/LiveActor/ActorSensorUtil.h"
#include "Library/Nerve/NerveSetupUtil.h"
#include "Library/Nerve/NerveUtil.h"
#include "Util/PlayerUtil.h"
namespace {
NERVE_IMPL(KoopaFireBeamGround, AppearSign)
NERVE_IMPL(KoopaFireBeamGround, Wait)
NERVES_MAKE_NOSTRUCT(KoopaFireBeamGround, AppearSign, Wait)
} // namespace
KoopaFireBeamGround::KoopaFireBeamGround(const char* name) : al::LiveActor(name) {}
void KoopaFireBeamGround::init(const al::ActorInitInfo& info) {
al::initActorWithArchiveName(this, info, "KoopaFireBeamGround", nullptr);
al::initNerve(this, &AppearSign, 0);
makeActorDead();
}
void KoopaFireBeamGround::appearSign() {
al::LiveActor::appear();
al::setNerve(this, &AppearSign);
}
void KoopaFireBeamGround::appear() {
al::LiveActor::appear();
al::setNerve(this, &Wait);
}
void KoopaFireBeamGround::attackSensor(al::HitSensor* self, al::HitSensor* other) {
if (!al::isNerve(this, &AppearSign) && rs::isPlayerOnGround(this))
al::sendMsgEnemyAttackFire(other, self, nullptr);
}
bool KoopaFireBeamGround::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) {
if (al::isMsgPlayerDisregard(message))
return true;
return false;
}
void KoopaFireBeamGround::exeAppearSign() {
if (al::isFirstStep(this))
al::startAction(this, "AppearSign");
}
void KoopaFireBeamGround::exeWait() {
if (al::isFirstStep(this))
al::startAction(this, "Wait");
}

View file

@ -0,0 +1,21 @@
#pragma once
#include "Library/LiveActor/LiveActor.h"
class KoopaFireBeamGround : public al::LiveActor {
public:
KoopaFireBeamGround(const char* name);
void init(const al::ActorInitInfo& info) override;
void appear() override;
void attackSensor(al::HitSensor* self, al::HitSensor* other) override;
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) override;
void appearSign();
void exeAppearSign();
void exeWait();
};
static_assert(sizeof(KoopaFireBeamGround) == 0x108);