mirror of https://github.com/zeldaret/tmc.git
added bow_state :)
This commit is contained in:
parent
ab3e4ef0f4
commit
4c37e6cf5e
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue