1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-11 03:39:59 +00:00

initial action-change-list docs (#1540)

This commit is contained in:
fig02 2023-09-27 11:02:21 -04:00 committed by GitHub
parent 2cb4ff4fd3
commit c5e4357127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,23 +144,10 @@ s32 func_80835B60(Player* this, PlayState* play);
s32 func_80835C08(Player* this, PlayState* play); s32 func_80835C08(Player* this, PlayState* play);
void Player_UseItem(PlayState* play, Player* this, s32 item); void Player_UseItem(PlayState* play, Player* this, s32 item);
void func_80839F90(Player* this, PlayState* play); void func_80839F90(Player* this, PlayState* play);
s32 func_80838A14(Player* this, PlayState* play);
s32 func_80839800(Player* this, PlayState* play);
s32 func_8083B040(Player* this, PlayState* play);
s32 func_8083B998(Player* this, PlayState* play);
s32 func_8083B644(Player* this, PlayState* play);
s32 func_8083BDBC(Player* this, PlayState* play);
s32 func_8083C1DC(Player* this, PlayState* play);
s32 func_8083C2B0(Player* this, PlayState* play);
s32 func_8083C544(Player* this, PlayState* play);
s32 func_8083C61C(PlayState* play, Player* this); s32 func_8083C61C(PlayState* play, Player* this);
void func_8083CA20(PlayState* play, Player* this); void func_8083CA20(PlayState* play, Player* this);
void func_8083CA54(PlayState* play, Player* this); void func_8083CA54(PlayState* play, Player* this);
void func_8083CA9C(PlayState* play, Player* this); void func_8083CA9C(PlayState* play, Player* this);
s32 func_8083E0FC(Player* this, PlayState* play);
s32 func_8083E5A8(Player* this, PlayState* play);
s32 func_8083EB44(Player* this, PlayState* play);
s32 func_8083F7BC(Player* this, PlayState* play);
void func_80846648(PlayState* play, Player* this); void func_80846648(PlayState* play, Player* this);
void func_80846660(PlayState* play, Player* this); void func_80846660(PlayState* play, Player* this);
void func_808467D4(PlayState* play, Player* this); void func_808467D4(PlayState* play, Player* this);
@ -173,7 +160,6 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input);
s32 func_8084FCAC(Player* this, PlayState* play); s32 func_8084FCAC(Player* this, PlayState* play);
void func_8084FF7C(Player* this); void func_8084FF7C(Player* this);
void Player_UpdateBunnyEars(Player* this); void Player_UpdateBunnyEars(Player* this);
s32 func_80850224(Player* this, PlayState* play);
void func_80851008(PlayState* play, Player* this, void* anim); void func_80851008(PlayState* play, Player* this, void* anim);
void func_80851030(PlayState* play, Player* this, void* anim); void func_80851030(PlayState* play, Player* this, void* anim);
void func_80851050(PlayState* play, Player* this, void* anim); void func_80851050(PlayState* play, Player* this, void* anim);
@ -3671,55 +3657,168 @@ s32 Player_GetMovementSpeedAndYaw(Player* this, f32* outSpeedTarget, s16* outYaw
} }
} }
static s8 D_808543E0[] = { 13, 2, 4, 9, 10, 11, 8, -7 }; typedef enum {
static s8 D_808543E8[] = { 13, 1, 2, 5, 3, 4, 9, 10, 11, 7, 8, -6 }; /* 0 */ PLAYER_ACTION_CHG_0,
static s8 D_808543F4[] = { 13, 1, 2, 3, 4, 9, 10, 11, 8, 7, -6 }; /* 1 */ PLAYER_ACTION_CHG_1,
static s8 D_80854400[] = { 13, 2, 4, 9, 10, 11, 8, -7 }; /* 2 */ PLAYER_ACTION_CHG_2,
static s8 D_80854408[] = { 13, 2, 4, 9, 10, 11, 12, 8, -7 }; /* 3 */ PLAYER_ACTION_CHG_3,
static s8 D_80854414[] = { -7 }; /* 4 */ PLAYER_ACTION_CHG_4,
static s8 D_80854418[] = { 0, 11, 1, 2, 3, 5, 4, 9, 8, 7, -6 }; /* 5 */ PLAYER_ACTION_CHG_5,
static s8 D_80854424[] = { 0, 11, 1, 2, 3, 12, 5, 4, 9, 8, 7, -6 }; /* 6 */ PLAYER_ACTION_CHG_6,
static s8 D_80854430[] = { 13, 1, 2, 3, 12, 5, 4, 9, 10, 11, 8, 7, -6 }; /* 7 */ PLAYER_ACTION_CHG_7,
static s8 D_80854440[] = { 10, 8, -7 }; /* 8 */ PLAYER_ACTION_CHG_8,
static s8 D_80854444[] = { 0, 12, 5, -4 }; /* 9 */ PLAYER_ACTION_CHG_9,
/* 10 */ PLAYER_ACTION_CHG_10,
/* 11 */ PLAYER_ACTION_CHG_11,
/* 12 */ PLAYER_ACTION_CHG_12,
/* 13 */ PLAYER_ACTION_CHG_13
} ActionChangeIndex;
static s32 (*D_80854448[])(Player* this, PlayState* play) = { static s8 sActionChangeList1[] = {
func_8083B998, func_80839800, func_8083E5A8, func_8083E0FC, func_8083B644, func_8083F7BC, func_8083C1DC, PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9,
func_80850224, func_8083C544, func_8083EB44, func_8083BDBC, func_8083C2B0, func_80838A14, func_8083B040, PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7,
}; };
s32 func_80837348(PlayState* play, Player* this, s8* arg2, s32 arg3) { static s8 sActionChangeList2[] = {
PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_5,
PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10,
PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_7, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_6,
};
static s8 sActionChangeList3[] = {
PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_3,
PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11,
PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6,
};
static s8 sActionChangeList4[] = {
PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9,
PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7,
};
static s8 sActionChangeList5[] = {
PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10,
PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_12, PLAYER_ACTION_CHG_8, -PLAYER_ACTION_CHG_7,
};
static s8 sActionChangeList6[] = {
-PLAYER_ACTION_CHG_7,
};
static s8 sActionChangeList7[] = {
PLAYER_ACTION_CHG_0, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2,
PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9,
PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6,
};
static s8 sActionChangeList8[] = {
PLAYER_ACTION_CHG_0, PLAYER_ACTION_CHG_11, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2,
PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_12, PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4,
PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6,
};
static s8 sActionChangeList9[] = {
PLAYER_ACTION_CHG_13, PLAYER_ACTION_CHG_1, PLAYER_ACTION_CHG_2, PLAYER_ACTION_CHG_3, PLAYER_ACTION_CHG_12,
PLAYER_ACTION_CHG_5, PLAYER_ACTION_CHG_4, PLAYER_ACTION_CHG_9, PLAYER_ACTION_CHG_10, PLAYER_ACTION_CHG_11,
PLAYER_ACTION_CHG_8, PLAYER_ACTION_CHG_7, -PLAYER_ACTION_CHG_6,
};
static s8 sActionChangeList10[] = {
PLAYER_ACTION_CHG_10,
PLAYER_ACTION_CHG_8,
-PLAYER_ACTION_CHG_7,
};
static s8 sActionChangeList11[] = {
PLAYER_ACTION_CHG_0,
PLAYER_ACTION_CHG_12,
PLAYER_ACTION_CHG_5,
-PLAYER_ACTION_CHG_4,
};
s32 Player_ActionChange_0(Player* this, PlayState* play);
s32 Player_ActionChange_1(Player* this, PlayState* play);
s32 Player_ActionChange_2(Player* this, PlayState* play);
s32 Player_ActionChange_3(Player* this, PlayState* play);
s32 Player_ActionChange_4(Player* this, PlayState* play);
s32 Player_ActionChange_5(Player* this, PlayState* play);
s32 Player_ActionChange_6(Player* this, PlayState* play);
s32 Player_ActionChange_7(Player* this, PlayState* play);
s32 Player_ActionChange_8(Player* this, PlayState* play);
s32 Player_ActionChange_9(Player* this, PlayState* play);
s32 Player_ActionChange_10(Player* this, PlayState* play);
s32 Player_ActionChange_11(Player* this, PlayState* play);
s32 Player_ActionChange_12(Player* this, PlayState* play);
s32 Player_ActionChange_13(Player* this, PlayState* play);
static s32 (*sActionChangeFuncs[])(Player* this, PlayState* play) = {
/* PLAYER_ACTION_CHG_0 */ Player_ActionChange_0,
/* PLAYER_ACTION_CHG_1 */ Player_ActionChange_1,
/* PLAYER_ACTION_CHG_2 */ Player_ActionChange_2,
/* PLAYER_ACTION_CHG_3 */ Player_ActionChange_3,
/* PLAYER_ACTION_CHG_4 */ Player_ActionChange_4,
/* PLAYER_ACTION_CHG_5 */ Player_ActionChange_5,
/* PLAYER_ACTION_CHG_6 */ Player_ActionChange_6,
/* PLAYER_ACTION_CHG_7 */ Player_ActionChange_7,
/* PLAYER_ACTION_CHG_8 */ Player_ActionChange_8,
/* PLAYER_ACTION_CHG_9 */ Player_ActionChange_9,
/* PLAYER_ACTION_CHG_10 */ Player_ActionChange_10,
/* PLAYER_ACTION_CHG_11 */ Player_ActionChange_11,
/* PLAYER_ACTION_CHG_12 */ Player_ActionChange_12,
/* PLAYER_ACTION_CHG_13 */ Player_ActionChange_13,
};
/**
* This function processes "Action Change Lists", which run various functions that
* check if it is appropriate to change to a new action.
*
* Action Change Lists are a list of indices for the `sActionChangeFuncs` array.
* The functions are ran in order until one of them returns true, or the end of the list is reached.
* An Action Change index having a negative value indicates that it is the last member in the list.
*
* Because these lists are processed sequentially, the order of the indices in the list determines its priority.
*
* If the `updateUpperBody` argument is true, Player's upper body will update before the Action Change List
* is processed. This allows for Item Action functions to run.
*
* @return true if a new action has been chosen
*
*/
s32 Player_TryActionChangeList(PlayState* play, Player* this, s8* actionChangeList, s32 updateUpperBody) {
s32 i; s32 i;
if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_7 | PLAYER_STATE1_29))) { if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_7 | PLAYER_STATE1_29))) {
if (arg3 != 0) { if (updateUpperBody) {
D_808535E0 = Player_UpdateUpperBody(this, play); D_808535E0 = Player_UpdateUpperBody(this, play);
if (Player_Action_8084E604 == this->actionFunc) { if (Player_Action_8084E604 == this->actionFunc) {
return 1; return true;
} }
} }
if (func_8008F128(this)) { if (func_8008F128(this)) {
this->unk_6AE |= 0x41; this->unk_6AE |= 0x41;
return 1; return true;
} }
if (!(this->stateFlags1 & PLAYER_STATE1_START_CHANGING_HELD_ITEM) && if (!(this->stateFlags1 & PLAYER_STATE1_START_CHANGING_HELD_ITEM) &&
(Player_IA_ChangeHeldItem != this->itemActionFunc)) { (Player_IA_ChangeHeldItem != this->itemActionFunc)) {
while (*arg2 >= 0) { // Process all entries in the Action Change List with a positive index
if (D_80854448[*arg2](this, play)) { while (*actionChangeList >= 0) {
return 1; if (sActionChangeFuncs[*actionChangeList](this, play)) {
return true;
} }
arg2++; actionChangeList++;
} }
if (D_80854448[-(*arg2)](this, play)) { // Try the last entry in the list. Negate the index to make it positive again.
return 1; if (sActionChangeFuncs[-(*actionChangeList)](this, play)) {
return true;
} }
} }
} }
return 0; return false;
} }
s32 func_808374A0(PlayState* play, Player* this, SkelAnime* skelAnime, f32 arg3) { s32 func_808374A0(PlayState* play, Player* this, SkelAnime* skelAnime, f32 arg3) {
@ -3727,7 +3826,7 @@ s32 func_808374A0(PlayState* play, Player* this, SkelAnime* skelAnime, f32 arg3)
s16 yawTarget; s16 yawTarget;
if ((skelAnime->endFrame - arg3) <= skelAnime->curFrame) { if ((skelAnime->endFrame - arg3) <= skelAnime->curFrame) {
if (func_80837348(play, this, D_80854418, 1)) { if (Player_TryActionChangeList(play, this, sActionChangeList7, true)) {
return 0; return 0;
} }
@ -4335,7 +4434,7 @@ void func_808389E8(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState*
func_80838940(this, anim, arg2, play, NA_SE_VO_LI_SWORD_N); func_80838940(this, anim, arg2, play, NA_SE_VO_LI_SWORD_N);
} }
s32 func_80838A14(Player* this, PlayState* play) { s32 Player_ActionChange_12(Player* this, PlayState* play) {
s32 sp3C; s32 sp3C;
LinkAnimationHeader* anim; LinkAnimationHeader* anim;
f32 sp34; f32 sp34;
@ -4710,7 +4809,7 @@ s32 Player_PosVsWallLineTest(PlayState* play, Player* this, Vec3f* offset, Colli
return BgCheck_EntityLineTest1(&play->colCtx, &posA, &posB, posResult, wallPoly, true, false, false, true, bgId); return BgCheck_EntityLineTest1(&play->colCtx, &posA, &posB, posResult, wallPoly, true, false, false, true, bgId);
} }
s32 func_80839800(Player* this, PlayState* play) { s32 Player_ActionChange_1(Player* this, PlayState* play) {
SlidingDoorActorBase* slidingDoor; SlidingDoorActorBase* slidingDoor;
DoorActorBase* door; DoorActorBase* door;
s32 doorDirection; s32 doorDirection;
@ -5353,7 +5452,7 @@ static LinkAnimationHeader* D_80854548[] = {
&gPlayerAnim_link_normal_take_out, &gPlayerAnim_link_normal_take_out,
}; };
s32 func_8083B040(Player* this, PlayState* play) { s32 Player_ActionChange_13(Player* this, PlayState* play) {
s32 sp2C; s32 sp2C;
s32 sp28; s32 sp28;
GetItemEntry* giEntry; GetItemEntry* giEntry;
@ -5499,7 +5598,7 @@ s32 func_8083B040(Player* this, PlayState* play) {
return 0; return 0;
} }
s32 func_8083B644(Player* this, PlayState* play) { s32 Player_ActionChange_4(Player* this, PlayState* play) {
Actor* sp34 = this->targetActor; Actor* sp34 = this->targetActor;
Actor* sp30 = this->unk_664; Actor* sp30 = this->unk_664;
Actor* sp2C = NULL; Actor* sp2C = NULL;
@ -5584,9 +5683,9 @@ s32 func_8083B8F4(Player* this, PlayState* play) {
return 0; return 0;
} }
s32 func_8083B998(Player* this, PlayState* play) { s32 Player_ActionChange_0(Player* this, PlayState* play) {
if (this->unk_6AD != 0) { if (this->unk_6AD != 0) {
func_8083B040(this, play); Player_ActionChange_13(this, play);
return 1; return 1;
} }
@ -5671,7 +5770,7 @@ void func_8083BCD0(Player* this, PlayState* play, s32 arg2) {
Player_PlaySfx(this, ((arg2 << 0xE) == 0x8000) ? NA_SE_PL_ROLL : NA_SE_PL_SKIP); Player_PlaySfx(this, ((arg2 << 0xE) == 0x8000) ? NA_SE_PL_ROLL : NA_SE_PL_SKIP);
} }
s32 func_8083BDBC(Player* this, PlayState* play) { s32 Player_ActionChange_10(Player* this, PlayState* play) {
s32 sp2C; s32 sp2C;
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) &&
@ -5762,7 +5861,7 @@ void func_8083C148(Player* this, PlayState* play) {
this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20); this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20);
} }
s32 func_8083C1DC(Player* this, PlayState* play) { s32 Player_ActionChange_6(Player* this, PlayState* play) {
if (!func_80833B54(this) && (D_808535E0 == 0) && !(this->stateFlags1 & PLAYER_STATE1_23) && if (!func_80833B54(this) && (D_808535E0 == 0) && !(this->stateFlags1 & PLAYER_STATE1_23) &&
CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) {
if (func_8083BC7C(this, play)) { if (func_8083BC7C(this, play)) {
@ -5778,7 +5877,7 @@ s32 func_8083C1DC(Player* this, PlayState* play) {
return 0; return 0;
} }
s32 func_8083C2B0(Player* this, PlayState* play) { s32 Player_ActionChange_11(Player* this, PlayState* play) {
LinkAnimationHeader* anim; LinkAnimationHeader* anim;
f32 frame; f32 frame;
@ -5846,7 +5945,7 @@ void func_8083C50C(Player* this) {
} }
} }
s32 func_8083C544(Player* this, PlayState* play) { s32 Player_ActionChange_8(Player* this, PlayState* play) {
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) {
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) && if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) &&
(this->heldItemAction != PLAYER_IA_DEKU_STICK)) { (this->heldItemAction != PLAYER_IA_DEKU_STICK)) {
@ -6431,7 +6530,7 @@ static struct_80854578 D_80854578[] = {
{ &gPlayerAnim_link_uma_right_up, -34.16f, 7.91f }, { &gPlayerAnim_link_uma_right_up, -34.16f, 7.91f },
}; };
s32 func_8083E0FC(Player* this, PlayState* play) { s32 Player_ActionChange_3(Player* this, PlayState* play) {
EnHorse* rideActor = (EnHorse*)this->rideActor; EnHorse* rideActor = (EnHorse*)this->rideActor;
f32 unk_04; f32 unk_04;
f32 unk_08; f32 unk_08;
@ -6558,7 +6657,7 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) {
Sfx_PlaySfxCentered((this->getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM); Sfx_PlaySfxCentered((this->getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM);
} }
s32 func_8083E5A8(Player* this, PlayState* play) { s32 Player_ActionChange_2(Player* this, PlayState* play) {
Actor* interactedActor; Actor* interactedActor;
if (iREG(67) || if (iREG(67) ||
@ -6687,7 +6786,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) {
return 1; return 1;
} }
s32 func_8083EB44(Player* this, PlayState* play) { s32 Player_ActionChange_9(Player* this, PlayState* play) {
if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) &&
CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) {
if (!func_80835644(play, this, this->heldActor)) { if (!func_80835644(play, this, this->heldActor)) {
@ -7010,7 +7109,7 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, PlayState* play) {
this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000;
} }
s32 func_8083F7BC(Player* this, PlayState* play) { s32 Player_ActionChange_5(Player* this, PlayState* play) {
DynaPolyActor* wallPolyActor; DynaPolyActor* wallPolyActor;
if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) &&
@ -7302,7 +7401,7 @@ void Player_Action_80840450(Player* this, PlayState* play) {
func_8083721C(this); func_8083721C(this);
if (!func_80837348(play, this, D_808543E0, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList1, true)) {
if (!func_80833B54(this) && (!func_80833B2C(this) || (func_80834B5C != this->itemActionFunc))) { if (!func_80833B54(this) && (!func_80833B2C(this) || (func_80834B5C != this->itemActionFunc))) {
func_8083CF10(this, play); func_8083CF10(this, play);
return; return;
@ -7368,7 +7467,7 @@ void Player_Action_808407CC(Player* this, PlayState* play) {
func_8083721C(this); func_8083721C(this);
if (!func_80837348(play, this, D_808543E8, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList2, true)) {
if (func_80833B54(this)) { if (func_80833B54(this)) {
func_8083CEAC(this, play); func_8083CEAC(this, play);
return; return;
@ -7496,7 +7595,7 @@ void Player_Action_80840BC8(Player* this, PlayState* play) {
func_8083721C(this); func_8083721C(this);
if (this->actionVar2 == 0) { if (this->actionVar2 == 0) {
if (!func_80837348(play, this, D_80854418, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList7, true)) {
if (func_80833B54(this)) { if (func_80833B54(this)) {
func_8083CEAC(this, play); func_8083CEAC(this, play);
return; return;
@ -7569,7 +7668,7 @@ void Player_Action_80840DE4(Player* this, PlayState* play) {
func_808327F8(this, this->speedXZ); func_808327F8(this, this->speedXZ);
} }
if (!func_80837348(play, this, D_808543F4, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList3, true)) {
if (func_80833B54(this)) { if (func_80833B54(this)) {
func_8083CEAC(this, play); func_8083CEAC(this, play);
return; return;
@ -7691,7 +7790,7 @@ void Player_Action_808414F8(Player* this, PlayState* play) {
func_80841138(this, play); func_80841138(this, play);
if (!func_80837348(play, this, D_80854400, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) {
if (!func_80833C04(this)) { if (!func_80833C04(this)) {
func_8083C8DC(this, play, this->yaw); func_8083C8DC(this, play, this->yaw);
return; return;
@ -7736,7 +7835,7 @@ void Player_Action_8084170C(Player* this, PlayState* play) {
sp34 = LinkAnimation_Update(play, &this->skelAnime); sp34 = LinkAnimation_Update(play, &this->skelAnime);
func_8083721C(this); func_8083721C(this);
if (!func_80837348(play, this, D_80854400, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play);
if (this->speedXZ == 0.0f) { if (this->speedXZ == 0.0f) {
@ -7756,7 +7855,7 @@ void Player_Action_808417FC(Player* this, PlayState* play) {
sp1C = LinkAnimation_Update(play, &this->skelAnime); sp1C = LinkAnimation_Update(play, &this->skelAnime);
if (!func_80837348(play, this, D_80854400, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList4, true)) {
if (sp1C != 0) { if (sp1C != 0) {
func_80839F30(this, play); func_80839F30(this, play);
} }
@ -7785,7 +7884,7 @@ void Player_Action_8084193C(Player* this, PlayState* play) {
func_80841860(play, this); func_80841860(play, this);
if (!func_80837348(play, this, D_80854408, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList5, true)) {
if (!func_80833C04(this)) { if (!func_80833C04(this)) {
func_8083C858(this, play); func_8083C858(this, play);
return; return;
@ -7855,7 +7954,7 @@ void Player_Action_80841BA8(Player* this, PlayState* play) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play); Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_CURVED, play);
if (!func_80837348(play, this, D_80854414, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList6, true)) {
if (speedTarget != 0.0f) { if (speedTarget != 0.0f) {
this->actor.shape.rot.y = yawTarget; this->actor.shape.rot.y = yawTarget;
func_8083C858(this, play); func_8083C858(this, play);
@ -7971,7 +8070,7 @@ void Player_Action_80842180(Player* this, PlayState* play) {
this->stateFlags2 |= PLAYER_STATE2_5; this->stateFlags2 |= PLAYER_STATE2_5;
func_80841EE4(this, play); func_80841EE4(this, play);
if (!func_80837348(play, this, D_80854424, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList8, true)) {
if (func_80833C04(this)) { if (func_80833C04(this)) {
func_8083C858(this, play); func_8083C858(this, play);
return; return;
@ -7997,7 +8096,7 @@ void Player_Action_8084227C(Player* this, PlayState* play) {
this->stateFlags2 |= PLAYER_STATE2_5; this->stateFlags2 |= PLAYER_STATE2_5;
func_80841EE4(this, play); func_80841EE4(this, play);
if (!func_80837348(play, this, D_80854430, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList9, true)) {
if (!func_80833C04(this)) { if (!func_80833C04(this)) {
func_8083C858(this, play); func_8083C858(this, play);
return; return;
@ -8030,7 +8129,7 @@ void Player_Action_808423EC(Player* this, PlayState* play) {
sp34 = LinkAnimation_Update(play, &this->skelAnime); sp34 = LinkAnimation_Update(play, &this->skelAnime);
if (!func_80837348(play, this, D_80854408, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList5, true)) {
if (!func_80833C04(this)) { if (!func_80833C04(this)) {
func_8083C858(this, play); func_8083C858(this, play);
return; return;
@ -8062,7 +8161,7 @@ void Player_Action_8084251C(Player* this, PlayState* play) {
func_8083721C(this); func_8083721C(this);
if (!func_80837348(play, this, D_80854440, 1)) { if (!Player_TryActionChangeList(play, this, sActionChangeList10, true)) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play);
if (this->speedXZ == 0.0f) { if (this->speedXZ == 0.0f) {
@ -8109,7 +8208,7 @@ void Player_Action_8084279C(Player* this, PlayState* play) {
func_80832CB0(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_wait, this->modelAnimType)); func_80832CB0(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_wait, this->modelAnimType));
if (DECR(this->actionVar2) == 0) { if (DECR(this->actionVar2) == 0) {
if (!func_8083B040(this, play)) { if (!Player_ActionChange_13(this, play)) {
func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_end, this->modelAnimType), play); func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_check_end, this->modelAnimType), play);
} }
@ -8141,7 +8240,7 @@ s32 func_808428D8(Player* this, PlayState* play) {
} }
s32 func_80842964(Player* this, PlayState* play) { s32 func_80842964(Player* this, PlayState* play) {
return func_8083B040(this, play) || func_8083B644(this, play) || func_8083E5A8(this, play); return Player_ActionChange_13(this, play) || Player_ActionChange_4(this, play) || Player_ActionChange_2(this, play);
} }
void Player_RequestQuake(PlayState* play, s32 speed, s32 y, s32 duration) { void Player_RequestQuake(PlayState* play, s32 speed, s32 y, s32 duration) {
@ -8386,7 +8485,7 @@ void Player_Action_80843188(Player* this, PlayState* play) {
this->actionVar1 = 0; this->actionVar1 = 0;
} }
} else if (!func_80842964(this, play)) { } else if (!func_80842964(this, play)) {
if (func_8083C2B0(this, play)) { if (Player_ActionChange_11(this, play)) {
func_808428D8(this, play); func_808428D8(this, play);
} else { } else {
this->stateFlags1 &= ~PLAYER_STATE1_22; this->stateFlags1 &= ~PLAYER_STATE1_22;
@ -8879,7 +8978,7 @@ void Player_Action_80844708(Player* this, PlayState* play) {
} }
} }
if ((this->skelAnime.curFrame < 15.0f) || !func_80850224(this, play)) { if ((this->skelAnime.curFrame < 15.0f) || !Player_ActionChange_7(this, play)) {
if (this->skelAnime.curFrame >= 20.0f) { if (this->skelAnime.curFrame >= 20.0f) {
func_8083A060(this, play); func_8083A060(this, play);
return; return;
@ -9335,7 +9434,7 @@ void Player_Action_80845CA4(Player* this, PlayState* play) {
s32 sp30; s32 sp30;
s32 pad; s32 pad;
if (!func_8083B040(this, play)) { if (!Player_ActionChange_13(this, play)) {
if (this->actionVar2 == 0) { if (this->actionVar2 == 0) {
LinkAnimation_Update(play, &this->skelAnime); LinkAnimation_Update(play, &this->skelAnime);
@ -9379,7 +9478,7 @@ void Player_Action_80845CA4(Player* this, PlayState* play) {
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN));
func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data); func_80845C68(play, gSaveContext.respawn[RESPAWN_MODE_DOWN].data);
if (!func_8083B644(this, play)) { if (!Player_ActionChange_4(this, play)) {
func_8083CF5C(this, play); func_8083CF5C(this, play);
} }
} }
@ -9455,7 +9554,7 @@ static struct_80832924 D_8085461C[] = {
void Player_Action_80846120(Player* this, PlayState* play) { void Player_Action_80846120(Player* this, PlayState* play) {
if (LinkAnimation_Update(play, &this->skelAnime) && (this->actionVar2++ > 20)) { if (LinkAnimation_Update(play, &this->skelAnime) && (this->actionVar2++ > 20)) {
if (!func_8083B040(this, play)) { if (!Player_ActionChange_13(this, play)) {
func_8083A098(this, &gPlayerAnim_link_normal_heavy_carry_end, play); func_8083A098(this, &gPlayerAnim_link_normal_heavy_carry_end, play);
} }
return; return;
@ -11545,7 +11644,7 @@ s32 func_8084B4D4(PlayState* play, Player* this) {
this->stateFlags3 &= ~PLAYER_STATE3_5; this->stateFlags3 &= ~PLAYER_STATE3_5;
func_8084B498(this); func_8084B498(this);
this->unk_6AD = 4; this->unk_6AD = 4;
func_8083B040(this, play); Player_ActionChange_13(this, play);
return 1; return 1;
} }
@ -11566,7 +11665,7 @@ void Player_Action_8084B530(Player* this, PlayState* play) {
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN));
if (!func_8084B4D4(play, this) && !func_8084B3CC(play, this) && !func_8083ADD4(play, this)) { if (!func_8084B4D4(play, this) && !func_8084B3CC(play, this) && !func_8083ADD4(play, this)) {
if ((this->targetActor != this->interactRangeActor) || !func_8083E5A8(this, play)) { if ((this->targetActor != this->interactRangeActor) || !Player_ActionChange_2(this, play)) {
if (this->stateFlags1 & PLAYER_STATE1_23) { if (this->stateFlags1 & PLAYER_STATE1_23) {
s32 sp24 = this->actionVar2; s32 sp24 = this->actionVar2;
func_8083A360(play, this); func_8083A360(play, this);
@ -12296,8 +12395,8 @@ void Player_Action_8084CC98(Player* this, PlayState* play) {
this->yaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; this->yaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y;
if ((this->csAction != PLAYER_CSACTION_NONE) || if ((this->csAction != PLAYER_CSACTION_NONE) ||
(!func_8083224C(play) && ((rideActor->actor.speed != 0.0f) || !func_8083B644(this, play)) && (!func_8083224C(play) && ((rideActor->actor.speed != 0.0f) || !Player_ActionChange_4(this, play)) &&
!func_8083C1DC(this, play))) { !Player_ActionChange_6(this, play))) {
if (D_808535E0 == 0) { if (D_808535E0 == 0) {
if (this->actionVar1 != 0) { if (this->actionVar1 != 0) {
if (LinkAnimation_Update(play, &this->skelAnimeUpper)) { if (LinkAnimation_Update(play, &this->skelAnimeUpper)) {
@ -12353,7 +12452,8 @@ void Player_Action_8084CC98(Player* this, PlayState* play) {
return; return;
} }
if ((this->csAction != PLAYER_CSACTION_NONE) || (!func_8084C9BC(this, play) && !func_8083B040(this, play))) { if ((this->csAction != PLAYER_CSACTION_NONE) ||
(!func_8084C9BC(this, play) && !Player_ActionChange_13(this, play))) {
if (this->unk_664 != NULL) { if (this->unk_664 != NULL) {
if (func_8002DD78(this) != 0) { if (func_8002DD78(this) != 0) {
this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y; this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y;
@ -12438,7 +12538,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) {
func_80832CB0(play, this, &gPlayerAnim_link_swimer_swim_wait); func_80832CB0(play, this, &gPlayerAnim_link_swimer_swim_wait);
func_8084B000(this); func_8084B000(this);
if (!func_8083224C(play) && !func_80837348(play, this, D_80854444, 1) && if (!func_8083224C(play) && !Player_TryActionChangeList(play, this, sActionChangeList11, true) &&
!func_8083D12C(play, this, sControlInput)) { !func_8083D12C(play, this, sControlInput)) {
if (this->unk_6AD != 1) { if (this->unk_6AD != 1) {
this->unk_6AD = 0; this->unk_6AD = 0;
@ -12475,7 +12575,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) {
} }
void Player_Action_8084D7C4(Player* this, PlayState* play) { void Player_Action_8084D7C4(Player* this, PlayState* play) {
if (!func_8083B040(this, play)) { if (!Player_ActionChange_13(this, play)) {
this->stateFlags2 |= PLAYER_STATE2_5; this->stateFlags2 |= PLAYER_STATE2_5;
func_8084B158(play, this, NULL, this->speedXZ); func_8084B158(play, this, NULL, this->speedXZ);
@ -12497,7 +12597,8 @@ void Player_Action_8084D84C(Player* this, PlayState* play) {
func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B158(play, this, sControlInput, this->speedXZ);
func_8084B000(this); func_8084B000(this);
if (!func_80837348(play, this, D_80854444, 1) && !func_8083D12C(play, this, sControlInput)) { if (!Player_TryActionChangeList(play, this, sActionChangeList11, true) &&
!func_8083D12C(play, this, sControlInput)) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play);
temp = this->actor.shape.rot.y - yawTarget; temp = this->actor.shape.rot.y - yawTarget;
@ -12556,7 +12657,8 @@ void Player_Action_8084DAB4(Player* this, PlayState* play) {
func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B158(play, this, sControlInput, this->speedXZ);
func_8084B000(this); func_8084B000(this);
if (!func_80837348(play, this, D_80854444, 1) && !func_8083D12C(play, this, sControlInput)) { if (!Player_TryActionChangeList(play, this, sActionChangeList11, true) &&
!func_8083D12C(play, this, sControlInput)) {
Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play);
if (speedTarget == 0.0f) { if (speedTarget == 0.0f) {
@ -12587,7 +12689,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) {
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
Player_UpdateUpperBody(this, play); Player_UpdateUpperBody(this, play);
if (!func_8083B040(this, play)) { if (!Player_ActionChange_13(this, play)) {
if (this->currentBoots == PLAYER_BOOTS_IRON) { if (this->currentBoots == PLAYER_BOOTS_IRON) {
func_80838F18(play, this); func_80838F18(play, this);
return; return;
@ -12609,7 +12711,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) {
func_8084B158(play, this, sControlInput, this->actor.velocity.y); func_8084B158(play, this, sControlInput, this->actor.velocity.y);
this->unk_6C2 = 16000; this->unk_6C2 = 16000;
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !func_8083E5A8(this, play) && if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !Player_ActionChange_2(this, play) &&
!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->actor.yDistToWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) { (this->actor.yDistToWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) {
func_8084DBC4(play, this, -2.0f); func_8084DBC4(play, this, -2.0f);
@ -12785,7 +12887,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) {
this->targetActor = this->naviActor; this->targetActor = this->naviActor;
this->naviActor->textId = -this->naviTextId; this->naviActor->textId = -this->naviTextId;
func_80853148(play, this->targetActor); func_80853148(play, this->targetActor);
} else if (!func_8083B040(this, play)) { } else if (!Player_ActionChange_13(this, play)) {
func_8083A098(this, &gPlayerAnim_link_normal_okarina_end, play); func_8083A098(this, &gPlayerAnim_link_normal_okarina_end, play);
} }
@ -13211,7 +13313,7 @@ void Player_Action_8084F390(Player* this, PlayState* play) {
func_8084269C(play, this); func_8084269C(play, this);
func_800F4138(&this->actor.projectedPos, NA_SE_PL_SLIP_LEVEL - SFX_FLAG, this->actor.speed); func_800F4138(&this->actor.projectedPos, NA_SE_PL_SLIP_LEVEL - SFX_FLAG, this->actor.speed);
if (func_8083B040(this, play) == 0) { if (Player_ActionChange_13(this, play) == 0) {
floorPoly = this->actor.floorPoly; floorPoly = this->actor.floorPoly;
if (floorPoly == NULL) { if (floorPoly == NULL) {
@ -13338,7 +13440,7 @@ void Player_Action_8084F88C(Player* this, PlayState* play) {
} }
void Player_Action_8084F9A0(Player* this, PlayState* play) { void Player_Action_8084F9A0(Player* this, PlayState* play) {
func_80839800(this, play); Player_ActionChange_1(this, play);
} }
void Player_Action_8084F9C0(Player* this, PlayState* play) { void Player_Action_8084F9C0(Player* this, PlayState* play) {
@ -13540,7 +13642,7 @@ void Player_UpdateBunnyEars(Player* this) {
} }
} }
s32 func_80850224(Player* this, PlayState* play) { s32 Player_ActionChange_7(Player* this, PlayState* play) {
if (func_8083C6B8(play, this) == 0) { if (func_8083C6B8(play, this) == 0) {
if (func_8083BB20(this) != 0) { if (func_8083BB20(this) != 0) {
s32 sp24 = func_80837818(this); s32 sp24 = func_80837818(this);
@ -13584,7 +13686,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) {
func_8083C50C(this); func_8083C50C(this);
if (LinkAnimation_Update(play, &this->skelAnime)) { if (LinkAnimation_Update(play, &this->skelAnime)) {
if (!func_80850224(this, play)) { if (!Player_ActionChange_7(this, play)) {
u8 sp43 = this->skelAnime.moveFlags; u8 sp43 = this->skelAnime.moveFlags;
LinkAnimationHeader* sp3C; LinkAnimationHeader* sp3C;
@ -14279,7 +14381,7 @@ void func_808514C0(PlayState* play, Player* this, CsCmdActorCue* cue) {
} }
if ((this->interactRangeActor != NULL) && (this->interactRangeActor->textId == 0xFFFF)) { if ((this->interactRangeActor != NULL) && (this->interactRangeActor->textId == 0xFFFF)) {
func_8083E5A8(this, play); Player_ActionChange_2(this, play);
} }
} }
@ -14835,8 +14937,8 @@ void func_80852944(PlayState* play, Player* this, CsCmdActorCue* cue) {
func_80832340(play, this); func_80832340(play, this);
} else { } else {
func_8083C148(this, play); func_8083C148(this, play);
if (!func_8083B644(this, play)) { if (!Player_ActionChange_4(this, play)) {
func_8083E5A8(this, play); Player_ActionChange_2(this, play);
} }
} }