diff --git a/include/player.h b/include/player.h index b35d8a63..eed2465d 100644 --- a/include/player.h +++ b/include/player.h @@ -424,7 +424,8 @@ typedef struct { /*0x1c*/ u8 field_0x1c; /*0x1d*/ u8 gustJarSpeed; /*0x1e*/ u8 dash_state; - /*0x1f*/ u8 field_0x1f[3]; + /*0x1f*/ u8 field_0x1f[2]; + /*0x21*/ u8 bow_state; /*0x22*/ u16 tilePosition; /*0x24*/ u16 tileType; /*0x26*/ u8 swim_state; /**< Is the player swimming? 0x80 for diving */ diff --git a/src/item/itemBow.c b/src/item/itemBow.c index 7714734f..a98825d1 100644 --- a/src/item/itemBow.c +++ b/src/item/itemBow.c @@ -22,14 +22,14 @@ void sub_08075DF4(ItemBehavior* this, u32 index) { sub_0806F948(&gPlayerEntity); sub_08077BB8(this); sub_08077D38(this, index); - gPlayerState.field_0x1f[2] = 1; + gPlayerState.bow_state = 1; } else { DeleteItemBehavior(this, index); } } void sub_08075E40(ItemBehavior* this, u32 index) { - if (gPlayerState.field_0x1f[2] != 0) { + if (gPlayerState.bow_state != 0) { if ((gPlayerState.attack_status & 0x80) == 0) { UpdateItemAnim(this); if ((this->playerFrame & 0x80) != 0) { @@ -43,7 +43,7 @@ void sub_08075E40(ItemBehavior* this, u32 index) { return; } } - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; DeleteItemBehavior(this, index); } @@ -54,8 +54,8 @@ void sub_08075EC0(ItemBehavior* this, u32 index) { arrowCount = gSave.stats.arrowCount; iVar2 = IsItemActive(this); if (iVar2 != 0 && arrowCount != 0) { - if (((gPlayerState.attack_status & 0x80) != 0) || (gPlayerState.field_0x1f[2] == 0)) { - gPlayerState.field_0x1f[2] = 0; + if (((gPlayerState.attack_status & 0x80) != 0) || (gPlayerState.bow_state == 0)) { + gPlayerState.bow_state = 0; DeleteItemBehavior(this, index); } } else { @@ -68,19 +68,19 @@ void sub_08075EC0(ItemBehavior* this, u32 index) { } void sub_08075F38(ItemBehavior* this, u32 index) { - if (((gPlayerState.attack_status & 0x80) == 0) && (gPlayerState.field_0x1f[2] != 0)) { + if (((gPlayerState.attack_status & 0x80) == 0) && (gPlayerState.bow_state != 0)) { UpdateItemAnim(this); if ((this->playerFrame & 1) != 0) { this->stateID = 4; } } else { - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; DeleteItemBehavior(this, index); } } void sub_08075F84(ItemBehavior* this, u32 index) { - if (((gPlayerState.attack_status & 0x80) == 0) && (gPlayerState.field_0x1f[2] != 0)) { + if (((gPlayerState.attack_status & 0x80) == 0) && (gPlayerState.bow_state != 0)) { if (GetInventoryValue(ITEM_ARROW_BUTTERFLY) == 1) { sub_08077E3C(this, 5); } else { @@ -90,6 +90,6 @@ void sub_08075F84(ItemBehavior* this, u32 index) { return; } } - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; DeleteItemBehavior(this, index); } diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c index e6862802..fc076799 100644 --- a/src/item/itemPegasusBoots.c +++ b/src/item/itemPegasusBoots.c @@ -67,7 +67,7 @@ void sub_080768F8(ItemBehavior* this, u32 index) { bVar1 |= bVar2; if (bVar1 == 0) { gPlayerState.dash_state = 1; - gPlayerState.field_0x1f[2] = bVar1; + gPlayerState.bow_state = bVar1; if ((gPlayerState.flags & PL_MINISH) == 0) { this->timer = 0x10; } else { diff --git a/src/object/swordParticle.c b/src/object/swordParticle.c index a2fc8110..63415fb6 100644 --- a/src/object/swordParticle.c +++ b/src/object/swordParticle.c @@ -69,15 +69,15 @@ void SwordParticle_Action1(SwordParticleEntity* this) { u32 tmp2; if (super->type2 != 0) { - if ((gPlayerState.field_0x1f[2] == 0) || ((gPlayerState.attack_status & 0x80) != 0)) { + if ((gPlayerState.bow_state == 0) || ((gPlayerState.attack_status & 0x80) != 0)) { DeleteThisEntity(); } - if (gPlayerState.field_0x1f[2] >= 0x50) { + if (gPlayerState.bow_state >= 0x50) { super->spriteSettings.draw = 1; - tmp1 = gPlayerState.field_0x1f[2]; + tmp1 = gPlayerState.bow_state; ptr = gUnk_081217D8; } else { - if (gPlayerState.field_0x1f[2] != 0) { + if (gPlayerState.bow_state != 0) { super->spriteSettings.draw = 0; return; } diff --git a/src/player.c b/src/player.c index 397b4857..baaca605 100644 --- a/src/player.c +++ b/src/player.c @@ -418,7 +418,7 @@ static void PlayerNormal(Entity* this) { return; } if (!gPlayerState.swim_state && (gPlayerState.jump_status & 0xC0) == 0) { - if (gPlayerState.shield_status || gPlayerState.field_0x1f[2]) { + if (gPlayerState.shield_status || gPlayerState.bow_state) { this->speed = SHIELDING_SPEED; } else { if (gPlayerState.sword_state) { diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index dc53f306..061e0a69 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -210,16 +210,16 @@ void PlayerItemBow_Action1(PlayerItemBowEntity* this) { } } else { - if ((PlayerItemBowEntity*)gPlayerState.item != this || (gPlayerState.field_0x1f[2] == 0)) { + if ((PlayerItemBowEntity*)gPlayerState.item != this || (gPlayerState.bow_state == 0)) { if ((PlayerItemBowEntity*)gPlayerState.item == this) { gPlayerState.item = 0; } - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; DeleteThisEntity(); } - if ((this->unk_68 == 0xa) && (gPlayerState.field_0x1f[2] != 0)) { - if (gPlayerState.field_0x1f[2] < 0x78) { - gPlayerState.field_0x1f[2]++; + if ((this->unk_68 == 0xa) && (gPlayerState.bow_state != 0)) { + if (gPlayerState.bow_state < 0x78) { + gPlayerState.bow_state++; } else { super->hurtType = 0x0e; } diff --git a/src/playerUtils.c b/src/playerUtils.c index 2ea00c46..f88af901 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -378,7 +378,7 @@ void ResetActiveItems() { gPlayerState.moleMittsState = 0; gPlayerState.field_0x1c = 0; - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; gPlayerState.grab_status = 0; gPlayerState.itemAnimPriority = 0; gPlayerState.dash_state = 0; @@ -1363,7 +1363,7 @@ void ClearPlayerState(void) { gPlayerState.dash_state = 0; gPlayerState.field_0x1f[0] = 0; gPlayerState.field_0x1f[1] = 0; - gPlayerState.field_0x1f[2] = 0; + gPlayerState.bow_state = 0; gPlayerState.tilePosition = 0; gPlayerState.tileType = 0; gPlayerState.swim_state = 0; @@ -1868,7 +1868,7 @@ void sub_080797EC(void) { animation = ANIM_CARRY_NOCAP; } else if (gPlayerState.shield_status != 0) { animation = ANIM_SHIELD_NOCAP; - } else if (gPlayerState.field_0x1f[2] == 0) { + } else if (gPlayerState.bow_state == 0) { if (gPlayerState.swim_state != 0) { animation = ANIM_SWIM; } else { @@ -1905,7 +1905,7 @@ void sub_080797EC(void) { animation = ANIM_MINECART; } else if (gPlayerState.shield_status != 0) { animation = ANIM_SHIELD; - } else if (gPlayerState.field_0x1f[2] != 0) { + } else if (gPlayerState.bow_state != 0) { animation = ANIM_BOW; } else { if (gPlayerState.swim_state != 0) { @@ -1958,7 +1958,7 @@ void ResolvePlayerAnimation(void) { anim = ANIM_JUMP; } else if (gPlayerState.shield_status != 0) { anim = ANIM_SHIELD_END_NOCAP; - } else if (gPlayerState.field_0x1f[2] != 0) { + } else if (gPlayerState.bow_state != 0) { anim = ANIM_BOW_END; } else if (gPlayerState.swim_state != 0) { anim = ANIM_SWIM_END; @@ -2007,7 +2007,7 @@ void ResolvePlayerAnimation(void) { anim = ANIM_MINECART_END; } else if (gPlayerState.shield_status != 0) { anim = ANIM_SHIELD_END; - } else if (gPlayerState.field_0x1f[2] != 0) { + } else if (gPlayerState.bow_state != 0) { anim = ANIM_BOW_END; } else if (gPlayerState.swim_state != 0) { anim = ANIM_SWIM_END;