SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
MechaKoopaPartsHead.cpp
1#include "Game/MapObj/MechaKoopaPartsHead.hpp"
2
3MechaKoopaPartsHead::MechaKoopaPartsHead(const char *pName) : MapObjActor(pName) {
4
5}
6
9 MapObjActorInitInfo initInfo;
10 initInfo.setupHioNode("地形オブジェ");
11 initInfo.setupDefaultPos();
12 initInfo.setupConnectToScene();
13 initInfo.setupEffect(nullptr);
14 initInfo.setupSound(6);
15 initInfo.setupNerve(&NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvWait::sInstance);
16 initialize(rIter, initInfo);
17 MR::declarePowerStar(this);
18 MR::registerDemoActionNerve(this, &NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvDemoBreak::sInstance, sDemoPartNameBreak);
19 MR::registerDemoActionNerve(this, &NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvDemoWhiteFadeOut::sInstance, sDemoPartNameFadeOut);
20 MR::registerDemoActionNerve(this, &NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvDemoWhiteWait::sInstance, sDemoPartNameWhite);
21 MR::registerDemoActionNerve(this, &NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvDemoWhiteFadeIn::sInstance, sDemoPartNameFadeIn);
22
23 if (MR::isValidSwitchA(this)) {
24 MR::onSwitchA(this);
25 }
26}
27
28void MechaKoopaPartsHead::exeDemoBreak() {
29 if (MR::isFirstStep(this)) {
30 MR::startSound(this, "SE_BM_MECHA_KOOPA_DOWN", -1, -1);
31 MR::moveVolumeStageBGM(0.0f, 0x1E);
32 MR::shakeCameraInfinity(this, 0.2f, 2.0f);
33 }
34
35 MR::tryRumblePadMiddle(this, 0);
36 MR::startLevelSound(this, "SE_BM_LV_MECHA_KOOPA_PRE_BREAK", -1, -1, -1);
37
38 if (MR::isStep(this, 120)) {
39 MR::emitEffect(this, "Explosion1");
40 MR::emitEffect(this, "Explosion2");
41 MR::emitEffect(this, "ExplosionEye1");
42 MR::emitEffect(this, "ExplosionEye2");
43 MR::startSound(this, "SE_OJ_M_KOOPA_EYE_BREAK", -1, -1);
44 }
45
46 if (MR::isStep(this, 300)) {
47 MR::emitEffect(this, "Explosion");
48 MR::startSound(this, "SE_BM_MECHA_KOOPA_BREAK_FIRE_ST", -1, -1);
49 }
50
51 if (MR::isGreaterStep(this, 300)) {
52 MR::startLevelSound(this, "SE_BM_LV_MECHA_KOOPA_BREAK_FIRE", -1, -1, -1);
53 }
54}
55
56void MechaKoopaPartsHead::exeDemoWhiteFadeOut() {
57 if (MR::isFirstStep(this)) {
58 MR::stopShakingCamera(this);
59 MR::tryRumblePadStrong(this, 0);
60 MR::shakeCameraStrong();
61 MR::startSound(this, "SE_BM_MECHA_KOOPA_EXPLODE", -1, -1);
62 MR::closeWipeWhiteFade(60);
63 }
64}
65
66void MechaKoopaPartsHead::exeDemoWhiteWait() {
67 if (MR::isFirstStep(this)) {
68 MR::hideModel(this);
69
70 if (MR::isValidSwitchA(this)) {
71 MR::offSwitchA(this);
72 }
73
74 MR::setPlayerPos("爆破デモ後マリオ");
75 MR::setPlayerStateWait();
76 }
77}
78
79void MechaKoopaPartsHead::exeDemoWhiteFadeIn() {
80 if (MR::isFirstStep(this)) {
81 MR::openWipeWhiteFade(60);
82 }
83
84 if (MR::isDemoPartLastStep(sDemoPartNameFadeIn)) {
85 setNerve(&NrvMechaKoopaPartsHead::MechaKoopaPartsHeadNrvDemoAppearStar::sInstance);
86 }
87}
88
89void MechaKoopaPartsHead::exeDemoAppearStar() {
90 if (MR::isFirstStep(this)) {
91 MR::startAfterBossBGM();
92 MR::requestAppearPowerStar(this);
93 }
94
95 if (MR::isEndPowerStarAppearDemo(this)) {
96 kill();
97 }
98}
99
100MechaKoopaPartsHead::~MechaKoopaPartsHead() {
101
102}
103
104namespace NrvMechaKoopaPartsHead {
105 INIT_NERVE(MechaKoopaPartsHeadNrvWait);
106 INIT_NERVE(MechaKoopaPartsHeadNrvDemoBreak);
107 INIT_NERVE(MechaKoopaPartsHeadNrvDemoWhiteFadeOut);
108 INIT_NERVE(MechaKoopaPartsHeadNrvDemoWhiteWait);
109 INIT_NERVE(MechaKoopaPartsHeadNrvDemoWhiteFadeIn);
110 INIT_NERVE(MechaKoopaPartsHeadNrvDemoAppearStar);
111
112 void MechaKoopaPartsHeadNrvDemoAppearStar::execute(Spine *pSpine) const {
113 MechaKoopaPartsHead* head = reinterpret_cast<MechaKoopaPartsHead*>(pSpine->mExecutor);
114 head->exeDemoAppearStar();
115 }
116
117 void MechaKoopaPartsHeadNrvDemoWhiteFadeIn::execute(Spine *pSpine) const {
118 MechaKoopaPartsHead* head = reinterpret_cast<MechaKoopaPartsHead*>(pSpine->mExecutor);
119 head->exeDemoWhiteFadeIn();
120 }
121
122 void MechaKoopaPartsHeadNrvDemoWhiteWait::execute(Spine *pSpine) const {
123 MechaKoopaPartsHead* head = reinterpret_cast<MechaKoopaPartsHead*>(pSpine->mExecutor);
124 head->exeDemoWhiteWait();
125 }
126
127 void MechaKoopaPartsHeadNrvDemoWhiteFadeOut::execute(Spine *pSpine) const {
128 MechaKoopaPartsHead* head = reinterpret_cast<MechaKoopaPartsHead*>(pSpine->mExecutor);
129 head->exeDemoWhiteFadeOut();
130 }
131
132 void MechaKoopaPartsHeadNrvDemoBreak::execute(Spine *pSpine) const {
133 MechaKoopaPartsHead* head = reinterpret_cast<MechaKoopaPartsHead*>(pSpine->mExecutor);
134 head->exeDemoBreak();
135 }
136
137 void MechaKoopaPartsHeadNrvWait::execute(Spine *pSpine) const {
138
139 }
140};
141
142void MechaKoopaPartsHead::initCaseNoUseSwitchB(const MapObjActorInitInfo &) {
143
144}
145
146void MechaKoopaPartsHead::initCaseUseSwitchB(const MapObjActorInitInfo &) {
147
148}
149
150void MechaKoopaPartsHead::initCaseNoUseSwitchA(const MapObjActorInitInfo &) {
151
152}
153
154void MechaKoopaPartsHead::initCaseUseSwitchA(const MapObjActorInitInfo &) {
155
156}
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.
Definition Spine.hpp:9