summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2024-11-18 11:37:11 +1100
committerEblo <7004497+Eblo@users.noreply.github.com>2025-09-16 13:48:20 -0400
commit88966a5e9610320c840fad9a9a0339be35146665 (patch)
treef7a0b3e858ad01ad03765bcf061702dba2fa946b
parent82a315a30b03ba56778c4065cfd92083e24cd992 (diff)
Player Docs: Zora Boomerang (#1739)
* zora boomerang * missed some * more docs * cleanup docs * more cleanup * Player_IsUsingZoraBoomerang
-rw-r--r--mm/include/z64player.h20
-rw-r--r--mm/src/code/z_camera.c7
-rw-r--r--mm/src/code/z_player_lib.c20
-rw-r--r--mm/src/overlays/actors/ovl_En_Boom/z_en_boom.c22
-rw-r--r--mm/src/overlays/actors/ovl_En_Zot/z_en_zot.c2
-rw-r--r--mm/src/overlays/actors/ovl_player_actor/z_player.c115
6 files changed, 94 insertions, 92 deletions
diff --git a/mm/include/z64player.h b/mm/include/z64player.h
index 52f08ce21..ecc577a8a 100644
--- a/mm/include/z64player.h
+++ b/mm/include/z64player.h
@@ -84,7 +84,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,
@@ -188,7 +188,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;
@@ -447,7 +447,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;
@@ -920,10 +920,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?
@@ -1050,8 +1050,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)
//
@@ -1218,7 +1218,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/mm/src/code/z_camera.c b/mm/src/code/z_camera.c
index 21c9be996..abb60e175 100644
--- a/mm/src/code/z_camera.c
+++ b/mm/src/code/z_camera.c
@@ -424,7 +424,6 @@ s32 func_800CB950(Camera* camera) {
player = (Player*)camera->focalActor;
if (!ret) {
- // Using zora fins
ret = player->stateFlags1 & PLAYER_STATE1_200000;
ret = !!ret;
}
@@ -526,7 +525,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) {
@@ -3905,7 +3904,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;
@@ -7475,7 +7474,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/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c
index e5c491cb8..8edb84f85 100644
--- a/mm/src/code/z_player_lib.c
+++ b/mm/src/code/z_player_lib.c
@@ -896,7 +896,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
@@ -1055,7 +1055,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 },
};
@@ -2548,7 +2548,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) &&
@@ -3023,16 +3023,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;
}
}
@@ -3053,7 +3053,7 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) {
func_80124618(D_801C0820, player->skelAnime.curFrame, player->unk_AF0);
} else if (BEN_ANIM_EQUAL(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;
@@ -3776,7 +3776,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/mm/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/mm/src/overlays/actors/ovl_En_Boom/z_en_boom.c
index da3f5484c..83b1d8c55 100644
--- a/mm/src/overlays/actors/ovl_En_Boom/z_en_boom.c
+++ b/mm/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/mm/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/mm/src/overlays/actors/ovl_En_Zot/z_en_zot.c
index 23d7ea560..5219bfa80 100644
--- a/mm/src/overlays/actors/ovl_En_Zot/z_en_zot.c
+++ b/mm/src/overlays/actors/ovl_En_Zot/z_en_zot.c
@@ -579,7 +579,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/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c
index 873eec534..0cc2fb97e 100644
--- a/mm/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c
@@ -2067,8 +2067,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
@@ -2848,7 +2848,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) {
@@ -3016,7 +3016,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 (BEN_ANIM_EQUAL(curAnim, **iter)) {
@@ -3124,7 +3124,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];
}
@@ -3139,7 +3139,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
@@ -3227,7 +3227,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
@@ -3489,14 +3489,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;
@@ -4017,7 +4017,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) &&
@@ -4268,7 +4268,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))) {
@@ -4378,7 +4378,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);
@@ -5086,9 +5086,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)) {
@@ -5759,7 +5759,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.
@@ -7838,7 +7838,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
@@ -8259,7 +8259,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;
}
@@ -8506,7 +8506,8 @@ s32 Player_ActionHandler_11(Player* this, PlayState* play) {
if (GameInteractor_Should(VB_SHIELD_FROM_BUTTON_HOLD, 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);
@@ -11270,13 +11271,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;
}
@@ -12105,7 +12107,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;
@@ -12118,9 +12120,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;
@@ -14351,7 +14353,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;
@@ -14393,41 +14395,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);
}
@@ -14447,10 +14450,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;
@@ -14461,7 +14464,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 {
@@ -16359,7 +16362,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);
}
}
@@ -19364,7 +19367,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) {
@@ -19460,8 +19463,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)) {
@@ -19588,19 +19591,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);
}
}
}
@@ -20824,7 +20827,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;