mirror of https://github.com/zeldaret/tmc.git
Filled in the directions
This commit is contained in:
parent
561b8da657
commit
e689c1b32d
|
@ -95,6 +95,12 @@ typedef enum {
|
|||
CONTROL_DISABLED,
|
||||
} PlayerControlMode;
|
||||
|
||||
typedef enum {
|
||||
DIR_DIAGONAL = 0x4,
|
||||
DIR_NOT_MOVING_CHECK = 0x80,
|
||||
DIR_NONE = 0xff,
|
||||
} PlayerDirections;
|
||||
|
||||
typedef enum {
|
||||
PL_BUSY = 0x1,
|
||||
PL_FLAGS2 = 0x2,
|
||||
|
@ -306,11 +312,10 @@ typedef enum {
|
|||
ANIM_PORTAL = 0x2c2,
|
||||
ANIM_PORTAL_SHRINK = 0x2c3,
|
||||
ANIM_DROWN_END = 0x2ce,
|
||||
// I literally can't tell the difference in the following
|
||||
ANIM_CLIMB = 0x2cf,
|
||||
ANIM_CLIMB2 = 0x2d0,
|
||||
ANIM_CLIMB3 = 0x2d1,
|
||||
ANIM_CLIMB4 = 0x2d2,
|
||||
ANIM_CLIMB1_UP = 0x2cf,
|
||||
ANIM_CLIMB2_UP = 0x2d0,
|
||||
ANIM_CLIMB1_DOWN = 0x2d1,
|
||||
ANIM_CLIMB2_DOWN = 0x2d2,
|
||||
ANIM_CLIMB_FROM_TOP = 0x2d3,
|
||||
ANIM_CLIMB_LEFT = 0x2d4,
|
||||
ANIM_CLIMB_RIGHT = 0x2d5,
|
||||
|
@ -392,7 +397,7 @@ typedef enum {
|
|||
ANIM_DROWN_MINISH = 0xc19,
|
||||
ANIM_DIE1_MINISH = 0xc1a,
|
||||
ANIM_DIE2_MINISH = 0xc1b,
|
||||
ANIM_C1C = 0xc1c,
|
||||
ANIM_DIVE_MINISH = 0xc1c,
|
||||
} PlayerAnimation;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -198,7 +198,7 @@ u32 UpdatePlayerCollision(void) {
|
|||
} else {
|
||||
direction = gPlayerState.direction;
|
||||
}
|
||||
if (((direction & 0x83) == 0) && (gPlayerState.field_0xa == 0)) {
|
||||
if (((direction & (DIR_NOT_MOVING_CHECK | 0x3)) == 0) && (gPlayerState.field_0xa == 0)) {
|
||||
index = sub_0807BDB8(&gPlayerEntity, direction >> 2);
|
||||
if (index != 0xff && (gRoomControls.scroll_flags & 4) == 0) {
|
||||
ptr1 = &gUnk_080B4490[index * 2];
|
||||
|
@ -254,10 +254,10 @@ u32 UpdatePlayerCollision(void) {
|
|||
if (gPlayerState.field_0xa != 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != 0) {
|
||||
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) {
|
||||
return 0;
|
||||
}
|
||||
if ((gPlayerEntity.direction & 0x80) != 0) {
|
||||
if ((gPlayerEntity.direction & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if (sub_080B1B44(position, gPlayerEntity.collisionLayer) != 0xf) {
|
||||
|
@ -356,7 +356,7 @@ u32 UpdatePlayerCollision(void) {
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != 0) {
|
||||
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) {
|
||||
return 0;
|
||||
}
|
||||
if ((gPlayerEntity.direction & 0x80) != 0) {
|
||||
|
@ -415,7 +415,7 @@ u32 UpdatePlayerCollision(void) {
|
|||
if ((animationState1 & 0xff) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) != 0) {
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((gPlayerEntity.frame & 2) == 0) {
|
||||
|
@ -555,7 +555,7 @@ u32 UpdatePlayerCollision(void) {
|
|||
if (animationState3 == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) != 0) {
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((gPlayerEntity.frame & 1) == 0) {
|
||||
|
@ -574,7 +574,7 @@ u32 UpdatePlayerCollision(void) {
|
|||
if ((animationState2) != 4) {
|
||||
return 0;
|
||||
}
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) != 0) {
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((gPlayerEntity.frame & 1) == 0) {
|
||||
|
@ -595,7 +595,7 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) {
|
|||
u16 temp4;
|
||||
|
||||
uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1];
|
||||
if ((((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) == 0) && ((gPlayerEntity.frame & 1) != 0)) {
|
||||
if ((((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) == 0) && ((gPlayerEntity.frame & 1) != 0)) {
|
||||
position = (u16)(position - (-uVar1)); // necessary for match
|
||||
temp4 = sub_080B1B54(GetTileType(position, gPlayerEntity.collisionLayer));
|
||||
switch (temp4) {
|
||||
|
@ -712,18 +712,18 @@ bool32 sub_0801A4F8(void) {
|
|||
if (GetInventoryValue(ITEM_POWER_BRACELETS) != 1) {
|
||||
return FALSE;
|
||||
}
|
||||
if ((gPlayerState.direction & 0x80) != 0) {
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if (gPlayerState.direction != gPlayerEntity.direction) {
|
||||
return FALSE;
|
||||
}
|
||||
tmp = (((gPlayerEntity.direction + 4) & 0x18) >> 3);
|
||||
tmp = (((gPlayerEntity.direction + 4) & DirectionWest) >> 3);
|
||||
if ((gUnk_080B44A0[tmp] & gPlayerEntity.collisions) == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & 0x80) != 0) {
|
||||
if (((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if ((gPlayerEntity.frame & 1) == 0) {
|
||||
|
|
|
@ -445,7 +445,7 @@ void AcroBandit_Type1Action4(Entity* this) {
|
|||
}
|
||||
}
|
||||
|
||||
if (this->direction & 0xf)
|
||||
if (this->direction & (0x3 | DirectionEast | DIR_DIAGONAL))
|
||||
this->spriteSettings.flipX = (this->direction >> 4 ^ 1);
|
||||
|
||||
ProcessMovement0(this);
|
||||
|
@ -486,7 +486,7 @@ void AcroBandit_Type1Action6(Entity* this) {
|
|||
this->action = 7;
|
||||
dir = fallDirections[this->field_0x74.HALF.LO * 5 + this->type2];
|
||||
this->direction = dir;
|
||||
if (dir >= 0x10) {
|
||||
if (dir >= DirectionSouth) {
|
||||
this->spriteSettings.flipX = 1;
|
||||
} else {
|
||||
this->spriteSettings.flipX = 0;
|
||||
|
@ -570,7 +570,7 @@ static void sub_080322E8(Entity* this) {
|
|||
}
|
||||
} else {
|
||||
u8 tmp = this->direction;
|
||||
if (tmp & 0xF) {
|
||||
if (tmp & (0x3 | DirectionEast | DIR_DIAGONAL)) {
|
||||
tmp >>= 4;
|
||||
tmp ^= 1;
|
||||
if (tmp != this->spriteSettings.flipX) {
|
||||
|
|
|
@ -105,7 +105,8 @@ void sub_080218CC(Entity* this) {
|
|||
if (this->subAction == 0) {
|
||||
this->subAction = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f;
|
||||
this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
|
||||
this->speed = 0x100;
|
||||
this->zVelocity = Q_16_16(1.125);
|
||||
}
|
||||
|
@ -244,9 +245,9 @@ void sub_08021B64(Entity* this) {
|
|||
this->zVelocity = Q_16_16(1.0);
|
||||
((u8*)&this->field_0x86)[1] = 0;
|
||||
if (gPlayerEntity.direction != 0xff) {
|
||||
this->direction = 0x10 ^ gPlayerEntity.direction;
|
||||
this->direction = DirectionSouth ^ gPlayerEntity.direction;
|
||||
} else {
|
||||
this->direction = (gPlayerEntity.animationState << 2) ^ 0x10;
|
||||
this->direction = (gPlayerEntity.animationState << 2) ^ DirectionSouth;
|
||||
}
|
||||
InitializeAnimation(this, 5);
|
||||
} else {
|
||||
|
|
|
@ -10,18 +10,20 @@
|
|||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
#define DIR_NOT_MOVING_CHECK 0x80
|
||||
|
||||
void BladeTrap(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->child = GetCurrentRoomProperty(this->type);
|
||||
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD);
|
||||
}
|
||||
if (!(this->direction & 0x80)) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
LinearMoveUpdate(this);
|
||||
}
|
||||
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
if (!(this->direction & 0x80)) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
EnqueueSFX(SFX_METAL_CLINK);
|
||||
}
|
||||
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD);
|
||||
|
|
|
@ -62,7 +62,7 @@ void Bobomb_OnCollision(Entity* this) {
|
|||
this->zVelocity = Q_16_16(1.5);
|
||||
this->speed = 0;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
InitializeAnimation(this, this->direction >> 4 | 6);
|
||||
InitializeAnimation(this, this->direction >> 4 | IdleWest);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void sub_0802C83C(Entity* this) {
|
|||
} else {
|
||||
this->field_0x82.HALF.LO = 2;
|
||||
this->timer = 120;
|
||||
InitializeAnimation(this, (this->direction >> 4) | 6);
|
||||
InitializeAnimation(this, (this->direction >> 4) | IdleWest);
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ void sub_0802C8D8(Entity* this) {
|
|||
this->action = 1;
|
||||
this->timer = 60;
|
||||
this->subtimer = 0;
|
||||
this->direction = (Random() & 0x18) | 4;
|
||||
this->direction = (Random() & 0x18) | DIR_DIAGONAL;
|
||||
this->carryFlags = 0;
|
||||
this->gustJarFlags = 0x12;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
|
@ -163,7 +163,7 @@ void sub_0802C91C(Entity* this) {
|
|||
if (this->field_0x82.HALF.LO) {
|
||||
if (this->collisions != COL_NONE) {
|
||||
sub_0800417E(this, this->collisions);
|
||||
InitializeAnimation(this, (this->direction >> 4) | 2);
|
||||
InitializeAnimation(this, (this->direction >> 4) | IdleEast);
|
||||
}
|
||||
if (--this->timer == 0) {
|
||||
sub_0802CBC4(this);
|
||||
|
@ -180,7 +180,7 @@ void sub_0802C91C(Entity* this) {
|
|||
}
|
||||
if (--this->timer == 0) {
|
||||
this->timer = 60;
|
||||
this->direction = (this->direction + 8) & 0x1c;
|
||||
this->direction = (this->direction + 8) & (DirectionWest | DIR_DIAGONAL);
|
||||
InitializeAnimation(this, this->direction >> 4);
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ void sub_0802C9D0(Entity* this) {
|
|||
this->spritePriority.b1 = 0;
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0802CC18(this);
|
||||
InitializeAnimation(this, (this->direction >> 4) | 6);
|
||||
InitializeAnimation(this, (this->direction >> 4) | IdleWest);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ void sub_0802CA10(Entity* this) {
|
|||
}
|
||||
} else {
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
this->direction = (((gPlayerEntity.animationState) << 2) | 4) & 0x1c;
|
||||
this->direction = (((gPlayerEntity.animationState) << 2) | IdleSouth) & (DIR_DIAGONAL | DirectionWest);
|
||||
sub_0802CC18(this);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
@ -234,8 +234,8 @@ void sub_0802CA94(Entity* this) {
|
|||
this->speed = 0;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->direction = ((gPlayerEntity.animationState << 2) | 4) & 0x1c;
|
||||
InitializeAnimation(this, (this->direction >> 4) | 6);
|
||||
this->direction = ((gPlayerEntity.animationState << 2) | IdleSouth) & (DirectionWest | DIR_DIAGONAL);
|
||||
InitializeAnimation(this, (this->direction >> 4) | IdleWest);
|
||||
}
|
||||
|
||||
void sub_0802CAF8(Entity* this) {
|
||||
|
@ -264,7 +264,7 @@ void sub_0802CB68(Entity* this) {
|
|||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->direction = Random() & 0x18;
|
||||
this->direction |= 4;
|
||||
this->direction |= IdleSouth;
|
||||
COLLISION_ON(this);
|
||||
if (this->field_0x82.HALF.LO) {
|
||||
this->timer = 200;
|
||||
|
|
|
@ -141,10 +141,10 @@ void sub_0802A9A8(Entity* this) {
|
|||
this->field_0x82.HWORD = 1;
|
||||
if (this->field_0x80.HALF.LO) {
|
||||
this->x.HALF.HI = gRoomControls.scroll_x - 0x10;
|
||||
this->direction = 8;
|
||||
this->direction = DirectionEast;
|
||||
} else {
|
||||
this->x.HALF.HI = gRoomControls.scroll_x + 0x100;
|
||||
this->direction = 0x18;
|
||||
this->direction = DirectionWest;
|
||||
}
|
||||
this->y.HALF.HI = gRoomControls.scroll_y + 0x40;
|
||||
this->timer = 128;
|
||||
|
@ -221,7 +221,7 @@ void sub_0802AAC0(Entity* this) {
|
|||
#ifndef EU
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->field_0x78.HALF.HI = 4;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
#endif
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ void BusinessScrub_Action0(Entity* this) {
|
|||
this->field_0x78.HWORD = this->x.HALF.HI;
|
||||
this->field_0x7a.HWORD = this->y.HALF.HI;
|
||||
this->animationState = 0;
|
||||
this->direction = 0x10;
|
||||
this->direction = DirectionSouth;
|
||||
sub_08028E9C(this);
|
||||
if ((*(u8*)this->field_0x7c.WORD & 1) || CheckFlags(this->field_0x86.HWORD)) {
|
||||
this->action = 4;
|
||||
|
@ -455,8 +455,8 @@ void sub_080290FC(Entity* this) {
|
|||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
if ((this->timer < 16) && ((this->timer & 1) == 0)) {
|
||||
s32 sVar3 = ((this->direction & 0x10) != 0) ? -1 : 1;
|
||||
if ((this->direction & 8) != 0) {
|
||||
s32 sVar3 = (this->direction & DirectionSouth) ? -1 : 1;
|
||||
if (this->direction & DirectionEast) {
|
||||
this->x.HALF.HI += ((this->timer & 8) != 0) ? -sVar3 : sVar3;
|
||||
} else {
|
||||
this->y.HALF.HI += ((this->timer & 8) != 0) ? sVar3 : -sVar3;
|
||||
|
|
|
@ -34,7 +34,7 @@ void sub_0802B540(Entity* this) {
|
|||
this->timer--;
|
||||
} else {
|
||||
u32 direction = sub_0804A024(this, 1, 0xc);
|
||||
if (direction != 0xff) {
|
||||
if (direction != DIR_NONE) {
|
||||
this->action = 2;
|
||||
this->speed = 0x40;
|
||||
this->direction = direction;
|
||||
|
|
|
@ -119,10 +119,11 @@ void sub_08022AA4(Entity* this) {
|
|||
if (!sub_08049FA0(this) && (rand >> 8) & 3) {
|
||||
this->direction = sub_08049EE4(this);
|
||||
} else {
|
||||
this->direction = (rand >> 0x10) & 0x1f;
|
||||
this->direction =
|
||||
(rand >> 0x10) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
|
||||
}
|
||||
|
||||
if (this->direction & 0xf)
|
||||
if (this->direction & (0x3 | DirectionEast | DIR_DIAGONAL))
|
||||
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
|
||||
}
|
||||
|
||||
|
@ -144,7 +145,7 @@ void sub_08022B44(Entity* this) {
|
|||
this->zVelocity = Q_16_16(0.75);
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
|
||||
if (this->direction & 0xf)
|
||||
if (this->direction & (0x3 | DIR_DIAGONAL | DirectionEast))
|
||||
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
|
||||
|
||||
EnqueueSFX(SFX_VO_CHEEP);
|
||||
|
|
|
@ -117,7 +117,7 @@ void sub_08045524(Entity* this) {
|
|||
|
||||
this->zVelocity = Q_16_16(1.75);
|
||||
tmp = sub_0804A024(this, 1, 8);
|
||||
if (tmp != 0xff && (Random() & 3) == 0) {
|
||||
if (tmp != DIR_NONE && (Random() & 3) == 0) {
|
||||
this->timer = Random() & 3;
|
||||
this->direction = DirectionRound(tmp);
|
||||
} else {
|
||||
|
|
|
@ -215,9 +215,9 @@ void sub_0802BE80(Entity* this) {
|
|||
}
|
||||
|
||||
void sub_0802BEBC(Entity* this) {
|
||||
this->direction ^= 0x10;
|
||||
this->direction ^= DirectionSouth;
|
||||
ProcessMovement2(this);
|
||||
this->direction ^= 0x10;
|
||||
this->direction ^= DirectionSouth;
|
||||
if (!sub_080044EC(this, Q_16_16(0.125))) {
|
||||
sub_0802C1C0(this);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ void sub_0803CD6C(Entity* this) {
|
|||
void sub_0803CDA8(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
LinearMoveUpdate(this);
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ void sub_0803CE14(Entity* this) {
|
|||
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD);
|
||||
|
||||
direction = this->direction;
|
||||
if (direction & 0x80) {
|
||||
if (direction & DIR_NOT_MOVING_CHECK) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void Leever_Idle(Entity* this) {
|
|||
if (Leever_PlayerInRange(this, Random() & 0x1f)) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & 0x1f;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & (0x3 | DirectionNorthWest);
|
||||
InitializeAnimation(this, LeeverAnimation_DigUp);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
} else {
|
||||
|
|
|
@ -369,16 +369,16 @@ void sub_08029EEC(Entity* this) {
|
|||
|
||||
void sub_08029F0C(Entity* this) {
|
||||
switch (this->direction >> 3) {
|
||||
case 0:
|
||||
case 0: // UP
|
||||
this->field_0x78.HWORD = this->y.HALF.HI - 0x10;
|
||||
break;
|
||||
case 1:
|
||||
case 1: // RIGHT
|
||||
this->field_0x78.HWORD = this->x.HALF.HI + 0x10;
|
||||
break;
|
||||
case 2:
|
||||
case 2: // DOWN
|
||||
this->field_0x78.HWORD = this->y.HALF.HI + 0x10;
|
||||
break;
|
||||
case 3:
|
||||
case 3: // LEFT
|
||||
this->field_0x78.HWORD = this->x.HALF.HI - 0x10;
|
||||
break;
|
||||
}
|
||||
|
@ -386,25 +386,25 @@ void sub_08029F0C(Entity* this) {
|
|||
|
||||
bool32 sub_08029F48(Entity* this) {
|
||||
switch (this->direction >> 3) {
|
||||
case 0:
|
||||
case 0: // UP
|
||||
if (this->y.HALF.HI <= this->field_0x78.HWORD) {
|
||||
this->y.HALF.HI = this->field_0x78.HWORD;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 1: // RIGHT
|
||||
if (this->x.HALF.HI >= this->field_0x78.HWORD) {
|
||||
this->x.HALF.HI = this->field_0x78.HWORD;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 2: // DOWN
|
||||
if (this->y.HALF.HI >= this->field_0x78.HWORD) {
|
||||
this->y.HALF.HI = this->field_0x78.HWORD;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 3: // LEFT
|
||||
if (this->x.HALF.HI <= this->field_0x78.HWORD) {
|
||||
this->x.HALF.HI = this->field_0x78.HWORD;
|
||||
return TRUE;
|
||||
|
|
|
@ -509,7 +509,7 @@ void sub_0803A8B8(Entity* this) {
|
|||
|
||||
this->action = 0x10;
|
||||
this->timer = 30;
|
||||
this->direction = 0;
|
||||
this->direction = DirectionNorth;
|
||||
this->speed = 0x80;
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
|
@ -553,7 +553,7 @@ void sub_0803A978(Entity* this) {
|
|||
sub_08004596(this, 0x10);
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
if (this->direction == 0x10) {
|
||||
if (this->direction == DirectionSouth) {
|
||||
this->action = 0x12;
|
||||
this->timer = 3;
|
||||
COLLISION_OFF(this);
|
||||
|
|
|
@ -561,7 +561,7 @@ void sub_0803473C(Entity* this) {
|
|||
if (roomX + 0xe0 < this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->direction = 8;
|
||||
this->direction = DirectionEast;
|
||||
} else {
|
||||
if (playerX + 4 >= this->x.HALF.HI) {
|
||||
return;
|
||||
|
@ -569,7 +569,7 @@ void sub_0803473C(Entity* this) {
|
|||
if (roomX + 0x90 > this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->direction = 0x18;
|
||||
this->direction = DirectionWest;
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ void sub_080347B4(Entity* this) {
|
|||
if (roomX + 0xe0 < this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->direction = 8;
|
||||
this->direction = DirectionEast;
|
||||
} else {
|
||||
if (playerX + 4 >= this->x.HALF.HI) {
|
||||
return;
|
||||
|
@ -589,7 +589,7 @@ void sub_080347B4(Entity* this) {
|
|||
if (roomX + 0x90 > this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->direction = 0x18;
|
||||
this->direction = DirectionWest;
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void sub_08022F14(Entity* this) {
|
|||
}
|
||||
|
||||
this->direction += this->field_0x78.HALF.LO;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= DirectionNorthWest | 0x3;
|
||||
|
||||
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
|
||||
this->frameIndex = this->animationState;
|
||||
|
|
|
@ -182,7 +182,7 @@ void Peahat_ChargeStart(Entity* this) {
|
|||
this->action = 3;
|
||||
this->timer = 120;
|
||||
this->speed = 192;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & 0x1f;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
} else {
|
||||
sub_080205F8(this);
|
||||
|
@ -226,6 +226,8 @@ void Peahat_ChargeEnd(Entity* this) {
|
|||
}
|
||||
}
|
||||
|
||||
#define DIR_NONE 0xff
|
||||
|
||||
void Peahat_Stunned(Entity* this) {
|
||||
switch (this->animationState) {
|
||||
default:
|
||||
|
@ -236,7 +238,7 @@ void Peahat_Stunned(Entity* this) {
|
|||
this->hitType = 0x71;
|
||||
}
|
||||
|
||||
if (this->direction == 0xff)
|
||||
if (this->direction == DIR_NONE)
|
||||
this->direction = this->knockbackDirection;
|
||||
|
||||
ProcessMovement0(this);
|
||||
|
@ -364,7 +366,7 @@ void sub_08020604(Entity* this) {
|
|||
this->direction = sub_08049EE4(this);
|
||||
} else {
|
||||
this->direction += this->field_0x80.HALF.LO;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= (0x3 | DirectionNorthWest);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -387,7 +387,7 @@ void sub_080244E8(Entity* this) {
|
|||
if (tmp == 0) {
|
||||
this->field_0x80.HALF.LO++;
|
||||
this->timer = 12;
|
||||
this->direction = 0x10;
|
||||
this->direction = DirectionSouth;
|
||||
this->speed = tmp;
|
||||
this->cutsceneBeh.HALF.LO = 0;
|
||||
this->flags2 &= 0xfc;
|
||||
|
@ -554,13 +554,13 @@ void sub_08024940(Entity* this) {
|
|||
}
|
||||
|
||||
void sub_080249DC(Entity* this) {
|
||||
u8 direction = ((this->direction + 2) & 0x1c) >> 2;
|
||||
u8 direction = ((this->direction + 2) & DirectionNorthWest) >> 2;
|
||||
this->animationState = direction;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
|
||||
void sub_080249F4(Entity* this) {
|
||||
u32 direction = ((this->direction + 2) & 0x1f);
|
||||
u32 direction = ((this->direction + 2) & (0x3 | DirectionNorthWest));
|
||||
direction >>= 2;
|
||||
if (direction != this->animationState) {
|
||||
this->animationState = direction;
|
||||
|
@ -770,8 +770,8 @@ void sub_08024D00(Entity* this) {
|
|||
this->field_0x80.HALF.LO++;
|
||||
this->timer = (Random() & 0xf) + 32;
|
||||
|
||||
this->direction += this->field_0x80.HALF.HI ? 4 : 0x1c;
|
||||
this->direction &= 0x1f;
|
||||
this->direction += this->field_0x80.HALF.HI ? DirectionNorthEast : DirectionNorthWest;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
|
||||
this->field_0x80.HALF.HI ^= 0x40;
|
||||
sub_08024A14(this, 3, 0x10);
|
||||
|
@ -783,8 +783,8 @@ void sub_08024D00(Entity* this) {
|
|||
this->timer = (Random() & 0x1f) + 32;
|
||||
} else {
|
||||
if (--this->subtimer == 0) {
|
||||
this->direction += this->field_0x80.HALF.HI ? 1 : 0x1f;
|
||||
this->direction &= 0x1f;
|
||||
this->direction += this->field_0x80.HALF.HI ? 1 : (0x3 | DirectionNorthWest);
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
|
||||
this->subtimer = 16;
|
||||
sub_080249DC(this);
|
||||
|
|
|
@ -338,7 +338,7 @@ void sub_080255AC(Entity* this) {
|
|||
}
|
||||
tmp -= 7;
|
||||
|
||||
this->direction = (GetFacingDirection(ent, this) + tmp) & 0x1f;
|
||||
this->direction = (GetFacingDirection(ent, this) + tmp) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
|
||||
if (this->field_0x78.HWORD == 0) {
|
||||
|
@ -378,7 +378,7 @@ void sub_080256B4(Entity* this) {
|
|||
this->action = 1;
|
||||
this->timer = (Random() & 3) + 4;
|
||||
this->subtimer = 30;
|
||||
this->direction = (this->direction + 7 + ((s32)Random() % 7) * 4) & 0x1c;
|
||||
this->direction = (this->direction + 7 + ((s32)Random() % 7) * 4) & DirectionNorthWest;
|
||||
this->field_0x78.HWORD = gUnk_080CC000[Random() & 0xf];
|
||||
this->field_0x7a.HALF.LO = ((s32)Random() % 0x18) << 1;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
|
|
|
@ -39,7 +39,7 @@ void Rollobite_OnCollision(Entity* this) {
|
|||
if (this->hitType == 34 && this->health != 0xff) {
|
||||
this->action = 4;
|
||||
this->zVelocity = Q_16_16(2.0);
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->health = 0xff;
|
||||
this->hitType = 35;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
|
@ -49,7 +49,7 @@ void Rollobite_OnCollision(Entity* this) {
|
|||
if (this->action == 4 || this->action == 5) {
|
||||
this->action = 4;
|
||||
this->timer = 180;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ void Rollobite_OnGrabbed(Entity* this) {
|
|||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->action = 4;
|
||||
COLLISION_ON(this);
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
} else {
|
||||
gUnk_080CA6A4[this->subAction](this);
|
||||
|
@ -107,7 +107,7 @@ void sub_080207A8(Entity* this) {
|
|||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->gustJarState &= 0xfb;
|
||||
this->direction ^= 0x10;
|
||||
this->direction ^= DirectionSouth;
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
this->speed = 0x80;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
|
@ -193,7 +193,7 @@ void Rollobite_RolledUp(Entity* this) {
|
|||
if (unk == 1)
|
||||
EnqueueSFX(SFX_PLACE_OBJ);
|
||||
|
||||
if ((this->direction & 0x80) == 0)
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK))
|
||||
ProcessMovement2(this);
|
||||
}
|
||||
}
|
||||
|
@ -248,8 +248,8 @@ void sub_08020A7C(Entity* this) {
|
|||
|
||||
if (sub_08049FA0(this) == 0) {
|
||||
int tmp = DirectionRoundUp(sub_08049EE4(this));
|
||||
if ((state ^ 0x10) == tmp)
|
||||
state ^= 0x10;
|
||||
if ((state ^ DirectionSouth) == tmp)
|
||||
state ^= DirectionSouth;
|
||||
}
|
||||
|
||||
this->direction = state;
|
||||
|
|
|
@ -131,7 +131,7 @@ void sub_08038304(Entity* this) {
|
|||
}
|
||||
this->field_0x7a.HALF.LO = this->field_0x78.HALF.HI;
|
||||
this->field_0x78.HALF.HI = cVar2;
|
||||
this->direction = (this->direction + cVar2) & 0x18;
|
||||
this->direction = (this->direction + cVar2) & DirectionWest;
|
||||
} else {
|
||||
this->direction = this->field_0x78.HALF.LO;
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ void sub_08029688(Entity* this) {
|
|||
void sub_0802969C(Entity* this) {
|
||||
u32 bVar1;
|
||||
|
||||
if ((this->direction & 0xf) != 0) {
|
||||
if (this->direction & (0x3 | DIR_DIAGONAL | DirectionEast)) {
|
||||
|
||||
bVar1 = this->direction >> 4;
|
||||
if (bVar1 != this->animationState) {
|
||||
|
|
|
@ -42,16 +42,16 @@ void sub_0802BA18(Entity* this) {
|
|||
this->direction = direction;
|
||||
|
||||
switch (direction >> 3) {
|
||||
case 0:
|
||||
case 0: // UP
|
||||
this->field_0x7a.HWORD = this->y.HALF.HI - this->field_0x7c.HALF.HI;
|
||||
break;
|
||||
case 1:
|
||||
case 1: // RIGHT
|
||||
this->field_0x7a.HWORD = this->x.HALF.HI + this->field_0x7c.HALF.LO;
|
||||
break;
|
||||
case 2:
|
||||
case 2: // DOWN
|
||||
this->field_0x7a.HWORD = this->y.HALF.HI + this->field_0x7c.HALF.HI;
|
||||
break;
|
||||
case 3:
|
||||
case 3: // LEFT
|
||||
this->field_0x7a.HWORD = this->x.HALF.HI - this->field_0x7c.HALF.LO;
|
||||
break;
|
||||
}
|
||||
|
@ -62,19 +62,19 @@ void sub_0802BA8C(Entity* this) {
|
|||
sub_0802BB10(this);
|
||||
} else {
|
||||
switch (this->direction >> 3) {
|
||||
case 0:
|
||||
case 0: // UP
|
||||
if (this->field_0x7a.HWORD >= this->y.HALF.HI)
|
||||
sub_0802BB10(this);
|
||||
break;
|
||||
case 1:
|
||||
case 1: // RIGHT
|
||||
if (this->field_0x7a.HWORD <= this->x.HALF.HI)
|
||||
sub_0802BB10(this);
|
||||
break;
|
||||
case 2:
|
||||
case 2: // DOWN
|
||||
if (this->field_0x7a.HWORD <= this->y.HALF.HI)
|
||||
sub_0802BB10(this);
|
||||
break;
|
||||
case 3:
|
||||
case 3: // LEFT
|
||||
if (this->field_0x7a.HWORD >= this->x.HALF.HI)
|
||||
sub_0802BB10(this);
|
||||
break;
|
||||
|
@ -91,7 +91,7 @@ void sub_0802BAFC(Entity* this) {
|
|||
void sub_0802BB10(Entity* this) {
|
||||
this->action = 3;
|
||||
this->speed = 0xc0;
|
||||
this->direction = this->direction ^ 0x10;
|
||||
this->direction = this->direction ^ DirectionSouth;
|
||||
EnqueueSFX(SFX_METAL_CLINK);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ void sub_08031714(Entity* this) {
|
|||
if (sub_08049FA0(this) == 0 && (this->subtimer & 1) != 0) {
|
||||
this->direction = sub_08049EE4(this);
|
||||
} else {
|
||||
this->direction += 0x18;
|
||||
this->direction = ((Random() & 0xe) + this->direction) & 0x1f;
|
||||
this->direction += DirectionWest;
|
||||
this->direction = ((Random() & 0xe) + this->direction) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
sub_080317E0(this);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ void sub_0802B35C(Entity* this) {
|
|||
if (--this->subtimer == 0) {
|
||||
this->subtimer = 120;
|
||||
|
||||
this->direction += is_head ? 0x08 : 0x18;
|
||||
this->direction += is_head ? DirectionEast : DirectionWest;
|
||||
this->direction = DirectionRound(this->direction);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -176,7 +176,7 @@ void sub_08028488(Entity* this) {
|
|||
this->timer = (Random() & 7) * 3 + 64;
|
||||
break;
|
||||
case 4:
|
||||
this->direction = (this->direction + 0x10) & 0x18;
|
||||
this->direction = (this->direction + 0x10) & DirectionWest;
|
||||
/* fallthrough */
|
||||
case 1:
|
||||
default:
|
||||
|
@ -265,7 +265,7 @@ void sub_08028604(Entity* this) {
|
|||
this->timer = this->timer + 0x10;
|
||||
this->field_0x82.HALF.HI--;
|
||||
}
|
||||
this->direction = (iVar3 + 4U) & 0x18;
|
||||
this->direction = (iVar3 + 4U) & DirectionWest;
|
||||
iVar3 = Direction8ToAnimationState(this->direction);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -107,7 +107,7 @@ void sub_0802B7A4(Entity* this) {
|
|||
this->timer = gUnk_080CD314[Random() & 3];
|
||||
this->speed = 0x60;
|
||||
sub_0802B960(this);
|
||||
if (this->direction != 0xff) {
|
||||
if (this->direction != DIR_NONE) {
|
||||
u32 animation = this->direction >> 3;
|
||||
if (animation != this->animationState) {
|
||||
this->animationState = animation & 3;
|
||||
|
|
|
@ -159,7 +159,7 @@ void sub_0802F300(Entity* this) {
|
|||
} else if (this->collisions != COL_NONE) {
|
||||
sub_0800417E(this, this->collisions);
|
||||
} else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
|
||||
if (--this->timer == 0) {
|
||||
|
@ -214,6 +214,6 @@ static void sub_0802F45C(Entity* this) {
|
|||
this->direction = sub_08049F84(this, 1);
|
||||
} else {
|
||||
temp = (Random() & 0xf) + 0x18;
|
||||
this->direction = (temp + this->direction) & 0x1f;
|
||||
this->direction = (temp + this->direction) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ void sub_08038048(Entity* this) {
|
|||
} else if (this->collisions != COL_NONE) {
|
||||
sub_0800417E(this, this->collisions);
|
||||
} else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
|
||||
if (--this->timer == 0) {
|
||||
|
@ -185,6 +185,6 @@ void sub_08038168(Entity* this) {
|
|||
this->direction = sub_08049F84(this, 1);
|
||||
} else {
|
||||
temp = (Random() & 0xf) + 0x18;
|
||||
this->direction = (temp + this->direction) & 0x1f;
|
||||
this->direction = (temp + this->direction) & (0x3 | DirectionNorthWest);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ void sub_0804468C(Entity* this) {
|
|||
case 0:
|
||||
this->action = 1;
|
||||
this->timer = 1;
|
||||
this->direction = (this->field_0x78.HALF.HI * 8) & 0x1f;
|
||||
this->direction = (this->field_0x78.HALF.HI * 8) & (0x3 | DirectionNorthWest);
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
|
@ -123,7 +123,7 @@ void sub_0804474C(Entity* this) {
|
|||
if (--this->timer == 0) {
|
||||
this->timer = 2;
|
||||
this->direction++;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
@ -253,7 +253,7 @@ void sub_080449F8(Entity* this) {
|
|||
|
||||
this->timer = 4;
|
||||
this->direction++;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
if (vaati->field_0x80.HALF.LO == 0)
|
||||
vaati->field_0x74.HALF.LO = 1;
|
||||
break;
|
||||
|
@ -266,9 +266,9 @@ void sub_080449F8(Entity* this) {
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
LinearMoveUpdate(this);
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
this->timer = 2;
|
||||
break;
|
||||
case 3:
|
||||
|
@ -324,7 +324,7 @@ void sub_08044B04(Entity* this) {
|
|||
if (--this->timer == 0) {
|
||||
this->timer = this->field_0x78.HALF.LO ? 4 : 2;
|
||||
this->direction++;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
}
|
||||
if (--this->subtimer == 0) {
|
||||
if (this->timer != 2) {
|
||||
|
@ -346,11 +346,11 @@ void sub_08044B04(Entity* this) {
|
|||
case 1:
|
||||
if (--this->timer == 0) {
|
||||
this->timer = 6;
|
||||
this->direction = (this->direction + 1) & 0x1f;
|
||||
this->direction = (this->direction + 1) & (0x3 | DirectionNorthWest);
|
||||
if (++this->subtimer == 0x30) {
|
||||
u32 direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10);
|
||||
this->speed = 0;
|
||||
this->direction = (direction + 16) & 0x1f;
|
||||
this->direction = (direction + 16) & (0x3 | DirectionNorthWest);
|
||||
this->timer = 16;
|
||||
this->subtimer = 16;
|
||||
this->field_0x74.HALF.LO++;
|
||||
|
@ -485,18 +485,18 @@ void sub_08044E74(Entity* this, u32 state) {
|
|||
switch (state) {
|
||||
case 2:
|
||||
this->action = 2;
|
||||
this->direction += 0x18;
|
||||
this->direction &= 0x1f;
|
||||
this->direction += DirectionWest;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
PositionRelative(this->parent, this, 0, Q_16_16(-16.0));
|
||||
this->speed = 12288;
|
||||
LinearMoveUpdate(this);
|
||||
this->direction += 0x8;
|
||||
this->direction &= 0x1f;
|
||||
this->direction += DirectionEast;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
this->speed = 1280;
|
||||
LinearMoveUpdate(this);
|
||||
break;
|
||||
case 1:
|
||||
this->direction = (this->direction + 8) & 0x1f;
|
||||
this->direction = (this->direction + 8) & (0x3 | DirectionNorthWest);
|
||||
break;
|
||||
case 0:
|
||||
if (this->field_0x78.HALF.LO) {
|
||||
|
@ -507,9 +507,9 @@ void sub_08044E74(Entity* this, u32 state) {
|
|||
} while (this->timer-- != 3);
|
||||
break;
|
||||
case 1:
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
LinearMoveUpdate(this);
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -232,7 +232,7 @@ void sub_0802EFB8(Entity* this) {
|
|||
}
|
||||
iVar4 = sub_080B1B44(TILE(this->x.HALF.HI, this->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
|
||||
if (iVar4 != 0) {
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
} else {
|
||||
this->timer = (rand & 3) + 1;
|
||||
this->direction = (uVar1 & 0x18);
|
||||
|
@ -251,7 +251,7 @@ void sub_0802F04C(Entity* this) {
|
|||
return;
|
||||
}
|
||||
switch (this->direction >> 3) {
|
||||
case 0:
|
||||
case 0: // UP
|
||||
if (((oldY & 0xf) > 8) && ((this->y.HALF.HI & 0xf) < 9)) {
|
||||
this->timer--;
|
||||
oldY = (this->y.HALF.HI & 0xfff0) + 8;
|
||||
|
@ -263,7 +263,7 @@ void sub_0802F04C(Entity* this) {
|
|||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 1: // RIGHT
|
||||
if (((oldX & 0xf) < 8) && ((this->x.HALF.HI & 0xf) >= 8)) {
|
||||
this->timer--;
|
||||
oldX = (this->x.HALF.HI & 0xfff0) + 8;
|
||||
|
@ -275,7 +275,7 @@ void sub_0802F04C(Entity* this) {
|
|||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 2: // DOWN
|
||||
if (((oldY & 0xf) < 8) && ((this->y.HALF.HI & 0xf) >= 8)) {
|
||||
this->timer--;
|
||||
oldY = (this->y.HALF.HI & 0xfff0) + 8;
|
||||
|
@ -287,7 +287,7 @@ void sub_0802F04C(Entity* this) {
|
|||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
default: // LEFT
|
||||
if (((oldX & 0xf) >= 9) && ((this->x.HALF.HI & 0xf) < 9)) {
|
||||
this->timer--;
|
||||
oldX = (this->x.HALF.HI & 0xfff0) + 8;
|
||||
|
|
|
@ -187,7 +187,7 @@ void VaatiProjectileFunction0Action5(Entity* this) {
|
|||
void VaatiProjectileFunction0Action6(Entity* this) {
|
||||
if (--this->timer == 0) {
|
||||
this->action = 7;
|
||||
this->direction = 0x10;
|
||||
this->direction = DirectionSouth;
|
||||
this->speed = 0x300;
|
||||
}
|
||||
sub_0803E444(this);
|
||||
|
|
|
@ -103,7 +103,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) {
|
|||
this->timer = 0;
|
||||
this->field_0x76.HALF.LO = 0;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->spritePriority.b0 = 4;
|
||||
this->z.WORD = 0;
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
|
@ -149,12 +149,12 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
|||
this->action = 2;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->timer = 16;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
} else {
|
||||
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
|
||||
this->direction = ((Random() & 0x80) >> 3) | 8;
|
||||
this->direction = ((Random() & 0x80) >> 3) | DirectionEast;
|
||||
} else {
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -165,7 +165,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
|||
this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->timer = 192;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
|||
case 0:
|
||||
this->action = 4;
|
||||
this->timer = 160;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->cutsceneBeh.HALF.LO = 0xff;
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
break;
|
||||
|
@ -184,21 +184,21 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
|||
this->action = 6;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->timer = 0;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
break;
|
||||
case 3:
|
||||
this->action = 5;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->subtimer = 32;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
break;
|
||||
case 2:
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->timer = 32;
|
||||
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
|
||||
this->direction = ((Random() & 0x80) >> 3) | 8;
|
||||
this->direction = ((Random() & 0x80) >> 3) | DirectionEast;
|
||||
} else {
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ void VaatiRebornEnemyType0Action4(Entity* this) {
|
|||
this->action = 1;
|
||||
this->cutsceneBeh.HALF.LO = 0xff;
|
||||
this->timer = 1;
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest);
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
} else {
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
|
@ -369,7 +369,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) {
|
|||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->action = 1;
|
||||
this->timer = 1;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) {
|
|||
this->field_0x86.HALF.HI++;
|
||||
this->subtimer = (Random() & 0x3f) + 64;
|
||||
uVar3 = GetFacingDirection(this, &gPlayerEntity);
|
||||
this->direction = (uVar3 & 0x10) | 8;
|
||||
this->direction = (uVar3 & 0x10) | DirectionEast;
|
||||
} else {
|
||||
this->field_0x74.HALF.LO++;
|
||||
this->field_0x86.HALF.HI = 0;
|
||||
|
@ -408,7 +408,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) {
|
|||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->timer = 1;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ void VaatiRebornEnemyType2Action0(Entity* this) {
|
|||
this->field_0x74.HALF.LO = 1;
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->spriteOffsetY = -2;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
PositionRelative(source, this, 0, Q_16_16(2.0));
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ void VaatiRebornEnemyType2Action1(Entity* this) {
|
|||
void VaatiRebornEnemyType3Action0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->spriteOffsetY = -1;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
sub_0803DC0C(this);
|
||||
|
@ -621,7 +621,7 @@ void VaatiRebornEnemyType3Action1(Entity* this) {
|
|||
} else {
|
||||
if (this->field_0x74.HALF.LO != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
|
@ -855,7 +855,7 @@ void VaatiRebornEnemyType0PreAction(Entity* this) {
|
|||
this->field_0x7c = this->y;
|
||||
}
|
||||
if (this->field_0x76.HALF.LO == 0) {
|
||||
if ((this->direction == 0xff) || sub_08049FA0(this)) {
|
||||
if ((this->direction == DIR_NONE) || sub_08049FA0(this)) {
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->animationState = (this->animationState + 1) & 3;
|
||||
this->spriteOffsetX = gUnk_080D04D3[this->animationState];
|
||||
|
@ -863,7 +863,7 @@ void VaatiRebornEnemyType0PreAction(Entity* this) {
|
|||
return;
|
||||
}
|
||||
bVar1 = sub_08049EE4(this);
|
||||
this->direction = (bVar1 & 0x10) | 8;
|
||||
this->direction = (bVar1 & 0x10) | DirectionEast;
|
||||
this->field_0x76.HALF.LO = 0x10;
|
||||
} else {
|
||||
this->field_0x76.HALF.LO--;
|
||||
|
|
|
@ -888,7 +888,7 @@ void sub_080406A0(Entity* this) {
|
|||
this->direction = tmp + 0x1f;
|
||||
}
|
||||
}
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
this->field_0x86.HALF.LO = uVar5;
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ void sub_08040770(Entity* this) {
|
|||
this->direction = tmp3 + 0x1F;
|
||||
}
|
||||
}
|
||||
this->direction &= 0x1F;
|
||||
this->direction &= 0x3 | DirectionNorthWest;
|
||||
this->field_0x86.HALF.LO = tmp2;
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ void VaatiWrathType0Action7(Entity* this) {
|
|||
UpdateAnimationSingleFrame(this);
|
||||
if (gRoomControls.origin_y + 0x48 != this->y.HALF.HI) {
|
||||
this->speed = 0x100;
|
||||
this->direction = ((gRoomControls.origin_y + 0x48) >= this->y.HALF.HI) ? 0x10 : 0;
|
||||
this->direction = ((gRoomControls.origin_y + 0x48) >= this->y.HALF.HI) ? DirectionSouth : DirectionNorth;
|
||||
LinearMoveUpdate(this);
|
||||
} else {
|
||||
if (--this->timer == 0) {
|
||||
|
@ -398,7 +398,7 @@ void VaatiWrathType0Action8(Entity* this) {
|
|||
LinearMoveUpdate(this);
|
||||
if (((gRoomControls.origin_x + 0x20) > this->x.HALF.HI) || ((gRoomControls.origin_x + 0x140) < this->x.HALF.HI)) {
|
||||
if (0x3f < this->speed) {
|
||||
this->direction ^= 0x10;
|
||||
this->direction ^= DirectionSouth;
|
||||
}
|
||||
}
|
||||
if (--this->timer == 0) {
|
||||
|
@ -451,7 +451,7 @@ void VaatiWrathType0ActionA(Entity* this) {
|
|||
if (this->field_0x7a.HALF.HI == 0xf0) {
|
||||
this->action = 0xb;
|
||||
this->subAction = 0;
|
||||
this->direction = 0;
|
||||
this->direction = DirectionNorth;
|
||||
this->speed = 0x100;
|
||||
this->zVelocity = Q_16_16(1.125);
|
||||
ChangeObjPalette(this, 0x16b);
|
||||
|
@ -521,7 +521,7 @@ void VaatiWrathType0ActionC(Entity* this) {
|
|||
if (this->z.HALF.HI < -4) {
|
||||
this->subAction = 1;
|
||||
this->timer = 120;
|
||||
this->direction = 0x10;
|
||||
this->direction = DirectionSouth;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -66,7 +66,7 @@ void sub_08076EC8(ItemBehavior* this, u32 index) {
|
|||
if (gPlayerEntity.subAction == 0x1b) {
|
||||
animIndex = 0x524;
|
||||
} else {
|
||||
if (gPlayerState.direction & 0x80) {
|
||||
if (gPlayerState.direction & DIR_NOT_MOVING_CHECK) {
|
||||
animIndex = 0x504;
|
||||
} else {
|
||||
animIndex = 0x518;
|
||||
|
|
|
@ -136,7 +136,7 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
|
|||
u8* ptr;
|
||||
|
||||
if ((IsItemActive(this) != 0) && (gPlayerState.dash_state != 0)) {
|
||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||
if (!(gPlayerState.flags & PL_MINISH)) {
|
||||
gPlayerEntity.speed = 0x300;
|
||||
} else {
|
||||
gPlayerEntity.speed = 0x280;
|
||||
|
@ -148,7 +148,7 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
|
|||
gPlayerEntity.subAction = 0;
|
||||
COLLISION_OFF(&gPlayerEntity);
|
||||
gPlayerState.field_0x38 = 0;
|
||||
gPlayerState.direction = 0xff;
|
||||
gPlayerState.direction = DIR_NONE;
|
||||
return;
|
||||
}
|
||||
this->subtimer = 1;
|
||||
|
@ -157,12 +157,13 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
|
|||
ptr = gUnk_0811BE38;
|
||||
if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) {
|
||||
this->direction = (this->playerAnimationState & 0xe) * 4;
|
||||
if ((gPlayerState.direction != 0xff) && (gPlayerState.direction != this->direction)) {
|
||||
if (((gPlayerState.direction - this->direction) & 0x1f) < 0x10) {
|
||||
if ((gPlayerState.direction != DIR_NONE) && (gPlayerState.direction != this->direction)) {
|
||||
if (((gPlayerState.direction - this->direction) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)) < DirectionSouth) {
|
||||
this->direction = this->direction + 2;
|
||||
}
|
||||
this->direction--;
|
||||
this->direction &= 0x1f;
|
||||
this->direction &= 0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest;
|
||||
}
|
||||
gPlayerState.direction = this->direction;
|
||||
UpdateItemAnim(this);
|
||||
|
|
|
@ -220,7 +220,7 @@ void sub_08075738(ItemBehavior* this, u32 index) {
|
|||
}
|
||||
|
||||
if ((gPlayerState.sword_state & 0x10) != 0) {
|
||||
if ((gPlayerState.direction & 0x80) == 0) {
|
||||
if (!(gPlayerState.direction & DIR_NOT_MOVING_CHECK)) {
|
||||
this->direction = gPlayerState.direction;
|
||||
}
|
||||
gPlayerEntity.direction = this->direction;
|
||||
|
|
|
@ -2080,7 +2080,7 @@ bool32 MoveNorthWest(Entity* this, s32 radius, s32 angle, u32 collisionType) {
|
|||
bool32 ProcessMovement0(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 0);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 0);
|
||||
} else {
|
||||
|
@ -2092,7 +2092,7 @@ bool32 ProcessMovement0(Entity* this) {
|
|||
bool32 ProcessMovement1(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 1);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 1);
|
||||
} else {
|
||||
|
@ -2104,7 +2104,7 @@ bool32 ProcessMovement1(Entity* this) {
|
|||
bool32 ProcessMovement2(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 2);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 2);
|
||||
} else {
|
||||
|
@ -2116,7 +2116,7 @@ bool32 ProcessMovement2(Entity* this) {
|
|||
bool32 ProcessMovement10(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 10);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 10);
|
||||
} else {
|
||||
|
@ -2128,7 +2128,7 @@ bool32 ProcessMovement10(Entity* this) {
|
|||
bool32 ProcessMovement12(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 12);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 12);
|
||||
} else {
|
||||
|
@ -2140,7 +2140,7 @@ bool32 ProcessMovement12(Entity* this) {
|
|||
bool32 ProcessMovement0_custom(Entity* this, u32 direction, u32 speed) {
|
||||
bool32 result;
|
||||
|
||||
if ((direction & 0x80) == 0) {
|
||||
if (!(direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, direction, 0);
|
||||
result = ProcessMovementInternal(this, speed, direction, 0);
|
||||
} else {
|
||||
|
@ -2152,7 +2152,7 @@ bool32 ProcessMovement0_custom(Entity* this, u32 direction, u32 speed) {
|
|||
bool32 ProcessMovement3(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if (((this->direction & 0x80) == 0) && (sub_080AF0C8(this) == 0)) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK) && !sub_080AF0C8(this)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 3);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 3);
|
||||
} else {
|
||||
|
@ -2165,25 +2165,37 @@ bool32 sub_080AF0C8(Entity* this) {
|
|||
u32 tileType = GetTileTypeByEntity(this);
|
||||
switch (tileType) {
|
||||
case 0x87:
|
||||
if (((this->direction + 7) & 0x1f) < 0x10) {
|
||||
if ((
|
||||
(this->direction + 7) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
|
||||
) < DirectionSouth) {
|
||||
this->collisions = COL_NORTH_ANY;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 0x8a:
|
||||
if (((this->direction - 1) & 0x1f) < 0x10) {
|
||||
if ((
|
||||
(this->direction - 1) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
|
||||
) < DirectionSouth) {
|
||||
this->collisions = COL_EAST_ANY;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 0x88:
|
||||
if (((this->direction - 9) & 0x1f) < 0x10) {
|
||||
if ((
|
||||
(this->direction - 9) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
|
||||
) < DirectionSouth) {
|
||||
this->collisions = COL_SOUTH_ANY;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 0x89:
|
||||
if (((this->direction - 0x11) & 0x1f) < 0x10) {
|
||||
if ((
|
||||
(this->direction - 0x11) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
|
||||
) < DirectionSouth) {
|
||||
this->collisions = COL_WEST_ANY;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2195,7 +2207,7 @@ bool32 sub_080AF0C8(Entity* this) {
|
|||
bool32 ProcessMovement4(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 4);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 4);
|
||||
} else {
|
||||
|
@ -2207,7 +2219,7 @@ bool32 ProcessMovement4(Entity* this) {
|
|||
bool32 ProcessMovement5(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 5);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 5);
|
||||
} else {
|
||||
|
@ -2231,7 +2243,7 @@ void Knockback2(Entity* this) {
|
|||
bool32 ProcessMovement6(Entity* this) {
|
||||
bool32 result;
|
||||
|
||||
if ((this->direction & 0x80) == 0) {
|
||||
if (!(this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, this->direction, 6);
|
||||
result = ProcessMovementInternal(this, this->speed, this->direction, 6);
|
||||
} else {
|
||||
|
@ -2243,7 +2255,7 @@ bool32 ProcessMovement6(Entity* this) {
|
|||
bool32 ProcessMovement6_custom(Entity* this, u32 direction, u32 speed) {
|
||||
bool32 result;
|
||||
|
||||
if ((direction & 0x80) == 0) {
|
||||
if (!(direction & DIR_NOT_MOVING_CHECK)) {
|
||||
CalculateEntityTileCollisions(this, direction, 6);
|
||||
result = ProcessMovementInternal(this, speed, direction, 6);
|
||||
} else {
|
||||
|
|
|
@ -206,12 +206,12 @@ void sub_08066570(Entity* this) {
|
|||
direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
cond = TRUE;
|
||||
|
||||
dir2 = (direction & 0x18);
|
||||
dir1 = (this->direction & 0x18);
|
||||
tmp = 0x18;
|
||||
dir2 = (direction & DirectionWest);
|
||||
dir1 = (this->direction & DirectionWest);
|
||||
tmp = DirectionWest;
|
||||
if (dir1 == dir2) {
|
||||
dir1 = (direction + 5) & 7;
|
||||
dir2 = (this->direction + 5) & 7;
|
||||
dir1 = (direction + 5) & (0x3 | DirectionNorthEast);
|
||||
dir2 = (this->direction + 5) & (0x3 | DirectionNorthEast);
|
||||
if (dir2 < 3 && dir1 < 3) {
|
||||
cond = FALSE;
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ void Book_Action5(BookEntity* this) {
|
|||
u32 sub_0809B688(Entity* this) {
|
||||
u32 ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
|
||||
|
||||
if (ret == 1 && gPlayerState.direction != 16) {
|
||||
if (ret == 1 && gPlayerState.direction != DirectionSouth) {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void ChuchuBossCutscene_Action3(Entity* this) {
|
|||
GetNextFrame(this);
|
||||
if (--this->timer == 0) {
|
||||
this->action++;
|
||||
this->direction = 0;
|
||||
this->direction = DirectionNorth;
|
||||
this->speed = 0x100;
|
||||
this->zVelocity = Q_16_16(2.0);
|
||||
this->spriteOrientation.flipY = 0;
|
||||
|
|
|
@ -138,7 +138,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
|
|||
if (super->parent->action == 2) {
|
||||
switch (super->parent->subAction) {
|
||||
case 1:
|
||||
if ((gPlayerState.direction & 0x80) != 0) {
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
InitializeAnimation(super, 4);
|
||||
} else {
|
||||
GetNextFrame(super);
|
||||
|
@ -161,7 +161,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
|
|||
} else {
|
||||
gPlayerState.mobility |= 0x80;
|
||||
gPlayerState.heldObject = 5;
|
||||
if ((gPlayerState.direction & 0x80) != 0) {
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
InitializeAnimation(super, (super->type >> 1) + 3);
|
||||
} else {
|
||||
GetNextFrame(super);
|
||||
|
|
|
@ -90,10 +90,10 @@ void GraveyardKey_Init(Entity* this, const struct_gUnk_08123FB0* param_2) {
|
|||
this->y.HALF.HI -= param_2->y;
|
||||
this->z.WORD = 0;
|
||||
this->timer = param_2->timer;
|
||||
if ((this->direction & 0x80)) {
|
||||
if ((this->direction & DIR_NOT_MOVING_CHECK)) {
|
||||
dir = this->direction;
|
||||
if (dir == 0x81) {
|
||||
this->direction = (((gPlayerEntity.animationState * 4 + (Random() & 3)) - 2) & 0x1f) ^ 0x10;
|
||||
if (dir == (DIR_NOT_MOVING_CHECK | 0x1)) {
|
||||
this->direction = (((gPlayerEntity.animationState * 4 + (Random() & 3)) - 2) & 0x1f) ^ DirectionSouth;
|
||||
}
|
||||
}
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
|
|
|
@ -271,7 +271,7 @@ void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) {
|
|||
SetTile(0x4022, unk_1, this->collisionLayer);
|
||||
this->timer = 7;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = (unk_0 << 3) ^ 0x10;
|
||||
this->direction = (unk_0 << 3) ^ DirectionSouth;
|
||||
tmp = &gUnk_0811F688[unk_0];
|
||||
if (this->type2 != 2) {
|
||||
this->x.HALF.HI += tmp->x;
|
||||
|
|
|
@ -52,7 +52,7 @@ void sub_0808A484(Entity* this) {
|
|||
this->action = 1;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->speed = 0x40;
|
||||
this->direction = 6;
|
||||
this->direction = DirectionNorthEast | 0x2;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
|
|
|
@ -321,7 +321,7 @@ void UpdateRailMovement(Entity* this, u16** param_2, u16* param_3) {
|
|||
ptr = ptr + (u32)ptr[1] * -3;
|
||||
}
|
||||
if (*ptr == 0xff) {
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->speed = 0;
|
||||
} else {
|
||||
this->direction = (u8)*ptr;
|
||||
|
|
|
@ -245,17 +245,21 @@ bool32 sub_0806F8DC(Entity* ent) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#define CDIR_DIAGONAL 1
|
||||
#define CDirectionSouth 4
|
||||
#define CDirectionWest 6
|
||||
|
||||
u32 sub_0806F948(Entity* ent) {
|
||||
u32 v1;
|
||||
if (gPlayerState.direction == 0xFF)
|
||||
u32 direction;
|
||||
if (gPlayerState.direction == DIR_NONE)
|
||||
return ent->animationState;
|
||||
|
||||
v1 = gPlayerState.direction / 4;
|
||||
if ((v1 & 1) && !(((v1 + 1) - ent->animationState) & 4)) {
|
||||
direction = gPlayerState.direction / 4;
|
||||
if ((direction & CDIR_DIAGONAL) && !(((direction + 1) - ent->animationState) & CDirectionSouth)) {
|
||||
return ent->animationState;
|
||||
} else {
|
||||
ent->spriteSettings.flipX = v1 > 4;
|
||||
ent->animationState = v1 & 6;
|
||||
ent->spriteSettings.flipX = direction > CDirectionSouth;
|
||||
ent->animationState = direction & CDirectionWest;
|
||||
}
|
||||
return ent->animationState;
|
||||
}
|
||||
|
|
81
src/player.c
81
src/player.c
|
@ -503,7 +503,7 @@ static void PlayerNormal(Entity* this) {
|
|||
this->speed = gPlayerState.jump_status & 0x20;
|
||||
sub_08008926(this);
|
||||
} else {
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
}
|
||||
}
|
||||
UpdatePlayerMovement();
|
||||
|
@ -535,14 +535,14 @@ static void PlayerNormal(Entity* this) {
|
|||
this->direction = gPlayerState.direction;
|
||||
if (gPlayerState.flags & PL_BURNING) {
|
||||
this->speed = BURNING_SPEED;
|
||||
if ((gPlayerState.direction & 0x80) != 0)
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) != 0)
|
||||
this->direction = 4 * (this->animationState & 0xE);
|
||||
DeleteClones();
|
||||
}
|
||||
}
|
||||
}
|
||||
v13 = 0;
|
||||
if ((((gPlayerState.field_0x7 | this->direction) & 0x80) | gPlayerState.field_0xa) == 0 &&
|
||||
if ((((gPlayerState.field_0x7 | this->direction) & DIR_NOT_MOVING_CHECK) | gPlayerState.field_0xa) == 0 &&
|
||||
(gPlayerState.field_0x7 & 0x10) == 0) {
|
||||
v13 = 1;
|
||||
if (this->knockbackDuration == 0 &&
|
||||
|
@ -578,7 +578,7 @@ static void PlayerFall(Entity* this) {
|
|||
PlayerFallUpdate,
|
||||
};
|
||||
|
||||
gPlayerState.direction = 0xFF;
|
||||
gPlayerState.direction = DIR_NONE;
|
||||
gPlayerState.pushedObject = 0x80;
|
||||
gPlayerState.framestate = PL_STATE_FALL;
|
||||
|
||||
|
@ -1068,7 +1068,7 @@ static void PortalStandUpdate(Entity* this) {
|
|||
break;
|
||||
}
|
||||
|
||||
if ((gPlayerState.direction & 0x84) == 0) {
|
||||
if ((gPlayerState.direction & (DIR_NOT_MOVING_CHECK | DIR_DIAGONAL)) == 0) {
|
||||
if (this->direction != gPlayerState.direction) {
|
||||
this->timer = 8;
|
||||
}
|
||||
|
@ -1557,7 +1557,7 @@ static void sub_08071D04(Entity* this) {
|
|||
ModHealth(deltaHealth);
|
||||
this->subAction = 3;
|
||||
gPlayerState.field_0x3c = 0;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
this->speed = 0;
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
gPlayerState.jump_status = 1;
|
||||
|
@ -1787,7 +1787,7 @@ static void sub_08072100(Entity* this) {
|
|||
this->subAction = 1;
|
||||
COLLISION_OFF(this);
|
||||
if (gPlayerState.field_0x39)
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
|
||||
if (gPlayerState.flags & PL_NO_CAP) {
|
||||
gPlayerState.animation = ANIM_DOOR_NOCAP;
|
||||
|
@ -2218,7 +2218,7 @@ static void PlayerInHoleUpdate(Entity* this) {
|
|||
}
|
||||
|
||||
static void sub_08072ACC(Entity* this) {
|
||||
if (gPlayerState.direction == 0xff) {
|
||||
if (gPlayerState.direction == DIR_NONE) {
|
||||
this->subtimer = 0;
|
||||
} else if (this->subtimer > 7) {
|
||||
COLLISION_ON(this);
|
||||
|
@ -2448,14 +2448,14 @@ static void PlayerClimb(Entity* this) {
|
|||
this->action = PLAYER_CLIMB;
|
||||
this->subAction = 0;
|
||||
this->y.HALF.LO = 0;
|
||||
gPlayerState.animation = ANIM_CLIMB;
|
||||
gPlayerState.animation = ANIM_CLIMB1_UP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_08072F94(Entity* this) {
|
||||
u32 bVar1;
|
||||
u32 direction;
|
||||
|
||||
switch (gPlayerState.floor_type) {
|
||||
default:
|
||||
|
@ -2466,10 +2466,10 @@ static void sub_08072F94(Entity* this) {
|
|||
case SURFACE_CLIMB_WALL:
|
||||
case SURFACE_2C:
|
||||
this->spritePriority.b1 = 0;
|
||||
bVar1 = gPlayerState.direction;
|
||||
if ((gPlayerState.direction & 0x80) == 0) {
|
||||
direction = gPlayerState.direction;
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0) {
|
||||
this->direction = gPlayerState.direction;
|
||||
if ((gPlayerState.direction == 8) || (gPlayerState.direction == 0x18)) {
|
||||
if ((gPlayerState.direction == DirectionEast) || (gPlayerState.direction == DirectionWest)) {
|
||||
if (gPlayerState.floor_type == SURFACE_LADDER) {
|
||||
return;
|
||||
}
|
||||
|
@ -2480,20 +2480,20 @@ static void sub_08072F94(Entity* this) {
|
|||
}
|
||||
sub_08073094(this);
|
||||
} else {
|
||||
if ((gPlayerState.floor_type == SURFACE_LADDER) && ((bVar1 & 7) != 0)) {
|
||||
this->direction = (bVar1 + 8) & 0x10;
|
||||
if ((gPlayerState.floor_type == SURFACE_LADDER) && ((direction & (DIR_DIAGONAL | 0x3)) != 0)) {
|
||||
this->direction = (direction + 8) & DirectionSouth;
|
||||
}
|
||||
if (this->direction & 0x10) {
|
||||
if (this->direction & DirectionSouth) {
|
||||
if (this->frame & 0x10) {
|
||||
gPlayerState.animation = ANIM_CLIMB3;
|
||||
gPlayerState.animation = ANIM_CLIMB1_DOWN;
|
||||
} else {
|
||||
gPlayerState.animation = ANIM_CLIMB4;
|
||||
gPlayerState.animation = ANIM_CLIMB2_DOWN;
|
||||
}
|
||||
} else {
|
||||
if (this->frame & 0x10) {
|
||||
gPlayerState.animation = ANIM_CLIMB;
|
||||
gPlayerState.animation = ANIM_CLIMB1_UP;
|
||||
} else {
|
||||
gPlayerState.animation = ANIM_CLIMB2;
|
||||
gPlayerState.animation = ANIM_CLIMB2_UP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2633,19 +2633,19 @@ static void sub_0807332C(Entity* this) {
|
|||
if (gPlayerState.field_0x39 == 7) {
|
||||
this->direction = IdleNorth;
|
||||
} else {
|
||||
this->direction = 28;
|
||||
this->direction = DirectionNorthWest;
|
||||
}
|
||||
if ((this->x.HALF.HI & 0xF) != 0xF) {
|
||||
if (gPlayerState.field_0x39 == 7) {
|
||||
this->animationState = IdleEast;
|
||||
this->direction = 4;
|
||||
this->direction = DIR_DIAGONAL;
|
||||
} else {
|
||||
this->animationState = 6;
|
||||
this->animationState = IdleWest;
|
||||
if (this->direction <= DirectionWest) {
|
||||
LinearMoveUpdate(this);
|
||||
return;
|
||||
}
|
||||
this->direction = (this->direction - 1) & 0x1F;
|
||||
this->direction = (this->direction - 1) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
return;
|
||||
|
@ -2756,7 +2756,7 @@ static void sub_08073584(Entity* this) {
|
|||
gUnk_0200AF00.rActionPlayerState = R_ACTION_CANCEL;
|
||||
if (sub_0807A2F8(0)) {
|
||||
this->subAction++;
|
||||
this->direction = 4 * (this->animationState & 6);
|
||||
this->direction = 4 * (this->animationState & IdleWest);
|
||||
COLLISION_OFF(this);
|
||||
return;
|
||||
}
|
||||
|
@ -2766,21 +2766,23 @@ static void sub_08073584(Entity* this) {
|
|||
else
|
||||
this->speed = 0x80;
|
||||
|
||||
if ((gPlayerState.direction & 0x80) == 0) {
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0) {
|
||||
if (this->direction != gPlayerState.direction) {
|
||||
if (((this->direction - gPlayerState.direction) & 0x1F) < 0x10)
|
||||
if (((this->direction - gPlayerState.direction) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast |
|
||||
DirectionSouth | DirectionWest)) < DirectionSouth)
|
||||
*(u32*)&this->field_0x80 -= 0x20;
|
||||
else
|
||||
*(u32*)&this->field_0x80 += 0x20;
|
||||
}
|
||||
}
|
||||
this->direction = (*(u32*)&this->field_0x80 >> 8) & 0x1F;
|
||||
this->direction = (*(u32*)&this->field_0x80 >> 8) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
|
||||
UpdatePlayerMovement();
|
||||
state = 4 * this->animationState;
|
||||
dir = this->direction;
|
||||
if (this->animationState == 0) {
|
||||
state = (state + 8) & 0x1F;
|
||||
dir = (dir + 8) & 0x1F;
|
||||
dir = (dir + 8) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
|
||||
}
|
||||
|
||||
if (state - 7 > dir) {
|
||||
|
@ -2798,7 +2800,8 @@ static void sub_08073584(Entity* this) {
|
|||
this->animationState = state;
|
||||
idx = 0;
|
||||
state = gPlayerState.direction >> 2;
|
||||
if (!this->field_0x86.HALF.HI || ((gPlayerState.direction & 0x80) == 0 && this->animationState != state)) {
|
||||
if (!this->field_0x86.HALF.HI ||
|
||||
((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0 && this->animationState != state)) {
|
||||
static const u16 sAnims1[] = {
|
||||
0x0708,
|
||||
0x071C,
|
||||
|
@ -2806,7 +2809,7 @@ static void sub_08073584(Entity* this) {
|
|||
0x0714,
|
||||
};
|
||||
|
||||
if ((gPlayerState.direction & 0x80) == 0) {
|
||||
if ((gPlayerState.direction & DIR_NOT_MOVING_CHECK) == 0) {
|
||||
if (this->animationState != state) {
|
||||
if (this->animationState == (state ^ 4)) {
|
||||
idx = 2;
|
||||
|
@ -2890,7 +2893,7 @@ static void sub_0807380C(Entity* this) {
|
|||
};
|
||||
|
||||
if ((gRoomTransition.frameCount & 3) == 0) {
|
||||
u32 tmp = (this->animationState + 2) & 6;
|
||||
u32 tmp = (this->animationState + 2) & IdleWest;
|
||||
this->animationState = tmp;
|
||||
this->direction = 4 * tmp;
|
||||
}
|
||||
|
@ -2916,7 +2919,7 @@ void sub_08073884(Entity* this) {
|
|||
};
|
||||
|
||||
if ((gRoomTransition.frameCount & 1) == 0) {
|
||||
u32 tmp = (this->animationState + 2) & 6;
|
||||
u32 tmp = (this->animationState + 2) & IdleWest;
|
||||
this->animationState = tmp;
|
||||
this->direction = 4 * tmp;
|
||||
}
|
||||
|
@ -2940,10 +2943,10 @@ static void DoJump(Entity* this) {
|
|||
}
|
||||
|
||||
static void sub_08073924(Entity* this) {
|
||||
if ((gPlayerState.flags & PL_ROLLING) == 0 && (this->z.HALF.HI & 0x8000) && !gPlayerState.field_0xa) {
|
||||
if (!(gPlayerState.flags & PL_ROLLING) && (this->z.HALF.HI & 0x8000) && !gPlayerState.field_0xa) {
|
||||
gPlayerState.jump_status = 0x40;
|
||||
gPlayerState.direction = 0xff;
|
||||
this->direction = 0xff;
|
||||
gPlayerState.direction = DIR_NONE;
|
||||
this->direction = DIR_NONE;
|
||||
PutAwayItems();
|
||||
sub_08073968(this);
|
||||
}
|
||||
|
@ -2996,7 +2999,7 @@ static void sub_080739EC(Entity* this) {
|
|||
if ((gPlayerState.jump_status & 0x20) && this->zVelocity == 0) {
|
||||
this->zVelocity = Q_16_16(2.5);
|
||||
this->timer = 10;
|
||||
this->direction = 0xff;
|
||||
this->direction = DIR_NONE;
|
||||
gPlayerState.jump_status += 2;
|
||||
gPlayerState.animation = ANIM_DOWN_THRUST;
|
||||
ResetPlayerVelocity();
|
||||
|
@ -3171,7 +3174,7 @@ static void sub_08073D20(Entity* this) {
|
|||
UpdatePlayerMovement();
|
||||
} else {
|
||||
this->direction = gPlayerState.direction;
|
||||
if ((gPlayerState.direction & 0x80) == 0) {
|
||||
if (!(gPlayerState.direction & DIR_NOT_MOVING_CHECK)) {
|
||||
gPlayerState.framestate = PL_STATE_WALK;
|
||||
UpdatePlayerMovement();
|
||||
}
|
||||
|
@ -3427,7 +3430,7 @@ void SurfaceAction_14(Entity* this) {
|
|||
sub_08074808(this);
|
||||
spd = this->speed;
|
||||
this->speed = 0x300;
|
||||
this->direction = 16;
|
||||
this->direction = DirectionSouth;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
LinearMoveUpdate(this);
|
||||
this->speed = spd;
|
||||
|
|
|
@ -148,8 +148,9 @@ void PlayerItemBoomerang_Action2(PlayerItemBoomerangEntity* this) {
|
|||
bool32 uVar6;
|
||||
|
||||
sub_0801B804(this);
|
||||
if ((this->unk_68 == 12) && (this->unk_80 == 0) && ((gPlayerState.direction & 0x80) == 0)) {
|
||||
if (((this->unk_82.HALF.HI - gPlayerState.direction) & 0x1f) > 0x10) {
|
||||
if ((this->unk_68 == 12) && (this->unk_80 == 0) && !(gPlayerState.direction & DIR_NOT_MOVING_CHECK)) {
|
||||
if (((this->unk_82.HALF.HI - gPlayerState.direction) &
|
||||
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)) > DirectionSouth) {
|
||||
this->unk_82.HWORD += 0x40;
|
||||
this->unk_82.HALF.HI &= 0x1f;
|
||||
super->direction = this->unk_82.HALF.HI;
|
||||
|
|
|
@ -1490,7 +1490,7 @@ bool32 CheckQueuedAction(void) {
|
|||
// this doesnt seem to have any real function where its used
|
||||
void CheckPlayerVelocity(void) {
|
||||
u32 angle = gPlayerState.direction;
|
||||
if ((angle & 0x80) != 0) {
|
||||
if ((angle & DIR_NOT_MOVING_CHECK) != 0) {
|
||||
ResetPlayerVelocity();
|
||||
} else {
|
||||
gPlayerState.vel_x = gSineTable[angle * 8];
|
||||
|
@ -1753,7 +1753,7 @@ code_3:
|
|||
|
||||
void sub_08079520(Entity* this) {
|
||||
s32 tmp = gPlayerState.direction;
|
||||
if (tmp < 0x80) {
|
||||
if (tmp < DIR_NOT_MOVING_CHECK) {
|
||||
this->direction = gPlayerState.direction;
|
||||
} else {
|
||||
this->direction = (this->animationState >> 1) << 3;
|
||||
|
@ -1774,7 +1774,7 @@ bool32 sub_08079550(void) {
|
|||
if (gDiggingCaveEntranceTransition.isDiggingCave == 0) {
|
||||
if ((gPlayerState.dash_state == 0 || (gPlayerState.flags & PL_BURNING)) &&
|
||||
(gPlayerState.swim_state != 0 || (gPlayerState.sword_state & 0x40) ||
|
||||
gPlayerEntity.direction != gPlayerState.direction || (gPlayerEntity.direction & 0x80))) {
|
||||
gPlayerEntity.direction != gPlayerState.direction || (gPlayerEntity.direction & DIR_NOT_MOVING_CHECK))) {
|
||||
gPlayerEntity.subtimer = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2072,8 +2072,8 @@ bool32 sub_08079B24(void) {
|
|||
}
|
||||
if ((gPlayerState.jump_status & 0x41) == 0) {
|
||||
gPlayerState.jump_status = 0x41;
|
||||
gPlayerEntity.direction = 0xff;
|
||||
gPlayerState.direction = 0xff;
|
||||
gPlayerEntity.direction = DIR_NONE;
|
||||
gPlayerState.direction = DIR_NONE;
|
||||
return TRUE;
|
||||
} else {
|
||||
return TRUE;
|
||||
|
@ -2660,7 +2660,7 @@ bool32 sub_0807AC54(Entity* this) {
|
|||
this->action = 0x1d;
|
||||
this->subAction = 0;
|
||||
this->y.HALF.LO = 0;
|
||||
gPlayerState.animation = ANIM_CLIMB;
|
||||
gPlayerState.animation = ANIM_CLIMB1_UP;
|
||||
return TRUE;
|
||||
case SURFACE_AUTO_LADDER:
|
||||
this->x.HALF.HI = (this->x.HALF.HI & 0xfff0) | 8;
|
||||
|
@ -2750,7 +2750,7 @@ void PlayerUpdateSwimming(Entity* this) {
|
|||
ModHealth(-2);
|
||||
SoundReq(SFX_PLY_VO6);
|
||||
}
|
||||
if ((this->direction & 0x80) != 0) {
|
||||
if (this->direction & DIR_NOT_MOVING_CHECK) {
|
||||
if ((gRoomTransition.frameCount & 0xf) == 0) {
|
||||
CreateRandomWaterTrace(this, 4);
|
||||
}
|
||||
|
@ -2825,15 +2825,15 @@ u32 GetSwordBeam(void) {
|
|||
}
|
||||
|
||||
void sub_0807B068(Entity* entity) {
|
||||
if ((gPlayerState.dash_state | gPlayerState.attack_status) == 0) {
|
||||
if (gPlayerState.swim_state != 0) {
|
||||
if ((gPlayerState.swim_state & 0x80) != 0) {
|
||||
gPlayerState.animation = ANIM_C1C;
|
||||
if (!(gPlayerState.dash_state | gPlayerState.attack_status)) {
|
||||
if (gPlayerState.swim_state) {
|
||||
if (gPlayerState.swim_state & 0x80) {
|
||||
gPlayerState.animation = ANIM_DIVE_MINISH;
|
||||
} else {
|
||||
gPlayerState.animation = ANIM_SWIM_MINISH;
|
||||
}
|
||||
} else {
|
||||
if ((gPlayerState.direction & 0x80) != 0) {
|
||||
if (gPlayerState.direction & DIR_NOT_MOVING_CHECK) {
|
||||
if (gPlayerState.animation != ANIM_BOUNCE_MINISH) {
|
||||
gPlayerState.animation = ANIM_BOUNCE_MINISH;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ void sub_080A82D8(Entity* this) {
|
|||
this->action = 4;
|
||||
COLLISION_OFF(this);
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
this->direction ^= 0x10;
|
||||
this->direction ^= DirectionSouth;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ void FireProjectile_Init(Entity* this) {
|
|||
InitializeAnimation(this, this->direction >> 3);
|
||||
} else {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->direction >> 3 | 4);
|
||||
InitializeAnimation(this, this->direction >> 3 | IdleSouth);
|
||||
EnqueueSFX(SFX_15E);
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ void FireProjectile_Action1(Entity* this) {
|
|||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
if (this->timer != 0) {
|
||||
direction = parent->direction & 0x18;
|
||||
direction = parent->direction & DirectionWest;
|
||||
this->direction = direction;
|
||||
this->timer = 0;
|
||||
InitializeAnimation(this, direction >> 3);
|
||||
|
|
|
@ -264,7 +264,7 @@ void sub_080AC6F0(Entity* this) {
|
|||
u32 uVar4;
|
||||
u32 tmp;
|
||||
|
||||
uVar4 = this->direction & 0x1f;
|
||||
uVar4 = this->direction & (0x3 | DirectionNorthWest);
|
||||
uVar1 = this->direction >> 5;
|
||||
iVar3 = uVar1 * 3;
|
||||
tmp = gUnk_0812A9C0[this->animationState] - uVar1 * 3;
|
||||
|
|
|
@ -24,7 +24,7 @@ void IceProjectile_Init(Entity* this) {
|
|||
InitializeAnimation(this, this->direction >> 3);
|
||||
} else {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->direction >> 3 | 4);
|
||||
InitializeAnimation(this, this->direction >> 3 | IdleSouth);
|
||||
EnqueueSFX(SFX_160);
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ void IceProjectile_Action1(Entity* this) {
|
|||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
if (this->timer != 0) {
|
||||
direction = parent->direction & 0x18;
|
||||
direction = parent->direction & DirectionWest;
|
||||
this->direction = direction;
|
||||
this->timer = 0;
|
||||
InitializeAnimation(this, direction >> 3);
|
||||
|
|
|
@ -36,7 +36,7 @@ void V3TennisBallProjectile_OnCollision(Entity* this) {
|
|||
this->speed += 0x80 * 2;
|
||||
this->child = this->contactedEntity;
|
||||
if (sub_080ACB40(this)) {
|
||||
this->direction = 0;
|
||||
this->direction = DirectionNorth;
|
||||
} else {
|
||||
this->direction = this->knockbackDirection;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ void V3TennisBallProjectile_OnCollision(Entity* this) {
|
|||
|
||||
void V3TennisBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = 0x10;
|
||||
this->direction = DirectionSouth;
|
||||
this->z.HALF.HI = -4;
|
||||
this->child = NULL;
|
||||
InitializeAnimation(this, 7);
|
||||
|
|
|
@ -24,7 +24,7 @@ void WindProjectile_Init(Entity* this) {
|
|||
InitializeAnimation(this, this->direction >> 3);
|
||||
} else {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->direction >> 3 | 4);
|
||||
InitializeAnimation(this, this->direction >> 3 | IdleSouth);
|
||||
EnqueueSFX(SFX_15F);
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ void WindProjectile_Action1(Entity* this) {
|
|||
} else {
|
||||
if (this->spriteSettings.draw == 1) {
|
||||
CopyPosition(parent, this);
|
||||
direction = (parent->direction + 4) & 0x18;
|
||||
direction = (parent->direction + 4) & DirectionWest;
|
||||
if (this->timer != 0) {
|
||||
this->direction = direction;
|
||||
this->animationState = direction >> 2;
|
||||
|
|
Loading…
Reference in New Issue