1#include "Game/MapObj/HipDropMoveObj.hpp"
2#include "Game/MapObj/StageEffectDataTable.hpp"
3#include "Game/Util.hpp"
5HipDropDemoMoveObj::~HipDropDemoMoveObj() {
9HipDropMoveObj::HipDropMoveObj(
const char *pName) :
LiveActor(pName) {
14 MR::initDefaultPos(
this, rIter);
15 MR::getObjectName(&mObjectName, rIter);
16 initModelManagerWithAnm(mObjectName, 0,
false);
17 MR::connectToSceneMapObj(
this);
18 initEffectKeeper(0, 0,
false);
25 HitSensor* jointSensor = MR::addHitSensorAtJointMapObj(
this,
"body", cSwitchJointName, 0, 225.0f, sensor);
26 MtxPtr mtx = MR::getJointMtx(
this, cMoveJointName);
27 MR::initCollisionParts(
this, mObjectName, jointSensor, mtx);
28 MR::setClippingTypeSphereContainsModelBoundingBox(
this, 100.0f);
29 MR::setGroupClipping(
this, rIter, 8);
30 MR::useStageSwitchWriteA(
this, rIter);
31 initNerve(&NrvHipDropMoveObj::HostTypeWait::sInstance);
32 MR::tryRegisterDemoCast(
this, rIter);
37 if (MR::isMsgPlayerHipDropFloor(msg)) {
38 if (!isNerve(&NrvHipDropMoveObj::HostTypeWait::sInstance)) {
42 f32 radius = a3->mRadius;
43 f32 dist = MR::calcDistanceToPlayer(a3->mPosition);
48 setNerve(&NrvHipDropMoveObj::HostTypeMove::sInstance);
56bool HipDropMoveObj::isEndMove()
const {
57 return MR::isBckStopped(
this);
60void HipDropMoveObj::exeMove() {
61 if (MR::isFirstStep(
this)) {
62 MR::startAllAnim(
this, cMoveAnimName);
63 const char* startSe = MR::StageEffect::getStartSe(mObjectName);
66 MR::startSound(
this, startSe, -1, -1);
69 MR::StageEffect::rumblePadStart(
this, mObjectName);
70 MR::StageEffect::shakeCameraMoving(
this, mObjectName);
71 MR::tryStartDemoRegistered(
this, 0);
75 s32 steps = MR::StageEffect::getStopSeSteps(mObjectName);
76 const char* movingSe = MR::StageEffect::getMovingSe(mObjectName);
80 if (MR::isLessStep(
this, steps)) {
81 MR::startLevelSound(
this, movingSe, -1, -1, -1);
85 MR::startLevelSound(
this, movingSe, -1, -1, -1);
90 if (MR::isStep(
this, steps)) {
91 const char* stopSe = MR::StageEffect::getStopSe(mObjectName);
94 MR::startSound(
this, stopSe, -1, -1);
97 if (MR::StageEffect::isRiddleSeTypeStop(mObjectName)) {
98 MR::startSystemSE(
"SE_SY_READ_RIDDLE_S", -1, -1);
106 if (MR::isValidSwitchA(
this)) {
110 MR::StageEffect::rumblePadStop(
this, mObjectName);
111 MR::StageEffect::stopShakingCameraMoving(
this, mObjectName);
114 const char* stopSe = MR::StageEffect::getStopSe(mObjectName);
117 MR::startSound(
this, stopSe, -1, -1);
122 setNerve(&NrvHipDropMoveObj::HostTypeDone::sInstance);
126HipDropDemoMoveObj::HipDropDemoMoveObj(
const char *pName) :
HipDropMoveObj(pName) {
130HipDropMoveObj::~HipDropMoveObj() {
134void HipDropDemoMoveObj::moveStart() {
135 MR::startBckPlayer(
"Wait", (
char*)
nullptr);
136 MtxPtr mtx = MR::getPlayerDemoActor()->
getBaseMtx();
139 MtxPtr jointMtx = MR::getJointMtx(
this, cMoveJointName);
141 stack_8.set(jointMtx);
142 stack_8.invert(stack_8);
143 mMtx.concat(stack_8, stack_38);
146void HipDropDemoMoveObj::moving() {
147 if (MR::isDemoActive()) {
148 MtxPtr jointMtx = MR::getJointMtx(
this, cMoveJointName);
150 stack_8.set(jointMtx);
151 stack_8.concat(stack_8, mMtx);
153 LiveActor* demoActor = MR::getPlayerDemoActor();
154 f32 z = stack_8.mMtx[2][3];
155 f32 y = stack_8.mMtx[1][3];
156 f32 x = stack_8.mMtx[0][3];
158 MR::setPlayerBaseMtx((MtxPtr)&stack_8);
162namespace NrvHipDropMoveObj {
163 HostTypeWait HostTypeWait::sInstance;
164 HostTypeMove HostTypeMove::sInstance;
165 HostTypeDone HostTypeDone::sInstance;
167 void HostTypeDone::execute(
Spine* pSpine)
const {
171 void HostTypeMove::execute(
Spine *pSpine)
const {
176 void HostTypeWait::execute(
Spine* pSpine)
const {
181void HipDropMoveObj::moveStart() {
185void HipDropMoveObj::moving() {
189void HipDropMoveObj::moveEnd() {
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
The basis of a drawable actor that can contain states (see: Nerve)
TVec3f mPosition
3D vector of the actor's position.
virtual MtxPtr getBaseMtx() const
Gets the base matrix of the model used for the actor.