mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
MapObj: Implement PoleClimbParts
This commit is contained in:
parent
fcc4c87e0d
commit
b442b4587d
|
|
@ -79886,53 +79886,53 @@ MapObj/PoleClimbParts.o:
|
|||
- offset: 0x2e5824
|
||||
size: 128
|
||||
label: _ZN14PoleClimbPartsC2EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e58a4
|
||||
size: 140
|
||||
label: _ZN14PoleClimbPartsC1EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5930
|
||||
size: 228
|
||||
label: _ZN14PoleClimbParts4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5a14
|
||||
size: 208
|
||||
label: _ZN14PoleClimbParts10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5ae4
|
||||
size: 60
|
||||
label: _ZN14PoleClimbParts8movementEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5b20
|
||||
size: 60
|
||||
label: _ZN14PoleClimbParts8calcAnimEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5b5c
|
||||
size: 4
|
||||
label: _ZN14PoleClimbParts7exeWaitEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5b60
|
||||
size: 156
|
||||
label: _ZN14PoleClimbParts8exeBreakEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5bfc
|
||||
size: 120
|
||||
label: _ZN14PoleClimbParts11exeReactionEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2e5c74
|
||||
size: 4
|
||||
label: _ZNK12_GLOBAL__N_121PoleClimbPartsNrvWait7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2e5c78
|
||||
size: 8
|
||||
label: _ZNK12_GLOBAL__N_122PoleClimbPartsNrvBreak7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2e5c80
|
||||
size: 124
|
||||
label: _ZNK12_GLOBAL__N_125PoleClimbPartsNrvReaction7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
MapObj/PoleGrabCeil.o:
|
||||
'.text':
|
||||
|
|
@ -135096,7 +135096,7 @@ Scene/ProjectActorFactory.o:
|
|||
- offset: 0x4ba504
|
||||
size: 52
|
||||
label: _ZN2al19createActorFunctionI14PoleClimbPartsEEPNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
lazy: true
|
||||
- offset: 0x4ba538
|
||||
size: 52
|
||||
|
|
|
|||
119
src/MapObj/PoleClimbParts.cpp
Normal file
119
src/MapObj/PoleClimbParts.cpp
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
#include "MapObj/PoleClimbParts.h"
|
||||
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorCollisionFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/LiveActorFunction.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
#include "Library/Placement/PlacementFunction.h"
|
||||
|
||||
#include "Util/PlayerUtil.h"
|
||||
#include "Util/SensorMsgFunction.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(PoleClimbParts, Wait);
|
||||
NERVE_IMPL(PoleClimbParts, Break);
|
||||
NERVE_IMPL(PoleClimbParts, Reaction);
|
||||
|
||||
NERVES_MAKE_STRUCT(PoleClimbParts, Wait, Break, Reaction);
|
||||
} // namespace
|
||||
|
||||
PoleClimbParts::PoleClimbParts(const char* name) : al::LiveActor(name) {}
|
||||
|
||||
void PoleClimbParts::init(const al::ActorInitInfo& info) {
|
||||
const char* suffix = nullptr;
|
||||
al::tryGetStringArg(&suffix, info, "Suffix");
|
||||
al::initMapPartsActor(this, info, suffix);
|
||||
|
||||
if (!al::isExistAction(this, "Reaction")) {
|
||||
makeActorDead();
|
||||
return;
|
||||
}
|
||||
|
||||
mIsBreak = al::isClassName(info, "PoleClimbPartsBreak");
|
||||
al::initNerve(this, &NrvPoleClimbParts.Wait, 0);
|
||||
|
||||
if (mIsBreak) {
|
||||
if (!al::isExistAction(this, "Break"))
|
||||
makeActorDead();
|
||||
|
||||
mBreakJudgeFunction = rs::getBreakJudgeFunction("標準攻撃");
|
||||
}
|
||||
|
||||
al::trySyncStageSwitchAppearAndKill(this);
|
||||
}
|
||||
|
||||
bool PoleClimbParts::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) {
|
||||
if (al::isNerve(this, &NrvPoleClimbParts.Break))
|
||||
return false;
|
||||
|
||||
if (rs::isMsgPlayerPoleClimbReaction(message)) {
|
||||
if (!al::isNerve(this, &NrvPoleClimbParts.Wait))
|
||||
return true;
|
||||
|
||||
al::setNerve(this, &NrvPoleClimbParts.Reaction);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mIsBreak && mBreakJudgeFunction(message, other, self)) {
|
||||
rs::requestHitReactionToAttacker(message, self, other);
|
||||
rs::sendMsgBreakFloorToPlayer(this);
|
||||
al::invalidateCollisionParts(this);
|
||||
al::setNerve(this, &NrvPoleClimbParts.Break);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PoleClimbParts::movement() {
|
||||
if (al::isNerve(this, &NrvPoleClimbParts.Wait))
|
||||
return;
|
||||
|
||||
al::LiveActor::movement();
|
||||
}
|
||||
|
||||
void PoleClimbParts::calcAnim() {
|
||||
if (al::isNerve(this, &NrvPoleClimbParts.Wait))
|
||||
return;
|
||||
|
||||
al::LiveActor::calcAnim();
|
||||
}
|
||||
|
||||
void PoleClimbParts::exeWait() {}
|
||||
|
||||
void PoleClimbParts::exeBreak() {
|
||||
if (!al::isFirstStep(this)) {
|
||||
kill();
|
||||
return;
|
||||
}
|
||||
|
||||
al::LiveActor* subActor = al::tryGetSubActor(this, "壊れモデル");
|
||||
if (subActor)
|
||||
subActor->appear();
|
||||
|
||||
subActor = al::tryGetSubActor(this, "残留モデル");
|
||||
if (subActor)
|
||||
subActor->appear();
|
||||
|
||||
if (al::isExistAction(this, "Break")) {
|
||||
al::startAction(this, "Break");
|
||||
return;
|
||||
}
|
||||
|
||||
kill();
|
||||
}
|
||||
|
||||
void PoleClimbParts::exeReaction() {
|
||||
if (al::isFirstStep(this)) {
|
||||
al::startAction(this, "Reaction");
|
||||
return;
|
||||
}
|
||||
|
||||
if (al::isIntervalStep(this, al::getActionFrameMax(this, "Reaction"), 0)) {
|
||||
al::stopAction(this);
|
||||
al::setNerve(this, &NrvPoleClimbParts.Wait);
|
||||
}
|
||||
}
|
||||
32
src/MapObj/PoleClimbParts.h
Normal file
32
src/MapObj/PoleClimbParts.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
#include "Util/BreakJudgeUtil.h"
|
||||
|
||||
namespace al {
|
||||
struct ActorInitInfo;
|
||||
class HitSensor;
|
||||
class SensorMsg;
|
||||
} // namespace al
|
||||
|
||||
class PoleClimbParts : public al::LiveActor {
|
||||
public:
|
||||
PoleClimbParts(const char* name);
|
||||
|
||||
void init(const al::ActorInitInfo& info) override;
|
||||
void movement() override;
|
||||
void calcAnim() override;
|
||||
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) override;
|
||||
|
||||
void exeWait();
|
||||
void exeBreak();
|
||||
void exeReaction();
|
||||
|
||||
private:
|
||||
bool mIsBreak = false;
|
||||
rs::break_judge_function_t mBreakJudgeFunction = nullptr;
|
||||
};
|
||||
|
||||
static_assert(sizeof(PoleClimbParts) == 0x118);
|
||||
|
|
@ -87,6 +87,7 @@
|
|||
#include "MapObj/MoonBasementSlideObj.h"
|
||||
#include "MapObj/MoonWorldCaptureParadeLift.h"
|
||||
#include "MapObj/PeachWorldTree.h"
|
||||
#include "MapObj/PoleClimbParts.h"
|
||||
#include "MapObj/PoleGrabCeil.h"
|
||||
#include "MapObj/RiseMapPartsHolder.h"
|
||||
#include "MapObj/RouletteSwitch.h"
|
||||
|
|
@ -461,7 +462,7 @@ const al::NameToCreator<al::ActorCreatorFunction> sProjectActorFactoryEntries[]
|
|||
{"PlayerStartObjNoLink", nullptr},
|
||||
{"PochiHintPhoto", nullptr},
|
||||
{"Poetter", nullptr},
|
||||
{"PoleClimbParts", nullptr},
|
||||
{"PoleClimbParts", al::createActorFunction<PoleClimbParts>},
|
||||
{"PoleClimbPartsBreak", nullptr},
|
||||
{"PoleGrabCeil", al::createActorFunction<PoleGrabCeil>},
|
||||
{"PoleGrabCeilKeyMoveParts", nullptr},
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
namespace al {
|
||||
class SensorMsg;
|
||||
}
|
||||
class HitSensor;
|
||||
} // namespace al
|
||||
|
||||
namespace rs {
|
||||
typedef bool (*break_judge_function_t)(const al::SensorMsg*);
|
||||
typedef bool (*break_judge_function_t)(const al::SensorMsg*, al::HitSensor*, al::HitSensor*);
|
||||
|
||||
break_judge_function_t getBreakJudgeFunction(const char* name);
|
||||
} // namespace rs
|
||||
|
|
|
|||
Loading…
Reference in a new issue