Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/constants/game_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ enum PLAYER_TYPE_e {

/// @brief Various flags applied to the player on occasion.
enum PLAYER_CREATE_ITEM_e {
CREATE_ITEM_NONE = BIT_FLAG(-1),
CREATE_ITEM_NONE = 0,
CREATE_ITEM_STAR_POWER = BIT_FLAG(0), ///< Gives the player Star Power.
CREATE_ITEM_YOSHI = BIT_FLAG(1), ///< Spawns a Yoshi along with the player.
CREATE_ITEM_BUBBLE = BIT_FLAG(2), ///< Spawns the player inside a bubble.
Expand Down
18 changes: 7 additions & 11 deletions include/game/bases/d_a_player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ class dAcPy_c : public daPlBase_c {
JUMP_AIR
};

/// @unofficial
enum LandSubstate_e {
LAND_ACTION_0,
LAND_ACTION_1
};

/// @unofficial
enum SpinJumpSubstate_e {
SPIN_JUMP_ACTION_0,
Expand Down Expand Up @@ -706,6 +700,8 @@ class dAcPy_c : public daPlBase_c {

mVec3_c getCarryPos();

PLAYER_TYPE_e getPlayerType() const { return mPlayerType; }

mMtx_c getCarryMtx() {
mMtx_c mtx;
mtx.trans(getCarryPos());
Expand All @@ -725,6 +721,7 @@ class dAcPy_c : public daPlBase_c {
return sc_DirSpeed[mDirection];
}

PLAYER_TYPE_e mPlayerType;
int mIsRescueKinopio;
PLAYER_POWERUP_e mPowerupCopy;
PLAYER_POWERUP_e mPowerupCopy2;
Expand Down Expand Up @@ -826,7 +823,7 @@ class dAcPy_c : public daPlBase_c {
u32 mAllBalloonFadeTimer;
mMtx_c mRideJrClownMtx;
int mSpinCooldown; ///< Timer to disable another spin action while active.
u8 m_12f4;
u8 mFireDirection;
float m_12f8;
fBaseID_e m_12fc;
float m_1300;
Expand All @@ -844,9 +841,9 @@ class dAcPy_c : public daPlBase_c {
int m_1580;
int m_1584;
dPyMdlMng_c mPyMdlMng;
float m_1594;
float m_1598;
float m_159c;
float mModelOffsetX;
float mModelOffsetY;
float mModelOffsetY2;
fBaseID_e mCarryActorID;
int mFastRunFrames; ///< How many frames the player has been running at over 1 unit/frame.
int m_15a8;
Expand All @@ -863,7 +860,6 @@ class dAcPy_c : public daPlBase_c {
dPropelParts_c mPropelParts;
dPlayerOrchestra_c mPlayerOrchestra;

ACTOR_PARAM_CONFIG(PlayerNo, 0, 4);
ACTOR_PARAM_CONFIG(CreateAction, 16, 8);
ACTOR_PARAM_CONFIG(Direction, 24, 1);

Expand Down
73 changes: 48 additions & 25 deletions include/game/bases/d_a_player_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ class daPlBase_c : public dActor_c {
ANIME_PLAY_ACTION_2
};

/// @unofficial
enum LandSubstate_e {
LAND_ACTION_0,
LAND_ACTION_1
};

/// @unofficial
enum TurnSubstate_e {
TURN_ACTION_0,
TURN_ACTION_1,
TURN_ACTION_2
};

/// @unofficial
enum DemoType_e {
DEMO_0,
Expand Down Expand Up @@ -360,7 +373,7 @@ class daPlBase_c : public dActor_c {
STATUS_OUT_OF_PLAY, ///< The player is in a bubble or has died.
STATUS_ALL_DOWN_FADE, ///< All players have died and the screen is transitioning.
STATUS_STUNNED, ///< Stunned by electric shock or ice.
STATUS_07, ///< [Ice related]
STATUS_FROZEN, ///< The player is frozen in an ice block.
STATUS_QUAKE, ///< The player was stunned by an earthquake.
STATUS_JUMP = 0x0a, ///< The player is jumping.
STATUS_CAN_PENGUIN_SLIDE, ///< If the player can start sliding as a penguin.
Expand Down Expand Up @@ -398,8 +411,8 @@ class daPlBase_c : public dActor_c {
STATUS_TWIRL, ///< The player is twirling in midair.
STATUS_WAS_TWIRL, ///< The player was twirling in midair the previous frame.
STATUS_SLIP_ACTIVE = 0x30, ///< The player is sliding.
STATUS_31,
STATUS_32,
STATUS_IS_ROLL_SLIP, ///< The player is rolling through the air after being thrown by a player or spat out by Yoshi.
STATUS_IS_ROLL_SLIP_DUP, ///< Same as STATUS_IS_ROLL_SLIP. [Only set/cleared, never checked].
STATUS_VINE, ///< The player is clinging to a vine / mesh net / rock wall.
STATUS_HANG, ///< The player is hanging from a ceiling rope.
STATUS_POLE, ///< The player is climbing a pole.
Expand All @@ -424,7 +437,8 @@ class daPlBase_c : public dActor_c {
STATUS_49,
STATUS_4A,
STATUS_RIDE_YOSHI, ///< The player is riding Yoshi.
STATUS_JUMP_DAI_COOLDOWN = 0x4d, ///< The player recently failed to perform a big jump because of a ceiling.
STATUS_4C,
STATUS_JUMP_DAI_COOLDOWN, ///< The player recently failed to perform a big jump because of a ceiling.
STATUS_4E,
STATUS_4F,
STATUS_50,
Expand Down Expand Up @@ -470,7 +484,9 @@ class daPlBase_c : public dActor_c {
STATUS_78,
STATUS_79,
STATUS_7A,
STATUS_STOP_EXECUTE = 0x7d, ///< Stop executing this player indefinitely.
STATUS_7B,
STATUS_7C,
STATUS_STOP_EXECUTE, ///< Stop executing this player indefinitely.
STATUS_7E,
STATUS_7F,
STATUS_80,
Expand All @@ -489,24 +505,24 @@ class daPlBase_c : public dActor_c {
STATUS_8D, ///< [Cannon shot related]
STATUS_8E, ///< [Cannon shot related]
STATUS_CAN_LAND, ///< The player can land on Yoshi or another player.
STATUS_91 = 0x91,
STATUS_92,
STATUS_93,
STATUS_CAN_RIDE_OFF = 0x91, ///< The player can dismount Yoshi.
STATUS_CAN_SPIN_LIFT, ///< The player can lift up another player.
STATUS_CANNOT_BE_SPIN_LIFTED, ///< The player cannot be lifted up by another player.
STATUS_94,
STATUS_95,
STATUS_96,
STATUS_97,
STATUS_98,
STATUS_NO_GRAVITY_AFFECT, ///< The player is not affected by gravity.
STATUS_99,
STATUS_9B = 0x9b,
STATUS_9C,
STATUS_9D,
STATUS_9E,
STATUS_CAN_CLIMB_VINE = 0x9b, ///< The player can climb mesh nets / rock walls.
STATUS_CAN_HANG, ///< The player can hang from ceiling ropes.
STATUS_CAN_CLIMB_POLE, ///< The player can climb poles.
STATUS_CAN_SHOOT_FIREBALL, ///< The player can shoot a fireball.
STATUS_CAN_SPIN, ///< The player can shake the controller to do a spin jump or a propeller spin.
STATUS_A0,
STATUS_A1,
STATUS_A2,
STATUS_A3,
STATUS_WIND_AFFECTED, ///< The player is affected by wind.
STATUS_CAN_KANI_JUMP, ///< The player can jump on a cliff.
STATUS_CAN_KANI_WALK, ///< The player can walk on a cliff.
STATUS_CAN_TARZAN_ROPE, ///< The player can grab onto swinging ropes / vines.
STATUS_A4,
STATUS_A5, ///< [Jump moving up?]
STATUS_FIREBALL_PREPARE_SHOOT, ///< The player is about to shoot a fireball.
Expand All @@ -518,8 +534,13 @@ class daPlBase_c : public dActor_c {
STATUS_FOLLOW_MAME_KURIBO, ///< Mini Goombas are attached to the player.
STATUS_IS_PENGUIN, ///< The player is in the penguin suit.
STATUS_HIP_ATTACK, ///< The player is in the ground pound action and is not yet about to stand back up.
STATUS_B3 = 0xb3, /// [Yoshi only?]
STATUS_ABOUT_TO_BE_DELETED = 0xb5,
STATUS_AF, /// [Yoshi only?]
STATUS_B0, /// [Yoshi only?]
STATUS_B1, /// [Yoshi only?]
STATUS_B2, /// [Yoshi only?]
STATUS_B3, /// [Yoshi only?]
STATUS_YOSHI_EAT_MOUTH, ///< Yoshi is eating something.
STATUS_ABOUT_TO_BE_DELETED,
STATUS_ITEM_KINOPIO_DISPLAY_OUT,
STATUS_B7,
STATUS_B8,
Expand All @@ -536,9 +557,12 @@ class daPlBase_c : public dActor_c {
STATUS_CAN_WATER_SLIDE, ///< The player can slide on water because of the penguin suit.
STATUS_C4,
STATUS_C5,
STATUS_C8 = 0xc8,
STATUS_C9,
STATUS_CA
STATUS_C6,
STATUS_C7,
STATUS_PLAYER_EAT, ///< The player is being swallowed by Yoshi.
STATUS_ON_TONGUE, ///< The player is on Yoshi's tongue.
STATUS_PLAYER_EAT_DUP, ///< Same as STATUS_PLAYER_EAT.
STATUS_YOSHI_ALONE_WAIT ///< Yoshi is not being ridden.
};

class jmpInf_c {
Expand Down Expand Up @@ -1077,7 +1101,6 @@ class daPlBase_c : public dActor_c {

float getDirSpeed() const { return sc_DirSpeed[mDirection]; }

PLAYER_TYPE_e getPlayerType() const { return mPlayerType; }
u8 getDirection() const { return mDirection; }
PLAYER_POWERUP_e getPowerup() const { return mPowerup; }

Expand Down Expand Up @@ -1114,7 +1137,7 @@ class daPlBase_c : public dActor_c {
float mViewLimitPadding;

KimePoseMode_e mKimePoseMode;
s8 mDemoState; /// Value is a ControlDemoState_e.
s8 mDemoState; /// Value is a ControlDemoSubstate_e.

int mDokanEnterNextGotoID; ///< The ID of the next-goto of the pipe being entered.
/// Position of the door or pipe the player is entering.
Expand Down Expand Up @@ -1295,7 +1318,7 @@ class daPlBase_c : public dActor_c {
float m_1138;
float m_113c;

PLAYER_TYPE_e mPlayerType;
ACTOR_PARAM_CONFIG(PlayerNo, 0, 4);

static const float sc_DirSpeed[];
static const float sc_JumpSpeed;
Expand Down
6 changes: 6 additions & 0 deletions include/game/bases/d_a_player_hio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ class dAcPy_HIO_Speed_c {

sSpeedData mDataNormal;
sSpeedData mDataStar;

static sSpeedData sc_player_mame;
static sSpeedData sc_player_mame_star;
static sSpeedData sc_player_normal;
static sSpeedData sc_player_normal_star;
static const float sc_gravity_data[];
};
4 changes: 4 additions & 0 deletions include/game/bases/d_a_player_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class daPyMng_c {
static int getYoshiColor(u8 plrNo);
static int getYoshiFruit(u8 plrNo);
static daYoshi_c *createYoshi(mVec3_c &, int, dAcPy_c *);
static bool setYoshi(daPlBase_c *);
static void initYoshiPriority(daPlBase_c *);
static void setYoshiPriority(daPlBase_c *);
static void releaseYoshi(daPlBase_c *);

static bool isItemKinopio(int plrNo) {
bool res = false;
Expand Down
Loading
Loading