summaryrefslogtreecommitdiff
path: root/src/projectile
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-05-21 15:36:50 +0300
committerTal Hayon <talhayon1@gmail.com>2022-05-21 15:36:50 +0300
commit6bb4086f60ccd5e5c39de1a2de2875cdc4d740fb (patch)
tree1b1cf8a1cd0197c14720cfa134c3fca7eb52fbb6 /src/projectile
parent74eaddb834871ee475e6f68d3a31786a2861a148 (diff)
Match sub_080AC6F0
Diffstat (limited to 'src/projectile')
-rw-r--r--src/projectile/gyorgTail.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/src/projectile/gyorgTail.c b/src/projectile/gyorgTail.c
index 41bc29f0..586c90bd 100644
--- a/src/projectile/gyorgTail.c
+++ b/src/projectile/gyorgTail.c
@@ -6,8 +6,6 @@
#include "projectile.h"
#include "hitbox.h"
-extern const u8 gUnk_0812A9C0[];
-
bool32 sub_080AC5E4(Entity*);
void sub_080AC388(Entity*);
void sub_080AC6F0(Entity*);
@@ -234,7 +232,57 @@ NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Enti
}
END_NONMATCH
-ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC6F0.inc", void sub_080AC6F0(Entity* this))
+void sub_080AC6F0(Entity* this) {
+ static const u8 gUnk_0812A9C0[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+
+ u32 uVar1;
+ s32 iVar2;
+ s32 iVar3;
+ u32 uVar4;
+ u32 tmp;
+
+ uVar4 = this->direction & 0x1f;
+ uVar1 = this->direction >> 5;
+ iVar3 = uVar1 * 3;
+ tmp = gUnk_0812A9C0[this->animationState] - uVar1 * 3;
+ if (tmp <= 3) {
+ switch (tmp) {
+ default:
+ if (uVar4 > 0x19) {
+ return;
+ }
+ break;
+ case 0:
+ if (uVar4 < 7) {
+ return;
+ }
+ break;
+ case 1:
+ if (uVar4 - 5 < 0xd) {
+ return;
+ }
+ break;
+ case 2:
+ if (uVar4 - 0xf < 0xd) {
+ return;
+ }
+ break;
+ }
+ }
+ iVar2 = iVar3 + 3;
+ if (uVar4 < 0x1b) {
+ iVar2 = iVar3 + 2;
+ if (uVar4 < 0x11) {
+ iVar2 = iVar3;
+ if (5 < uVar4) {
+ iVar2 = iVar3 + 1;
+ }
+ }
+ }
+ this->animationState = iVar2 % 0x18;
+ this->frameIndex = gUnk_0812A9C0[iVar2 % 0x18];
+}
void sub_080AC760(Entity* param_1) {
s32 tmp;
@@ -311,5 +359,3 @@ void sub_080AC884(Entity* this) {
this->subtimer = 0x56;
}
}
-
-const u8 gUnk_0812A9C0[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };