New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
Actor.h
Go to the documentation of this file.
1#pragma once
2
3#include <actor/ActorBase.h>
4#include <actor/ActorCullRange.h>
5#include <collision/ActorCollisionCheck.h>
6#include <utility/Angle3.h>
7#include <utility/Direction.h>
8
10class BgCollision;
13class EatData;
14class PropelParts;
15
16typedef s32 EffectID;
17
18class Actor : public ActorBase // vtbl Address: 0x10000268
19{
20 // getRuntimeTypeInfoStatic()::typeInfo initialization guard variable Address: 0x101E9CBC
21 // getRuntimeTypeInfoStatic()::typeInfo Address: 0x101E9CC0
22 SEAD_RTTI_OVERRIDE(Actor, ActorBase)
23
24public:
33
43
44 /**
45 * @brief Flags to pass to `screenOutCheck` to skip checks or actions during the evaluation.
46 */
48 {
49 cScreenOutFlag_SkipNone = 0, ///< Perform all checks and delete the actor if they pass.
50 cScreenOutFlag_SkipDeletion = 1 << 1, ///< Skip deleting the actor if the checks do pass.
51 cScreenOutFlag_SkipCameraCheck = 1 << 2, ///< Skip checking if the actor is outside of the visible camera.
52 cScreenOutFlag_SkipRideCheck = 1 << 3, ///< Skip checking if the actor is riding another actor/platform.
53 cScreenOutFlag_SkipTottenCheck = 1 << 4 ///< Skip checking if Nabbit has passed to the right of the actor's visible range.
54 };
55
56public:
57 virtual void setPlayerNo(s8 id)
58 {
59 mPlayerNo = id;
60 }
61
63 {
64 return mPlayerNo;
65 }
66
67 // Address: 0x020002CC
68 virtual void removeCollisionCheck();
69 // Address: 0x02000328
70 virtual void reviveCollisionCheck();
71
73 {
74 return nullptr;
75 }
76
77 virtual void setCarryFall(Actor*, s32)
78 {
79 }
80
81 virtual bool isSpinLiftUpEnable()
82 {
83 return true;
84 }
85
86 virtual void setSpinLiftUpActor(Actor* player)
87 {
88 }
89
90 virtual void vfC4()
91 {
92 }
93
94 virtual void vfCC()
95 {
96 }
97
98 // Address: 0x02000394
99 bool checkCarried(s32* player_no);
100
102 {
103 return mComboCnt;
104 }
105
106 // Address: 0x02000418
108 // Address: 0x0200042C
110
111 // Address: 0x02000454
112 void slideComboSE(s32 combo_cnt, bool combo_type_2);
113
114 // Address: 0x020005A4
115 s32 searchNearPlayer(sead::Vector2f& out); // Returns -1 if no player found
116
117 // Address: 0x020005EC
118 DirType getPlayerDirLR(const sead::Vector3f& position);
119 // Address: 0x020006B4
120 DirType getPlayerDirUD(const sead::Vector3f& position);
121
123 {
124 return getPlayerDirLR(mPos);
125 }
126
128 {
129 return getPlayerDirUD(mPos);
130 }
131
132 /**
133 * @brief Checks if the actor is out of gameplay and optionally deletes it.
134 * @param flag Specify checks to skip, and whether to delete the actor if they all passed. See the `ScreenOutFlag` enum.
135 * @return Whether the actor is out of gameplay.
136 * @details The actor is considered "out of gameplay" if:
137 * * It has not been eaten.
138 * * It is not riding another actor/platform (unless skipped by flag).
139 * * Nabbit has passed to the **right** of the actor's visible range.
140 * * The actor is out of the zone bounds OR the actor is outside of the visible camera.
141 * @par Address: 0x020007A0
142 */
143 bool screenOutCheck(u16 flag);
144
145 // Address: 0x02002AD8
146 virtual void allEnemyDeathEffSet(); // Spawn burst effect at instances where all enemies die (such as touching goal pole or defeating boss), called if profile flag bit 4, 5 or 7 is set
147 // Address: 0x02002ADC
148 virtual void waterSplashEffect(const sead::Vector3f& pos);
149 // Address: 0x02002AE0
150 virtual void yoganSplashEffect(const sead::Vector3f& pos);
151 // Address: 0x02000960
152 virtual void yoganWaveSplashEffect(const sead::Vector3f& pos);
153 // Address: 0x02002AE4
154 virtual void poisonSplashEffect(const sead::Vector3f& pos);
155
156 // Address: 0x02000970
158
159 // Address: 0x02000A70
160 bool checkEat() const;
161
162 /**
163 * @brief Schedule this actor for deletion on the next frame.
164 * @param manual_deleted Prevents respawning.
165 * @par Address: 0x02000774
166 */
167 void deleteActor(bool manual_deleted);
168
169public:
171 {
172 return mCollisionCheck;
173 }
174
176 {
177 return mCollisionCheck;
178 }
179
180 bool isExecEnable() const
181 {
182 return mIsExecEnable;
183 }
184
185 bool isDrawEnable() const
186 {
187 return mIsDrawEnable;
188 }
189
191 {
192 return mDirection;
193 }
194
195 void setDirection(DirType dir)
196 {
197 mDirection = dir;
198 }
199
200 u8 getLayer() const
201 {
202 return mLayer;
203 }
204
206 {
207 return mSpeedF;
208 }
209
210 void setSpeedF(f32 speedF)
211 {
212 mSpeedF = speedF;
213 }
214
216 {
217 return mMaxSpeedF;
218 }
219
220 void setMaxSpeedF(f32 maxSpeedF)
221 {
222 mMaxSpeedF = maxSpeedF;
223 }
224
226 {
227 return mMaxFallSpeed;
228 }
229
230 void setMaxFallSpeed(f32 maxFallSpeed)
231 {
232 mMaxFallSpeed = maxFallSpeed;
233 }
234
236 {
237 return mAccelY;
238 }
239
240 void setAccelY(f32 accelY)
241 {
242 mAccelY = accelY;
243 }
244
246 {
247 return mAccelF;
248 }
249
250 void setAccelF(f32 accelF)
251 {
252 mAccelF = accelF;
253 }
254
256 {
257 return mPos;
258 }
259
260 const sead::Vector3f& getPos() const
261 {
262 return mPos;
263 }
264
266 {
267 return reinterpret_cast<sead::Vector2f&>(mPos.x);
268 }
269
270 const sead::Vector2f& getPos2D() const
271 {
272 return reinterpret_cast<const sead::Vector2f&>(mPos.x);
273 }
274
276 {
277 return getPos() + mCenterOffset;
278 }
279
281 {
282 return getPos2D() + reinterpret_cast<const sead::Vector2f&>(mCenterOffset.x);
283 }
284
286 {
287 return mPos.x + mCenterOffset.x;
288 }
289
291 {
292 return mPos.y + mCenterOffset.y;
293 }
294
296 {
297 return mPos.z + mCenterOffset.z;
298 }
299
301 {
302 return mSpeed;
303 }
304
305 const sead::Vector3f& getSpeedVec() const
306 {
307 return mSpeed;
308 }
309
311 {
312 return mSpeedMax;
313 }
314
316 {
317 return mSpeedMax;
318 }
319
321 {
322 return mScale;
323 }
324
325 const sead::Vector3f& getScale() const
326 {
327 return mScale;
328 }
329
331 {
332 return mAngle;
333 }
334
335 const Angle3& getAngle() const
336 {
337 return mAngle;
338 }
339
341 {
342 return ActorType(mActorType);
343 }
344
345 void setKind(ActorType type)
346 {
347 mActorType = type;
348 }
349
351 {
352 return mManualDeletedFlag;
353 }
354
356 {
357 return CarryFlag(mCarryFlag);
358 }
359
361 {
362 return mSwitchFlag0;
363 }
364
366 {
367 return mSwitchFlag1;
368 }
369
371 {
372 return mProfFlag;
373 }
374
375protected:
376 // Address: 0x02000AC8
377 Actor(const ActorCreateParam& param);
378 // Address: 0x02000F18
380
381protected:
382 // Address: 0x02000FB8
383 void postCreate(MainState state) override;
384
385 // Address: 0x02000FE8
387 // Address: 0x020010BC
388 void postExecute(MainState state) override;
389
390 // Address: 0x020011A0
392
393 // Address: 0x02001254
394 virtual bool drawCullCheck_();
395
396 virtual void blockHitInit_()
397 {
398 }
399
400 // Address: 0x02001304
401 void splashEffect_(const sead::Vector3f& pos, EffectID effect_id, u8 wave_scale, const char* sound_label);
402
403 // Address: 0x020013D4
405
406 // Address: 0x020013E8
408 // Address: 0x02001430
409 void calcSpeedY_(f32 accel_y, f32 speed_max_y);
410 void calcSpeedY_() { calcSpeedY_(mAccelY, mSpeedMax.y); }
411
412 void calcSpeedF_(f32 accelF, f32 max_speedF) { sead::Mathf::chase(&mSpeedF, max_speedF, accelF); }
413 void calcSpeedF_() { calcSpeedF_(mAccelF, mMaxSpeedF); }
414 // Address: 0x0200144C
415 void calcFallSpeed_(f32 accel_y, f32 max_fall_speed);
416 void calcFallSpeed_() { calcFallSpeed_(mAccelY, mMaxFallSpeed); }
417
418 void posMove_(sead::Vector3f& delta)
419 {
420 mPos += delta;
421 }
422
423 void posMove_(sead::Vector2f& delta_xy, f32 delta_z)
424 {
425 getPos2D() += delta_xy;
426 mPos.z += delta_z;
427 }
428
429 void posMove_()
430 {
431 posMove_(mSpeed);
432 }
433
434 // Address: 0x02001A28
435 void carryFukidashiCheck_(s32 action);
436 // Address: 0x02001490
437 void carryFukidashiCheck_(s32 action, const sead::Vector2f& range);
438 // Address: 0x02001A64
439 void carryFukidashiCancel_(s32 action, s32 player_no);
440
441 // Address: 0x02001DC4
443 // Address: 0x0200222C
445
446 // Address: 0x02002594
448 // Address: 0x02002664
450
451 // Address: 0x0200272C
453
454 // Address: 0x02002390
455 bool setPressBreakIce_(const BgCollision* bg_collision);
456 // Address: 0x020024E0
457 bool setPressBreakBlockDRC_(const BgCollision* bg_collision);
458
459private:
461
462 // Address: 0x02001AF4
463 bool canPress_(const BgCollision* bg_collision);
464
465 // Address: 0x02001C08
466 bool checkPressLR_(const ActorBgCollisionCheck& bc, DirType direction);
467 // Address: 0x02002098
469 // Address: 0x02001F04
471
472 // Address: 0x02001B2C
473 bool canPressIfApproaching_(const BgCollision* bgcol_approaching_side, const BgCollision* bgcol_fixed_side);
474
475 // Address: 0x02000720
476 u32 calcTottenToSrcDir_(const sead::BoundBox2f& src_range) const;
477
478protected:
482 u8 mLayer; // Inited to ActorCreateParam::layer
484 f32 mSpeedF; // Horizontal speed
485 f32 mMaxSpeedF; // Maximum horizontal speed
486 f32 mMaxFallSpeed; // Maximum fall speed
487 f32 mAccelY; // Vertical acceleration
488 f32 mAccelF; // Horizontal acceleration
495 sead::Vector2f mPosDelta; // At start of every frame
497 sead::Vector2f mVisibleAreaOffset; // Inited to ActorCreateInfo::spawn_range.offset
498 sead::Vector2f mVisibleAreaSize; // Inited to ActorCreateInfo::spawn_range.half_size * 2
500 ActorCullRange mCullLimit; // Inited to { 256.0 + ActorCreateInfo::cull_range.up,
501 // 256.0 + ActorCreateInfo::cull_range.down,
502 // 80.0 + ActorCreateInfo::cull_range.left,
503 // 80.0 + ActorCreateInfo::cull_range.right }
505 u8 mActorType; // ActorType
510 u8 mCarryFlag; // CarryFlag
513 u16 mCreateFlag; // Inited to ActorCreateInfo::flag
520 u32 mProfFlag; // Inited to Profile::mFlag
522 sead::Vector3f mPosPrev; // At frame start
524 sead::Vector3f mPosPrev2; // At frame end
528 u8* _270; // Inited to ActorCreateParam::_28
531
532 // Address: 0x10000B64
533 static const f32 cCullXLimit;
534 // Address: 0x10000B68
535 static const f32 cCullYLimit;
536};
537static_assert(sizeof(Actor) == 0x27C);
s32 EffectID
Definition Actor.h:16
Definition ActorBgCollisionCheck.h:59
Definition Actor.h:19
bool isDrawEnable() const
Definition Actor.h:185
virtual void waterSplashEffect(const sead::Vector3f &pos)
sead::Vector3f mPosPrev
Definition Actor.h:522
void setSpeedF(f32 speedF)
Definition Actor.h:210
DirType getDirection() const
Definition Actor.h:190
s32 searchNearPlayer(sead::Vector2f &out)
virtual void allEnemyDeathEffSet()
virtual bool isSpinLiftUpEnable()
Definition Actor.h:81
void setMaxSpeedF(f32 maxSpeedF)
Definition Actor.h:220
Angle3 mAngle
Definition Actor.h:493
bool mIsExecEnable
Definition Actor.h:506
ScreenOutFlag
Flags to pass to screenOutCheck to skip checks or actions during the evaluation.
Definition Actor.h:48
@ cScreenOutFlag_SkipDeletion
Skip deleting the actor if the checks do pass.
Definition Actor.h:50
@ cScreenOutFlag_SkipRideCheck
Skip checking if the actor is riding another actor/platform.
Definition Actor.h:52
@ cScreenOutFlag_SkipNone
Perform all checks and delete the actor if they pass.
Definition Actor.h:49
@ cScreenOutFlag_SkipTottenCheck
Skip checking if Nabbit has passed to the right of the actor's visible range.
Definition Actor.h:53
@ cScreenOutFlag_SkipCameraCheck
Skip checking if the actor is outside of the visible camera.
Definition Actor.h:51
bool checkPressU_(const ActorBgCollisionCheck &bc)
sead::Vector2f mVisibleAreaSize
Definition Actor.h:498
void posMove_(sead::Vector2f &delta_xy, f32 delta_z)
Definition Actor.h:423
virtual bool drawCullCheck_()
sead::Vector3f mSpeedMax
Definition Actor.h:491
const sead::Vector3f & getSpeedMaxVec() const
Definition Actor.h:315
s8 mPlayerNo
Definition Actor.h:480
const Angle3 & getAngle() const
Definition Actor.h:335
void postExecute(MainState state) override
Callback invoked unconditionally after the execute phase completes. It executes even if preExecute() ...
u8 getLayer() const
Definition Actor.h:200
f32 getMaxFallSpeed() const
Definition Actor.h:225
s8 getPlayerNo() const
Definition Actor.h:62
const ActorCollisionCheck & getCollisionCheck() const
Definition Actor.h:175
u8 getSwitchFlag1() const
Definition Actor.h:365
void calcSpeedX_()
bool setPressBreakLR_(const ActorBgCollisionCheck &bc)
virtual void setPlayerNo(s8 id)
Definition Actor.h:57
void setAccelY(f32 accelY)
Definition Actor.h:240
PropelParts * mPropelParts
Definition Actor.h:527
void setAccelF(f32 accelF)
Definition Actor.h:250
sead::Vector2f mVisibleAreaOffset
Definition Actor.h:497
bool canPress_(const BgCollision *bg_collision)
s32 mComboCnt
Definition Actor.h:519
virtual void setCarryFall(Actor *, s32)
Definition Actor.h:77
bool setPressIceHeadBreak_(const ActorBgCollisionCheck &bc)
ChibiYoshiEatData * mChibiYoshiEatDataPtr
Definition Actor.h:526
EatData * mEatDataPtr
Definition Actor.h:525
const sead::Vector3f & getSpeedVec() const
Definition Actor.h:305
DirType mDirection
Definition Actor.h:479
bool preExecute() override
Callback invoked before the execute operation.
ActorCullRange mCullLimit
Definition Actor.h:500
ActorType getActorType() const
Definition Actor.h:340
virtual ActorBgCollisionCheck * getBgCheck()
Definition Actor.h:72
bool isEnablePressUD_(const ActorBgCollisionCheck &bc)
sead::Vector3f & getPos()
Definition Actor.h:255
u32 mProfFlag
Definition Actor.h:520
virtual void setSpinLiftUpActor(Actor *player)
Definition Actor.h:86
void setDirection(DirType dir)
Definition Actor.h:195
sead::Vector2f mSize
Definition Actor.h:499
DirType getPlayerDirLR()
Definition Actor.h:122
void carryFukidashiCheck_(s32 action)
sead::Vector2f getCenterPos2D() const
Definition Actor.h:280
bool setPressBreakIce_(const BgCollision *bg_collision)
ActorCollisionCheck mCollisionCheck
Definition Actor.h:496
s8 mControllerLytPlayerNo
Definition Actor.h:481
void calcSpeedF_()
Definition Actor.h:413
u16 mCreateFlag
Definition Actor.h:513
void posMove_()
Definition Actor.h:429
sead::Vector3f mCenterOffset
Definition Actor.h:521
void postCreate(MainState state) override
Callback invoked unconditionally after the create phase completes. It executes even if preCreate() by...
f32 getAccelF() const
Definition Actor.h:245
bool screenOutCheck(u16 flag)
Checks if the actor is out of gameplay and optionally deletes it.
bool checkPressD_(const ActorBgCollisionCheck &bc)
bool mIsDrawEnable
Definition Actor.h:507
static const f32 cCullXLimit
Definition Actor.h:533
u8 mAreaNo
Definition Actor.h:504
sead::Vector3f & getSpeedVec()
Definition Actor.h:300
void calcFallSpeed_(f32 accel_y, f32 max_fall_speed)
s32 getComboCnt() const
Definition Actor.h:101
sead::Vector2f & getPos2D()
Definition Actor.h:265
sead::Vector3f & getSpeedMaxVec()
Definition Actor.h:310
sead::Vector3f mPosPrevPostExec
Definition Actor.h:523
void carryFukidashiCancel_(s32 action, s32 player_no)
const sead::Vector2f & getPos2D() const
Definition Actor.h:270
u32 getProfFlag() const
Definition Actor.h:370
f32 mAccelF
Definition Actor.h:488
DirType getPlayerDirUD()
Definition Actor.h:127
void setAreaNo_()
u8 mSwitchFlag1
Definition Actor.h:512
void splashEffect_(const sead::Vector3f &pos, EffectID effect_id, u8 wave_scale, const char *sound_label)
sead::Vector3f mPos
Definition Actor.h:489
bool setPressBreakBlockDRC_(const BgCollision *bg_collision)
void calcSpeedF_(f32 accelF, f32 max_speedF)
Definition Actor.h:412
virtual void yoganWaveSplashEffect(const sead::Vector3f &pos)
bool checkEat() const
bool isEnablePressLR_(const ActorBgCollisionCheck &bc)
bool canPressIfApproaching_(const BgCollision *bgcol_approaching_side, const BgCollision *bgcol_fixed_side)
f32 mAccelY
Definition Actor.h:487
ChibiYoshiAwaData * mChibiYoshiAwaDataPtr
Definition Actor.h:530
u32 mBumpDamageTimer
Definition Actor.h:514
sead::Vector2f mPosDelta
Definition Actor.h:495
void deleteActor(bool manual_deleted)
Schedule this actor for deletion on the next frame.
bool checkCarried(s32 *player_no)
u8 _220
Definition Actor.h:516
Actor(const ActorCreateParam &param)
u32 mBumpDirection
Definition Actor.h:515
u8 mSwitchFlag0
Definition Actor.h:511
f32 mMaxSpeedF
Definition Actor.h:485
virtual void vfC4()
Definition Actor.h:90
CarryFlag getCarryFlag() const
Definition Actor.h:355
bool setPressBreakUD_(const ActorBgCollisionCheck &bc)
f32 mAddSpeedF
Definition Actor.h:529
void slideComboSE(s32 combo_cnt, bool combo_type_2)
f32 getSpeedF() const
Definition Actor.h:205
virtual void yoganSplashEffect(const sead::Vector3f &pos)
DirType mCarryDirection
Definition Actor.h:517
static const f32 cCullYLimit
Definition Actor.h:535
u8 getSwitchFlag0() const
Definition Actor.h:360
void setMaxFallSpeed(f32 maxFallSpeed)
Definition Actor.h:230
Angle3 mAnglePrev
Definition Actor.h:494
u8 mLayer
Definition Actor.h:482
void calcSpeedY_()
Definition Actor.h:410
DirType getPlayerDirLR(const sead::Vector3f &position)
sead::Vector3f getCenterPos() const
Definition Actor.h:275
~Actor() override
f32 mSpeedF
Definition Actor.h:484
bool isExecEnable() const
Definition Actor.h:180
f32 getMaxSpeedF() const
Definition Actor.h:215
u8 mActorType
Definition Actor.h:505
ActorCollisionCheck & getCollisionCheck()
Definition Actor.h:170
virtual void poisonSplashEffect(const sead::Vector3f &pos)
bool mManualDeletedFlag
Definition Actor.h:508
virtual void removeCollisionCheck()
void incComboCnt()
virtual void reviveCollisionCheck()
bool getManualDeletedFlag() const
Definition Actor.h:350
void calcFallSpeed_()
Definition Actor.h:416
Actor * searchCarryFukidashiPlayer_(s32 action)
void carryFukidashiCheck_(s32 action, const sead::Vector2f &range)
Angle3 & getAngle()
Definition Actor.h:330
u32 mThrowPlayerNo
Definition Actor.h:518
f32 getCenterX() const
Definition Actor.h:285
CarryFlag
Definition Actor.h:35
@ cCarryFlag_Throw
Definition Actor.h:37
@ cCarryFlag_Release
Definition Actor.h:36
@ cCarryFlag_All
Definition Actor.h:41
@ cCarryFlag_ThrowHard
Definition Actor.h:38
@ cCarryFlag_None
Definition Actor.h:40
sead::Vector3f mScale
Definition Actor.h:492
sead::Vector3f mPosPrev2
Definition Actor.h:524
u8 * _270
Definition Actor.h:528
void clrComboCnt()
f32 getCenterY() const
Definition Actor.h:290
u32 calcTottenToSrcDir_(const sead::BoundBox2f &src_range) const
virtual void blockHitInit_()
Definition Actor.h:396
void calcSpeedY_(f32 accel_y, f32 speed_max_y)
f32 getEffectZPos() const
sead::BitFlag8 mCollisionMask
Definition Actor.h:483
const sead::Vector3f & getScale() const
Definition Actor.h:325
f32 getCenterZ() const
Definition Actor.h:295
sead::Vector3f & getScale()
Definition Actor.h:320
f32 getAccelY() const
Definition Actor.h:235
void posMove_(sead::Vector3f &delta)
Definition Actor.h:418
u8 mCarryFlag
Definition Actor.h:510
sead::Vector3f mSpeed
Definition Actor.h:490
DirType getPlayerDirUD(const sead::Vector3f &position)
u8 _211
Definition Actor.h:509
const sead::Vector3f & getPos() const
Definition Actor.h:260
bool preDraw() override
Callback invoked before the draw operation.
virtual void vfCC()
Definition Actor.h:94
void setKind(ActorType type)
Definition Actor.h:345
bool checkPressLR_(const ActorBgCollisionCheck &bc, DirType direction)
f32 mMaxFallSpeed
Definition Actor.h:486
Definition BgCollision.h:19
Defines parameters for interaction with bubbles from the blue Baby Yoshi.
Definition ChibiYoshiAwaData.h:14
Definition ChibiYoshiEatData.h:10
Definition EatData.h:10
Definition PropelParts.h:11