Skip to content
Open
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
1 change: 1 addition & 0 deletions include/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,7 @@ typedef struct Player {
s16 csDelayTimer; // Player_Action_WaitForCutscene: Number of frames to wait before responding to a cutscene
s16 playedLandingSfx; // Player_Action_BlueWarpArrive: Played sfx when landing on the ground
s16 appearTimer; // Player_Action_FaroresWindArrive: Counts up, appear at 20 frames (1 second)
s16 plantBeanTimer; // Player_Action_PlantMagicBean: Timer for planting bean sequence (80 frames)
} av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running

/* 0x0854 */ f32 unk_854;
Expand Down
13 changes: 8 additions & 5 deletions src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void Player_Action_8084193C(Player* this, PlayState* play);
void Player_Action_TurnInPlace(Player* this, PlayState* play);
void Player_Action_80842180(Player* this, PlayState* play);
void Player_Action_8084227C(Player* this, PlayState* play);
void Player_Action_8084279C(Player* this, PlayState* play);
void Player_Action_PlantMagicBean(Player* this, PlayState* play);
void Player_Action_808423EC(Player* this, PlayState* play);
void Player_Action_8084251C(Player* this, PlayState* play);
void Player_Action_80843188(Player* this, PlayState* play);
Expand Down Expand Up @@ -6087,9 +6087,9 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) {
(this->itemAction == PLAYER_IA_MAGIC_BEAN))) {
if (this->exchangeItemId == EXCH_ITEM_MAGIC_BEAN) {
Inventory_ChangeAmmo(ITEM_MAGIC_BEAN, -1);
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084279C, 0);
Player_SetupActionPreserveItemAction(play, this, Player_Action_PlantMagicBean, 0);
this->stateFlags1 |= PLAYER_STATE1_29;
this->av2.actionVar2 = 0x50;
this->av2.plantBeanTimer = 80;
this->av1.actionVar1 = -1;
}
talkActor->flags |= ACTOR_FLAG_TALK;
Expand Down Expand Up @@ -8933,10 +8933,13 @@ s32 func_8084269C(PlayState* play, Player* this) {
return 0;
}

void Player_Action_8084279C(Player* this, PlayState* play) {
/**
* Watch as Magic Bean gets planted, then setup idle.
*/
void Player_Action_PlantMagicBean(Player* this, PlayState* play) {
func_80832CB0(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_wait, this->modelAnimType));

if (DECR(this->av2.actionVar2) == 0) {
if (DECR(this->av2.plantBeanTimer) == 0) { // Starts at 80
if (!Player_ActionHandler_13(this, play)) {
func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_end, this->modelAnimType), play);
}
Expand Down