SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
DeathArea.cpp
1#include "Game/AreaObj/DeathArea.hpp"
2
3DeathArea::DeathArea(int a1, const char *pName) : AreaObj(a1, pName) {
4
5}
6
7void DeathArea::init(const JMapInfoIter &rIter) {
8 AreaObj::init(rIter);
9 MR::connectToSceneAreaObj(this);
10}
11
12void DeathArea::movement() {
13 if (isInVolume(*MR::getPlayerPos())) {
14 bool canKill = getDeathType() == 0;
15 if (canKill) {
16 MR::forceKillPlayerByAbyss();
17 }
18 }
19}
20
21bool DeathArea::isInVolume(const TVec3f &rVec) const {
22 bool ret;
23
24 if (isValidSwitchA() && !isOnSwitchA()) {
25 ret = false;
26 }
27 else {
28 ret = AreaObj::isInVolume(rVec);
29 }
30
31 return ret;
32}
33
34s32 DeathArea::getDeathType() const {
35 return mObjArg0 != -1 ? mObjArg0 : 0;
36}
37
38DeathArea::~DeathArea() {
39
40}
41
42const char* DeathArea::getManagerName() const {
43 return "DeathArea";
44}
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition AreaObj.cpp:41
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition DeathArea.cpp:7