New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
IceMgr.h
Go to the documentation of this file.
1#pragma once
2
3#include <actor/ActorUniqueID.h>
4
5#include <container/seadSafeArray.h>
6#include <math/seadVector.h>
7
8struct IceEfScale;
9
11{
12 cIceType_Square = 0, ///< Square
13 cIceType_Tate, ///< Vertical rectangle
14 cIceType_Yoko, ///< Horizontal rectangle
15 cIceType_BigSquare, ///< Square that isn't carryable
16 cIceType_BigTate, ///< Vertical rectangle that isn't carryable
17 cIceType_BigYoko, ///< Horizontal rectangle that isn't carryable
18
20};
21static_assert(cIceType_Num == 6);
22
23struct IceInfo
24{
28 const IceEfScale* ef_scale; // Was actually applied in NSMBW, but no longer does anything in NSMBU
29
30 static u32 makeParam(IceType type, bool unk_1 = false, u32 unk_2 = 0, bool unk_3 = false)
31 {
32 return (
33 ((u32)type & 7) |
34 ((u32)unk_1 << 12) |
35 ((unk_2 & 0xF) << 24) |
36 ((u32)unk_3 << 28)
37 );
38 }
39};
40
41class Enemy;
42
43class IceMgr
44{
45public:
46 static const s32 cIceMaxNum = 12;
47
48public:
56
64
65public:
66 struct IceStatus
67 {
68 union
69 {
70 struct
71 {
75 };
77 };
78
81 , ice_act_1(0)
82 , ice_act_2(4)
83 {
84 }
85
86 IceStatus(s32 melt_time_type_, s32 ice_act_1_, s32 ice_act_2_)
90 {
91 }
92 };
93 static_assert(sizeof(IceStatus) == 4);
94
95 struct TimeInfo
96 {
99 };
100 static_assert(sizeof(TimeInfo) == 4);
101
102public:
103 // Address: 0x0237CBBC
104 IceMgr(Enemy* owner);
105 // Address: 0x0237CD54
107
108 // Address: 0x0237CB94
109 void setIceStatus(const IceStatus& status);
110
111 // Address: 0x0237D068
113
114 // Address: 0x0237D540
116
117 // Address: 0x0237D63C
118 bool createIce(IceInfo* info, s32 num);
119
120 bool createIce(IceInfo& info)
121 {
122 return createIce(&info, 1);
123 }
124
125 template <s32 N>
126 bool createIce(IceInfo (&info_array)[N])
127 {
128 return createIce(info_array, N);
129 }
130
131 // Address: 0x0237CCC8
132 void removeIce();
133
134 void setIce(bool enable)
135 {
136 mHasIce = enable;
137 }
138
139 bool hasIce() const
140 {
141 return mHasIce;
142 }
143
144 // Address: 0x0237D934
146
147 bool isYoganDive() const
148 {
149 return mYoganDive;
150 }
151
152 bool isDrcBreakSound() const
153 {
154 return mDrcBreakSound;
155 }
156
157 bool isDestroy() const
158 {
159 return mDestroyMode != cDestroyMode_None;
160 }
161
163 {
164 return DestroyMode(mDestroyMode);
165 }
166
167 void setPlayerNo(s8 player_no)
168 {
169 mPlayerNo = player_no;
170 }
171
172protected:
180 bool mHasIce; // Maybe?
181 bool mPermanent; // Maybe??
189};
190static_assert(sizeof(IceMgr) == 0x50);
IceType
Definition IceMgr.h:11
@ cIceType_Num
Definition IceMgr.h:19
@ cIceType_Tate
Vertical rectangle.
Definition IceMgr.h:13
@ cIceType_Square
Square.
Definition IceMgr.h:12
@ cIceType_BigYoko
Horizontal rectangle that isn't carryable.
Definition IceMgr.h:17
@ cIceType_BigTate
Vertical rectangle that isn't carryable.
Definition IceMgr.h:16
@ cIceType_Yoko
Horizontal rectangle.
Definition IceMgr.h:14
@ cIceType_BigSquare
Square that isn't carryable.
Definition IceMgr.h:15
Definition Enemy.h:152
Definition IceMgr.h:44
bool mDrcBreakSound
Definition IceMgr.h:183
void initialize()
bool createIce(IceInfo(&info_array)[N])
Definition IceMgr.h:126
IceMgr(Enemy *owner)
sead::SafeArray< ActorUniqueID, cIceMaxNum > mIceID
Definition IceMgr.h:174
DestroyMode getDestroyMode() const
Definition IceMgr.h:162
void breakEffect()
bool mYoganDive
Definition IceMgr.h:182
s8 mDestroyMode
Definition IceMgr.h:186
u8 mIceNum
Definition IceMgr.h:173
bool isDrcBreakSound() const
Definition IceMgr.h:152
void setIceStatus(const IceStatus &status)
bool createIce(IceInfo *info, s32 num)
bool isYoganDive() const
Definition IceMgr.h:147
s16 mTimer2
Definition IceMgr.h:179
TimeInfo * mTimeInfo
Definition IceMgr.h:176
DestroyMode
Definition IceMgr.h:58
@ cDestroyMode_2
Definition IceMgr.h:61
@ cDestroyMode_Break
Definition IceMgr.h:60
@ cDestroyMode_Vanish
Definition IceMgr.h:62
@ cDestroyMode_None
Definition IceMgr.h:59
s8 mPlayerNo
Definition IceMgr.h:187
IceStatus mIceStatus
Definition IceMgr.h:175
bool mPermanent
Definition IceMgr.h:181
void setPlayerNo(s8 player_no)
Definition IceMgr.h:167
s16 mTimer1
Definition IceMgr.h:178
void setIce(bool enable)
Definition IceMgr.h:134
u8 _49
Definition IceMgr.h:185
bool mHasIce
Definition IceMgr.h:180
Enemy * mOwner
Definition IceMgr.h:177
void removeIce()
Proc
Definition IceMgr.h:50
@ cProc_Melt
Definition IceMgr.h:52
@ cProc_Ice
Definition IceMgr.h:51
@ cProc_2
Definition IceMgr.h:53
@ cProc_Return
Definition IceMgr.h:54
Proc manageProc()
u8 _48
Definition IceMgr.h:184
bool hasIce() const
Definition IceMgr.h:139
bool isDestroy() const
Definition IceMgr.h:157
bool createIce(IceInfo &info)
Definition IceMgr.h:120
u8 _4c
Definition IceMgr.h:188
static const s32 cIceMaxNum
Definition IceMgr.h:46
Definition IceMgr.h:24
u32 ice_param_0
Definition IceMgr.h:25
sead::Vector3f position
Definition IceMgr.h:26
const IceEfScale * ef_scale
Definition IceMgr.h:28
static u32 makeParam(IceType type, bool unk_1=false, u32 unk_2=0, bool unk_3=false)
Definition IceMgr.h:30
sead::Vector3f scale
Definition IceMgr.h:27
Definition IceMgr.h:67
u8 melt_time_type
Definition IceMgr.h:72
u32 _0
Definition IceMgr.h:76
u8 ice_act_2
Definition IceMgr.h:74
u8 ice_act_1
Definition IceMgr.h:73
IceStatus()
Definition IceMgr.h:79
IceStatus(s32 melt_time_type_, s32 ice_act_1_, s32 ice_act_2_)
Definition IceMgr.h:86
Definition IceMgr.h:96
s16 melt_shake
Definition IceMgr.h:98
s16 melt
Definition IceMgr.h:97