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;
|
/*0x1c*/ u8 field_0x1c;
|
||||||
/*0x1d*/ u8 gustJarSpeed;
|
/*0x1d*/ u8 gustJarSpeed;
|
||||||
/*0x1e*/ u8 dash_state;
|
/*0x1e*/ u8 dash_state;
|
||||||
/*0x1f*/ u8 field_0x1f[3];
|
/*0x1f*/ u8 field_0x1f[2];
|
||||||
|
/*0x21*/ u8 bow_state;
|
||||||
/*0x22*/ u16 tilePosition;
|
/*0x22*/ u16 tilePosition;
|
||||||
/*0x24*/ u16 tileType;
|
/*0x24*/ u16 tileType;
|
||||||
/*0x26*/ u8 swim_state; /**< Is the player swimming? 0x80 for diving */
|
/*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_0806F948(&gPlayerEntity);
|
||||||
sub_08077BB8(this);
|
sub_08077BB8(this);
|
||||||
sub_08077D38(this, index);
|
sub_08077D38(this, index);
|
||||||
gPlayerState.field_0x1f[2] = 1;
|
gPlayerState.bow_state = 1;
|
||||||
} else {
|
} else {
|
||||||
DeleteItemBehavior(this, index);
|
DeleteItemBehavior(this, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08075E40(ItemBehavior* this, u32 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) {
|
if ((gPlayerState.attack_status & 0x80) == 0) {
|
||||||
UpdateItemAnim(this);
|
UpdateItemAnim(this);
|
||||||
if ((this->playerFrame & 0x80) != 0) {
|
if ((this->playerFrame & 0x80) != 0) {
|
||||||
|
@ -43,7 +43,7 @@ void sub_08075E40(ItemBehavior* this, u32 index) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
DeleteItemBehavior(this, index);
|
DeleteItemBehavior(this, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ void sub_08075EC0(ItemBehavior* this, u32 index) {
|
||||||
arrowCount = gSave.stats.arrowCount;
|
arrowCount = gSave.stats.arrowCount;
|
||||||
iVar2 = IsItemActive(this);
|
iVar2 = IsItemActive(this);
|
||||||
if (iVar2 != 0 && arrowCount != 0) {
|
if (iVar2 != 0 && arrowCount != 0) {
|
||||||
if (((gPlayerState.attack_status & 0x80) != 0) || (gPlayerState.field_0x1f[2] == 0)) {
|
if (((gPlayerState.attack_status & 0x80) != 0) || (gPlayerState.bow_state == 0)) {
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
DeleteItemBehavior(this, index);
|
DeleteItemBehavior(this, index);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,19 +68,19 @@ void sub_08075EC0(ItemBehavior* this, u32 index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08075F38(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);
|
UpdateItemAnim(this);
|
||||||
if ((this->playerFrame & 1) != 0) {
|
if ((this->playerFrame & 1) != 0) {
|
||||||
this->stateID = 4;
|
this->stateID = 4;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
DeleteItemBehavior(this, index);
|
DeleteItemBehavior(this, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08075F84(ItemBehavior* this, u32 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) {
|
if (GetInventoryValue(ITEM_ARROW_BUTTERFLY) == 1) {
|
||||||
sub_08077E3C(this, 5);
|
sub_08077E3C(this, 5);
|
||||||
} else {
|
} else {
|
||||||
|
@ -90,6 +90,6 @@ void sub_08075F84(ItemBehavior* this, u32 index) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
DeleteItemBehavior(this, index);
|
DeleteItemBehavior(this, index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ void sub_080768F8(ItemBehavior* this, u32 index) {
|
||||||
bVar1 |= bVar2;
|
bVar1 |= bVar2;
|
||||||
if (bVar1 == 0) {
|
if (bVar1 == 0) {
|
||||||
gPlayerState.dash_state = 1;
|
gPlayerState.dash_state = 1;
|
||||||
gPlayerState.field_0x1f[2] = bVar1;
|
gPlayerState.bow_state = bVar1;
|
||||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||||
this->timer = 0x10;
|
this->timer = 0x10;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -69,15 +69,15 @@ void SwordParticle_Action1(SwordParticleEntity* this) {
|
||||||
u32 tmp2;
|
u32 tmp2;
|
||||||
|
|
||||||
if (super->type2 != 0) {
|
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();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if (gPlayerState.field_0x1f[2] >= 0x50) {
|
if (gPlayerState.bow_state >= 0x50) {
|
||||||
super->spriteSettings.draw = 1;
|
super->spriteSettings.draw = 1;
|
||||||
tmp1 = gPlayerState.field_0x1f[2];
|
tmp1 = gPlayerState.bow_state;
|
||||||
ptr = gUnk_081217D8;
|
ptr = gUnk_081217D8;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.field_0x1f[2] != 0) {
|
if (gPlayerState.bow_state != 0) {
|
||||||
super->spriteSettings.draw = 0;
|
super->spriteSettings.draw = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,7 +418,7 @@ static void PlayerNormal(Entity* this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!gPlayerState.swim_state && (gPlayerState.jump_status & 0xC0) == 0) {
|
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;
|
this->speed = SHIELDING_SPEED;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.sword_state) {
|
if (gPlayerState.sword_state) {
|
||||||
|
|
|
@ -210,16 +210,16 @@ void PlayerItemBow_Action1(PlayerItemBowEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} 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) {
|
if ((PlayerItemBowEntity*)gPlayerState.item == this) {
|
||||||
gPlayerState.item = 0;
|
gPlayerState.item = 0;
|
||||||
}
|
}
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
if ((this->unk_68 == 0xa) && (gPlayerState.field_0x1f[2] != 0)) {
|
if ((this->unk_68 == 0xa) && (gPlayerState.bow_state != 0)) {
|
||||||
if (gPlayerState.field_0x1f[2] < 0x78) {
|
if (gPlayerState.bow_state < 0x78) {
|
||||||
gPlayerState.field_0x1f[2]++;
|
gPlayerState.bow_state++;
|
||||||
} else {
|
} else {
|
||||||
super->hurtType = 0x0e;
|
super->hurtType = 0x0e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,7 +378,7 @@ void ResetActiveItems() {
|
||||||
|
|
||||||
gPlayerState.moleMittsState = 0;
|
gPlayerState.moleMittsState = 0;
|
||||||
gPlayerState.field_0x1c = 0;
|
gPlayerState.field_0x1c = 0;
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
gPlayerState.grab_status = 0;
|
gPlayerState.grab_status = 0;
|
||||||
gPlayerState.itemAnimPriority = 0;
|
gPlayerState.itemAnimPriority = 0;
|
||||||
gPlayerState.dash_state = 0;
|
gPlayerState.dash_state = 0;
|
||||||
|
@ -1363,7 +1363,7 @@ void ClearPlayerState(void) {
|
||||||
gPlayerState.dash_state = 0;
|
gPlayerState.dash_state = 0;
|
||||||
gPlayerState.field_0x1f[0] = 0;
|
gPlayerState.field_0x1f[0] = 0;
|
||||||
gPlayerState.field_0x1f[1] = 0;
|
gPlayerState.field_0x1f[1] = 0;
|
||||||
gPlayerState.field_0x1f[2] = 0;
|
gPlayerState.bow_state = 0;
|
||||||
gPlayerState.tilePosition = 0;
|
gPlayerState.tilePosition = 0;
|
||||||
gPlayerState.tileType = 0;
|
gPlayerState.tileType = 0;
|
||||||
gPlayerState.swim_state = 0;
|
gPlayerState.swim_state = 0;
|
||||||
|
@ -1868,7 +1868,7 @@ void sub_080797EC(void) {
|
||||||
animation = ANIM_CARRY_NOCAP;
|
animation = ANIM_CARRY_NOCAP;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status != 0) {
|
||||||
animation = ANIM_SHIELD_NOCAP;
|
animation = ANIM_SHIELD_NOCAP;
|
||||||
} else if (gPlayerState.field_0x1f[2] == 0) {
|
} else if (gPlayerState.bow_state == 0) {
|
||||||
if (gPlayerState.swim_state != 0) {
|
if (gPlayerState.swim_state != 0) {
|
||||||
animation = ANIM_SWIM;
|
animation = ANIM_SWIM;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1905,7 +1905,7 @@ void sub_080797EC(void) {
|
||||||
animation = ANIM_MINECART;
|
animation = ANIM_MINECART;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status != 0) {
|
||||||
animation = ANIM_SHIELD;
|
animation = ANIM_SHIELD;
|
||||||
} else if (gPlayerState.field_0x1f[2] != 0) {
|
} else if (gPlayerState.bow_state != 0) {
|
||||||
animation = ANIM_BOW;
|
animation = ANIM_BOW;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.swim_state != 0) {
|
if (gPlayerState.swim_state != 0) {
|
||||||
|
@ -1958,7 +1958,7 @@ void ResolvePlayerAnimation(void) {
|
||||||
anim = ANIM_JUMP;
|
anim = ANIM_JUMP;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status != 0) {
|
||||||
anim = ANIM_SHIELD_END_NOCAP;
|
anim = ANIM_SHIELD_END_NOCAP;
|
||||||
} else if (gPlayerState.field_0x1f[2] != 0) {
|
} else if (gPlayerState.bow_state != 0) {
|
||||||
anim = ANIM_BOW_END;
|
anim = ANIM_BOW_END;
|
||||||
} else if (gPlayerState.swim_state != 0) {
|
} else if (gPlayerState.swim_state != 0) {
|
||||||
anim = ANIM_SWIM_END;
|
anim = ANIM_SWIM_END;
|
||||||
|
@ -2007,7 +2007,7 @@ void ResolvePlayerAnimation(void) {
|
||||||
anim = ANIM_MINECART_END;
|
anim = ANIM_MINECART_END;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status != 0) {
|
||||||
anim = ANIM_SHIELD_END;
|
anim = ANIM_SHIELD_END;
|
||||||
} else if (gPlayerState.field_0x1f[2] != 0) {
|
} else if (gPlayerState.bow_state != 0) {
|
||||||
anim = ANIM_BOW_END;
|
anim = ANIM_BOW_END;
|
||||||
} else if (gPlayerState.swim_state != 0) {
|
} else if (gPlayerState.swim_state != 0) {
|
||||||
anim = ANIM_SWIM_END;
|
anim = ANIM_SWIM_END;
|
||||||
|
|
Loading…
Reference in New Issue