SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
BenefitItemLifeUp.cpp
1#include "Game/MapObj/BenefitItemLifeUp.hpp"
2#include <cstring>
3
4BenefitItemLifeUp::BenefitItemLifeUp(const char *pName) : BenefitItemObj(pName, "KinokoLifeUp") {
5 if (MR::isGalaxyDarkCometAppearInCurrentStage()) {
6 _D8 = 1;
7 }
8}
9
10void BenefitItemLifeUp::exeCatch() {
11 MR::hideModel(this);
12 MR::changePlayerItemStatus(0xA);
13 runEfx("Get");
14 kill();
15}
16
17void BenefitItemLifeUp::initModelAndEfx() {
18 initModelManagerWithAnm(_120, nullptr, false);
19 initEffectKeeper(5, "BenefitItemObj", false);
20 initBinder(50.0f, 50.0f, 0);
21 initHitSensor(1);
22 TVec3f offs;
23 offs.x = 0.0f;
24 offs.y = 50.0f;
25 offs.z = 0.0f;
26 MR::addHitSensorMapObj(this, "body", 4, 50.0f, offs);
27}
28
29void BenefitItemLifeUp::runEfx(const char *pName) {
30 char str[0x40];
31 strcpy(str, pName);
32 strcat(str, "LifeUp");
33 MR::emitEffect(this, str);
34}
35
36namespace NrvBenefitItemObj {
37 INIT_NERVE(HostTypeNrvWait);
38 INIT_NERVE(HostTypeNrvShoot);
39 INIT_NERVE(HostTypeNrvCatch);
40 INIT_NERVE(HostTypeNrvAppearGround);
41 INIT_NERVE(HostTypeNrvPreEscape);
42 INIT_NERVE(HostTypeNrvEscape);
43};
44
47}
48
49void BenefitItemLifeUp::stopEfx(const char *pName) {
50 char str[0x40];
51 strcpy(str, pName);
52 strcat(str, "LifeUp");
53 MR::emitEffect(this, str);
54}
55
56BenefitItemLifeUp::~BenefitItemLifeUp() {
57
58}
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.