SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
BenefitItemInvincible.cpp
1#include "Game/MapObj/BenefitItemInvincible.hpp"
2#include <cstring>
3
4namespace {
5 const f32 cAppearThrowFwdSpd = 5.0f;
6 const f32 cAppearThrowUpSpd = 10.0f;
7 const f32 cBoundUpSpd = 20.0f;
8};
9
10BenefitItemInvincible::BenefitItemInvincible(const char *pName) : BenefitItemObj(pName, "PowerupInvincible") {
11 if (MR::isGalaxyDarkCometAppearInCurrentStage()) {
12 _D8 = 1;
13 }
14}
15
16void BenefitItemInvincible::exeCatch() {
17 MR::startSystemSE("SE_SY_POWER_UP_2", -1, -1);
18 MR::hideModel(this);
19 MR::changePlayerItemStatus(7);
20 kill();
21}
22
25
26 if (!_D8) {
27 if (_DC) {
28 MR::setShadowVolumeCylinderRadius(this, nullptr, 60.0f);
29 }
30
31 _13A = 0;
32 TVec3f axis_z;
33 MR::getRotatedAxisZ(&axis_z, mRotation);
34 _148.set<f32>(axis_z);
35 TVec3f axis_y;
36 MR::getRotatedAxisY(&axis_y, mRotation);
37 _13C.set<f32>(axis_y);
38 }
39}
40
41void BenefitItemInvincible::initModelAndEfx() {
42 initModelManagerWithAnm(_120, nullptr, false);
43 initEffectKeeper(5, "BenefitItemObj", false);
44 initBinder(60.0f, 60.0f, 0);
45 initHitSensor(1);
46 TVec3f offs;
47 offs.x = 0.0f;
48 offs.y = 60.0f;
49 offs.z = 0.0f;
50 MR::addHitSensorMapObj(this, "body", 4, 60.0f, offs);
51 MR::startBrk(this, "PowerupInvincible");
52}
53
54/*
55void BenefitItemInvincible::appearThrowUp() {
56 if (!_DA) {
57 BenefitItemObj::appearThrowUp();
58 }
59 else {
60 MR::startSystemSE("SE_SY_ITEM_APPEAR", -1, -1);
61 setNerve(&NrvBenefitItemObj::HostTypeNrvShoot::sInstance);
62 f32 appear = cAppearThrowFwdSpd;
63 mVelocity = MR::addTwoScalarVecs(_148, _13C, appear, cAppearThrowUpSpd);
64 MR::invalidateClipping(this);
65 }
66}
67*/
68
69// BenefitItemInvincible::initEscape
70// BenefitItemInvincible::doEscape
71
72void BenefitItemInvincible::runEfx(const char *pEffect) {
73 char str[0x40];
74 if (!strcmp(pEffect, "Glow")) {
75 strcpy(str, pEffect);
76 strcat(str, "PowerUpInvincible");
77 MR::emitEffect(this, str);
78 }
79}
80
81void BenefitItemInvincible::stopEfx(const char *pEffect) {
82 char str[0x40];
83 if (!strcmp(pEffect, "Glow")) {
84 strcpy(str, pEffect);
85 strcat(str, "PowerUpInvincible");
86 MR::emitEffect(this, str);
87 }
88}
89
90BenefitItemInvincible::~BenefitItemInvincible() {
91
92}
93
94void BenefitItemInvincible::runBck(const char *) {
95
96}
97
98namespace NrvBenefitItemObj {
99 INIT_NERVE(HostTypeNrvWait);
100 INIT_NERVE(HostTypeNrvShoot);
101 INIT_NERVE(HostTypeNrvCatch);
102 INIT_NERVE(HostTypeNrvAppearGround);
103 INIT_NERVE(HostTypeNrvPreEscape);
104 INIT_NERVE(HostTypeNrvEscape);
105};
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.
TVec3f mRotation
3D vector of the actor's rotation.
Definition LiveActor.hpp:96