NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_en_togezo_base.hpp
1#include <game/bases/d_a_en_shell.hpp>
2#include <game/bases/d_effect.hpp>
3
4/// @brief Base class for spinys.
5/// @statetable
6/// @paramtable
7class daEnTogezoBase_c : public daEnShell_c {
8public:
9 daEnTogezoBase_c() {}
10 virtual ~daEnTogezoBase_c() {}
11
12 virtual int create();
13 virtual int execute();
14 virtual int draw();
15 virtual int doDelete();
16 virtual void deleteReady();
17 virtual void block_hit_init();
18 virtual bool setEatSpitOut(dActor_c *eatingActor);
19 virtual bool hitCallback_Slip(dCc_c *self, dCc_c *other) { return false; }
20 virtual bool createIceActor();
21
22 virtual void finalUpdate() { calcMdl(); }
23
24 STATE_FUNC_DECLARE(daEnTogezoBase_c, Walk); ///< Walking on the ground.
25 STATE_FUNC_DECLARE(daEnTogezoBase_c, Pipo); ///< Rolled up in a ball.
26 STATE_FUNC_DECLARE(daEnTogezoBase_c, Change_Pipo); ///< Transforming into a ball.
27 STATE_FUNC_DECLARE(daEnTogezoBase_c, Change_Togezo); ///< Transforming into a regular spiny.
28 STATE_FUNC_DECLARE(daEnTogezoBase_c, Turn); ///< Turning around while walking.
29 STATE_VIRTUAL_FUNC_DECLARE(daEnTogezoBase_c, DieFall);
30 STATE_VIRTUAL_FUNC_DECLARE(daEnTogezoBase_c, Wakeup);
31 STATE_VIRTUAL_FUNC_DECLARE(daEnTogezoBase_c, WakeupReverse);
32 STATE_VIRTUAL_FUNC_DECLARE(daEnTogezoBase_c, WakeupTurn);
33
34 virtual bool setPlayerDamage(dActor_c *actor);
35 virtual bool specialFumiProc(dActor_c *actor);
36 virtual bool specialFumiProc_Yoshi(dActor_c *actor);
37 virtual bool isFumiInvalid() const { return !mIsFlipped; }
38 virtual void setAfterSleepState();
39 virtual bool turnProc();
40 virtual bool isDieShell();
41
42 virtual void setEnemyTurn() {
43 if (isState(StateID_Walk)) {
45 }
46 }
47
48 virtual void initialize() {}
49 virtual bool isCullCheckOk() { return true; }
50 virtual void calcCatchPos() {}
51
52 void createModel();
53 void calcMdl();
54 void calcPaipoMdl();
55 void calcTogezoMdl();
56 void drawTogezo();
57 void drawPaipo();
58 bool checkRyusa();
59 void ryusaEffect();
60 void pipoRolling();
61 void pipoWallBound();
62 bool isBlockHitDeath() const;
63 void landonEffect(float height);
64
65 u8 mPad1[0x4];
66 dHeapAllocator_c mAllocator; ///< The allocator used for the resources of this actor.
67 nw4r::g3d::ResFile mTogezoResFile; ///< The resource file for the spiny.
68 m3d::mdl_c mTogezoModel; ///< The spiny model.
69 m3d::anmChr_c mTogezoAnim; ///< The spiny's animation.
70 nw4r::g3d::ResFile mPaipoResFile; ///< The resource file for the rolled up spiny.
71 m3d::smdl_c mPaipoMdl; ///< The model for the rolled up spiny.
72 u32 mChangeTimer; ///< Timer used for transforming between spiny and rolled up spiny.
73 u8 mPad2[0x2];
74 u8 mPipoDir; ///< The direction the rolled up spiny is moving. Used to determine if the spiny should turn around when it unrolls.
75 s16 mPipoRollSpeed; ///< The speed at which the spiny unrolls.
76 u8 mPad3[0x6];
77 s16 m_894;
78 u32 mPipoTouchedGround; ///< Whether the rolled up spiny has touched the ground since rolling up.
79 dEf::dLevelEffect_c mLevelEffect;
80
81 ACTOR_PARAM_CONFIG(DieOnBlockHit, 4, 1);
82
83 static const sBcSensorPoint smc_toge_head;
84 static const sBcSensorLine smc_toge_foot;
85 static const sBcSensorLine smc_toge_wall;
86 static const sBcSensorLine smc_sakasa_toge_foot;
87 static const sBcSensorPoint smc_pipo_head;
88 static const sBcSensorLine smc_pipo_foot;
89 static const sBcSensorLine smc_pipo_wall;
90 static const sCcDatNewF smc_toge_cc;
91 static const float smc_WALK_SPEED_DAT[2];
92 static const s16 smc_ROTATE_SPEED_DAT[2];
93 static const s16 smc_ANGLE_Y[2];
94};
bool isState(const sStateIDIf_c &other) const
Checks if the actor is currently in the given state.
The minimum required implementation for a stage actor.
Definition d_actor.hpp:15
Collider ("Collision Check") class - handles collisions between actors.
Definition d_cc.hpp:133
virtual void changeState(const sStateIDIf_c &newState)
Changes the actor's state to the given state.
bool mIsFlipped
Whether the shell is flipped upside down from a block hit.
nw4r::g3d::ResFile mTogezoResFile
The resource file for the spiny.
m3d::anmChr_c mTogezoAnim
The spiny's animation.
u32 mChangeTimer
Timer used for transforming between spiny and rolled up spiny.
u32 mPipoTouchedGround
Whether the rolled up spiny has touched the ground since rolling up.
virtual int doDelete()
do method for the delete operation.
virtual void deleteReady()
Informs the base that it's about to be deleted.
virtual int draw()
do method for the draw operation.
static sFStateID_c< daEnTogezoBase_c > StateID_Walk
Walking on the ground.
virtual int create()
do method for the create operation.
m3d::smdl_c mPaipoMdl
The model for the rolled up spiny.
virtual void block_hit_init()
Callback for when a block directly beneath the actor is hit.
virtual int execute()
do method for the execute operation.
nw4r::g3d::ResFile mPaipoResFile
The resource file for the rolled up spiny.
dHeapAllocator_c mAllocator
The allocator used for the resources of this actor.
virtual void finalUpdate()
Code to be executed after all actors' execute operation has run.
virtual bool setEatSpitOut(dActor_c *eatingActor)
Callback for when the actor is about to be spat out.
s16 mPipoRollSpeed
The speed at which the spiny unrolls.
m3d::mdl_c mTogezoModel
The spiny model.
u8 mPipoDir
The direction the rolled up spiny is moving. Used to determine if the spiny should turn around when i...
static sFStateID_c< daEnTogezoBase_c > StateID_Turn
Turning around while walking.
#define STATE_FUNC_DECLARE(class, name)
Declares a state.
Definition s_State.hpp:12
#define STATE_VIRTUAL_FUNC_DECLARE(class, name)
Declares a virtual state.
Definition s_State.hpp:22
A structure that contains information about a collider.
Definition d_cc.hpp:98