mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Merge 6b58461325 into 0f550e5aae
This commit is contained in:
commit
b30c4dc112
|
|
@ -72949,68 +72949,68 @@ MapObj/HipDropMoveLift.o:
|
|||
- offset: 0x2a2894
|
||||
size: 128
|
||||
label: _ZN15HipDropMoveLiftC2EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2914
|
||||
size: 140
|
||||
label: _ZN15HipDropMoveLiftC1EPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a29a0
|
||||
size: 132
|
||||
label: _ZN15HipDropMoveLift4initERKN2al13ActorInitInfoE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2a24
|
||||
size: 168
|
||||
label: _ZN15HipDropMoveLift10receiveMsgEPKN2al9SensorMsgEPNS0_9HitSensorES5_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2acc
|
||||
size: 128
|
||||
label: _ZN15HipDropMoveLift5startEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2b4c
|
||||
size: 52
|
||||
label: _ZN15HipDropMoveLift10exeStandByEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2b80
|
||||
size: 84
|
||||
label: _ZN15HipDropMoveLift7exeWaitEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2bd4
|
||||
size: 120
|
||||
label: _ZN15HipDropMoveLift15setWaitEndNerveEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2c4c
|
||||
size: 236
|
||||
label: _ZN15HipDropMoveLift7exeMoveEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0x2a2d38
|
||||
size: 56
|
||||
label: _ZNK12_GLOBAL__N_125HipDropMoveLiftNrvStandBy7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2d70
|
||||
size: 12
|
||||
label: _ZNK12_GLOBAL__N_125HipDropMoveLiftNrvStandBy13getActionNameEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2d7c
|
||||
size: 88
|
||||
label: _ZNK12_GLOBAL__N_122HipDropMoveLiftNrvWait7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2dd4
|
||||
size: 12
|
||||
label: _ZNK12_GLOBAL__N_122HipDropMoveLiftNrvWait13getActionNameEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2de0
|
||||
size: 8
|
||||
label: _ZNK12_GLOBAL__N_122HipDropMoveLiftNrvMove7executeEPN2al11NerveKeeperE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2de8
|
||||
size: 12
|
||||
label: _ZNK12_GLOBAL__N_122HipDropMoveLiftNrvMove13getActionNameEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
guess: true
|
||||
- offset: 0x2a2df4
|
||||
size: 116
|
||||
|
|
@ -134566,7 +134566,7 @@ Scene/ProjectActorFactory.o:
|
|||
- offset: 0x4b8d84
|
||||
size: 52
|
||||
label: _ZN2al19createActorFunctionI15HipDropMoveLiftEEPNS_9LiveActorEPKc
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
lazy: true
|
||||
- offset: 0x4b8db8
|
||||
size: 52
|
||||
|
|
|
|||
108
src/MapObj/HipDropMoveLift.cpp
Normal file
108
src/MapObj/HipDropMoveLift.cpp
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#include "MapObj/HipDropMoveLift.h"
|
||||
|
||||
#include "Library/KeyPose/KeyPoseKeeper.h"
|
||||
#include "Library/KeyPose/KeyPoseKeeperUtil.h"
|
||||
#include "Library/LiveActor/ActorActionFunction.h"
|
||||
#include "Library/LiveActor/ActorAreaFunction.h"
|
||||
#include "Library/LiveActor/ActorClippingFunction.h"
|
||||
#include "Library/LiveActor/ActorInitUtil.h"
|
||||
#include "Library/LiveActor/ActorMovementFunction.h"
|
||||
#include "Library/LiveActor/ActorPoseUtil.h"
|
||||
#include "Library/LiveActor/ActorSensorUtil.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
|
||||
namespace {
|
||||
NERVE_ACTION_IMPL(HipDropMoveLift, StandBy)
|
||||
NERVE_ACTION_IMPL(HipDropMoveLift, Wait)
|
||||
NERVE_ACTION_IMPL(HipDropMoveLift, Move)
|
||||
|
||||
NERVE_ACTIONS_MAKE_STRUCT(HipDropMoveLift, StandBy, Wait, Move)
|
||||
} // namespace
|
||||
|
||||
HipDropMoveLift::HipDropMoveLift(const char* name) : al::LiveActor(name) {}
|
||||
|
||||
void HipDropMoveLift::init(const al::ActorInitInfo& info) {
|
||||
al::initNerveAction(this, "Wait", &NrvHipDropMoveLift.collector, 0);
|
||||
al::initMapPartsActor(this, info, nullptr);
|
||||
mKeyPoseKeeper = al::createKeyPoseKeeper(info);
|
||||
mKeyPoseKeeper->setMoveTypeTurn();
|
||||
al::registerAreaHostMtx(this, info);
|
||||
al::startNerveAction(this, "StandBy");
|
||||
makeActorAlive();
|
||||
}
|
||||
|
||||
bool HipDropMoveLift::receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) {
|
||||
if (!al::isMsgPlayerHipDropAll(message) ||
|
||||
!al::isNerve(this, NrvHipDropMoveLift.StandBy.data()))
|
||||
return false;
|
||||
|
||||
if (al::isNerve(this, NrvHipDropMoveLift.StandBy.data()) &&
|
||||
al::getKeyPoseCount(mKeyPoseKeeper) >= 2) {
|
||||
if (al::isExistAction(this, "Start"))
|
||||
al::startAction(this, "Start");
|
||||
al::startNerveAction(this, "Wait");
|
||||
al::invalidateClipping(this);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HipDropMoveLift::start() {
|
||||
if (!al::isNerve(this, NrvHipDropMoveLift.StandBy.data()) ||
|
||||
al::getKeyPoseCount(mKeyPoseKeeper) < 2)
|
||||
return;
|
||||
|
||||
if (al::isExistAction(this, "Start"))
|
||||
al::startAction(this, "Start");
|
||||
al::startNerveAction(this, "Wait");
|
||||
al::invalidateClipping(this);
|
||||
}
|
||||
|
||||
void HipDropMoveLift::exeStandBy() {
|
||||
if (al::isFirstStep(this))
|
||||
al::validateClipping(this);
|
||||
}
|
||||
|
||||
void HipDropMoveLift::exeWait() {
|
||||
if (al::isFirstStep(this)) {
|
||||
s32 waitTime = al::calcKeyMoveWaitTime(mKeyPoseKeeper);
|
||||
if (waitTime >= 0)
|
||||
mWaitTime = waitTime;
|
||||
}
|
||||
|
||||
if (al::isGreaterEqualStep(this, mWaitTime))
|
||||
return setWaitEndNerve();
|
||||
}
|
||||
|
||||
void HipDropMoveLift::setWaitEndNerve() {
|
||||
if (!al::isRestart(mKeyPoseKeeper))
|
||||
return al::startNerveAction(this, "Move");
|
||||
|
||||
al::restartKeyPose(mKeyPoseKeeper, al::getTransPtr(this), al::getQuatPtr(this));
|
||||
al::resetPosition(this);
|
||||
return al::startNerveAction(this, "Wait");
|
||||
}
|
||||
|
||||
void HipDropMoveLift::exeMove() {
|
||||
if (al::isFirstStep(this))
|
||||
mMoveTime = al::calcKeyMoveMoveTime(mKeyPoseKeeper);
|
||||
|
||||
f32 rate = al::calcNerveRate(this, mMoveTime);
|
||||
al::calcLerpKeyTrans(al::getTransPtr(this), mKeyPoseKeeper, rate);
|
||||
al::calcSlerpKeyQuat(al::getQuatPtr(this), mKeyPoseKeeper, rate);
|
||||
|
||||
if (!al::isGreaterEqualStep(this, mMoveTime))
|
||||
return;
|
||||
|
||||
al::nextKeyPose(mKeyPoseKeeper);
|
||||
|
||||
if (al::isFirstKey(mKeyPoseKeeper))
|
||||
return al::startNerveAction(this, "StandBy");
|
||||
|
||||
if (al::calcKeyMoveWaitTime(mKeyPoseKeeper) != 0)
|
||||
return al::startNerveAction(this, "Wait");
|
||||
|
||||
return setWaitEndNerve();
|
||||
}
|
||||
29
src/MapObj/HipDropMoveLift.h
Normal file
29
src/MapObj/HipDropMoveLift.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
|
||||
namespace al {
|
||||
class KeyPoseKeeper;
|
||||
}
|
||||
|
||||
class HipDropMoveLift : public al::LiveActor {
|
||||
public:
|
||||
HipDropMoveLift(const char* name);
|
||||
|
||||
void init(const al::ActorInitInfo& info) override;
|
||||
bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other,
|
||||
al::HitSensor* self) override;
|
||||
|
||||
void start();
|
||||
void exeStandBy();
|
||||
void exeWait();
|
||||
void setWaitEndNerve();
|
||||
void exeMove();
|
||||
|
||||
private:
|
||||
al::KeyPoseKeeper* mKeyPoseKeeper = nullptr;
|
||||
s32 mMoveTime = 0;
|
||||
s32 mWaitTime = 30;
|
||||
};
|
||||
|
||||
static_assert(sizeof(HipDropMoveLift) == 0x118);
|
||||
|
|
@ -83,6 +83,7 @@
|
|||
#include "MapObj/FireDrum2D.h"
|
||||
#include "MapObj/FixMapPartsBgmChangeAction.h"
|
||||
#include "MapObj/HackFork.h"
|
||||
#include "MapObj/HipDropMoveLift.h"
|
||||
#include "MapObj/HipDropSwitch.h"
|
||||
#include "MapObj/KoopaShip.h"
|
||||
#include "MapObj/LavaPan.h"
|
||||
|
|
@ -356,7 +357,7 @@ const al::NameToCreator<al::ActorCreatorFunction> sProjectActorFactoryEntries[]
|
|||
{"HipDropSwitchSave", nullptr},
|
||||
{"HipDropSwitchTimer", nullptr},
|
||||
{"HipDropTile", nullptr},
|
||||
{"HipDropMoveLift", nullptr},
|
||||
{"HipDropMoveLift", al::createActorFunction<HipDropMoveLift>},
|
||||
{"HipDropRepairParts", nullptr},
|
||||
{"HipDropTransformPartsWatcher", nullptr},
|
||||
{"HomeBed", nullptr},
|
||||
|
|
|
|||
Loading…
Reference in a new issue