NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_ice.hpp
1#pragma once
2
3#include <game/bases/d_actor_state.hpp>
4#include <game/bases/d_heap_allocator.hpp>
5#include <game/bases/d_ice_effect_maker.hpp>
6#include <game/bases/d_ice_manager.hpp>
7#include <game/bases/d_ice_param.hpp>
8
9/// @brief Ice blocks for enemies.
10/// @statetable
11/// @paramtable
12class daIce_c : public dActorState_c {
13public:
14 /// @brief The possible pre-defined ice block types.
15 /// @unofficial
16 enum IceType_e {
17 ICE_TYPE_SQUARE, ///< A square block.
18 ICE_TYPE_TATE, ///< A vertical block.
19 ICE_TYPE_YOKO, ///< A horizontal block.
20 ICE_TYPE_BIG_SQUARE, ///< A large square block.
21 ICE_TYPE_BIG_TATE, ///< A large vertical block.
22 ICE_TYPE_BIG_YOKO, ///< A large horizontal block.
23 ICE_TYPE_COUNT
24 };
25
26 /// @brief How the ice block behaves when it's created.
27 /// @unofficial
29 INIT_LAND, ///< The block rests on the ground. @see StateID_Land
30 INIT_FREEZE, ///< The block is frozen in place indefinitely. @see StateID_Freeze
31 INIT_AIR, ///< The block hangs in the air for a while, then falls down. @see StateID_Air
32 INIT_FALL, ///< The block falls down immediately. @see StateID_Fall
33 INIT_WATER, ///< The block was created underwater and floats up. @see StateID_Sink
34 INIT_WATER_TOGE, ///< Same as #INIT_WATER, but for spiky enemies that break the ice block after a while.
35 INIT_WATER_STUCK, ///< The block was created underwater, but doesn't float up.
36 INIT_COVER, ///< The block follows the parent enemy. @see StateID_Cover
37 INIT_HOP ///< The block is launched with the parent enemy's speed. @see StateID_Hop
38 };
39
40 /// @brief The weight class of the ice block. Heavy blocks cannot be carried.
41 /// @unofficial
43 ICE_WEIGHT_LIGHTEST,
44 ICE_WEIGHT_LIGHT,
45 ICE_WEIGHT_HEAVY,
46 ICE_WEIGHT_HEAVIEST,
47 ICE_WEIGHT_COUNT
48 };
49
50 /// @brief The tile collision mode of the ice block.
51 /// @unofficial
53 COLLISION_NORMAL, ///< The block collides with tiles.
54 COLLISION_NONE, ///< The block does not collide with tiles.
55 COLLISION_NO_SINK_COLLISION ///< The block does not check for ground collision while sinking in water.
56 };
57
58 /// @brief Flags for #mFlags.
59 /// @unofficial
60 enum Flags_e {
61 FLAG_BREAKABLE = BIT_FLAG(0), ///< The block can be broken by ground pounding or attacking it from below.
62 FLAG_CARRYABLE = BIT_FLAG(1) ///< The block can be picked up by players.
63 };
64
65 /// @brief How the ice block is pushed under the water surface.
66 /// @unofficial
68 PUSH_SINK_LAND, ///< A player landed on the block.
69 PUSH_SINK_HIP_ATTACK, ///< A player ground-pounded the block.
70 PUSH_SINK_PRESS, ///< A player standing on the block is pressed against a ceiling.
71 PUSH_SINK_COUNT
72 };
73
74 /// @brief The state of the water surface while the block floats on top of it. See StateID_FloatWait.
75 /// @unofficial
77 FLOAT_STATE_INIT, ///< The water level has not been checked yet.
78 FLOAT_STATE_STILL, ///< The water level is constant, the block bobs up and down.
79 FLOAT_STATE_RISING, ///< The water level is rising.
80 FLOAT_STATE_LOWERING ///< The water level is lowering.
81 };
82
83 /// @brief The result of checkPlAttach_Wall().
84 /// @unofficial
86 WALL_ATTACH_NONE, ///< The player is not touching a wall.
87 WALL_ATTACH_TOUCH, ///< The player is also touching a wall on the other side of the ice block.
88 WALL_ATTACH_STUCK, ///< The player is stuck between the ice block and a wall.
89 };
90
91 typedef void (daIce_c::*EnlargeFunc)();
92
93 daIce_c() : mShake(0), mFlags(0), mBreakRequested(0), mIceEfMaker(this) {} ///< @copydoc dActorState_c::dActorState_c
94 ~daIce_c() {} ///< @copydoc dActorState_c::~dActorState_c
95
96 int create() override;
97 int doDelete() override;
98 int execute() override;
99 int preExecute() override;
100 int draw() override;
101 void deleteReady() override;
102 void finalUpdate() override;
103 void block_hit_init() override;
104 bool isSpinLiftUpEnable() override { return canCarry(); }
105 void setSpinLiftUpActor(dActor_c *carryingActor) override { setCarry(carryingActor); }
106 bool vf68(dBg_ctr_c *collider) override;
107
108 /// @brief Returns whether touching the collider beneath the ice block counts as touching the ground.
109 /// @unofficial
110 virtual bool checkFootBgcIsGround();
111
112 void createMdl(); ///< Creates the model and texture animation according to the ice type.
113 void calcMdl(); ///< Updates the model matrix.
114
115 /// @brief Sets up the ice block. Called by the ice manager after creation.
116 /// @param size The scale of the ice block, relative to the default size of the ice type.
117 /// @param scale The scale of the effects.
118 void setInfo(mVec3_c size, dIceEfScale_c scale);
119
120 void initSize(const mVec3_c &scale); ///< Calculates the block's size from the ice type and the given scale.
121 void initPos(); ///< Places the block on the ground if it's landing or falling.
122 void initWeight(); ///< Calculates the weight class of the block. @see IceWeight_e
123 void initCollision(); ///< Sets up the tile collision, the actor collision and the dynamic collider.
124 void initEffect(dIceEfScale_c scale); ///< Initializes the effect maker.
125
126 /// @brief Checks whether the ice block should be broken immediately after creation.
127 /// @param checkBg Whether to also check for overlap with background tiles.
128 /// @return Whether a player (or optionally a tile) is inside the ice block.
129 bool checkInstantBreak(BOOL checkBg);
130 bool checkPlayerIn(); ///< Checks whether a player overlaps the ice block.
131 bool checkBgIn(); ///< Checks whether a solid tile overlaps the ice block.
132
133 /// @brief Calculates the highest ground position below the ice block.
134 /// @param height Receives the ground height, if found.
135 /// @return Whether the ice block would clip into the ground in its current position.
136 bool calcLandLine(float &height);
137
138 bool isQuakeDamage(); ///< Checks whether the ice block should be broken by an earthquake.
139 void quakeDamage(); ///< Awards the earthquake combo score and breaks the ice block.
140
141 /// @brief Requests the ice block to be broken.
142 /// @param dir The direction the enemy flies off in.
143 /// @param playerNo The player that broke the ice block, or -1. Receives a score if valid.
144 void breakReq(int dir, int playerNo);
145 void floatbreakReq(); ///< Requests the ice block to break on water. No score is awarded.
146
147 void combobreakReq(int dir, dActor_c *initiator); ///< Requests the ice block to be broken by a combo attack (e.g. a shell being thrown).
148 void plcombobreakReq(int dir, dActor_c *initiator); ///< Like combobreakReq(), but uses the player's combo counter.
149 void treadcombobreakReq(int dir, dActor_c *initiator); ///< Like combobreakReq(), but uses the stomp combo score.
150 void starbreakReq(int dir, dActor_c *initiator); ///< Like combobreakReq(), but uses the star combo score.
151
152 void setBc(); ///< Sets up the tile collision sensors.
153 void setCarryBc(); ///< Sets up the tile collision sensors while the block is being carried.
154 void enlargeBgc(); ///< Enlarges the dynamic collider until it reaches the full size.
155 void enlargeBgcLand(); ///< Enlarges the dynamic collider when not in water.
156 void enlargeBgcWater(); ///< Enlarges the dynamic collider when in water.
157
158 void enemyAttach(); ///< Moves the parent enemy along with the ice block.
159 void shake(); ///< Shakes the model of the ice block.
160 void normalShake(); ///< Shakes the model left and right.
161 void watertogeShake(); ///< Swings the model left and right with increasing frequency. Used for #INIT_WATER_TOGE.
162
163 void calcFloatAngle(); ///< Tilts the ice block back and forth while floating up.
164 void calcFloatSpeed(); ///< Accelerates the ice block towards #mFloatTargetSpeed in the direction it is tilted to.
165
166 /// @brief Checks whether the given actor should push the ice block down and sets #mPushSinkType accordingly.
167 /// @param actor The actor to check.
168 /// @return Whether the ice block should be pushed down.
169 bool checkPushSink(dActor_c *actor);
170
171 dIceMng_c *getManager(); ///< Gets the ice manager of the parent enemy.
172
173 bool checkUnderBreak(dActor_c *actor); ///< Checks whether a falling block hits a player / Yoshi from above and causes daPlBase_c::DAMAGE_HEAD_BONK.
174 bool checkUpperBreak(dActor_c *actor); ///< Checks whether an actor landing on the block breaks it. [Always false].
175 bool checkSideBreak(dActor_c *actor, int direction); ///< Checks whether a thrown block hits a player / Yoshi from the side and causes daPlBase_c::DAMAGE_HIP_ATTACK.
176
177 void breakEffect(); ///< Plays the break effect.
178 void meltEffect(); ///< Plays the melt effect.
179 void yoganEffect(); ///< Plays the lava splash effect.
180 void poisonEffect(); ///< Plays the poison splash effect.
181
182 bool checkNetIn(); ///< Checks whether the ice block overlaps a climbable fence.
183
184 void setCarry(dActor_c *actor); ///< Starts being carried by the given actor.
185 mVec3_c calcCarryPos(); ///< Calculates the position of the block in the carrying player's hands.
186 BOOL canCarry() const; ///< Checks whether the ice block can currently be picked up.
187
188 /// @brief Returns whether a player is stuck between the ice block and the background collision.
189 /// @param plrNo Receives the player number, or -1 if no player is stuck.
190 bool checkPlHasami(int *plrNo);
191
192 /// @brief Returns whether a player is standing on the ice block.
193 /// @param playerTouchingCeiling If not @p nullptr, receives @p TRUE if the player is also touching the ceiling, else @p FALSE.
194 bool checkPlAttach_Head(BOOL *playerTouchingCeiling);
195
196 /// @brief Returns whether a player's head is touching the ice block.
197 /// @param playerTouchingFloor If not @p nullptr, receives @p TRUE if the player is also touching the floor, else @p FALSE.
198 bool checkPlAttach_Foot(BOOL *playerTouchingFloor, int *plrNo);
199
200 /**
201 * @brief Returns whether a player is touching the given side of the ice block.
202 * @param dir The side of the ice block to check.
203 * @param checkResult If not nullptr, receives a value of type #WallAttachCheckResult_e.
204 */
205 bool checkPlAttach_Wall(int dir, int *checkResult);
206
207 /// @brief Checks whether the given player is stuck between the ice block and a wall.
208 /// @param dir The side of the ice block to check.
209 bool checkPlHasami_Wall(dActor_c *actor, int dir);
210
211 fBaseID_e getParentID(); ///< Gets the ID of the parent enemy.
212
213 STATE_FUNC_DECLARE(daIce_c, Freeze); ///< Frozen in place.
214 STATE_FUNC_DECLARE(daIce_c, Cover); ///< Following the parent enemy. [Used for Fuzzies].
215 STATE_FUNC_DECLARE(daIce_c, Hop); ///< Being launched with the parent enemy's speed. [Used for the Pokey segments].
216 STATE_FUNC_DECLARE(daIce_c, Sink); ///< Slowing down after being created underwater.
217 STATE_FUNC_DECLARE(daIce_c, PushSink); ///< Being pushed under the water surface.
218 STATE_FUNC_DECLARE(daIce_c, Float); ///< Floating up to the water surface while tilting back and forth.
219 STATE_FUNC_DECLARE(daIce_c, SmallFloat); ///< Floating back up to the water surface after a small push downwards.
220 STATE_FUNC_DECLARE(daIce_c, FloatWait); ///< Floating on the water surface.
221 STATE_FUNC_DECLARE(daIce_c, TogeFloat); ///< Floating up to the water surface, variant for spiky enemies.
222 STATE_FUNC_DECLARE(daIce_c, ShakeFloat); ///< Floating up slowly while shaking before melting.
223 STATE_FUNC_DECLARE(daIce_c, Air); ///< Hanging in the air before falling down.
224 STATE_FUNC_DECLARE(daIce_c, Fall); ///< Falling down.
225 STATE_FUNC_DECLARE(daIce_c, Land); ///< Resting on the ground.
226 STATE_FUNC_DECLARE(daIce_c, Dive); ///< Slowing down after falling into water.
227 STATE_FUNC_DECLARE(daIce_c, YoganDive); ///< Sinking into lava or poison.
228 STATE_FUNC_DECLARE(daIce_c, Carry); ///< Being carried by a player.
229 STATE_FUNC_DECLARE(daIce_c, Throw); ///< Sliding across the ground after being thrown.
230 STATE_FUNC_DECLARE(daIce_c, Drop); ///< Falling down after being dropped. Breaks on landing.
231 STATE_FUNC_DECLARE(daIce_c, Melt_Normal); ///< Breaking apart after the ice block has has melted.
232
233 float getFloatPosY() { return mWaterHeight - mSize.y * 0.5f; }
234 bool isDestroy() { return mBreakRequested != 0 || mpIceMng != nullptr && mpIceMng->mDestroyMode != dIceMng_c::DESTROY_NONE; }
235
236 static void callBackFoot(dActor_c *self, dActor_c *other); ///< Called when another actor's foot sensor touches the ice block.
237 static void callBackHead(dActor_c *self, dActor_c *other); ///< Called when another actor's head sensor touches the ice block.
238 static void callBackWall(dActor_c *self, dActor_c *other, u8 dir); ///< Called when another actor's wall sensor touches the ice block.
239
240 static bool checkRevFoot(dActor_c *self, dActor_c *other); ///< Returns whether the ice block should push up the actor standing on it.
241 static bool checkRevHead(dActor_c *self, dActor_c *other); ///< Returns whether the ice block should push down the actor below it.
242 static bool checkRevWall(dActor_c *self, dActor_c *other, u8 dir); ///< Returns whether the ice block should push the actor at its side.
243
244 static void ccCallBack(dCc_c *self, dCc_c *other); ///< The actor collision callback.
245 static void ccCallBack_Water(dCc_c *self, dCc_c *other); ///< The actor collision callback in water.
246
247private:
248 dHeapAllocator_c mAllocator; ///< The allocator.
249 nw4r::g3d::ResFile mResFileMdl; ///< The resource file.
250 m3d::mdl_c mMdl; ///< The model.
251 nw4r::g3d::ResAnmTexSrt mResFileAnm; ///< The texture animation resource file.
252 m3d::anmTexSrt_c mAnm; ///< The texture animation.
253 dBg_ctr_c mBgCtr; ///< The dynamic collider.
254 mVec2_c mCurrBgcSize; ///< The current dynamic collider size, grows over time.
255 mVec2_c mBgcSizeIncrease; ///< The amount to increase #mCurrBgcSize per frame until the full size is reached.
256 sBcMany mBcPointFoot; ///< The foot sensor for tile collision.
257 sBcMany mBcPointHead; ///< The head sensor for tile collision.
258 sBcMany mBcPointWall; ///< The wall sensor for tile collision.
259 mVec3_c mPosDiff; ///< The offset to the parent actor.
260 mVec3_c mInitialPos; ///< The position at creation.
261 mVec3_c mModelPos; ///< The position of the model, including the shake offset.
262 mVec3_c mPrevPos; ///< The position on the previous frame.
263 mVec3_c mSize; ///< The size of the ice block.
264
265 PushSinkType_e mPushSinkType; ///< How the block got pushed under the water surface.
266
267 int mCarriedByPlrNo; ///< The player number of the player carrying the ice block.
268
269 float mFloatTargetSpeed; ///< The target speed when floating.
270 float mFloatAccel; ///< The acceleration towards #mFloatTargetSpeed.
271 short mFloatAngle; ///< The current angle while floating up.
272 u8 mPad1[0x4];
273 float mExtraFloatSpeedX; ///< Added to the X speed while floating. @unused
274
275 BOOL mShake; ///< Whether the ice block should shake.
276 short mShakeRotSpeed; ///< The angular speed of #mShakeRotAngle.
277 short mShakeRotAngle; ///< The current angle of the swinging motion.
278 short mShakeRotAmplitude; ///< The maximum rotation of the swinging motion.
279
280 u8 mPad2[0x4];
281
282 BOOL mIsWater; ///< Whether the block was created in water.
283 short mCurrFloatUpDown; ///< Counter for bobbing up and down on the water surface.
284 float mWaterHeight; ///< The height of the water surface.
285 FloatState_e mFloatState; ///< The state of the water surface, used in StateID_FloatWait.
286
287 float mStartFallY; ///< The Y position where the block started falling, used to check whether the block falls far enough to break.
288 int mCollEntryTimer; ///< Countdown until the collision is fully activated.
289 int mTimer; ///< A general purpose timer.
290 u32 mFlags; ///< Value is a FLAG_e.
291 BOOL mBreakRequested; ///< Whether the ice block should break.
292 float mPrevPosX; ///< The X position before running execute().
293
294 InitType_e mInitType; ///< The initial behavior. @see InitType_e
295 IceWeight_e mWeightType; ///< The weight class. @see IceWeight_e
296
297 dIceMng_c *mpIceMng; ///< The ice manager.
298 dIceEfMaker_c mIceEfMaker; ///< The ice effect maker.
299
300 ACTOR_PARAM_CONFIG(IceType, 0, 4); ///< The shape of the ice block. See IceType_e.
301 ACTOR_PARAM_CONFIG(Unbreakable, 8, 1); ///< If not set, sets #FLAG_BREAKABLE.
302 ACTOR_PARAM_CONFIG(NoCarry, 12, 1); ///< If not set, sets #FLAG_CARRYABLE.
303 ACTOR_PARAM_CONFIG(CollisionMode, 16, 2); ///< The tile collision mode. See CollisionMode_e.
304 ACTOR_PARAM_CONFIG(NoQuakeScore, 20, 1); ///< Whether to not award a score when broken by an earthquake.
305 ACTOR_PARAM_CONFIG(InitType, 24, 4); ///< The initial behavior. See InitType_e.
306
307 static const short smc_OBJBG_DUMMY_ANGLE = 0;
308};
dActorState_c()
Constructs a new actor.
The minimum required implementation for a stage actor.
Definition d_actor.hpp:18
dActor_c()
Constructs a new actor.
Definition d_actor.cpp:46
Ice blocks for enemies.
Definition d_a_ice.hpp:12
InitType_e
How the ice block behaves when it's created.
Definition d_a_ice.hpp:28
@ INIT_COVER
The block follows the parent enemy.
Definition d_a_ice.hpp:36
@ INIT_WATER_STUCK
The block was created underwater, but doesn't float up.
Definition d_a_ice.hpp:35
@ INIT_AIR
The block hangs in the air for a while, then falls down.
Definition d_a_ice.hpp:31
@ INIT_WATER_TOGE
Same as INIT_WATER, but for spiky enemies that break the ice block after a while.
Definition d_a_ice.hpp:34
@ INIT_LAND
The block rests on the ground.
Definition d_a_ice.hpp:29
@ INIT_FREEZE
The block is frozen in place indefinitely.
Definition d_a_ice.hpp:30
@ INIT_WATER
The block was created underwater and floats up.
Definition d_a_ice.hpp:33
@ INIT_HOP
The block is launched with the parent enemy's speed.
Definition d_a_ice.hpp:37
@ INIT_FALL
The block falls down immediately.
Definition d_a_ice.hpp:32
void setCarryBc()
Sets up the tile collision sensors while the block is being carried.
Definition d_a_ice.cpp:648
bool checkUnderBreak(dActor_c *actor)
Checks whether a falling block hits a player / Yoshi from above and causes daPlBase_c::DAMAGE_HEAD_BO...
Definition d_a_ice.cpp:818
ACTOR_PARAM_CONFIG(NoQuakeScore, 20, 1)
Whether to not award a score when broken by an earthquake.
void setCarry(dActor_c *actor)
Starts being carried by the given actor.
Definition d_a_ice.cpp:1139
BOOL canCarry() const
Checks whether the ice block can currently be picked up.
Definition d_a_ice.cpp:1279
bool checkInstantBreak(BOOL checkBg)
Checks whether the ice block should be broken immediately after creation.
Definition d_a_ice.cpp:370
int doDelete() override
do method for the delete operation.
Definition d_a_ice.cpp:221
mVec3_c calcCarryPos()
Calculates the position of the block in the carrying player's hands.
Definition d_a_ice.cpp:1263
short mShakeRotAmplitude
The maximum rotation of the swinging motion.
Definition d_a_ice.hpp:278
bool checkPushSink(dActor_c *actor)
Checks whether the given actor should push the ice block down and sets mPushSinkType accordingly.
Definition d_a_ice.cpp:781
IceWeight_e mWeightType
The weight class.
Definition d_a_ice.hpp:295
PushSinkType_e
How the ice block is pushed under the water surface.
Definition d_a_ice.hpp:67
@ PUSH_SINK_HIP_ATTACK
A player ground-pounded the block.
Definition d_a_ice.hpp:69
@ PUSH_SINK_LAND
A player landed on the block.
Definition d_a_ice.hpp:68
@ PUSH_SINK_PRESS
A player standing on the block is pressed against a ceiling.
Definition d_a_ice.hpp:70
void watertogeShake()
Swings the model left and right with increasing frequency. Used for INIT_WATER_TOGE.
Definition d_a_ice.cpp:743
static void ccCallBack_Water(dCc_c *self, dCc_c *other)
The actor collision callback in water.
Definition d_a_ice.cpp:1073
void meltEffect()
Plays the melt effect.
Definition d_a_ice.cpp:862
nw4r::g3d::ResFile mResFileMdl
The resource file.
Definition d_a_ice.hpp:249
bool calcLandLine(float &height)
Calculates the highest ground position below the ice block.
Definition d_a_ice.cpp:435
void finalUpdate() override
Code to be executed after all actors' execute operation has run.
Definition d_a_ice.cpp:483
float mFloatTargetSpeed
The target speed when floating.
Definition d_a_ice.hpp:269
void initPos()
Places the block on the ground if it's landing or falling.
Definition d_a_ice.cpp:279
PushSinkType_e mPushSinkType
How the block got pushed under the water surface.
Definition d_a_ice.hpp:265
sBcMany mBcPointFoot
The foot sensor for tile collision.
Definition d_a_ice.hpp:256
fBaseID_e getParentID()
Gets the ID of the parent enemy.
Definition d_a_ice.cpp:1299
short mFloatAngle
The current angle while floating up.
Definition d_a_ice.hpp:271
dHeapAllocator_c mAllocator
The allocator.
Definition d_a_ice.hpp:248
void plcombobreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the player's combo counter.
Definition d_a_ice.cpp:579
void breakEffect()
Plays the break effect.
Definition d_a_ice.cpp:851
void shake()
Shakes the model of the ice block.
Definition d_a_ice.cpp:729
int draw() override
do method for the draw operation.
Definition d_a_ice.cpp:204
static void ccCallBack(dCc_c *self, dCc_c *other)
The actor collision callback.
Definition d_a_ice.cpp:988
void enemyAttach()
Moves the parent enemy along with the ice block.
Definition d_a_ice.cpp:724
void yoganEffect()
Plays the lava splash effect.
Definition d_a_ice.cpp:1307
void floatbreakReq()
Requests the ice block to break on water. No score is awarded.
Definition d_a_ice.cpp:1114
bool checkUpperBreak(dActor_c *actor)
Checks whether an actor landing on the block breaks it. [Always false].
Definition d_a_ice.cpp:835
void setBc()
Sets up the tile collision sensors.
Definition d_a_ice.cpp:623
void enlargeBgcWater()
Enlarges the dynamic collider when in water.
Definition d_a_ice.cpp:705
u32 mFlags
Value is a FLAG_e.
Definition d_a_ice.hpp:290
void initSize(const mVec3_c &scale)
Calculates the block's size from the ice type and the given scale.
Definition d_a_ice.cpp:267
void breakReq(int dir, int playerNo)
Requests the ice block to be broken.
Definition d_a_ice.cpp:1095
~daIce_c()
Destroys the actor.
Definition d_a_ice.hpp:94
bool checkPlHasami_Wall(dActor_c *actor, int dir)
Checks whether the given player is stuck between the ice block and a wall.
Definition d_a_ice.cpp:1241
static void callBackFoot(dActor_c *self, dActor_c *other)
Called when another actor's foot sensor touches the ice block.
Definition d_a_ice.cpp:894
float mWaterHeight
The height of the water surface.
Definition d_a_ice.hpp:284
dIceMng_c * mpIceMng
The ice manager.
Definition d_a_ice.hpp:297
CollisionMode_e
The tile collision mode of the ice block.
Definition d_a_ice.hpp:52
@ COLLISION_NO_SINK_COLLISION
The block does not check for ground collision while sinking in water.
Definition d_a_ice.hpp:55
@ COLLISION_NORMAL
The block collides with tiles.
Definition d_a_ice.hpp:53
@ COLLISION_NONE
The block does not collide with tiles.
Definition d_a_ice.hpp:54
bool checkNetIn()
Checks whether the ice block overlaps a climbable fence.
Definition d_a_ice.cpp:1122
short mShakeRotSpeed
The angular speed of mShakeRotAngle.
Definition d_a_ice.hpp:276
int create() override
do method for the create operation.
Definition d_a_ice.cpp:64
float mFloatAccel
The acceleration towards mFloatTargetSpeed.
Definition d_a_ice.hpp:270
Flags_e
Flags for mFlags.
Definition d_a_ice.hpp:60
@ FLAG_CARRYABLE
The block can be picked up by players.
Definition d_a_ice.hpp:62
@ FLAG_BREAKABLE
The block can be broken by ground pounding or attacking it from below.
Definition d_a_ice.hpp:61
ACTOR_PARAM_CONFIG(Unbreakable, 8, 1)
If not set, sets FLAG_BREAKABLE.
int preExecute() override
pre method for the execute operation.
Definition d_a_ice.cpp:157
void createMdl()
Creates the model and texture animation according to the ice type.
Definition d_a_ice.cpp:130
static void callBackWall(dActor_c *self, dActor_c *other, u8 dir)
Called when another actor's wall sensor touches the ice block.
Definition d_a_ice.cpp:926
mVec3_c mPosDiff
The offset to the parent actor.
Definition d_a_ice.hpp:259
static void callBackHead(dActor_c *self, dActor_c *other)
Called when another actor's head sensor touches the ice block.
Definition d_a_ice.cpp:873
void quakeDamage()
Awards the earthquake combo score and breaks the ice block.
Definition d_a_ice.cpp:541
IceWeight_e
The weight class of the ice block. Heavy blocks cannot be carried.
Definition d_a_ice.hpp:42
nw4r::g3d::ResAnmTexSrt mResFileAnm
The texture animation resource file.
Definition d_a_ice.hpp:251
float mStartFallY
The Y position where the block started falling, used to check whether the block falls far enough to b...
Definition d_a_ice.hpp:287
InitType_e mInitType
The initial behavior.
Definition d_a_ice.hpp:294
sBcMany mBcPointWall
The wall sensor for tile collision.
Definition d_a_ice.hpp:258
ACTOR_PARAM_CONFIG(InitType, 24, 4)
The initial behavior. See InitType_e.
static bool checkRevFoot(dActor_c *self, dActor_c *other)
Returns whether the ice block should push up the actor standing on it.
Definition d_a_ice.cpp:971
bool vf68(dBg_ctr_c *collider) override
Unknown, related to collision.
Definition d_a_ice.cpp:241
int execute() override
do method for the execute operation.
Definition d_a_ice.cpp:185
ACTOR_PARAM_CONFIG(IceType, 0, 4)
The shape of the ice block. See IceType_e.
virtual bool checkFootBgcIsGround()
Returns whether touching the collider beneath the ice block counts as touching the ground.
Definition d_a_ice.cpp:250
WallAttachCheckResult_e
The result of checkPlAttach_Wall().
Definition d_a_ice.hpp:85
@ WALL_ATTACH_NONE
The player is not touching a wall.
Definition d_a_ice.hpp:86
@ WALL_ATTACH_STUCK
The player is stuck between the ice block and a wall.
Definition d_a_ice.hpp:88
@ WALL_ATTACH_TOUCH
The player is also touching a wall on the other side of the ice block.
Definition d_a_ice.hpp:87
void combobreakReq(int dir, dActor_c *initiator)
Requests the ice block to be broken by a combo attack (e.g. a shell being thrown).
Definition d_a_ice.cpp:557
static bool checkRevWall(dActor_c *self, dActor_c *other, u8 dir)
Returns whether the ice block should push the actor at its side.
Definition d_a_ice.cpp:975
void calcFloatSpeed()
Accelerates the ice block towards mFloatTargetSpeed in the direction it is tilted to.
Definition d_a_ice.cpp:762
bool checkPlAttach_Head(BOOL *playerTouchingCeiling)
Returns whether a player is standing on the ice block.
Definition d_a_ice.cpp:1164
void initWeight()
Calculates the weight class of the block.
Definition d_a_ice.cpp:295
BOOL mShake
Whether the ice block should shake.
Definition d_a_ice.hpp:275
ACTOR_PARAM_CONFIG(NoCarry, 12, 1)
If not set, sets FLAG_CARRYABLE.
bool checkPlHasami(int *plrNo)
Returns whether a player is stuck between the ice block and the background collision.
Definition d_a_ice.cpp:1148
int mTimer
A general purpose timer.
Definition d_a_ice.hpp:289
void poisonEffect()
Plays the poison splash effect.
Definition d_a_ice.cpp:1325
void deleteReady() override
Informs the base that it's about to be deleted.
Definition d_a_ice.cpp:209
daIce_c()
Constructs a new actor.
Definition d_a_ice.hpp:93
int mCarriedByPlrNo
The player number of the player carrying the ice block.
Definition d_a_ice.hpp:267
float mExtraFloatSpeedX
Added to the X speed while floating.
Definition d_a_ice.hpp:273
mVec2_c mBgcSizeIncrease
The amount to increase mCurrBgcSize per frame until the full size is reached.
Definition d_a_ice.hpp:255
void calcFloatAngle()
Tilts the ice block back and forth while floating up.
Definition d_a_ice.cpp:754
dBg_ctr_c mBgCtr
The dynamic collider.
Definition d_a_ice.hpp:253
static bool checkRevHead(dActor_c *self, dActor_c *other)
Returns whether the ice block should push down the actor below it.
Definition d_a_ice.cpp:967
mVec3_c mSize
The size of the ice block.
Definition d_a_ice.hpp:263
void setSpinLiftUpActor(dActor_c *carryingActor) override
Callback for when the actor is picked up by another actor.
Definition d_a_ice.hpp:105
BOOL mBreakRequested
Whether the ice block should break.
Definition d_a_ice.hpp:291
m3d::anmTexSrt_c mAnm
The texture animation.
Definition d_a_ice.hpp:252
bool checkPlayerIn()
Checks whether a player overlaps the ice block.
Definition d_a_ice.cpp:382
mVec3_c mInitialPos
The position at creation.
Definition d_a_ice.hpp:260
bool checkSideBreak(dActor_c *actor, int direction)
Checks whether a thrown block hits a player / Yoshi from the side and causes daPlBase_c::DAMAGE_HIP_A...
Definition d_a_ice.cpp:839
mVec2_c mCurrBgcSize
The current dynamic collider size, grows over time.
Definition d_a_ice.hpp:254
void block_hit_init() override
Callback for when a block directly beneath the actor is hit.
Definition d_a_ice.cpp:1091
mVec3_c mModelPos
The position of the model, including the shake offset.
Definition d_a_ice.hpp:261
void treadcombobreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the stomp combo score.
Definition d_a_ice.cpp:597
void enlargeBgc()
Enlarges the dynamic collider until it reaches the full size.
Definition d_a_ice.cpp:679
void initEffect(dIceEfScale_c scale)
Initializes the effect maker.
Definition d_a_ice.cpp:362
short mShakeRotAngle
The current angle of the swinging motion.
Definition d_a_ice.hpp:277
IceType_e
The possible pre-defined ice block types.
Definition d_a_ice.hpp:16
@ ICE_TYPE_TATE
A vertical block.
Definition d_a_ice.hpp:18
@ ICE_TYPE_YOKO
A horizontal block.
Definition d_a_ice.hpp:19
@ ICE_TYPE_BIG_SQUARE
A large square block.
Definition d_a_ice.hpp:20
@ ICE_TYPE_SQUARE
A square block.
Definition d_a_ice.hpp:17
@ ICE_TYPE_BIG_YOKO
A large horizontal block.
Definition d_a_ice.hpp:22
@ ICE_TYPE_BIG_TATE
A large vertical block.
Definition d_a_ice.hpp:21
BOOL mIsWater
Whether the block was created in water.
Definition d_a_ice.hpp:282
FloatState_e
The state of the water surface while the block floats on top of it. See StateID_FloatWait.
Definition d_a_ice.hpp:76
@ FLOAT_STATE_LOWERING
The water level is lowering.
Definition d_a_ice.hpp:80
@ FLOAT_STATE_RISING
The water level is rising.
Definition d_a_ice.hpp:79
@ FLOAT_STATE_STILL
The water level is constant, the block bobs up and down.
Definition d_a_ice.hpp:78
@ FLOAT_STATE_INIT
The water level has not been checked yet.
Definition d_a_ice.hpp:77
bool checkPlAttach_Foot(BOOL *playerTouchingFloor, int *plrNo)
Returns whether a player's head is touching the ice block.
Definition d_a_ice.cpp:1182
void normalShake()
Shakes the model left and right.
Definition d_a_ice.cpp:737
sBcMany mBcPointHead
The head sensor for tile collision.
Definition d_a_ice.hpp:257
FloatState_e mFloatState
The state of the water surface, used in StateID_FloatWait.
Definition d_a_ice.hpp:285
void starbreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the star combo score.
Definition d_a_ice.cpp:610
void setInfo(mVec3_c size, dIceEfScale_c scale)
Sets up the ice block. Called by the ice manager after creation.
Definition d_a_ice.cpp:257
float mPrevPosX
The X position before running execute().
Definition d_a_ice.hpp:292
m3d::mdl_c mMdl
The model.
Definition d_a_ice.hpp:250
void calcMdl()
Updates the model matrix.
Definition d_a_ice.cpp:226
mVec3_c mPrevPos
The position on the previous frame.
Definition d_a_ice.hpp:262
int mCollEntryTimer
Countdown until the collision is fully activated.
Definition d_a_ice.hpp:288
bool isQuakeDamage()
Checks whether the ice block should be broken by an earthquake.
Definition d_a_ice.cpp:516
dIceMng_c * getManager()
Gets the ice manager of the parent enemy.
Definition d_a_ice.cpp:814
bool checkBgIn()
Checks whether a solid tile overlaps the ice block.
Definition d_a_ice.cpp:407
void initCollision()
Sets up the tile collision, the actor collision and the dynamic collider.
Definition d_a_ice.cpp:308
ACTOR_PARAM_CONFIG(CollisionMode, 16, 2)
The tile collision mode. See CollisionMode_e.
dIceEfMaker_c mIceEfMaker
The ice effect maker.
Definition d_a_ice.hpp:298
void enlargeBgcLand()
Enlarges the dynamic collider when not in water.
Definition d_a_ice.cpp:687
bool isSpinLiftUpEnable() override
Returns whether the actor can be carried.
Definition d_a_ice.hpp:104
bool checkPlAttach_Wall(int dir, int *checkResult)
Returns whether a player is touching the given side of the ice block.
Definition d_a_ice.cpp:1206
short mCurrFloatUpDown
Counter for bobbing up and down on the water surface.
Definition d_a_ice.hpp:283
A two-dimensional floating point vector.
Definition m_vec.hpp:26
A three-dimensional floating point vector.
Definition m_vec.hpp:122
fBaseID_e
A unique identifier for each base.
Definition f_base_id.hpp:6
#define STATE_FUNC_DECLARE(class, name)
Declares a state.
Definition s_State.hpp:12