mirror of https://github.com/zeldaret/tmc.git
Merge pull request #631 from Reinmmar/MissingPlayerStateFlags
found more anims, also removing != 0 sometimes
This commit is contained in:
commit
d05f7dff2d
|
@ -396,6 +396,12 @@ typedef enum {
|
||||||
ANIM_PARACHUTE = 0x708,
|
ANIM_PARACHUTE = 0x708,
|
||||||
ANIM_MINECART_PAUSE = 0x70c,
|
ANIM_MINECART_PAUSE = 0x70c,
|
||||||
ANIM_MINECART = 0x710,
|
ANIM_MINECART = 0x710,
|
||||||
|
ANIM_PARACHUTE_TURN_RIGHT = 0x714,
|
||||||
|
ANIM_PARACHUTE_TURN_OPPOSITE = 0x718,
|
||||||
|
ANIM_PARACHUTE_TURN_LEFT = 0x71c,
|
||||||
|
ANIM_PARACHUTE_TURN2_RIGHT = 0x720,
|
||||||
|
ANIM_PARACHUTE_TURN2_OPPOSITE = 0x724,
|
||||||
|
ANIM_PARACHUTE_TURN2_LEFT = 0x728,
|
||||||
ANIM_DROWN = 0x72c,
|
ANIM_DROWN = 0x72c,
|
||||||
ANIM_PARACHUTE_FALL = 0x730,
|
ANIM_PARACHUTE_FALL = 0x730,
|
||||||
ANIM_PUT_ON_EZLO = 0x734,
|
ANIM_PUT_ON_EZLO = 0x734,
|
||||||
|
|
|
@ -306,10 +306,10 @@ u32 UpdatePlayerCollision(void) {
|
||||||
case 0x3a:
|
case 0x3a:
|
||||||
case 0x5b:
|
case 0x5b:
|
||||||
case 0x4051:
|
case 0x4051:
|
||||||
if ((gPlayerState.flags & PL_MINISH) != 0) {
|
if (gPlayerState.flags & PL_MINISH) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (gPlayerEntity.animationState != 0) {
|
if (gPlayerEntity.animationState != IdleNorth) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
gUnk_0200AF00.rActionInteractTile = R_ACTION_READ;
|
gUnk_0200AF00.rActionInteractTile = R_ACTION_READ;
|
||||||
|
|
34
src/player.c
34
src/player.c
|
@ -2804,13 +2804,13 @@ static void sub_08073584(Entity* this) {
|
||||||
if (!this->field_0x86.HALF.HI ||
|
if (!this->field_0x86.HALF.HI ||
|
||||||
((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0 && this->animationState != state)) {
|
((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0 && this->animationState != state)) {
|
||||||
static const u16 sAnims1[] = {
|
static const u16 sAnims1[] = {
|
||||||
0x0708,
|
ANIM_PARACHUTE,
|
||||||
0x071C,
|
ANIM_PARACHUTE_TURN_LEFT,
|
||||||
0x0718,
|
ANIM_PARACHUTE_TURN_OPPOSITE,
|
||||||
0x0714,
|
ANIM_PARACHUTE_TURN_RIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0) {
|
if (!(gPlayerState.direction & DIR_NOT_MOVING_CHECK)) {
|
||||||
if (this->animationState != state) {
|
if (this->animationState != state) {
|
||||||
if (this->animationState == (state ^ 4)) {
|
if (this->animationState == (state ^ 4)) {
|
||||||
idx = 2;
|
idx = 2;
|
||||||
|
@ -2836,10 +2836,10 @@ static void sub_08073584(Entity* this) {
|
||||||
this->field_0x86.HALF.LO = idx;
|
this->field_0x86.HALF.LO = idx;
|
||||||
} else {
|
} else {
|
||||||
static const u16 sAnims2[] = {
|
static const u16 sAnims2[] = {
|
||||||
0x0708,
|
ANIM_PARACHUTE,
|
||||||
0x0728,
|
ANIM_PARACHUTE_TURN2_LEFT,
|
||||||
0x0724,
|
ANIM_PARACHUTE_TURN2_OPPOSITE,
|
||||||
0x0720,
|
ANIM_PARACHUTE_TURN2_RIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
this->field_0x86.HALF.HI--;
|
this->field_0x86.HALF.HI--;
|
||||||
|
@ -2887,10 +2887,10 @@ static void sub_080737BC(Entity* this) {
|
||||||
|
|
||||||
static void sub_0807380C(Entity* this) {
|
static void sub_0807380C(Entity* this) {
|
||||||
static const u16 sAnims[] = {
|
static const u16 sAnims[] = {
|
||||||
0x0708,
|
ANIM_PARACHUTE,
|
||||||
0x071C,
|
ANIM_PARACHUTE_TURN_LEFT,
|
||||||
0x0718,
|
ANIM_PARACHUTE_TURN_OPPOSITE,
|
||||||
0x0714,
|
ANIM_PARACHUTE_TURN_RIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((gRoomTransition.frameCount & 3) == 0) {
|
if ((gRoomTransition.frameCount & 3) == 0) {
|
||||||
|
@ -2913,10 +2913,10 @@ static void sub_0807380C(Entity* this) {
|
||||||
|
|
||||||
void sub_08073884(Entity* this) {
|
void sub_08073884(Entity* this) {
|
||||||
static const u16 sAnims[] = {
|
static const u16 sAnims[] = {
|
||||||
0x0708,
|
ANIM_PARACHUTE,
|
||||||
0x071C,
|
ANIM_PARACHUTE_TURN_LEFT,
|
||||||
0x0718,
|
ANIM_PARACHUTE_TURN_OPPOSITE,
|
||||||
0x0714,
|
ANIM_PARACHUTE_TURN_RIGHT,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((gRoomTransition.frameCount & 1) == 0) {
|
if ((gRoomTransition.frameCount & 1) == 0) {
|
||||||
|
|
|
@ -1490,7 +1490,7 @@ bool32 CheckQueuedAction(void) {
|
||||||
// this doesnt seem to have any real function where its used
|
// this doesnt seem to have any real function where its used
|
||||||
void CheckPlayerVelocity(void) {
|
void CheckPlayerVelocity(void) {
|
||||||
u32 angle = gPlayerState.direction;
|
u32 angle = gPlayerState.direction;
|
||||||
if ((angle & DIR_NOT_MOVING_CHECK) != 0) {
|
if (angle & DIR_NOT_MOVING_CHECK) {
|
||||||
ResetPlayerVelocity();
|
ResetPlayerVelocity();
|
||||||
} else {
|
} else {
|
||||||
gPlayerState.vel_x = gSineTable[angle * 8];
|
gPlayerState.vel_x = gSineTable[angle * 8];
|
||||||
|
@ -1518,14 +1518,14 @@ bool32 sub_08078F74(Entity* this) {
|
||||||
void sub_08078FB0(Entity* this) {
|
void sub_08078FB0(Entity* this) {
|
||||||
u32 animIndex;
|
u32 animIndex;
|
||||||
|
|
||||||
if ((gPlayerState.pushedObject & 0x80) == 0) {
|
if (!(gPlayerState.pushedObject & 0x80)) {
|
||||||
gPlayerState.field_0x35 = 0xff;
|
gPlayerState.field_0x35 = 0xff;
|
||||||
}
|
}
|
||||||
sub_08079064(this);
|
sub_08079064(this);
|
||||||
if ((gPlayerState.flags & PL_NO_CAP) != 0) {
|
if (gPlayerState.flags & PL_NO_CAP) {
|
||||||
animIndex = 0x58;
|
animIndex = 0x58;
|
||||||
} else {
|
} else {
|
||||||
if ((gPlayerState.flags & PL_MINISH) != 0) {
|
if (gPlayerState.flags & PL_MINISH) {
|
||||||
animIndex = 0x18;
|
animIndex = 0x18;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.animation >> 8 == 7) {
|
if (gPlayerState.animation >> 8 == 7) {
|
||||||
|
@ -1543,7 +1543,7 @@ void sub_08078FB0(Entity* this) {
|
||||||
this->spriteSettings.flipX = 0;
|
this->spriteSettings.flipX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gPlayerState.flags & PL_MOLDWORM_CAPTURED) != 0) {
|
if (gPlayerState.flags & PL_MOLDWORM_CAPTURED) {
|
||||||
animIndex = gPlayerState.animation + this->animationState;
|
animIndex = gPlayerState.animation + this->animationState;
|
||||||
} else {
|
} else {
|
||||||
animIndex = (this->animationState >> 1) + gPlayerState.animation;
|
animIndex = (this->animationState >> 1) + gPlayerState.animation;
|
||||||
|
@ -1564,7 +1564,7 @@ void sub_08079064(Entity* this) {
|
||||||
u32 maxAnimPriority;
|
u32 maxAnimPriority;
|
||||||
u32 animIndex;
|
u32 animIndex;
|
||||||
|
|
||||||
if ((gPlayerState.flags & (PL_IN_HOLE | PL_MINISH)) == 0) {
|
if (!(gPlayerState.flags & (PL_IN_HOLE | PL_MINISH))) {
|
||||||
maxAnimPriority = 0;
|
maxAnimPriority = 0;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (gActiveItems[i].animPriority > maxAnimPriority) {
|
if (gActiveItems[i].animPriority > maxAnimPriority) {
|
||||||
|
@ -1601,7 +1601,7 @@ void sub_080790E4(Entity* this) {
|
||||||
if ((gPlayerState.pushedObject & 0x80) != 0) {
|
if ((gPlayerState.pushedObject & 0x80) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (gPlayerState.pushedObject == 0) {
|
if (!gPlayerState.pushedObject) {
|
||||||
if (sub_080793E4(1)) {
|
if (sub_080793E4(1)) {
|
||||||
if (this->subtimer <= 5) {
|
if (this->subtimer <= 5) {
|
||||||
this->subtimer++;
|
this->subtimer++;
|
||||||
|
@ -1616,7 +1616,7 @@ void sub_080790E4(Entity* this) {
|
||||||
}
|
}
|
||||||
gPlayerState.field_0x35 = this->animationState;
|
gPlayerState.field_0x35 = this->animationState;
|
||||||
gPlayerState.framestate = PL_STATE_PUSH;
|
gPlayerState.framestate = PL_STATE_PUSH;
|
||||||
if ((gPlayerState.flags & PL_NO_CAP) != 0) {
|
if (gPlayerState.flags & PL_NO_CAP) {
|
||||||
gPlayerState.animation = ANIM_PUSH_NOCAP;
|
gPlayerState.animation = ANIM_PUSH_NOCAP;
|
||||||
} else {
|
} else {
|
||||||
gPlayerState.animation = ANIM_PUSH;
|
gPlayerState.animation = ANIM_PUSH;
|
||||||
|
@ -1644,10 +1644,10 @@ void SetPlayerActionNormal(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetPlayerAnimationAndAction(void) {
|
void ResetPlayerAnimationAndAction(void) {
|
||||||
if ((gPlayerState.flags & PL_HIDDEN) == 0) {
|
if (!(gPlayerState.flags & PL_HIDDEN)) {
|
||||||
gPlayerEntity.spriteSettings.draw = 3;
|
gPlayerEntity.spriteSettings.draw = 3;
|
||||||
}
|
}
|
||||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
if (!(gPlayerState.flags & PL_MINISH)) {
|
||||||
gPlayerEntity.spritePriority.b1 = 1;
|
gPlayerEntity.spritePriority.b1 = 1;
|
||||||
PlayerSetNormalAndCollide();
|
PlayerSetNormalAndCollide();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1666,7 +1666,7 @@ void PlayerSetNormalAndCollide(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerMinishSetNormalAndCollide(void) {
|
void PlayerMinishSetNormalAndCollide(void) {
|
||||||
if ((gPlayerState.flags & PL_HIDDEN) == 0) {
|
if (!(gPlayerState.flags & PL_HIDDEN)) {
|
||||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||||
gPlayerEntity.spriteSettings.draw = 3;
|
gPlayerEntity.spriteSettings.draw = 3;
|
||||||
}
|
}
|
||||||
|
@ -1692,12 +1692,12 @@ ASM_FUNC("asm/non_matching/playerUtils/sub_080792D8.inc", void sub_080792D8())
|
||||||
|
|
||||||
bool32 sub_080793E4(u32 param_1) {
|
bool32 sub_080793E4(u32 param_1) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
if (gPlayerState.swim_state == 0) {
|
if (!gPlayerState.swim_state) {
|
||||||
tmp = gUnk_0811C0F8[gPlayerEntity.animationState >> 1];
|
tmp = gUnk_0811C0F8[gPlayerEntity.animationState >> 1];
|
||||||
} else {
|
} else {
|
||||||
tmp = gUnk_0811C0F8[gPlayerEntity.direction >> 2];
|
tmp = gUnk_0811C0F8[gPlayerEntity.direction >> 2];
|
||||||
}
|
}
|
||||||
if (sub_08079778() && ((gPlayerState.playerInput.heldInput & tmp) != 0)) {
|
if (sub_08079778() && (gPlayerState.playerInput.heldInput & tmp)) {
|
||||||
if (param_1 != 0) {
|
if (param_1 != 0) {
|
||||||
if (!sub_080B1BA4(GetPlayerTilePos(), gPlayerEntity.collisionLayer, param_1)) {
|
if (!sub_080B1BA4(GetPlayerTilePos(), gPlayerEntity.collisionLayer, param_1)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1719,8 +1719,8 @@ void RespawnPlayer(void) {
|
||||||
player->zVelocity = 0;
|
player->zVelocity = 0;
|
||||||
player->knockbackDuration = 0;
|
player->knockbackDuration = 0;
|
||||||
ResetPlayerPosition();
|
ResetPlayerPosition();
|
||||||
if ((gPlayerState.flags & PL_GYORG_FIGHT) == 0) {
|
if (!(gPlayerState.flags & PL_GYORG_FIGHT)) {
|
||||||
if ((gPlayerState.flags & PL_FLAGS10000) != 0) {
|
if (gPlayerState.flags & PL_FLAGS10000) {
|
||||||
player->x.HALF.HI = gPlayerState.lilypad->x.HALF.HI;
|
player->x.HALF.HI = gPlayerState.lilypad->x.HALF.HI;
|
||||||
player->y.HALF.HI = gPlayerState.lilypad->y.HALF.HI;
|
player->y.HALF.HI = gPlayerState.lilypad->y.HALF.HI;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1771,9 +1771,9 @@ bool32 sub_08079550(void) {
|
||||||
u32 tilePos2;
|
u32 tilePos2;
|
||||||
u32 tilePos1;
|
u32 tilePos1;
|
||||||
|
|
||||||
if (gDiggingCaveEntranceTransition.isDiggingCave == 0) {
|
if (!gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||||
if ((gPlayerState.dash_state == 0 || (gPlayerState.flags & PL_BURNING)) &&
|
if ((!gPlayerState.dash_state || (gPlayerState.flags & PL_BURNING)) &&
|
||||||
(gPlayerState.swim_state != 0 || (gPlayerState.sword_state & 0x40) ||
|
(gPlayerState.swim_state || (gPlayerState.sword_state & 0x40) ||
|
||||||
gPlayerEntity.direction != gPlayerState.direction || (gPlayerEntity.direction & DIR_NOT_MOVING_CHECK))) {
|
gPlayerEntity.direction != gPlayerState.direction || (gPlayerEntity.direction & DIR_NOT_MOVING_CHECK))) {
|
||||||
gPlayerEntity.subtimer = 0;
|
gPlayerEntity.subtimer = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1821,7 +1821,7 @@ void sub_08079708(Entity* this) {
|
||||||
this->action = 0xa;
|
this->action = 0xa;
|
||||||
this->subAction = 0;
|
this->subAction = 0;
|
||||||
sub_080085B0(this);
|
sub_080085B0(this);
|
||||||
if ((gPlayerState.flags & (PL_CAPTURED | PL_DISABLE_ITEMS)) == 0) {
|
if (!(gPlayerState.flags & (PL_CAPTURED | PL_DISABLE_ITEMS))) {
|
||||||
SetPlayerEventPriority();
|
SetPlayerEventPriority();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1848,7 +1848,7 @@ void sub_08079744(Entity* this) {
|
||||||
|
|
||||||
bool32 sub_08079778(void) {
|
bool32 sub_08079778(void) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
if (gPlayerState.swim_state == 0) {
|
if (!gPlayerState.swim_state) {
|
||||||
tmp = gUnk_0811C108[gPlayerEntity.animationState >> 1];
|
tmp = gUnk_0811C108[gPlayerEntity.animationState >> 1];
|
||||||
} else {
|
} else {
|
||||||
tmp = gUnk_0811C108[gPlayerEntity.direction >> 2];
|
tmp = gUnk_0811C108[gPlayerEntity.direction >> 2];
|
||||||
|
@ -1864,20 +1864,20 @@ u32 sub_080797C4(void) {
|
||||||
void sub_080797EC(void) {
|
void sub_080797EC(void) {
|
||||||
u32 animation;
|
u32 animation;
|
||||||
|
|
||||||
if ((gPlayerState.flags & PL_NO_CAP) != 0) {
|
if (gPlayerState.flags & PL_NO_CAP) {
|
||||||
if (gPlayerState.heldObject != 0) {
|
if (gPlayerState.heldObject) {
|
||||||
animation = ANIM_CARRY_NOCAP;
|
animation = ANIM_CARRY_NOCAP;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status) {
|
||||||
animation = ANIM_SHIELD_WALK_NOCAP;
|
animation = ANIM_SHIELD_WALK_NOCAP;
|
||||||
} else if (gPlayerState.bow_state == 0) {
|
} else if (!gPlayerState.bow_state) {
|
||||||
if (gPlayerState.swim_state != 0) {
|
if (gPlayerState.swim_state) {
|
||||||
animation = ANIM_SWIM_MOVE;
|
animation = ANIM_SWIM_MOVE;
|
||||||
} else {
|
} else {
|
||||||
animation = ANIM_SWORD_CHARGE_WALK;
|
animation = ANIM_SWORD_CHARGE_WALK;
|
||||||
if ((gPlayerState.sword_state & 0x48) != 0) {
|
if (gPlayerState.sword_state & 0x48) {
|
||||||
gPlayerState.prevAnim = 0x6c;
|
gPlayerState.prevAnim = 0x6c;
|
||||||
return;
|
return;
|
||||||
} else if (gPlayerState.sword_state == 0) {
|
} else if (!gPlayerState.sword_state) {
|
||||||
if (gPlayerState.framestate == PL_STATE_IDLE) {
|
if (gPlayerState.framestate == PL_STATE_IDLE) {
|
||||||
gPlayerState.framestate = PL_STATE_WALK;
|
gPlayerState.framestate = PL_STATE_WALK;
|
||||||
}
|
}
|
||||||
|
@ -1896,27 +1896,27 @@ void sub_080797EC(void) {
|
||||||
animation = ANIM_BOW_WALK;
|
animation = ANIM_BOW_WALK;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.field_0x1c != 0) {
|
if (gPlayerState.field_0x1c) {
|
||||||
return;
|
return;
|
||||||
} else if (gPlayerState.heldObject != 0) {
|
} else if (gPlayerState.heldObject) {
|
||||||
animation = ANIM_CARRY;
|
animation = ANIM_CARRY;
|
||||||
} else if (gPlayerState.dash_state != 0) {
|
} else if (gPlayerState.dash_state) {
|
||||||
animation = ANIM_DASH;
|
animation = ANIM_DASH;
|
||||||
} else if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
|
} else if (gPlayerState.flags & PL_IN_MINECART) {
|
||||||
animation = ANIM_MINECART;
|
animation = ANIM_MINECART;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status) {
|
||||||
animation = ANIM_SHIELD_WALK;
|
animation = ANIM_SHIELD_WALK;
|
||||||
} else if (gPlayerState.bow_state != 0) {
|
} else if (gPlayerState.bow_state) {
|
||||||
animation = ANIM_BOW_WALK;
|
animation = ANIM_BOW_WALK;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.swim_state != 0) {
|
if (gPlayerState.swim_state) {
|
||||||
animation = ANIM_SWIM_MOVE;
|
animation = ANIM_SWIM_MOVE;
|
||||||
} else {
|
} else {
|
||||||
animation = ANIM_SWORD_CHARGE_WALK;
|
animation = ANIM_SWORD_CHARGE_WALK;
|
||||||
if ((gPlayerState.sword_state & 0x48) != 0) {
|
if (gPlayerState.sword_state & 0x48) {
|
||||||
gPlayerState.prevAnim = 0x6c;
|
gPlayerState.prevAnim = 0x6c;
|
||||||
return;
|
return;
|
||||||
} else if (gPlayerState.sword_state != 0) {
|
} else if (gPlayerState.sword_state) {
|
||||||
animation = ANIM_SWORD_CHARGE_WALK;
|
animation = ANIM_SWORD_CHARGE_WALK;
|
||||||
if (sub_080793E4(0)) {
|
if (sub_080793E4(0)) {
|
||||||
if (sub_080B1B44(GetPlayerTilePos(), (u32)gPlayerEntity.collisionLayer) != 0xff) {
|
if (sub_080B1B44(GetPlayerTilePos(), (u32)gPlayerEntity.collisionLayer) != 0xff) {
|
||||||
|
@ -1933,7 +1933,6 @@ void sub_080797EC(void) {
|
||||||
} else {
|
} else {
|
||||||
// Change to test animations I guess
|
// Change to test animations I guess
|
||||||
animation = ANIM_WALK;
|
animation = ANIM_WALK;
|
||||||
// animation = 12;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1941,7 +1940,7 @@ void sub_080797EC(void) {
|
||||||
}
|
}
|
||||||
gPlayerState.animation = animation;
|
gPlayerState.animation = animation;
|
||||||
|
|
||||||
if (gPlayerState.shield_status == 0) {
|
if (!gPlayerState.shield_status) {
|
||||||
UpdateAnimationSingleFrame(&gPlayerEntity);
|
UpdateAnimationSingleFrame(&gPlayerEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1950,30 +1949,30 @@ void ResolvePlayerAnimation(void) {
|
||||||
u32 index;
|
u32 index;
|
||||||
u32 maxAnimPriority;
|
u32 maxAnimPriority;
|
||||||
u32 anim;
|
u32 anim;
|
||||||
if ((gPlayerState.flags & PL_NO_CAP) != 0) {
|
if (gPlayerState.flags & PL_NO_CAP) {
|
||||||
if (gPlayerState.heldObject != 0) {
|
if (gPlayerState.heldObject) {
|
||||||
anim = ANIM_CARRY_STAND_NOCAP;
|
anim = ANIM_CARRY_STAND_NOCAP;
|
||||||
} else {
|
} else {
|
||||||
if ((gPlayerState.field_0x1c | gPlayerState.moleMittsState) != 0) {
|
if (gPlayerState.field_0x1c | gPlayerState.moleMittsState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((gPlayerState.flags & PL_CONVEYOR_PUSHED) != 0) {
|
if (gPlayerState.flags & PL_CONVEYOR_PUSHED) {
|
||||||
anim = ANIM_JUMP;
|
anim = ANIM_JUMP;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status) {
|
||||||
anim = ANIM_SHIELD_NOCAP;
|
anim = ANIM_SHIELD_NOCAP;
|
||||||
} else if (gPlayerState.bow_state != 0) {
|
} else if (gPlayerState.bow_state) {
|
||||||
anim = ANIM_BOW_CHARGE;
|
anim = ANIM_BOW_CHARGE;
|
||||||
} else if (gPlayerState.swim_state != 0) {
|
} else if (gPlayerState.swim_state) {
|
||||||
anim = ANIM_SWIM_STILL;
|
anim = ANIM_SWIM_STILL;
|
||||||
} else {
|
} else {
|
||||||
if ((gPlayerState.sword_state & 0x48) != 0) {
|
if (gPlayerState.sword_state & 0x48) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (gPlayerState.sword_state == 0) {
|
if (!gPlayerState.sword_state) {
|
||||||
if (gPlayerState.attack_status != 0) {
|
if (gPlayerState.attack_status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((gPlayerState.flags & PL_USE_PORTAL) != 0) {
|
if (gPlayerState.flags & PL_USE_PORTAL) {
|
||||||
switch (gArea.portal_type) {
|
switch (gArea.portal_type) {
|
||||||
case PT_5:
|
case PT_5:
|
||||||
anim = ANIM_DEFAULT_NOCAP;
|
anim = ANIM_DEFAULT_NOCAP;
|
||||||
|
@ -1994,41 +1993,41 @@ void ResolvePlayerAnimation(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.heldObject != 0) {
|
if (gPlayerState.heldObject) {
|
||||||
anim = ANIM_CARRY_STAND;
|
anim = ANIM_CARRY_STAND;
|
||||||
} else {
|
} else {
|
||||||
if ((gPlayerState.field_0x1c | gPlayerState.moleMittsState) != 0) {
|
if (gPlayerState.field_0x1c | gPlayerState.moleMittsState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((gPlayerState.flags & PL_MOLDWORM_CAPTURED) != 0) {
|
if (gPlayerState.flags & PL_MOLDWORM_CAPTURED) {
|
||||||
anim = ANIM_MOLDWORM_CAPTURED;
|
anim = ANIM_MOLDWORM_CAPTURED;
|
||||||
} else if ((gPlayerState.flags & PL_CONVEYOR_PUSHED) != 0) {
|
} else if (gPlayerState.flags & PL_CONVEYOR_PUSHED) {
|
||||||
anim = ANIM_JUMP;
|
anim = ANIM_JUMP;
|
||||||
} else if (gPlayerState.dash_state != 0) {
|
} else if (gPlayerState.dash_state) {
|
||||||
anim = ANIM_DASH;
|
anim = ANIM_DASH;
|
||||||
} else if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
|
} else if (gPlayerState.flags & PL_IN_MINECART) {
|
||||||
anim = ANIM_MINECART_PAUSE;
|
anim = ANIM_MINECART_PAUSE;
|
||||||
} else if (gPlayerState.shield_status != 0) {
|
} else if (gPlayerState.shield_status) {
|
||||||
anim = ANIM_SHIELD;
|
anim = ANIM_SHIELD;
|
||||||
} else if (gPlayerState.bow_state != 0) {
|
} else if (gPlayerState.bow_state) {
|
||||||
anim = ANIM_BOW_CHARGE;
|
anim = ANIM_BOW_CHARGE;
|
||||||
} else if (gPlayerState.swim_state != 0) {
|
} else if (gPlayerState.swim_state) {
|
||||||
anim = ANIM_SWIM_STILL;
|
anim = ANIM_SWIM_STILL;
|
||||||
} else {
|
} else {
|
||||||
if ((gPlayerState.sword_state & 0x48) != 0) {
|
if (gPlayerState.sword_state & 0x48) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((gPlayerState.flags & PL_USE_PORTAL) != 0) {
|
if (gPlayerState.flags & PL_USE_PORTAL) {
|
||||||
anim = (gArea.portal_type == PT_JAR) ? ANIM_IN_POT : ANIM_PORTAL;
|
anim = (gArea.portal_type == PT_JAR) ? ANIM_IN_POT : ANIM_PORTAL;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.sword_state != 0) {
|
if (gPlayerState.sword_state) {
|
||||||
anim = ANIM_SWORD_CHARGE;
|
anim = ANIM_SWORD_CHARGE;
|
||||||
} else {
|
} else {
|
||||||
if (gPlayerState.attack_status != 0) {
|
if (gPlayerState.attack_status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (gPlayerState.flags & PL_USE_LANTERN) {
|
if (gPlayerState.flags & PL_USE_LANTERN) {
|
||||||
if (gActiveItems[ACTIVE_ITEM_LANTERN].animPriority != 0) {
|
if (gActiveItems[ACTIVE_ITEM_LANTERN].animPriority) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
anim = ANIM_LANTERN_ON;
|
anim = ANIM_LANTERN_ON;
|
||||||
|
@ -2042,7 +2041,7 @@ void ResolvePlayerAnimation(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
gPlayerState.animation = anim;
|
gPlayerState.animation = anim;
|
||||||
if (gPlayerState.heldObject == 0) {
|
if (!gPlayerState.heldObject) {
|
||||||
maxAnimPriority = 0;
|
maxAnimPriority = 0;
|
||||||
for (index = 0; index < 4; index++) {
|
for (index = 0; index < 4; index++) {
|
||||||
if (gActiveItems[index].animPriority > maxAnimPriority) {
|
if (gActiveItems[index].animPriority > maxAnimPriority) {
|
||||||
|
|
|
@ -1548,11 +1548,12 @@ void sub_0807F100(Entity* entity, ScriptExecutionContext* context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0807F128(Entity* entity, ScriptExecutionContext* context) {
|
void sub_0807F128(Entity* entity, ScriptExecutionContext* context) {
|
||||||
static const u8 sAnimations[] = { 6, 2, 6, 2, 4, 6, 4, 2 };
|
static const u8 sAnimationStates[] = { IdleWest, IdleEast, IdleWest, IdleEast,
|
||||||
|
IdleSouth, IdleWest, IdleSouth, IdleEast };
|
||||||
static const u8 sValues[] = { 0xa, 0x14, 0x1e, 0x12, 0x1c, 0x26, 0xc, 0x18 };
|
static const u8 sValues[] = { 0xa, 0x14, 0x1e, 0x12, 0x1c, 0x26, 0xc, 0x18 };
|
||||||
|
|
||||||
u32 rand = Random();
|
u32 rand = Random();
|
||||||
entity->animationState = sAnimations[rand & 7];
|
entity->animationState = sAnimationStates[rand & 7];
|
||||||
context->unk_1A = sValues[(rand >> 8) % 8];
|
context->unk_1A = sValues[(rand >> 8) % 8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue