This commit is contained in:
theo3
2022-03-28 21:01:02 -07:00
parent 6000b4f2d3
commit 65b80571b2
41 changed files with 117 additions and 118 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
EnqueueSFX(SFX_132);
RequestPriorityDuration(super, 0x1e);
if (sub_08079F8C()) {
if (PlayerCanBeMoved()) {
gPlayerState.pushedObject = 0x98;
gPlayerState.queued_action = 5;
gPlayerState.flags |= PL_BUSY;
+3 -3
View File
@@ -211,9 +211,9 @@ void Bird_Type8(Entity* this) {
this->speed = 0x300;
}
if ((gPlayerEntity.flags & 0x80) != 0 && (gMessage.doTextBox & 0x7f) == 0 && gPlayerEntity.action != 28 &&
gPlayerEntity.action != 6 && gPlayerEntity.action != 9 && gPlayerState.framestate != 24 &&
gPlayerState.framestate != 11 && gPlayerState.framestate != 8 && sub_08079F8C() &&
if ((gPlayerEntity.flags & ENT_COLLIDE) && (gMessage.doTextBox & 0x7f) == 0 && gPlayerEntity.action != PLAYER_SLEEP &&
gPlayerEntity.action != PLAYER_BOUNCE && gPlayerEntity.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_PARACHUTE && PlayerCanBeMoved() &&
(EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe))) {
s32 z = gPlayerEntity.z.HALF.HI - this->z.HALF.HI - 8;
if ((u16)z < 0x20 && gPlayerEntity.health != 0) {
+1 -1
View File
@@ -58,7 +58,7 @@ void sub_08098BE0(BoardEntity* this) {
}
void sub_08098BE8(BoardEntity* this) {
if ((gPlayerState.flags & PL_MINISH) && sub_08098C30(this, &gPlayerEntity) && sub_08079F8C() &&
if ((gPlayerState.flags & PL_MINISH) && sub_08098C30(this, &gPlayerEntity) && PlayerCanBeMoved() &&
gPlayerEntity.z.HALF.HI == 0) {
gPlayerState.field_0x14 = 1;
sub_0807AAF8(&gPlayerEntity, this->tile);
+1 -1
View File
@@ -165,7 +165,7 @@ Entity* sub_08081D74(Entity* this) {
u32 sub_08081E0C(Entity* this) {
Entity* tmp = &gPlayerEntity;
if (tmp->z.HALF.HI != 0 || !sub_08079F8C()) {
if (tmp->z.HALF.HI != 0 || !PlayerCanBeMoved()) {
return 0;
} else {
return EntityInRectRadius(this, tmp, 5, 6);
+1 -1
View File
@@ -113,7 +113,7 @@ void sub_0809EE44(FanEntity* this) {
if (uVar4 != 0) {
pEVar1 = &gPlayerEntity;
if (sub_0809EF78(this, pEVar1)) {
if (sub_08079F8C()) {
if (PlayerCanBeMoved()) {
sub_08079E58(super->speed, super->direction);
}
}
+6 -6
View File
@@ -29,7 +29,7 @@ void sub_080860D8(FloatingPlatformEntity* this) {
super->frameIndex = super->type;
super->spritePriority.b0 = 7;
super->child = (Entity*)GetCurrentRoomProperty(super->type2);
sub_080A2CC0(super, (u16**)&super->child, &this->unk70);
UpdateRailMovement(super, (u16**)&super->child, &this->unk70);
}
void sub_0808611C(FloatingPlatformEntity* this) {
@@ -41,15 +41,15 @@ void sub_0808611C(FloatingPlatformEntity* this) {
super->parent->timer++;
}
sub_080A2BE4(super, iVar2);
SyncPlayerToPlatform(super, iVar2);
} else if (super->timer == 0) {
sub_080A2BE4(super, iVar2);
SyncPlayerToPlatform(super, iVar2);
} else {
sub_080A2BE4(super, FALSE);
SyncPlayerToPlatform(super, FALSE);
}
if (--this->unk70 == 0) {
sub_080A2CC0(super, (u16**)&super->child, &this->unk70);
UpdateRailMovement(super, (u16**)&super->child, &this->unk70);
}
}
@@ -58,7 +58,7 @@ bool32 sub_08086168(FloatingPlatformEntity* this) {
const u8* ptr;
ptr = gUnk_08120658 + super->type * 2;
if (((EntityInRectRadius(super, &gPlayerEntity, ptr[0], ptr[1])) && sub_08079F8C())) {
if (((EntityInRectRadius(super, &gPlayerEntity, ptr[0], ptr[1])) && PlayerCanBeMoved())) {
gPlayerState.field_0x14 = 1;
if (gPlayerEntity.z.HALF.HI == 0) {
return TRUE;
+2 -2
View File
@@ -225,7 +225,7 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) {
}
this->unk_6c = 0;
gRoomTransition.field_0x39 = 0;
if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) {
if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
super->action = 9;
super->timer = 0;
super->subtimer = 0xF0;
@@ -479,7 +479,7 @@ u32 sub_080A20B8(GyorgBossObjectEntity* this, GyorgMaleEntity* other) {
if (other == NULL) {
return 1;
}
if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) {
if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
return other->unk_7c == 0 && gPlayerState.field_0x14 != 0;
}
return 0;
+6 -6
View File
@@ -18,11 +18,11 @@ typedef struct {
/*0x72*/ u16 wobbleTime; /**< Time the player can stand on the platform. */
/*0x74*/ u16 respawnTime; /**< Time until the platform respawns after it has sunk. */
/*0x76*/ u16 unk_76;
/*0x78*/ Entity* unk_78; // Typed same as second argument of sub_080A2CC0
/*0x78*/ Entity* unk_78; // Typed same as second argument of UpdateRailMovement
} LavaPlatformEntity;
typedef struct {
/*0x00*/ Entity* unk_78; // Typed same as second argument of sub_080A2CC0
/*0x00*/ Entity* unk_78; // Typed same as second argument of UpdateRailMovement
/*0x04*/ s16 x;
/*0x06*/ s16 y;
/*0x08*/ u8 collisionLayer;
@@ -246,7 +246,7 @@ void LavaPlatform_SpawnPlatforms(LavaPlatformEntity* this) {
platform->respawnTime = entry->respawnTime;
platform->unk_78 = entry->unk_78;
UpdateSpriteForCollisionLayer((Entity*)platform);
sub_080A2CC0(&platform->base, (u16**)&platform->unk_78, &platform->unk_76);
UpdateRailMovement(&platform->base, (u16**)&platform->unk_78, &platform->unk_76);
}
entry++;
}
@@ -282,7 +282,7 @@ void sub_0809264C(LavaPlatformEntity* this) {
bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) {
if ((gPlayerState.flags & PL_MINISH) == 0 && EntityInRectRadius(super, &gPlayerEntity, 0x10, 0x10) &&
sub_08079F8C()) {
PlayerCanBeMoved()) {
gPlayerState.field_0x14 = 1;
if (gPlayerEntity.z.HALF.HI == 0) {
super->subtimer = 1;
@@ -294,12 +294,12 @@ bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) {
}
void sub_080926E4(LavaPlatformEntity* this) {
sub_080A2BE4(super, super->subtimer);
SyncPlayerToPlatform(super, super->subtimer);
if (super->action == 1) {
(super->parent)->x.HALF.HI = super->x.HALF.HI;
(super->parent)->y.HALF.HI = super->y.HALF.HI;
}
if (--this->unk_76 == 0) {
sub_080A2CC0(super, (u16**)&this->unk_78, &this->unk_76);
UpdateRailMovement(super, (u16**)&this->unk_78, &this->unk_76);
}
}
+2 -2
View File
@@ -65,7 +65,7 @@ void sub_0809EAD8(Entity* this) {
if (this->type2 != 0) {
this->child = GetCurrentRoomProperty(this->type2);
sub_080A2CC0(this, (u16**)&this->child, &this->field_0x74.HWORD);
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD);
} else {
SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer);
@@ -82,7 +82,7 @@ void sub_0809EB30(Entity* this) {
}
puVar2 = &this->field_0x74.HWORD;
if (!--*puVar2) {
sub_080A2CC0(this, (u16**)&this->child, puVar2);
UpdateRailMovement(this, (u16**)&this->child, puVar2);
}
}
}
+6 -6
View File
@@ -4,7 +4,7 @@
extern u16 gUnk_08123318[];
static void sub_08097B24(Entity* this);
static bool32 sub_08097ADC(Entity* this);
static bool32 CheckMovePlayer(Entity* this);
void LilypadSmall(Entity* this) {
u32 rand;
@@ -19,22 +19,22 @@ void LilypadSmall(Entity* this) {
this->spriteSettings.draw = TRUE;
this->spritePriority.b0 = 7;
this->child = GetCurrentRoomProperty(this->type2);
sub_080A2CC0(this, (u16**)&this->child, &this->field_0x70.HALF.LO);
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x70.HALF.LO);
}
sub_080A2BE4(this, sub_08097ADC(this));
SyncPlayerToPlatform(this, CheckMovePlayer(this));
sub_08097B24(this);
psVar4 = (u16*)&this->field_0x70;
if (--*psVar4 == 0) {
sub_080A2CC0(this, (u16**)&this->child, psVar4);
UpdateRailMovement(this, (u16**)&this->child, psVar4);
}
}
static bool32 sub_08097ADC(Entity* this) {
static bool32 CheckMovePlayer(Entity* this) {
if (!(gPlayerState.flags & PL_MINISH)) {
return FALSE;
} else if (EntityInRectRadius(this, &gPlayerEntity, 8, 8) == 0) {
return FALSE;
} else if (!sub_08079F8C()) {
} else if (!PlayerCanBeMoved()) {
return FALSE;
} else {
gPlayerState.field_0x14 = 1;
+2 -2
View File
@@ -48,7 +48,7 @@ void sub_0809E360(Object98Entity* this) {
SetDefaultPriority(super, 0);
if (super->type != 0) {
super->child = (Entity*)GetCurrentRoomProperty(super->type);
sub_080A2CC0(super, (u16**)&super->child, &this->unk74);
UpdateRailMovement(super, (u16**)&super->child, &this->unk74);
}
}
}
@@ -62,7 +62,7 @@ void sub_0809E3E4(Object98Entity* this) {
}
if (--this->unk74 == 0) {
sub_080A2CC0(super, (u16**)&super->child, &this->unk74);
UpdateRailMovement(super, (u16**)&super->child, &this->unk74);
}
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_16A);
RequestPriorityDuration(super, 0x1e);
if (sub_08079F8C()) {
if (PlayerCanBeMoved()) {
gPlayerState.pushedObject = 0x90;
gPlayerState.queued_action = 5;
gPlayerState.flags |= PL_BUSY;
+1 -1
View File
@@ -205,7 +205,7 @@ void sub_0808B73C(Entity* this) {
u32 sub_0808B7C8(Entity* this) {
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE && gPlayerEntity.health != 0 &&
sub_08079F8C() && EntityInRectRadius(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) {
PlayerCanBeMoved() && EntityInRectRadius(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) {
if (this->timer == 0 && gPlayerEntity.action == PLAYER_08072C9C) {
ResetPlayerAnimationAndAction();
}