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>
91 typedef void (
daIce_c::*EnlargeFunc)();
144 void breakReq(
int dir,
int playerNo);
244 static void ccCallBack(dCc_c *self, dCc_c *other);
307 static const short smc_OBJBG_DUMMY_ANGLE = 0;
dActorState_c()
Constructs a new actor.
The minimum required implementation for a stage actor.
dActor_c()
Constructs a new actor.
InitType_e
How the ice block behaves when it's created.
@ INIT_COVER
The block follows the parent enemy.
@ INIT_WATER_STUCK
The block was created underwater, but doesn't float up.
@ INIT_AIR
The block hangs in the air for a while, then falls down.
@ INIT_WATER_TOGE
Same as INIT_WATER, but for spiky enemies that break the ice block after a while.
@ INIT_LAND
The block rests on the ground.
@ INIT_FREEZE
The block is frozen in place indefinitely.
@ INIT_WATER
The block was created underwater and floats up.
@ INIT_HOP
The block is launched with the parent enemy's speed.
@ INIT_FALL
The block falls down immediately.
void setCarryBc()
Sets up the tile collision sensors while the block is being carried.
bool checkUnderBreak(dActor_c *actor)
Checks whether a falling block hits a player / Yoshi from above and causes daPlBase_c::DAMAGE_HEAD_BO...
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.
BOOL canCarry() const
Checks whether the ice block can currently be picked up.
bool checkInstantBreak(BOOL checkBg)
Checks whether the ice block should be broken immediately after creation.
int doDelete() override
do method for the delete operation.
mVec3_c calcCarryPos()
Calculates the position of the block in the carrying player's hands.
short mShakeRotAmplitude
The maximum rotation of the swinging motion.
bool checkPushSink(dActor_c *actor)
Checks whether the given actor should push the ice block down and sets mPushSinkType accordingly.
IceWeight_e mWeightType
The weight class.
PushSinkType_e
How the ice block is pushed under the water surface.
@ PUSH_SINK_HIP_ATTACK
A player ground-pounded the block.
@ PUSH_SINK_LAND
A player landed on the block.
@ PUSH_SINK_PRESS
A player standing on the block is pressed against a ceiling.
void watertogeShake()
Swings the model left and right with increasing frequency. Used for INIT_WATER_TOGE.
static void ccCallBack_Water(dCc_c *self, dCc_c *other)
The actor collision callback in water.
void meltEffect()
Plays the melt effect.
nw4r::g3d::ResFile mResFileMdl
The resource file.
bool calcLandLine(float &height)
Calculates the highest ground position below the ice block.
void finalUpdate() override
Code to be executed after all actors' execute operation has run.
float mFloatTargetSpeed
The target speed when floating.
void initPos()
Places the block on the ground if it's landing or falling.
PushSinkType_e mPushSinkType
How the block got pushed under the water surface.
sBcMany mBcPointFoot
The foot sensor for tile collision.
fBaseID_e getParentID()
Gets the ID of the parent enemy.
short mFloatAngle
The current angle while floating up.
dHeapAllocator_c mAllocator
The allocator.
void plcombobreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the player's combo counter.
void breakEffect()
Plays the break effect.
void shake()
Shakes the model of the ice block.
int draw() override
do method for the draw operation.
static void ccCallBack(dCc_c *self, dCc_c *other)
The actor collision callback.
void enemyAttach()
Moves the parent enemy along with the ice block.
void yoganEffect()
Plays the lava splash effect.
void floatbreakReq()
Requests the ice block to break on water. No score is awarded.
bool checkUpperBreak(dActor_c *actor)
Checks whether an actor landing on the block breaks it. [Always false].
void setBc()
Sets up the tile collision sensors.
void enlargeBgcWater()
Enlarges the dynamic collider when in water.
u32 mFlags
Value is a FLAG_e.
void initSize(const mVec3_c &scale)
Calculates the block's size from the ice type and the given scale.
void breakReq(int dir, int playerNo)
Requests the ice block to be broken.
~daIce_c()
Destroys the actor.
bool checkPlHasami_Wall(dActor_c *actor, int dir)
Checks whether the given player is stuck between the ice block and a wall.
static void callBackFoot(dActor_c *self, dActor_c *other)
Called when another actor's foot sensor touches the ice block.
float mWaterHeight
The height of the water surface.
dIceMng_c * mpIceMng
The ice manager.
CollisionMode_e
The tile collision mode of the ice block.
@ COLLISION_NO_SINK_COLLISION
The block does not check for ground collision while sinking in water.
@ COLLISION_NORMAL
The block collides with tiles.
@ COLLISION_NONE
The block does not collide with tiles.
bool checkNetIn()
Checks whether the ice block overlaps a climbable fence.
short mShakeRotSpeed
The angular speed of mShakeRotAngle.
int create() override
do method for the create operation.
float mFloatAccel
The acceleration towards mFloatTargetSpeed.
@ FLAG_CARRYABLE
The block can be picked up by players.
@ FLAG_BREAKABLE
The block can be broken by ground pounding or attacking it from below.
ACTOR_PARAM_CONFIG(Unbreakable, 8, 1)
If not set, sets FLAG_BREAKABLE.
int preExecute() override
pre method for the execute operation.
void createMdl()
Creates the model and texture animation according to the ice type.
static void callBackWall(dActor_c *self, dActor_c *other, u8 dir)
Called when another actor's wall sensor touches the ice block.
mVec3_c mPosDiff
The offset to the parent actor.
static void callBackHead(dActor_c *self, dActor_c *other)
Called when another actor's head sensor touches the ice block.
void quakeDamage()
Awards the earthquake combo score and breaks the ice block.
IceWeight_e
The weight class of the ice block. Heavy blocks cannot be carried.
nw4r::g3d::ResAnmTexSrt mResFileAnm
The texture animation resource file.
float mStartFallY
The Y position where the block started falling, used to check whether the block falls far enough to b...
InitType_e mInitType
The initial behavior.
sBcMany mBcPointWall
The wall sensor for tile collision.
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.
bool vf68(dBg_ctr_c *collider) override
Unknown, related to collision.
int execute() override
do method for the execute operation.
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.
WallAttachCheckResult_e
The result of checkPlAttach_Wall().
@ WALL_ATTACH_NONE
The player is not touching a wall.
@ WALL_ATTACH_STUCK
The player is stuck between the ice block and a wall.
@ WALL_ATTACH_TOUCH
The player is also touching a wall on the other side of the ice block.
void combobreakReq(int dir, dActor_c *initiator)
Requests the ice block to be broken by a combo attack (e.g. a shell being thrown).
static bool checkRevWall(dActor_c *self, dActor_c *other, u8 dir)
Returns whether the ice block should push the actor at its side.
void calcFloatSpeed()
Accelerates the ice block towards mFloatTargetSpeed in the direction it is tilted to.
bool checkPlAttach_Head(BOOL *playerTouchingCeiling)
Returns whether a player is standing on the ice block.
void initWeight()
Calculates the weight class of the block.
BOOL mShake
Whether the ice block should shake.
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.
int mTimer
A general purpose timer.
void poisonEffect()
Plays the poison splash effect.
void deleteReady() override
Informs the base that it's about to be deleted.
daIce_c()
Constructs a new actor.
int mCarriedByPlrNo
The player number of the player carrying the ice block.
float mExtraFloatSpeedX
Added to the X speed while floating.
mVec2_c mBgcSizeIncrease
The amount to increase mCurrBgcSize per frame until the full size is reached.
void calcFloatAngle()
Tilts the ice block back and forth while floating up.
dBg_ctr_c mBgCtr
The dynamic collider.
static bool checkRevHead(dActor_c *self, dActor_c *other)
Returns whether the ice block should push down the actor below it.
mVec3_c mSize
The size of the ice block.
void setSpinLiftUpActor(dActor_c *carryingActor) override
Callback for when the actor is picked up by another actor.
BOOL mBreakRequested
Whether the ice block should break.
m3d::anmTexSrt_c mAnm
The texture animation.
bool checkPlayerIn()
Checks whether a player overlaps the ice block.
mVec3_c mInitialPos
The position at creation.
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...
mVec2_c mCurrBgcSize
The current dynamic collider size, grows over time.
void block_hit_init() override
Callback for when a block directly beneath the actor is hit.
mVec3_c mModelPos
The position of the model, including the shake offset.
void treadcombobreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the stomp combo score.
void enlargeBgc()
Enlarges the dynamic collider until it reaches the full size.
void initEffect(dIceEfScale_c scale)
Initializes the effect maker.
short mShakeRotAngle
The current angle of the swinging motion.
IceType_e
The possible pre-defined ice block types.
@ ICE_TYPE_TATE
A vertical block.
@ ICE_TYPE_YOKO
A horizontal block.
@ ICE_TYPE_BIG_SQUARE
A large square block.
@ ICE_TYPE_SQUARE
A square block.
@ ICE_TYPE_BIG_YOKO
A large horizontal block.
@ ICE_TYPE_BIG_TATE
A large vertical block.
BOOL mIsWater
Whether the block was created in water.
FloatState_e
The state of the water surface while the block floats on top of it. See StateID_FloatWait.
@ FLOAT_STATE_LOWERING
The water level is lowering.
@ FLOAT_STATE_RISING
The water level is rising.
@ FLOAT_STATE_STILL
The water level is constant, the block bobs up and down.
@ FLOAT_STATE_INIT
The water level has not been checked yet.
bool checkPlAttach_Foot(BOOL *playerTouchingFloor, int *plrNo)
Returns whether a player's head is touching the ice block.
void normalShake()
Shakes the model left and right.
sBcMany mBcPointHead
The head sensor for tile collision.
FloatState_e mFloatState
The state of the water surface, used in StateID_FloatWait.
void starbreakReq(int dir, dActor_c *initiator)
Like combobreakReq(), but uses the star combo score.
void setInfo(mVec3_c size, dIceEfScale_c scale)
Sets up the ice block. Called by the ice manager after creation.
float mPrevPosX
The X position before running execute().
m3d::mdl_c mMdl
The model.
void calcMdl()
Updates the model matrix.
mVec3_c mPrevPos
The position on the previous frame.
int mCollEntryTimer
Countdown until the collision is fully activated.
bool isQuakeDamage()
Checks whether the ice block should be broken by an earthquake.
dIceMng_c * getManager()
Gets the ice manager of the parent enemy.
bool checkBgIn()
Checks whether a solid tile overlaps the ice block.
void initCollision()
Sets up the tile collision, the actor collision and the dynamic collider.
ACTOR_PARAM_CONFIG(CollisionMode, 16, 2)
The tile collision mode. See CollisionMode_e.
dIceEfMaker_c mIceEfMaker
The ice effect maker.
void enlargeBgcLand()
Enlarges the dynamic collider when not in water.
bool isSpinLiftUpEnable() override
Returns whether the actor can be carried.
bool checkPlAttach_Wall(int dir, int *checkResult)
Returns whether a player is touching the given side of the ice block.
short mCurrFloatUpDown
Counter for bobbing up and down on the water surface.
A two-dimensional floating point vector.
A three-dimensional floating point vector.
fBaseID_e
A unique identifier for each base.
#define STATE_FUNC_DECLARE(class, name)
Declares a state.