2023-12-13 00:40:16 -05:00
|
|
|
#include "Game/MapObj/SnowplowSwitch.hpp"
|
2022-07-17 03:46:28 -04:00
|
|
|
|
|
|
|
|
SnowplowSwitch::SnowplowSwitch(const char *pName) : LiveActor(pName) {
|
|
|
|
|
_8C = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SnowplowSwitch::receiveOtherMsg(u32 msg, HitSensor *, HitSensor *) {
|
|
|
|
|
if (msg == 73) {
|
|
|
|
|
return _8C == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (msg == 74 && _8C) {
|
|
|
|
|
_8C = 1;
|
|
|
|
|
MR::onSwitchA(this);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SnowplowSwitch::~SnowplowSwitch() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SnowplowSwitch::init(const JMapInfoIter &rIter) {
|
|
|
|
|
MR::initDefaultPos(this, rIter);
|
|
|
|
|
MR::connectToSceneMapObjMovement(this);
|
|
|
|
|
MR::invalidateClipping(this);
|
|
|
|
|
initHitSensor(1);
|
|
|
|
|
TVec3f sensorOffs;
|
|
|
|
|
sensorOffs.x = 0.0f;
|
|
|
|
|
sensorOffs.y = 0.0f;
|
|
|
|
|
sensorOffs.z = 0.0f;
|
|
|
|
|
MR::addHitSensorEnemy(this, "Body", 8, 70.0f, sensorOffs);
|
|
|
|
|
MR::needStageSwitchWriteA(this, rIter);
|
|
|
|
|
|
|
|
|
|
if (MR::useStageSwitchReadAppear(this, rIter)) {
|
|
|
|
|
MR::syncStageSwitchAppear(this);
|
|
|
|
|
makeActorDead();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
makeActorAppeared();
|
|
|
|
|
}
|
|
|
|
|
}
|