1#include "Game/MapObj/SpaceMine.hpp"
3SpaceMine::SpaceMine(
const char *pName) :
MapObjActor(pName), mClippingRange(gZeroVec) {
12 info.setupHioNode(
"地形オブジェ");
13 info.setupDefaultPos();
14 info.setupConnectToScene();
15 info.setupEffect(
nullptr);
17 info.setupNerve(&NrvSpaceMine::HostTypeWait::sInstance);
18 info.setupRailMover();
19 info.setupHitSensor();
24 info.setupHitSensorParam(8, 100.0f, sensorOffs);
25 info.setupGroupClipping(0x10);
26 MR::getJMapInfoArg0NoInit(rIter, &_D4);
28 bool isValid = isShadowValid(_D4);
31 info.setupShadow(
nullptr);
35 MR::getJMapInfoArg1NoInit(rIter, &arg1);
38 info.setupBinder(100.0f, 0.0f);
41 initialize(rIter, info);
42 if (isCalcShadowAlways()) {
43 MR::onCalcShadow(
this,
nullptr);
44 MR::onCalcShadowDropGravity(
this,
nullptr);
64void SpaceMine::kill() {
65 MR::emitEffect(
this,
"Explosion");
66 MR::startSound(
this,
"SE_OJ_SPACEMINE_EXPLOSION", -1, -1);
67 MR::tryRumblePad(
this,
"中", 0);
71void SpaceMine::initAfterPlacement() {
72 bool isShadow = isShadowValid(_D4);
75 MR::setClippingRangeIncludeShadow(
this, &mClippingRange, 100.0f);
80 if (MR::sendMsgEnemyAttackExplosion(a2, a1)) {
84 MR::sendMsgPush(a2, a1);
89 if (MR::isMsgInvincibleAttack(msg)) {
94 if (MR::isMsgStarPieceAttack(msg)) {
102void SpaceMine::exeWait() {
103 if (isCalcShadowAlways()) {
104 MR::setClippingRangeIncludeShadow(
this, &mClippingRange, 100.0f);
107 f32 playerDist = MR::calcDistanceToPlayer(
this);
109 if (1450.0f < playerDist) {
114 else if (playerDist < 1500.0f) {
119 if (MR::isBinded(
this)) {
120 if (MR::isBindedGround(
this)) {
121 MR::sendMsgEnemyAttackExplosionToBindedSensor(
this, MR::getGroundSensor(
this));
124 if (MR::isBindedWall(
this)) {
125 MR::sendMsgEnemyAttackExplosionToBindedSensor(
this, MR::getWallSensor(
this));
128 if (MR::isBindedRoof(
this)) {
129 MR::sendMsgEnemyAttackExplosionToBindedSensor(
this, MR::getWallSensor(
this));
136 f32 v6 = MR::subtractFromSum(_C4,
mRotation.y, 0.0f);
142void SpaceMine::exeAppear() {
143 if (MR::isFirstStep(
this)) {
144 MR::emitEffect(
this,
"Appear");
145 MR::setClippingRangeIncludeShadow(
this, &mClippingRange, 100.0f);
148 MR::startLevelSound(
this,
"SE_OJ_LV_SPACEMINE_APPEAR", -1, -1, -1);
150 if (MR::isStep(
this, 120)) {
151 MR::startBck(
this,
"Appear",
nullptr);
153 MR::startSound(
this,
"SE_OJ_SPACEMINE_APPEAR", -1, -1);
156 if (MR::isGreaterStep(
this, 120)) {
157 if (MR::isBckStopped(
this)) {
158 setNerve(&NrvSpaceMine::HostTypeWait::sInstance);
163SpaceMine::~SpaceMine() {
167namespace NrvSpaceMine {
168 void HostTypeAppear::execute(
Spine *pSpine)
const {
173 void HostTypeWait::execute(
Spine *pSpine)
const {
178 INIT_NERVE(HostTypeWait);
179 INIT_NERVE(HostTypeAppear);
TVec3f mRotation
3D vector of the actor's rotation.
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.