Skip to content

Commit

Permalink
renamed and added a bunch of animations to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeStepYT committed Sep 19, 2023
1 parent 20483c2 commit 0fdb9c5
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 132 deletions.
88 changes: 62 additions & 26 deletions include/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,33 +285,43 @@ typedef enum {
typedef enum {
ANIM_DEFAULT = 0x100,
ANIM_WALK = 0x104,
ANIM_SWORD = 0x108,
ANIM_BOUNCE = 0x114,
ANIM_SHIELD = 0x160,
ANIM_SHIELD_END = 0x164,
ANIM_SWORD_CHARGE_END = 0x168,
ANIM_SWORD_CHARGE = 0x16c,
ANIM_SPINATTACK = 0x124,
ANIM_GREATSPIN = 0x128,
ANIM_ROLLATTACK_SPIN = 0x12c,
ANIM_ROLLATTACK_SLIDE = 0x130,
ANIM_ROLLATTACK_END = 0x134,
ANIM_SHIELD_PULLOUT = 0x158,
ANIM_SHIELD_WALK = 0x160,
ANIM_SHIELD = 0x164,
ANIM_SWORD_CHARGE = 0x168,
ANIM_SWORD_CHARGE_WALK = 0x16c,
ANIM_SWORD_CHARGE_BUMP = 0x170,
ANIM_DOWN_THRUST = 0x174,
ANIM_FALL = 0x1b8,
ANIM_GET_ITEM_BIG = 0x1b9,
ANIM_FALL_MINISH = 0x1ba,
ANIM_DIE1 = 0x1bc,
ANIM_GET_WHITE_SWORD = 0x1e2,
ANIM_TRAPPED_BY_GHINI = 0x25c,
ANIM_BOW_END = 0x280,
ANIM_BOW = 0x284,
ANIM_BOW_PULLOUT = 0x21c,
ANIM_TRAPPED = 0x25c,
ANIM_BOW_SHOOT = 0x27c,
ANIM_BOW_CHARGE = 0x280,
ANIM_BOW_WALK = 0x284,
ANIM_ROCS_CAPE = 0x288,
ANIM_SWIM_END = 0x28c,
ANIM_SWIM = 0x290,
ANIM_SWIM_STILL = 0x28c,
ANIM_SWIM_MOVE = 0x290,
ANIM_FROZEN = 0x294,
ANIM_DASH = 0x298,
ANIM_ELECTROCUTED = 0x29c,
ANIM_ROLL = 0x2ac,
ANIM_DIE2 = 0x2bd,
ANIM_DIVE = 0x2be,
ANIM_IN_LAVA = 0x2c1,
ANIM_PORTAL = 0x2c2,
ANIM_PORTAL_SHRINK = 0x2c3,
ANIM_DROWN_END = 0x2ce,
ANIM_DROWN_RESPAWN = 0x2ce,
ANIM_CLIMB1_UP = 0x2cf,
ANIM_CLIMB2_UP = 0x2d0,
ANIM_CLIMB1_DOWN = 0x2d1,
Expand All @@ -322,12 +332,16 @@ typedef enum {
ANIM_CLIMB_TO_TOP = 0x2d6,
ANIM_BOTTLE_DRINK = 0x2df,
ANIM_GET_ITEM_SMALL = 0x2e0,
ANIM_PICKUP = 0x338,
ANIM_PUSH = 0x33c,
ANIM_PULL = 0x34c,
ANIM_PULL = 0x340,
ANIM_THROW = 0x344,
ANIM_CARRY = 0x348,
ANIM_CARRY_END = 0x350,
ANIM_PULL2 = 0x34c,
ANIM_CARRY_STAND = 0x350,
ANIM_GRAB = 0x378,
ANIM_FALL_ON_BACK = 0x3a0,
ANIM_3C0 = 0x3c0,
ANIM_LAUNCHED = 0x3c0,
ANIM_EZLO_SEARCH = 0x3c5,
ANIM_EZLO_APPEAR_LEFT = 0x3c6,
ANIM_EZLO_EYES_UP = 0x3c7,
Expand All @@ -338,9 +352,12 @@ typedef enum {
ANIM_EZLO_LEAVE_RIGHT = 0x3cd,
ANIM_DEFAULT_NOCAP = 0x400,
ANIM_WALK_NOCAP = 0x404,
ANIM_SHIELD_NOCAP = 0x410,
ANIM_SHIELD_END_NOCAP = 0x414,
ANIM_PORTAL_LEAVE_NOCAP = 0x41c,
ANIM_SWORD_NOCAP = 0x408,
ANIM_SHIELD_PULLOUT_NOCAP = 0x40c,
ANIM_SHIELD_WALK_NOCAP = 0x410,
ANIM_SHIELD_NOCAP = 0x414,
ANIM_BOUNCE_NOCAP = 0x418,
ANIM_HOP_NOCAP = 0x41c,
ANIM_JUMP_NOCAP = 0x420,
ANIM_LAND_NOCAP = 0x424,
ANIM_ROLL_NOCAP = 0x438,
Expand All @@ -351,19 +368,33 @@ typedef enum {
ANIM_GET_ITEM_BIG_NOCAP = 0x45b,
ANIM_GET_ITEM_SMALL_NOCAP = 0x45e,
ANIM_GET_ITEM_SWORD = 0x45f,
ANIM_524 = 0x524,
ANIM_GUSTJAR_PULLOUT = 0x500,
ANIM_GUSTJAR_SUCK = 0x504,
ANIM_MOLEMITTS_FLOOR = 0x508,
ANIM_MOLEMITTS_DIG = 0x50c,
ANIM_GUSTJAR_END = 0x510,
ANIM_GUSTJAR_BLOW = 0x514,
ANIM_GUSTJAR_WALK = 0x518,
ANIM_MOLEMITTS_CLANG = 0x51c,
ANIM_MOLEMITTS_MISS = 0x520,
ANIM_GUSTJAR_524 = 0x524,
ANIM_ENTER_POT = 0x52c,
ANIM_IN_POT = 0x530,
ANIM_LANTERN_END = 0x604,
ANIM_LANTERN_LIGHT = 0x600,
ANIM_LANTERN_ON = 0x604,
ANIM_LANTERN = 0x608,
ANIM_BOTTLE_EMPTY = 0x610,
ANIM_LANTERN_BURN = 0x60c,
ANIM_BOTTLE_POUR = 0x610,
ANIM_BOTTLE_SWING = 0x614,
ANIM_BOTTLE_SWING_END = 0x618,
ANIM_FALL_IN_HOLE = 0x61c,
ANIM_IN_HOLE = 0x620,
ANIM_ROLL_IN_HOLE = 0x624,
ANIM_PARACHUTE = 0x700,
ANIM_PARACHUTE2 = 0x708,
ANIM_MINECART_END = 0x70c,
ANIM_SPRING_JUMP = 0x624,
ANIM_CANE = 0x628,
ANIM_PARACHUTE_ACTIVATE = 0x700,
ANIM_BOOMERANG_MAGIC = 0x704,
ANIM_PARACHUTE = 0x708,
ANIM_MINECART_PAUSE = 0x70c,
ANIM_MINECART = 0x710,
ANIM_DROWN = 0x72c,
ANIM_PARACHUTE_FALL = 0x730,
Expand All @@ -373,18 +404,23 @@ typedef enum {
ANIM_PORTAL_ACTIVATE = 0x738,
ANIM_SLEEP_NOCAP = 0x73a,
ANIM_WAKEUP_NOCAP = 0x73b,
ANIM_73C = 0x73c,
ANIM_PORTAL_LEAVE = 0x80c,
ANIM_GROW = 0x73c,
ANIM_HOP = 0x80c,
ANIM_JUMP = 0x810,
ANIM_BOOMERANG = 0x818,
ANIM_LAND = 0x820,
ANIM_MOLDWORM_CAPTURED = 0x8b0,
ANIM_GET_NEW_SWORD = 0x8bf,
ANIM_OCARINA = 0x8e1,
ANIM_GET_LAST_SWORD = 0x8e3,
ANIM_GET_NEWCAP = 0x8e4,
ANIM_CARRY_END_NOCAP = 0x92c,
ANIM_PICKUP_NOCAP = 0x928,
ANIM_CARRY_STAND_NOCAP = 0x92c,
ANIM_THROW_NOCAP = 0x930,
ANIM_CARRY_NOCAP = 0x934,
ANIM_PUSH_NOCAP = 0x93c,
ANIM_PULL_NOCAP = 0x944,
ANIM_GRAB_NOCAP = 0x948,
ANIM_FALL_IN_HOLE_NOCAP = 0x950,
ANIM_IN_HOLE_NOCAP = 0x954,
ANIM_SWORD_MINISH = 0xc00,
Expand Down
4 changes: 2 additions & 2 deletions include/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ typedef enum {
SFX_FALL_HOLE,
SFX_86,
SFX_PLY_DIE,
SFX_88,
SFX_GRAB,
SFX_BARREL_RELEASE,
SFX_BARREL_ENTER,
SFX_BARREL_ROLL,
Expand Down Expand Up @@ -295,7 +295,7 @@ typedef enum {
SFX_PLACE_OBJ,
SFX_105,
SFX_106,
SFX_107,
SFX_ITEM_GLOVES_AIR,
SFX_108,
SFX_ITEM_GET,
SFX_10A,
Expand Down
14 changes: 7 additions & 7 deletions src/item/itemBow.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

void sub_08075DF4(ItemBehavior*, u32);
void sub_08075E40(ItemBehavior*, u32);
void sub_08075EC0(ItemBehavior*, u32);
void ItemBowShoot(ItemBehavior*, u32);
void sub_08075F38(ItemBehavior*, u32);
void sub_08075F84(ItemBehavior*, u32);
void sub_08075D88(ItemBehavior*, u32);

void ItemBow(ItemBehavior* this, u32 index) {
static void (*const stateFuncs[])(ItemBehavior*, u32) = {
sub_08075DF4, sub_08075E40, sub_08075EC0, sub_08075F38, sub_08075F84, sub_08075D88,
sub_08075DF4, sub_08075E40, ItemBowShoot, sub_08075F38, sub_08075F84, sub_08075D88,
};
stateFuncs[this->stateID](this, index);
}
Expand Down Expand Up @@ -47,20 +47,20 @@ void sub_08075E40(ItemBehavior* this, u32 index) {
DeleteItemBehavior(this, index);
}

void sub_08075EC0(ItemBehavior* this, u32 index) {
void ItemBowShoot(ItemBehavior* this, u32 index) {
u8 arrowCount;
s32 iVar2;
s32 isShooting;

arrowCount = gSave.stats.arrowCount;
iVar2 = IsItemActive(this);
if (iVar2 != 0 && arrowCount != 0) {
isShooting = IsItemActive(this);
if (isShooting && arrowCount != 0) {
if (((gPlayerState.attack_status & 0x80) != 0) || (gPlayerState.bow_state == 0)) {
gPlayerState.bow_state = 0;
DeleteItemBehavior(this, index);
}
} else {
gPlayerState.field_0xa = (8 >> index) | gPlayerState.field_0xa;
SetItemAnim(this, 0x27c);
SetItemAnim(this, ANIM_BOW_SHOOT);
this->animPriority = 0xf;
this->priority |= 0xf;
this->stateID = 3;
Expand Down
16 changes: 8 additions & 8 deletions src/item/itemGustJar.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void sub_08076E60(ItemBehavior* this, u32 index) {
}
if ((this->playerFrame & 0x80) != 0) {
this->stateID = 2;
SetItemAnim(this, 0x504);
SetItemAnim(this, ANIM_GUSTJAR_SUCK);
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> index);
playerItem = CreatePlayerItem(PLAYER_ITEM_GUST, 0, 0, 0);
if (playerItem != NULL) {
Expand Down Expand Up @@ -64,12 +64,12 @@ void sub_08076EC8(ItemBehavior* this, u32 index) {
}

if (gPlayerEntity.subAction == 0x1b) {
animIndex = 0x524;
animIndex = ANIM_GUSTJAR_524;
} else {
if (gPlayerState.direction & DIR_NOT_MOVING_CHECK) {
animIndex = 0x504;
animIndex = ANIM_GUSTJAR_SUCK;
} else {
animIndex = 0x518;
animIndex = ANIM_GUSTJAR_WALK;
}
}

Expand Down Expand Up @@ -100,15 +100,15 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
gPlayerState.field_0x1c = 1;
gPlayerState.field_0xa &= ~(8 >> index);
this->stateID = 2;
SetItemAnim(this, 0x504);
SetItemAnim(this, ANIM_GUSTJAR_SUCK);
item = CreatePlayerItem(PLAYER_ITEM_GUST, 0, 0, 0);
if (item) {
item->parent = player;
}
return;
} else {
gPlayerState.field_0x1c = 6;
SetItemAnim(this, 0x510);
SetItemAnim(this, ANIM_GUSTJAR_END);
return;
}
} else {
Expand Down Expand Up @@ -155,15 +155,15 @@ void sub_08076F64(ItemBehavior* this, u32 index) {
return;
break;
case 7:
SetItemAnim(this, 0x514);
SetItemAnim(this, ANIM_GUSTJAR_BLOW);
gPlayerState.field_0x1c = 3;
gPlayerState.gustJarSpeed = 0;
return;
case 1:
case 2:
default:
gPlayerState.field_0x1c = 3;
SetItemAnim(this, 0x514);
SetItemAnim(this, ANIM_GUSTJAR_BLOW);
return;
case 0:
break;
Expand Down
10 changes: 5 additions & 5 deletions src/item/itemJarEmpty.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void sub_08077534(ItemBehavior* this, u32 index) {
this->timer = gSave.stats.bottles[tmp - ITEM_BOTTLE1];
switch (this->timer) {
case ITEM_BOTTLE_EMPTY:
SetItemAnim(this, 0x614);
SetItemAnim(this, ANIM_BOTTLE_SWING);
return;
case ITEM_BOTTLE_BUTTER:
case ITEM_BOTTLE_MILK:
Expand All @@ -43,22 +43,22 @@ void sub_08077534(ItemBehavior* this, u32 index) {
this->stateID = 3;
gPlayerEntity.animationState = 4;
gPlayerEntity.spriteSettings.flipX = 0;
SetItemAnim(this, 0x2df);
SetItemAnim(this, ANIM_BOTTLE_DRINK);
break;
case BOTTLE_CHARM_NAYRU:
case BOTTLE_CHARM_FARORE:
case BOTTLE_CHARM_DIN:
default:
this->stateID = 3;
SetItemAnim(this, 0x610);
SetItemAnim(this, ANIM_BOTTLE_POUR);
break;
}
gPlayerEntity.flags &= ~ENT_COLLIDE;
}

void sub_08077618(ItemBehavior* this, u32 index) {
if ((this->playerFrame & 0x80) != 0) {
SetItemAnim(this, 0x618);
if (this->playerFrame & 0x80) {
SetItemAnim(this, ANIM_BOTTLE_SWING_END);
this->stateID++;
} else {
UpdateItemAnim(this);
Expand Down
2 changes: 1 addition & 1 deletion src/item/itemLantern.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void sub_08075B54(ItemBehavior* this, u32 index) {
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
}
SetItemAnim(this, 0x60c);
SetItemAnim(this, ANIM_LANTERN_BURN);
bVar1 = (8 >> (index));
gPlayerState.field_0xa |= bVar1;
gPlayerState.keepFacing |= bVar1;
Expand Down
10 changes: 5 additions & 5 deletions src/item/itemMoleMitts.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void sub_08077130(ItemBehavior* this, u32 index) {
iVar1 = sub_080774A0();
if (iVar1 != 0) {
if (this->timer == 0) {
SetItemAnim(this, 0x50c);
SetItemAnim(this, ANIM_MOLEMITTS_DIG);
this->stateID = 2;
if (iVar1 == 0x56) {
if ((gPlayerEntity.animationState & 2) != 0) {
Expand All @@ -45,7 +45,7 @@ void sub_08077130(ItemBehavior* this, u32 index) {
}
}
} else {
SetItemAnim(this, 0x508);
SetItemAnim(this, ANIM_MOLEMITTS_FLOOR);
this->stateID = 1;
}
} else {
Expand All @@ -71,9 +71,9 @@ void sub_080771C8(ItemBehavior* this, u32 index) {
}
if ((this->playerFrame & 0x10) != 0) {
if (sub_0800875A(&gPlayerEntity, 0xd, this) == 0) {
SetItemAnim(this, 0x520);
SetItemAnim(this, ANIM_MOLEMITTS_MISS);
this->stateID = 3;
SoundReq(SFX_107);
SoundReq(SFX_ITEM_GLOVES_AIR);
} else {
if (this->subtimer != 0xff) {
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_1F, 0, this->field_0x2[1]);
Expand Down Expand Up @@ -140,7 +140,7 @@ void sub_080772A8(ItemBehavior* this, u32 index) {
SoundReq(SFX_108);
CreateObjectWithParent(&gPlayerEntity, MOLE_MITTS_PARTICLE, this->playerFrame, 0);
} else {
SetItemAnim(this, 0x51c);
SetItemAnim(this, ANIM_MOLEMITTS_CLANG);
effect = CreateFx(&gPlayerEntity, FX_STARS_STRIKE, 0);
if (effect != NULL) {
effect->animationState = this->playerAnimationState;
Expand Down
6 changes: 3 additions & 3 deletions src/item/itemPegasusBoots.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void sub_08076964(ItemBehavior* this, u32 index) {
if (HasSwordEquipped() && (gPlayerState.flags & PL_MINISH) == 0 &&
(gPlayerState.skills & SKILL_DASH_ATTACK) != 0) {
gPlayerState.lastSwordMove = SWORD_MOVE_DASH;
SetItemAnim(this, 0x298);
SetItemAnim(this, ANIM_DASH);
entity = CreatePlayerItemWithParent(this, PLAYER_ITEM_DASH_SWORD);
if (entity != NULL) {
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != 0) {
Expand All @@ -115,8 +115,8 @@ void sub_08076964(ItemBehavior* this, u32 index) {
entity->field_0x68.HALF.LO = uVar3;
return;
}
} else if ((gPlayerState.flags & PL_MINISH) == 0) {
SetItemAnim(this, 0x104);
} else if (!(gPlayerState.flags & PL_MINISH)) {
SetItemAnim(this, ANIM_WALK);
return;
} else {
gPlayerState.animation = ANIM_C10;
Expand Down
Loading

0 comments on commit 0fdb9c5

Please sign in to comment.