This commit is contained in:
guymakinggames 2026-04-23 10:50:12 +02:00 committed by GitHub
commit 61a9bd6ed0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 135 additions and 10 deletions

View file

@ -85550,36 +85550,36 @@ MapObj/SignBoard.o:
- offset: 0x31ac48
size: 124
label: _ZN9SignBoardC2EPKc
status: NotDecompiled
status: Matching
- offset: 0x31acc4
size: 136
label: _ZN9SignBoardC1EPKc
status: NotDecompiled
status: Matching
- offset: 0x31ad4c
size: 312
label: _ZN9SignBoard4initERKN2al13ActorInitInfoE
status: NotDecompiled
status: Matching
- offset: 0x31ae84
size: 60
label: _ZN9SignBoard7exeWaitEv
status: NotDecompiled
status: Matching
- offset: 0x31aec0
size: 88
label: _ZN9SignBoard11exeReactionEv
status: NotDecompiled
status: Matching
- offset: 0x31af18
size: 124
label: _ZN9SignBoard10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
status: NotDecompiled
status: Matching
- offset: 0x31af94
size: 64
label: _ZNK12_GLOBAL__N_116SignBoardNrvWait7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x31afd4
size: 92
label: _ZNK12_GLOBAL__N_120SignBoardNrvReaction7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
MapObj/SignBoardBlow.o:
'.text':
@ -135436,7 +135436,7 @@ Scene/ProjectActorFactory.o:
- offset: 0x4bbdd4
size: 52
label: _ZN2al19createActorFunctionI9SignBoardEEPNS_9LiveActorEPKc
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x4bbe08
size: 52
@ -268249,6 +268249,8 @@ Library/Obj/SimpleCircleShadowXZ.o:
size: 12
label: _ZN2al20SimpleCircleShadowXZ17setInterpoleFrameEi
status: NotDecompiled
MapObj/SimpleSignBoard.o:
'.text':
- offset: 0x96f214
size: 120
label: _ZN15SimpleSignBoardC2EPKc

77
src/MapObj/SignBoard.cpp Normal file
View file

@ -0,0 +1,77 @@
#include "MapObj/SignBoard.h"
#include <math/seadVector.h>
#include "Library/Base/StringUtil.h"
#include "Library/LiveActor/ActorActionFunction.h"
#include "Library/LiveActor/ActorAnimFunction.h"
#include "Library/LiveActor/ActorInitUtil.h"
#include "Library/LiveActor/ActorPoseUtil.h"
#include "Library/Nerve/NerveSetupUtil.h"
#include "Library/Nerve/NerveUtil.h"
#include "Library/Placement/PlacementFunction.h"
#include "MapObj/SimpleSignBoard.h"
#include "Util/SensorMsgFunction.h"
namespace {
NERVE_IMPL(SignBoard, Wait);
NERVE_IMPL(SignBoard, Reaction);
NERVES_MAKE_NOSTRUCT(SignBoard, Wait, Reaction);
} // namespace
SignBoard::SignBoard(const char* name) : al::LiveActor(name) {}
void SignBoard::init(const al::ActorInitInfo& info) {
const char* objectName = nullptr;
al::getObjectName(&objectName, info);
bool isWall = al::isEqualString(objectName, "SignBoardNormalWall");
if (isWall)
al::initActorWithArchiveName(this, info, "SignBoardNormal", "Wall");
else
al::initActor(this, info);
al::initNerve(this, &Wait, 0);
SimpleSignBoardFunction::startSignAimVisAnimFromModelName(this, info);
if (isWall) {
al::startVisAnimForAction(this, "WallOn");
sead::Vector3f frontDir;
al::calcFrontDir(&frontDir, this);
al::setTrans(this, al::getTrans(this) - frontDir * 16.0f);
}
mIsWall = isWall;
makeActorAlive();
}
void SignBoard::exeWait() {
if (al::isFirstStep(this))
al::startAction(this, "Wait");
}
void SignBoard::exeReaction() {
if (al::isFirstStep(this))
al::startAction(this, "Reaction");
if (al::isActionEnd(this))
al::setNerve(this, &Wait);
}
bool SignBoard::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) {
if (mIsWall)
return false;
if (rs::isMsgCapReflectCollide(message) || rs::isMsgPlayerRollingWallHitDown(message)) {
al::setNerve(this, &Reaction);
rs::requestHitReactionToAttacker(message, self, other);
return true;
}
return false;
}

26
src/MapObj/SignBoard.h Normal file
View file

@ -0,0 +1,26 @@
#pragma once
#include <basis/seadTypes.h>
#include "Library/LiveActor/LiveActor.h"
namespace al {
struct ActorInitInfo;
class HitSensor;
class SensorMsg;
} // namespace al
class SignBoard : public al::LiveActor {
public:
SignBoard(const char* name);
void init(const al::ActorInitInfo& info) override;
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
al::HitSensor* self) override;
void exeWait();
void exeReaction();
private:
bool mIsWall = false;
};
static_assert(sizeof(SignBoard) == 0x110);

View file

@ -0,0 +1,19 @@
#pragma once
#include "Library/LiveActor/LiveActor.h"
namespace al {
struct ActorInitInfo;
} // namespace al
class SimpleSignBoard : public al::LiveActor {
public:
SimpleSignBoard(const char* name);
void init(const al::ActorInitInfo& info) override;
};
static_assert(sizeof(SimpleSignBoard) == 0x108);
namespace SimpleSignBoardFunction {
void startSignAimVisAnimFromModelName(al::LiveActor* actor, const al::ActorInitInfo& info);
} // namespace SimpleSignBoardFunction

View file

@ -99,6 +99,7 @@
#include "MapObj/RouletteSwitch.h"
#include "MapObj/SaveFlagCheckObj.h"
#include "MapObj/ShineTowerRocket.h"
#include "MapObj/SignBoard.h"
#include "MapObj/SignBoardDanger.h"
#include "MapObj/Souvenir.h"
#include "MapObj/StageSwitchSelector.h"
@ -549,7 +550,7 @@ const al::NameToCreator<al::ActorCreatorFunction> sProjectActorFactoryEntries[]
{"SkyWorldKoopaFire", nullptr},
{"SkyWorldKoopaFrame", nullptr},
{"SkyWorldMiddleViewCloud", nullptr},
{"SignBoard", nullptr},
{"SignBoard", al::createActorFunction<SignBoard>},
{"SnowWorldBigIcicle", nullptr},
{"SnowWorldSequenceFlagCheckObj", nullptr},
{"Sky", nullptr},