diff --git a/include/z64player.h b/include/z64player.h index 9fabf823f5..8a3aaa7eb0 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -81,7 +81,7 @@ typedef enum PlayerItemAction { /* 0x05 */ PLAYER_IA_SWORD_GILDED, /* 0x06 */ PLAYER_IA_SWORD_TWO_HANDED, /* 0x07 */ PLAYER_IA_DEKU_STICK, - /* 0x08 */ PLAYER_IA_ZORA_FINS, + /* 0x08 */ PLAYER_IA_ZORA_BOOMERANG, /* 0x09 */ PLAYER_IA_BOW, /* 0x0A */ PLAYER_IA_BOW_FIRE, /* 0x0B */ PLAYER_IA_BOW_ICE, @@ -185,7 +185,7 @@ typedef enum PlayerMeleeWeapon { /* 3 */ PLAYER_MELEEWEAPON_SWORD_GILDED = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_GILDED), /* 4 */ PLAYER_MELEEWEAPON_SWORD_TWO_HANDED = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_SWORD_TWO_HANDED), /* 5 */ PLAYER_MELEEWEAPON_DEKU_STICK = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_DEKU_STICK), - /* 6 */ PLAYER_MELEEWEAPON_ZORA_FINS = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_ZORA_FINS), + /* 6 */ PLAYER_MELEEWEAPON_ZORA_BOOMERANG = GET_MELEE_WEAPON_FROM_IA(PLAYER_IA_ZORA_BOOMERANG), /* 7 */ PLAYER_MELEEWEAPON_MAX } PlayerMeleeWeapon; @@ -444,7 +444,7 @@ typedef enum PlayerModelGroup { /* 11 */ PLAYER_MODELGROUP_INSTRUMENT, /* 12 */ PLAYER_MODELGROUP_BOTTLE, /* 13 */ PLAYER_MODELGROUP_13, - /* 14 */ PLAYER_MODELGROUP_ZORA_FINS, + /* 14 */ PLAYER_MODELGROUP_ZORA_BOOMERANG, /* 15 */ PLAYER_MODELGROUP_MAX } PlayerModelGroup; @@ -917,10 +917,10 @@ typedef enum PlayerCueId { #define PLAYER_STATE1_400000 (1 << 22) // #define PLAYER_STATE1_800000 (1 << 23) -// -#define PLAYER_STATE1_1000000 (1 << 24) -// -#define PLAYER_STATE1_2000000 (1 << 25) +// Currently using the zora boomerang. This includes all phases (aiming, throwing, and catching). +#define PLAYER_STATE1_USING_ZORA_BOOMERANG (1 << 24) +// Zora boomerang has been thrown and is flying in the air +#define PLAYER_STATE1_ZORA_BOOMERANG_THROWN (1 << 25) // #define PLAYER_STATE1_4000000 (1 << 26) // Swimming? @@ -1047,8 +1047,8 @@ typedef enum PlayerCueId { #define PLAYER_STATE3_200000 (1 << 21) // #define PLAYER_STATE3_400000 (1 << 22) -// -#define PLAYER_STATE3_800000 (1 << 23) +// A Zora boomerang has been caught this frame +#define PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT (1 << 23) // #define PLAYER_STATE3_1000000 (1 << 24) // @@ -1215,7 +1215,7 @@ typedef struct Player { /* 0xA70 */ u32 stateFlags2; /* 0xA74 */ u32 stateFlags3; /* 0xA78 */ Actor* autoLockOnActor; // Actor that is locked onto automatically without player input; see `Player_SetAutoLockOnActor` - /* 0xA7C */ Actor* boomerangActor; + /* 0xA7C */ Actor* zoraBoomerangActor; // Defaults to the left zora boomerang, but will switch to right if only the left boomerang is caught. /* 0xA80 */ Actor* tatlActor; /* 0xA84 */ s16 tatlTextId; /* 0xA86 */ s8 csId; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index b3f3f5fdd9..d010162a7f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -425,7 +425,6 @@ s32 func_800CB950(Camera* camera) { player = (Player*)camera->focalActor; if (!ret) { - // Using zora fins ret = player->stateFlags1 & PLAYER_STATE1_200000; ret = !!ret; } @@ -527,7 +526,7 @@ s32 func_800CBB88(Camera* camera) { return 0; } -s32 Camera_IsUsingZoraFins(Camera* camera) { +s32 func_800CBC00(Camera* camera) { Actor* focalActor = camera->focalActor; if (camera->focalActor == &GET_PLAYER(camera->play)->actor) { @@ -3898,7 +3897,7 @@ s32 Camera_Battle0(Camera* camera) { } /** - * Used for following a secondary target such as zora fins or a z-target + * Used for following a secondary target such as zora boomerangs or a z-target */ s32 Camera_KeepOn1(Camera* camera) { Vec3f* eye = &camera->eye; @@ -7450,7 +7449,7 @@ Vec3s Camera_Update(Camera* camera) { bgCamIndex = Camera_GetBgCamIndex(camera, &bgId, sp90); if ((bgCamIndex != -1) && (camera->bgId == BGCHECK_SCENE)) { - if (!Camera_IsUsingZoraFins(camera)) { + if (!func_800CBC00(camera)) { camera->nextCamSceneDataId = bgCamIndex | CAM_DATA_IS_BG; } } diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 5e51a9903c..f431369670 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -846,7 +846,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = { PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_GILDED PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_TWO_HANDED PLAYER_MODELGROUP_DEKU_STICK, // PLAYER_IA_DEKU_STICK - PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_IA_ZORA_FINS + PLAYER_MODELGROUP_ZORA_BOOMERANG, // PLAYER_IA_ZORA_BOOMERANG PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW_FIRE PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW_ICE @@ -1005,7 +1005,7 @@ PlayerModelIndices gPlayerModelTypes[PLAYER_MODELGROUP_MAX] = { /* PLAYER_MODELGROUP_13 */ { PLAYER_ANIMTYPE_DEFAULT, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_15, PLAYER_MODELTYPE_WAIST }, - /* PLAYER_MODELGROUP_ZORA_FINS */ + /* PLAYER_MODELGROUP_ZORA_BOOMERANG */ { PLAYER_ANIMTYPE_DEFAULT, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, PLAYER_MODELTYPE_WAIST }, }; @@ -2402,7 +2402,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** if (player->stateFlags3 & PLAYER_STATE3_2000) { rot->z -= player->unk_B8C; } else if ((sPlayerLeftHandType == PLAYER_MODELTYPE_LH_4) && - (player->stateFlags1 & PLAYER_STATE1_2000000)) { + (player->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) { leftHandDLists = &gPlayerLeftHandOpenDLs[D_801F59E0]; sPlayerLeftHandType = PLAYER_MODELTYPE_LH_OPEN; } else if ((player->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (player->actor.speed > 2.0f) && @@ -2872,16 +2872,16 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { CLOSE_DISPS(play->state.gfxCtx); } else { - Actor* boomerangActor = player->boomerangActor; + Actor* zoraBoomerangActor = player->zoraBoomerangActor; Vec3f sp58; Vec3f sp4C; - if (player->stateFlags1 & PLAYER_STATE1_2000000) { - if (player->boomerangActor == NULL) { + if (player->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) { + if (player->zoraBoomerangActor == NULL) { return; } - if ((player->boomerangActor->params == arg2) || - (((boomerangActor->child != NULL)) && (boomerangActor->child->params == arg2))) { + if ((player->zoraBoomerangActor->params == arg2) || + (((zoraBoomerangActor->child != NULL)) && (zoraBoomerangActor->child->params == arg2))) { return; } } @@ -2902,7 +2902,7 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { func_80124618(D_801C0820, player->skelAnime.curFrame, player->unk_AF0); } else if (player->skelAnime.animation == &gPlayerAnim_pz_jumpATend) { func_80124618(D_801C0838, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->heldItemAction == PLAYER_IA_ZORA_FINS) { + } else if (player->heldItemAction == PLAYER_IA_ZORA_BOOMERANG) { player->unk_AF0[0].x = 1.0f; player->unk_AF0[0].y = 1.0f; player->unk_AF0[0].z = 1.0f; @@ -3619,7 +3619,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G 4000.0f, // PLAYER_MELEEWEAPON_SWORD_GILDED 5500.0f, // PLAYER_MELEEWEAPON_SWORD_TWO_HANDED -1.0f, // PLAYER_MELEEWEAPON_DEKU_STICK - 2500.0f, // PLAYER_MELEEWEAPON_ZORA_FINS + 2500.0f, // PLAYER_MELEEWEAPON_ZORA_BOOMERANG }; if ((player->transformation == PLAYER_FORM_FIERCE_DEITY) || diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 2e944cd58b..342b45f9c9 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -140,26 +140,26 @@ void EnBoom_Init(Actor* thisx, PlayState* play) { void EnBoom_Destroy(Actor* thisx, PlayState* play) { EnBoom* this = THIS; Player* player = GET_PLAYER(play); - Actor* temp; + Actor* otherZoraBoomerangActor; if (player != NULL) { Effect_Destroy(play, this->effectIndex); Collider_DestroyQuad(play, &this->collider); - temp = this->actor.child; - if (temp != NULL) { - temp->parent = NULL; - player->boomerangActor = temp; + otherZoraBoomerangActor = this->actor.child; + if (otherZoraBoomerangActor != NULL) { + otherZoraBoomerangActor->parent = NULL; + player->zoraBoomerangActor = otherZoraBoomerangActor; } else { - temp = this->actor.parent; - if (temp != NULL) { - temp->child = NULL; + otherZoraBoomerangActor = this->actor.parent; + if (otherZoraBoomerangActor != NULL) { + otherZoraBoomerangActor->child = NULL; } else { - player->boomerangActor = NULL; - player->stateFlags1 &= ~PLAYER_STATE1_2000000; + player->zoraBoomerangActor = NULL; + player->stateFlags1 &= ~PLAYER_STATE1_ZORA_BOOMERANG_THROWN; } } - player->stateFlags3 |= PLAYER_STATE3_800000; + player->stateFlags3 |= PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT; } } diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index 8d36693019..d3ca6402dd 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -580,7 +580,7 @@ void func_80B97708(EnZot* this, PlayState* play) { return; } - if (!(player->stateFlags1 & PLAYER_STATE1_2000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) { phi_v1 = func_80B96CE4(this); } else { phi_v1 = 0; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 474c4513f7..41082006b9 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -2064,8 +2064,8 @@ void Player_Anim_PlayOnceWaterAdjustment(PlayState* play, Player* this, PlayerAn PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, sWaterSpeedFactor); } -s32 func_8082ECCC(Player* this) { - return this->stateFlags1 & PLAYER_STATE1_1000000; +s32 Player_IsUsingZoraBoomerang(Player* this) { + return this->stateFlags1 & PLAYER_STATE1_USING_ZORA_BOOMERANG; } #define CHEST_ANIM_SHORT 0 @@ -2840,7 +2840,7 @@ PlayerAnimationHeader* func_8082EEE0(Player* this) { } bool func_8082EF20(Player* this) { - return func_8082ECCC(this) && (this->unk_ACC != 0); + return Player_IsUsingZoraBoomerang(this) && (this->unk_ACC != 0); } PlayerAnimationHeader* func_8082EF54(Player* this) { @@ -3008,7 +3008,7 @@ void Player_InitItemActionWithAnim(PlayState* play, Player* this, PlayerItemActi PlayerAnimationHeader*(*iter)[PLAYER_ANIMTYPE_MAX] = (void*)&D_8085BE84[0][this->modelAnimType]; s32 animGroup; - this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_1000000); + this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_USING_ZORA_BOOMERANG); for (animGroup = 0; animGroup < PLAYER_ANIMGROUP_MAX; animGroup++) { if (curAnim == **iter) { @@ -3116,7 +3116,7 @@ PlayerItemAction Player_ItemToItemAction(Player* this, ItemId item) { } else if (item == ITEM_FISHING_ROD) { return PLAYER_IA_FISHING_ROD; } else if ((item == ITEM_SWORD_KOKIRI) && (this->transformation == PLAYER_FORM_ZORA)) { - return PLAYER_IA_ZORA_FINS; + return PLAYER_IA_ZORA_BOOMERANG; } else { return sItemItemActions[item]; } @@ -3131,7 +3131,7 @@ PlayerUpperActionFunc sPlayerUpperActionUpdateFuncs[PLAYER_IA_MAX] = { Player_UpperAction_1, // PLAYER_IA_SWORD_GILDED Player_UpperAction_1, // PLAYER_IA_SWORD_TWO_HANDED Player_UpperAction_0, // PLAYER_IA_DEKU_STICK - Player_UpperAction_0, // PLAYER_IA_ZORA_FINS + Player_UpperAction_0, // PLAYER_IA_ZORA_BOOMERANG Player_UpperAction_6, // PLAYER_IA_BOW Player_UpperAction_6, // PLAYER_IA_BOW_FIRE Player_UpperAction_6, // PLAYER_IA_BOW_ICE @@ -3219,7 +3219,7 @@ PlayerInitItemActionFunc sPlayerItemActionInitFuncs[PLAYER_IA_MAX] = { Player_InitItemAction_DoNothing, // PLAYER_IA_SWORD_GILDED Player_InitItemAction_DoNothing, // PLAYER_IA_SWORD_TWO_HANDED Player_InitItemAction_DekuStick, // PLAYER_IA_DEKU_STICK - Player_InitItemAction_5, // PLAYER_IA_ZORA_FINS + Player_InitItemAction_5, // PLAYER_IA_ZORA_BOOMERANG Player_InitItemAction_2, // PLAYER_IA_BOW Player_InitItemAction_2, // PLAYER_IA_BOW_FIRE Player_InitItemAction_2, // PLAYER_IA_BOW_ICE @@ -3481,14 +3481,14 @@ void Player_InitItemAction_SpawnHookshot(PlayState* play, Player* this) { } void Player_InitItemAction_5(PlayState* play, Player* this) { - this->stateFlags1 |= PLAYER_STATE1_1000000; + this->stateFlags1 |= PLAYER_STATE1_USING_ZORA_BOOMERANG; } void Player_InitItemAction(PlayState* play, Player* this, PlayerItemAction itemAction) { this->itemAction = this->heldItemAction = itemAction; this->modelGroup = this->nextModelGroup; - this->stateFlags1 &= ~(PLAYER_STATE1_1000000 | PLAYER_STATE1_8); + this->stateFlags1 &= ~(PLAYER_STATE1_USING_ZORA_BOOMERANG | PLAYER_STATE1_8); this->unk_B08 = 0.0f; this->unk_B0C = 0.0f; @@ -3918,7 +3918,7 @@ void Player_StartChangingHeldItem(Player* this, PlayState* play) { nextModelAnimType = gPlayerModelTypes[this->nextModelGroup].modelAnimType; itemChangeType = sPlayerItemChangeTypes[gPlayerModelTypes[this->modelGroup].modelAnimType][nextModelAnimType]; - if ((heldItemAction == PLAYER_IA_ZORA_FINS) || (this->heldItemAction == PLAYER_IA_ZORA_FINS)) { + if ((heldItemAction == PLAYER_IA_ZORA_BOOMERANG) || (this->heldItemAction == PLAYER_IA_ZORA_BOOMERANG)) { itemChangeType = (heldItemAction == PLAYER_IA_NONE) ? -PLAYER_ITEM_CHG_14 : PLAYER_ITEM_CHG_14; } else if ((heldItemAction == PLAYER_IA_BOTTLE_EMPTY) || (heldItemAction == PLAYER_IA_11) || ((heldItemAction == PLAYER_IA_NONE) && @@ -4162,7 +4162,7 @@ s32 func_80830B88(PlayState* play, Player* this) { if ((this->transformation == PLAYER_FORM_FIERCE_DEITY) || (!Player_IsGoronOrDeku(this) && ((((this->transformation == PLAYER_FORM_ZORA)) && - !(this->stateFlags1 & PLAYER_STATE1_2000000)) || + !(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) || ((this->transformation == PLAYER_FORM_HUMAN) && (this->currentShield != PLAYER_SHIELD_NONE))) && Player_IsZTargeting(this))) { @@ -4272,7 +4272,7 @@ bool func_80831010(Player* this, PlayState* play) { } bool func_80831094(Player* this, PlayState* play) { - if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & PLAYER_STATE1_2000000)) { + if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) { if (sPlayerUseHeldItem || func_80830F9C(play)) { if (func_80830E30(this, play)) { return func_80831010(this, play); @@ -4967,9 +4967,9 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) { isTalking = Player_IsTalking(play); if (isTalking || (this->zTargetActiveTimer != 0) || - (this->stateFlags1 & (PLAYER_STATE1_1000 | PLAYER_STATE1_2000000))) { + (this->stateFlags1 & (PLAYER_STATE1_1000 | PLAYER_STATE1_ZORA_BOOMERANG_THROWN))) { if (!isTalking) { - if (!(this->stateFlags1 & PLAYER_STATE1_2000000) && + if (!(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) && ((this->heldItemAction != PLAYER_IA_FISHING_ROD) || (this->unk_B28 == 0)) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_Z)) { @@ -5638,7 +5638,7 @@ MeleeWeaponDamageInfo D_8085D09C[PLAYER_MELEEWEAPON_MAX] = { { DMG_SWORD, 4, 8, 3, 6 }, // PLAYER_MELEEWEAPON_SWORD_GILDED { DMG_SWORD, 4, 8, 4, 8 }, // PLAYER_MELEEWEAPON_SWORD_TWO_HANDED { DMG_DEKU_STICK, 0, 0, 2, 4 }, // PLAYER_MELEEWEAPON_DEKU_STICK - { DMG_ZORA_PUNCH, 1, 2, 0, 0 }, // PLAYER_MELEEWEAPON_ZORA_FINS + { DMG_ZORA_PUNCH, 1, 2, 0, 0 }, // PLAYER_MELEEWEAPON_ZORA_BOOMERANG }; // New function in NE0: split out of func_80833864 to be able to call it to patch Power Crouch Stab. @@ -7711,7 +7711,7 @@ u8 D_8085D1A4[PLAYER_IA_MAX] = { GI_SWORD_GILDED, // PLAYER_IA_SWORD_GILDED GI_SWORD_GREAT_FAIRY, // PLAYER_IA_SWORD_TWO_HANDED GI_DEKU_STICKS_1, // PLAYER_IA_DEKU_STICK - GI_SWORD_KOKIRI, // PLAYER_IA_ZORA_FINS + GI_SWORD_KOKIRI, // PLAYER_IA_ZORA_BOOMERANG GI_QUIVER_30, // PLAYER_IA_BOW GI_ARROW_FIRE, // PLAYER_IA_BOW_FIRE GI_ARROW_ICE, // PLAYER_IA_BOW_ICE @@ -8128,7 +8128,7 @@ s32 func_808396B8(PlayState* play, Player* this) { (((this->actor.id != ACTOR_PLAYER) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) || ((Player_GetMeleeWeaponHeld(this) != PLAYER_MELEEWEAPON_NONE) && ((this->transformation != PLAYER_FORM_GORON) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) && - ((this->transformation != PLAYER_FORM_ZORA) || !(this->stateFlags1 & PLAYER_STATE1_2000000)) && + ((this->transformation != PLAYER_FORM_ZORA) || !(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) && sPlayerUseHeldItem))) { return true; } @@ -8373,7 +8373,8 @@ s32 Player_ActionHandler_11(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_R) && (this->unk_AA5 == PLAYER_UNKAA5_0) && (play->bButtonAmmoPlusOne == 0)) { if (Player_IsGoronOrDeku(this) || - ((((this->transformation == PLAYER_FORM_ZORA) && !(this->stateFlags1 & PLAYER_STATE1_2000000)) || + ((((this->transformation == PLAYER_FORM_ZORA) && + !(this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN)) || ((this->transformation == PLAYER_FORM_HUMAN) && (this->currentShield != PLAYER_SHIELD_NONE))) && !Player_FriendlyLockOnOrParallel(this) && (this->focusActor == NULL))) { func_8082DC38(this); @@ -11111,13 +11112,14 @@ void Player_Init(Actor* thisx, PlayState* play) { this->unk_B92 = 0; this->unk_B94 = 0; this->unk_B96 = 0; - this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_1000 | PLAYER_STATE1_1000000 | PLAYER_STATE1_2000000); + this->stateFlags1 &= ~(PLAYER_STATE1_8 | PLAYER_STATE1_1000 | PLAYER_STATE1_USING_ZORA_BOOMERANG | + PLAYER_STATE1_ZORA_BOOMERANG_THROWN); this->stateFlags2 &= ~(PLAYER_STATE2_20000 | PLAYER_STATE2_1000000 | PLAYER_STATE2_40000000); this->stateFlags3 &= ~(PLAYER_STATE3_8 | PLAYER_STATE3_40 | PLAYER_STATE3_80 | PLAYER_STATE3_100 | PLAYER_STATE3_200 | PLAYER_STATE3_800 | PLAYER_STATE3_1000 | PLAYER_STATE3_2000 | PLAYER_STATE3_8000 | PLAYER_STATE3_10000 | PLAYER_STATE3_40000 | PLAYER_STATE3_80000 | PLAYER_STATE3_100000 | PLAYER_STATE3_200000 | - PLAYER_STATE3_800000 | PLAYER_STATE3_1000000 | PLAYER_STATE3_2000000); + PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT | PLAYER_STATE3_1000000 | PLAYER_STATE3_2000000); this->unk_B08 = 0.0f; this->unk_B0C = 0.0f; } @@ -11938,7 +11940,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) { camMode = CAM_MODE_TALK; } else if (this->stateFlags1 & PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS) { - if (this->stateFlags1 & PLAYER_STATE1_2000000) { + if (this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) { camMode = CAM_MODE_FOLLOWBOOMERANG; } else { camMode = CAM_MODE_FOLLOWTARGET; @@ -11951,9 +11953,9 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { camMode = CAM_MODE_CHARGE; } else if (this->stateFlags3 & PLAYER_STATE3_100) { camMode = CAM_MODE_DEKUHIDE; - } else if (this->stateFlags1 & PLAYER_STATE1_2000000) { + } else if (this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) { camMode = CAM_MODE_FOLLOWBOOMERANG; - Camera_SetViewParam(camera, CAM_VIEW_TARGET, this->boomerangActor); + Camera_SetViewParam(camera, CAM_VIEW_TARGET, this->zoraBoomerangActor); } else if (this->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000)) { if (Player_FriendlyLockOnOrParallel(this)) { camMode = CAM_MODE_HANGZ; @@ -13966,7 +13968,7 @@ s32 Player_UpperAction_11(Player* this, PlayState* play) { return true; } - if (this->stateFlags1 & PLAYER_STATE1_2000000) { + if (this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) { Player_SetUpperAction(play, this, Player_UpperAction_15); } else if (func_80831094(this, play)) { return true; @@ -14008,41 +14010,42 @@ s32 Player_UpperAction_14(Player* this, PlayState* play) { pos.y = this->actor.world.pos.y + 50.0f; untargetedRotY = this->actor.shape.rot.y - 0x190; - this->boomerangActor = Actor_Spawn( + this->zoraBoomerangActor = Actor_Spawn( &play->actorCtx, play, ACTOR_EN_BOOM, pos.x, pos.y, pos.z, this->actor.focus.rot.x, (this->focusActor != NULL) ? this->actor.shape.rot.y + 0x36B0 : untargetedRotY, 0, ZORA_BOOMERANG_LEFT); - if (this->boomerangActor != NULL) { - EnBoom* leftBoomerang = (EnBoom*)this->boomerangActor; - EnBoom* rightBoomerang; + if (this->zoraBoomerangActor != NULL) { + EnBoom* leftZoraBoomerang = (EnBoom*)this->zoraBoomerangActor; + EnBoom* rightZoraBoomerang; - leftBoomerang->moveTo = this->focusActor; - if (leftBoomerang->moveTo != NULL) { - leftBoomerang->unk_1CF = 0x10; + leftZoraBoomerang->moveTo = this->focusActor; + if (leftZoraBoomerang->moveTo != NULL) { + leftZoraBoomerang->unk_1CF = 0x10; } - leftBoomerang->unk_1CC = leftBoomerang->unk_1CF + 0x24; + leftZoraBoomerang->unk_1CC = leftZoraBoomerang->unk_1CF + 0x24; func_80835BF8(&this->bodyPartsPos[PLAYER_BODYPART_RIGHT_HAND], this->actor.shape.rot.y, 0.0f, &pos); untargetedRotY = (this->actor.shape.rot.y + 0x190); - rightBoomerang = + rightZoraBoomerang = (EnBoom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOOM, pos.x, pos.y, pos.z, this->actor.focus.rot.x, (this->focusActor != NULL) ? this->actor.shape.rot.y - 0x36B0 : untargetedRotY, 0, ZORA_BOOMERANG_RIGHT); - if (rightBoomerang != NULL) { - rightBoomerang->moveTo = this->focusActor; - if (rightBoomerang->moveTo != NULL) { - rightBoomerang->unk_1CF = 0x10; + if (rightZoraBoomerang != NULL) { + rightZoraBoomerang->moveTo = this->focusActor; + if (rightZoraBoomerang->moveTo != NULL) { + rightZoraBoomerang->unk_1CF = 0x10; } - rightBoomerang->unk_1CC = rightBoomerang->unk_1CF + 0x24; - leftBoomerang->actor.child = &rightBoomerang->actor; - rightBoomerang->actor.parent = &leftBoomerang->actor; + rightZoraBoomerang->unk_1CC = rightZoraBoomerang->unk_1CF + 0x24; + leftZoraBoomerang->actor.child = &rightZoraBoomerang->actor; + rightZoraBoomerang->actor.parent = &leftZoraBoomerang->actor; } - this->stateFlags1 |= PLAYER_STATE1_2000000; - this->stateFlags3 &= ~PLAYER_STATE3_800000; + this->stateFlags1 |= PLAYER_STATE1_ZORA_BOOMERANG_THROWN; + this->stateFlags3 &= ~PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT; + if (!Player_CheckHostileLockOn(this)) { Player_SetParallel(this); } @@ -14062,10 +14065,10 @@ s32 Player_UpperAction_15(Player* this, PlayState* play) { return true; } - if (this->stateFlags3 & PLAYER_STATE3_800000) { + if (this->stateFlags3 & PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT) { Player_SetUpperAction(play, this, Player_UpperAction_16); PlayerAnimation_PlayOnce(play, &this->skelAnimeUpper, &gPlayerAnim_pz_cuttercatch); - this->stateFlags3 &= ~PLAYER_STATE3_800000; + this->stateFlags3 &= ~PLAYER_STATE3_ZORA_BOOMERANG_CAUGHT; Player_PlaySfx(this, NA_SE_PL_CATCH_BOOMERANG); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_SWORD_N); return true; @@ -14076,7 +14079,7 @@ s32 Player_UpperAction_15(Player* this, PlayState* play) { s32 Player_UpperAction_16(Player* this, PlayState* play) { if (!Player_UpperAction_11(this, play) && PlayerAnimation_Update(play, &this->skelAnimeUpper)) { - if (this->stateFlags1 & PLAYER_STATE1_2000000) { + if (this->stateFlags1 & PLAYER_STATE1_ZORA_BOOMERANG_THROWN) { Player_SetUpperAction(play, this, Player_UpperAction_15); this->unk_ACC = 0; } else { @@ -15961,7 +15964,7 @@ void Player_Action_43(Player* this, PlayState* play) { } if (this->unk_AA5 == PLAYER_UNKAA5_3) { - if (func_800B7118(this) || func_8082ECCC(this)) { + if (func_800B7118(this) || Player_IsUsingZoraBoomerang(this)) { Player_UpdateUpperBody(this, play); } } @@ -18905,7 +18908,7 @@ void Player_Action_93(Player* this, PlayState* play) { this->actor.world.pos.y += temp_fv0_2 * this->actor.scale.y; func_80834DB8(this, &gPlayerAnim_pn_kakku, speed, play); Player_SetAction(play, this, Player_Action_94, 1); - this->boomerangActor = NULL; + this->zoraBoomerangActor = NULL; this->stateFlags3 |= PLAYER_STATE3_200; if (sp38 != 0) { @@ -19001,8 +19004,8 @@ Vec3f D_8085D96C = { 30.0f, 50.0f, 0.0f }; // Flying as Deku? void Player_Action_94(Player* this, PlayState* play) { - if ((this->boomerangActor != NULL) && (this->boomerangActor->update == NULL)) { - this->boomerangActor = NULL; + if ((this->zoraBoomerangActor != NULL) && (this->zoraBoomerangActor->update == NULL)) { + this->zoraBoomerangActor = NULL; } if (Player_ActionHandler_13(this, play)) { @@ -19129,19 +19132,19 @@ void Player_Action_94(Player* this, PlayState* play) { } Audio_PlaySfx_AtPosWithTimer(&this->actor.projectedPos, 0x1851, 2.0f * (this->unk_B86[1] * (1.0f / 6000.0f))); - if ((this->boomerangActor == NULL) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) { + if ((this->zoraBoomerangActor == NULL) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) { if (AMMO(ITEM_DEKU_NUT) == 0) { Audio_PlaySfx(NA_SE_SY_ERROR); } else { - this->boomerangActor = + this->zoraBoomerangActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ARROW, this->bodyPartsPos[PLAYER_BODYPART_WAIST].x, this->bodyPartsPos[PLAYER_BODYPART_WAIST].y, this->bodyPartsPos[PLAYER_BODYPART_WAIST].z, -1, 0, 0, ARROW_TYPE_DEKU_NUT); - if (this->boomerangActor != NULL) { - this->boomerangActor->velocity.x = this->actor.velocity.x * 1.5f; - this->boomerangActor->velocity.z = this->actor.velocity.z * 1.5f; + if (this->zoraBoomerangActor != NULL) { + this->zoraBoomerangActor->velocity.x = this->actor.velocity.x * 1.5f; + this->zoraBoomerangActor->velocity.z = this->actor.velocity.z * 1.5f; Inventory_ChangeAmmo(ITEM_DEKU_NUT, -1); - Actor_PlaySfx(this->boomerangActor, NA_SE_PL_DEKUNUTS_DROP_BOMB); + Actor_PlaySfx(this->zoraBoomerangActor, NA_SE_PL_DEKUNUTS_DROP_BOMB); } } } @@ -20360,7 +20363,7 @@ void Player_CsAction_5(PlayState* play, Player* this, CsCmdActorCue* cue) { f32 linearVelocity; s16 yaw; - this->stateFlags1 &= ~PLAYER_STATE1_2000000; + this->stateFlags1 &= ~PLAYER_STATE1_ZORA_BOOMERANG_THROWN; yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_3A0); linearVelocity = this->speedXZ; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index ebf96434ac..b9a7eca951 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1143,7 +1143,7 @@ 0x800CBAD4:("Camera_GetFocalActorPos",), 0x800CBB58:("Camera_IsUnderwaterAsZora",), 0x800CBB88:("func_800CBB88",), - 0x800CBC00:("Camera_IsUsingZoraFins",), + 0x800CBC00:("func_800CBC00",), 0x800CBC30:("func_800CBC30",), 0x800CBC84:("func_800CBC84",), 0x800CBFA4:("func_800CBFA4",), @@ -4298,7 +4298,7 @@ 0x8082EB18:("Player_AnimReplace_PlayLoopNormalAdjusted",), 0x8082EB38:("Player_ProcessControlStick",), 0x8082EC9C:("Player_Anim_PlayOnceWaterAdjustment",), - 0x8082ECCC:("func_8082ECCC",), + 0x8082ECCC:("Player_IsUsingZoraBoomerang",), 0x8082ECE0:("func_8082ECE0",), 0x8082ED20:("Player_GetIdleAnim",), 0x8082ED94:("Player_CheckForIdleAnim",), diff --git a/tools/overlayhelpers/mscriptdis.py b/tools/overlayhelpers/mscriptdis.py index c8f6321002..d82ccf7670 100644 --- a/tools/overlayhelpers/mscriptdis.py +++ b/tools/overlayhelpers/mscriptdis.py @@ -1309,7 +1309,7 @@ item_action_names = ( "PLAYER_IA_SWORD_GILDED", "PLAYER_IA_SWORD_TWO_HANDED", "PLAYER_IA_DEKU_STICK", - "PLAYER_IA_ZORA_FINS", + "PLAYER_IA_ZORA_BOOMERANG", "PLAYER_IA_BOW", "PLAYER_IA_BOW_FIRE", "PLAYER_IA_BOW_ICE", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 2c6503463b..2ba310d311 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -657,7 +657,7 @@ asm/non_matchings/code/z_camera/func_800CBAAC.s,func_800CBAAC,0x800CBAAC,0xA asm/non_matchings/code/z_camera/Camera_GetFocalActorPos.s,Camera_GetFocalActorPos,0x800CBAD4,0x21 asm/non_matchings/code/z_camera/Camera_IsUnderwaterAsZora.s,Camera_IsUnderwaterAsZora,0x800CBB58,0xC asm/non_matchings/code/z_camera/func_800CBB88.s,func_800CBB88,0x800CBB88,0x1E -asm/non_matchings/code/z_camera/Camera_IsUsingZoraFins.s,Camera_IsUsingZoraFins,0x800CBC00,0xC +asm/non_matchings/code/z_camera/func_800CBC00.s,func_800CBC00,0x800CBC00,0xC asm/non_matchings/code/z_camera/func_800CBC30.s,func_800CBC30,0x800CBC30,0x15 asm/non_matchings/code/z_camera/func_800CBC84.s,func_800CBC84,0x800CBC84,0xC8 asm/non_matchings/code/z_camera/func_800CBFA4.s,func_800CBFA4,0x800CBFA4,0x17