2023-12-13 00:40:16 -05:00
|
|
|
#include "Game/MapObj/LargeChainParts.hpp"
|
2022-10-16 06:31:54 -04:00
|
|
|
|
|
|
|
|
LargeChainParts::LargeChainParts(const char *pName) : LiveActor(pName) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LargeChainParts::breakChainParts() {
|
|
|
|
|
kill();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LargeChainParts::initChainParts(TVec3f *pPos, TVec3f *pRot, TVec3f *pScale, bool isFixedPoint) {
|
|
|
|
|
mPosition.set(*pPos);
|
|
|
|
|
mRotation.set(*pRot);
|
|
|
|
|
mScale.set(*pScale);
|
|
|
|
|
|
|
|
|
|
if (isFixedPoint) {
|
2023-02-13 03:33:10 -05:00
|
|
|
initModelManagerWithAnm("LargeChainFixPoint", nullptr, false);
|
2022-10-16 06:31:54 -04:00
|
|
|
}
|
|
|
|
|
else {
|
2023-02-13 03:33:10 -05:00
|
|
|
initModelManagerWithAnm("LargeChain", nullptr, false);
|
2022-10-16 06:31:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MR::connectToSceneMapObj(this);
|
|
|
|
|
initHitSensor(1);
|
|
|
|
|
MR::addBodyMessageSensorMapObj(this);
|
|
|
|
|
if (isFixedPoint) {
|
2023-02-13 03:33:10 -05:00
|
|
|
MR::initCollisionParts(this, "LargeChainFixPoint", getSensor("body"), nullptr);
|
2022-10-16 06:31:54 -04:00
|
|
|
}
|
|
|
|
|
else {
|
2023-02-13 03:33:10 -05:00
|
|
|
MR::initCollisionParts(this, "LargeChain", getSensor("body"), nullptr);
|
2022-10-16 06:31:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initEffectKeeper(0, "LargeChain", false);
|
|
|
|
|
initSound(2, false);
|
|
|
|
|
makeActorAppeared();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LargeChainParts::kill() {
|
|
|
|
|
MR::emitEffect(this, "Break");
|
|
|
|
|
MR::startSound(this, "SE_OJ_LARGE_CHAIN_BREAK", -1, -1);
|
|
|
|
|
LiveActor::kill();
|
|
|
|
|
}
|