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
32public:
33 ActorBlockBase(const ActorCreateParameter& param);
35
36 // Address: 0x0269F6C8
37 bool init(bool register_collider, bool set_revision_wall_callback);
38 // Address: 0x0269FB30
39 void initMover();
40
42 {
43 return mType;
44 }
45
46 void forceSpawnItemUp(u8 player_no_2, s32 hit_player_no)
47 {
48 mPlayerNo2 = player_no_2;
49 mHitPlayerNo = hit_player_no;
50 mSpawnDirection = cDirType_Up;
51
54 }
55
56 // Address: 0x0269FAB0
57 Content getContent(u32 index);
58
59protected:
60 // Address: 0x0269E6C4
62 // Address: 0x0269E77C
63 bool draw() override;
64
65public:
71
73
74 /**
75 * @brief Restores the persistent state of the block across scene transitions, so that a destroyed/hit block stays that way.
76 * @return Whether the block should still be active as opposed to destroyed.
77 */
78 virtual bool restoreState();
79
80 virtual void vf2DC()
81 {
82 }
83
84 virtual u8 getContentIndex() const
85 {
86 return (mParam1 >> 28 & 1) << 4 | (mParam1 & 0xF);
87 }
88
89 virtual void preSpawnItem();
90
92 {
93 return mPos;
94 }
95
96 virtual void updateMovement();
97 virtual void destroy();
98 virtual void destroy2();
99
100 virtual void updateLiquidEffects()
101 {
102 }
103
104 virtual void onBumpDiff()
105 {
106 }
107
108 virtual void postBump()
109 {
110 }
111
112 virtual u32 vf32C()
113 {
114 return 0;
115 }
116
117 DECLARE_STATE_VIRTUAL_ID_BASE(ActorBlockBase, Wait)
119
120protected:
122
123public:
125 {
126 return mItemCreateZPos;
127 }
128
130 {
131 return mItemCreateYOffsetUpSingle;
132 }
133
135 {
136 return mItemCreateYOffsetDownSingle;
137 }
138
140 {
141 return mItemCreateYOffsetUpMulti;
142 }
143
145 {
146 return mItemCreateYOffsetDownMulti;
147 }
148
149 Type getType() const
150 {
151 return mType;
152 }
153
155 {
157 }
158
159 void setItemCreateZPos(f32 pos)
160 {
161 mItemCreateZPos = pos;
162 }
163
165 {
166 mItemCreateYOffsetUpSingle = offset;
167 }
168
170 {
171 mItemCreateYOffsetDownSingle = offset;
172 }
173
175 {
176 mItemCreateYOffsetUpMulti = offset;
177 }
178
180 {
181 mItemCreateYOffsetDownMulti = offset;
182 }
183
184 void setType(Type type)
185 {
186 mType = type;
187 }
188
189 void setScreenOutCheckEnable(bool screen_out_check)
190 {
191 mScreenOutCheckEnable = screen_out_check;
192 }
193
194protected:
206 bool mScreenOutCheckEnable; // Initialized to true
208};
209static_assert(sizeof(ActorBlockBase) == 0x1CD0);
Definition ActorBlockBase.h:6
void onDownMove_DiffEnd() override
Type getType() const
Definition ActorBlockBase.h:149
u8 _1ccd
Definition ActorBlockBase.h:207
u32 _1cc8
Definition ActorBlockBase.h:205
f32 getItemCreateZPos() const
Definition ActorBlockBase.h:124
u8 _1cc4
Definition ActorBlockBase.h:202
f32 getItemCreateYOffsetDownMulti() const
Definition ActorBlockBase.h:144
f32 getItemCreateYOffsetUpMulti() const
Definition ActorBlockBase.h:139
virtual void destroy()
Main deletion callback for the actor.
f32 mItemCreateZPos
Definition ActorBlockBase.h:195
void setItemCreateYOffsetUpSingle(f32 offset)
Definition ActorBlockBase.h:164
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:41
f32 mItemCreateYOffsetDownSingle
Definition ActorBlockBase.h:197
~ActorBlockBase() override
Definition ActorBlockBase.h:34
void setType(Type type)
Definition ActorBlockBase.h:184
ActorBlockBase(const ActorCreateParameter &param)
ObjBlockInfo
Persistent state of the block across area reloads.
Definition ActorBlockBase.h:25
@ cObjBlockInfo_Destroyed
Definition ActorBlockBase.h:28
@ cObjBlockInfo_Used
Definition ActorBlockBase.h:27
@ cObjBlockInfo_MultiCoinExpired
Definition ActorBlockBase.h:29
@ cObjBlockInfo_Active
Definition ActorBlockBase.h:26
void setItemCreateYOffsetDownSingle(f32 offset)
Definition ActorBlockBase.h:169
bool vf2C4() override
virtual void postBump()
Definition ActorBlockBase.h:108
virtual void updateMovement()
virtual sead::Vector3f getItemCreatePos() const
Definition ActorBlockBase.h:91
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:46
void setItemCreateYOffsetUpMulti(f32 offset)
Definition ActorBlockBase.h:174
f32 mItemCreateYOffsetDownMulti
Definition ActorBlockBase.h:199
f32 getItemCreateYOffsetUpSingle() const
Definition ActorBlockBase.h:129
void spawnItemUp() override
virtual u8 getContentIndex() const
Definition ActorBlockBase.h:84
virtual void updateLiquidEffects()
Definition ActorBlockBase.h:100
void setItemCreateZPos(f32 pos)
Definition ActorBlockBase.h:159
u8 _1cc6
Definition ActorBlockBase.h:204
virtual void vf2DC()
Definition ActorBlockBase.h:80
bool mScreenOutCheckEnable
Definition ActorBlockBase.h:206
f32 getItemCreateYOffsetDownSingle() const
Definition ActorBlockBase.h:134
virtual void onBumpDiff()
Definition ActorBlockBase.h:104
void setItemCreateYOffsetDownMulti(f32 offset)
Definition ActorBlockBase.h:179
f32 mItemCreateYOffsetUpMulti
Definition ActorBlockBase.h:198
u8 _1cc5
Definition ActorBlockBase.h:203
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:154
virtual u32 vf32C()
Definition ActorBlockBase.h:112
void spawnItemDown() override
void setScreenOutCheckEnable(bool screen_out_check)
Definition ActorBlockBase.h:189
f32 mItemCreateYOffsetUpSingle
Definition ActorBlockBase.h:196
u32 _1cc0
Definition ActorBlockBase.h:201
Type mType
Definition ActorBlockBase.h:200
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)