1#include <game/bases/d_enemy_carry.hpp>
2#include <game/bases/d_a_player_manager.hpp>
20 endSpeed += actor->
mSpeed.x * 0.5f;
29 mSpeed.set(endSpeed, 0.0f, 0.0f);
56void dEnemyCarry_c::initializeState_Carry() {
59 if (player->mAmiLayer == 1) {
66 mCc.mCcData.mVsKind |= BIT_FLAG(CC_KIND_KILLER);
67 mCc.mCcData.mAttack = CC_ATTACK_SHELL;
72void dEnemyCarry_c::finalizeState_Carry() {
73 dAcPy_c *player = daPyMng_c::getPlayer(
mPlayerNo);
75 player->cancelCarry(
this);
76 mCc.mCcData.mAttack = CC_KIND_PLAYER;
77 mCc.mCcData.mVsKind &= ~BIT_FLAG(CC_KIND_KILLER);
83void dEnemyCarry_c::executeState_Carry() {
84 dAcPy_c *player = daPyMng_c::getPlayer(
mPlayerNo);
107void dEnemyCarry_c::initializeState_Throw() {
109 mCc.mCcData.mVsKind |= BIT_FLAG(CC_KIND_KILLER) | BIT_FLAG(CC_KIND_ITEM);
111 mCc.mCcData.mAttack = CC_ATTACK_SHELL;
115void dEnemyCarry_c::finalizeState_Throw() {
116 mCc.mCcData.mVsKind &= ~(BIT_FLAG(CC_KIND_KILLER) | BIT_FLAG(CC_KIND_ITEM));
117 mCc.mCcData.mAttack = CC_KIND_PLAYER;
122void dEnemyCarry_c::executeState_Throw() {}
@ CARRY_RELEASE
The actor is being released from carry.
@ CARRY_THROW
The actor is being actively thrown by the player.
dBc_c mBc
The actor-to-tile collision sensor.
u32 mCarryingFlags
The actor's carry actions. See CARRY_ACTION_e.
u8 mAmiLayer
The actor's layer for chainlink fences.
u8 mDirection
The actor's facing direction.
dCc_c mCc
The actor-to-actor collision sensor.
u8 mThrowDirection
The actor's direction when thrown or dropped after carrying.
s8 mPlayerNo
The player associated with the actor, -1 if not associated to any player.
dActor_c()
Constructs a new actor.
dRc_c mRc
The actor's ride surface manager.
virtual s8 * getPlrNo()
Gets the player number associated with the actor. See mPlayerNo.
float mAccelF
The actor's horizontal acceleration.
mVec3_c mSpeed
The actor's speed.
mVec3_c mPos
The actor's position.
mVec3_c mSpeedMax
The actor's maximum speed.
mAng3_c mAngle
The actor's rotation (for 2D actors).
dDeathInfo_c mDeathInfo
The parameters for the death animation.
dPlayerDownTimer_c mNoHitPlayer
Hit cooldown timers for each player. This is used to prevent, for example, a thrown shell from hittin...
virtual void changeState(const sStateIDIf_c &newState)
Changes the actor's state to the given state.
A carryable enemy. This class is only used as a base for daEnJumpdai_c.
void setDeathInfo_CarryBgIn(dActor_c *)
Sets the death info for when the enemy is stuck in background collision.
virtual void setPutOnChangeState()
Drops this enemy.
static const float smc_DIR_MODE1[]
dEnemyCarry_c()
Constructs a new carryable enemy.
bool mWasDropped
Whether the enemy was dropped or thrown. If dropped, it will not collide with other entities.
virtual void setThrowSpeed(dActor_c *actor)
Sets the throw speed based on the actor throwing it.
virtual void setThrowChangeState()
Throws this enemy.
static const float smc_DIR_MODE0[]
u8 mThrowSpeed
0 => X speed = 2.5, 1 => X speed = 3.0
static sFStateVirtualID_c< dEnemyCarry_c > StateID_Throw
The enemy is being thrown / put down.
const u8 l_Ami_Line[]
The sub-layer for each side of chainlink fences.
#define STATE_VIRTUAL_DEFINE(class, name)
Defines a virtual state.