This commit is contained in:
guymakinggames 2026-04-23 05:44:11 +00:00 committed by GitHub
commit f30628726b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 156 additions and 14 deletions

View file

@ -33295,63 +33295,63 @@ Enemy/JangoStateWaitTree.o:
label:
- _ZN18JangoStateWaitTreeC1EPN2al9LiveActorERKNS0_13ActorInitInfoE17JangoWaitTreeType
- _ZN18JangoStateWaitTreeC2EPN2al9LiveActorERKNS0_13ActorInitInfoE17JangoWaitTreeType
status: NotDecompiled
status: Matching
- offset: 0x133134
size: 60
label: _ZN18JangoStateWaitTree4initEv
status: NotDecompiled
status: Matching
- offset: 0x133170
size: 116
label: _ZN18JangoStateWaitTree6appearEv
status: NotDecompiled
status: Matching
- offset: 0x1331e4
size: 200
label: _ZN18JangoStateWaitTree7controlEv
status: NotDecompiled
status: Matching
- offset: 0x1332ac
size: 12
label: _ZNK18JangoStateWaitTree9isEndDemoEv
status: NotDecompiled
status: Matching
- offset: 0x1332b8
size: 12
label: _ZNK18JangoStateWaitTree9isEndFindEv
status: NotDecompiled
status: Matching
- offset: 0x1332c4
size: 160
label: _ZN18JangoStateWaitTree15exeWaitOnSwitchEv
status: NotDecompiled
status: Matching
- offset: 0x133364
size: 148
label: _ZN18JangoStateWaitTree21exeWaitPlayerOnGroundEv
status: NotDecompiled
status: Matching
- offset: 0x1333f8
size: 4
label: _ZN18JangoStateWaitTree6exeEndEv
status: NotDecompiled
status: Matching
- offset: 0x1333fc
size: 36
label: _ZN18JangoStateWaitTreeD0Ev
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x133420
size: 164
label: _ZNK12_GLOBAL__N_133JangoStateWaitTreeNrvWaitOnSwitch7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x1334c4
size: 4
label: _ZNK12_GLOBAL__N_128JangoStateWaitTreeNrvEndFind7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x1334c8
size: 4
label: _ZNK12_GLOBAL__N_128JangoStateWaitTreeNrvEndDemo7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
- offset: 0x1334cc
size: 148
label: _ZNK12_GLOBAL__N_139JangoStateWaitTreeNrvWaitPlayerOnGround7executeEPN2al11NerveKeeperE
status: NotDecompiled
status: Matching
guess: true
Enemy/Joku.o:
'.text':

View file

@ -0,0 +1,102 @@
#include "Enemy/JangoStateWaitTree.h"
#include "Library/Collision/PartsConnectorUtil.h"
#include "Library/LiveActor/ActorActionFunction.h"
#include "Library/LiveActor/ActorFlagFunction.h"
#include "Library/LiveActor/ActorMovementFunction.h"
#include "Library/LiveActor/ActorPoseUtil.h"
#include "Library/LiveActor/LiveActor.h"
#include "Library/Nerve/NerveSetupUtil.h"
#include "Library/Nerve/NerveUtil.h"
#include "Library/Stage/StageSwitchUtil.h"
#include "Util/PlayerUtil.h"
namespace {
NERVE_IMPL(JangoStateWaitTree, WaitOnSwitch)
NERVE_IMPL_(JangoStateWaitTree, EndFind, End)
NERVE_IMPL_(JangoStateWaitTree, EndDemo, End)
NERVE_IMPL(JangoStateWaitTree, WaitPlayerOnGround)
NERVES_MAKE_NOSTRUCT(JangoStateWaitTree, WaitOnSwitch, EndFind, EndDemo, WaitPlayerOnGround);
} // namespace
JangoStateWaitTree::JangoStateWaitTree(al::LiveActor* actor, const al::ActorInitInfo& initInfo,
JangoWaitTreeType waitTreeType)
: al::ActorStateBase("木で待機", actor), mWaitTreeType(waitTreeType) {}
void JangoStateWaitTree::init() {
mMtxConnector = al::createMtxConnector(mActor, mQuat);
initNerve(&WaitOnSwitch, 0);
}
void JangoStateWaitTree::appear() {
al::LiveActor* actor = mActor;
al::NerveStateBase::appear();
al::setNerve(this, &WaitOnSwitch);
al::offCollide(actor);
al::attachMtxConnectorToCollision(mMtxConnector, actor, 0.0f, 200.0f);
mTrans = al::getTrans(actor);
al::setVelocityZero(actor);
}
void JangoStateWaitTree::control() {
al::LiveActor* actor = mActor;
const sead::Vector3f& trans = al::getTrans(actor);
if ((rs::getPlayerPos(actor) - trans).length() < 600.0f) {
al::setNerve(this, &EndFind);
kill();
return;
}
al::connectPoseTrans(actor, mMtxConnector, mTrans);
}
bool JangoStateWaitTree::isEndDemo() const {
return al::isNerve(this, &EndDemo);
}
bool JangoStateWaitTree::isEndFind() const {
return al::isNerve(this, &EndFind);
}
void JangoStateWaitTree::exeWaitOnSwitch() {
al::LiveActor* actor = mActor;
if (al::isFirstStep(this))
al::startAction(actor, "WaitTree");
if (!al::isOnSwitchStart(actor))
return;
switch (mWaitTreeType) {
case JangoWaitTreeType::Find:
al::setNerve(this, &WaitPlayerOnGround);
break;
case JangoWaitTreeType::Demo:
al::setNerve(this, &EndDemo);
kill();
break;
default:
return;
}
}
void JangoStateWaitTree::exeWaitPlayerOnGround() {
al::LiveActor* actor = mActor;
if (!rs::isPlayerCollidedGround(actor) || rs::isPlayerSafetyPointRecovery(actor)) {
al::setNerve(this, &WaitPlayerOnGround);
return;
}
if (al::isGreaterEqualStep(this, 2)) {
al::onCollide(actor);
al::setNerve(this, &EndDemo);
kill();
}
}
void JangoStateWaitTree::exeEnd() {}

View file

@ -0,0 +1,40 @@
#pragma once
#include <basis/seadTypes.h>
#include <math/seadQuat.h>
#include <math/seadVector.h>
#include <prim/seadEnum.h>
#include "Library/Nerve/NerveStateBase.h"
namespace al {
struct ActorInitInfo;
class LiveActor;
class MtxConnector;
} // namespace al
SEAD_ENUM(JangoWaitTreeType, Find, Demo);
class JangoStateWaitTree : public al::ActorStateBase {
public:
JangoStateWaitTree(al::LiveActor* actor, const al::ActorInitInfo& initInfo,
JangoWaitTreeType waitTreeType);
void init() override;
void appear() override;
void control() override;
bool isEndDemo() const;
bool isEndFind() const;
void exeWaitOnSwitch();
void exeWaitPlayerOnGround();
void exeEnd();
private:
JangoWaitTreeType mWaitTreeType;
al::MtxConnector* mMtxConnector = nullptr;
sead::Quatf mQuat = sead::Quatf::unit;
sead::Vector3f mTrans = sead::Vector3f::zero;
};
static_assert(sizeof(JangoStateWaitTree) == 0x50);