diff --git a/data/scripts/unused/script_08016482.inc b/data/scripts/unused/script_08016482.inc index 6df39b0f..7ffcc08a 100644 --- a/data/scripts/unused/script_08016482.inc +++ b/data/scripts/unused/script_08016482.inc @@ -14,7 +14,7 @@ SCRIPT_START script_08016482 DisablePlayerControl SetPlayerAction 0x00005408 StartPlayerScript script_08016384 - SetPlayerAnimation FALL_ON_BACK + SetPlayerAnimation ANIM_FALL_ON_BACK _0807E8E4_0 _0807E8E4_1 _0807E8E4_2 diff --git a/include/area.h b/include/area.h index ce25c8df..66e7c016 100644 --- a/include/area.h +++ b/include/area.h @@ -6,6 +6,10 @@ #define MAX_ROOMS 64 +typedef enum { + PT_POT = 4, +} PortalTypes; + typedef struct { u16 pixel_width; u16 pixel_height; diff --git a/include/player.h b/include/player.h index d8dcd6b1..b35d8a63 100644 --- a/include/player.h +++ b/include/player.h @@ -294,6 +294,7 @@ typedef enum { ANIM_TRAPPED_BY_GHINI = 0x25c, ANIM_BOW_END = 0x280, ANIM_BOW = 0x284, + ANIM_ROCS_CAPE = 0x288, ANIM_SWIM_END = 0x28c, ANIM_SWIM = 0x290, ANIM_FROZEN = 0x294, @@ -347,6 +348,7 @@ typedef enum { ANIM_GET_ITEM_SWORD = 0x45f, ANIM_524 = 0x524, ANIM_ENTER_POT = 0x52c, + ANIM_IN_POT = 0x530, ANIM_LANTERN_END = 0x604, ANIM_LANTERN = 0x608, ANIM_BOTTLE_EMPTY = 0x610, @@ -380,9 +382,12 @@ typedef enum { ANIM_PULL_NOCAP = 0x944, ANIM_FALL_IN_HOLE_NOCAP = 0x950, ANIM_IN_HOLE_NOCAP = 0x954, + ANIM_SWORD_MINISH = 0xc00, ANIM_WALK_MINISH = 0xc04, ANIM_ROLL_MINISH = 0xc08, ANIM_SWIM_MINISH = 0xc0c, + ANIM_C10 = 0xc10, + ANIM_C14 = 0xc14, ANIM_BOUNCE_MINISH = 0xc18, ANIM_DROWN_MINISH = 0xc19, ANIM_DIE1_MINISH = 0xc1a, diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index ab565a0d..ad64876b 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -554,7 +554,7 @@ void sub_080262A8(ChuchuBossEntity* this) { super->timer = 1; sub_080276F4(super, 6, 1); if (super->type2 == 0) { - gPlayerState.animation = 0x104; + gPlayerState.animation = ANIM_DOOR; this->unk_84->unk_03 = 1; } else { this->unk_7c = 0; diff --git a/src/enterPortalSubtask.c b/src/enterPortalSubtask.c index 379ee2e7..fbb94ccc 100644 --- a/src/enterPortalSubtask.c +++ b/src/enterPortalSubtask.c @@ -258,7 +258,7 @@ bool32 sub_0804AD18(void) { case 6: return FALSE; case 3: - case 4: + case PT_POT: case 5: default: return FALSE; diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c index 7b487cee..e6862802 100644 --- a/src/item/itemPegasusBoots.c +++ b/src/item/itemPegasusBoots.c @@ -71,7 +71,7 @@ void sub_080768F8(ItemBehavior* this, u32 index) { if ((gPlayerState.flags & PL_MINISH) == 0) { this->timer = 0x10; } else { - gPlayerState.animation = 0xc14; + gPlayerState.animation = ANIM_C14; } sub_08077D38(this, index); sub_08076964(this, index); @@ -119,7 +119,7 @@ void sub_08076964(ItemBehavior* this, u32 index) { SetItemAnim(this, 0x104); return; } else { - gPlayerState.animation = 0xc10; + gPlayerState.animation = ANIM_C10; return; } } else { diff --git a/src/item/itemRocsCape.c b/src/item/itemRocsCape.c index dee55950..cfb165a3 100644 --- a/src/item/itemRocsCape.c +++ b/src/item/itemRocsCape.c @@ -69,7 +69,7 @@ void sub_08076758(ItemBehavior* this, u32 index) { gPlayerEntity.field_0x7a.HWORD = 2; gPlayerEntity.zVelocity = Q_16_16(2.0); gPlayerState.jump_status |= 0x10; - gPlayerState.animation = 0x288; + gPlayerState.animation = ANIM_ROCS_CAPE; SoundReq(SFX_172); } } else { diff --git a/src/item/itemSword.c b/src/item/itemSword.c index 5598e0d7..f34718f0 100644 --- a/src/item/itemSword.c +++ b/src/item/itemSword.c @@ -31,7 +31,7 @@ void sub_08075338(ItemBehavior* this, u32 index) { if (gPlayerState.flags & PL_MINISH) { this->priority |= 0x80; sub_08077D38(this, index); - gPlayerState.animation = 0xc00; + gPlayerState.animation = ANIM_SWORD_MINISH; SoundReq(SFX_PLY_VO1); return; } diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index 5c5fdc2d..19c05a57 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -122,7 +122,7 @@ void sub_0808C01C(JarPortalEntity* this, u32 r1) { gArea.portal_x = super->x.HALF.HI; gArea.portal_y = super->y.HALF.HI; gArea.portal_exit_dir = 2; - type = 4; + type = PT_POT; if (r1 != 0) type = 2; gArea.portal_type = type; diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index 5d5f02ba..8a5a40b1 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -477,7 +477,7 @@ void sub_0809E1F0(KeyStealingTakkuriEntity* this) { void sub_0809E210(KeyStealingTakkuriEntity* this) { gPlayerEntity.animationState = GetAnimationStateForDirection8(GetFacingDirection(&gPlayerEntity, super)) & 0xfe; - gPlayerState.animation = 0x100; + gPlayerState.animation = ANIM_DEFAULT; } void sub_0809E238(KeyStealingTakkuriEntity* this) { diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 9b380797..5c1e9949 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -551,7 +551,7 @@ void sub_08085E74(LilypadLargeEntity* this) { gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; gPlayerEntity.direction = super->direction; - gPlayerState.animation = 0x100; + gPlayerState.animation = ANIM_DEFAULT; gRoomControls.camera_target = super; if (gPlayerState.item != NULL) { DeleteEntity(gPlayerState.item); diff --git a/src/player.c b/src/player.c index de8fa5eb..397b4857 100644 --- a/src/player.c +++ b/src/player.c @@ -1049,7 +1049,7 @@ static void PortalJumpOnUpdate(Entity* this) { this->subAction = 1; this->animationState = IdleSouth; this->spriteSettings.flipX = FALSE; - if (gArea.portal_type == 4) { + if (gArea.portal_type == PT_POT) { gPlayerState.animation = ANIM_ENTER_POT; } } @@ -1090,7 +1090,7 @@ static void PortalStandUpdate(Entity* this) { this->timer = 8; } - if (gArea.portal_type == 4) { + if (gArea.portal_type == PT_POT) { if (this->frame == 0) { UpdateAnimationSingleFrame(this); return; @@ -2049,7 +2049,7 @@ static void PlayerRollInit(Entity* this) { if (playerFlags & PL_NO_CAP) { gPlayerState.animation = ANIM_ROLL_NOCAP; } else { - gPlayerState.animation = 0x3a0; + gPlayerState.animation = ANIM_ROLL; } } gPlayerState.flags |= PL_ROLLING; diff --git a/src/playerUtils.c b/src/playerUtils.c index 97767102..2ea00c46 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -1975,7 +1975,7 @@ void ResolvePlayerAnimation(void) { case 5: anim = ANIM_DEFAULT_NOCAP; break; - case 4: + case PT_POT: anim = ANIM_DEFAULT; break; default: @@ -2016,7 +2016,7 @@ void ResolvePlayerAnimation(void) { return; } if ((gPlayerState.flags & PL_USE_PORTAL) != 0) { - anim = (gArea.portal_type == 4) ? 0x530 : 0x2c2; + anim = (gArea.portal_type == PT_POT) ? ANIM_IN_POT : ANIM_PORTAL; } else { if (gPlayerState.sword_state != 0) { anim = ANIM_SWORD_CHARGE_END;