summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-11-06 10:19:26 +0000
committeroctorock <79596758+octorock@users.noreply.github.com>2022-11-06 10:19:26 +0000
commit4f1f2f280e6df4a469e1b066d73ea827be33dc05 (patch)
treedca8c38534518f8515a61e913a6ae1778c69530b /src
parent582831dac29aa6fdf896bd26cb70afdc15e1f0f5 (diff)
Match sub_0803086C
Diffstat (limited to 'src')
-rw-r--r--src/enemy/armos.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index 7e0c3b7a..38a30371 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -413,7 +413,43 @@ void sub_08030834(ArmosEntity* this) {
SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
-ASM_FUNC("asm/non_matching/armos/sub_0803086C.inc", bool32 sub_0803086C(ArmosEntity* this))
+bool32 sub_0803086C(ArmosEntity* this) {
+ u32 uVar2;
+ u32 pos;
+ u32 pos2;
+ u16 centerY;
+ u16 centerX;
+ FORCE_REGISTER(u32 r2, r2);
+
+ if (this->unk_7c != NULL) {
+ if ((gPlayerState.flags & 0x80) != 0) {
+ centerX = super->x.HALF_U.HI - gRoomControls.origin_x;
+ centerY = super->y.HALF_U.HI - gRoomControls.origin_y;
+ // TODO for some reason the 0x3f of COORD_TO_TILE(super) needs to be forced to r2 here.
+ pos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
+ (((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);
+
+ if (GetTileType(pos, super->collisionLayer) == 0x4049) {
+ if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
+ if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) {
+ gPlayerEntity.spritePriority.b0 = 3;
+ DoExitTransition(this->unk_7c);
+ gRoomTransition.armos_data.field_0xae = this->unk_80;
+ return TRUE;
+ }
+ } else {
+ SetTile(0x4022, pos, super->collisionLayer);
+ }
+ } else {
+ if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
+ SetTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
+ }
+ }
+ }
+ super->spritePriority.b0 = 4;
+ }
+ return FALSE;
+}
void sub_080309A8(ArmosEntity* this) {
GetNextFrame(super);