diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-02-08 18:27:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-08 18:27:04 -0800 |
| commit | e1fc6d628c8b780f7f19e8ce3e2153d5a35d41b7 (patch) | |
| tree | 06a8943409f98b0f9fdc92092847689747f40cd2 /src | |
| parent | 358f8c87cce6e0c84e31222b737508bf2194051f (diff) | |
| parent | 06d3302cc76948fbbd829555faa0cab83c892543 (diff) | |
Merge pull request #361 from hatal175/rocscape
Diffstat (limited to 'src')
| -rw-r--r-- | src/item/itemRocsCape.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/item/itemRocsCape.c b/src/item/itemRocsCape.c index c3af396c..3c94d851 100644 --- a/src/item/itemRocsCape.c +++ b/src/item/itemRocsCape.c @@ -5,46 +5,49 @@ void sub_08076758(ItemBehavior*, u32); extern void sub_08077F84(void); -/*void ItemRocsCape(ItemBehavior* this, u32 arg1) { +void ItemRocsCape(ItemBehavior* this, u32 arg1) { if (this->stateID != 0) { sub_08076758(this, arg1); return; } if (gPlayerState.item == NULL) { - if (gPlayerState.field_0x0[1] == 0) { - if (((u8)(gPlayerState.sword_state | gPlayerState.field_0xa | gPlayerState.field_0x3[1] | - gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) && - ((((1 < (u8)(gPlayerState.field_0x10[2] - 0x12) && (gPlayerState.field_0x10[2] != 1)) || - (gPlayerEntity.z.WORD != 0)) || - (gPlayerState.field_0x14 != 0)))) { - if ((gPlayerState.jump_status != 0) && ((gPlayerState.jump_status & 7) != 3)) - goto _08076710; - if (-1 < gPlayerEntity.z.WORD) { - gPlayerEntity.zVelocity = 0x20000; - gPlayerState.jump_status = 1; - gPlayerState.item = NULL; - this->stateID += 1; - goto _0807673C; + if (gPlayerState.field_0x0[1]) { + if (((gPlayerState.field_0x3[1] | gPlayerState.heldObject) == 0) && + (((gPlayerState.floor_type != SURFACE_DOOR && (gPlayerState.floor_type != SURFACE_PIT)) || + ((gPlayerEntity.z.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) { + if ((gPlayerState.jump_status == 0) || ((gPlayerState.jump_status & 7) == 3)) { + if (-1 < gPlayerEntity.z.WORD) { + gPlayerState.field_0x0[1] = 0; + this->stateID += 1; + gPlayerState.keepFacing = 0; + gPlayerState.jump_status = 1; + gPlayerState.field_0xe = -1; + gPlayerState.item = NULL; + gPlayerEntity.zVelocity = 0x20000; + sub_08077F84(); + SoundReq(SFX_PLY_VO4); + return; + } + } else { + sub_08076758(this, arg1); + return; } } } else { - if (((gPlayerState.heldObject | gPlayerState.field_0x3[1]) == 0) && - (((gPlayerState.field_0x10[2] != 0x12 && (gPlayerState.field_0x10[2] != 1)) || - ((gPlayerEntity.z.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) { + if (((u8)(gPlayerState.sword_state | gPlayerState.field_0xa | gPlayerState.field_0x3[1] | + gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) && + ((((gPlayerState.floor_type != SURFACE_DOOR && gPlayerState.floor_type != SURFACE_DOOR_13 && + gPlayerState.floor_type != SURFACE_PIT) || + (gPlayerEntity.z.WORD != 0)) || + (gPlayerState.field_0x14 != 0)))) { if ((gPlayerState.jump_status != 0) && ((gPlayerState.jump_status & 7) != 3)) { - _08076710: sub_08076758(this, arg1); return; - } - if (-1 < gPlayerEntity.z.WORD) { - gPlayerState.field_0x0[1] = 0; - this->stateID += 1; - gPlayerState.keepFacing = 0; + } else if (-1 < gPlayerEntity.z.WORD) { + gPlayerEntity.zVelocity = 0x20000; gPlayerState.jump_status = 1; - gPlayerState.field_0xe = -1; gPlayerState.item = NULL; - gPlayerEntity.zVelocity = 0x20000; - _0807673C: + this->stateID += 1; sub_08077F84(); SoundReq(SFX_PLY_VO4); return; @@ -54,8 +57,6 @@ extern void sub_08077F84(void); } sub_08077E78(this, arg1); } -*/ -ASM_FUNC("asm/non_matching/itemRocsCape/ItemRocsCape.inc", void ItemRocsCape(ItemBehavior* this, u32 arg1)) void sub_08076758(ItemBehavior* this, u32 arg1) { s32 iVar1; |
