New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
ActorBlockBase.h
Go to the documentation of this file.
1#pragma once
2
3#include <map_obj/ChangeBlockCoinBase.h>
4
6{
7 SEAD_RTTI_OVERRIDE(ActorBlockBase, ChangeBlockCoinBase)
8
9public:
10 /**
11 * @brief Defines the type of block.
12 */
13 enum Type
14 {
15 cType_Hatena = 0, ///< Question Block
16 cType_Renga = 1, ///< Brick Block
17 cType_Hit = 2, ///< Used Block
18 cType_Clear = 3 ///< Invisible Block
19 };
20
21 /**
22 * @brief Persistent state of the block across area reloads.
23 */
31
41 static_assert(sizeof(DestroyedParam) == 0x10, "DestroyedParam size mismatch");
42
50 static_assert(sizeof(DestroyedParam2) == 0xC, "DestroyedParam2 size mismatch");
51
52public:
53 ActorBlockBase(const ActorCreateParam& param);
55
56 // Address: 0x0269F6C8
57 bool init(bool register_collider, bool set_revision_wall_callback);
58 // Address: 0x0269FB30
59 void initMover();
60
62 {
63 return mType;
64 }
65
66 void forceSpawnItemUp(u8 player_no_2, s32 hit_player_no)
67 {
68 mPlayerNo2 = player_no_2;
69 mHitPlayerNo = hit_player_no;
70 mSpawnDirection = cDirType_Up;
71
74 }
75
76 // Address: 0x0269FAB0
77 Content getContent(u32 index);
78
79protected:
80 // Address: 0x0269E6C4
82 // Address: 0x0269E77C
83 bool draw() override;
84
85public:
91
93
94 /**
95 * @brief Restores the persistent state of the block across scene transitions, so that a destroyed/hit block stays that way.
96 * @return Whether the block should still be active as opposed to destroyed.
97 */
98 virtual bool restoreState();
99
100 virtual void vf2DC()
101 {
102 }
103
104 virtual u8 getContentIndex() const
105 {
106 return (mParam1 >> 28 & 1) << 4 | (mParam1 & 0xF);
107 }
108
109 virtual void preSpawnItem();
110
112 {
113 return mPos;
114 }
115
116 virtual void updateMovement();
117 virtual void destroy();
118 virtual void destroy2();
119
120 virtual void updateLiquidEffects()
121 {
122 }
123
124 virtual void onBumpDiff()
125 {
126 }
127
128 virtual void postBump()
129 {
130 }
131
132 virtual u32 vf32C()
133 {
134 return 0;
135 }
136
137 DECLARE_STATE_VIRTUAL_ID_BASE(ActorBlockBase, Wait)
139
140protected:
142
143public:
145 {
146 return mItemCreateZPos;
147 }
148
150 {
151 return mItemCreateYOffsetUpSingle;
152 }
153
155 {
156 return mItemCreateYOffsetDownSingle;
157 }
158
160 {
161 return mItemCreateYOffsetUpMulti;
162 }
163
165 {
166 return mItemCreateYOffsetDownMulti;
167 }
168
169 Type getType() const
170 {
171 return mType;
172 }
173
175 {
177 }
178
179 void setItemCreateZPos(f32 pos)
180 {
181 mItemCreateZPos = pos;
182 }
183
185 {
186 mItemCreateYOffsetUpSingle = offset;
187 }
188
190 {
191 mItemCreateYOffsetDownSingle = offset;
192 }
193
195 {
196 mItemCreateYOffsetUpMulti = offset;
197 }
198
200 {
201 mItemCreateYOffsetDownMulti = offset;
202 }
203
204 void setType(Type type)
205 {
206 mType = type;
207 }
208
209 void setScreenOutCheckEnable(bool screen_out_check)
210 {
211 mScreenOutCheckEnable = screen_out_check;
212 }
213
214protected:
226 bool mScreenOutCheckEnable; // Initialized to true
228};
229static_assert(sizeof(ActorBlockBase) == 0x1CD0);
Definition ActorBlockBase.h:6
void onDownMove_DiffEnd() override
Type getType() const
Definition ActorBlockBase.h:169
u8 _1ccd
Definition ActorBlockBase.h:227
u32 _1cc8
Definition ActorBlockBase.h:225
f32 getItemCreateZPos() const
Definition ActorBlockBase.h:144
u8 _1cc4
Definition ActorBlockBase.h:222
f32 getItemCreateYOffsetDownMulti() const
Definition ActorBlockBase.h:164
f32 getItemCreateYOffsetUpMulti() const
Definition ActorBlockBase.h:159
virtual void destroy()
f32 mItemCreateZPos
Definition ActorBlockBase.h:215
void setItemCreateYOffsetUpSingle(f32 offset)
Definition ActorBlockBase.h:184
virtual bool restoreState()
Restores the persistent state of the block across scene transitions, so that a destroyed/hit block st...
void onDownMove_DiffStart() override
Type getBlockType() const
Definition ActorBlockBase.h:61
f32 mItemCreateYOffsetDownSingle
Definition ActorBlockBase.h:217
ActiveState
Persistent state of the block across area reloads.
Definition ActorBlockBase.h:25
@ cActiveState_Used
Definition ActorBlockBase.h:27
@ cActiveState_Active
Definition ActorBlockBase.h:26
@ cActiveState_MultiCoinExpired
Definition ActorBlockBase.h:29
@ cActiveState_Destroyed
Definition ActorBlockBase.h:28
~ActorBlockBase() override
Definition ActorBlockBase.h:54
void setType(Type type)
Definition ActorBlockBase.h:204
void setItemCreateYOffsetDownSingle(f32 offset)
Definition ActorBlockBase.h:189
bool vf2C4() override
virtual void postBump()
Definition ActorBlockBase.h:128
virtual void updateMovement()
virtual sead::Vector3f getItemCreatePos() const
Definition ActorBlockBase.h:111
bool init(bool register_collider, bool set_revision_wall_callback)
virtual void preSpawnItem()
void forceSpawnItemUp(u8 player_no_2, s32 hit_player_no)
Definition ActorBlockBase.h:66
void setItemCreateYOffsetUpMulti(f32 offset)
Definition ActorBlockBase.h:194
f32 mItemCreateYOffsetDownMulti
Definition ActorBlockBase.h:219
f32 getItemCreateYOffsetUpSingle() const
Definition ActorBlockBase.h:149
void spawnItemUp() override
virtual u8 getContentIndex() const
Definition ActorBlockBase.h:104
virtual void updateLiquidEffects()
Definition ActorBlockBase.h:120
void setItemCreateZPos(f32 pos)
Definition ActorBlockBase.h:179
u8 _1cc6
Definition ActorBlockBase.h:224
virtual void vf2DC()
Definition ActorBlockBase.h:100
bool mScreenOutCheckEnable
Definition ActorBlockBase.h:226
f32 getItemCreateYOffsetDownSingle() const
Definition ActorBlockBase.h:154
virtual void onBumpDiff()
Definition ActorBlockBase.h:124
void setItemCreateYOffsetDownMulti(f32 offset)
Definition ActorBlockBase.h:199
f32 mItemCreateYOffsetUpMulti
Definition ActorBlockBase.h:218
u8 _1cc5
Definition ActorBlockBase.h:223
bool draw() override
Main rendering callback for the actor. Called every frame (the game runs at exactly 60 FPS).
bool getScreenOutCheckEnable() const
Definition ActorBlockBase.h:174
virtual u32 vf32C()
Definition ActorBlockBase.h:132
void spawnItemDown() override
void setScreenOutCheckEnable(bool screen_out_check)
Definition ActorBlockBase.h:209
f32 mItemCreateYOffsetUpSingle
Definition ActorBlockBase.h:216
u32 _1cc0
Definition ActorBlockBase.h:221
Type mType
Definition ActorBlockBase.h:220
virtual void destroy2()
void onMove_Diff() override
bool execute() override
Main execution/logic callback for the actor. Called every frame (the game runs at exactly 60 FPS).
Content getContent(u32 index)
ActorBlockBase(const ActorCreateParam &param)
Definition ActorBlockBase.h:44
u16 fragment_idx
Definition ActorBlockBase.h:48
s8 player_no
Definition ActorBlockBase.h:47
u8 destroy_direction
Definition ActorBlockBase.h:46
sead::Vector2f position
Definition ActorBlockBase.h:45
Definition ActorBlockBase.h:33
s8 player_no
Definition ActorBlockBase.h:38
u16 fragment_idx
Definition ActorBlockBase.h:39
u8 state_type
Definition ActorBlockBase.h:36
u8 _a
Definition ActorBlockBase.h:37
sead::Vector2f position
Definition ActorBlockBase.h:34
u8 destroy_direction
Definition ActorBlockBase.h:35